Skip to main content

uarp_sdk/generated/
models.rs

1// Code generated by @uarp/codegen from spec/openapi.json. DO NOT EDIT.
2//!
3//! Data models for UARP — Universal Agent Runtime Platform (spec version 0.4.0).
4
5#![allow(unused_imports, clippy::large_enum_variant)]
6
7use std::collections::HashMap;
8
9use serde::{Deserialize, Serialize};
10
11use crate::multipart::FilePart;
12
13/// `A2ajsonRpcRequest` model.
14#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15pub struct A2ajsonRpcRequest {
16    /// Always `2.0`.
17    pub jsonrpc: String,
18    pub method: A2ajsonRpcRequestMethod,
19    #[serde(default, skip_serializing_if = "Option::is_none")]
20    pub params: Option<serde_json::Map<String, serde_json::Value>>,
21    #[serde(default, skip_serializing_if = "Option::is_none")]
22    pub id: Option<serde_json::Value>,
23}
24
25/// `A2ajsonRpcRequestMethod` enumeration.
26#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
27pub enum A2ajsonRpcRequestMethod {
28    #[default]
29    #[serde(rename = "tasks/send")]
30    TasksSend,
31    #[serde(rename = "tasks/sendSubscribe")]
32    TasksSendSubscribe,
33    #[serde(rename = "tasks/get")]
34    TasksGet,
35    #[serde(rename = "tasks/cancel")]
36    TasksCancel,
37    #[serde(rename = "tasks/pushNotification/set")]
38    TasksPushNotificationSet,
39    #[serde(rename = "tasks/pushNotification/get")]
40    TasksPushNotificationGet,
41    /// A value the API introduced after this SDK was generated.
42    #[serde(untagged)]
43    Other(String),
44}
45
46impl A2ajsonRpcRequestMethod {
47    /// The value as it appears on the wire.
48    pub fn as_str(&self) -> &str {
49        match self {
50            Self::TasksSend => "tasks/send",
51            Self::TasksSendSubscribe => "tasks/sendSubscribe",
52            Self::TasksGet => "tasks/get",
53            Self::TasksCancel => "tasks/cancel",
54            Self::TasksPushNotificationSet => "tasks/pushNotification/set",
55            Self::TasksPushNotificationGet => "tasks/pushNotification/get",
56            Self::Other(value) => value.as_str(),
57        }
58    }
59}
60
61impl std::fmt::Display for A2ajsonRpcRequestMethod {
62    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
63        f.write_str(self.as_str())
64    }
65}
66
67impl From<&str> for A2ajsonRpcRequestMethod {
68    fn from(value: &str) -> Self {
69        match value {
70            "tasks/send" => Self::TasksSend,
71            "tasks/sendSubscribe" => Self::TasksSendSubscribe,
72            "tasks/get" => Self::TasksGet,
73            "tasks/cancel" => Self::TasksCancel,
74            "tasks/pushNotification/set" => Self::TasksPushNotificationSet,
75            "tasks/pushNotification/get" => Self::TasksPushNotificationGet,
76            other => Self::Other(other.to_string()),
77        }
78    }
79}
80
81/// `A2ATask` model.
82#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
83pub struct A2ATask {
84    pub id: String,
85    #[serde(default, skip_serializing_if = "Option::is_none")]
86    pub agent_id: Option<String>,
87    #[serde(default, skip_serializing_if = "Option::is_none")]
88    pub session_id: Option<String>,
89    pub status: A2ATaskStatus,
90    pub messages: Vec<A2ATaskMessage>,
91    pub artifacts: Vec<A2ATaskArtifact>,
92    pub metadata: serde_json::Map<String, serde_json::Value>,
93    #[serde(default, skip_serializing_if = "Option::is_none")]
94    pub created_at: Option<String>,
95    #[serde(default, skip_serializing_if = "Option::is_none")]
96    pub updated_at: Option<String>,
97}
98
99/// `A2ATaskArtifact` model.
100#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
101pub struct A2ATaskArtifact {
102    pub name: String,
103    #[serde(default, skip_serializing_if = "Option::is_none")]
104    pub description: Option<String>,
105    pub parts: Vec<serde_json::Map<String, serde_json::Value>>,
106    pub index: i64,
107}
108
109/// `A2ATaskMessage` model.
110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
111pub struct A2ATaskMessage {
112    pub role: A2ATaskMessageRole,
113    pub parts: Vec<serde_json::Map<String, serde_json::Value>>,
114}
115
116/// `A2ATaskMessageRole` enumeration.
117#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
118pub enum A2ATaskMessageRole {
119    #[default]
120    #[serde(rename = "user")]
121    User,
122    #[serde(rename = "agent")]
123    Agent,
124    /// A value the API introduced after this SDK was generated.
125    #[serde(untagged)]
126    Other(String),
127}
128
129impl A2ATaskMessageRole {
130    /// The value as it appears on the wire.
131    pub fn as_str(&self) -> &str {
132        match self {
133            Self::User => "user",
134            Self::Agent => "agent",
135            Self::Other(value) => value.as_str(),
136        }
137    }
138}
139
140impl std::fmt::Display for A2ATaskMessageRole {
141    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
142        f.write_str(self.as_str())
143    }
144}
145
146impl From<&str> for A2ATaskMessageRole {
147    fn from(value: &str) -> Self {
148        match value {
149            "user" => Self::User,
150            "agent" => Self::Agent,
151            other => Self::Other(other.to_string()),
152        }
153    }
154}
155
156/// `A2ATaskStatus` enumeration.
157#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
158pub enum A2ATaskStatus {
159    #[default]
160    #[serde(rename = "submitted")]
161    Submitted,
162    #[serde(rename = "working")]
163    Working,
164    #[serde(rename = "input-required")]
165    InputRequired,
166    #[serde(rename = "completed")]
167    Completed,
168    #[serde(rename = "canceled")]
169    Canceled,
170    #[serde(rename = "failed")]
171    Failed,
172    /// A value the API introduced after this SDK was generated.
173    #[serde(untagged)]
174    Other(String),
175}
176
177impl A2ATaskStatus {
178    /// The value as it appears on the wire.
179    pub fn as_str(&self) -> &str {
180        match self {
181            Self::Submitted => "submitted",
182            Self::Working => "working",
183            Self::InputRequired => "input-required",
184            Self::Completed => "completed",
185            Self::Canceled => "canceled",
186            Self::Failed => "failed",
187            Self::Other(value) => value.as_str(),
188        }
189    }
190}
191
192impl std::fmt::Display for A2ATaskStatus {
193    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
194        f.write_str(self.as_str())
195    }
196}
197
198impl From<&str> for A2ATaskStatus {
199    fn from(value: &str) -> Self {
200        match value {
201            "submitted" => Self::Submitted,
202            "working" => Self::Working,
203            "input-required" => Self::InputRequired,
204            "completed" => Self::Completed,
205            "canceled" => Self::Canceled,
206            "failed" => Self::Failed,
207            other => Self::Other(other.to_string()),
208        }
209    }
210}
211
212/// After-action review, built once when the mission reaches a terminal status.
213/// `failure_analysis` is present only when something failed.
214#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
215pub struct Aar {
216    pub aar_id: String,
217    pub mission_id: String,
218    pub tenant_id: String,
219    pub created_at: String,
220    pub outcome: MissionOutcome,
221    pub phases: Vec<AarPhaseRecord>,
222    pub objective_outcomes: Vec<AarObjectiveOutcome>,
223    #[serde(default, skip_serializing_if = "Option::is_none")]
224    pub failure_analysis: Option<AarFailureAnalysis>,
225}
226
227/// `AarFailureAnalysis` model.
228#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
229pub struct AarFailureAnalysis {
230    pub failed_objective_ids: Vec<String>,
231    pub root_causes: Vec<AarRootCause>,
232    pub lessons: Vec<AarLesson>,
233}
234
235/// A pattern seen in this mission and what to do about it next time.
236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
237pub struct AarLesson {
238    pub pattern: String,
239    pub recommendation: String,
240}
241
242/// `AarObjectiveOutcome` model.
243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
244pub struct AarObjectiveOutcome {
245    pub objective_id: String,
246    /// The objective's status when the mission ended.
247    pub final_status: String,
248    /// Retries spent on this objective before it settled.
249    pub strikes_used: i64,
250    #[serde(default, skip_serializing_if = "Option::is_none")]
251    pub final_agent_id: Option<String>,
252    #[serde(default, skip_serializing_if = "Option::is_none")]
253    pub final_model: Option<String>,
254    #[serde(default, skip_serializing_if = "Option::is_none")]
255    pub duration_ms: Option<i64>,
256    #[serde(default, skip_serializing_if = "Option::is_none")]
257    pub cost_usd: Option<f64>,
258    /// Whether the success criteria were checked and held.
259    pub verified: bool,
260}
261
262/// `AarPhaseRecord` model.
263#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
264pub struct AarPhaseRecord {
265    pub phase: AarPhaseRecordPhase,
266    pub started_at: String,
267    pub completed_at: String,
268    pub duration_ms: i64,
269}
270
271/// `AarPhaseRecordPhase` enumeration.
272#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
273pub enum AarPhaseRecordPhase {
274    #[default]
275    #[serde(rename = "recon")]
276    Recon,
277    #[serde(rename = "plan")]
278    Plan,
279    #[serde(rename = "authorize")]
280    Authorize,
281    #[serde(rename = "execute")]
282    Execute,
283    #[serde(rename = "verify")]
284    Verify,
285    /// A value the API introduced after this SDK was generated.
286    #[serde(untagged)]
287    Other(String),
288}
289
290impl AarPhaseRecordPhase {
291    /// The value as it appears on the wire.
292    pub fn as_str(&self) -> &str {
293        match self {
294            Self::Recon => "recon",
295            Self::Plan => "plan",
296            Self::Authorize => "authorize",
297            Self::Execute => "execute",
298            Self::Verify => "verify",
299            Self::Other(value) => value.as_str(),
300        }
301    }
302}
303
304impl std::fmt::Display for AarPhaseRecordPhase {
305    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
306        f.write_str(self.as_str())
307    }
308}
309
310impl From<&str> for AarPhaseRecordPhase {
311    fn from(value: &str) -> Self {
312        match value {
313            "recon" => Self::Recon,
314            "plan" => Self::Plan,
315            "authorize" => Self::Authorize,
316            "execute" => Self::Execute,
317            "verify" => Self::Verify,
318            other => Self::Other(other.to_string()),
319        }
320    }
321}
322
323/// `AarRootCause` model.
324#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
325pub struct AarRootCause {
326    pub objective_id: String,
327    pub category: AarRootCauseCategory,
328    pub details: String,
329}
330
331/// `AarRootCauseCategory` enumeration.
332#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
333pub enum AarRootCauseCategory {
334    #[default]
335    #[serde(rename = "llm_timeout")]
336    LLMTimeout,
337    #[serde(rename = "llm_idle")]
338    LLMIdle,
339    #[serde(rename = "llm_loop")]
340    LLMLoop,
341    #[serde(rename = "tool_error")]
342    ToolError,
343    #[serde(rename = "tool_truncation")]
344    ToolTruncation,
345    #[serde(rename = "verification_failed")]
346    VerificationFailed,
347    #[serde(rename = "authorization_denied")]
348    AuthorizationDenied,
349    #[serde(rename = "external_error")]
350    ExternalError,
351    #[serde(rename = "max_duration_exceeded")]
352    MaxDurationExceeded,
353    #[serde(rename = "unknown")]
354    Unknown,
355    /// A value the API introduced after this SDK was generated.
356    #[serde(untagged)]
357    Other(String),
358}
359
360impl AarRootCauseCategory {
361    /// The value as it appears on the wire.
362    pub fn as_str(&self) -> &str {
363        match self {
364            Self::LLMTimeout => "llm_timeout",
365            Self::LLMIdle => "llm_idle",
366            Self::LLMLoop => "llm_loop",
367            Self::ToolError => "tool_error",
368            Self::ToolTruncation => "tool_truncation",
369            Self::VerificationFailed => "verification_failed",
370            Self::AuthorizationDenied => "authorization_denied",
371            Self::ExternalError => "external_error",
372            Self::MaxDurationExceeded => "max_duration_exceeded",
373            Self::Unknown => "unknown",
374            Self::Other(value) => value.as_str(),
375        }
376    }
377}
378
379impl std::fmt::Display for AarRootCauseCategory {
380    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
381        f.write_str(self.as_str())
382    }
383}
384
385impl From<&str> for AarRootCauseCategory {
386    fn from(value: &str) -> Self {
387        match value {
388            "llm_timeout" => Self::LLMTimeout,
389            "llm_idle" => Self::LLMIdle,
390            "llm_loop" => Self::LLMLoop,
391            "tool_error" => Self::ToolError,
392            "tool_truncation" => Self::ToolTruncation,
393            "verification_failed" => Self::VerificationFailed,
394            "authorization_denied" => Self::AuthorizationDenied,
395            "external_error" => Self::ExternalError,
396            "max_duration_exceeded" => Self::MaxDurationExceeded,
397            "unknown" => Self::Unknown,
398            other => Self::Other(other.to_string()),
399        }
400    }
401}
402
403/// `AbortMissionRequest` model.
404#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
405pub struct AbortMissionRequest {
406    /// Recorded on the mission; blank or missing is fine.
407    #[serde(default, skip_serializing_if = "Option::is_none")]
408    pub reason: Option<String>,
409}
410
411/// `AcceptInviteFromPickerRequest` model.
412#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
413pub struct AcceptInviteFromPickerRequest {
414    /// The invite secret, echoed to the picker by `GET /api/v1/me/tenants`. Compared in constant
415    /// time. Defence in depth rather than the primary gate — the email match is that — and it
416    /// catches the class where the listing ever shows an invite not addressed to the caller.
417    /// Invites created before secrets exist accept without one.
418    #[serde(default, skip_serializing_if = "Option::is_none")]
419    pub token: Option<String>,
420    /// Display name for the new member. Omitted, the local part of the invited email is used.
421    #[serde(default, skip_serializing_if = "Option::is_none")]
422    pub name: Option<String>,
423}
424
425/// `AcceptInviteFromPickerResponse` model.
426#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
427pub struct AcceptInviteFromPickerResponse {
428    pub accepted: bool,
429    pub tenant_id: String,
430    pub user_id: String,
431    pub role: String,
432}
433
434/// `AcceptInviteRequest` model.
435#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
436pub struct AcceptInviteRequest {
437    /// Display name. Omitted, the local part of the invited email is used.
438    #[serde(default, skip_serializing_if = "Option::is_none")]
439    pub name: Option<String>,
440    /// The invite secret from the email link's `?t=`, forwarded in the body.
441    #[serde(default, skip_serializing_if = "Option::is_none")]
442    pub token: Option<String>,
443}
444
445/// `AcceptInviteResponse` model.
446#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
447pub struct AcceptInviteResponse {
448    pub accepted: bool,
449    pub user_id: String,
450    pub tenant_id: String,
451    pub role: String,
452}
453
454/// The JSON form of an account export. The same bundle the zip contains, as one document.
455#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
456pub struct AccountExport {
457    pub format: AccountExportFormat,
458    pub exported_at: String,
459    pub counts: AccountExportCounts,
460    /// False when a size ceiling was hit; `omitted` then says what was left out. An export that
461    /// quietly drops things is worse than one that admits it.
462    pub complete: bool,
463    pub omitted: Vec<String>,
464    /// Path inside the bundle → its contents (`account.json`, `projects.md`, `memory.md`,
465    /// `chats/…`).
466    pub files: serde_json::Map<String, serde_json::Value>,
467}
468
469/// `AccountExportCounts` model.
470#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
471pub struct AccountExportCounts {
472    pub chats: i64,
473    pub projects: i64,
474    pub memories: i64,
475}
476
477/// `AccountExportFormat` enumeration.
478#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
479pub enum AccountExportFormat {
480    #[default]
481    #[serde(rename = "snaga.export.v1")]
482    SnagaExportV1,
483    /// A value the API introduced after this SDK was generated.
484    #[serde(untagged)]
485    Other(String),
486}
487
488impl AccountExportFormat {
489    /// The value as it appears on the wire.
490    pub fn as_str(&self) -> &str {
491        match self {
492            Self::SnagaExportV1 => "snaga.export.v1",
493            Self::Other(value) => value.as_str(),
494        }
495    }
496}
497
498impl std::fmt::Display for AccountExportFormat {
499    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
500        f.write_str(self.as_str())
501    }
502}
503
504impl From<&str> for AccountExportFormat {
505    fn from(value: &str) -> Self {
506        match value {
507            "snaga.export.v1" => Self::SnagaExportV1,
508            other => Self::Other(other.to_string()),
509        }
510    }
511}
512
513/// `ActivateSafeModeRequest` model.
514#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
515pub struct ActivateSafeModeRequest {
516    pub reason: String,
517    #[serde(default, skip_serializing_if = "Option::is_none")]
518    pub activated_by: Option<String>,
519    #[serde(default, skip_serializing_if = "Option::is_none")]
520    pub deadline_hours: Option<f64>,
521}
522
523/// `ActivateSessionBranchResponse` model.
524#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
525pub struct ActivateSessionBranchResponse {
526    pub session_id: String,
527    pub active_branch: String,
528}
529
530/// `ActiveSession` model.
531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
532pub struct ActiveSession {
533    pub key_id: String,
534    pub name: String,
535    pub prefix: String,
536    pub scopes: Vec<String>,
537    pub status: APIKeySummaryStatus,
538    pub is_current: bool,
539    #[serde(default, skip_serializing_if = "Option::is_none")]
540    pub created_at: Option<String>,
541    #[serde(default, skip_serializing_if = "Option::is_none")]
542    pub expires_at: Option<String>,
543    #[serde(default, skip_serializing_if = "Option::is_none")]
544    pub last_used_at: Option<String>,
545}
546
547/// `AddAndroidTestersRequest` model.
548#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
549pub struct AddAndroidTestersRequest {
550    pub emails: Vec<String>,
551    /// Server default: `"admin"`.
552    #[serde(default, skip_serializing_if = "Option::is_none")]
553    pub source: Option<String>,
554}
555
556/// `AddAndroidTestersResponse` model.
557#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
558pub struct AddAndroidTestersResponse {
559    pub added: Vec<String>,
560    pub already: Vec<String>,
561    pub invalid: Vec<String>,
562}
563
564/// `AddSquadGraphEdgeRequest` model.
565#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
566pub struct AddSquadGraphEdgeRequest {
567    pub from: String,
568    pub to: String,
569    pub r#type: TeamGraphEdgeType,
570    #[serde(default, skip_serializing_if = "Option::is_none")]
571    pub task_id: Option<String>,
572}
573
574/// `AddSquadGraphNodeRequest` model.
575#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
576pub struct AddSquadGraphNodeRequest {
577    pub agent_id: String,
578    pub role: TeamGraphNodeRole,
579    #[serde(default, skip_serializing_if = "Option::is_none")]
580    pub spawned_by: Option<String>,
581    #[serde(default, skip_serializing_if = "Option::is_none")]
582    pub goal_summary: Option<String>,
583}
584
585/// `AddTeamGraphEdgeRequest` model.
586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
587pub struct AddTeamGraphEdgeRequest {
588    pub from: String,
589    pub to: String,
590    pub r#type: TeamGraphEdgeType,
591    #[serde(default, skip_serializing_if = "Option::is_none")]
592    pub task_id: Option<String>,
593}
594
595/// `AddTeamGraphNodeRequest` model.
596#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
597pub struct AddTeamGraphNodeRequest {
598    pub agent_id: String,
599    pub role: TeamGraphNodeRole,
600    #[serde(default, skip_serializing_if = "Option::is_none")]
601    pub spawned_by: Option<String>,
602    #[serde(default, skip_serializing_if = "Option::is_none")]
603    pub goal_summary: Option<String>,
604}
605
606/// `AdminAnalyticsEventsResponse` model.
607#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
608pub struct AdminAnalyticsEventsResponse {
609    pub items: Vec<AdminAnalyticsEventsResponseItem>,
610    pub count: i64,
611}
612
613/// `AdminAnalyticsEventsResponseItem` model.
614#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
615pub struct AdminAnalyticsEventsResponseItem {
616    #[serde(default, skip_serializing_if = "Option::is_none")]
617    pub event_id: Option<String>,
618    #[serde(default, skip_serializing_if = "Option::is_none")]
619    pub ts: Option<String>,
620    #[serde(default, skip_serializing_if = "Option::is_none")]
621    pub r#type: Option<String>,
622    #[serde(default, skip_serializing_if = "Option::is_none")]
623    pub visitor_id: Option<String>,
624    #[serde(default, skip_serializing_if = "Option::is_none")]
625    pub tenant_id: Option<String>,
626    #[serde(default, skip_serializing_if = "Option::is_none")]
627    pub country: Option<String>,
628    #[serde(default, skip_serializing_if = "Option::is_none")]
629    pub device_type: Option<AdminAnalyticsEventsResponseItemDeviceType>,
630    #[serde(default, skip_serializing_if = "Option::is_none")]
631    pub browser: Option<String>,
632    #[serde(default, skip_serializing_if = "Option::is_none")]
633    pub os: Option<String>,
634    #[serde(default, skip_serializing_if = "Option::is_none")]
635    pub language: Option<String>,
636    #[serde(default, skip_serializing_if = "Option::is_none")]
637    pub referrer_host: Option<String>,
638    #[serde(default, skip_serializing_if = "Option::is_none")]
639    pub path: Option<String>,
640    #[serde(default, skip_serializing_if = "Option::is_none")]
641    pub utm_source: Option<String>,
642    #[serde(default, skip_serializing_if = "Option::is_none")]
643    pub utm_medium: Option<String>,
644    #[serde(default, skip_serializing_if = "Option::is_none")]
645    pub utm_campaign: Option<String>,
646    #[serde(default, skip_serializing_if = "Option::is_none")]
647    pub ip_hash: Option<String>,
648}
649
650/// `AdminAnalyticsEventsResponseItemDeviceType` enumeration.
651#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
652pub enum AdminAnalyticsEventsResponseItemDeviceType {
653    #[default]
654    #[serde(rename = "mobile")]
655    Mobile,
656    #[serde(rename = "tablet")]
657    Tablet,
658    #[serde(rename = "desktop")]
659    Desktop,
660    #[serde(rename = "bot")]
661    Bot,
662    #[serde(rename = "unknown")]
663    Unknown,
664    /// A value the API introduced after this SDK was generated.
665    #[serde(untagged)]
666    Other(String),
667}
668
669impl AdminAnalyticsEventsResponseItemDeviceType {
670    /// The value as it appears on the wire.
671    pub fn as_str(&self) -> &str {
672        match self {
673            Self::Mobile => "mobile",
674            Self::Tablet => "tablet",
675            Self::Desktop => "desktop",
676            Self::Bot => "bot",
677            Self::Unknown => "unknown",
678            Self::Other(value) => value.as_str(),
679        }
680    }
681}
682
683impl std::fmt::Display for AdminAnalyticsEventsResponseItemDeviceType {
684    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
685        f.write_str(self.as_str())
686    }
687}
688
689impl From<&str> for AdminAnalyticsEventsResponseItemDeviceType {
690    fn from(value: &str) -> Self {
691        match value {
692            "mobile" => Self::Mobile,
693            "tablet" => Self::Tablet,
694            "desktop" => Self::Desktop,
695            "bot" => Self::Bot,
696            "unknown" => Self::Unknown,
697            other => Self::Other(other.to_string()),
698        }
699    }
700}
701
702/// `AdminAnalyticsOverviewResponse` model.
703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
704pub struct AdminAnalyticsOverviewResponse {
705    #[serde(default, skip_serializing_if = "Option::is_none")]
706    pub range: Option<AdminAnalyticsOverviewResponseRange>,
707    #[serde(default, skip_serializing_if = "Option::is_none")]
708    pub totals: Option<AdminAnalyticsOverviewResponseTotals>,
709    #[serde(default, skip_serializing_if = "Option::is_none")]
710    pub unique_visitors_30d: Option<i64>,
711    #[serde(default, skip_serializing_if = "Option::is_none")]
712    pub signups_30d: Option<i64>,
713    #[serde(default, skip_serializing_if = "Option::is_none")]
714    pub conversion_rate: Option<f64>,
715    #[serde(default, skip_serializing_if = "Option::is_none")]
716    pub timeseries: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
717    #[serde(default, skip_serializing_if = "Option::is_none")]
718    pub top_countries: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
719    #[serde(default, skip_serializing_if = "Option::is_none")]
720    pub top_devices: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
721    #[serde(default, skip_serializing_if = "Option::is_none")]
722    pub top_browsers: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
723    #[serde(default, skip_serializing_if = "Option::is_none")]
724    pub top_referrers: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
725    #[serde(default, skip_serializing_if = "Option::is_none")]
726    pub top_utm_sources: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
727}
728
729/// `AdminAnalyticsOverviewResponseRange` model.
730#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
731pub struct AdminAnalyticsOverviewResponseRange {
732    #[serde(default, skip_serializing_if = "Option::is_none")]
733    pub from: Option<String>,
734    #[serde(default, skip_serializing_if = "Option::is_none")]
735    pub to: Option<String>,
736    #[serde(default, skip_serializing_if = "Option::is_none")]
737    pub days: Option<i64>,
738}
739
740/// `AdminAnalyticsOverviewResponseTotals` model.
741#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
742pub struct AdminAnalyticsOverviewResponseTotals {
743    #[serde(default, skip_serializing_if = "Option::is_none")]
744    pub landing_visit: Option<i64>,
745    #[serde(default, skip_serializing_if = "Option::is_none")]
746    pub page_view: Option<i64>,
747    #[serde(default, skip_serializing_if = "Option::is_none")]
748    pub signup: Option<i64>,
749    #[serde(default, skip_serializing_if = "Option::is_none")]
750    pub login: Option<i64>,
751    #[serde(default, skip_serializing_if = "Option::is_none")]
752    pub app_open: Option<i64>,
753}
754
755/// `AdminDataExplorerRawKeysResponse` model.
756#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
757pub struct AdminDataExplorerRawKeysResponse {
758    pub keys: Vec<AdminDataExplorerRawKeysResponseKey>,
759    #[serde(default, skip_serializing_if = "Option::is_none")]
760    pub cursor: Option<String>,
761    pub total: i64,
762}
763
764/// `AdminDataExplorerRawKeysResponseKey` model.
765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
766pub struct AdminDataExplorerRawKeysResponseKey {
767    #[serde(default, skip_serializing_if = "Option::is_none")]
768    pub key: Option<Vec<serde_json::Value>>,
769    #[serde(default, skip_serializing_if = "Option::is_none")]
770    pub namespace: Option<String>,
771    #[serde(default, skip_serializing_if = "Option::is_none")]
772    pub value_preview: Option<String>,
773    #[serde(default, skip_serializing_if = "Option::is_none")]
774    pub size: Option<i64>,
775    #[serde(default, skip_serializing_if = "Option::is_none")]
776    pub r#type: Option<AdminDataExplorerRawKeysResponseKeyType>,
777    #[serde(default, skip_serializing_if = "Option::is_none")]
778    pub sensitive: Option<bool>,
779}
780
781/// `AdminDataExplorerRawKeysResponseKeyType` enumeration.
782#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
783pub enum AdminDataExplorerRawKeysResponseKeyType {
784    #[default]
785    #[serde(rename = "null")]
786    Null,
787    #[serde(rename = "array")]
788    Array,
789    #[serde(rename = "string")]
790    String,
791    #[serde(rename = "number")]
792    Number,
793    #[serde(rename = "boolean")]
794    Boolean,
795    #[serde(rename = "object")]
796    Object,
797    #[serde(rename = "undefined")]
798    Undefined,
799    /// A value the API introduced after this SDK was generated.
800    #[serde(untagged)]
801    Other(String),
802}
803
804impl AdminDataExplorerRawKeysResponseKeyType {
805    /// The value as it appears on the wire.
806    pub fn as_str(&self) -> &str {
807        match self {
808            Self::Null => "null",
809            Self::Array => "array",
810            Self::String => "string",
811            Self::Number => "number",
812            Self::Boolean => "boolean",
813            Self::Object => "object",
814            Self::Undefined => "undefined",
815            Self::Other(value) => value.as_str(),
816        }
817    }
818}
819
820impl std::fmt::Display for AdminDataExplorerRawKeysResponseKeyType {
821    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
822        f.write_str(self.as_str())
823    }
824}
825
826impl From<&str> for AdminDataExplorerRawKeysResponseKeyType {
827    fn from(value: &str) -> Self {
828        match value {
829            "null" => Self::Null,
830            "array" => Self::Array,
831            "string" => Self::String,
832            "number" => Self::Number,
833            "boolean" => Self::Boolean,
834            "object" => Self::Object,
835            "undefined" => Self::Undefined,
836            other => Self::Other(other.to_string()),
837        }
838    }
839}
840
841/// `AdminGetReconciliationResponse` model.
842#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
843pub struct AdminGetReconciliationResponse {
844    pub tenant_id: String,
845    pub reconciliation: AdminGetReconciliationResponseReconciliation,
846}
847
848/// `AdminGetReconciliationResponseReconciliation` model.
849#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
850pub struct AdminGetReconciliationResponseReconciliation {
851    #[serde(default, skip_serializing_if = "Option::is_none")]
852    pub period: Option<String>,
853    /// Any additional properties the server returned.
854    #[serde(flatten)]
855    pub extra: HashMap<String, serde_json::Value>,
856}
857
858/// `AdminListToolsResponse` model.
859#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
860pub struct AdminListToolsResponse {
861    pub tools: Vec<AdminListToolsResponseTool>,
862    pub count: i64,
863}
864
865/// `AdminListToolsResponseTool` model.
866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
867pub struct AdminListToolsResponseTool {
868    #[serde(default, skip_serializing_if = "Option::is_none")]
869    pub id: Option<String>,
870    #[serde(default, skip_serializing_if = "Option::is_none")]
871    pub name: Option<String>,
872    #[serde(default, skip_serializing_if = "Option::is_none")]
873    pub description: Option<String>,
874    /// JSON Schema for tool parameters.
875    #[serde(default, skip_serializing_if = "Option::is_none")]
876    pub parameters: Option<serde_json::Map<String, serde_json::Value>>,
877}
878
879/// `AdminListWebhookDLQResponse` model.
880#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
881pub struct AdminListWebhookDLQResponse {
882    pub entries: Vec<AdminListWebhookDLQResponseEntry>,
883}
884
885/// `AdminListWebhookDLQResponseEntry` model.
886#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
887pub struct AdminListWebhookDLQResponseEntry {
888    #[serde(rename = "eventId")]
889    pub event_id: String,
890    #[serde(rename = "eventType")]
891    pub event_type: String,
892    #[serde(default, skip_serializing_if = "Option::is_none")]
893    pub payload: Option<serde_json::Map<String, serde_json::Value>>,
894    #[serde(rename = "errorMessage")]
895    pub error_message: String,
896    pub timestamp: String,
897    #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")]
898    pub tenant_id: Option<String>,
899}
900
901/// `AdminReplayWebhookDLQResponse` model.
902#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
903pub struct AdminReplayWebhookDLQResponse {
904    pub success: bool,
905    #[serde(rename = "eventId")]
906    pub event_id: String,
907    pub action: String,
908    pub message: String,
909}
910
911/// `Agent` model.
912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
913pub struct Agent {
914    /// SPECs installed on this agent, with version pin and granted permissions.
915    #[serde(default, skip_serializing_if = "Option::is_none")]
916    pub specs: Option<Vec<AgentSpec>>,
917    /// Tools this agent may call without a human-in-the-loop prompt.
918    #[serde(default, skip_serializing_if = "Option::is_none")]
919    pub auto_approve_tools: Option<Vec<String>>,
920    /// Command hierarchy (MVP: opcon only).
921    #[serde(default, skip_serializing_if = "Option::is_none")]
922    pub command_relationships: Option<AgentCommandRelationships>,
923    /// Security clearance and compartment access.
924    #[serde(default, skip_serializing_if = "Option::is_none")]
925    pub access_control: Option<AgentAccessControl>,
926    /// Free-form caller-supplied metadata.
927    #[serde(default, skip_serializing_if = "Option::is_none")]
928    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
929    pub agent_id: String,
930    pub tenant_id: String,
931    pub name: String,
932    #[serde(default, skip_serializing_if = "Option::is_none")]
933    pub description: Option<String>,
934    #[serde(default, skip_serializing_if = "Option::is_none")]
935    pub version: Option<String>,
936    pub model: AgentModelConfig,
937    #[serde(default, skip_serializing_if = "Option::is_none")]
938    pub prompts: Option<AgentPrompts>,
939    #[serde(default, skip_serializing_if = "Option::is_none")]
940    pub mcp: Option<serde_json::Map<String, serde_json::Value>>,
941    #[serde(default, skip_serializing_if = "Option::is_none")]
942    pub policies: Option<serde_json::Map<String, serde_json::Value>>,
943    #[serde(default, skip_serializing_if = "Option::is_none")]
944    pub skills: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
945    #[serde(default, skip_serializing_if = "Option::is_none")]
946    pub thinking: Option<serde_json::Map<String, serde_json::Value>>,
947    #[serde(default, skip_serializing_if = "Option::is_none")]
948    pub effort_policy: Option<serde_json::Map<String, serde_json::Value>>,
949    #[serde(default, skip_serializing_if = "Option::is_none")]
950    pub resource_limits: Option<serde_json::Map<String, serde_json::Value>>,
951    #[serde(default, skip_serializing_if = "Option::is_none")]
952    pub memory: Option<serde_json::Map<String, serde_json::Value>>,
953    #[serde(default, skip_serializing_if = "Option::is_none")]
954    pub guardrails: Option<serde_json::Map<String, serde_json::Value>>,
955    /// Tool names requiring human approval before execution
956    #[serde(default, skip_serializing_if = "Option::is_none")]
957    pub approval_required_tools: Option<Vec<String>>,
958    /// Built-in tool names enabled for this agent
959    #[serde(default, skip_serializing_if = "Option::is_none")]
960    pub built_in_tools: Option<Vec<String>>,
961    /// Image generation configuration
962    #[serde(default, skip_serializing_if = "Option::is_none")]
963    pub image_generation: Option<serde_json::Map<String, serde_json::Value>>,
964    /// Deprecated in `packages/types/agent.ts:296`; kept for pre-migration records. Use
965    /// `knowledge_base_ids`. Documenting only the singular is why a client reading this schema
966    /// could link one base to an agent that supports several.
967    #[serde(default, skip_serializing_if = "Option::is_none")]
968    pub knowledge_base_id: Option<String>,
969    /// Every knowledge base linked to the agent. `search_kb` searches all of them by default.
970    #[serde(default, skip_serializing_if = "Option::is_none")]
971    pub knowledge_base_ids: Option<Vec<String>>,
972    /// Who can reach the agent. The publication screen is built on this field.
973    #[serde(default, skip_serializing_if = "Option::is_none")]
974    pub visibility: Option<AgentUpdateVisibility>,
975    /// Governance state, distinct from a run's status.
976    #[serde(default, skip_serializing_if = "Option::is_none")]
977    pub status: Option<AgentStatus>,
978    #[serde(default, skip_serializing_if = "Option::is_none")]
979    pub status_changed_at: Option<String>,
980    #[serde(default, skip_serializing_if = "Option::is_none")]
981    pub status_reason: Option<String>,
982    #[serde(default, skip_serializing_if = "Option::is_none")]
983    pub autonomy: Option<AgentAutonomy>,
984    /// Per-tool trust, overriding the agent's default approval policy.
985    #[serde(default, skip_serializing_if = "Option::is_none")]
986    pub tool_overrides: Option<Vec<AgentToolOverride>>,
987    #[serde(default, skip_serializing_if = "Option::is_none")]
988    pub public_config: Option<AgentPublicConfig>,
989    /// Present only on `GET /agents/{id}`, and only for a bridge agent. Computed at read time from
990    /// the machines currently registered, never stored on the record.
991    #[serde(default, skip_serializing_if = "Option::is_none")]
992    pub bridge: Option<AgentBridgeState>,
993    /// Fallback model configuration
994    #[serde(default, skip_serializing_if = "Option::is_none")]
995    pub fallback_model: Option<serde_json::Map<String, serde_json::Value>>,
996    #[serde(default, skip_serializing_if = "Option::is_none")]
997    pub execution_mode: Option<AgentExecutionMode>,
998    #[serde(default, skip_serializing_if = "Option::is_none")]
999    pub worker_reuse: Option<bool>,
1000    /// Cron schedule configuration
1001    #[serde(default, skip_serializing_if = "Option::is_none")]
1002    pub schedule: Option<serde_json::Map<String, serde_json::Value>>,
1003    /// Agent-to-Agent protocol configuration
1004    #[serde(default, skip_serializing_if = "Option::is_none")]
1005    pub a2a: Option<serde_json::Map<String, serde_json::Value>>,
1006    /// EU AI Act risk classification
1007    #[serde(default, skip_serializing_if = "Option::is_none")]
1008    pub risk_classification: Option<serde_json::Map<String, serde_json::Value>>,
1009    /// Workspace this agent belongs to
1010    #[serde(default, skip_serializing_if = "Option::is_none")]
1011    pub workspace_id: Option<String>,
1012    #[serde(default, skip_serializing_if = "Option::is_none")]
1013    pub context_strategy: Option<AgentContextStrategy>,
1014    /// Number of recent MESSAGES to keep — not a token budget, and read only when
1015    /// `context_strategy` is `sliding_window`. Default 20. Under any other strategy it is ignored
1016    /// entirely.
1017    ///
1018    /// Said explicitly because the name reads like a token ceiling and was used as one: the Head
1019    /// Agent tier template set it to 65536/131072/262144 as if it capped context, and a client
1020    /// posted those values believing they sized the window. The window is the model's — see
1021    /// `model.capabilities.max_context_tokens` — and what bounds history per call is
1022    /// `resource_limits.max_tokens_per_run` together with the platform's history-budget ratio.
1023    #[serde(default, skip_serializing_if = "Option::is_none")]
1024    pub context_window_size: Option<i64>,
1025    pub created_at: String,
1026    #[serde(default, skip_serializing_if = "Option::is_none")]
1027    pub updated_at: Option<String>,
1028}
1029
1030/// Security clearance and compartment access.
1031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1032pub struct AgentAccessControl {
1033    /// 0=public, 1=internal, 2=restricted, 3=confidential, 4=secret.
1034    pub clearance: i64,
1035    #[serde(default, skip_serializing_if = "Option::is_none")]
1036    pub compartments: Option<Vec<String>>,
1037    #[serde(default, skip_serializing_if = "Option::is_none")]
1038    pub caveats: Option<Vec<String>>,
1039}
1040
1041/// `AgentAnalyticsRow` model.
1042#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1043pub struct AgentAnalyticsRow {
1044    pub agent_id: String,
1045    pub tenant_id: String,
1046    pub name: String,
1047    pub execution_mode: AgentExecutionMode,
1048    pub status: String,
1049    /// Bridge agents only.
1050    #[serde(default, skip_serializing_if = "Option::is_none")]
1051    pub bridge_status: Option<AgentSummaryBridgeStatus>,
1052    /// Bridge agents only.
1053    #[serde(default, skip_serializing_if = "Option::is_none")]
1054    pub machine_count: Option<i64>,
1055    pub runs: i64,
1056    pub cost_usd: f64,
1057    pub tokens: i64,
1058}
1059
1060/// Output of summariseAgents (analytics.ts) — same shape for /admin/analytics/agents and
1061/// /analytics/agents (tenant-scoped).
1062#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1063pub struct AgentAnalyticsSummary {
1064    pub range: AgentAnalyticsSummaryRange,
1065    pub total: i64,
1066    #[serde(default, skip_serializing_if = "Option::is_none")]
1067    pub by_execution_mode: Option<AgentAnalyticsSummaryByExecutionMode>,
1068    #[serde(default, skip_serializing_if = "Option::is_none")]
1069    pub bridge: Option<AgentAnalyticsSummaryBridge>,
1070    #[serde(default, skip_serializing_if = "Option::is_none")]
1071    pub runs_total: Option<i64>,
1072    #[serde(default, skip_serializing_if = "Option::is_none")]
1073    pub cost_total_usd: Option<f64>,
1074    #[serde(default, skip_serializing_if = "Option::is_none")]
1075    pub tokens_total: Option<i64>,
1076    #[serde(default, skip_serializing_if = "Option::is_none")]
1077    pub top_by_runs: Option<Vec<AgentSummary>>,
1078    #[serde(default, skip_serializing_if = "Option::is_none")]
1079    pub top_by_cost: Option<Vec<AgentSummary>>,
1080    pub agents: Vec<AgentSummary>,
1081}
1082
1083/// `AgentAnalyticsSummaryBridge` model.
1084#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1085pub struct AgentAnalyticsSummaryBridge {
1086    #[serde(default, skip_serializing_if = "Option::is_none")]
1087    pub online: Option<i64>,
1088    #[serde(default, skip_serializing_if = "Option::is_none")]
1089    pub stale: Option<i64>,
1090    #[serde(default, skip_serializing_if = "Option::is_none")]
1091    pub offline: Option<i64>,
1092    #[serde(default, skip_serializing_if = "Option::is_none")]
1093    pub machines_total: Option<i64>,
1094}
1095
1096/// `AgentAnalyticsSummaryByExecutionMode` model.
1097#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1098pub struct AgentAnalyticsSummaryByExecutionMode {
1099    #[serde(default, skip_serializing_if = "Option::is_none")]
1100    pub cloud: Option<i64>,
1101    #[serde(default, skip_serializing_if = "Option::is_none")]
1102    pub bridge: Option<i64>,
1103}
1104
1105/// `AgentAnalyticsSummaryRange` model.
1106#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1107pub struct AgentAnalyticsSummaryRange {
1108    pub days: i64,
1109}
1110
1111/// `AgentAutonomy` model.
1112#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1113pub struct AgentAutonomy {
1114    pub level: AgentAutonomyLevel,
1115}
1116
1117/// `AgentAutonomyLevel` enumeration.
1118#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1119pub enum AgentAutonomyLevel {
1120    #[default]
1121    #[serde(rename = "manual")]
1122    Manual,
1123    #[serde(rename = "approve_risky")]
1124    ApproveRisky,
1125    #[serde(rename = "full_auto")]
1126    FullAuto,
1127    /// A value the API introduced after this SDK was generated.
1128    #[serde(untagged)]
1129    Other(String),
1130}
1131
1132impl AgentAutonomyLevel {
1133    /// The value as it appears on the wire.
1134    pub fn as_str(&self) -> &str {
1135        match self {
1136            Self::Manual => "manual",
1137            Self::ApproveRisky => "approve_risky",
1138            Self::FullAuto => "full_auto",
1139            Self::Other(value) => value.as_str(),
1140        }
1141    }
1142}
1143
1144impl std::fmt::Display for AgentAutonomyLevel {
1145    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1146        f.write_str(self.as_str())
1147    }
1148}
1149
1150impl From<&str> for AgentAutonomyLevel {
1151    fn from(value: &str) -> Self {
1152        match value {
1153            "manual" => Self::Manual,
1154            "approve_risky" => Self::ApproveRisky,
1155            "full_auto" => Self::FullAuto,
1156            other => Self::Other(other.to_string()),
1157        }
1158    }
1159}
1160
1161/// A message pinned under an agent. Keyed by `message_id`; the platform keeps the text the
1162/// client sent, it does not look the message up.
1163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1164pub struct AgentBookmark {
1165    pub message_id: String,
1166    pub agent_id: String,
1167    pub tenant_id: String,
1168    pub kind: AgentBookmarkKind,
1169    pub content: String,
1170    #[serde(default, skip_serializing_if = "Option::is_none")]
1171    pub session_id: Option<String>,
1172    pub created_at: String,
1173}
1174
1175/// `AgentBookmarkKind` enumeration.
1176#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1177pub enum AgentBookmarkKind {
1178    #[default]
1179    #[serde(rename = "user")]
1180    User,
1181    #[serde(rename = "assistant")]
1182    Assistant,
1183    /// A value the API introduced after this SDK was generated.
1184    #[serde(untagged)]
1185    Other(String),
1186}
1187
1188impl AgentBookmarkKind {
1189    /// The value as it appears on the wire.
1190    pub fn as_str(&self) -> &str {
1191        match self {
1192            Self::User => "user",
1193            Self::Assistant => "assistant",
1194            Self::Other(value) => value.as_str(),
1195        }
1196    }
1197}
1198
1199impl std::fmt::Display for AgentBookmarkKind {
1200    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1201        f.write_str(self.as_str())
1202    }
1203}
1204
1205impl From<&str> for AgentBookmarkKind {
1206    fn from(value: &str) -> Self {
1207        match value {
1208            "user" => Self::User,
1209            "assistant" => Self::Assistant,
1210            other => Self::Other(other.to_string()),
1211        }
1212    }
1213}
1214
1215/// `AgentBridgeState` model.
1216#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1217pub struct AgentBridgeState {
1218    pub online_machines: i64,
1219    pub total_machines: i64,
1220    pub platforms: Vec<String>,
1221    pub working_directories: Vec<String>,
1222    pub machine_names: Vec<String>,
1223    pub latest_heartbeat: String,
1224    pub installed_specs: Vec<BridgeInstalledSpec>,
1225}
1226
1227/// What GET /agents/{agentId}/capabilities serves. Measured 2026-09-10 on the e2e-canon tenant;
1228/// `tools\[\]` and `kb_ids\[\]` were empty there, so their element shape is not asserted.
1229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1230pub struct AgentCapabilities {
1231    pub agent_id: String,
1232    pub skills: Vec<AgentCapabilitiesSkill>,
1233    pub constraints: AgentCapabilitiesConstraints,
1234    pub tools: Vec<serde_json::Value>,
1235    pub kb_ids: Vec<String>,
1236    pub updated_at: String,
1237}
1238
1239/// `AgentCapabilitiesConstraints` model.
1240#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1241pub struct AgentCapabilitiesConstraints {
1242    #[serde(default, skip_serializing_if = "Option::is_none")]
1243    pub max_context_tokens: Option<i64>,
1244    #[serde(default, skip_serializing_if = "Option::is_none")]
1245    pub rate_limit_rpm: Option<i64>,
1246    #[serde(default, skip_serializing_if = "Option::is_none")]
1247    pub supported_languages: Option<Vec<String>>,
1248}
1249
1250/// `AgentCapabilitiesSkill` model.
1251#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1252pub struct AgentCapabilitiesSkill {
1253    pub id: String,
1254    pub name: String,
1255    #[serde(default, skip_serializing_if = "Option::is_none")]
1256    pub description: Option<String>,
1257    #[serde(default, skip_serializing_if = "Option::is_none")]
1258    pub input_types: Option<Vec<String>>,
1259    #[serde(default, skip_serializing_if = "Option::is_none")]
1260    pub output_types: Option<Vec<String>>,
1261}
1262
1263/// Command hierarchy (MVP: opcon only).
1264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1265pub struct AgentCommandRelationships {
1266    /// Agent ID holding operational control.
1267    #[serde(default, skip_serializing_if = "Option::is_none")]
1268    pub opcon: Option<String>,
1269    #[serde(default, skip_serializing_if = "Option::is_none")]
1270    pub coordinates_with: Option<Vec<String>>,
1271}
1272
1273/// `AgentContextStrategy` enumeration.
1274#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1275pub enum AgentContextStrategy {
1276    #[default]
1277    #[serde(rename = "compaction")]
1278    Compaction,
1279    #[serde(rename = "summarize")]
1280    Summarize,
1281    #[serde(rename = "truncate")]
1282    Truncate,
1283    #[serde(rename = "sliding_window")]
1284    SlidingWindow,
1285    /// A value the API introduced after this SDK was generated.
1286    #[serde(untagged)]
1287    Other(String),
1288}
1289
1290impl AgentContextStrategy {
1291    /// The value as it appears on the wire.
1292    pub fn as_str(&self) -> &str {
1293        match self {
1294            Self::Compaction => "compaction",
1295            Self::Summarize => "summarize",
1296            Self::Truncate => "truncate",
1297            Self::SlidingWindow => "sliding_window",
1298            Self::Other(value) => value.as_str(),
1299        }
1300    }
1301}
1302
1303impl std::fmt::Display for AgentContextStrategy {
1304    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1305        f.write_str(self.as_str())
1306    }
1307}
1308
1309impl From<&str> for AgentContextStrategy {
1310    fn from(value: &str) -> Self {
1311        match value {
1312            "compaction" => Self::Compaction,
1313            "summarize" => Self::Summarize,
1314            "truncate" => Self::Truncate,
1315            "sliding_window" => Self::SlidingWindow,
1316            other => Self::Other(other.to_string()),
1317        }
1318    }
1319}
1320
1321/// `AgentExecutionMode` enumeration.
1322#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1323pub enum AgentExecutionMode {
1324    #[default]
1325    #[serde(rename = "async")]
1326    Async,
1327    #[serde(rename = "worker")]
1328    Worker,
1329    #[serde(rename = "bridge")]
1330    Bridge,
1331    /// A value the API introduced after this SDK was generated.
1332    #[serde(untagged)]
1333    Other(String),
1334}
1335
1336impl AgentExecutionMode {
1337    /// The value as it appears on the wire.
1338    pub fn as_str(&self) -> &str {
1339        match self {
1340            Self::Async => "async",
1341            Self::Worker => "worker",
1342            Self::Bridge => "bridge",
1343            Self::Other(value) => value.as_str(),
1344        }
1345    }
1346}
1347
1348impl std::fmt::Display for AgentExecutionMode {
1349    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1350        f.write_str(self.as_str())
1351    }
1352}
1353
1354impl From<&str> for AgentExecutionMode {
1355    fn from(value: &str) -> Self {
1356        match value {
1357            "async" => Self::Async,
1358            "worker" => Self::Worker,
1359            "bridge" => Self::Bridge,
1360            other => Self::Other(other.to_string()),
1361        }
1362    }
1363}
1364
1365/// Agent-scoped integration (connection) instance
1366#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1367pub struct AgentIntegration {
1368    pub id: String,
1369    pub agent_id: String,
1370    #[serde(default, skip_serializing_if = "Option::is_none")]
1371    pub tenant_id: Option<String>,
1372    pub connector_id: String,
1373    pub name: String,
1374    pub status: IntegrationStatus,
1375    /// Redacted config (no secrets)
1376    #[serde(default, skip_serializing_if = "Option::is_none")]
1377    pub config: Option<serde_json::Map<String, serde_json::Value>>,
1378    #[serde(default, skip_serializing_if = "Option::is_none")]
1379    pub created_at: Option<String>,
1380    #[serde(default, skip_serializing_if = "Option::is_none")]
1381    pub updated_at: Option<String>,
1382}
1383
1384/// `AgentLineage` model.
1385#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1386pub struct AgentLineage {
1387    pub agent_id: String,
1388    /// Full chain from root to this agent.
1389    pub chain: Vec<String>,
1390    pub depth: i64,
1391    #[serde(default, skip_serializing_if = "Option::is_none")]
1392    pub parent_id: Option<String>,
1393    pub spawned_by: String,
1394    #[serde(default, skip_serializing_if = "Option::is_none")]
1395    pub spawned_at: Option<String>,
1396}
1397
1398/// One message between two agents.
1399#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1400pub struct AgentMessage {
1401    pub message_id: String,
1402    pub thread_id: String,
1403    pub from_agent_id: String,
1404    pub to_agent_id: String,
1405    pub message: String,
1406    pub created_at: String,
1407    /// Integrity signature, when the message carries one.
1408    #[serde(default, skip_serializing_if = "Option::is_none")]
1409    pub signature: Option<String>,
1410    /// Communications precedence; absent means routine.
1411    #[serde(default, skip_serializing_if = "Option::is_none")]
1412    pub precedence: Option<AgentMessagePrecedence>,
1413}
1414
1415/// Communications precedence; absent means routine.
1416#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1417pub enum AgentMessagePrecedence {
1418    #[default]
1419    #[serde(rename = "flash")]
1420    Flash,
1421    #[serde(rename = "immediate")]
1422    Immediate,
1423    #[serde(rename = "priority")]
1424    Priority,
1425    #[serde(rename = "routine")]
1426    Routine,
1427    /// A value the API introduced after this SDK was generated.
1428    #[serde(untagged)]
1429    Other(String),
1430}
1431
1432impl AgentMessagePrecedence {
1433    /// The value as it appears on the wire.
1434    pub fn as_str(&self) -> &str {
1435        match self {
1436            Self::Flash => "flash",
1437            Self::Immediate => "immediate",
1438            Self::Priority => "priority",
1439            Self::Routine => "routine",
1440            Self::Other(value) => value.as_str(),
1441        }
1442    }
1443}
1444
1445impl std::fmt::Display for AgentMessagePrecedence {
1446    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1447        f.write_str(self.as_str())
1448    }
1449}
1450
1451impl From<&str> for AgentMessagePrecedence {
1452    fn from(value: &str) -> Self {
1453        match value {
1454            "flash" => Self::Flash,
1455            "immediate" => Self::Immediate,
1456            "priority" => Self::Priority,
1457            "routine" => Self::Routine,
1458            other => Self::Other(other.to_string()),
1459        }
1460    }
1461}
1462
1463/// Model capabilities. Deliberately carries no provider or model identifier — see the model
1464/// lockdown.
1465#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1466pub struct AgentModelConfig {
1467    /// Feature flags the client may branch on (e.g. `vision`, `tool_calls`, `streaming`). Absent
1468    /// when the platform has published none.
1469    #[serde(default, skip_serializing_if = "Option::is_none")]
1470    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
1471}
1472
1473/// Accepted and IGNORED. The platform default is applied on create and preserved on update, so
1474/// sending this changes nothing. Kept so existing clients do not start failing validation.
1475#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1476pub struct AgentModelConfigInput {
1477    #[serde(default, skip_serializing_if = "Option::is_none")]
1478    pub provider: Option<String>,
1479    #[serde(default, skip_serializing_if = "Option::is_none")]
1480    pub model_ref: Option<String>,
1481    #[serde(default, skip_serializing_if = "Option::is_none")]
1482    pub endpoint_url: Option<String>,
1483    #[serde(default, skip_serializing_if = "Option::is_none")]
1484    pub api_key_ref: Option<String>,
1485    #[serde(default, skip_serializing_if = "Option::is_none")]
1486    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
1487}
1488
1489/// `AgentPrompts` model.
1490#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1491pub struct AgentPrompts {
1492    #[serde(default, skip_serializing_if = "Option::is_none")]
1493    pub system: Option<String>,
1494    #[serde(default, skip_serializing_if = "Option::is_none")]
1495    pub developer: Option<String>,
1496}
1497
1498/// `AgentPublicConfig` model.
1499#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1500pub struct AgentPublicConfig {
1501    pub enabled: bool,
1502    #[serde(default, skip_serializing_if = "Option::is_none")]
1503    pub system_prompt: Option<String>,
1504    #[serde(default, skip_serializing_if = "Option::is_none")]
1505    pub greeting: Option<String>,
1506    #[serde(default, skip_serializing_if = "Option::is_none")]
1507    pub allowed_tools: Option<Vec<String>>,
1508    #[serde(default, skip_serializing_if = "Option::is_none")]
1509    pub max_messages_per_session: Option<i64>,
1510    #[serde(default, skip_serializing_if = "Option::is_none")]
1511    pub max_concurrent_sessions: Option<i64>,
1512    #[serde(default, skip_serializing_if = "Option::is_none")]
1513    pub rate_limit_sessions_per_ip: Option<i64>,
1514    #[serde(default, skip_serializing_if = "Option::is_none")]
1515    pub rate_limit_messages_per_min: Option<i64>,
1516    /// Messages per UTC day per visitor identity (a hash of IP + anonymous visitor id). Enforced
1517    /// ONLY for the featured landing agent — the one `GET /admin/config/landing` names as
1518    /// `public_agent_id`; every other public agent keeps its per-session caps and ignores this.
1519    /// Over the cap the server answers 429 with `code: "DAILY_LIMIT"`. Unset means the platform
1520    /// default of 15.
1521    #[serde(default, skip_serializing_if = "Option::is_none")]
1522    pub daily_message_limit: Option<i64>,
1523}
1524
1525/// The stored schedule configuration (AgentScheduleConfig in @uarp/scheduler).
1526#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1527pub struct AgentScheduleConfig {
1528    pub cron: String,
1529    pub enabled: bool,
1530    /// IANA zone; `UTC` when not given.
1531    pub timezone: String,
1532    pub input: serde_json::Map<String, serde_json::Value>,
1533    pub max_concurrent_scheduled: i64,
1534    pub on_failure: AgentScheduleConfigOnFailure,
1535    #[serde(default, skip_serializing_if = "Option::is_none")]
1536    pub autonomous_mode: Option<bool>,
1537    #[serde(default, skip_serializing_if = "Option::is_none")]
1538    pub reflection_prompt: Option<String>,
1539}
1540
1541/// `AgentScheduleConfigOnFailure` enumeration.
1542#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1543pub enum AgentScheduleConfigOnFailure {
1544    #[default]
1545    #[serde(rename = "retry_next")]
1546    RetryNext,
1547    #[serde(rename = "pause_schedule")]
1548    PauseSchedule,
1549    #[serde(rename = "notify")]
1550    Notify,
1551    /// A value the API introduced after this SDK was generated.
1552    #[serde(untagged)]
1553    Other(String),
1554}
1555
1556impl AgentScheduleConfigOnFailure {
1557    /// The value as it appears on the wire.
1558    pub fn as_str(&self) -> &str {
1559        match self {
1560            Self::RetryNext => "retry_next",
1561            Self::PauseSchedule => "pause_schedule",
1562            Self::Notify => "notify",
1563            Self::Other(value) => value.as_str(),
1564        }
1565    }
1566}
1567
1568impl std::fmt::Display for AgentScheduleConfigOnFailure {
1569    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1570        f.write_str(self.as_str())
1571    }
1572}
1573
1574impl From<&str> for AgentScheduleConfigOnFailure {
1575    fn from(value: &str) -> Self {
1576        match value {
1577            "retry_next" => Self::RetryNext,
1578            "pause_schedule" => Self::PauseSchedule,
1579            "notify" => Self::Notify,
1580            other => Self::Other(other.to_string()),
1581        }
1582    }
1583}
1584
1585/// `AgentScorer` model.
1586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1587pub struct AgentScorer {
1588    pub scorer_id: String,
1589    pub agent_id: String,
1590    pub tenant_id: String,
1591    pub name: String,
1592    pub config: AgentScorerConfig,
1593    pub created_at: String,
1594}
1595
1596/// `AgentScorerConfig` model.
1597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1598pub struct AgentScorerConfig {
1599    pub r#type: AgentScorerConfigType,
1600    pub url: String,
1601    #[serde(default, skip_serializing_if = "Option::is_none")]
1602    pub timeout_ms: Option<i64>,
1603    /// Any additional properties the server returned.
1604    #[serde(flatten)]
1605    pub extra: HashMap<String, serde_json::Value>,
1606}
1607
1608/// `AgentScorerConfigType` enumeration.
1609#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1610pub enum AgentScorerConfigType {
1611    #[default]
1612    #[serde(rename = "webhook")]
1613    Webhook,
1614    /// A value the API introduced after this SDK was generated.
1615    #[serde(untagged)]
1616    Other(String),
1617}
1618
1619impl AgentScorerConfigType {
1620    /// The value as it appears on the wire.
1621    pub fn as_str(&self) -> &str {
1622        match self {
1623            Self::Webhook => "webhook",
1624            Self::Other(value) => value.as_str(),
1625        }
1626    }
1627}
1628
1629impl std::fmt::Display for AgentScorerConfigType {
1630    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1631        f.write_str(self.as_str())
1632    }
1633}
1634
1635impl From<&str> for AgentScorerConfigType {
1636    fn from(value: &str) -> Self {
1637        match value {
1638            "webhook" => Self::Webhook,
1639            other => Self::Other(other.to_string()),
1640        }
1641    }
1642}
1643
1644/// `AgentSpec` model.
1645#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1646pub struct AgentSpec {
1647    pub spec_id: String,
1648    #[serde(default, skip_serializing_if = "Option::is_none")]
1649    pub version: Option<String>,
1650    /// Soft-disable. false keeps the install history but skips injection.
1651    #[serde(default, skip_serializing_if = "Option::is_none")]
1652    pub enabled: Option<bool>,
1653    #[serde(default, skip_serializing_if = "Option::is_none")]
1654    pub permissions_granted: Option<Vec<AgentSpecPermissionsGrantedItem>>,
1655}
1656
1657/// `AgentSpecPermissionsGrantedItem` model.
1658#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1659pub struct AgentSpecPermissionsGrantedItem {
1660    pub cap: String,
1661    #[serde(default, skip_serializing_if = "Option::is_none")]
1662    pub scope: Option<String>,
1663    #[serde(default, skip_serializing_if = "Option::is_none")]
1664    pub reason: Option<String>,
1665    pub granted_by: AgentSpecPermissionsGrantedItemGrantedBy,
1666    pub granted_at: String,
1667}
1668
1669/// `AgentSpecPermissionsGrantedItemGrantedBy` enumeration.
1670#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1671pub enum AgentSpecPermissionsGrantedItemGrantedBy {
1672    #[default]
1673    #[serde(rename = "wizard")]
1674    Wizard,
1675    #[serde(rename = "admin")]
1676    Admin,
1677    #[serde(rename = "bootstrap")]
1678    Bootstrap,
1679    #[serde(rename = "migrated")]
1680    Migrated,
1681    /// A value the API introduced after this SDK was generated.
1682    #[serde(untagged)]
1683    Other(String),
1684}
1685
1686impl AgentSpecPermissionsGrantedItemGrantedBy {
1687    /// The value as it appears on the wire.
1688    pub fn as_str(&self) -> &str {
1689        match self {
1690            Self::Wizard => "wizard",
1691            Self::Admin => "admin",
1692            Self::Bootstrap => "bootstrap",
1693            Self::Migrated => "migrated",
1694            Self::Other(value) => value.as_str(),
1695        }
1696    }
1697}
1698
1699impl std::fmt::Display for AgentSpecPermissionsGrantedItemGrantedBy {
1700    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1701        f.write_str(self.as_str())
1702    }
1703}
1704
1705impl From<&str> for AgentSpecPermissionsGrantedItemGrantedBy {
1706    fn from(value: &str) -> Self {
1707        match value {
1708            "wizard" => Self::Wizard,
1709            "admin" => Self::Admin,
1710            "bootstrap" => Self::Bootstrap,
1711            "migrated" => Self::Migrated,
1712            other => Self::Other(other.to_string()),
1713        }
1714    }
1715}
1716
1717/// Governance state, distinct from a run's status.
1718#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1719pub enum AgentStatus {
1720    #[default]
1721    #[serde(rename = "active")]
1722    Active,
1723    #[serde(rename = "suspended")]
1724    Suspended,
1725    #[serde(rename = "terminated")]
1726    Terminated,
1727    #[serde(rename = "deposed")]
1728    Deposed,
1729    /// A value the API introduced after this SDK was generated.
1730    #[serde(untagged)]
1731    Other(String),
1732}
1733
1734impl AgentStatus {
1735    /// The value as it appears on the wire.
1736    pub fn as_str(&self) -> &str {
1737        match self {
1738            Self::Active => "active",
1739            Self::Suspended => "suspended",
1740            Self::Terminated => "terminated",
1741            Self::Deposed => "deposed",
1742            Self::Other(value) => value.as_str(),
1743        }
1744    }
1745}
1746
1747impl std::fmt::Display for AgentStatus {
1748    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1749        f.write_str(self.as_str())
1750    }
1751}
1752
1753impl From<&str> for AgentStatus {
1754    fn from(value: &str) -> Self {
1755        match value {
1756            "active" => Self::Active,
1757            "suspended" => Self::Suspended,
1758            "terminated" => Self::Terminated,
1759            "deposed" => Self::Deposed,
1760            other => Self::Other(other.to_string()),
1761        }
1762    }
1763}
1764
1765/// `AgentSummary` model.
1766#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1767pub struct AgentSummary {
1768    pub agent_id: String,
1769    pub tenant_id: String,
1770    pub name: String,
1771    pub execution_mode: AgentSummaryExecutionMode,
1772    pub status: String,
1773    #[serde(default, skip_serializing_if = "Option::is_none")]
1774    pub bridge_status: Option<AgentSummaryBridgeStatus>,
1775    #[serde(default, skip_serializing_if = "Option::is_none")]
1776    pub machine_count: Option<i64>,
1777    #[serde(default, skip_serializing_if = "Option::is_none")]
1778    pub runs: Option<i64>,
1779    #[serde(default, skip_serializing_if = "Option::is_none")]
1780    pub cost_usd: Option<f64>,
1781    #[serde(default, skip_serializing_if = "Option::is_none")]
1782    pub tokens: Option<i64>,
1783}
1784
1785/// `AgentSummaryBridgeStatus` enumeration.
1786#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1787pub enum AgentSummaryBridgeStatus {
1788    #[default]
1789    #[serde(rename = "online")]
1790    Online,
1791    #[serde(rename = "stale")]
1792    Stale,
1793    #[serde(rename = "offline")]
1794    Offline,
1795    /// A value the API introduced after this SDK was generated.
1796    #[serde(untagged)]
1797    Other(String),
1798}
1799
1800impl AgentSummaryBridgeStatus {
1801    /// The value as it appears on the wire.
1802    pub fn as_str(&self) -> &str {
1803        match self {
1804            Self::Online => "online",
1805            Self::Stale => "stale",
1806            Self::Offline => "offline",
1807            Self::Other(value) => value.as_str(),
1808        }
1809    }
1810}
1811
1812impl std::fmt::Display for AgentSummaryBridgeStatus {
1813    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1814        f.write_str(self.as_str())
1815    }
1816}
1817
1818impl From<&str> for AgentSummaryBridgeStatus {
1819    fn from(value: &str) -> Self {
1820        match value {
1821            "online" => Self::Online,
1822            "stale" => Self::Stale,
1823            "offline" => Self::Offline,
1824            other => Self::Other(other.to_string()),
1825        }
1826    }
1827}
1828
1829/// `AgentSummaryExecutionMode` enumeration.
1830#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1831pub enum AgentSummaryExecutionMode {
1832    #[default]
1833    #[serde(rename = "async")]
1834    Async,
1835    #[serde(rename = "worker")]
1836    Worker,
1837    #[serde(rename = "bridge")]
1838    Bridge,
1839    #[serde(rename = "cloud")]
1840    Cloud,
1841    /// A value the API introduced after this SDK was generated.
1842    #[serde(untagged)]
1843    Other(String),
1844}
1845
1846impl AgentSummaryExecutionMode {
1847    /// The value as it appears on the wire.
1848    pub fn as_str(&self) -> &str {
1849        match self {
1850            Self::Async => "async",
1851            Self::Worker => "worker",
1852            Self::Bridge => "bridge",
1853            Self::Cloud => "cloud",
1854            Self::Other(value) => value.as_str(),
1855        }
1856    }
1857}
1858
1859impl std::fmt::Display for AgentSummaryExecutionMode {
1860    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1861        f.write_str(self.as_str())
1862    }
1863}
1864
1865impl From<&str> for AgentSummaryExecutionMode {
1866    fn from(value: &str) -> Self {
1867        match value {
1868            "async" => Self::Async,
1869            "worker" => Self::Worker,
1870            "bridge" => Self::Bridge,
1871            "cloud" => Self::Cloud,
1872            other => Self::Other(other.to_string()),
1873        }
1874    }
1875}
1876
1877/// `AgentToolOverride` model.
1878#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1879pub struct AgentToolOverride {
1880    pub tool_name: String,
1881    pub trust_level: AgentToolOverrideTrustLevel,
1882}
1883
1884/// `AgentToolOverrideTrustLevel` enumeration.
1885#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1886pub enum AgentToolOverrideTrustLevel {
1887    #[default]
1888    #[serde(rename = "always_allow")]
1889    AlwaysAllow,
1890    #[serde(rename = "ask_first")]
1891    AskFirst,
1892    #[serde(rename = "never_allow")]
1893    NeverAllow,
1894    /// A value the API introduced after this SDK was generated.
1895    #[serde(untagged)]
1896    Other(String),
1897}
1898
1899impl AgentToolOverrideTrustLevel {
1900    /// The value as it appears on the wire.
1901    pub fn as_str(&self) -> &str {
1902        match self {
1903            Self::AlwaysAllow => "always_allow",
1904            Self::AskFirst => "ask_first",
1905            Self::NeverAllow => "never_allow",
1906            Self::Other(value) => value.as_str(),
1907        }
1908    }
1909}
1910
1911impl std::fmt::Display for AgentToolOverrideTrustLevel {
1912    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1913        f.write_str(self.as_str())
1914    }
1915}
1916
1917impl From<&str> for AgentToolOverrideTrustLevel {
1918    fn from(value: &str) -> Self {
1919        match value {
1920            "always_allow" => Self::AlwaysAllow,
1921            "ask_first" => Self::AskFirst,
1922            "never_allow" => Self::NeverAllow,
1923            other => Self::Other(other.to_string()),
1924        }
1925    }
1926}
1927
1928/// `AgentToolOverrideUpdate` model.
1929#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1930pub struct AgentToolOverrideUpdate {
1931    pub tool_name: String,
1932    pub trust_level: AgentToolOverrideTrustLevel,
1933}
1934
1935/// Body for `PUT /api/v1/agents/{agentId}`. Every field optional — an omitted field means NO
1936/// CHANGE, not 'clear it'. `model` and `fallback_model` are accepted and ignored (see the model
1937/// lockdown).
1938#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1939pub struct AgentUpdate {
1940    #[serde(default, skip_serializing_if = "Option::is_none")]
1941    pub name: Option<String>,
1942    #[serde(default, skip_serializing_if = "Option::is_none")]
1943    pub description: Option<String>,
1944    #[serde(default, skip_serializing_if = "Option::is_none")]
1945    pub prompts: Option<serde_json::Map<String, serde_json::Value>>,
1946    #[serde(default, skip_serializing_if = "Option::is_none")]
1947    pub model: Option<AgentModelConfigInput>,
1948    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
1949    /// leaves the agent with exactly that one — read the current value and send the full set. The
1950    /// incoming list is normalised and persisted whole; the previous list is consulted only to keep
1951    /// permission-grant timestamps stable for SPECs that were already installed.
1952    #[serde(default, skip_serializing_if = "Option::is_none")]
1953    pub specs: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
1954    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
1955    /// leaves the agent with exactly that one — read the current value and send the full set. 
1956    #[serde(default, skip_serializing_if = "Option::is_none")]
1957    pub approval_required_tools: Option<Vec<String>>,
1958    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
1959    /// leaves the agent with exactly that one — read the current value and send the full set. 
1960    #[serde(default, skip_serializing_if = "Option::is_none")]
1961    pub auto_approve_tools: Option<Vec<String>>,
1962    #[serde(default, skip_serializing_if = "Option::is_none")]
1963    pub knowledge_base_id: Option<String>,
1964    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
1965    /// leaves the agent with exactly that one — read the current value and send the full set. Note
1966    /// the legacy singular `knowledge_base_id` is UNIONED with this array within the same request —
1967    /// the server-side helper is named `mergeKbIds` for that reason, and merges the two REQUEST
1968    /// fields, never the request with what is stored.
1969    #[serde(default, skip_serializing_if = "Option::is_none")]
1970    pub knowledge_base_ids: Option<Vec<String>>,
1971    #[serde(default, skip_serializing_if = "Option::is_none")]
1972    pub workspace_id: Option<String>,
1973    #[serde(default, skip_serializing_if = "Option::is_none")]
1974    pub visibility: Option<AgentUpdateVisibility>,
1975}
1976
1977/// `AgentUpdateVisibility` enumeration.
1978#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1979pub enum AgentUpdateVisibility {
1980    #[default]
1981    #[serde(rename = "private")]
1982    Private,
1983    #[serde(rename = "team")]
1984    Team,
1985    #[serde(rename = "public")]
1986    Public,
1987    /// A value the API introduced after this SDK was generated.
1988    #[serde(untagged)]
1989    Other(String),
1990}
1991
1992impl AgentUpdateVisibility {
1993    /// The value as it appears on the wire.
1994    pub fn as_str(&self) -> &str {
1995        match self {
1996            Self::Private => "private",
1997            Self::Team => "team",
1998            Self::Public => "public",
1999            Self::Other(value) => value.as_str(),
2000        }
2001    }
2002}
2003
2004impl std::fmt::Display for AgentUpdateVisibility {
2005    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2006        f.write_str(self.as_str())
2007    }
2008}
2009
2010impl From<&str> for AgentUpdateVisibility {
2011    fn from(value: &str) -> Self {
2012        match value {
2013            "private" => Self::Private,
2014            "team" => Self::Team,
2015            "public" => Self::Public,
2016            other => Self::Other(other.to_string()),
2017        }
2018    }
2019}
2020
2021/// `AgentVersion` model.
2022#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2023pub struct AgentVersion {
2024    pub version_id: String,
2025    pub agent_id: String,
2026    #[serde(default, skip_serializing_if = "Option::is_none")]
2027    pub tenant_id: Option<String>,
2028    pub version: i64,
2029    #[serde(default, skip_serializing_if = "Option::is_none")]
2030    pub changelog: Option<String>,
2031    pub created_at: String,
2032    #[serde(default, skip_serializing_if = "Option::is_none")]
2033    pub created_by: Option<String>,
2034    /// The full agent configuration as it stood at this version. Shape follows `Agent`; not pinned
2035    /// here so the two cannot drift.
2036    #[serde(default, skip_serializing_if = "Option::is_none")]
2037    pub config: Option<serde_json::Map<String, serde_json::Value>>,
2038}
2039
2040/// `AiSystemCard` model.
2041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2042pub struct AiSystemCard {
2043    pub system_name: String,
2044    pub provider: String,
2045    pub version: String,
2046    #[serde(default, skip_serializing_if = "Option::is_none")]
2047    pub risk_classification: Option<RiskClassification>,
2048    pub intended_purpose: String,
2049    pub technical_specifications: AiSystemCardTechnicalSpecifications,
2050    #[serde(default, skip_serializing_if = "Option::is_none")]
2051    pub training_data_summary: Option<String>,
2052    #[serde(default, skip_serializing_if = "Option::is_none")]
2053    pub performance_metrics: Option<serde_json::Map<String, serde_json::Value>>,
2054    pub limitations: Vec<String>,
2055    pub guardrails_summary: Vec<String>,
2056    pub human_oversight_measures: Vec<String>,
2057    pub generated_at: String,
2058}
2059
2060/// `AiSystemCardTechnicalSpecifications` model.
2061#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2062pub struct AiSystemCardTechnicalSpecifications {
2063    #[serde(default, skip_serializing_if = "Option::is_none")]
2064    pub model_provider: Option<String>,
2065    #[serde(default, skip_serializing_if = "Option::is_none")]
2066    pub model_ref: Option<String>,
2067    #[serde(default, skip_serializing_if = "Option::is_none")]
2068    pub max_context_tokens: Option<i64>,
2069    #[serde(default, skip_serializing_if = "Option::is_none")]
2070    pub built_in_tools: Option<Vec<String>>,
2071    #[serde(default, skip_serializing_if = "Option::is_none")]
2072    pub guardrails_enabled: Option<bool>,
2073    #[serde(default, skip_serializing_if = "Option::is_none")]
2074    pub guardrail_ids: Option<Vec<String>>,
2075}
2076
2077/// Keys as served by GET /governance/ambassador/ambassadors and …/{id} (measured 2026-09-10).
2078#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2079pub struct Ambassador {
2080    pub ambassador_id: String,
2081    pub tenant_id: String,
2082    pub name: String,
2083    pub role: AmbassadorRole,
2084    pub permissions: AmbassadorPermissions,
2085    pub created_at: String,
2086}
2087
2088/// `AmbassadorPermissions` model.
2089#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2090pub struct AmbassadorPermissions {
2091    pub can_veto: bool,
2092    pub can_audit: bool,
2093    pub can_propose: bool,
2094}
2095
2096/// `AmbassadorRequest` model.
2097#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2098pub struct AmbassadorRequest {
2099    pub request_id: String,
2100    pub tenant_id: String,
2101    pub from_agent_id: String,
2102    pub r#type: AmbassadorRequestType,
2103    pub subject: String,
2104    pub body: String,
2105    pub status: AmbassadorRequestStatus,
2106    #[serde(default, skip_serializing_if = "Option::is_none")]
2107    pub response: Option<String>,
2108    pub created_at: String,
2109    #[serde(default, skip_serializing_if = "Option::is_none")]
2110    pub resolved_at: Option<String>,
2111}
2112
2113/// `AmbassadorRequestStatus` enumeration.
2114#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2115pub enum AmbassadorRequestStatus {
2116    #[default]
2117    #[serde(rename = "pending")]
2118    Pending,
2119    #[serde(rename = "acknowledged")]
2120    Acknowledged,
2121    #[serde(rename = "resolved")]
2122    Resolved,
2123    /// A value the API introduced after this SDK was generated.
2124    #[serde(untagged)]
2125    Other(String),
2126}
2127
2128impl AmbassadorRequestStatus {
2129    /// The value as it appears on the wire.
2130    pub fn as_str(&self) -> &str {
2131        match self {
2132            Self::Pending => "pending",
2133            Self::Acknowledged => "acknowledged",
2134            Self::Resolved => "resolved",
2135            Self::Other(value) => value.as_str(),
2136        }
2137    }
2138}
2139
2140impl std::fmt::Display for AmbassadorRequestStatus {
2141    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2142        f.write_str(self.as_str())
2143    }
2144}
2145
2146impl From<&str> for AmbassadorRequestStatus {
2147    fn from(value: &str) -> Self {
2148        match value {
2149            "pending" => Self::Pending,
2150            "acknowledged" => Self::Acknowledged,
2151            "resolved" => Self::Resolved,
2152            other => Self::Other(other.to_string()),
2153        }
2154    }
2155}
2156
2157/// `AmbassadorRequestType` enumeration.
2158#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2159pub enum AmbassadorRequestType {
2160    #[default]
2161    #[serde(rename = "clarification")]
2162    Clarification,
2163    #[serde(rename = "approval")]
2164    Approval,
2165    #[serde(rename = "escalation")]
2166    Escalation,
2167    #[serde(rename = "report")]
2168    Report,
2169    /// A value the API introduced after this SDK was generated.
2170    #[serde(untagged)]
2171    Other(String),
2172}
2173
2174impl AmbassadorRequestType {
2175    /// The value as it appears on the wire.
2176    pub fn as_str(&self) -> &str {
2177        match self {
2178            Self::Clarification => "clarification",
2179            Self::Approval => "approval",
2180            Self::Escalation => "escalation",
2181            Self::Report => "report",
2182            Self::Other(value) => value.as_str(),
2183        }
2184    }
2185}
2186
2187impl std::fmt::Display for AmbassadorRequestType {
2188    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2189        f.write_str(self.as_str())
2190    }
2191}
2192
2193impl From<&str> for AmbassadorRequestType {
2194    fn from(value: &str) -> Self {
2195        match value {
2196            "clarification" => Self::Clarification,
2197            "approval" => Self::Approval,
2198            "escalation" => Self::Escalation,
2199            "report" => Self::Report,
2200            other => Self::Other(other.to_string()),
2201        }
2202    }
2203}
2204
2205/// `AmbassadorRole` enumeration.
2206#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2207pub enum AmbassadorRole {
2208    #[default]
2209    #[serde(rename = "founder")]
2210    Founder,
2211    #[serde(rename = "ambassador")]
2212    Ambassador,
2213    #[serde(rename = "observer")]
2214    Observer,
2215    /// A value the API introduced after this SDK was generated.
2216    #[serde(untagged)]
2217    Other(String),
2218}
2219
2220impl AmbassadorRole {
2221    /// The value as it appears on the wire.
2222    pub fn as_str(&self) -> &str {
2223        match self {
2224            Self::Founder => "founder",
2225            Self::Ambassador => "ambassador",
2226            Self::Observer => "observer",
2227            Self::Other(value) => value.as_str(),
2228        }
2229    }
2230}
2231
2232impl std::fmt::Display for AmbassadorRole {
2233    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2234        f.write_str(self.as_str())
2235    }
2236}
2237
2238impl From<&str> for AmbassadorRole {
2239    fn from(value: &str) -> Self {
2240        match value {
2241            "founder" => Self::Founder,
2242            "ambassador" => Self::Ambassador,
2243            "observer" => Self::Observer,
2244            other => Self::Other(other.to_string()),
2245        }
2246    }
2247}
2248
2249/// `AmbassadorVetoRequest` model.
2250#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2251pub struct AmbassadorVetoRequest {
2252    pub target_type: String,
2253    pub target_id: String,
2254    pub reason: String,
2255}
2256
2257/// `AmendConstitutionRequest` model.
2258#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2259pub struct AmendConstitutionRequest {
2260    pub rule_id: String,
2261    pub action: String,
2262    #[serde(default, skip_serializing_if = "Option::is_none")]
2263    pub rule: Option<serde_json::Map<String, serde_json::Value>>,
2264    #[serde(default, skip_serializing_if = "Option::is_none")]
2265    pub rationale: Option<String>,
2266}
2267
2268/// `AndroidTester` model.
2269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2270pub struct AndroidTester {
2271    pub email: String,
2272    #[serde(default, skip_serializing_if = "Option::is_none")]
2273    pub source: Option<String>,
2274    /// Truncated hash of the first submitting address. The raw IP is never stored.
2275    #[serde(default, skip_serializing_if = "Option::is_none")]
2276    pub first_ip_hash: Option<String>,
2277    pub created_at: String,
2278    pub emails_sent: i64,
2279    /// `last_email_at` under the name the admin table renders; null rather than absent so a column
2280    /// can bind to it.
2281    #[serde(default)]
2282    pub emailed_at: Option<String>,
2283    #[serde(default, skip_serializing_if = "Option::is_none")]
2284    pub send_failures: Option<i64>,
2285}
2286
2287/// `AndroidTesterSignupResult` model.
2288#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2289pub struct AndroidTesterSignupResult {
2290    pub ok: bool,
2291    pub already_registered: bool,
2292    /// Whether a letter went out on THIS request. False when no testing URL is configured, when
2293    /// SMTP refused, when the address is inside its 24-hour resend cooldown, or when the
2294    /// platform-wide hourly send ceiling is reached. The address is recorded in every one of those
2295    /// cases — a "here is your link" letter without a link is worse than silence — so a client must
2296    /// NOT read `emailed: false` as "testing has not opened yet".
2297    pub emailed: bool,
2298}
2299
2300/// `APIKeyResponse` model.
2301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2302pub struct APIKeyResponse {
2303    #[serde(default, skip_serializing_if = "Option::is_none")]
2304    pub key_id: Option<String>,
2305    #[serde(default, skip_serializing_if = "Option::is_none")]
2306    pub prefix: Option<String>,
2307    /// Shown once. Save immediately.
2308    #[serde(default, skip_serializing_if = "Option::is_none")]
2309    pub raw_key: Option<String>,
2310    #[serde(default, skip_serializing_if = "Option::is_none")]
2311    pub name: Option<String>,
2312    #[serde(default, skip_serializing_if = "Option::is_none")]
2313    pub scopes: Option<Vec<String>>,
2314    #[serde(default, skip_serializing_if = "Option::is_none")]
2315    pub created_at: Option<String>,
2316    #[serde(default, skip_serializing_if = "Option::is_none")]
2317    pub warning: Option<String>,
2318}
2319
2320/// An API key as listed. The secret is shown once, at creation, and never here.
2321#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2322pub struct APIKeySummary {
2323    pub key_id: String,
2324    pub name: String,
2325    pub prefix: String,
2326    /// What the key IS: `session` was minted by an OTP/OAuth sign-in and carries a user_id;
2327    /// `api_key` was created deliberately from Settings or the CLI.
2328    pub kind: APIKeySummaryKind,
2329    pub scopes: Vec<String>,
2330    pub status: APIKeySummaryStatus,
2331    pub created_at: String,
2332    #[serde(default, skip_serializing_if = "Option::is_none")]
2333    pub expires_at: Option<String>,
2334    #[serde(default, skip_serializing_if = "Option::is_none")]
2335    pub last_used_at: Option<String>,
2336}
2337
2338/// What the key IS: `session` was minted by an OTP/OAuth sign-in and carries a user_id;
2339/// `api_key` was created deliberately from Settings or the CLI.
2340#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2341pub enum APIKeySummaryKind {
2342    #[default]
2343    #[serde(rename = "session")]
2344    Session,
2345    #[serde(rename = "api_key")]
2346    APIKey,
2347    /// A value the API introduced after this SDK was generated.
2348    #[serde(untagged)]
2349    Other(String),
2350}
2351
2352impl APIKeySummaryKind {
2353    /// The value as it appears on the wire.
2354    pub fn as_str(&self) -> &str {
2355        match self {
2356            Self::Session => "session",
2357            Self::APIKey => "api_key",
2358            Self::Other(value) => value.as_str(),
2359        }
2360    }
2361}
2362
2363impl std::fmt::Display for APIKeySummaryKind {
2364    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2365        f.write_str(self.as_str())
2366    }
2367}
2368
2369impl From<&str> for APIKeySummaryKind {
2370    fn from(value: &str) -> Self {
2371        match value {
2372            "session" => Self::Session,
2373            "api_key" => Self::APIKey,
2374            other => Self::Other(other.to_string()),
2375        }
2376    }
2377}
2378
2379/// `APIKeySummaryStatus` enumeration.
2380#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2381pub enum APIKeySummaryStatus {
2382    #[default]
2383    #[serde(rename = "active")]
2384    Active,
2385    #[serde(rename = "revoked")]
2386    Revoked,
2387    /// A value the API introduced after this SDK was generated.
2388    #[serde(untagged)]
2389    Other(String),
2390}
2391
2392impl APIKeySummaryStatus {
2393    /// The value as it appears on the wire.
2394    pub fn as_str(&self) -> &str {
2395        match self {
2396            Self::Active => "active",
2397            Self::Revoked => "revoked",
2398            Self::Other(value) => value.as_str(),
2399        }
2400    }
2401}
2402
2403impl std::fmt::Display for APIKeySummaryStatus {
2404    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2405        f.write_str(self.as_str())
2406    }
2407}
2408
2409impl From<&str> for APIKeySummaryStatus {
2410    fn from(value: &str) -> Self {
2411        match value {
2412            "active" => Self::Active,
2413            "revoked" => Self::Revoked,
2414            other => Self::Other(other.to_string()),
2415        }
2416    }
2417}
2418
2419/// `AppleNativeAuthRequest` model.
2420#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2421pub struct AppleNativeAuthRequest {
2422    /// Apple-signed JWT from `ASAuthorizationAppleIDCredential.identityToken`.
2423    pub identity_token: String,
2424    /// Apple's stable `userIdentifier` (informational only — server reads `sub` from the JWT).
2425    #[serde(default, skip_serializing_if = "Option::is_none")]
2426    pub user: Option<String>,
2427    /// User profile name from Apple. Apple supplies this only on first sign-in; iOS should cache it
2428    /// locally and resend if the user record needs to be bootstrapped.
2429    #[serde(default, skip_serializing_if = "Option::is_none")]
2430    pub name: Option<String>,
2431    /// Device name (e.g. `iPhone 15 Pro`) surfaced on the minted api_key for `/me/sessions`.
2432    #[serde(default, skip_serializing_if = "Option::is_none")]
2433    pub device_label: Option<String>,
2434}
2435
2436/// `AppleNativeAuthResponse` model.
2437#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2438pub struct AppleNativeAuthResponse {
2439    pub api_key: String,
2440    pub email: String,
2441}
2442
2443/// `ApplyProgramRequest` model.
2444#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2445pub struct ApplyProgramRequest {
2446    pub session_id: String,
2447    #[serde(default, skip_serializing_if = "Option::is_none")]
2448    pub start_date: Option<String>,
2449    #[serde(default, skip_serializing_if = "Option::is_none")]
2450    pub agent_id: Option<String>,
2451}
2452
2453/// `ApplyProgramResponse` model.
2454#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2455pub struct ApplyProgramResponse {
2456    pub applied: bool,
2457    pub program_id: String,
2458    pub todos: Vec<Todo>,
2459}
2460
2461/// `ApproveRunResponse` model.
2462#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2463pub struct ApproveRunResponse {
2464    pub approved: bool,
2465    pub run_id: String,
2466}
2467
2468/// `ArbiterCase` model.
2469#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2470pub struct ArbiterCase {
2471    pub case_id: String,
2472    pub tenant_id: String,
2473    pub filed_by: String,
2474    pub against_agent_id: String,
2475    pub rule_ids: Vec<String>,
2476    pub description: String,
2477    pub evidence: serde_json::Map<String, serde_json::Value>,
2478    pub status: ArbiterCaseStatus,
2479    #[serde(default, skip_serializing_if = "Option::is_none")]
2480    pub assigned_arbiter_id: Option<String>,
2481    pub created_at: String,
2482    pub deadline: String,
2483    pub updated_at: String,
2484}
2485
2486/// `ArbiterCaseStatus` enumeration.
2487#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2488pub enum ArbiterCaseStatus {
2489    #[default]
2490    #[serde(rename = "open")]
2491    Open,
2492    #[serde(rename = "under_review")]
2493    UnderReview,
2494    #[serde(rename = "ruled")]
2495    Ruled,
2496    #[serde(rename = "appealed")]
2497    Appealed,
2498    #[serde(rename = "closed")]
2499    Closed,
2500    /// A value the API introduced after this SDK was generated.
2501    #[serde(untagged)]
2502    Other(String),
2503}
2504
2505impl ArbiterCaseStatus {
2506    /// The value as it appears on the wire.
2507    pub fn as_str(&self) -> &str {
2508        match self {
2509            Self::Open => "open",
2510            Self::UnderReview => "under_review",
2511            Self::Ruled => "ruled",
2512            Self::Appealed => "appealed",
2513            Self::Closed => "closed",
2514            Self::Other(value) => value.as_str(),
2515        }
2516    }
2517}
2518
2519impl std::fmt::Display for ArbiterCaseStatus {
2520    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2521        f.write_str(self.as_str())
2522    }
2523}
2524
2525impl From<&str> for ArbiterCaseStatus {
2526    fn from(value: &str) -> Self {
2527        match value {
2528            "open" => Self::Open,
2529            "under_review" => Self::UnderReview,
2530            "ruled" => Self::Ruled,
2531            "appealed" => Self::Appealed,
2532            "closed" => Self::Closed,
2533            other => Self::Other(other.to_string()),
2534        }
2535    }
2536}
2537
2538/// `ArbiterRegistry` model.
2539#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2540pub struct ArbiterRegistry {
2541    #[serde(default, skip_serializing_if = "Option::is_none")]
2542    pub arbiter_agent_ids: Option<Vec<String>>,
2543    #[serde(default, skip_serializing_if = "Option::is_none")]
2544    pub max_appeals: Option<i64>,
2545    #[serde(default, skip_serializing_if = "Option::is_none")]
2546    pub panel_size: Option<i64>,
2547    #[serde(default, skip_serializing_if = "Option::is_none")]
2548    pub ruling_deadline_hours: Option<i64>,
2549    #[serde(default, skip_serializing_if = "Option::is_none")]
2550    pub tenant_id: Option<String>,
2551    #[serde(default, skip_serializing_if = "Option::is_none")]
2552    pub updated_at: Option<String>,
2553}
2554
2555/// `Artifact` model.
2556#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2557pub struct Artifact {
2558    pub artifact_id: String,
2559    pub run_id: String,
2560    #[serde(default, skip_serializing_if = "Option::is_none")]
2561    pub tenant_id: Option<String>,
2562    pub name: String,
2563    pub mime_type: String,
2564    pub size_bytes: i64,
2565    #[serde(default, skip_serializing_if = "Option::is_none")]
2566    pub storage_ref: Option<String>,
2567    pub created_at: String,
2568}
2569
2570/// `AssignWorkspaceRequest` model.
2571#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2572pub struct AssignWorkspaceRequest {
2573    #[serde(default, skip_serializing_if = "Option::is_none")]
2574    pub agent_id: Option<String>,
2575    #[serde(default, skip_serializing_if = "Option::is_none")]
2576    pub team_id: Option<String>,
2577    #[serde(default, skip_serializing_if = "Option::is_none")]
2578    pub company_id: Option<String>,
2579}
2580
2581/// One audit-log row as served by GET /runs/{runId}/audit-log and GET
2582/// /sessions/{sessionId}/audit-log. Keys measured 2026-09-10 on the e2e-canon tenant (runs and
2583/// sessions alike).
2584#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2585pub struct AuditLogEntry {
2586    pub entry_id: String,
2587    pub action: String,
2588    pub actor_tenant_id: String,
2589    pub target_type: String,
2590    pub target_id: String,
2591    pub details: serde_json::Map<String, serde_json::Value>,
2592    pub ip_address: String,
2593    pub timestamp: String,
2594}
2595
2596/// `AuthProvider` model.
2597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2598pub struct AuthProvider {
2599    pub email: String,
2600    pub id: String,
2601    pub linked: bool,
2602    #[serde(default, skip_serializing_if = "Option::is_none")]
2603    pub linked_at: Option<String>,
2604    #[serde(default, skip_serializing_if = "Option::is_none")]
2605    pub sub: Option<String>,
2606}
2607
2608/// Body for POST /api/v1/auth/verify-code. No request_id; code is bound to email only.
2609#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2610pub struct AuthVerifyCodeRequest {
2611    /// Same email used in request-code
2612    pub email: String,
2613    /// OTP from email (6 digits); spaces are stripped server-side
2614    pub code: String,
2615}
2616
2617/// Success response: API key to use as Bearer token
2618#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2619pub struct AuthVerifyCodeResponse {
2620    /// uarp_\<prefix\>_\<secret\>; store and use as Authorization: Bearer \<api_key\>
2621    pub api_key: String,
2622}
2623
2624/// `Ballot` model.
2625#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2626pub struct Ballot {
2627    pub proposal_id: String,
2628    pub agent_id: String,
2629    pub vote: BallotVote,
2630    pub weight: f64,
2631    #[serde(default, skip_serializing_if = "Option::is_none")]
2632    pub reasoning: Option<String>,
2633    #[serde(default, skip_serializing_if = "Option::is_none")]
2634    pub signature: Option<String>,
2635    pub cast_at: String,
2636}
2637
2638/// `BallotVote` enumeration.
2639#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2640pub enum BallotVote {
2641    #[default]
2642    #[serde(rename = "approve")]
2643    Approve,
2644    #[serde(rename = "reject")]
2645    Reject,
2646    #[serde(rename = "abstain")]
2647    Abstain,
2648    /// A value the API introduced after this SDK was generated.
2649    #[serde(untagged)]
2650    Other(String),
2651}
2652
2653impl BallotVote {
2654    /// The value as it appears on the wire.
2655    pub fn as_str(&self) -> &str {
2656        match self {
2657            Self::Approve => "approve",
2658            Self::Reject => "reject",
2659            Self::Abstain => "abstain",
2660            Self::Other(value) => value.as_str(),
2661        }
2662    }
2663}
2664
2665impl std::fmt::Display for BallotVote {
2666    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2667        f.write_str(self.as_str())
2668    }
2669}
2670
2671impl From<&str> for BallotVote {
2672    fn from(value: &str) -> Self {
2673        match value {
2674            "approve" => Self::Approve,
2675            "reject" => Self::Reject,
2676            "abstain" => Self::Abstain,
2677            other => Self::Other(other.to_string()),
2678        }
2679    }
2680}
2681
2682/// `BlogConfig` model.
2683#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2684pub struct BlogConfig {
2685    pub enabled: bool,
2686    pub title: String,
2687    pub description: String,
2688    #[serde(default)]
2689    pub agent_id: Option<String>,
2690    /// Derived, never sent by a client: set from the caller's tenant when `agent_id` is assigned,
2691    /// so the cron can run the author without a request context.
2692    #[serde(default)]
2693    pub agent_tenant_id: Option<String>,
2694    pub frequency: BlogConfigFrequency,
2695    pub schedule_hour: i64,
2696    pub schedule_weekday: i64,
2697    pub topic_prompt: String,
2698    pub conditions: String,
2699    pub auto_publish: bool,
2700    /// Drives scheduling. Null until the first successful generation.
2701    #[serde(default)]
2702    pub last_generated_at: Option<String>,
2703}
2704
2705/// `BlogConfigFrequency` enumeration.
2706#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2707pub enum BlogConfigFrequency {
2708    #[default]
2709    #[serde(rename = "manual")]
2710    Manual,
2711    #[serde(rename = "hourly")]
2712    Hourly,
2713    #[serde(rename = "daily")]
2714    Daily,
2715    #[serde(rename = "weekly")]
2716    Weekly,
2717    /// A value the API introduced after this SDK was generated.
2718    #[serde(untagged)]
2719    Other(String),
2720}
2721
2722impl BlogConfigFrequency {
2723    /// The value as it appears on the wire.
2724    pub fn as_str(&self) -> &str {
2725        match self {
2726            Self::Manual => "manual",
2727            Self::Hourly => "hourly",
2728            Self::Daily => "daily",
2729            Self::Weekly => "weekly",
2730            Self::Other(value) => value.as_str(),
2731        }
2732    }
2733}
2734
2735impl std::fmt::Display for BlogConfigFrequency {
2736    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2737        f.write_str(self.as_str())
2738    }
2739}
2740
2741impl From<&str> for BlogConfigFrequency {
2742    fn from(value: &str) -> Self {
2743        match value {
2744            "manual" => Self::Manual,
2745            "hourly" => Self::Hourly,
2746            "daily" => Self::Daily,
2747            "weekly" => Self::Weekly,
2748            other => Self::Other(other.to_string()),
2749        }
2750    }
2751}
2752
2753/// `BlogPost` model.
2754#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2755pub struct BlogPost {
2756    pub id: String,
2757    /// Derived from the title and unique. Re-minted whenever the title changes.
2758    pub slug: String,
2759    pub title: String,
2760    pub body: String,
2761    pub tags: Vec<String>,
2762    pub status: BlogPostStatus,
2763    /// Who last shaped it, not who started it — an edit to the title or body of an agent-written
2764    /// post re-stamps this to `manual`.
2765    pub source: BlogPostSource,
2766    #[serde(default)]
2767    pub agent_id: Option<String>,
2768    #[serde(default)]
2769    pub run_id: Option<String>,
2770    pub created_at: String,
2771    pub updated_at: String,
2772    /// Null while a draft. Stamped on transition to published and cleared on a return to draft, so
2773    /// a republished post carries a new timestamp rather than its original.
2774    #[serde(default)]
2775    pub published_at: Option<String>,
2776}
2777
2778/// Who last shaped it, not who started it — an edit to the title or body of an agent-written
2779/// post re-stamps this to `manual`.
2780#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2781pub enum BlogPostSource {
2782    #[default]
2783    #[serde(rename = "agent")]
2784    Agent,
2785    #[serde(rename = "manual")]
2786    Manual,
2787    /// A value the API introduced after this SDK was generated.
2788    #[serde(untagged)]
2789    Other(String),
2790}
2791
2792impl BlogPostSource {
2793    /// The value as it appears on the wire.
2794    pub fn as_str(&self) -> &str {
2795        match self {
2796            Self::Agent => "agent",
2797            Self::Manual => "manual",
2798            Self::Other(value) => value.as_str(),
2799        }
2800    }
2801}
2802
2803impl std::fmt::Display for BlogPostSource {
2804    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2805        f.write_str(self.as_str())
2806    }
2807}
2808
2809impl From<&str> for BlogPostSource {
2810    fn from(value: &str) -> Self {
2811        match value {
2812            "agent" => Self::Agent,
2813            "manual" => Self::Manual,
2814            other => Self::Other(other.to_string()),
2815        }
2816    }
2817}
2818
2819/// `BlogPostStatus` enumeration.
2820#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2821pub enum BlogPostStatus {
2822    #[default]
2823    #[serde(rename = "draft")]
2824    Draft,
2825    #[serde(rename = "published")]
2826    Published,
2827    /// A value the API introduced after this SDK was generated.
2828    #[serde(untagged)]
2829    Other(String),
2830}
2831
2832impl BlogPostStatus {
2833    /// The value as it appears on the wire.
2834    pub fn as_str(&self) -> &str {
2835        match self {
2836            Self::Draft => "draft",
2837            Self::Published => "published",
2838            Self::Other(value) => value.as_str(),
2839        }
2840    }
2841}
2842
2843impl std::fmt::Display for BlogPostStatus {
2844    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2845        f.write_str(self.as_str())
2846    }
2847}
2848
2849impl From<&str> for BlogPostStatus {
2850    fn from(value: &str) -> Self {
2851        match value {
2852            "draft" => Self::Draft,
2853            "published" => Self::Published,
2854            other => Self::Other(other.to_string()),
2855        }
2856    }
2857}
2858
2859/// `BootstrapAmbassadorResponse` model.
2860#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2861pub struct BootstrapAmbassadorResponse {
2862    #[serde(default, skip_serializing_if = "Option::is_none")]
2863    pub ambassador_id: Option<String>,
2864}
2865
2866/// `BootstrapRequest` model.
2867#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2868pub struct BootstrapRequest {
2869    /// Server default: `"Admin Tenant"`.
2870    #[serde(default, skip_serializing_if = "Option::is_none")]
2871    pub tenant_name: Option<String>,
2872    /// Server default: `"admin"`.
2873    #[serde(default, skip_serializing_if = "Option::is_none")]
2874    pub tenant_slug: Option<String>,
2875}
2876
2877/// `BridgeAgentSummary` model.
2878#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2879pub struct BridgeAgentSummary {
2880    pub agent_id: String,
2881    pub machine_id: String,
2882    pub machine_name: String,
2883    pub capabilities: Vec<String>,
2884    pub working_directory: String,
2885    pub status: String,
2886    pub last_heartbeat: String,
2887}
2888
2889/// `BridgeConnection` model.
2890#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2891pub struct BridgeConnection {
2892    pub agent_id: String,
2893    #[serde(default, skip_serializing_if = "Option::is_none")]
2894    pub tenant_id: Option<String>,
2895    pub machine_id: String,
2896    #[serde(default, skip_serializing_if = "Option::is_none")]
2897    pub machine_name: Option<String>,
2898    pub capabilities: Vec<String>,
2899    pub working_directory: String,
2900    pub version: String,
2901    pub last_heartbeat: String,
2902    pub status: AgentSummaryBridgeStatus,
2903    #[serde(default, skip_serializing_if = "Option::is_none")]
2904    pub registered_at: Option<String>,
2905    #[serde(default, skip_serializing_if = "Option::is_none")]
2906    pub os: Option<String>,
2907}
2908
2909/// `BridgeDelegateRequest` model.
2910#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2911pub struct BridgeDelegateRequest {
2912    pub agent_id: String,
2913    pub context: serde_json::Map<String, serde_json::Value>,
2914}
2915
2916/// `BridgeDelegateResponse` model.
2917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2918pub struct BridgeDelegateResponse {
2919    #[serde(default, skip_serializing_if = "Option::is_none")]
2920    pub success: Option<bool>,
2921    #[serde(default, skip_serializing_if = "Option::is_none")]
2922    pub task_id: Option<String>,
2923}
2924
2925/// `BridgeDeregisterRequest` model.
2926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2927pub struct BridgeDeregisterRequest {
2928    pub machine_id: String,
2929}
2930
2931/// `BridgeDeregisterResponse` model.
2932#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2933pub struct BridgeDeregisterResponse {
2934    pub status: BridgeDeregisterResponseStatus,
2935}
2936
2937/// `BridgeDeregisterResponseStatus` enumeration.
2938#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2939pub enum BridgeDeregisterResponseStatus {
2940    #[default]
2941    #[serde(rename = "offline")]
2942    Offline,
2943    /// A value the API introduced after this SDK was generated.
2944    #[serde(untagged)]
2945    Other(String),
2946}
2947
2948impl BridgeDeregisterResponseStatus {
2949    /// The value as it appears on the wire.
2950    pub fn as_str(&self) -> &str {
2951        match self {
2952            Self::Offline => "offline",
2953            Self::Other(value) => value.as_str(),
2954        }
2955    }
2956}
2957
2958impl std::fmt::Display for BridgeDeregisterResponseStatus {
2959    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2960        f.write_str(self.as_str())
2961    }
2962}
2963
2964impl From<&str> for BridgeDeregisterResponseStatus {
2965    fn from(value: &str) -> Self {
2966        match value {
2967            "offline" => Self::Offline,
2968            other => Self::Other(other.to_string()),
2969        }
2970    }
2971}
2972
2973/// `BridgeHeartbeatRequest` model.
2974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2975pub struct BridgeHeartbeatRequest {
2976    #[serde(default, skip_serializing_if = "Option::is_none")]
2977    pub machine_id: Option<String>,
2978    #[serde(default, skip_serializing_if = "Option::is_none")]
2979    pub agent_id: Option<String>,
2980    #[serde(default, skip_serializing_if = "Option::is_none")]
2981    pub status: Option<String>,
2982}
2983
2984/// `BridgeHeartbeatResponse` model.
2985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2986pub struct BridgeHeartbeatResponse {
2987    pub ok: bool,
2988    #[serde(default, skip_serializing_if = "Option::is_none")]
2989    pub timestamp: Option<String>,
2990}
2991
2992/// `BridgeInstalledSpec` model.
2993#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2994pub struct BridgeInstalledSpec {
2995    /// `@scope/name`.
2996    pub spec_id: String,
2997    /// Resolved exactly, never a range.
2998    #[serde(default, skip_serializing_if = "Option::is_none")]
2999    pub version: Option<String>,
3000    /// Tool names the SPEC registered into the local runtime.
3001    #[serde(default, skip_serializing_if = "Option::is_none")]
3002    pub tools: Option<Vec<String>>,
3003    pub status: BridgeInstalledSpecStatus,
3004    /// Failure detail when `status` is `failed` — artifact 404, SHA mismatch, capability conflict.
3005    #[serde(default, skip_serializing_if = "Option::is_none")]
3006    pub error: Option<String>,
3007    #[serde(default, skip_serializing_if = "Option::is_none")]
3008    pub reported_at: Option<String>,
3009}
3010
3011/// `BridgeInstalledSpecStatus` enumeration.
3012#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3013pub enum BridgeInstalledSpecStatus {
3014    #[default]
3015    #[serde(rename = "installed")]
3016    Installed,
3017    #[serde(rename = "failed")]
3018    Failed,
3019    /// A value the API introduced after this SDK was generated.
3020    #[serde(untagged)]
3021    Other(String),
3022}
3023
3024impl BridgeInstalledSpecStatus {
3025    /// The value as it appears on the wire.
3026    pub fn as_str(&self) -> &str {
3027        match self {
3028            Self::Installed => "installed",
3029            Self::Failed => "failed",
3030            Self::Other(value) => value.as_str(),
3031        }
3032    }
3033}
3034
3035impl std::fmt::Display for BridgeInstalledSpecStatus {
3036    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3037        f.write_str(self.as_str())
3038    }
3039}
3040
3041impl From<&str> for BridgeInstalledSpecStatus {
3042    fn from(value: &str) -> Self {
3043        match value {
3044            "installed" => Self::Installed,
3045            "failed" => Self::Failed,
3046            other => Self::Other(other.to_string()),
3047        }
3048    }
3049}
3050
3051/// `BridgePendingTask` model.
3052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3053pub struct BridgePendingTask {
3054    pub task_id: String,
3055    pub agent_id: String,
3056    #[serde(default, skip_serializing_if = "Option::is_none")]
3057    pub session_id: Option<String>,
3058    #[serde(default, skip_serializing_if = "Option::is_none")]
3059    pub run_id: Option<String>,
3060    pub input: BridgePendingTaskInput,
3061    pub queued_at: String,
3062    pub expires_at: String,
3063    pub source: BridgePendingTaskSource,
3064}
3065
3066/// `BridgePendingTaskInput` model.
3067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3068pub struct BridgePendingTaskInput {
3069    pub message: String,
3070    #[serde(default, skip_serializing_if = "Option::is_none")]
3071    pub conversation_history: Option<Vec<BridgePendingTaskInputConversationHistoryItem>>,
3072    /// Attachment ids the user added to this message. Fetch each with GET /files/{fileId}/content
3073    /// (scope files:read). Absent when the message had no attachment.
3074    #[serde(default, skip_serializing_if = "Option::is_none")]
3075    pub files: Option<Vec<String>>,
3076    /// The attachments, in the same order as `files`, with what a client needs BEFORE it spends a
3077    /// fetch: a 40 MB video and a 2 KB note are not the same decision, and an error that cannot
3078    /// name the file leaves the model answering about a document it never opened. This is the
3079    /// SUBSET of `files` whose artifact record still exists when the task is enqueued — a run
3080    /// dispatched from a schedule was written earlier and the file may have been deleted since. An
3081    /// id present in `files` with no entry here means the file is gone, not that its metadata was
3082    /// omitted; fetching it will 404, which is how the client reports the attachment as not
3083    /// delivered.
3084    #[serde(default, skip_serializing_if = "Option::is_none")]
3085    pub attachments: Option<Vec<BridgePendingTaskInputAttachment>>,
3086}
3087
3088/// `BridgePendingTaskInputAttachment` model.
3089#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3090pub struct BridgePendingTaskInputAttachment {
3091    pub file_id: String,
3092    pub filename: String,
3093    pub mime_type: String,
3094    pub size_bytes: i64,
3095}
3096
3097/// `BridgePendingTaskInputConversationHistoryItem` model.
3098#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3099pub struct BridgePendingTaskInputConversationHistoryItem {
3100    #[serde(default, skip_serializing_if = "Option::is_none")]
3101    pub role: Option<String>,
3102    #[serde(default, skip_serializing_if = "Option::is_none")]
3103    pub content: Option<String>,
3104}
3105
3106/// `BridgePendingTaskSource` model.
3107#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3108pub struct BridgePendingTaskSource {
3109    pub r#type: BridgePendingTaskSourceType,
3110    #[serde(default, skip_serializing_if = "Option::is_none")]
3111    pub agent_id: Option<String>,
3112    #[serde(default, skip_serializing_if = "Option::is_none")]
3113    pub user_id: Option<String>,
3114}
3115
3116/// `BridgePendingTaskSourceType` enumeration.
3117#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3118pub enum BridgePendingTaskSourceType {
3119    #[default]
3120    #[serde(rename = "head_agent")]
3121    HeadAgent,
3122    #[serde(rename = "user")]
3123    User,
3124    #[serde(rename = "team")]
3125    Team,
3126    /// A value the API introduced after this SDK was generated.
3127    #[serde(untagged)]
3128    Other(String),
3129}
3130
3131impl BridgePendingTaskSourceType {
3132    /// The value as it appears on the wire.
3133    pub fn as_str(&self) -> &str {
3134        match self {
3135            Self::HeadAgent => "head_agent",
3136            Self::User => "user",
3137            Self::Team => "team",
3138            Self::Other(value) => value.as_str(),
3139        }
3140    }
3141}
3142
3143impl std::fmt::Display for BridgePendingTaskSourceType {
3144    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3145        f.write_str(self.as_str())
3146    }
3147}
3148
3149impl From<&str> for BridgePendingTaskSourceType {
3150    fn from(value: &str) -> Self {
3151        match value {
3152            "head_agent" => Self::HeadAgent,
3153            "user" => Self::User,
3154            "team" => Self::Team,
3155            other => Self::Other(other.to_string()),
3156        }
3157    }
3158}
3159
3160/// `BridgePollResponse` model.
3161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3162pub struct BridgePollResponse {
3163    pub tasks: Vec<BridgePendingTask>,
3164}
3165
3166/// `BridgeRegisterRequest` model.
3167#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3168pub struct BridgeRegisterRequest {
3169    pub machine_id: String,
3170    pub capabilities: Vec<String>,
3171    pub working_directory: String,
3172    pub version: String,
3173    #[serde(default, skip_serializing_if = "Option::is_none")]
3174    pub machine_name: Option<String>,
3175    #[serde(default, skip_serializing_if = "Option::is_none")]
3176    pub agent_name: Option<String>,
3177    #[serde(default, skip_serializing_if = "Option::is_none")]
3178    pub os: Option<String>,
3179}
3180
3181/// `BridgeRegisterResponse` model.
3182#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3183pub struct BridgeRegisterResponse {
3184    pub agent_id: String,
3185    /// Always `online`.
3186    pub status: String,
3187    #[serde(default, skip_serializing_if = "Option::is_none")]
3188    pub registered: Option<bool>,
3189}
3190
3191/// `BridgeStatusResponse` model.
3192#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3193pub struct BridgeStatusResponse {
3194    pub connections: Vec<BridgeConnection>,
3195}
3196
3197/// A progress frame from the Snaga bridge (BridgeTaskEvent in @uarp/types); `type` decides
3198/// which optional fields are present.
3199#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3200pub struct BridgeTaskEvent {
3201    #[serde(default, skip_serializing_if = "Option::is_none")]
3202    pub event_id: Option<String>,
3203    pub r#type: BridgeTaskEventType,
3204    pub timestamp: String,
3205    #[serde(default, skip_serializing_if = "Option::is_none")]
3206    pub approval_id: Option<String>,
3207    #[serde(default, skip_serializing_if = "Option::is_none")]
3208    pub status: Option<String>,
3209    #[serde(default, skip_serializing_if = "Option::is_none")]
3210    pub options: Option<Vec<String>>,
3211    #[serde(default, skip_serializing_if = "Option::is_none")]
3212    pub kind: Option<String>,
3213    #[serde(default, skip_serializing_if = "Option::is_none")]
3214    pub message: Option<String>,
3215    #[serde(default, skip_serializing_if = "Option::is_none")]
3216    pub tool_name: Option<String>,
3217    #[serde(default, skip_serializing_if = "Option::is_none")]
3218    pub tool_args_preview: Option<String>,
3219    #[serde(default, skip_serializing_if = "Option::is_none")]
3220    pub tool_call_id: Option<String>,
3221    #[serde(default, skip_serializing_if = "Option::is_none")]
3222    pub tool_result_preview: Option<String>,
3223    #[serde(default, skip_serializing_if = "Option::is_none")]
3224    pub tool_duration_ms: Option<i64>,
3225    #[serde(default, skip_serializing_if = "Option::is_none")]
3226    pub content: Option<String>,
3227    #[serde(default, skip_serializing_if = "Option::is_none")]
3228    pub metrics: Option<BridgeTaskEventMetrics>,
3229    #[serde(default, skip_serializing_if = "Option::is_none")]
3230    pub input_tokens: Option<i64>,
3231    #[serde(default, skip_serializing_if = "Option::is_none")]
3232    pub output_tokens: Option<i64>,
3233    #[serde(default, skip_serializing_if = "Option::is_none")]
3234    pub error: Option<String>,
3235    #[serde(default, skip_serializing_if = "Option::is_none")]
3236    pub output: Option<String>,
3237    #[serde(default, skip_serializing_if = "Option::is_none")]
3238    pub capabilities: Option<Vec<String>>,
3239    #[serde(default, skip_serializing_if = "Option::is_none")]
3240    pub working_directory: Option<String>,
3241    #[serde(default, skip_serializing_if = "Option::is_none")]
3242    pub hostname: Option<String>,
3243    #[serde(default, skip_serializing_if = "Option::is_none")]
3244    pub platform: Option<String>,
3245    #[serde(default, skip_serializing_if = "Option::is_none")]
3246    pub reason: Option<String>,
3247    #[serde(default, skip_serializing_if = "Option::is_none")]
3248    pub context: Option<String>,
3249    #[serde(default, skip_serializing_if = "Option::is_none")]
3250    pub model: Option<String>,
3251}
3252
3253/// `BridgeTaskEventMetrics` model.
3254#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3255pub struct BridgeTaskEventMetrics {
3256    #[serde(default, skip_serializing_if = "Option::is_none")]
3257    pub tool_calls_count: Option<i64>,
3258    #[serde(default, skip_serializing_if = "Option::is_none")]
3259    pub files_modified: Option<i64>,
3260    #[serde(default, skip_serializing_if = "Option::is_none")]
3261    pub commands_executed: Option<i64>,
3262    #[serde(default, skip_serializing_if = "Option::is_none")]
3263    pub llm_calls: Option<i64>,
3264    #[serde(default, skip_serializing_if = "Option::is_none")]
3265    pub execution_time_ms: Option<i64>,
3266}
3267
3268/// `BridgeTaskEventType` enumeration.
3269#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3270pub enum BridgeTaskEventType {
3271    #[default]
3272    #[serde(rename = "status")]
3273    Status,
3274    #[serde(rename = "tool_call")]
3275    ToolCall,
3276    #[serde(rename = "tool_result")]
3277    ToolResult,
3278    #[serde(rename = "content")]
3279    Content,
3280    #[serde(rename = "thinking")]
3281    Thinking,
3282    #[serde(rename = "text")]
3283    Text,
3284    #[serde(rename = "metrics")]
3285    Metrics,
3286    #[serde(rename = "approval_request")]
3287    ApprovalRequest,
3288    #[serde(rename = "error")]
3289    Error,
3290    #[serde(rename = "completed")]
3291    Completed,
3292    #[serde(rename = "capability_report")]
3293    CapabilityReport,
3294    #[serde(rename = "escalation")]
3295    Escalation,
3296    #[serde(rename = "approval_denied")]
3297    ApprovalDenied,
3298    /// A value the API introduced after this SDK was generated.
3299    #[serde(untagged)]
3300    Other(String),
3301}
3302
3303impl BridgeTaskEventType {
3304    /// The value as it appears on the wire.
3305    pub fn as_str(&self) -> &str {
3306        match self {
3307            Self::Status => "status",
3308            Self::ToolCall => "tool_call",
3309            Self::ToolResult => "tool_result",
3310            Self::Content => "content",
3311            Self::Thinking => "thinking",
3312            Self::Text => "text",
3313            Self::Metrics => "metrics",
3314            Self::ApprovalRequest => "approval_request",
3315            Self::Error => "error",
3316            Self::Completed => "completed",
3317            Self::CapabilityReport => "capability_report",
3318            Self::Escalation => "escalation",
3319            Self::ApprovalDenied => "approval_denied",
3320            Self::Other(value) => value.as_str(),
3321        }
3322    }
3323}
3324
3325impl std::fmt::Display for BridgeTaskEventType {
3326    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3327        f.write_str(self.as_str())
3328    }
3329}
3330
3331impl From<&str> for BridgeTaskEventType {
3332    fn from(value: &str) -> Self {
3333        match value {
3334            "status" => Self::Status,
3335            "tool_call" => Self::ToolCall,
3336            "tool_result" => Self::ToolResult,
3337            "content" => Self::Content,
3338            "thinking" => Self::Thinking,
3339            "text" => Self::Text,
3340            "metrics" => Self::Metrics,
3341            "approval_request" => Self::ApprovalRequest,
3342            "error" => Self::Error,
3343            "completed" => Self::Completed,
3344            "capability_report" => Self::CapabilityReport,
3345            "escalation" => Self::Escalation,
3346            "approval_denied" => Self::ApprovalDenied,
3347            other => Self::Other(other.to_string()),
3348        }
3349    }
3350}
3351
3352/// `BulkDeleteNotificationsResponse` model.
3353#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3354pub struct BulkDeleteNotificationsResponse {
3355    pub deleted: i64,
3356    pub scope: BulkDeleteNotificationsScope,
3357}
3358
3359/// `BulkDeleteNotificationsScope` enumeration.
3360#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3361pub enum BulkDeleteNotificationsScope {
3362    #[default]
3363    #[serde(rename = "read")]
3364    Read,
3365    #[serde(rename = "all")]
3366    All,
3367    /// A value the API introduced after this SDK was generated.
3368    #[serde(untagged)]
3369    Other(String),
3370}
3371
3372impl BulkDeleteNotificationsScope {
3373    /// The value as it appears on the wire.
3374    pub fn as_str(&self) -> &str {
3375        match self {
3376            Self::Read => "read",
3377            Self::All => "all",
3378            Self::Other(value) => value.as_str(),
3379        }
3380    }
3381}
3382
3383impl std::fmt::Display for BulkDeleteNotificationsScope {
3384    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3385        f.write_str(self.as_str())
3386    }
3387}
3388
3389impl From<&str> for BulkDeleteNotificationsScope {
3390    fn from(value: &str) -> Self {
3391        match value {
3392            "read" => Self::Read,
3393            "all" => Self::All,
3394            other => Self::Other(other.to_string()),
3395        }
3396    }
3397}
3398
3399/// `BulkDeleteSessionsRequest` model.
3400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3401pub struct BulkDeleteSessionsRequest {
3402    pub session_ids: Vec<String>,
3403}
3404
3405/// `BulkDeleteSessionsResponse` model.
3406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3407pub struct BulkDeleteSessionsResponse {
3408    pub deleted: i64,
3409    pub failed: Vec<String>,
3410}
3411
3412/// `CancelA2ATaskResponse` model.
3413#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3414pub struct CancelA2ATaskResponse {
3415    pub cancelled: bool,
3416    pub task_id: String,
3417}
3418
3419/// `CancelPublicSessionRunResponse` model.
3420#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3421pub struct CancelPublicSessionRunResponse {
3422    pub cancelled: bool,
3423    pub run_id: String,
3424}
3425
3426/// `CancelRunResponse` model.
3427#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3428pub struct CancelRunResponse {
3429    pub cancelled: bool,
3430    pub run_id: String,
3431}
3432
3433/// `CancelSquadRunResponse` model.
3434#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3435pub struct CancelSquadRunResponse {
3436    pub cancelled: bool,
3437    pub team_run_id: String,
3438    /// Child runs actually stopped. Zero is normal for a run whose children had already finished.
3439    #[serde(rename = "cancelledCount")]
3440    pub cancelled_count: i64,
3441    /// False when no orchestration loop was in flight in this process — the run had already
3442    /// settled, or it belongs to another replica.
3443    pub orchestrator_stopped: bool,
3444}
3445
3446/// `CancelTeamRunResponse` model.
3447#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3448pub struct CancelTeamRunResponse {
3449    pub cancelled: bool,
3450    pub team_run_id: String,
3451    /// Child runs actually stopped. Zero is normal for a run whose children had already finished.
3452    #[serde(rename = "cancelledCount")]
3453    pub cancelled_count: i64,
3454    /// False when no orchestration loop was in flight in this process — the run had already
3455    /// settled, or it belongs to another replica.
3456    pub orchestrator_stopped: bool,
3457}
3458
3459/// `CanvasWorkflowStep` model.
3460#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3461pub struct CanvasWorkflowStep {
3462    /// The agent this step runs. An entry without it is silently discarded.
3463    pub agent_id: String,
3464    /// Display name for the step; falls back to the agent's own name.
3465    #[serde(default, skip_serializing_if = "Option::is_none")]
3466    pub label: Option<String>,
3467    /// Per-step instruction. Carried through the SCHEDULE too — dropping it there made every
3468    /// scheduled run fall back to the bare label while the manual run honoured it.
3469    #[serde(default, skip_serializing_if = "Option::is_none")]
3470    pub prompt: Option<String>,
3471}
3472
3473/// `CastBallotRequest` model.
3474#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3475pub struct CastBallotRequest {
3476    pub agent_id: String,
3477    pub vote: String,
3478    /// Voting weight; 0 \< w ≤ 100.
3479    #[serde(default, skip_serializing_if = "Option::is_none")]
3480    pub weight: Option<f64>,
3481    #[serde(default, skip_serializing_if = "Option::is_none")]
3482    pub reasoning: Option<String>,
3483    /// Optional cryptographic ballot signature.
3484    #[serde(default, skip_serializing_if = "Option::is_none")]
3485    pub signature: Option<String>,
3486}
3487
3488/// `ChatCompletionRequest` model.
3489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3490pub struct ChatCompletionRequest {
3491    /// Agent ID or 'agent/\<agent_id\>'
3492    pub model: String,
3493    pub messages: Vec<ChatCompletionRequestMessage>,
3494    #[serde(default, skip_serializing_if = "Option::is_none")]
3495    pub temperature: Option<f64>,
3496    #[serde(default, skip_serializing_if = "Option::is_none")]
3497    pub max_tokens: Option<i64>,
3498    /// Server default: `false`.
3499    #[serde(default, skip_serializing_if = "Option::is_none")]
3500    pub stream: Option<bool>,
3501    #[serde(default, skip_serializing_if = "Option::is_none")]
3502    pub tools: Option<Vec<ChatCompletionRequestTool>>,
3503    #[serde(default, skip_serializing_if = "Option::is_none")]
3504    pub tool_choice: Option<serde_json::Value>,
3505}
3506
3507/// `ChatCompletionRequestMessage` model.
3508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3509pub struct ChatCompletionRequestMessage {
3510    #[serde(default, skip_serializing_if = "Option::is_none")]
3511    pub role: Option<ChatCompletionRequestMessageRole>,
3512    #[serde(default, skip_serializing_if = "Option::is_none")]
3513    pub content: Option<String>,
3514}
3515
3516/// `ChatCompletionRequestMessageRole` enumeration.
3517#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3518pub enum ChatCompletionRequestMessageRole {
3519    #[default]
3520    #[serde(rename = "system")]
3521    System,
3522    #[serde(rename = "user")]
3523    User,
3524    #[serde(rename = "assistant")]
3525    Assistant,
3526    #[serde(rename = "tool")]
3527    Tool,
3528    /// A value the API introduced after this SDK was generated.
3529    #[serde(untagged)]
3530    Other(String),
3531}
3532
3533impl ChatCompletionRequestMessageRole {
3534    /// The value as it appears on the wire.
3535    pub fn as_str(&self) -> &str {
3536        match self {
3537            Self::System => "system",
3538            Self::User => "user",
3539            Self::Assistant => "assistant",
3540            Self::Tool => "tool",
3541            Self::Other(value) => value.as_str(),
3542        }
3543    }
3544}
3545
3546impl std::fmt::Display for ChatCompletionRequestMessageRole {
3547    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3548        f.write_str(self.as_str())
3549    }
3550}
3551
3552impl From<&str> for ChatCompletionRequestMessageRole {
3553    fn from(value: &str) -> Self {
3554        match value {
3555            "system" => Self::System,
3556            "user" => Self::User,
3557            "assistant" => Self::Assistant,
3558            "tool" => Self::Tool,
3559            other => Self::Other(other.to_string()),
3560        }
3561    }
3562}
3563
3564/// `ChatCompletionRequestTool` model.
3565#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3566pub struct ChatCompletionRequestTool {
3567    pub r#type: ChatCompletionRequestToolType,
3568    pub function: ChatCompletionRequestToolFunction,
3569}
3570
3571/// `ChatCompletionRequestToolFunction` model.
3572#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3573pub struct ChatCompletionRequestToolFunction {
3574    pub name: String,
3575    pub description: String,
3576    /// JSON Schema Draft 2020-12 for tool parameters
3577    #[serde(default, skip_serializing_if = "Option::is_none")]
3578    pub parameters: Option<serde_json::Map<String, serde_json::Value>>,
3579}
3580
3581/// `ChatCompletionRequestToolType` enumeration.
3582#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3583pub enum ChatCompletionRequestToolType {
3584    #[default]
3585    #[serde(rename = "function")]
3586    Function,
3587    /// A value the API introduced after this SDK was generated.
3588    #[serde(untagged)]
3589    Other(String),
3590}
3591
3592impl ChatCompletionRequestToolType {
3593    /// The value as it appears on the wire.
3594    pub fn as_str(&self) -> &str {
3595        match self {
3596            Self::Function => "function",
3597            Self::Other(value) => value.as_str(),
3598        }
3599    }
3600}
3601
3602impl std::fmt::Display for ChatCompletionRequestToolType {
3603    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3604        f.write_str(self.as_str())
3605    }
3606}
3607
3608impl From<&str> for ChatCompletionRequestToolType {
3609    fn from(value: &str) -> Self {
3610        match value {
3611            "function" => Self::Function,
3612            other => Self::Other(other.to_string()),
3613        }
3614    }
3615}
3616
3617/// `CheckGovernanceRequest` model.
3618#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3619pub struct CheckGovernanceRequest {
3620    pub agent_id: String,
3621    pub action: String,
3622    #[serde(default, skip_serializing_if = "Option::is_none")]
3623    pub run_id: Option<String>,
3624    #[serde(default, skip_serializing_if = "Option::is_none")]
3625    pub team_id: Option<String>,
3626}
3627
3628/// `CheckSpawnPermissionRequest` model.
3629#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3630pub struct CheckSpawnPermissionRequest {
3631    pub parent_agent_id: String,
3632    pub child_permissions: PermissionSet,
3633}
3634
3635/// `CloseSessionResponse` model.
3636#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3637pub struct CloseSessionResponse {
3638    pub deleted: bool,
3639    pub session_id: String,
3640}
3641
3642/// Autonomous agent company — strategist + teams pursuing strategic goals.
3643#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3644pub struct Company {
3645    pub company_id: String,
3646    pub tenant_id: String,
3647    pub name: String,
3648    #[serde(default, skip_serializing_if = "Option::is_none")]
3649    pub description: Option<String>,
3650    #[serde(default, skip_serializing_if = "Option::is_none")]
3651    pub mission: Option<String>,
3652    #[serde(default, skip_serializing_if = "Option::is_none")]
3653    pub strategic_goals: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
3654    pub strategist_agent_id: String,
3655    #[serde(default, skip_serializing_if = "Option::is_none")]
3656    pub team_ids: Option<Vec<String>>,
3657    #[serde(default, skip_serializing_if = "Option::is_none")]
3658    pub created_agent_ids: Option<Vec<String>>,
3659    #[serde(default, skip_serializing_if = "Option::is_none")]
3660    pub budget: Option<serde_json::Map<String, serde_json::Value>>,
3661    #[serde(default, skip_serializing_if = "Option::is_none")]
3662    pub status: Option<String>,
3663    #[serde(default, skip_serializing_if = "Option::is_none")]
3664    pub config: Option<serde_json::Map<String, serde_json::Value>>,
3665    #[serde(default, skip_serializing_if = "Option::is_none")]
3666    pub workspace_id: Option<String>,
3667    #[serde(default, skip_serializing_if = "Option::is_none")]
3668    pub created_at: Option<String>,
3669    #[serde(default, skip_serializing_if = "Option::is_none")]
3670    pub updated_at: Option<String>,
3671    /// When the company loop last ATTEMPTED a tick, success or failure. The tick schedule is
3672    /// computed from this (falling back to updated_at while absent), so an ordinary edit no longer
3673    /// postpones the next tick.
3674    #[serde(default, skip_serializing_if = "Option::is_none")]
3675    pub last_tick_at: Option<String>,
3676    /// When the company loop last completed a tick whose strategist run SUCCEEDED. The `stuck`
3677    /// escalation reads this (falling back to updated_at while absent).
3678    #[serde(default, skip_serializing_if = "Option::is_none")]
3679    pub last_successful_tick_at: Option<String>,
3680}
3681
3682/// Body for `POST /api/v1/companies` (`CreateCompanySchema`).
3683#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3684pub struct CompanyCreate {
3685    pub name: String,
3686    /// What the company exists to do.
3687    pub mission: String,
3688    /// Spend ceiling and pacing for the company.
3689    pub budget: CompanyCreateBudget,
3690    #[serde(default, skip_serializing_if = "Option::is_none")]
3691    pub description: Option<String>,
3692    #[serde(default, skip_serializing_if = "Option::is_none")]
3693    pub strategic_goals: Option<Vec<String>>,
3694    #[serde(default, skip_serializing_if = "Option::is_none")]
3695    pub config: Option<serde_json::Map<String, serde_json::Value>>,
3696    #[serde(default, skip_serializing_if = "Option::is_none")]
3697    pub workspace_id: Option<String>,
3698}
3699
3700/// Spend ceiling and pacing for the company.
3701#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3702pub struct CompanyCreateBudget {
3703    pub total_usd: f64,
3704    pub daily_limit_usd: f64,
3705    pub alert_threshold_pct: f64,
3706    /// Metered by the platform. Ignored on create (set to 0) and on update.
3707    #[serde(default, skip_serializing_if = "Option::is_none")]
3708    pub spent_usd: Option<f64>,
3709}
3710
3711/// Body for `PUT /api/v1/companies/{id}`. Every field optional — send only what changes.
3712#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3713pub struct CompanyUpdate {
3714    #[serde(default, skip_serializing_if = "Option::is_none")]
3715    pub name: Option<String>,
3716    #[serde(default, skip_serializing_if = "Option::is_none")]
3717    pub mission: Option<String>,
3718    #[serde(default, skip_serializing_if = "Option::is_none")]
3719    pub budget: Option<f64>,
3720    #[serde(default, skip_serializing_if = "Option::is_none")]
3721    pub description: Option<String>,
3722    #[serde(default, skip_serializing_if = "Option::is_none")]
3723    pub strategic_goals: Option<Vec<String>>,
3724    #[serde(default, skip_serializing_if = "Option::is_none")]
3725    pub config: Option<serde_json::Map<String, serde_json::Value>>,
3726}
3727
3728/// `CompleteOAuthLoginResponse` model.
3729#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3730pub struct CompleteOAuthLoginResponse {
3731    pub api_key: String,
3732    pub email: String,
3733}
3734
3735/// `ConnectorConfigField` model.
3736#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3737pub struct ConnectorConfigField {
3738    pub r#type: String,
3739    #[serde(default, skip_serializing_if = "Option::is_none")]
3740    pub required: Option<bool>,
3741    #[serde(default, skip_serializing_if = "Option::is_none")]
3742    pub description: Option<String>,
3743}
3744
3745/// `ConstitutionAmendment` model.
3746#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3747pub struct ConstitutionAmendment {
3748    pub amendment_id: String,
3749    pub rule_id: String,
3750    pub action: ConstitutionAmendmentAction,
3751    /// The new rule, for `add` and `modify`. Absent on `remove`.
3752    #[serde(default, skip_serializing_if = "Option::is_none")]
3753    pub rule: Option<ConstitutionRule>,
3754    pub proposed_by: String,
3755    /// The founder, or the consensus that carried it.
3756    pub approved_by: String,
3757    pub rationale: String,
3758    pub applied_at: String,
3759}
3760
3761/// `ConstitutionAmendmentAction` enumeration.
3762#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3763pub enum ConstitutionAmendmentAction {
3764    #[default]
3765    #[serde(rename = "add")]
3766    Add,
3767    #[serde(rename = "modify")]
3768    Modify,
3769    #[serde(rename = "remove")]
3770    Remove,
3771    /// A value the API introduced after this SDK was generated.
3772    #[serde(untagged)]
3773    Other(String),
3774}
3775
3776impl ConstitutionAmendmentAction {
3777    /// The value as it appears on the wire.
3778    pub fn as_str(&self) -> &str {
3779        match self {
3780            Self::Add => "add",
3781            Self::Modify => "modify",
3782            Self::Remove => "remove",
3783            Self::Other(value) => value.as_str(),
3784        }
3785    }
3786}
3787
3788impl std::fmt::Display for ConstitutionAmendmentAction {
3789    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3790        f.write_str(self.as_str())
3791    }
3792}
3793
3794impl From<&str> for ConstitutionAmendmentAction {
3795    fn from(value: &str) -> Self {
3796        match value {
3797            "add" => Self::Add,
3798            "modify" => Self::Modify,
3799            "remove" => Self::Remove,
3800            other => Self::Other(other.to_string()),
3801        }
3802    }
3803}
3804
3805/// `ConstitutionDocument` model.
3806#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3807pub struct ConstitutionDocument {
3808    pub tenant_id: String,
3809    pub version: i64,
3810    pub rules: Vec<ConstitutionRule>,
3811    pub amendments: Vec<ConstitutionAmendment>,
3812    /// Who created the genesis document.
3813    pub founder_id: String,
3814    pub created_at: String,
3815    /// Present and `true` only when no document is stored and these are the genesis defaults
3816    /// computed on read; absent on a stored document (measured 2026-09-10).
3817    #[serde(default, skip_serializing_if = "Option::is_none")]
3818    pub r#virtual: Option<bool>,
3819    pub updated_at: String,
3820}
3821
3822/// `ConstitutionRule` model.
3823#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3824pub struct ConstitutionRule {
3825    /// Stable slug, e.g. `no-privilege-escalation`.
3826    pub id: String,
3827    pub rule_type: ConstitutionRuleRuleType,
3828    /// Who the rule binds. The document previously listed `global`/`tenant`/`agent`, none of which
3829    /// the server has ever emitted.
3830    pub scope: ConstitutionRuleScope,
3831    /// Agent ids, team ids or role names, depending on `scope`. Absent for `all_agents`.
3832    #[serde(default, skip_serializing_if = "Option::is_none")]
3833    pub scope_targets: Option<Vec<String>>,
3834    /// The action the rule governs, e.g. `modify_constitution`.
3835    pub action: String,
3836    /// For `requirement` rules: the action that must be performed.
3837    #[serde(default, skip_serializing_if = "Option::is_none")]
3838    pub obligated_action: Option<String>,
3839    pub penalty: ConstitutionRulePenalty,
3840    #[serde(default, skip_serializing_if = "Option::is_none")]
3841    pub description: Option<String>,
3842    /// Genesis rules cannot be amended or removed.
3843    #[serde(default, skip_serializing_if = "Option::is_none")]
3844    pub immutable: Option<bool>,
3845    /// Conflict resolution — higher wins. Defaults to 0.
3846    #[serde(default, skip_serializing_if = "Option::is_none")]
3847    pub priority: Option<i64>,
3848}
3849
3850/// `ConstitutionRulePenalty` enumeration.
3851#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3852pub enum ConstitutionRulePenalty {
3853    #[default]
3854    #[serde(rename = "block")]
3855    Block,
3856    #[serde(rename = "warn")]
3857    Warn,
3858    #[serde(rename = "log")]
3859    Log,
3860    #[serde(rename = "terminate_agent")]
3861    TerminateAgent,
3862    #[serde(rename = "revoke_permissions")]
3863    RevokePermissions,
3864    /// A value the API introduced after this SDK was generated.
3865    #[serde(untagged)]
3866    Other(String),
3867}
3868
3869impl ConstitutionRulePenalty {
3870    /// The value as it appears on the wire.
3871    pub fn as_str(&self) -> &str {
3872        match self {
3873            Self::Block => "block",
3874            Self::Warn => "warn",
3875            Self::Log => "log",
3876            Self::TerminateAgent => "terminate_agent",
3877            Self::RevokePermissions => "revoke_permissions",
3878            Self::Other(value) => value.as_str(),
3879        }
3880    }
3881}
3882
3883impl std::fmt::Display for ConstitutionRulePenalty {
3884    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3885        f.write_str(self.as_str())
3886    }
3887}
3888
3889impl From<&str> for ConstitutionRulePenalty {
3890    fn from(value: &str) -> Self {
3891        match value {
3892            "block" => Self::Block,
3893            "warn" => Self::Warn,
3894            "log" => Self::Log,
3895            "terminate_agent" => Self::TerminateAgent,
3896            "revoke_permissions" => Self::RevokePermissions,
3897            other => Self::Other(other.to_string()),
3898        }
3899    }
3900}
3901
3902/// `ConstitutionRuleRuleType` enumeration.
3903#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3904pub enum ConstitutionRuleRuleType {
3905    #[default]
3906    #[serde(rename = "prohibition")]
3907    Prohibition,
3908    #[serde(rename = "requirement")]
3909    Requirement,
3910    #[serde(rename = "permission")]
3911    Permission,
3912    /// A value the API introduced after this SDK was generated.
3913    #[serde(untagged)]
3914    Other(String),
3915}
3916
3917impl ConstitutionRuleRuleType {
3918    /// The value as it appears on the wire.
3919    pub fn as_str(&self) -> &str {
3920        match self {
3921            Self::Prohibition => "prohibition",
3922            Self::Requirement => "requirement",
3923            Self::Permission => "permission",
3924            Self::Other(value) => value.as_str(),
3925        }
3926    }
3927}
3928
3929impl std::fmt::Display for ConstitutionRuleRuleType {
3930    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3931        f.write_str(self.as_str())
3932    }
3933}
3934
3935impl From<&str> for ConstitutionRuleRuleType {
3936    fn from(value: &str) -> Self {
3937        match value {
3938            "prohibition" => Self::Prohibition,
3939            "requirement" => Self::Requirement,
3940            "permission" => Self::Permission,
3941            other => Self::Other(other.to_string()),
3942        }
3943    }
3944}
3945
3946/// Who the rule binds. The document previously listed `global`/`tenant`/`agent`, none of which
3947/// the server has ever emitted.
3948#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3949pub enum ConstitutionRuleScope {
3950    #[default]
3951    #[serde(rename = "all_agents")]
3952    AllAgents,
3953    #[serde(rename = "team")]
3954    Team,
3955    #[serde(rename = "agent")]
3956    Agent,
3957    #[serde(rename = "role")]
3958    Role,
3959    /// A value the API introduced after this SDK was generated.
3960    #[serde(untagged)]
3961    Other(String),
3962}
3963
3964impl ConstitutionRuleScope {
3965    /// The value as it appears on the wire.
3966    pub fn as_str(&self) -> &str {
3967        match self {
3968            Self::AllAgents => "all_agents",
3969            Self::Team => "team",
3970            Self::Agent => "agent",
3971            Self::Role => "role",
3972            Self::Other(value) => value.as_str(),
3973        }
3974    }
3975}
3976
3977impl std::fmt::Display for ConstitutionRuleScope {
3978    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3979        f.write_str(self.as_str())
3980    }
3981}
3982
3983impl From<&str> for ConstitutionRuleScope {
3984    fn from(value: &str) -> Self {
3985        match value {
3986            "all_agents" => Self::AllAgents,
3987            "team" => Self::Team,
3988            "agent" => Self::Agent,
3989            "role" => Self::Role,
3990            other => Self::Other(other.to_string()),
3991        }
3992    }
3993}
3994
3995/// `ConstitutionViolation` model.
3996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3997pub struct ConstitutionViolation {
3998    pub rule_id: String,
3999    pub rule_type: ConstitutionRuleRuleType,
4000    pub action: String,
4001    pub agent_id: String,
4002    pub penalty: ConstitutionRulePenalty,
4003    #[serde(default, skip_serializing_if = "Option::is_none")]
4004    pub description: Option<String>,
4005    pub timestamp: String,
4006}
4007
4008/// `ContentReport` model.
4009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4010pub struct ContentReport {
4011    pub id: String,
4012    pub target_type: ContentReportInputTargetType,
4013    pub target_id: String,
4014    pub reason: ContentReportInputReason,
4015    #[serde(default, skip_serializing_if = "Option::is_none")]
4016    pub details: Option<String>,
4017    /// Tenant that owns the reported content — the queue this report lands in.
4018    pub tenant_id: String,
4019    #[serde(default, skip_serializing_if = "Option::is_none")]
4020    pub agent_id: Option<String>,
4021    #[serde(default, skip_serializing_if = "Option::is_none")]
4022    pub session_id: Option<String>,
4023    pub origin: ContentReportOrigin,
4024    #[serde(default, skip_serializing_if = "Option::is_none")]
4025    pub reporter_tenant_id: Option<String>,
4026    #[serde(default, skip_serializing_if = "Option::is_none")]
4027    pub reporter_user_id: Option<String>,
4028    /// Truncated SHA-256 of the reporter's IP. Never the raw address; enough to spot one source
4029    /// flooding the queue.
4030    #[serde(default, skip_serializing_if = "Option::is_none")]
4031    pub reporter_fingerprint: Option<String>,
4032    pub status: ContentReportStatus,
4033    pub severity: ContentReportSeverity,
4034    pub created_at: String,
4035}
4036
4037/// `ContentReportAccepted` model.
4038#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4039pub struct ContentReportAccepted {
4040    pub report_id: String,
4041    pub status: ContentReportAcceptedStatus,
4042}
4043
4044/// `ContentReportAcceptedStatus` enumeration.
4045#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4046pub enum ContentReportAcceptedStatus {
4047    #[default]
4048    #[serde(rename = "received")]
4049    Received,
4050    /// A value the API introduced after this SDK was generated.
4051    #[serde(untagged)]
4052    Other(String),
4053}
4054
4055impl ContentReportAcceptedStatus {
4056    /// The value as it appears on the wire.
4057    pub fn as_str(&self) -> &str {
4058        match self {
4059            Self::Received => "received",
4060            Self::Other(value) => value.as_str(),
4061        }
4062    }
4063}
4064
4065impl std::fmt::Display for ContentReportAcceptedStatus {
4066    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4067        f.write_str(self.as_str())
4068    }
4069}
4070
4071impl From<&str> for ContentReportAcceptedStatus {
4072    fn from(value: &str) -> Self {
4073        match value {
4074            "received" => Self::Received,
4075            other => Self::Other(other.to_string()),
4076        }
4077    }
4078}
4079
4080/// An abuse/moderation report. Same body shape for the authenticated and anonymous endpoints.
4081#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4082pub struct ContentReportInput {
4083    pub target_type: ContentReportInputTargetType,
4084    pub target_id: String,
4085    /// Closed vocabulary — unknown values are rejected with 422. `self_harm` raises the resulting
4086    /// operator notification to critical priority.
4087    pub reason: ContentReportInputReason,
4088    /// Optional free-text note from the reporter.
4089    #[serde(default, skip_serializing_if = "Option::is_none")]
4090    pub details: Option<String>,
4091}
4092
4093/// Closed vocabulary — unknown values are rejected with 422. `self_harm` raises the resulting
4094/// operator notification to critical priority.
4095#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4096pub enum ContentReportInputReason {
4097    #[default]
4098    #[serde(rename = "harassment")]
4099    Harassment,
4100    #[serde(rename = "hate")]
4101    Hate,
4102    #[serde(rename = "sexual")]
4103    Sexual,
4104    #[serde(rename = "violence")]
4105    Violence,
4106    #[serde(rename = "self_harm")]
4107    SelfHarm,
4108    #[serde(rename = "illegal")]
4109    Illegal,
4110    #[serde(rename = "spam")]
4111    Spam,
4112    #[serde(rename = "other")]
4113    Other,
4114    /// A value the API introduced after this SDK was generated.
4115    #[serde(untagged)]
4116    Unknown(String),
4117}
4118
4119impl ContentReportInputReason {
4120    /// The value as it appears on the wire.
4121    pub fn as_str(&self) -> &str {
4122        match self {
4123            Self::Harassment => "harassment",
4124            Self::Hate => "hate",
4125            Self::Sexual => "sexual",
4126            Self::Violence => "violence",
4127            Self::SelfHarm => "self_harm",
4128            Self::Illegal => "illegal",
4129            Self::Spam => "spam",
4130            Self::Other => "other",
4131            Self::Unknown(value) => value.as_str(),
4132        }
4133    }
4134}
4135
4136impl std::fmt::Display for ContentReportInputReason {
4137    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4138        f.write_str(self.as_str())
4139    }
4140}
4141
4142impl From<&str> for ContentReportInputReason {
4143    fn from(value: &str) -> Self {
4144        match value {
4145            "harassment" => Self::Harassment,
4146            "hate" => Self::Hate,
4147            "sexual" => Self::Sexual,
4148            "violence" => Self::Violence,
4149            "self_harm" => Self::SelfHarm,
4150            "illegal" => Self::Illegal,
4151            "spam" => Self::Spam,
4152            "other" => Self::Other,
4153            other => Self::Unknown(other.to_string()),
4154        }
4155    }
4156}
4157
4158/// `ContentReportInputTargetType` enumeration.
4159#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4160pub enum ContentReportInputTargetType {
4161    #[default]
4162    #[serde(rename = "message")]
4163    Message,
4164    #[serde(rename = "session")]
4165    Session,
4166    #[serde(rename = "agent")]
4167    Agent,
4168    /// A value the API introduced after this SDK was generated.
4169    #[serde(untagged)]
4170    Other(String),
4171}
4172
4173impl ContentReportInputTargetType {
4174    /// The value as it appears on the wire.
4175    pub fn as_str(&self) -> &str {
4176        match self {
4177            Self::Message => "message",
4178            Self::Session => "session",
4179            Self::Agent => "agent",
4180            Self::Other(value) => value.as_str(),
4181        }
4182    }
4183}
4184
4185impl std::fmt::Display for ContentReportInputTargetType {
4186    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4187        f.write_str(self.as_str())
4188    }
4189}
4190
4191impl From<&str> for ContentReportInputTargetType {
4192    fn from(value: &str) -> Self {
4193        match value {
4194            "message" => Self::Message,
4195            "session" => Self::Session,
4196            "agent" => Self::Agent,
4197            other => Self::Other(other.to_string()),
4198        }
4199    }
4200}
4201
4202/// `ContentReportOrigin` enumeration.
4203#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4204pub enum ContentReportOrigin {
4205    #[default]
4206    #[serde(rename = "authenticated")]
4207    Authenticated,
4208    #[serde(rename = "public_session")]
4209    PublicSession,
4210    /// A value the API introduced after this SDK was generated.
4211    #[serde(untagged)]
4212    Other(String),
4213}
4214
4215impl ContentReportOrigin {
4216    /// The value as it appears on the wire.
4217    pub fn as_str(&self) -> &str {
4218        match self {
4219            Self::Authenticated => "authenticated",
4220            Self::PublicSession => "public_session",
4221            Self::Other(value) => value.as_str(),
4222        }
4223    }
4224}
4225
4226impl std::fmt::Display for ContentReportOrigin {
4227    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4228        f.write_str(self.as_str())
4229    }
4230}
4231
4232impl From<&str> for ContentReportOrigin {
4233    fn from(value: &str) -> Self {
4234        match value {
4235            "authenticated" => Self::Authenticated,
4236            "public_session" => Self::PublicSession,
4237            other => Self::Other(other.to_string()),
4238        }
4239    }
4240}
4241
4242/// `ContentReportSeverity` enumeration.
4243#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4244pub enum ContentReportSeverity {
4245    #[default]
4246    #[serde(rename = "critical")]
4247    Critical,
4248    #[serde(rename = "high")]
4249    High,
4250    #[serde(rename = "normal")]
4251    Normal,
4252    /// A value the API introduced after this SDK was generated.
4253    #[serde(untagged)]
4254    Other(String),
4255}
4256
4257impl ContentReportSeverity {
4258    /// The value as it appears on the wire.
4259    pub fn as_str(&self) -> &str {
4260        match self {
4261            Self::Critical => "critical",
4262            Self::High => "high",
4263            Self::Normal => "normal",
4264            Self::Other(value) => value.as_str(),
4265        }
4266    }
4267}
4268
4269impl std::fmt::Display for ContentReportSeverity {
4270    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4271        f.write_str(self.as_str())
4272    }
4273}
4274
4275impl From<&str> for ContentReportSeverity {
4276    fn from(value: &str) -> Self {
4277        match value {
4278            "critical" => Self::Critical,
4279            "high" => Self::High,
4280            "normal" => Self::Normal,
4281            other => Self::Other(other.to_string()),
4282        }
4283    }
4284}
4285
4286/// `ContentReportStatus` enumeration.
4287#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4288pub enum ContentReportStatus {
4289    #[default]
4290    #[serde(rename = "received")]
4291    Received,
4292    #[serde(rename = "reviewing")]
4293    Reviewing,
4294    #[serde(rename = "actioned")]
4295    Actioned,
4296    #[serde(rename = "dismissed")]
4297    Dismissed,
4298    /// A value the API introduced after this SDK was generated.
4299    #[serde(untagged)]
4300    Other(String),
4301}
4302
4303impl ContentReportStatus {
4304    /// The value as it appears on the wire.
4305    pub fn as_str(&self) -> &str {
4306        match self {
4307            Self::Received => "received",
4308            Self::Reviewing => "reviewing",
4309            Self::Actioned => "actioned",
4310            Self::Dismissed => "dismissed",
4311            Self::Other(value) => value.as_str(),
4312        }
4313    }
4314}
4315
4316impl std::fmt::Display for ContentReportStatus {
4317    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4318        f.write_str(self.as_str())
4319    }
4320}
4321
4322impl From<&str> for ContentReportStatus {
4323    fn from(value: &str) -> Self {
4324        match value {
4325            "received" => Self::Received,
4326            "reviewing" => Self::Reviewing,
4327            "actioned" => Self::Actioned,
4328            "dismissed" => Self::Dismissed,
4329            other => Self::Other(other.to_string()),
4330        }
4331    }
4332}
4333
4334/// `ContinueRunRequest` model.
4335#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4336pub struct ContinueRunRequest {
4337    /// Opaque base64-encoded continuation token
4338    pub continuation_token: String,
4339}
4340
4341/// `ContinueRunResponse` model.
4342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4343pub struct ContinueRunResponse {
4344    pub continued: bool,
4345    pub run_id: String,
4346    #[serde(default, skip_serializing_if = "Option::is_none")]
4347    pub checkpoint: Option<String>,
4348    #[serde(default, skip_serializing_if = "Option::is_none")]
4349    pub resume_step: Option<i64>,
4350}
4351
4352/// `ConversationEntry` model.
4353#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4354pub struct ConversationEntry {
4355    pub role: ConversationEntryRole,
4356    /// Message content
4357    pub content: String,
4358    #[serde(default, skip_serializing_if = "Option::is_none")]
4359    pub run_id: Option<String>,
4360    #[serde(default, skip_serializing_if = "Option::is_none")]
4361    pub timestamp: Option<String>,
4362    #[serde(default, skip_serializing_if = "Option::is_none")]
4363    pub compacted: Option<bool>,
4364    /// Persisted on assistant entries when the run executed tools. Reload re-paints these blocks
4365    /// underneath the assistant turn (matches what the SSE stream renders during the live run).
4366    #[serde(default, skip_serializing_if = "Option::is_none")]
4367    pub tool_calls: Option<Vec<ConversationEntryToolCall>>,
4368    /// Reasoning / thinking content (DeepSeek `reasoning_content`, Anthropic extended thinking,
4369    /// GLM/Qwen `\<think\>` blocks). Persisted on assistant entries so reload re-paints the
4370    /// Thinking section above the assistant text.
4371    #[serde(default, skip_serializing_if = "Option::is_none")]
4372    pub thinking: Option<String>,
4373}
4374
4375/// `ConversationEntryRole` enumeration.
4376#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4377pub enum ConversationEntryRole {
4378    #[default]
4379    #[serde(rename = "user")]
4380    User,
4381    #[serde(rename = "assistant")]
4382    Assistant,
4383    #[serde(rename = "system")]
4384    System,
4385    #[serde(rename = "tool_result")]
4386    ToolResult,
4387    /// A value the API introduced after this SDK was generated.
4388    #[serde(untagged)]
4389    Other(String),
4390}
4391
4392impl ConversationEntryRole {
4393    /// The value as it appears on the wire.
4394    pub fn as_str(&self) -> &str {
4395        match self {
4396            Self::User => "user",
4397            Self::Assistant => "assistant",
4398            Self::System => "system",
4399            Self::ToolResult => "tool_result",
4400            Self::Other(value) => value.as_str(),
4401        }
4402    }
4403}
4404
4405impl std::fmt::Display for ConversationEntryRole {
4406    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4407        f.write_str(self.as_str())
4408    }
4409}
4410
4411impl From<&str> for ConversationEntryRole {
4412    fn from(value: &str) -> Self {
4413        match value {
4414            "user" => Self::User,
4415            "assistant" => Self::Assistant,
4416            "system" => Self::System,
4417            "tool_result" => Self::ToolResult,
4418            other => Self::Other(other.to_string()),
4419        }
4420    }
4421}
4422
4423/// `ConversationEntryToolCall` model.
4424#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4425pub struct ConversationEntryToolCall {
4426    pub id: String,
4427    pub name: String,
4428    pub status: ConversationEntryToolCallStatus,
4429    #[serde(default, skip_serializing_if = "Option::is_none")]
4430    pub input: Option<String>,
4431    #[serde(default, skip_serializing_if = "Option::is_none")]
4432    pub output: Option<String>,
4433    #[serde(default, skip_serializing_if = "Option::is_none")]
4434    pub duration_ms: Option<i64>,
4435    #[serde(default, skip_serializing_if = "Option::is_none")]
4436    pub error: Option<String>,
4437}
4438
4439/// `ConversationEntryToolCallStatus` enumeration.
4440#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4441pub enum ConversationEntryToolCallStatus {
4442    #[default]
4443    #[serde(rename = "done")]
4444    Done,
4445    #[serde(rename = "error")]
4446    Error,
4447    /// A value the API introduced after this SDK was generated.
4448    #[serde(untagged)]
4449    Other(String),
4450}
4451
4452impl ConversationEntryToolCallStatus {
4453    /// The value as it appears on the wire.
4454    pub fn as_str(&self) -> &str {
4455        match self {
4456            Self::Done => "done",
4457            Self::Error => "error",
4458            Self::Other(value) => value.as_str(),
4459        }
4460    }
4461}
4462
4463impl std::fmt::Display for ConversationEntryToolCallStatus {
4464    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4465        f.write_str(self.as_str())
4466    }
4467}
4468
4469impl From<&str> for ConversationEntryToolCallStatus {
4470    fn from(value: &str) -> Self {
4471        match value {
4472            "done" => Self::Done,
4473            "error" => Self::Error,
4474            other => Self::Other(other.to_string()),
4475        }
4476    }
4477}
4478
4479/// `CopyWorkspaceFileRequest` model.
4480#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4481pub struct CopyWorkspaceFileRequest {
4482    pub source_path: String,
4483    pub dest_path: String,
4484}
4485
4486/// `CoreMemoryBlock` model.
4487#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4488pub struct CoreMemoryBlock {
4489    #[serde(default, skip_serializing_if = "Option::is_none")]
4490    pub block_id: Option<String>,
4491    #[serde(default, skip_serializing_if = "Option::is_none")]
4492    pub agent_id: Option<String>,
4493    #[serde(default, skip_serializing_if = "Option::is_none")]
4494    pub tenant_id: Option<String>,
4495    #[serde(default, skip_serializing_if = "Option::is_none")]
4496    pub label: Option<String>,
4497    #[serde(default, skip_serializing_if = "Option::is_none")]
4498    pub content: Option<String>,
4499    #[serde(default, skip_serializing_if = "Option::is_none")]
4500    pub max_tokens: Option<i64>,
4501    #[serde(default, skip_serializing_if = "Option::is_none")]
4502    pub updated_at: Option<String>,
4503}
4504
4505/// `CreateA2ATaskRequest` model.
4506#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4507pub struct CreateA2ATaskRequest {
4508    pub agent_id: String,
4509    pub messages: Vec<CreateA2ATaskRequestMessage>,
4510    #[serde(default, skip_serializing_if = "Option::is_none")]
4511    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
4512}
4513
4514/// `CreateA2ATaskRequestMessage` model.
4515#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4516pub struct CreateA2ATaskRequestMessage {
4517    #[serde(default, skip_serializing_if = "Option::is_none")]
4518    pub role: Option<String>,
4519    #[serde(default, skip_serializing_if = "Option::is_none")]
4520    pub parts: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
4521}
4522
4523/// `CreateAdminBlogPostRequest` model.
4524#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4525pub struct CreateAdminBlogPostRequest {
4526    pub title: String,
4527    pub body: String,
4528    #[serde(default, skip_serializing_if = "Option::is_none")]
4529    pub tags: Option<Vec<String>>,
4530    #[serde(default, skip_serializing_if = "Option::is_none")]
4531    pub status: Option<BlogPostStatus>,
4532}
4533
4534/// `CreateAdminBlogPostResponse` model.
4535#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4536pub struct CreateAdminBlogPostResponse {
4537    pub post: BlogPost,
4538}
4539
4540/// `CreateAgentBookmarkRequest` model.
4541#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4542pub struct CreateAgentBookmarkRequest {
4543    pub message_id: String,
4544    pub kind: AgentBookmarkKind,
4545    pub content: String,
4546    #[serde(default, skip_serializing_if = "Option::is_none")]
4547    pub session_id: Option<String>,
4548}
4549
4550/// `CreateAgentFriaRequest` model.
4551#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4552pub struct CreateAgentFriaRequest {
4553    /// One entry per fundamental right considered.
4554    pub rights_assessed: Vec<CreateAgentFriaRequestRightsAssessedItem>,
4555    pub mitigations: String,
4556    pub assessor: String,
4557    /// When the assessment must be revisited.
4558    pub next_review: String,
4559}
4560
4561/// `CreateAgentFriaRequestRightsAssessedItem` model.
4562#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4563pub struct CreateAgentFriaRequestRightsAssessedItem {
4564    pub right: String,
4565    pub impact: FriaRightImpact,
4566    pub justification: String,
4567    #[serde(default, skip_serializing_if = "Option::is_none")]
4568    pub mitigation: Option<String>,
4569}
4570
4571/// `CreateAgentRequest` model.
4572#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4573pub struct CreateAgentRequest {
4574    pub name: String,
4575    #[serde(default, skip_serializing_if = "Option::is_none")]
4576    pub model: Option<AgentModelConfigInput>,
4577    #[serde(default, skip_serializing_if = "Option::is_none")]
4578    pub description: Option<String>,
4579    #[serde(default, skip_serializing_if = "Option::is_none")]
4580    pub prompts: Option<serde_json::Map<String, serde_json::Value>>,
4581    #[serde(default, skip_serializing_if = "Option::is_none")]
4582    pub thinking: Option<serde_json::Map<String, serde_json::Value>>,
4583    /// How runs execute. Accepted by `CreateAgentSchema` (schemas/mod.ts:499) and undocumented
4584    /// until now — `bridge` is deliberately NOT selectable here: bridge agents are created by the
4585    /// bridge registration path, not by this route.
4586    #[serde(default, skip_serializing_if = "Option::is_none")]
4587    pub execution_mode: Option<CreateAgentRequestExecutionMode>,
4588    #[serde(default, skip_serializing_if = "Option::is_none")]
4589    pub resource_limits: Option<serde_json::Map<String, serde_json::Value>>,
4590    #[serde(default, skip_serializing_if = "Option::is_none")]
4591    pub memory: Option<serde_json::Map<String, serde_json::Value>>,
4592    #[serde(default, skip_serializing_if = "Option::is_none")]
4593    pub guardrails: Option<serde_json::Map<String, serde_json::Value>>,
4594}
4595
4596/// How runs execute. Accepted by `CreateAgentSchema` (schemas/mod.ts:499) and undocumented
4597/// until now — `bridge` is deliberately NOT selectable here: bridge agents are created by the
4598/// bridge registration path, not by this route.
4599#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4600pub enum CreateAgentRequestExecutionMode {
4601    #[default]
4602    #[serde(rename = "async")]
4603    Async,
4604    #[serde(rename = "worker")]
4605    Worker,
4606    /// A value the API introduced after this SDK was generated.
4607    #[serde(untagged)]
4608    Other(String),
4609}
4610
4611impl CreateAgentRequestExecutionMode {
4612    /// The value as it appears on the wire.
4613    pub fn as_str(&self) -> &str {
4614        match self {
4615            Self::Async => "async",
4616            Self::Worker => "worker",
4617            Self::Other(value) => value.as_str(),
4618        }
4619    }
4620}
4621
4622impl std::fmt::Display for CreateAgentRequestExecutionMode {
4623    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4624        f.write_str(self.as_str())
4625    }
4626}
4627
4628impl From<&str> for CreateAgentRequestExecutionMode {
4629    fn from(value: &str) -> Self {
4630        match value {
4631            "async" => Self::Async,
4632            "worker" => Self::Worker,
4633            other => Self::Other(other.to_string()),
4634        }
4635    }
4636}
4637
4638/// `CreateAgentVersionRequest` model.
4639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4640pub struct CreateAgentVersionRequest {
4641    #[serde(default, skip_serializing_if = "Option::is_none")]
4642    pub changelog: Option<String>,
4643}
4644
4645/// `CreateAmbassadorRequestRequest` model.
4646#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4647pub struct CreateAmbassadorRequestRequest {
4648    pub from_agent_id: String,
4649    pub r#type: String,
4650    pub subject: String,
4651    pub body: String,
4652}
4653
4654/// `CreateAPIKeyRequest` model.
4655#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4656pub struct CreateAPIKeyRequest {
4657    pub name: String,
4658    /// Server default:
4659    /// `\["agents:read","agents:write","runs:create","runs:read","notifications:read","notifications:write","memory:read","memory:write","files:read","files:write"\]`.
4660    #[serde(default, skip_serializing_if = "Option::is_none")]
4661    pub scopes: Option<Vec<String>>,
4662}
4663
4664/// `CreateBillingPortalSessionRequest` model.
4665#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4666pub struct CreateBillingPortalSessionRequest {
4667    /// Same-origin URL to return to after the portal session ends.
4668    #[serde(default, skip_serializing_if = "Option::is_none")]
4669    pub return_url: Option<String>,
4670}
4671
4672/// `CreateBillingPortalSessionResponse` model.
4673#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4674pub struct CreateBillingPortalSessionResponse {
4675    pub url: String,
4676}
4677
4678/// `CreateCheckoutSessionRequest` model.
4679#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4680pub struct CreateCheckoutSessionRequest {
4681    pub plan_id: String,
4682    #[serde(default, skip_serializing_if = "Option::is_none")]
4683    pub success_url: Option<String>,
4684    #[serde(default, skip_serializing_if = "Option::is_none")]
4685    pub cancel_url: Option<String>,
4686}
4687
4688/// `CreateCheckoutSessionResponse` model.
4689#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4690pub struct CreateCheckoutSessionResponse {
4691    #[serde(default, skip_serializing_if = "Option::is_none")]
4692    pub url: Option<String>,
4693}
4694
4695/// `CreateDatasetRequest` model.
4696#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4697pub struct CreateDatasetRequest {
4698    pub name: String,
4699    pub cases: Vec<CreateDatasetRequestCas>,
4700}
4701
4702/// `CreateDatasetRequestCas` model.
4703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4704pub struct CreateDatasetRequestCas {
4705    #[serde(default, skip_serializing_if = "Option::is_none")]
4706    pub input: Option<serde_json::Map<String, serde_json::Value>>,
4707    #[serde(default, skip_serializing_if = "Option::is_none")]
4708    pub expected_output: Option<serde_json::Map<String, serde_json::Value>>,
4709    #[serde(default, skip_serializing_if = "Option::is_none")]
4710    pub tags: Option<Vec<String>>,
4711}
4712
4713/// `CreateExperimentRequest` model.
4714#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4715pub struct CreateExperimentRequest {
4716    pub name: String,
4717    pub dataset_id: String,
4718    pub variants: Vec<CreateExperimentRequestVariant>,
4719}
4720
4721/// `CreateExperimentRequestVariant` model.
4722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4723pub struct CreateExperimentRequestVariant {
4724    #[serde(default, skip_serializing_if = "Option::is_none")]
4725    pub version: Option<String>,
4726    #[serde(default, skip_serializing_if = "Option::is_none")]
4727    pub eval_run_id: Option<String>,
4728}
4729
4730/// `CreateGoalRequest` model.
4731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4732pub struct CreateGoalRequest {
4733    pub agent_id: String,
4734}
4735
4736/// `CreateGuardrailRequest` model.
4737#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4738pub struct CreateGuardrailRequest {
4739    pub name: String,
4740    /// Where the guardrail is called. Checked against the security-policy denylist and resolved
4741    /// through DNS before it is accepted.
4742    pub webhook_url: String,
4743    pub phase: GuardrailPhase,
4744    #[serde(default, skip_serializing_if = "Option::is_none")]
4745    pub action: Option<GuardrailAction>,
4746    #[serde(default, skip_serializing_if = "Option::is_none")]
4747    pub timeout_ms: Option<i64>,
4748    /// Shared secret used to sign calls to `webhook_url`.
4749    #[serde(default, skip_serializing_if = "Option::is_none")]
4750    pub secret: Option<String>,
4751}
4752
4753/// `CreateImprovementProposalRequest` model.
4754#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4755pub struct CreateImprovementProposalRequest {
4756    pub r#type: String,
4757}
4758
4759/// `CreateIntegrationRequest` model.
4760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4761pub struct CreateIntegrationRequest {
4762    pub connector_id: String,
4763    pub name: String,
4764    #[serde(default, skip_serializing_if = "Option::is_none")]
4765    pub config: Option<serde_json::Map<String, serde_json::Value>>,
4766    #[serde(default, skip_serializing_if = "Option::is_none")]
4767    pub agent_id: Option<String>,
4768}
4769
4770/// `CreateMCPServerRequest` model.
4771#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4772pub struct CreateMCPServerRequest {
4773    pub name: String,
4774    pub transport: MCPTransport,
4775    #[serde(default, skip_serializing_if = "Option::is_none")]
4776    pub url: Option<String>,
4777    #[serde(default, skip_serializing_if = "Option::is_none")]
4778    pub command: Option<String>,
4779    #[serde(default, skip_serializing_if = "Option::is_none")]
4780    pub args: Option<Vec<String>>,
4781    #[serde(default, skip_serializing_if = "Option::is_none")]
4782    pub env: Option<serde_json::Map<String, serde_json::Value>>,
4783    #[serde(default, skip_serializing_if = "Option::is_none")]
4784    pub enabled: Option<bool>,
4785}
4786
4787/// `CreateMyTenantRequest` model.
4788#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4789pub struct CreateMyTenantRequest {
4790    pub name: String,
4791    #[serde(default, skip_serializing_if = "Option::is_none")]
4792    pub slug: Option<String>,
4793}
4794
4795/// `CreateMyTenantResponse` model.
4796#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4797pub struct CreateMyTenantResponse {
4798    pub created: bool,
4799    pub tenant_id: String,
4800    pub name: String,
4801    pub slug: String,
4802    pub role: String,
4803    pub user_id: String,
4804}
4805
4806/// `CreatePlanStripePriceRequest` model.
4807#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4808pub struct CreatePlanStripePriceRequest {
4809    pub amount_cents: i64,
4810    /// Server default: `"usd"`.
4811    #[serde(default, skip_serializing_if = "Option::is_none")]
4812    pub currency: Option<String>,
4813    /// Server default: `"month"`.
4814    #[serde(default, skip_serializing_if = "Option::is_none")]
4815    pub interval: Option<SpecPackagePricingBillingInterval>,
4816    #[serde(default, skip_serializing_if = "Option::is_none")]
4817    pub product_name: Option<String>,
4818}
4819
4820/// `CreatePlanStripePriceResponse` model.
4821#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4822pub struct CreatePlanStripePriceResponse {
4823    #[serde(default, skip_serializing_if = "Option::is_none")]
4824    pub plan_id: Option<String>,
4825    #[serde(default, skip_serializing_if = "Option::is_none")]
4826    pub stripe_price_id: Option<String>,
4827    #[serde(default, skip_serializing_if = "Option::is_none")]
4828    pub stripe_product_id: Option<String>,
4829    #[serde(default, skip_serializing_if = "Option::is_none")]
4830    pub amount_cents: Option<i64>,
4831    #[serde(default, skip_serializing_if = "Option::is_none")]
4832    pub currency: Option<String>,
4833    #[serde(default, skip_serializing_if = "Option::is_none")]
4834    pub interval: Option<String>,
4835}
4836
4837/// `CreateProgramRequest` model.
4838#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4839pub struct CreateProgramRequest {
4840    pub name: String,
4841    pub agent_id: String,
4842    #[serde(default, skip_serializing_if = "Option::is_none")]
4843    pub listing_id: Option<String>,
4844    #[serde(default, skip_serializing_if = "Option::is_none")]
4845    pub description: Option<String>,
4846    pub steps: Vec<CreateProgramRequestStep>,
4847}
4848
4849/// `CreateProgramRequestStep` model.
4850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4851pub struct CreateProgramRequestStep {
4852    pub title: String,
4853    #[serde(default, skip_serializing_if = "Option::is_none")]
4854    pub description: Option<String>,
4855    #[serde(default, skip_serializing_if = "Option::is_none")]
4856    pub order_index: Option<f64>,
4857    #[serde(default, skip_serializing_if = "Option::is_none")]
4858    pub suggested_due_offset_days: Option<f64>,
4859}
4860
4861/// `CreateProjectRequest` model.
4862#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4863pub struct CreateProjectRequest {
4864    pub name: String,
4865    #[serde(default, skip_serializing_if = "Option::is_none")]
4866    pub description: Option<String>,
4867    #[serde(default, skip_serializing_if = "Option::is_none")]
4868    pub instructions: Option<String>,
4869    #[serde(default, skip_serializing_if = "Option::is_none")]
4870    pub knowledge_base_ids: Option<Vec<String>>,
4871    #[serde(default, skip_serializing_if = "Option::is_none")]
4872    pub file_ids: Option<Vec<String>>,
4873    #[serde(default, skip_serializing_if = "Option::is_none")]
4874    pub visibility: Option<ProjectVisibility>,
4875    #[serde(default, skip_serializing_if = "Option::is_none")]
4876    pub shared_with: Option<Vec<ProjectGrant>>,
4877}
4878
4879/// `CreatePublicSessionRequest` model.
4880#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4881pub struct CreatePublicSessionRequest {
4882    pub agent_id: String,
4883}
4884
4885/// `CreatePublicSessionResponse` model.
4886#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4887pub struct CreatePublicSessionResponse {
4888    #[serde(default, skip_serializing_if = "Option::is_none")]
4889    pub session_id: Option<String>,
4890    #[serde(default, skip_serializing_if = "Option::is_none")]
4891    pub token: Option<String>,
4892    #[serde(default, skip_serializing_if = "Option::is_none")]
4893    pub agent_name: Option<String>,
4894    #[serde(default, skip_serializing_if = "Option::is_none")]
4895    pub greeting: Option<String>,
4896}
4897
4898/// `CreateResponseRequest` model.
4899#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4900pub struct CreateResponseRequest {
4901    /// Agent ID or model alias resolvable via `/v1/models`.
4902    pub model: String,
4903    /// Input string or structured turn array.
4904    pub input: serde_json::Value,
4905    /// Chain to an earlier response in the same conversation.
4906    #[serde(default, skip_serializing_if = "Option::is_none")]
4907    pub previous_response_id: Option<String>,
4908    /// System-prompt override for this call only.
4909    #[serde(default, skip_serializing_if = "Option::is_none")]
4910    pub instructions: Option<String>,
4911    /// Server default: `false`.
4912    #[serde(default, skip_serializing_if = "Option::is_none")]
4913    pub stream: Option<bool>,
4914    #[serde(default, skip_serializing_if = "Option::is_none")]
4915    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
4916}
4917
4918/// `CreateResponseResponse` model.
4919#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4920pub struct CreateResponseResponse {
4921    pub id: String,
4922    /// Always `response`.
4923    pub object: String,
4924    #[serde(default, skip_serializing_if = "Option::is_none")]
4925    pub created_at: Option<i64>,
4926    pub model: String,
4927    pub output: Vec<serde_json::Map<String, serde_json::Value>>,
4928    #[serde(default, skip_serializing_if = "Option::is_none")]
4929    pub usage: Option<CreateResponseResponseUsage>,
4930}
4931
4932/// `CreateResponseResponseUsage` model.
4933#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4934pub struct CreateResponseResponseUsage {
4935    #[serde(default, skip_serializing_if = "Option::is_none")]
4936    pub input_tokens: Option<i64>,
4937    #[serde(default, skip_serializing_if = "Option::is_none")]
4938    pub output_tokens: Option<i64>,
4939    #[serde(default, skip_serializing_if = "Option::is_none")]
4940    pub total_tokens: Option<i64>,
4941}
4942
4943/// `CreateRunRequest` model.
4944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4945pub struct CreateRunRequest {
4946    pub agent_id: String,
4947    #[serde(default, skip_serializing_if = "Option::is_none")]
4948    pub session_id: Option<String>,
4949    /// Free-form input for the agent; `message` is the conventional field. `file_ids` attaches
4950    /// uploaded files (at most 20): every id is resolved against THIS tenant before the run is
4951    /// created, and an id with no file here is refused with 422 rather than accepted and dropped —
4952    /// an unresolvable id would otherwise travel to the agent, and to a bridge agent's machine, as
4953    /// an attachment that cannot be fetched.
4954    ///
4955    /// Server default: `{}`.
4956    #[serde(default, skip_serializing_if = "Option::is_none")]
4957    pub input: Option<CreateRunRequestInput>,
4958    /// Pin to a specific agent version (1-based). When omitted, runs against the agent's current
4959    /// head version.
4960    #[serde(default, skip_serializing_if = "Option::is_none")]
4961    pub version: Option<i64>,
4962    #[serde(default, skip_serializing_if = "Option::is_none")]
4963    pub resource_limits: Option<serde_json::Map<String, serde_json::Value>>,
4964    #[serde(default, skip_serializing_if = "Option::is_none")]
4965    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
4966}
4967
4968/// Free-form input for the agent; `message` is the conventional field. `file_ids` attaches
4969/// uploaded files (at most 20): every id is resolved against THIS tenant before the run is
4970/// created, and an id with no file here is refused with 422 rather than accepted and dropped —
4971/// an unresolvable id would otherwise travel to the agent, and to a bridge agent's machine, as
4972/// an attachment that cannot be fetched.
4973#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4974pub struct CreateRunRequestInput {
4975    #[serde(default, skip_serializing_if = "Option::is_none")]
4976    pub message: Option<String>,
4977    #[serde(default, skip_serializing_if = "Option::is_none")]
4978    pub file_ids: Option<Vec<String>>,
4979}
4980
4981/// `CreateSessionAnnotationRequest` model.
4982#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4983pub struct CreateSessionAnnotationRequest {
4984    pub message_id: String,
4985    pub content: String,
4986}
4987
4988/// `CreateSessionAnnotationResponse` model.
4989#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4990pub struct CreateSessionAnnotationResponse {
4991    #[serde(default, skip_serializing_if = "Option::is_none")]
4992    pub id: Option<String>,
4993    #[serde(default, skip_serializing_if = "Option::is_none")]
4994    pub message_id: Option<String>,
4995    #[serde(default, skip_serializing_if = "Option::is_none")]
4996    pub content: Option<String>,
4997    #[serde(default, skip_serializing_if = "Option::is_none")]
4998    pub author: Option<String>,
4999    #[serde(default, skip_serializing_if = "Option::is_none")]
5000    pub created_at: Option<String>,
5001    #[serde(default, skip_serializing_if = "Option::is_none")]
5002    pub resolved: Option<bool>,
5003}
5004
5005/// `CreateSessionBranchRequest` model.
5006#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5007pub struct CreateSessionBranchRequest {
5008    /// Defaults to the session's most recent run.
5009    #[serde(default, skip_serializing_if = "Option::is_none")]
5010    pub fork_point_run_id: Option<String>,
5011    /// Defaults to 0.
5012    #[serde(default, skip_serializing_if = "Option::is_none")]
5013    pub fork_point_step_seq: Option<i64>,
5014    /// Defaults to the session's active branch.
5015    #[serde(default, skip_serializing_if = "Option::is_none")]
5016    pub parent_branch_id: Option<String>,
5017    /// Defaults to `branch-\<first 8 characters of the branch id\>`.
5018    #[serde(default, skip_serializing_if = "Option::is_none")]
5019    pub name: Option<String>,
5020}
5021
5022/// `CreateSessionRequest` model.
5023#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5024pub struct CreateSessionRequest {
5025    pub agent_id: String,
5026    #[serde(default, skip_serializing_if = "Option::is_none")]
5027    pub team_id: Option<String>,
5028    #[serde(default, skip_serializing_if = "Option::is_none")]
5029    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
5030}
5031
5032/// `CreateSessionShareRequest` model.
5033#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5034pub struct CreateSessionShareRequest {
5035    pub role: CreateSessionShareRequestRole,
5036    #[serde(default, skip_serializing_if = "Option::is_none")]
5037    pub expires_in_hours: Option<f64>,
5038}
5039
5040/// `CreateSessionShareRequestRole` enumeration.
5041#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5042pub enum CreateSessionShareRequestRole {
5043    #[default]
5044    #[serde(rename = "viewer")]
5045    Viewer,
5046    #[serde(rename = "editor")]
5047    Editor,
5048    /// A value the API introduced after this SDK was generated.
5049    #[serde(untagged)]
5050    Other(String),
5051}
5052
5053impl CreateSessionShareRequestRole {
5054    /// The value as it appears on the wire.
5055    pub fn as_str(&self) -> &str {
5056        match self {
5057            Self::Viewer => "viewer",
5058            Self::Editor => "editor",
5059            Self::Other(value) => value.as_str(),
5060        }
5061    }
5062}
5063
5064impl std::fmt::Display for CreateSessionShareRequestRole {
5065    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5066        f.write_str(self.as_str())
5067    }
5068}
5069
5070impl From<&str> for CreateSessionShareRequestRole {
5071    fn from(value: &str) -> Self {
5072        match value {
5073            "viewer" => Self::Viewer,
5074            "editor" => Self::Editor,
5075            other => Self::Other(other.to_string()),
5076        }
5077    }
5078}
5079
5080/// `CreateSessionShareResponse` model.
5081#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5082pub struct CreateSessionShareResponse {
5083    #[serde(default, skip_serializing_if = "Option::is_none")]
5084    pub share_url: Option<String>,
5085    #[serde(default, skip_serializing_if = "Option::is_none")]
5086    pub role: Option<String>,
5087    #[serde(default, skip_serializing_if = "Option::is_none")]
5088    pub expires_at: Option<String>,
5089}
5090
5091/// `CreateSessionTodoRequest` model.
5092#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5093pub struct CreateSessionTodoRequest {
5094    pub title: String,
5095    #[serde(default, skip_serializing_if = "Option::is_none")]
5096    pub description: Option<String>,
5097    #[serde(default, skip_serializing_if = "Option::is_none")]
5098    pub due_at: Option<String>,
5099    #[serde(default, skip_serializing_if = "Option::is_none")]
5100    pub assign_agent_id: Option<String>,
5101    #[serde(default, skip_serializing_if = "Option::is_none")]
5102    pub status: Option<String>,
5103}
5104
5105/// `CreateSpecPackageCheckoutSessionRequest` model.
5106#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5107pub struct CreateSpecPackageCheckoutSessionRequest {
5108    /// Same-origin. Defaults to the billing settings page.
5109    #[serde(default, skip_serializing_if = "Option::is_none")]
5110    pub success_url: Option<String>,
5111    /// Same-origin. Defaults to the billing settings page.
5112    #[serde(default, skip_serializing_if = "Option::is_none")]
5113    pub cancel_url: Option<String>,
5114}
5115
5116/// `CreateSpecPackageCheckoutSessionResponse` model.
5117#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5118pub struct CreateSpecPackageCheckoutSessionResponse {
5119    pub url: String,
5120}
5121
5122/// `CreateVotingProposalRequest` model.
5123#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5124pub struct CreateVotingProposalRequest {
5125    pub title: String,
5126    pub description: String,
5127    pub proposal_type: String,
5128}
5129
5130/// `CreateWebhookRequest` model.
5131#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5132pub struct CreateWebhookRequest {
5133    pub url: String,
5134    pub events: Vec<CreateWebhookRequestEvent>,
5135}
5136
5137/// `CreateWebhookRequestEvent` enumeration.
5138#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5139pub enum CreateWebhookRequestEvent {
5140    #[default]
5141    #[serde(rename = "run.completed")]
5142    RunCompleted,
5143    #[serde(rename = "run.failed")]
5144    RunFailed,
5145    #[serde(rename = "run.cancelled")]
5146    RunCancelled,
5147    #[serde(rename = "agent.created")]
5148    AgentCreated,
5149    #[serde(rename = "agent.updated")]
5150    AgentUpdated,
5151    #[serde(rename = "agent.deleted")]
5152    AgentDeleted,
5153    #[serde(rename = "quota.threshold")]
5154    QuotaThreshold,
5155    #[serde(rename = "quota.exceeded")]
5156    QuotaExceeded,
5157    #[serde(rename = "guardrail.violated")]
5158    GuardrailViolated,
5159    #[serde(rename = "billing.invoice.created")]
5160    BillingInvoiceCreated,
5161    #[serde(rename = "billing.payment.failed")]
5162    BillingPaymentFailed,
5163    #[serde(rename = "eval.auto_rollback")]
5164    EvalAutoRollback,
5165    #[serde(rename = "company.budget_alert")]
5166    CompanyBudgetAlert,
5167    #[serde(rename = "company.budget_exceeded")]
5168    CompanyBudgetExceeded,
5169    #[serde(rename = "company.objective_failed")]
5170    CompanyObjectiveFailed,
5171    #[serde(rename = "company.goal_completed")]
5172    CompanyGoalCompleted,
5173    #[serde(rename = "company.paused")]
5174    CompanyPaused,
5175    /// A value the API introduced after this SDK was generated.
5176    #[serde(untagged)]
5177    Other(String),
5178}
5179
5180impl CreateWebhookRequestEvent {
5181    /// The value as it appears on the wire.
5182    pub fn as_str(&self) -> &str {
5183        match self {
5184            Self::RunCompleted => "run.completed",
5185            Self::RunFailed => "run.failed",
5186            Self::RunCancelled => "run.cancelled",
5187            Self::AgentCreated => "agent.created",
5188            Self::AgentUpdated => "agent.updated",
5189            Self::AgentDeleted => "agent.deleted",
5190            Self::QuotaThreshold => "quota.threshold",
5191            Self::QuotaExceeded => "quota.exceeded",
5192            Self::GuardrailViolated => "guardrail.violated",
5193            Self::BillingInvoiceCreated => "billing.invoice.created",
5194            Self::BillingPaymentFailed => "billing.payment.failed",
5195            Self::EvalAutoRollback => "eval.auto_rollback",
5196            Self::CompanyBudgetAlert => "company.budget_alert",
5197            Self::CompanyBudgetExceeded => "company.budget_exceeded",
5198            Self::CompanyObjectiveFailed => "company.objective_failed",
5199            Self::CompanyGoalCompleted => "company.goal_completed",
5200            Self::CompanyPaused => "company.paused",
5201            Self::Other(value) => value.as_str(),
5202        }
5203    }
5204}
5205
5206impl std::fmt::Display for CreateWebhookRequestEvent {
5207    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5208        f.write_str(self.as_str())
5209    }
5210}
5211
5212impl From<&str> for CreateWebhookRequestEvent {
5213    fn from(value: &str) -> Self {
5214        match value {
5215            "run.completed" => Self::RunCompleted,
5216            "run.failed" => Self::RunFailed,
5217            "run.cancelled" => Self::RunCancelled,
5218            "agent.created" => Self::AgentCreated,
5219            "agent.updated" => Self::AgentUpdated,
5220            "agent.deleted" => Self::AgentDeleted,
5221            "quota.threshold" => Self::QuotaThreshold,
5222            "quota.exceeded" => Self::QuotaExceeded,
5223            "guardrail.violated" => Self::GuardrailViolated,
5224            "billing.invoice.created" => Self::BillingInvoiceCreated,
5225            "billing.payment.failed" => Self::BillingPaymentFailed,
5226            "eval.auto_rollback" => Self::EvalAutoRollback,
5227            "company.budget_alert" => Self::CompanyBudgetAlert,
5228            "company.budget_exceeded" => Self::CompanyBudgetExceeded,
5229            "company.objective_failed" => Self::CompanyObjectiveFailed,
5230            "company.goal_completed" => Self::CompanyGoalCompleted,
5231            "company.paused" => Self::CompanyPaused,
5232            other => Self::Other(other.to_string()),
5233        }
5234    }
5235}
5236
5237/// `CreateWorkspaceRequest` model.
5238#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5239pub struct CreateWorkspaceRequest {
5240    #[serde(default, skip_serializing_if = "Option::is_none")]
5241    pub name: Option<String>,
5242}
5243
5244/// `CustomPlan` model.
5245#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5246pub struct CustomPlan {
5247    /// Lower-cased. The identity — not settable through the body.
5248    pub id: String,
5249    pub name: String,
5250    /// Absent when unset.
5251    #[serde(default, skip_serializing_if = "Option::is_none")]
5252    pub description: Option<String>,
5253    /// Pairs the plan with a promo program. Absent when unset.
5254    #[serde(default, skip_serializing_if = "Option::is_none")]
5255    pub program: Option<String>,
5256    pub base_plan: SpecPackageIncludedInPlan,
5257    pub price_amount_cents: i64,
5258    pub price_currency: String,
5259    /// Absent when unset.
5260    #[serde(default, skip_serializing_if = "Option::is_none")]
5261    pub stripe_price_id: Option<String>,
5262    #[serde(default, skip_serializing_if = "Option::is_none")]
5263    pub quotas: Option<TenantQuotas>,
5264    #[serde(default, skip_serializing_if = "Option::is_none")]
5265    pub llm: Option<PlanLLMLimits>,
5266    pub visibility: CustomPlanVisibility,
5267    pub active: bool,
5268    pub created_at: String,
5269    pub updated_at: String,
5270}
5271
5272/// `CustomPlanInput` model.
5273#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5274pub struct CustomPlanInput {
5275    pub name: String,
5276    #[serde(default, skip_serializing_if = "Option::is_none")]
5277    pub description: Option<String>,
5278    #[serde(default, skip_serializing_if = "Option::is_none")]
5279    pub program: Option<String>,
5280    pub base_plan: SpecPackageIncludedInPlan,
5281    pub price_amount_cents: i64,
5282    /// Server default: `"usd"`.
5283    #[serde(default, skip_serializing_if = "Option::is_none")]
5284    pub price_currency: Option<String>,
5285    #[serde(default, skip_serializing_if = "Option::is_none")]
5286    pub stripe_price_id: Option<String>,
5287    #[serde(default, skip_serializing_if = "Option::is_none")]
5288    pub quotas: Option<TenantQuotas>,
5289    #[serde(default, skip_serializing_if = "Option::is_none")]
5290    pub llm: Option<PlanLLMLimits>,
5291    /// Omitting this on an update HIDES a previously public plan.
5292    ///
5293    /// Server default: `"hidden"`.
5294    #[serde(default, skip_serializing_if = "Option::is_none")]
5295    pub visibility: Option<CustomPlanVisibility>,
5296    /// Omitting this on an update REACTIVATES a deactivated plan. Send it explicitly on every
5297    /// write.
5298    ///
5299    /// Server default: `true`.
5300    #[serde(default, skip_serializing_if = "Option::is_none")]
5301    pub active: Option<bool>,
5302}
5303
5304/// `CustomPlanVisibility` enumeration.
5305#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5306pub enum CustomPlanVisibility {
5307    #[default]
5308    #[serde(rename = "public")]
5309    Public,
5310    #[serde(rename = "hidden")]
5311    Hidden,
5312    /// A value the API introduced after this SDK was generated.
5313    #[serde(untagged)]
5314    Other(String),
5315}
5316
5317impl CustomPlanVisibility {
5318    /// The value as it appears on the wire.
5319    pub fn as_str(&self) -> &str {
5320        match self {
5321            Self::Public => "public",
5322            Self::Hidden => "hidden",
5323            Self::Other(value) => value.as_str(),
5324        }
5325    }
5326}
5327
5328impl std::fmt::Display for CustomPlanVisibility {
5329    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5330        f.write_str(self.as_str())
5331    }
5332}
5333
5334impl From<&str> for CustomPlanVisibility {
5335    fn from(value: &str) -> Self {
5336        match value {
5337            "public" => Self::Public,
5338            "hidden" => Self::Hidden,
5339            other => Self::Other(other.to_string()),
5340        }
5341    }
5342}
5343
5344/// `DeactivateSafeModeResponse` model.
5345#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5346pub struct DeactivateSafeModeResponse {
5347    #[serde(default, skip_serializing_if = "Option::is_none")]
5348    pub ok: Option<bool>,
5349    #[serde(default, skip_serializing_if = "Option::is_none")]
5350    pub mode: Option<String>,
5351}
5352
5353/// `DeclineInviteFromPickerResponse` model.
5354#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5355pub struct DeclineInviteFromPickerResponse {
5356    pub declined: bool,
5357    pub invite: Invite,
5358}
5359
5360/// `DeleteAdminBlogPostResponse` model.
5361#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5362pub struct DeleteAdminBlogPostResponse {
5363    pub deleted: bool,
5364}
5365
5366/// `DeleteAdminIntegrationOAuthProviderResponse` model.
5367#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5368pub struct DeleteAdminIntegrationOAuthProviderResponse {
5369    pub provider: String,
5370    /// Always false here.
5371    pub configured: bool,
5372}
5373
5374/// `DeleteAdminLLMDefaultResponse` model.
5375#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5376pub struct DeleteAdminLLMDefaultResponse {
5377    pub provider: String,
5378    /// Always false here — the key is gone.
5379    pub configured: bool,
5380}
5381
5382/// `DeleteAdminProviderResponse` model.
5383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5384pub struct DeleteAdminProviderResponse {
5385    pub deleted: bool,
5386    pub id: String,
5387}
5388
5389/// `DeleteAgentBookmarkResponse` model.
5390#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5391pub struct DeleteAgentBookmarkResponse {
5392    pub removed: bool,
5393    pub message_id: String,
5394}
5395
5396/// `DeleteAgentIdentityResponse` model.
5397#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5398pub struct DeleteAgentIdentityResponse {
5399    pub error: RevokeSessionShareResponseError,
5400    pub message: String,
5401    pub retry_after_seconds: i64,
5402}
5403
5404/// `DeleteAllAgentBookmarksResponse` model.
5405#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5406pub struct DeleteAllAgentBookmarksResponse {
5407    pub removed: i64,
5408}
5409
5410/// `DeleteAndroidTesterResponse` model.
5411#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5412pub struct DeleteAndroidTesterResponse {
5413    pub error: RevokeSessionShareResponseError,
5414    pub message: String,
5415    pub retry_after_seconds: i64,
5416}
5417
5418/// `DeleteCompanyResponse` model.
5419#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5420pub struct DeleteCompanyResponse {
5421    pub error: RevokeSessionShareResponseError,
5422    pub message: String,
5423    pub retry_after_seconds: i64,
5424}
5425
5426/// `DeleteCustomPlanForce` enumeration.
5427#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5428pub enum DeleteCustomPlanForce {
5429    #[default]
5430    #[serde(rename = "1")]
5431    V1,
5432    /// A value the API introduced after this SDK was generated.
5433    #[serde(untagged)]
5434    Other(String),
5435}
5436
5437impl DeleteCustomPlanForce {
5438    /// The value as it appears on the wire.
5439    pub fn as_str(&self) -> &str {
5440        match self {
5441            Self::V1 => "1",
5442            Self::Other(value) => value.as_str(),
5443        }
5444    }
5445}
5446
5447impl std::fmt::Display for DeleteCustomPlanForce {
5448    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5449        f.write_str(self.as_str())
5450    }
5451}
5452
5453impl From<&str> for DeleteCustomPlanForce {
5454    fn from(value: &str) -> Self {
5455        match value {
5456            "1" => Self::V1,
5457            other => Self::Other(other.to_string()),
5458        }
5459    }
5460}
5461
5462/// `DeleteCustomPlanResponse` model.
5463#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5464pub struct DeleteCustomPlanResponse {
5465    pub deleted: bool,
5466    pub id: String,
5467    /// Tenants moved off the plan, when forced.
5468    #[serde(default, skip_serializing_if = "Option::is_none")]
5469    pub reassigned: Option<i64>,
5470}
5471
5472/// `DeleteDataExplorerValueResponse` model.
5473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5474pub struct DeleteDataExplorerValueResponse {
5475    #[serde(default, skip_serializing_if = "Option::is_none")]
5476    pub success: Option<bool>,
5477}
5478
5479/// `DeleteFileResponse` model.
5480#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5481pub struct DeleteFileResponse {
5482    pub error: RevokeSessionShareResponseError,
5483    pub message: String,
5484    pub retry_after_seconds: i64,
5485}
5486
5487/// `DeleteGuardrailResponse` model.
5488#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5489pub struct DeleteGuardrailResponse {
5490    #[serde(default, skip_serializing_if = "Option::is_none")]
5491    pub deleted: Option<bool>,
5492    #[serde(default, skip_serializing_if = "Option::is_none")]
5493    pub guardrail_id: Option<String>,
5494}
5495
5496/// `DeleteIntegrationResponse` model.
5497#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5498pub struct DeleteIntegrationResponse {
5499    pub error: RevokeSessionShareResponseError,
5500    pub message: String,
5501    pub retry_after_seconds: i64,
5502}
5503
5504/// `DeleteInviteResponse` model.
5505#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5506pub struct DeleteInviteResponse {
5507    pub error: RevokeSessionShareResponseError,
5508    pub message: String,
5509    pub retry_after_seconds: i64,
5510}
5511
5512/// `DeleteKbDocumentResponse` model.
5513#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5514pub struct DeleteKbDocumentResponse {
5515    pub error: RevokeSessionShareResponseError,
5516    pub message: String,
5517    pub retry_after_seconds: i64,
5518}
5519
5520/// `DeleteKnowledgeBaseResponse` model.
5521#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5522pub struct DeleteKnowledgeBaseResponse {
5523    pub error: RevokeSessionShareResponseError,
5524    pub message: String,
5525    pub retry_after_seconds: i64,
5526}
5527
5528/// `DeleteLLMProviderKeyResponse` model.
5529#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5530pub struct DeleteLLMProviderKeyResponse {
5531    #[serde(default, skip_serializing_if = "Option::is_none")]
5532    pub deleted: Option<bool>,
5533    #[serde(default, skip_serializing_if = "Option::is_none")]
5534    pub provider_id: Option<String>,
5535}
5536
5537/// `DeleteMemoryEntryResponse` model.
5538#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5539pub struct DeleteMemoryEntryResponse {
5540    pub error: RevokeSessionShareResponseError,
5541    pub message: String,
5542    pub retry_after_seconds: i64,
5543}
5544
5545/// `DeleteMeResponse` model.
5546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5547pub struct DeleteMeResponse {
5548    pub deleted: bool,
5549    pub tenants: Vec<DeleteMeResponseTenant>,
5550    pub sessions_revoked: i64,
5551}
5552
5553/// `DeleteMeResponseTenant` model.
5554#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5555pub struct DeleteMeResponseTenant {
5556    pub tenant_id: String,
5557}
5558
5559/// `DeleteModelPricingOverrideResponse` model.
5560#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5561pub struct DeleteModelPricingOverrideResponse {
5562    #[serde(rename = "modelRef")]
5563    pub model_ref: String,
5564    pub deleted: bool,
5565}
5566
5567/// `DeleteNotificationResponse` model.
5568#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5569pub struct DeleteNotificationResponse {
5570    #[serde(default, skip_serializing_if = "Option::is_none")]
5571    pub ok: Option<bool>,
5572}
5573
5574/// `DeleteNotificationTargetResponse` model.
5575#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5576pub struct DeleteNotificationTargetResponse {
5577    pub ok: bool,
5578}
5579
5580/// `DeleteProjectResponse` model.
5581#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5582pub struct DeleteProjectResponse {
5583    pub deleted: bool,
5584    pub project_id: String,
5585    pub chats_kept: i64,
5586}
5587
5588/// `DeletePromoCodeResponse` model.
5589#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5590pub struct DeletePromoCodeResponse {
5591    pub deleted: bool,
5592    /// Upper-cased, which may differ from what was sent.
5593    pub code: String,
5594}
5595
5596/// `DeleteSessionAnnotationResponse` model.
5597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5598pub struct DeleteSessionAnnotationResponse {
5599    pub error: RevokeSessionShareResponseError,
5600    pub message: String,
5601    pub retry_after_seconds: i64,
5602}
5603
5604/// `DeleteSessionTodoResponse` model.
5605#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5606pub struct DeleteSessionTodoResponse {
5607    #[serde(default, skip_serializing_if = "Option::is_none")]
5608    pub deleted: Option<bool>,
5609    #[serde(default, skip_serializing_if = "Option::is_none")]
5610    pub todo_id: Option<String>,
5611    #[serde(default, skip_serializing_if = "Option::is_none")]
5612    pub session_id: Option<String>,
5613}
5614
5615/// `DeleteSpawnPolicyResponse` model.
5616#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5617pub struct DeleteSpawnPolicyResponse {
5618    #[serde(default, skip_serializing_if = "Option::is_none")]
5619    pub ok: Option<bool>,
5620}
5621
5622/// `DeleteSquadGraphEdgeResponse` model.
5623#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5624pub struct DeleteSquadGraphEdgeResponse {
5625    #[serde(default, skip_serializing_if = "Option::is_none")]
5626    pub deleted: Option<bool>,
5627    #[serde(default, skip_serializing_if = "Option::is_none")]
5628    pub edge_id: Option<String>,
5629}
5630
5631/// `DeleteSquadGraphNodeResponse` model.
5632#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5633pub struct DeleteSquadGraphNodeResponse {
5634    #[serde(default, skip_serializing_if = "Option::is_none")]
5635    pub deleted: Option<bool>,
5636    #[serde(default, skip_serializing_if = "Option::is_none")]
5637    pub agent_id: Option<String>,
5638}
5639
5640/// `DeleteSquadResponse` model.
5641#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5642pub struct DeleteSquadResponse {
5643    #[serde(default, skip_serializing_if = "Option::is_none")]
5644    pub deleted: Option<bool>,
5645}
5646
5647/// `DeleteTeamGraphEdgeResponse` model.
5648#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5649pub struct DeleteTeamGraphEdgeResponse {
5650    #[serde(default, skip_serializing_if = "Option::is_none")]
5651    pub deleted: Option<bool>,
5652    #[serde(default, skip_serializing_if = "Option::is_none")]
5653    pub edge_id: Option<String>,
5654}
5655
5656/// `DeleteTeamGraphNodeResponse` model.
5657#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5658pub struct DeleteTeamGraphNodeResponse {
5659    #[serde(default, skip_serializing_if = "Option::is_none")]
5660    pub deleted: Option<bool>,
5661    #[serde(default, skip_serializing_if = "Option::is_none")]
5662    pub agent_id: Option<String>,
5663}
5664
5665/// `DeleteTeamResponse` model.
5666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5667pub struct DeleteTeamResponse {
5668    pub deleted: bool,
5669    pub team_id: String,
5670}
5671
5672/// `DeleteUserResponse` model.
5673#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5674pub struct DeleteUserResponse {
5675    #[serde(default, skip_serializing_if = "Option::is_none")]
5676    pub deleted: Option<bool>,
5677}
5678
5679/// `DeleteWebhookResponse` model.
5680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5681pub struct DeleteWebhookResponse {
5682    pub deleted: bool,
5683    pub webhook_id: String,
5684}
5685
5686/// `DeleteWorkspaceFileResponse` model.
5687#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5688pub struct DeleteWorkspaceFileResponse {
5689    pub trashed: bool,
5690    pub trash_path: String,
5691    pub original_path: String,
5692}
5693
5694/// `DeleteWorkspaceFileTrash` enumeration.
5695#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5696pub enum DeleteWorkspaceFileTrash {
5697    #[default]
5698    #[serde(rename = "false")]
5699    False,
5700    /// A value the API introduced after this SDK was generated.
5701    #[serde(untagged)]
5702    Other(String),
5703}
5704
5705impl DeleteWorkspaceFileTrash {
5706    /// The value as it appears on the wire.
5707    pub fn as_str(&self) -> &str {
5708        match self {
5709            Self::False => "false",
5710            Self::Other(value) => value.as_str(),
5711        }
5712    }
5713}
5714
5715impl std::fmt::Display for DeleteWorkspaceFileTrash {
5716    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5717        f.write_str(self.as_str())
5718    }
5719}
5720
5721impl From<&str> for DeleteWorkspaceFileTrash {
5722    fn from(value: &str) -> Self {
5723        match value {
5724            "false" => Self::False,
5725            other => Self::Other(other.to_string()),
5726        }
5727    }
5728}
5729
5730/// `DeleteWorkspaceResponse` model.
5731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5732pub struct DeleteWorkspaceResponse {
5733    pub error: RevokeSessionShareResponseError,
5734    pub message: String,
5735    pub retry_after_seconds: i64,
5736}
5737
5738/// Governance-builder request to design a new agent (packages/governance/builder-flow.ts).
5739#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5740pub struct DesignRequest {
5741    pub request_id: String,
5742    pub tenant_id: String,
5743    #[serde(default, skip_serializing_if = "Option::is_none")]
5744    pub submitted_by: Option<String>,
5745    #[serde(default, skip_serializing_if = "Option::is_none")]
5746    pub agent_name: Option<String>,
5747    #[serde(default, skip_serializing_if = "Option::is_none")]
5748    pub agent_description: Option<String>,
5749    #[serde(default, skip_serializing_if = "Option::is_none")]
5750    pub agent_role: Option<String>,
5751    #[serde(default, skip_serializing_if = "Option::is_none")]
5752    pub tools: Option<Vec<String>>,
5753    #[serde(default, skip_serializing_if = "Option::is_none")]
5754    pub parent_agent_id: Option<String>,
5755    #[serde(default, skip_serializing_if = "Option::is_none")]
5756    pub rationale: Option<String>,
5757    pub status: DesignRequestStatus,
5758    /// Set once the request enters a vote.
5759    #[serde(default, skip_serializing_if = "Option::is_none")]
5760    pub proposal_id: Option<String>,
5761    /// Set once the approved design has been created.
5762    #[serde(default, skip_serializing_if = "Option::is_none")]
5763    pub spawned_agent_id: Option<String>,
5764    pub created_at: String,
5765    pub updated_at: String,
5766}
5767
5768/// Body for `POST /api/v1/governance/builder/requests`.
5769#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5770pub struct DesignRequestCreate {
5771    #[serde(default, skip_serializing_if = "Option::is_none")]
5772    pub submitted_by: Option<String>,
5773    #[serde(default, skip_serializing_if = "Option::is_none")]
5774    pub agent_name: Option<String>,
5775    #[serde(default, skip_serializing_if = "Option::is_none")]
5776    pub agent_description: Option<String>,
5777    #[serde(default, skip_serializing_if = "Option::is_none")]
5778    pub agent_role: Option<String>,
5779    #[serde(default, skip_serializing_if = "Option::is_none")]
5780    pub tools: Option<Vec<String>>,
5781    #[serde(default, skip_serializing_if = "Option::is_none")]
5782    pub parent_agent_id: Option<String>,
5783    #[serde(default, skip_serializing_if = "Option::is_none")]
5784    pub rationale: Option<String>,
5785}
5786
5787/// `DesignRequestStatus` enumeration.
5788#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5789pub enum DesignRequestStatus {
5790    #[default]
5791    #[serde(rename = "pending")]
5792    Pending,
5793    #[serde(rename = "voting")]
5794    Voting,
5795    #[serde(rename = "approved")]
5796    Approved,
5797    #[serde(rename = "rejected")]
5798    Rejected,
5799    #[serde(rename = "spawned")]
5800    Spawned,
5801    /// A value the API introduced after this SDK was generated.
5802    #[serde(untagged)]
5803    Other(String),
5804}
5805
5806impl DesignRequestStatus {
5807    /// The value as it appears on the wire.
5808    pub fn as_str(&self) -> &str {
5809        match self {
5810            Self::Pending => "pending",
5811            Self::Voting => "voting",
5812            Self::Approved => "approved",
5813            Self::Rejected => "rejected",
5814            Self::Spawned => "spawned",
5815            Self::Other(value) => value.as_str(),
5816        }
5817    }
5818}
5819
5820impl std::fmt::Display for DesignRequestStatus {
5821    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5822        f.write_str(self.as_str())
5823    }
5824}
5825
5826impl From<&str> for DesignRequestStatus {
5827    fn from(value: &str) -> Self {
5828        match value {
5829            "pending" => Self::Pending,
5830            "voting" => Self::Voting,
5831            "approved" => Self::Approved,
5832            "rejected" => Self::Rejected,
5833            "spawned" => Self::Spawned,
5834            other => Self::Other(other.to_string()),
5835        }
5836    }
5837}
5838
5839/// `DisableMfaResponse` model.
5840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5841pub struct DisableMfaResponse {
5842    pub disabled: bool,
5843}
5844
5845/// `DomainCertLifecycle` model.
5846#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5847pub struct DomainCertLifecycle {
5848    /// `renewal_due` is entered 14 days or less before `not_after`.
5849    pub state: DomainCertLifecycleState,
5850    #[serde(default, skip_serializing_if = "Option::is_none")]
5851    pub not_before: Option<String>,
5852    #[serde(default, skip_serializing_if = "Option::is_none")]
5853    pub not_after: Option<String>,
5854    /// Issuer CN, so a CA migration is visible without parsing the leaf.
5855    #[serde(default, skip_serializing_if = "Option::is_none")]
5856    pub issuer_cn: Option<String>,
5857    #[serde(default, skip_serializing_if = "Option::is_none")]
5858    pub last_checked_at: Option<String>,
5859    #[serde(default, skip_serializing_if = "Option::is_none")]
5860    pub last_error: Option<String>,
5861}
5862
5863/// `renewal_due` is entered 14 days or less before `not_after`.
5864#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5865pub enum DomainCertLifecycleState {
5866    #[default]
5867    #[serde(rename = "none")]
5868    None,
5869    #[serde(rename = "provisioning")]
5870    Provisioning,
5871    #[serde(rename = "active")]
5872    Active,
5873    #[serde(rename = "renewal_due")]
5874    RenewalDue,
5875    #[serde(rename = "failed")]
5876    Failed,
5877    #[serde(rename = "revoked")]
5878    Revoked,
5879    /// A value the API introduced after this SDK was generated.
5880    #[serde(untagged)]
5881    Other(String),
5882}
5883
5884impl DomainCertLifecycleState {
5885    /// The value as it appears on the wire.
5886    pub fn as_str(&self) -> &str {
5887        match self {
5888            Self::None => "none",
5889            Self::Provisioning => "provisioning",
5890            Self::Active => "active",
5891            Self::RenewalDue => "renewal_due",
5892            Self::Failed => "failed",
5893            Self::Revoked => "revoked",
5894            Self::Other(value) => value.as_str(),
5895        }
5896    }
5897}
5898
5899impl std::fmt::Display for DomainCertLifecycleState {
5900    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5901        f.write_str(self.as_str())
5902    }
5903}
5904
5905impl From<&str> for DomainCertLifecycleState {
5906    fn from(value: &str) -> Self {
5907        match value {
5908            "none" => Self::None,
5909            "provisioning" => Self::Provisioning,
5910            "active" => Self::Active,
5911            "renewal_due" => Self::RenewalDue,
5912            "failed" => Self::Failed,
5913            "revoked" => Self::Revoked,
5914            other => Self::Other(other.to_string()),
5915        }
5916    }
5917}
5918
5919/// `DomainDnsLifecycle` model.
5920#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5921pub struct DomainDnsLifecycle {
5922    /// `drift` means it verified once and no longer matches — distinct from `failed`, which never
5923    /// verified.
5924    pub state: DomainDnsLifecycleState,
5925    pub method: DomainDnsLifecycleMethod,
5926    /// What the customer points DNS at. Stored per record so changing the platform target does not
5927    /// silently invalidate domains already pinned to the old one.
5928    pub target: String,
5929    /// Most recent lookup, whatever its result.
5930    #[serde(default, skip_serializing_if = "Option::is_none")]
5931    pub last_checked_at: Option<String>,
5932    /// First time it matched. Sticky across verified → drift → verified, so it is not the time of
5933    /// the LAST success.
5934    #[serde(default, skip_serializing_if = "Option::is_none")]
5935    pub verified_at: Option<String>,
5936    #[serde(default, skip_serializing_if = "Option::is_none")]
5937    pub last_error: Option<String>,
5938}
5939
5940/// `DomainDnsLifecycleMethod` enumeration.
5941#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5942pub enum DomainDnsLifecycleMethod {
5943    #[default]
5944    #[serde(rename = "cname")]
5945    Cname,
5946    #[serde(rename = "a")]
5947    A,
5948    /// A value the API introduced after this SDK was generated.
5949    #[serde(untagged)]
5950    Other(String),
5951}
5952
5953impl DomainDnsLifecycleMethod {
5954    /// The value as it appears on the wire.
5955    pub fn as_str(&self) -> &str {
5956        match self {
5957            Self::Cname => "cname",
5958            Self::A => "a",
5959            Self::Other(value) => value.as_str(),
5960        }
5961    }
5962}
5963
5964impl std::fmt::Display for DomainDnsLifecycleMethod {
5965    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5966        f.write_str(self.as_str())
5967    }
5968}
5969
5970impl From<&str> for DomainDnsLifecycleMethod {
5971    fn from(value: &str) -> Self {
5972        match value {
5973            "cname" => Self::Cname,
5974            "a" => Self::A,
5975            other => Self::Other(other.to_string()),
5976        }
5977    }
5978}
5979
5980/// `drift` means it verified once and no longer matches — distinct from `failed`, which never
5981/// verified.
5982#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5983pub enum DomainDnsLifecycleState {
5984    #[default]
5985    #[serde(rename = "pending")]
5986    Pending,
5987    #[serde(rename = "verified")]
5988    Verified,
5989    #[serde(rename = "failed")]
5990    Failed,
5991    #[serde(rename = "drift")]
5992    Drift,
5993    #[serde(rename = "deactivated")]
5994    Deactivated,
5995    /// A value the API introduced after this SDK was generated.
5996    #[serde(untagged)]
5997    Other(String),
5998}
5999
6000impl DomainDnsLifecycleState {
6001    /// The value as it appears on the wire.
6002    pub fn as_str(&self) -> &str {
6003        match self {
6004            Self::Pending => "pending",
6005            Self::Verified => "verified",
6006            Self::Failed => "failed",
6007            Self::Drift => "drift",
6008            Self::Deactivated => "deactivated",
6009            Self::Other(value) => value.as_str(),
6010        }
6011    }
6012}
6013
6014impl std::fmt::Display for DomainDnsLifecycleState {
6015    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6016        f.write_str(self.as_str())
6017    }
6018}
6019
6020impl From<&str> for DomainDnsLifecycleState {
6021    fn from(value: &str) -> Self {
6022        match value {
6023            "pending" => Self::Pending,
6024            "verified" => Self::Verified,
6025            "failed" => Self::Failed,
6026            "drift" => Self::Drift,
6027            "deactivated" => Self::Deactivated,
6028            other => Self::Other(other.to_string()),
6029        }
6030    }
6031}
6032
6033/// `EmbeddingsRequest` model.
6034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6035pub struct EmbeddingsRequest {
6036    /// Embedding model (optional; platform default used)
6037    #[serde(default, skip_serializing_if = "Option::is_none")]
6038    pub model: Option<String>,
6039    /// Input text or array of texts
6040    pub input: serde_json::Value,
6041    /// Server default: `"float"`.
6042    #[serde(default, skip_serializing_if = "Option::is_none")]
6043    pub encoding_format: Option<EmbeddingsRequestEncodingFormat>,
6044    /// Requested embedding dimensions. **Currently ignored**: handler always emits the
6045    /// platform-configured dimension (256 for the default `multilingual-e5-large-instruct` model).
6046    #[serde(default, skip_serializing_if = "Option::is_none")]
6047    pub dimensions: Option<i64>,
6048}
6049
6050/// `EmbeddingsRequestEncodingFormat` enumeration.
6051#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6052pub enum EmbeddingsRequestEncodingFormat {
6053    #[default]
6054    #[serde(rename = "float")]
6055    Float,
6056    #[serde(rename = "base64")]
6057    Base64,
6058    /// A value the API introduced after this SDK was generated.
6059    #[serde(untagged)]
6060    Other(String),
6061}
6062
6063impl EmbeddingsRequestEncodingFormat {
6064    /// The value as it appears on the wire.
6065    pub fn as_str(&self) -> &str {
6066        match self {
6067            Self::Float => "float",
6068            Self::Base64 => "base64",
6069            Self::Other(value) => value.as_str(),
6070        }
6071    }
6072}
6073
6074impl std::fmt::Display for EmbeddingsRequestEncodingFormat {
6075    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6076        f.write_str(self.as_str())
6077    }
6078}
6079
6080impl From<&str> for EmbeddingsRequestEncodingFormat {
6081    fn from(value: &str) -> Self {
6082        match value {
6083            "float" => Self::Float,
6084            "base64" => Self::Base64,
6085            other => Self::Other(other.to_string()),
6086        }
6087    }
6088}
6089
6090/// `EmbeddingsResponse` model.
6091#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6092pub struct EmbeddingsResponse {
6093    /// Always `list`.
6094    pub object: String,
6095    pub data: Vec<EmbeddingsResponseDataItem>,
6096    pub model: String,
6097    #[serde(default, skip_serializing_if = "Option::is_none")]
6098    pub usage: Option<EmbeddingsResponseUsage>,
6099}
6100
6101/// `EmbeddingsResponseDataItem` model.
6102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6103pub struct EmbeddingsResponseDataItem {
6104    /// Always `embedding`.
6105    pub object: String,
6106    pub embedding: Vec<f64>,
6107    pub index: i64,
6108}
6109
6110/// `EmbeddingsResponseUsage` model.
6111#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6112pub struct EmbeddingsResponseUsage {
6113    #[serde(default, skip_serializing_if = "Option::is_none")]
6114    pub prompt_tokens: Option<i64>,
6115    #[serde(default, skip_serializing_if = "Option::is_none")]
6116    pub total_tokens: Option<i64>,
6117}
6118
6119/// `EmergencyState` model.
6120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6121pub struct EmergencyState {
6122    pub mode: EmergencyStateMode,
6123    #[serde(default, skip_serializing_if = "Option::is_none")]
6124    pub reason: Option<String>,
6125    #[serde(default, skip_serializing_if = "Option::is_none")]
6126    pub activated_at: Option<String>,
6127    #[serde(default, skip_serializing_if = "Option::is_none")]
6128    pub activated_by: Option<String>,
6129    #[serde(default, skip_serializing_if = "Option::is_none")]
6130    pub deadline: Option<String>,
6131}
6132
6133/// `EmergencyStateMode` enumeration.
6134#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6135pub enum EmergencyStateMode {
6136    #[default]
6137    #[serde(rename = "normal")]
6138    Normal,
6139    #[serde(rename = "safe_mode")]
6140    SafeMode,
6141    #[serde(rename = "arbitration_safe_mode")]
6142    ArbitrationSafeMode,
6143    #[serde(rename = "bootstrap")]
6144    Bootstrap,
6145    /// A value the API introduced after this SDK was generated.
6146    #[serde(untagged)]
6147    Other(String),
6148}
6149
6150impl EmergencyStateMode {
6151    /// The value as it appears on the wire.
6152    pub fn as_str(&self) -> &str {
6153        match self {
6154            Self::Normal => "normal",
6155            Self::SafeMode => "safe_mode",
6156            Self::ArbitrationSafeMode => "arbitration_safe_mode",
6157            Self::Bootstrap => "bootstrap",
6158            Self::Other(value) => value.as_str(),
6159        }
6160    }
6161}
6162
6163impl std::fmt::Display for EmergencyStateMode {
6164    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6165        f.write_str(self.as_str())
6166    }
6167}
6168
6169impl From<&str> for EmergencyStateMode {
6170    fn from(value: &str) -> Self {
6171        match value {
6172            "normal" => Self::Normal,
6173            "safe_mode" => Self::SafeMode,
6174            "arbitration_safe_mode" => Self::ArbitrationSafeMode,
6175            "bootstrap" => Self::Bootstrap,
6176            other => Self::Other(other.to_string()),
6177        }
6178    }
6179}
6180
6181/// `EmptyWorkspaceTrashResponse` model.
6182#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6183pub struct EmptyWorkspaceTrashResponse {
6184    pub deleted_count: i64,
6185    pub message: String,
6186}
6187
6188/// `EnforcementResult` model.
6189#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6190pub struct EnforcementResult {
6191    /// False when any matched rule carries a blocking penalty.
6192    pub allowed: bool,
6193    #[serde(rename = "checkResult")]
6194    pub check_result: EnforcementResultCheckResult,
6195    /// What the matched rules call for. Empty when nothing matched.
6196    pub penalties: Vec<EnforcementResultPenalty>,
6197}
6198
6199/// `EnforcementResultCheckResult` model.
6200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6201pub struct EnforcementResultCheckResult {
6202    pub allowed: bool,
6203    /// Rule ids actually evaluated. Empty means no rule applied — never that nothing was checked.
6204    pub checked_rules: Vec<String>,
6205    pub violations: Vec<ConstitutionViolation>,
6206    pub checked_at: String,
6207}
6208
6209/// `EnforcementResultPenalty` model.
6210#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6211pub struct EnforcementResultPenalty {
6212    #[serde(rename = "ruleId")]
6213    pub rule_id: String,
6214    pub penalty: ConstitutionRulePenalty,
6215}
6216
6217/// `EnrolMfaRequest` model.
6218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6219pub struct EnrolMfaRequest {
6220    /// Account label embedded in otpauth URL (defaults to user id).
6221    #[serde(default, skip_serializing_if = "Option::is_none")]
6222    pub label: Option<String>,
6223    /// Issuer string embedded in otpauth URL (defaults to `UARP`).
6224    #[serde(default, skip_serializing_if = "Option::is_none")]
6225    pub issuer: Option<String>,
6226    #[serde(default, skip_serializing_if = "Option::is_none")]
6227    pub algorithm: Option<EnrolMfaRequestAlgorithm>,
6228}
6229
6230/// `EnrolMfaRequestAlgorithm` enumeration.
6231#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6232pub enum EnrolMfaRequestAlgorithm {
6233    #[default]
6234    #[serde(rename = "SHA-1")]
6235    Sha1,
6236    #[serde(rename = "SHA-256")]
6237    Sha256,
6238    #[serde(rename = "SHA-512")]
6239    Sha512,
6240    /// A value the API introduced after this SDK was generated.
6241    #[serde(untagged)]
6242    Other(String),
6243}
6244
6245impl EnrolMfaRequestAlgorithm {
6246    /// The value as it appears on the wire.
6247    pub fn as_str(&self) -> &str {
6248        match self {
6249            Self::Sha1 => "SHA-1",
6250            Self::Sha256 => "SHA-256",
6251            Self::Sha512 => "SHA-512",
6252            Self::Other(value) => value.as_str(),
6253        }
6254    }
6255}
6256
6257impl std::fmt::Display for EnrolMfaRequestAlgorithm {
6258    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6259        f.write_str(self.as_str())
6260    }
6261}
6262
6263impl From<&str> for EnrolMfaRequestAlgorithm {
6264    fn from(value: &str) -> Self {
6265        match value {
6266            "SHA-1" => Self::Sha1,
6267            "SHA-256" => Self::Sha256,
6268            "SHA-512" => Self::Sha512,
6269            other => Self::Other(other.to_string()),
6270        }
6271    }
6272}
6273
6274/// RFC 9457 problem+json style error; correlationId for request tracing.
6275#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6276pub struct Error {
6277    pub r#type: String,
6278    pub title: String,
6279    pub status: i64,
6280    #[serde(default, skip_serializing_if = "Option::is_none")]
6281    pub detail: Option<String>,
6282    /// Request ID for tracing
6283    #[serde(rename = "correlationId", default, skip_serializing_if = "Option::is_none")]
6284    pub correlation_id: Option<String>,
6285    /// Field-level validation errors (present on 422 responses)
6286    #[serde(default, skip_serializing_if = "Option::is_none")]
6287    pub errors: Option<Vec<ErrorError>>,
6288}
6289
6290/// `ErrorError` model.
6291#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6292pub struct ErrorError {
6293    #[serde(default, skip_serializing_if = "Option::is_none")]
6294    pub field: Option<String>,
6295    #[serde(default, skip_serializing_if = "Option::is_none")]
6296    pub message: Option<String>,
6297}
6298
6299/// What a person reported from the “report to the team” button, or general feedback. Reports
6300/// are stored in ONE global inbox across all tenants, and expire after 90 days — the inbox is a
6301/// working queue, not an archive.
6302#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6303pub struct ErrorReport {
6304    pub id: String,
6305    /// The tenant the report came FROM, not the inbox it is stored in.
6306    pub tenant_id: String,
6307    #[serde(default, skip_serializing_if = "Option::is_none")]
6308    pub user_id: Option<String>,
6309    #[serde(default, skip_serializing_if = "Option::is_none")]
6310    pub key_id: Option<String>,
6311    /// The toast headline. Defaults to “Reported error” when the caller sends none.
6312    pub title: String,
6313    pub message: String,
6314    /// What the person was doing — action, component.
6315    #[serde(default, skip_serializing_if = "Option::is_none")]
6316    pub context: Option<String>,
6317    #[serde(default, skip_serializing_if = "Option::is_none")]
6318    pub url: Option<String>,
6319    #[serde(default, skip_serializing_if = "Option::is_none")]
6320    pub run_id: Option<String>,
6321    #[serde(default, skip_serializing_if = "Option::is_none")]
6322    pub user_agent: Option<String>,
6323    /// Anything other than `feedback` is filed as an `error`.
6324    pub kind: ErrorReportKind,
6325    pub status: ErrorReportStatus,
6326    pub created_at: String,
6327}
6328
6329/// Anything other than `feedback` is filed as an `error`.
6330#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6331pub enum ErrorReportKind {
6332    #[default]
6333    #[serde(rename = "error")]
6334    Error,
6335    #[serde(rename = "feedback")]
6336    Feedback,
6337    /// A value the API introduced after this SDK was generated.
6338    #[serde(untagged)]
6339    Other(String),
6340}
6341
6342impl ErrorReportKind {
6343    /// The value as it appears on the wire.
6344    pub fn as_str(&self) -> &str {
6345        match self {
6346            Self::Error => "error",
6347            Self::Feedback => "feedback",
6348            Self::Other(value) => value.as_str(),
6349        }
6350    }
6351}
6352
6353impl std::fmt::Display for ErrorReportKind {
6354    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6355        f.write_str(self.as_str())
6356    }
6357}
6358
6359impl From<&str> for ErrorReportKind {
6360    fn from(value: &str) -> Self {
6361        match value {
6362            "error" => Self::Error,
6363            "feedback" => Self::Feedback,
6364            other => Self::Other(other.to_string()),
6365        }
6366    }
6367}
6368
6369/// `ErrorReportStatus` enumeration.
6370#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6371pub enum ErrorReportStatus {
6372    #[default]
6373    #[serde(rename = "new")]
6374    New,
6375    #[serde(rename = "resolved")]
6376    Resolved,
6377    /// A value the API introduced after this SDK was generated.
6378    #[serde(untagged)]
6379    Other(String),
6380}
6381
6382impl ErrorReportStatus {
6383    /// The value as it appears on the wire.
6384    pub fn as_str(&self) -> &str {
6385        match self {
6386            Self::New => "new",
6387            Self::Resolved => "resolved",
6388            Self::Other(value) => value.as_str(),
6389        }
6390    }
6391}
6392
6393impl std::fmt::Display for ErrorReportStatus {
6394    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6395        f.write_str(self.as_str())
6396    }
6397}
6398
6399impl From<&str> for ErrorReportStatus {
6400    fn from(value: &str) -> Self {
6401        match value {
6402            "new" => Self::New,
6403            "resolved" => Self::Resolved,
6404            other => Self::Other(other.to_string()),
6405        }
6406    }
6407}
6408
6409/// `EstimateRunCostRequest` model.
6410#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6411pub struct EstimateRunCostRequest {
6412    pub agent_id: String,
6413    /// The prompt, used for the input-token estimate.
6414    #[serde(default, skip_serializing_if = "Option::is_none")]
6415    pub input_text: Option<String>,
6416    /// Picks up a per-session model override, when one is set.
6417    #[serde(default, skip_serializing_if = "Option::is_none")]
6418    pub session_id: Option<String>,
6419}
6420
6421/// `Experiment` model.
6422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6423pub struct Experiment {
6424    #[serde(default, skip_serializing_if = "Option::is_none")]
6425    pub experiment_id: Option<String>,
6426    #[serde(default, skip_serializing_if = "Option::is_none")]
6427    pub tenant_id: Option<String>,
6428    #[serde(default, skip_serializing_if = "Option::is_none")]
6429    pub agent_id: Option<String>,
6430    #[serde(default, skip_serializing_if = "Option::is_none")]
6431    pub name: Option<String>,
6432    #[serde(default, skip_serializing_if = "Option::is_none")]
6433    pub dataset_id: Option<String>,
6434    #[serde(default, skip_serializing_if = "Option::is_none")]
6435    pub variants: Option<Vec<ExperimentVariant>>,
6436    #[serde(default, skip_serializing_if = "Option::is_none")]
6437    pub status: Option<ExperimentStatus>,
6438    #[serde(default, skip_serializing_if = "Option::is_none")]
6439    pub comparison: Option<serde_json::Map<String, serde_json::Value>>,
6440    #[serde(default, skip_serializing_if = "Option::is_none")]
6441    pub created_at: Option<String>,
6442}
6443
6444/// `ExperimentStatus` enumeration.
6445#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6446pub enum ExperimentStatus {
6447    #[default]
6448    #[serde(rename = "pending")]
6449    Pending,
6450    #[serde(rename = "running")]
6451    Running,
6452    #[serde(rename = "completed")]
6453    Completed,
6454    /// A value the API introduced after this SDK was generated.
6455    #[serde(untagged)]
6456    Other(String),
6457}
6458
6459impl ExperimentStatus {
6460    /// The value as it appears on the wire.
6461    pub fn as_str(&self) -> &str {
6462        match self {
6463            Self::Pending => "pending",
6464            Self::Running => "running",
6465            Self::Completed => "completed",
6466            Self::Other(value) => value.as_str(),
6467        }
6468    }
6469}
6470
6471impl std::fmt::Display for ExperimentStatus {
6472    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6473        f.write_str(self.as_str())
6474    }
6475}
6476
6477impl From<&str> for ExperimentStatus {
6478    fn from(value: &str) -> Self {
6479        match value {
6480            "pending" => Self::Pending,
6481            "running" => Self::Running,
6482            "completed" => Self::Completed,
6483            other => Self::Other(other.to_string()),
6484        }
6485    }
6486}
6487
6488/// `ExperimentVariant` model.
6489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6490pub struct ExperimentVariant {
6491    #[serde(default, skip_serializing_if = "Option::is_none")]
6492    pub version: Option<String>,
6493    #[serde(default, skip_serializing_if = "Option::is_none")]
6494    pub eval_run_id: Option<String>,
6495}
6496
6497/// `ExportAdminConfigResponse` model.
6498#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6499pub struct ExportAdminConfigResponse {
6500    pub exported_at: String,
6501    pub section_count: i64,
6502    pub sections: serde_json::Map<String, serde_json::Value>,
6503}
6504
6505/// `ExportMyAccountFormat` enumeration.
6506#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6507pub enum ExportMyAccountFormat {
6508    #[default]
6509    #[serde(rename = "zip")]
6510    Zip,
6511    #[serde(rename = "json")]
6512    JSON,
6513    /// A value the API introduced after this SDK was generated.
6514    #[serde(untagged)]
6515    Other(String),
6516}
6517
6518impl ExportMyAccountFormat {
6519    /// The value as it appears on the wire.
6520    pub fn as_str(&self) -> &str {
6521        match self {
6522            Self::Zip => "zip",
6523            Self::JSON => "json",
6524            Self::Other(value) => value.as_str(),
6525        }
6526    }
6527}
6528
6529impl std::fmt::Display for ExportMyAccountFormat {
6530    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6531        f.write_str(self.as_str())
6532    }
6533}
6534
6535impl From<&str> for ExportMyAccountFormat {
6536    fn from(value: &str) -> Self {
6537        match value {
6538            "zip" => Self::Zip,
6539            "json" => Self::JSON,
6540            other => Self::Other(other.to_string()),
6541        }
6542    }
6543}
6544
6545/// `ExportSessionFormat` enumeration.
6546#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6547pub enum ExportSessionFormat {
6548    #[default]
6549    #[serde(rename = "md")]
6550    Md,
6551    #[serde(rename = "json")]
6552    JSON,
6553    /// A value the API introduced after this SDK was generated.
6554    #[serde(untagged)]
6555    Other(String),
6556}
6557
6558impl ExportSessionFormat {
6559    /// The value as it appears on the wire.
6560    pub fn as_str(&self) -> &str {
6561        match self {
6562            Self::Md => "md",
6563            Self::JSON => "json",
6564            Self::Other(value) => value.as_str(),
6565        }
6566    }
6567}
6568
6569impl std::fmt::Display for ExportSessionFormat {
6570    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6571        f.write_str(self.as_str())
6572    }
6573}
6574
6575impl From<&str> for ExportSessionFormat {
6576    fn from(value: &str) -> Self {
6577        match value {
6578            "md" => Self::Md,
6579            "json" => Self::JSON,
6580            other => Self::Other(other.to_string()),
6581        }
6582    }
6583}
6584
6585/// `FeedEntry` model.
6586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6587pub struct FeedEntry {
6588    pub feed_id: String,
6589    pub tenant_id: String,
6590    pub timestamp: String,
6591    pub event_type: FeedEntryEventType,
6592    pub title: String,
6593    #[serde(default, skip_serializing_if = "Option::is_none")]
6594    pub summary: Option<String>,
6595    #[serde(default, skip_serializing_if = "Option::is_none")]
6596    pub agent_id: Option<String>,
6597    #[serde(default, skip_serializing_if = "Option::is_none")]
6598    pub agent_name: Option<String>,
6599    #[serde(default, skip_serializing_if = "Option::is_none")]
6600    pub company_id: Option<String>,
6601    #[serde(default, skip_serializing_if = "Option::is_none")]
6602    pub company_name: Option<String>,
6603    #[serde(default, skip_serializing_if = "Option::is_none")]
6604    pub team_id: Option<String>,
6605    #[serde(default, skip_serializing_if = "Option::is_none")]
6606    pub team_name: Option<String>,
6607    #[serde(default, skip_serializing_if = "Option::is_none")]
6608    pub session_id: Option<String>,
6609    #[serde(default, skip_serializing_if = "Option::is_none")]
6610    pub run_id: Option<String>,
6611    #[serde(default, skip_serializing_if = "Option::is_none")]
6612    pub status: Option<String>,
6613    #[serde(default, skip_serializing_if = "Option::is_none")]
6614    pub metrics: Option<FeedEntryMetrics>,
6615    #[serde(default, skip_serializing_if = "Option::is_none")]
6616    pub error: Option<String>,
6617}
6618
6619/// `FeedEntryEventType` enumeration.
6620#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6621pub enum FeedEntryEventType {
6622    #[default]
6623    #[serde(rename = "run.started")]
6624    RunStarted,
6625    #[serde(rename = "run.completed")]
6626    RunCompleted,
6627    #[serde(rename = "run.failed")]
6628    RunFailed,
6629    #[serde(rename = "run.timeout")]
6630    RunTimeout,
6631    #[serde(rename = "run.cancelled")]
6632    RunCancelled,
6633    #[serde(rename = "session.created")]
6634    SessionCreated,
6635    #[serde(rename = "company.tick_start")]
6636    CompanyTickStart,
6637    #[serde(rename = "company.tick_end")]
6638    CompanyTickEnd,
6639    #[serde(rename = "company.paused")]
6640    CompanyPaused,
6641    #[serde(rename = "company.resumed")]
6642    CompanyResumed,
6643    #[serde(rename = "company.escalation")]
6644    CompanyEscalation,
6645    #[serde(rename = "team.round_start")]
6646    TeamRoundStart,
6647    #[serde(rename = "team.round_end")]
6648    TeamRoundEnd,
6649    #[serde(rename = "objective.created")]
6650    ObjectiveCreated,
6651    #[serde(rename = "objective.completed")]
6652    ObjectiveCompleted,
6653    #[serde(rename = "agent.created")]
6654    AgentCreated,
6655    /// A value the API introduced after this SDK was generated.
6656    #[serde(untagged)]
6657    Other(String),
6658}
6659
6660impl FeedEntryEventType {
6661    /// The value as it appears on the wire.
6662    pub fn as_str(&self) -> &str {
6663        match self {
6664            Self::RunStarted => "run.started",
6665            Self::RunCompleted => "run.completed",
6666            Self::RunFailed => "run.failed",
6667            Self::RunTimeout => "run.timeout",
6668            Self::RunCancelled => "run.cancelled",
6669            Self::SessionCreated => "session.created",
6670            Self::CompanyTickStart => "company.tick_start",
6671            Self::CompanyTickEnd => "company.tick_end",
6672            Self::CompanyPaused => "company.paused",
6673            Self::CompanyResumed => "company.resumed",
6674            Self::CompanyEscalation => "company.escalation",
6675            Self::TeamRoundStart => "team.round_start",
6676            Self::TeamRoundEnd => "team.round_end",
6677            Self::ObjectiveCreated => "objective.created",
6678            Self::ObjectiveCompleted => "objective.completed",
6679            Self::AgentCreated => "agent.created",
6680            Self::Other(value) => value.as_str(),
6681        }
6682    }
6683}
6684
6685impl std::fmt::Display for FeedEntryEventType {
6686    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6687        f.write_str(self.as_str())
6688    }
6689}
6690
6691impl From<&str> for FeedEntryEventType {
6692    fn from(value: &str) -> Self {
6693        match value {
6694            "run.started" => Self::RunStarted,
6695            "run.completed" => Self::RunCompleted,
6696            "run.failed" => Self::RunFailed,
6697            "run.timeout" => Self::RunTimeout,
6698            "run.cancelled" => Self::RunCancelled,
6699            "session.created" => Self::SessionCreated,
6700            "company.tick_start" => Self::CompanyTickStart,
6701            "company.tick_end" => Self::CompanyTickEnd,
6702            "company.paused" => Self::CompanyPaused,
6703            "company.resumed" => Self::CompanyResumed,
6704            "company.escalation" => Self::CompanyEscalation,
6705            "team.round_start" => Self::TeamRoundStart,
6706            "team.round_end" => Self::TeamRoundEnd,
6707            "objective.created" => Self::ObjectiveCreated,
6708            "objective.completed" => Self::ObjectiveCompleted,
6709            "agent.created" => Self::AgentCreated,
6710            other => Self::Other(other.to_string()),
6711        }
6712    }
6713}
6714
6715/// `FeedEntryMetrics` model.
6716#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6717pub struct FeedEntryMetrics {
6718    #[serde(default, skip_serializing_if = "Option::is_none")]
6719    pub duration_ms: Option<i64>,
6720    #[serde(default, skip_serializing_if = "Option::is_none")]
6721    pub tokens_used: Option<i64>,
6722    #[serde(default, skip_serializing_if = "Option::is_none")]
6723    pub cost_usd: Option<f64>,
6724    #[serde(default, skip_serializing_if = "Option::is_none")]
6725    pub steps: Option<i64>,
6726    #[serde(default, skip_serializing_if = "Option::is_none")]
6727    pub tool_calls: Option<i64>,
6728}
6729
6730/// `FileArbiterAppealRequest` model.
6731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6732pub struct FileArbiterAppealRequest {
6733    #[serde(default, skip_serializing_if = "Option::is_none")]
6734    pub filed_by: Option<String>,
6735    pub reason: String,
6736}
6737
6738/// `FileArbiterAppealResponse` model.
6739#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6740pub struct FileArbiterAppealResponse {
6741    pub appeal_id: String,
6742    pub case_id: String,
6743    pub filed_by: String,
6744    pub reason: String,
6745    pub panel_arbiter_ids: Vec<String>,
6746    pub status: FileArbiterAppealResponseStatus,
6747    pub filed_at: String,
6748    #[serde(default, skip_serializing_if = "Option::is_none")]
6749    pub resolved_at: Option<String>,
6750}
6751
6752/// `FileArbiterAppealResponseStatus` enumeration.
6753#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6754pub enum FileArbiterAppealResponseStatus {
6755    #[default]
6756    #[serde(rename = "pending")]
6757    Pending,
6758    #[serde(rename = "upheld")]
6759    Upheld,
6760    #[serde(rename = "overturned")]
6761    Overturned,
6762    /// A value the API introduced after this SDK was generated.
6763    #[serde(untagged)]
6764    Other(String),
6765}
6766
6767impl FileArbiterAppealResponseStatus {
6768    /// The value as it appears on the wire.
6769    pub fn as_str(&self) -> &str {
6770        match self {
6771            Self::Pending => "pending",
6772            Self::Upheld => "upheld",
6773            Self::Overturned => "overturned",
6774            Self::Other(value) => value.as_str(),
6775        }
6776    }
6777}
6778
6779impl std::fmt::Display for FileArbiterAppealResponseStatus {
6780    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6781        f.write_str(self.as_str())
6782    }
6783}
6784
6785impl From<&str> for FileArbiterAppealResponseStatus {
6786    fn from(value: &str) -> Self {
6787        match value {
6788            "pending" => Self::Pending,
6789            "upheld" => Self::Upheld,
6790            "overturned" => Self::Overturned,
6791            other => Self::Other(other.to_string()),
6792        }
6793    }
6794}
6795
6796/// `FileArbiterCaseRequest` model.
6797#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6798pub struct FileArbiterCaseRequest {
6799    pub filed_by: String,
6800    pub against_agent_id: String,
6801    #[serde(default, skip_serializing_if = "Option::is_none")]
6802    pub reason: Option<String>,
6803}
6804
6805/// `FileEntry` model.
6806#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6807pub struct FileEntry {
6808    pub created_at: String,
6809    pub file_id: String,
6810    pub filename: String,
6811    pub mime_type: String,
6812    pub sha256: String,
6813    pub size_bytes: i64,
6814    pub tenant_id: String,
6815}
6816
6817/// A stored file as GET /files/{fileId} serves it (measured 2026-09-10 on e2e-canon). POST
6818/// /files returns the same record plus `url`.
6819#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6820pub struct FileRecord {
6821    pub file_id: String,
6822    pub tenant_id: String,
6823    pub filename: String,
6824    pub mime_type: String,
6825    pub size_bytes: i64,
6826    pub sha256: String,
6827    pub created_at: String,
6828}
6829
6830/// The operator's canvas: where each agent sits, how they are wired, and the notes and
6831/// not-yet-real nodes drawn around them. Persisted as one record per tenant.
6832#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6833pub struct FleetLayout {
6834    /// Agent id → its place on the canvas.
6835    pub positions: HashMap<String, Value3>,
6836    pub edges: Vec<FleetLayoutEdge>,
6837    #[serde(default, skip_serializing_if = "Option::is_none")]
6838    pub notes: Option<Vec<FleetLayoutNote>>,
6839    #[serde(default, skip_serializing_if = "Option::is_none")]
6840    pub drafts: Option<Vec<FleetLayoutDraft>>,
6841    #[serde(default, skip_serializing_if = "Option::is_none")]
6842    pub updated_at: Option<String>,
6843    /// Present ONLY when the save discarded something. Counts per collection of the items that did
6844    /// not survive the caps or validation. A 200 without this field saved everything.
6845    #[serde(default, skip_serializing_if = "Option::is_none")]
6846    pub dropped: Option<FleetLayoutDropped>,
6847}
6848
6849/// `FleetLayoutDraft` model.
6850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6851pub struct FleetLayoutDraft {
6852    pub id: String,
6853    /// memory / knowledge / tool / condition / … — a node the operator drew that is not a backend
6854    /// entity yet.
6855    pub kind: String,
6856    pub x: f64,
6857    pub y: f64,
6858    #[serde(default, skip_serializing_if = "Option::is_none")]
6859    pub label: Option<String>,
6860    #[serde(default, skip_serializing_if = "Option::is_none")]
6861    pub config: Option<serde_json::Map<String, serde_json::Value>>,
6862}
6863
6864/// Present ONLY when the save discarded something. Counts per collection of the items that did
6865/// not survive the caps or validation. A 200 without this field saved everything.
6866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6867pub struct FleetLayoutDropped {
6868    pub positions: i64,
6869    pub edges: i64,
6870    pub notes: i64,
6871    pub drafts: i64,
6872}
6873
6874/// `FleetLayoutEdge` model.
6875#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6876pub struct FleetLayoutEdge {
6877    pub id: String,
6878    /// Agent id.
6879    pub source: String,
6880    /// Agent id.
6881    pub target: String,
6882    /// Edge kind; a workflow edge is what makes the graph runnable.
6883    #[serde(default, skip_serializing_if = "Option::is_none")]
6884    pub r#type: Option<String>,
6885}
6886
6887/// `FleetLayoutNote` model.
6888#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6889pub struct FleetLayoutNote {
6890    pub id: String,
6891    pub x: f64,
6892    pub y: f64,
6893    pub w: f64,
6894    pub h: f64,
6895    pub text: String,
6896    #[serde(default, skip_serializing_if = "Option::is_none")]
6897    pub color: Option<String>,
6898    /// A frame is a large titled rectangle drawn BEHIND the nodes to group a squad.
6899    #[serde(default, skip_serializing_if = "Option::is_none")]
6900    pub frame: Option<bool>,
6901}
6902
6903/// What a client SENDS when saving the canvas. The stored record additionally carries
6904/// `updated_at`, and the response may carry `dropped` — both are produced by the server, so
6905/// neither belongs in a request.
6906#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6907pub struct FleetLayoutUpdate {
6908    /// Agent id → its place on the canvas.
6909    pub positions: HashMap<String, Value2>,
6910    pub edges: Vec<FleetLayoutUpdateEdge>,
6911    #[serde(default, skip_serializing_if = "Option::is_none")]
6912    pub notes: Option<Vec<FleetLayoutUpdateNote>>,
6913    #[serde(default, skip_serializing_if = "Option::is_none")]
6914    pub drafts: Option<Vec<FleetLayoutUpdateDraft>>,
6915}
6916
6917/// `FleetLayoutUpdateDraft` model.
6918#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6919pub struct FleetLayoutUpdateDraft {
6920    pub id: String,
6921    pub kind: String,
6922    pub x: f64,
6923    pub y: f64,
6924    #[serde(default, skip_serializing_if = "Option::is_none")]
6925    pub label: Option<String>,
6926    #[serde(default, skip_serializing_if = "Option::is_none")]
6927    pub config: Option<serde_json::Map<String, serde_json::Value>>,
6928}
6929
6930/// `FleetLayoutUpdateEdge` model.
6931#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6932pub struct FleetLayoutUpdateEdge {
6933    pub id: String,
6934    pub source: String,
6935    pub target: String,
6936    #[serde(default, skip_serializing_if = "Option::is_none")]
6937    pub r#type: Option<String>,
6938}
6939
6940/// `FleetLayoutUpdateNote` model.
6941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6942pub struct FleetLayoutUpdateNote {
6943    pub id: String,
6944    pub x: f64,
6945    pub y: f64,
6946    pub w: f64,
6947    pub h: f64,
6948    pub text: String,
6949    #[serde(default, skip_serializing_if = "Option::is_none")]
6950    pub color: Option<String>,
6951    #[serde(default, skip_serializing_if = "Option::is_none")]
6952    pub frame: Option<bool>,
6953}
6954
6955/// `FounderIdentity` model.
6956#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6957pub struct FounderIdentity {
6958    /// Empty string when unset — this read never omits the key.
6959    pub founder_id: String,
6960    pub founder_name: String,
6961    pub founder_public_key: String,
6962}
6963
6964/// `FriaReport` model.
6965#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6966pub struct FriaReport {
6967    pub agent_id: String,
6968    pub risk_level: String,
6969    pub rights_assessed: Vec<FriaRight>,
6970    pub mitigations: String,
6971    pub assessor: String,
6972    pub assessed_at: String,
6973    pub next_review: String,
6974}
6975
6976/// `FriaRight` model.
6977#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6978pub struct FriaRight {
6979    pub right: String,
6980    pub impact: FriaRightImpact,
6981    pub justification: String,
6982    #[serde(default, skip_serializing_if = "Option::is_none")]
6983    pub mitigation: Option<String>,
6984}
6985
6986/// `FriaRightImpact` enumeration.
6987#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6988pub enum FriaRightImpact {
6989    #[default]
6990    #[serde(rename = "none")]
6991    None,
6992    #[serde(rename = "low")]
6993    Low,
6994    #[serde(rename = "medium")]
6995    Medium,
6996    #[serde(rename = "high")]
6997    High,
6998    /// A value the API introduced after this SDK was generated.
6999    #[serde(untagged)]
7000    Other(String),
7001}
7002
7003impl FriaRightImpact {
7004    /// The value as it appears on the wire.
7005    pub fn as_str(&self) -> &str {
7006        match self {
7007            Self::None => "none",
7008            Self::Low => "low",
7009            Self::Medium => "medium",
7010            Self::High => "high",
7011            Self::Other(value) => value.as_str(),
7012        }
7013    }
7014}
7015
7016impl std::fmt::Display for FriaRightImpact {
7017    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7018        f.write_str(self.as_str())
7019    }
7020}
7021
7022impl From<&str> for FriaRightImpact {
7023    fn from(value: &str) -> Self {
7024        match value {
7025            "none" => Self::None,
7026            "low" => Self::Low,
7027            "medium" => Self::Medium,
7028            "high" => Self::High,
7029            other => Self::Other(other.to_string()),
7030        }
7031    }
7032}
7033
7034/// `GenerateAdminBlogPostResponse` model.
7035#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7036pub struct GenerateAdminBlogPostResponse {
7037    pub post: BlogPost,
7038}
7039
7040/// `GetActivityFeedResponse` model.
7041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7042pub struct GetActivityFeedResponse {
7043    #[serde(default, skip_serializing_if = "Option::is_none")]
7044    pub entries: Option<Vec<FeedEntry>>,
7045    #[serde(default, skip_serializing_if = "Option::is_none")]
7046    pub cursor: Option<String>,
7047    #[serde(default, skip_serializing_if = "Option::is_none")]
7048    pub total: Option<i64>,
7049}
7050
7051/// `GetAdminBlogConfigResponse` model.
7052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7053pub struct GetAdminBlogConfigResponse {
7054    pub config: BlogConfig,
7055}
7056
7057/// `GetAdminDisabledToolsResponse` model.
7058#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7059pub struct GetAdminDisabledToolsResponse {
7060    pub ok: bool,
7061    pub disabled_tools: Vec<String>,
7062}
7063
7064/// `GetAdminFounderConfigResponse` model.
7065#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7066pub struct GetAdminFounderConfigResponse {
7067    pub kv: FounderIdentity,
7068    pub env: FounderIdentity,
7069    pub effective: FounderIdentity,
7070}
7071
7072/// `GetAdminGuardrailsResponse` model.
7073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7074pub struct GetAdminGuardrailsResponse {
7075    #[serde(default, skip_serializing_if = "Option::is_none")]
7076    pub guardrails: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7077}
7078
7079/// `GetAdminIntegrationOAuthProviderProvider` enumeration.
7080#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7081pub enum GetAdminIntegrationOAuthProviderProvider {
7082    #[default]
7083    #[serde(rename = "github")]
7084    Github,
7085    #[serde(rename = "google")]
7086    Google,
7087    #[serde(rename = "slack")]
7088    Slack,
7089    #[serde(rename = "notion")]
7090    Notion,
7091    #[serde(rename = "stripe")]
7092    Stripe,
7093    #[serde(rename = "jira")]
7094    Jira,
7095    #[serde(rename = "zendesk")]
7096    Zendesk,
7097    #[serde(rename = "hubspot")]
7098    Hubspot,
7099    #[serde(rename = "linkedin")]
7100    Linkedin,
7101    #[serde(rename = "youtube")]
7102    Youtube,
7103    #[serde(rename = "instagram")]
7104    Instagram,
7105    #[serde(rename = "x_twitter")]
7106    XTwitter,
7107    #[serde(rename = "facebook")]
7108    Facebook,
7109    #[serde(rename = "tiktok")]
7110    Tiktok,
7111    /// A value the API introduced after this SDK was generated.
7112    #[serde(untagged)]
7113    Other(String),
7114}
7115
7116impl GetAdminIntegrationOAuthProviderProvider {
7117    /// The value as it appears on the wire.
7118    pub fn as_str(&self) -> &str {
7119        match self {
7120            Self::Github => "github",
7121            Self::Google => "google",
7122            Self::Slack => "slack",
7123            Self::Notion => "notion",
7124            Self::Stripe => "stripe",
7125            Self::Jira => "jira",
7126            Self::Zendesk => "zendesk",
7127            Self::Hubspot => "hubspot",
7128            Self::Linkedin => "linkedin",
7129            Self::Youtube => "youtube",
7130            Self::Instagram => "instagram",
7131            Self::XTwitter => "x_twitter",
7132            Self::Facebook => "facebook",
7133            Self::Tiktok => "tiktok",
7134            Self::Other(value) => value.as_str(),
7135        }
7136    }
7137}
7138
7139impl std::fmt::Display for GetAdminIntegrationOAuthProviderProvider {
7140    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7141        f.write_str(self.as_str())
7142    }
7143}
7144
7145impl From<&str> for GetAdminIntegrationOAuthProviderProvider {
7146    fn from(value: &str) -> Self {
7147        match value {
7148            "github" => Self::Github,
7149            "google" => Self::Google,
7150            "slack" => Self::Slack,
7151            "notion" => Self::Notion,
7152            "stripe" => Self::Stripe,
7153            "jira" => Self::Jira,
7154            "zendesk" => Self::Zendesk,
7155            "hubspot" => Self::Hubspot,
7156            "linkedin" => Self::Linkedin,
7157            "youtube" => Self::Youtube,
7158            "instagram" => Self::Instagram,
7159            "x_twitter" => Self::XTwitter,
7160            "facebook" => Self::Facebook,
7161            "tiktok" => Self::Tiktok,
7162            other => Self::Other(other.to_string()),
7163        }
7164    }
7165}
7166
7167/// `GetAdminIntegrationOAuthProviderResponse` model.
7168#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7169pub struct GetAdminIntegrationOAuthProviderResponse {
7170    pub provider: String,
7171    pub enabled: bool,
7172    pub configured: bool,
7173    /// Present only when `configured` is true.
7174    #[serde(default, skip_serializing_if = "Option::is_none")]
7175    pub client_id: Option<String>,
7176    /// Last four characters behind dots. Present only when `configured` is true; null when the
7177    /// stored secret is empty.
7178    #[serde(default, skip_serializing_if = "Option::is_none")]
7179    pub client_secret_hint: Option<String>,
7180    /// Override of the default scope list. Present only when `configured` is true; null when no
7181    /// override is stored.
7182    #[serde(default, skip_serializing_if = "Option::is_none")]
7183    pub scopes: Option<Vec<String>>,
7184}
7185
7186/// `GetAdminIntegrationsResponse` model.
7187#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7188pub struct GetAdminIntegrationsResponse {
7189    pub integrations: Vec<GetAdminIntegrationsResponseIntegration>,
7190}
7191
7192/// `GetAdminIntegrationsResponseIntegration` model.
7193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7194pub struct GetAdminIntegrationsResponseIntegration {
7195    pub id: String,
7196    pub name: String,
7197    #[serde(default, skip_serializing_if = "Option::is_none")]
7198    pub icon: Option<String>,
7199    #[serde(default, skip_serializing_if = "Option::is_none")]
7200    pub auth_type: Option<GetAdminIntegrationsResponseIntegrationAuthType>,
7201    #[serde(default, skip_serializing_if = "Option::is_none")]
7202    pub category: Option<String>,
7203    pub enabled: bool,
7204    #[serde(default, skip_serializing_if = "Option::is_none")]
7205    pub beta: Option<bool>,
7206    /// `kv` when an operator overrode the shipped default, `default` otherwise.
7207    #[serde(default, skip_serializing_if = "Option::is_none")]
7208    pub source: Option<String>,
7209}
7210
7211/// `GetAdminIntegrationsResponseIntegrationAuthType` enumeration.
7212#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7213pub enum GetAdminIntegrationsResponseIntegrationAuthType {
7214    #[default]
7215    #[serde(rename = "oauth2")]
7216    Oauth2,
7217    #[serde(rename = "api_key")]
7218    APIKey,
7219    #[serde(rename = "none")]
7220    None,
7221    /// A value the API introduced after this SDK was generated.
7222    #[serde(untagged)]
7223    Other(String),
7224}
7225
7226impl GetAdminIntegrationsResponseIntegrationAuthType {
7227    /// The value as it appears on the wire.
7228    pub fn as_str(&self) -> &str {
7229        match self {
7230            Self::Oauth2 => "oauth2",
7231            Self::APIKey => "api_key",
7232            Self::None => "none",
7233            Self::Other(value) => value.as_str(),
7234        }
7235    }
7236}
7237
7238impl std::fmt::Display for GetAdminIntegrationsResponseIntegrationAuthType {
7239    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7240        f.write_str(self.as_str())
7241    }
7242}
7243
7244impl From<&str> for GetAdminIntegrationsResponseIntegrationAuthType {
7245    fn from(value: &str) -> Self {
7246        match value {
7247            "oauth2" => Self::Oauth2,
7248            "api_key" => Self::APIKey,
7249            "none" => Self::None,
7250            other => Self::Other(other.to_string()),
7251        }
7252    }
7253}
7254
7255/// `GetAdminLLMDefaultsResponse` model.
7256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7257pub struct GetAdminLLMDefaultsResponse {
7258    pub providers: Vec<GetAdminLLMDefaultsResponseProvider>,
7259    #[serde(default, skip_serializing_if = "Option::is_none")]
7260    pub default_provider: Option<String>,
7261    #[serde(default, skip_serializing_if = "Option::is_none")]
7262    pub default_model: Option<String>,
7263    #[serde(default, skip_serializing_if = "Option::is_none")]
7264    pub default_endpoint: Option<String>,
7265    #[serde(default, skip_serializing_if = "Option::is_none")]
7266    pub fallback_provider: Option<String>,
7267    #[serde(default, skip_serializing_if = "Option::is_none")]
7268    pub fallback_model: Option<String>,
7269    #[serde(default, skip_serializing_if = "Option::is_none")]
7270    pub fallback_endpoint: Option<String>,
7271}
7272
7273/// `GetAdminLLMDefaultsResponseProvider` model.
7274#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7275pub struct GetAdminLLMDefaultsResponseProvider {
7276    pub provider_id: String,
7277    /// Always true — the list holds configured providers only.
7278    pub configured: bool,
7279    /// Masked key: first four and last four, or all dots when the key is 10 characters or fewer.
7280    pub key_hint: String,
7281}
7282
7283/// `GetAdminOAuthIdentityConfigResponse` model.
7284#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7285pub struct GetAdminOAuthIdentityConfigResponse {
7286    pub kv: OAuthIdentityConfig,
7287    pub env: OAuthIdentityConfig,
7288    pub effective: OAuthIdentityConfig,
7289}
7290
7291/// `GetAdminPlansResponse` model.
7292#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7293pub struct GetAdminPlansResponse {
7294    pub plans: Vec<GetAdminPlansResponsePlan>,
7295}
7296
7297/// `GetAdminPlansResponsePlan` model.
7298#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7299pub struct GetAdminPlansResponsePlan {
7300    pub id: String,
7301    pub name: String,
7302    /// Per-plan limits (`max_agents`, `max_monthly_tokens`, …).
7303    pub quotas: serde_json::Map<String, serde_json::Value>,
7304}
7305
7306/// `GetAdminRegistrationConfigResponse` model.
7307#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7308pub struct GetAdminRegistrationConfigResponse {
7309    pub registration_open: bool,
7310    /// `free` when nothing is stored.
7311    pub default_signup_plan: String,
7312    /// Empty means no domain restriction.
7313    pub allowed_email_domains: Vec<String>,
7314    pub setup_status: SetupStateResponseStateStatus,
7315    /// Setup steps still outstanding. Non-empty means an attempt to open registration is refused,
7316    /// and this is the list it will name.
7317    pub missing_required: Vec<String>,
7318    /// How many tenants are waitlisted — ALL of them, counted by walking every KV page. It used to
7319    /// be `waitlist.length`, from a single unpaginated read, so past a thousand signups the number
7320    /// froze at exactly 1000 with nothing saying it had been cut (ADM-04). This is the number an
7321    /// admin uses to decide when to open registration, so it is the one that must be complete
7322    /// rather than the roster.
7323    pub waitlist_count: i64,
7324    /// True when `waitlist` holds fewer rows than `waitlist_count`. The roster is a display list
7325    /// and stays bounded at 1000; the count is not.
7326    #[serde(default, skip_serializing_if = "Option::is_none")]
7327    pub waitlist_truncated: Option<bool>,
7328    /// Oldest first. Bounded at 1000 rows — check `waitlist_truncated` rather than taking
7329    /// `waitlist.length` as the total.
7330    pub waitlist: Vec<GetAdminRegistrationConfigResponseWaitlistItem>,
7331}
7332
7333/// `GetAdminRegistrationConfigResponseWaitlistItem` model.
7334#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7335pub struct GetAdminRegistrationConfigResponseWaitlistItem {
7336    pub tenant_id: String,
7337    pub email: String,
7338    pub created_at: String,
7339}
7340
7341/// `GetAdminSmtpConfigResponse` model.
7342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7343pub struct GetAdminSmtpConfigResponse {
7344    /// What is stored. Empty strings and a `port` of 0 mean nothing has been saved for that field.
7345    pub kv: GetAdminSmtpConfigResponseKv,
7346    /// What the environment supplies. `port` defaults to 465 when unset or unparseable.
7347    pub env: GetAdminSmtpConfigResponseEnv,
7348    /// Which layer is in force, decided by the stored HOST alone: a saved host makes it `kv`,
7349    /// otherwise an environment host makes it `env`, otherwise `none`. Note the consequence —
7350    /// saving a user or a password WITHOUT a host leaves `source` at `env` and the stored fields
7351    /// inert.
7352    pub source: GetAdminSmtpConfigResponseSource,
7353}
7354
7355/// What the environment supplies. `port` defaults to 465 when unset or unparseable.
7356#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7357pub struct GetAdminSmtpConfigResponseEnv {
7358    #[serde(default, skip_serializing_if = "Option::is_none")]
7359    pub host: Option<String>,
7360    #[serde(default, skip_serializing_if = "Option::is_none")]
7361    pub port: Option<i64>,
7362    #[serde(default, skip_serializing_if = "Option::is_none")]
7363    pub user: Option<String>,
7364    #[serde(default, skip_serializing_if = "Option::is_none")]
7365    pub from: Option<String>,
7366    #[serde(default, skip_serializing_if = "Option::is_none")]
7367    pub from_name: Option<String>,
7368    /// Whether a credential is stored. The password itself is never returned by any read.
7369    #[serde(default, skip_serializing_if = "Option::is_none")]
7370    pub has_password: Option<bool>,
7371}
7372
7373/// What is stored. Empty strings and a `port` of 0 mean nothing has been saved for that field.
7374#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7375pub struct GetAdminSmtpConfigResponseKv {
7376    #[serde(default, skip_serializing_if = "Option::is_none")]
7377    pub host: Option<String>,
7378    #[serde(default, skip_serializing_if = "Option::is_none")]
7379    pub port: Option<i64>,
7380    #[serde(default, skip_serializing_if = "Option::is_none")]
7381    pub user: Option<String>,
7382    #[serde(default, skip_serializing_if = "Option::is_none")]
7383    pub from: Option<String>,
7384    #[serde(default, skip_serializing_if = "Option::is_none")]
7385    pub from_name: Option<String>,
7386    /// Whether a credential is stored. The password itself is never returned by any read.
7387    #[serde(default, skip_serializing_if = "Option::is_none")]
7388    pub has_password: Option<bool>,
7389}
7390
7391/// Which layer is in force, decided by the stored HOST alone: a saved host makes it `kv`,
7392/// otherwise an environment host makes it `env`, otherwise `none`. Note the consequence —
7393/// saving a user or a password WITHOUT a host leaves `source` at `env` and the stored fields
7394/// inert.
7395#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7396pub enum GetAdminSmtpConfigResponseSource {
7397    #[default]
7398    #[serde(rename = "kv")]
7399    Kv,
7400    #[serde(rename = "env")]
7401    Env,
7402    #[serde(rename = "none")]
7403    None,
7404    /// A value the API introduced after this SDK was generated.
7405    #[serde(untagged)]
7406    Other(String),
7407}
7408
7409impl GetAdminSmtpConfigResponseSource {
7410    /// The value as it appears on the wire.
7411    pub fn as_str(&self) -> &str {
7412        match self {
7413            Self::Kv => "kv",
7414            Self::Env => "env",
7415            Self::None => "none",
7416            Self::Other(value) => value.as_str(),
7417        }
7418    }
7419}
7420
7421impl std::fmt::Display for GetAdminSmtpConfigResponseSource {
7422    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7423        f.write_str(self.as_str())
7424    }
7425}
7426
7427impl From<&str> for GetAdminSmtpConfigResponseSource {
7428    fn from(value: &str) -> Self {
7429        match value {
7430            "kv" => Self::Kv,
7431            "env" => Self::Env,
7432            "none" => Self::None,
7433            other => Self::Other(other.to_string()),
7434        }
7435    }
7436}
7437
7438/// `GetAdminSpecPackagesResponse` model.
7439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7440pub struct GetAdminSpecPackagesResponse {
7441    pub packages: Vec<SpecPackage>,
7442}
7443
7444/// `GetAdminStatsResponse` model.
7445#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7446pub struct GetAdminStatsResponse {
7447    #[serde(default, skip_serializing_if = "Option::is_none")]
7448    pub total_tenants: Option<i64>,
7449    #[serde(default, skip_serializing_if = "Option::is_none")]
7450    pub total_agents: Option<i64>,
7451    #[serde(default, skip_serializing_if = "Option::is_none")]
7452    pub total_runs: Option<i64>,
7453}
7454
7455/// `GetAdminToolOverridesResponse` model.
7456#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7457pub struct GetAdminToolOverridesResponse {
7458    pub ok: bool,
7459    pub overrides: HashMap<String, ToolOverride>,
7460}
7461
7462/// `GetAdminTraceResponse` model.
7463#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7464pub struct GetAdminTraceResponse {
7465    pub trace_id: String,
7466    pub count: i64,
7467    #[serde(default, skip_serializing_if = "Option::is_none")]
7468    pub truncated: Option<bool>,
7469    pub runs: Vec<GetAdminTraceResponseRun>,
7470}
7471
7472/// `GetAdminTraceResponseRun` model.
7473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7474pub struct GetAdminTraceResponseRun {
7475    #[serde(default, skip_serializing_if = "Option::is_none")]
7476    pub run_id: Option<String>,
7477    #[serde(default, skip_serializing_if = "Option::is_none")]
7478    pub agent_id: Option<String>,
7479    #[serde(default, skip_serializing_if = "Option::is_none")]
7480    pub status: Option<String>,
7481    #[serde(default, skip_serializing_if = "Option::is_none")]
7482    pub parent_run_id: Option<String>,
7483    #[serde(default, skip_serializing_if = "Option::is_none")]
7484    pub dag_trace_id: Option<String>,
7485    #[serde(default, skip_serializing_if = "Option::is_none")]
7486    pub created_at: Option<String>,
7487    #[serde(default, skip_serializing_if = "Option::is_none")]
7488    pub completed_at: Option<String>,
7489    #[serde(default, skip_serializing_if = "Option::is_none")]
7490    pub duration_ms: Option<i64>,
7491    #[serde(default, skip_serializing_if = "Option::is_none")]
7492    pub error: Option<String>,
7493}
7494
7495/// `GetAgentActivityStatsResponse` model.
7496#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7497pub struct GetAgentActivityStatsResponse {
7498    #[serde(rename = "totalRuns", default, skip_serializing_if = "Option::is_none")]
7499    pub total_runs: Option<i64>,
7500    #[serde(rename = "completedRuns", default, skip_serializing_if = "Option::is_none")]
7501    pub completed_runs: Option<i64>,
7502    #[serde(rename = "failedRuns", default, skip_serializing_if = "Option::is_none")]
7503    pub failed_runs: Option<i64>,
7504    #[serde(rename = "cancelledRuns", default, skip_serializing_if = "Option::is_none")]
7505    pub cancelled_runs: Option<i64>,
7506    #[serde(rename = "guardrailBlockedRuns", default, skip_serializing_if = "Option::is_none")]
7507    pub guardrail_blocked_runs: Option<i64>,
7508    #[serde(rename = "errorRatePercent", default, skip_serializing_if = "Option::is_none")]
7509    pub error_rate_percent: Option<f64>,
7510    #[serde(rename = "avgStepsPerRun", default, skip_serializing_if = "Option::is_none")]
7511    pub avg_steps_per_run: Option<f64>,
7512    #[serde(rename = "avgDurationMs", default, skip_serializing_if = "Option::is_none")]
7513    pub avg_duration_ms: Option<f64>,
7514    #[serde(rename = "avgInputTokens", default, skip_serializing_if = "Option::is_none")]
7515    pub avg_input_tokens: Option<f64>,
7516    #[serde(rename = "avgOutputTokens", default, skip_serializing_if = "Option::is_none")]
7517    pub avg_output_tokens: Option<f64>,
7518    #[serde(rename = "avgThinkingTokens", default, skip_serializing_if = "Option::is_none")]
7519    pub avg_thinking_tokens: Option<f64>,
7520    #[serde(rename = "toolBreakdown", default, skip_serializing_if = "Option::is_none")]
7521    pub tool_breakdown: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7522    #[serde(rename = "topErrorMessages", default, skip_serializing_if = "Option::is_none")]
7523    pub top_error_messages: Option<Vec<GetAgentActivityStatsResponseTopErrorMessage>>,
7524    #[serde(rename = "runsByDay", default, skip_serializing_if = "Option::is_none")]
7525    pub runs_by_day: Option<Vec<GetAgentActivityStatsResponseRunsByDayItem>>,
7526}
7527
7528/// `GetAgentActivityStatsResponseRunsByDayItem` model.
7529#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7530pub struct GetAgentActivityStatsResponseRunsByDayItem {
7531    #[serde(default, skip_serializing_if = "Option::is_none")]
7532    pub day: Option<String>,
7533    #[serde(default, skip_serializing_if = "Option::is_none")]
7534    pub total: Option<i64>,
7535    #[serde(default, skip_serializing_if = "Option::is_none")]
7536    pub completed: Option<i64>,
7537    #[serde(default, skip_serializing_if = "Option::is_none")]
7538    pub failed: Option<i64>,
7539}
7540
7541/// `GetAgentActivityStatsResponseTopErrorMessage` model.
7542#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7543pub struct GetAgentActivityStatsResponseTopErrorMessage {
7544    #[serde(default, skip_serializing_if = "Option::is_none")]
7545    pub message: Option<String>,
7546    #[serde(default, skip_serializing_if = "Option::is_none")]
7547    pub count: Option<i64>,
7548}
7549
7550/// `GetAgentIdentityResponse` model.
7551#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7552pub struct GetAgentIdentityResponse {
7553    #[serde(default, skip_serializing_if = "Option::is_none")]
7554    pub public_key: Option<String>,
7555    #[serde(default, skip_serializing_if = "Option::is_none")]
7556    pub created_at: Option<String>,
7557}
7558
7559/// `GetAgentObligationsResponse` model.
7560#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7561pub struct GetAgentObligationsResponse {
7562    #[serde(default, skip_serializing_if = "Option::is_none")]
7563    pub agent_id: Option<String>,
7564    #[serde(default, skip_serializing_if = "Option::is_none")]
7565    pub rules: Option<Vec<ConstitutionRule>>,
7566    #[serde(default, skip_serializing_if = "Option::is_none")]
7567    pub count: Option<i64>,
7568}
7569
7570/// `GetAgentSystemCardFormat` enumeration.
7571#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7572pub enum GetAgentSystemCardFormat {
7573    #[default]
7574    #[serde(rename = "json")]
7575    JSON,
7576    #[serde(rename = "markdown")]
7577    Markdown,
7578    /// A value the API introduced after this SDK was generated.
7579    #[serde(untagged)]
7580    Other(String),
7581}
7582
7583impl GetAgentSystemCardFormat {
7584    /// The value as it appears on the wire.
7585    pub fn as_str(&self) -> &str {
7586        match self {
7587            Self::JSON => "json",
7588            Self::Markdown => "markdown",
7589            Self::Other(value) => value.as_str(),
7590        }
7591    }
7592}
7593
7594impl std::fmt::Display for GetAgentSystemCardFormat {
7595    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7596        f.write_str(self.as_str())
7597    }
7598}
7599
7600impl From<&str> for GetAgentSystemCardFormat {
7601    fn from(value: &str) -> Self {
7602        match value {
7603            "json" => Self::JSON,
7604            "markdown" => Self::Markdown,
7605            other => Self::Other(other.to_string()),
7606        }
7607    }
7608}
7609
7610/// `GetAgentTrafficResponse` model.
7611#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7612pub struct GetAgentTrafficResponse {
7613    #[serde(default, skip_serializing_if = "Option::is_none")]
7614    pub agent_id: Option<String>,
7615    #[serde(default, skip_serializing_if = "Option::is_none")]
7616    pub entries: Option<Vec<GetAgentTrafficResponseEntry>>,
7617    #[serde(default, skip_serializing_if = "Option::is_none")]
7618    pub updated_at: Option<String>,
7619}
7620
7621/// `GetAgentTrafficResponseEntry` model.
7622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7623pub struct GetAgentTrafficResponseEntry {
7624    #[serde(default, skip_serializing_if = "Option::is_none")]
7625    pub version: Option<i64>,
7626    #[serde(default, skip_serializing_if = "Option::is_none")]
7627    pub weight: Option<f64>,
7628}
7629
7630/// `GetAgentVersionDiffResponse` model.
7631#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7632pub struct GetAgentVersionDiffResponse {
7633    #[serde(default, skip_serializing_if = "Option::is_none")]
7634    pub agent_id: Option<String>,
7635    #[serde(default, skip_serializing_if = "Option::is_none")]
7636    pub version_from: Option<i64>,
7637    #[serde(default, skip_serializing_if = "Option::is_none")]
7638    pub version_to: Option<i64>,
7639    #[serde(default, skip_serializing_if = "Option::is_none")]
7640    pub diff: Option<HashMap<String, Value4>>,
7641    #[serde(default, skip_serializing_if = "Option::is_none")]
7642    pub changed_fields: Option<Vec<String>>,
7643}
7644
7645/// `GetAgentViolationsResponse` model.
7646#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7647pub struct GetAgentViolationsResponse {
7648    #[serde(default, skip_serializing_if = "Option::is_none")]
7649    pub agent_id: Option<String>,
7650    #[serde(default, skip_serializing_if = "Option::is_none")]
7651    pub violations: Option<Vec<ConstitutionViolation>>,
7652    #[serde(default, skip_serializing_if = "Option::is_none")]
7653    pub count: Option<i64>,
7654}
7655
7656/// `GetAndroidTestingStatusResponse` model.
7657#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7658pub struct GetAndroidTestingStatusResponse {
7659    pub registered: bool,
7660    pub emailed: bool,
7661}
7662
7663/// `GetAppleAppSiteAssociationResponse` model.
7664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7665pub struct GetAppleAppSiteAssociationResponse {
7666    pub applinks: GetAppleAppSiteAssociationResponseApplinks,
7667    #[serde(default, skip_serializing_if = "Option::is_none")]
7668    pub webcredentials: Option<GetAppleAppSiteAssociationResponseWebcredentials>,
7669}
7670
7671/// `GetAppleAppSiteAssociationResponseApplinks` model.
7672#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7673pub struct GetAppleAppSiteAssociationResponseApplinks {
7674    #[serde(default, skip_serializing_if = "Option::is_none")]
7675    pub apps: Option<Vec<String>>,
7676    #[serde(default, skip_serializing_if = "Option::is_none")]
7677    pub details: Option<Vec<GetAppleAppSiteAssociationResponseApplinksDetail>>,
7678}
7679
7680/// `GetAppleAppSiteAssociationResponseApplinksDetail` model.
7681#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7682pub struct GetAppleAppSiteAssociationResponseApplinksDetail {
7683    #[serde(rename = "appIDs", default, skip_serializing_if = "Option::is_none")]
7684    pub app_i_ds: Option<Vec<String>>,
7685    #[serde(default, skip_serializing_if = "Option::is_none")]
7686    pub components: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7687}
7688
7689/// `GetAppleAppSiteAssociationResponseWebcredentials` model.
7690#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7691pub struct GetAppleAppSiteAssociationResponseWebcredentials {
7692    #[serde(default, skip_serializing_if = "Option::is_none")]
7693    pub apps: Option<Vec<String>>,
7694}
7695
7696/// `GetBillingTrialResponse` model.
7697#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7698pub struct GetBillingTrialResponse {
7699    #[serde(default, skip_serializing_if = "Option::is_none")]
7700    pub active: Option<bool>,
7701    #[serde(default, skip_serializing_if = "Option::is_none")]
7702    pub ends_at: Option<String>,
7703    #[serde(default, skip_serializing_if = "Option::is_none")]
7704    pub days_left: Option<i64>,
7705    #[serde(default, skip_serializing_if = "Option::is_none")]
7706    pub recommended_plan: Option<String>,
7707    #[serde(default, skip_serializing_if = "Option::is_none")]
7708    pub signals: Option<serde_json::Map<String, serde_json::Value>>,
7709}
7710
7711/// `GetBridgeTaskApprovalResponse` model.
7712#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7713pub struct GetBridgeTaskApprovalResponse {
7714    #[serde(default, skip_serializing_if = "Option::is_none")]
7715    pub approval_response: Option<serde_json::Map<String, serde_json::Value>>,
7716}
7717
7718/// `GetClientConfigResponse` model.
7719#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7720pub struct GetClientConfigResponse {
7721    #[serde(default, skip_serializing_if = "Option::is_none")]
7722    pub features: Option<serde_json::Map<String, serde_json::Value>>,
7723    #[serde(default, skip_serializing_if = "Option::is_none")]
7724    pub providers: Option<serde_json::Map<String, serde_json::Value>>,
7725}
7726
7727/// `GetCompanyActivityResponse` model.
7728#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7729pub struct GetCompanyActivityResponse {
7730    #[serde(default, skip_serializing_if = "Option::is_none")]
7731    pub activity: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7732}
7733
7734/// `GetCompanyBudgetResponse` model.
7735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7736pub struct GetCompanyBudgetResponse {
7737    #[serde(default, skip_serializing_if = "Option::is_none")]
7738    pub total_usd: Option<f64>,
7739    #[serde(default, skip_serializing_if = "Option::is_none")]
7740    pub spent_usd: Option<f64>,
7741    #[serde(default, skip_serializing_if = "Option::is_none")]
7742    pub daily_limit_usd: Option<f64>,
7743    #[serde(default, skip_serializing_if = "Option::is_none")]
7744    pub alert_threshold_pct: Option<f64>,
7745    #[serde(default, skip_serializing_if = "Option::is_none")]
7746    pub remaining_usd: Option<f64>,
7747}
7748
7749/// `GetCompanyObjectivesResponse` model.
7750#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7751pub struct GetCompanyObjectivesResponse {
7752    #[serde(default, skip_serializing_if = "Option::is_none")]
7753    pub trees: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7754    #[serde(default, skip_serializing_if = "Option::is_none")]
7755    pub objectives: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7756}
7757
7758/// `GetDataExplorerValueResponse` model.
7759#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7760pub struct GetDataExplorerValueResponse {
7761    #[serde(default, skip_serializing_if = "Option::is_none")]
7762    pub namespace: Option<String>,
7763    #[serde(default, skip_serializing_if = "Option::is_none")]
7764    pub key: Option<String>,
7765    #[serde(default, skip_serializing_if = "Option::is_none")]
7766    pub value: Option<serde_json::Value>,
7767    #[serde(default, skip_serializing_if = "Option::is_none")]
7768    pub size_bytes: Option<i64>,
7769    #[serde(default, skip_serializing_if = "Option::is_none")]
7770    pub r#type: Option<String>,
7771}
7772
7773/// `GetFeatureFlagsResponse` model.
7774#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7775pub struct GetFeatureFlagsResponse {
7776    #[serde(default, skip_serializing_if = "Option::is_none")]
7777    pub flags: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7778}
7779
7780/// `GetGovernanceLedgerResponse` model.
7781#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7782pub struct GetGovernanceLedgerResponse {
7783    pub entries: Vec<GovernanceLedgerEntry>,
7784    pub head: GovernanceLedgerHead,
7785    /// Number of entries IN THIS RESPONSE, not the size of the ledger. Measured 2026-08-20: `total`
7786    /// was 16 while `GET /governance/ledger/verify` reported `entries_checked: 6698` against the
7787    /// same ledger a second later. Rendering this as "events recorded" understates the ledger by
7788    /// three orders of magnitude. For the size, read `tenant_total`.
7789    pub total: i64,
7790    /// How many entries in the whole ledger belong to the calling tenant — the number to render as
7791    /// "ledger entries". Independent of `count`/`from`/`to`. Not `entries_checked` from
7792    /// `/governance/ledger/verify` (that walks every tenant) and not `head.seq` (global sequence).
7793    pub tenant_total: i64,
7794}
7795
7796/// `GetHealthResponse` model.
7797#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7798pub struct GetHealthResponse {
7799    #[serde(default, skip_serializing_if = "Option::is_none")]
7800    pub status: Option<GetHealthResponseStatus>,
7801    #[serde(default, skip_serializing_if = "Option::is_none")]
7802    pub timestamp: Option<String>,
7803    #[serde(default, skip_serializing_if = "Option::is_none")]
7804    pub kv_connected: Option<bool>,
7805    #[serde(default, skip_serializing_if = "Option::is_none")]
7806    pub uptime_seconds: Option<f64>,
7807    /// The API contract version, a DATE STAMP — `2026-09-10` — bumped only on a breaking change,
7808    /// and the same value the `X-API-Version` RESPONSE header carries. The server does not read a
7809    /// request header of that name: pinning a date negotiates nothing. Not a release number and not
7810    /// semver: it cannot be ordered against a semver string, so a client that compares it to one is
7811    /// wrong in a way that appears to work for as long as both happen to sort the same. Compare it
7812    /// for equality, or read it as a date. It says nothing about which BUILD is running — for that,
7813    /// read `build_sha`.
7814    #[serde(default, skip_serializing_if = "Option::is_none")]
7815    pub version: Option<String>,
7816    /// The commit this running build was made from, baked in at image build time. This is the only
7817    /// value on the wire that identifies the deployed code: `version` is the contract stamp and is
7818    /// constant across deploys, and a restart proves a restart rather than an identity. `"unknown"`
7819    /// means the image was built without the build argument (a local build, or a deploy predating
7820    /// this field) and must be read as UNKNOWN, never as a match. Documentation that pins a claim
7821    /// about platform behaviour can cite it.
7822    #[serde(default, skip_serializing_if = "Option::is_none")]
7823    pub build_sha: Option<String>,
7824    /// Always 0. Kept for compatibility — there is no resume-parking state: `RunStatus` has no
7825    /// `waiting_for_resume`, and startup reconciliation FAILS an interrupted run rather than
7826    /// holding it for resume. It previously reported the queue depth under this name, which reads
7827    /// as recovery progress on the one endpoint an operator watches during a deploy. Use
7828    /// `runs_queued` for the queue, and run status for recovery.
7829    #[serde(default, skip_serializing_if = "Option::is_none")]
7830    pub pending_resumes: Option<i64>,
7831    /// Runs currently queued. After a restart this includes runs reconciliation re-queued, so it
7832    /// falls as they are picked up — but it is a queue depth, not a count of recoveries.
7833    #[serde(default, skip_serializing_if = "Option::is_none")]
7834    pub runs_queued: Option<i64>,
7835}
7836
7837/// `GetHealthResponseStatus` enumeration.
7838#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7839pub enum GetHealthResponseStatus {
7840    #[default]
7841    #[serde(rename = "healthy")]
7842    Healthy,
7843    #[serde(rename = "degraded")]
7844    Degraded,
7845    #[serde(rename = "unhealthy")]
7846    Unhealthy,
7847    /// A value the API introduced after this SDK was generated.
7848    #[serde(untagged)]
7849    Other(String),
7850}
7851
7852impl GetHealthResponseStatus {
7853    /// The value as it appears on the wire.
7854    pub fn as_str(&self) -> &str {
7855        match self {
7856            Self::Healthy => "healthy",
7857            Self::Degraded => "degraded",
7858            Self::Unhealthy => "unhealthy",
7859            Self::Other(value) => value.as_str(),
7860        }
7861    }
7862}
7863
7864impl std::fmt::Display for GetHealthResponseStatus {
7865    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7866        f.write_str(self.as_str())
7867    }
7868}
7869
7870impl From<&str> for GetHealthResponseStatus {
7871    fn from(value: &str) -> Self {
7872        match value {
7873            "healthy" => Self::Healthy,
7874            "degraded" => Self::Degraded,
7875            "unhealthy" => Self::Unhealthy,
7876            other => Self::Other(other.to_string()),
7877        }
7878    }
7879}
7880
7881/// `GetImmutableAuditResponse` model.
7882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7883pub struct GetImmutableAuditResponse {
7884    pub events: Vec<serde_json::Map<String, serde_json::Value>>,
7885    pub total: i64,
7886}
7887
7888/// `GetLinkPreviewResponse` model.
7889#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7890pub struct GetLinkPreviewResponse {
7891    pub preview: LinkPreview,
7892}
7893
7894/// `GetListingReviewsResponse` model.
7895#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7896pub struct GetListingReviewsResponse {
7897    #[serde(default, skip_serializing_if = "Option::is_none")]
7898    pub reviews: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
7899    #[serde(default, skip_serializing_if = "Option::is_none")]
7900    pub total: Option<i64>,
7901    #[serde(default, skip_serializing_if = "Option::is_none")]
7902    pub cursor: Option<String>,
7903}
7904
7905/// `GetMarketplaceCategoriesResponse` model.
7906#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7907pub struct GetMarketplaceCategoriesResponse {
7908    pub categories: Vec<String>,
7909}
7910
7911/// `GetMarkupConfigResponse` model.
7912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7913pub struct GetMarkupConfigResponse {
7914    #[serde(default, skip_serializing_if = "Option::is_none")]
7915    pub markup: Option<serde_json::Map<String, serde_json::Value>>,
7916}
7917
7918/// `GetMediaUsageResponse` model.
7919#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7920pub struct GetMediaUsageResponse {
7921    #[serde(default, skip_serializing_if = "Option::is_none")]
7922    pub plan: Option<String>,
7923    #[serde(default, skip_serializing_if = "Option::is_none")]
7924    pub images: Option<GetMediaUsageResponseImages>,
7925    #[serde(default, skip_serializing_if = "Option::is_none")]
7926    pub videos: Option<GetMediaUsageResponseVideos>,
7927}
7928
7929/// `GetMediaUsageResponseImages` model.
7930#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7931pub struct GetMediaUsageResponseImages {
7932    #[serde(default, skip_serializing_if = "Option::is_none")]
7933    pub monthly_used: Option<i64>,
7934    #[serde(default, skip_serializing_if = "Option::is_none")]
7935    pub daily_used: Option<i64>,
7936    #[serde(default, skip_serializing_if = "Option::is_none")]
7937    pub monthly_limit: Option<i64>,
7938    #[serde(default, skip_serializing_if = "Option::is_none")]
7939    pub daily_limit: Option<i64>,
7940}
7941
7942/// `GetMediaUsageResponseVideos` model.
7943#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7944pub struct GetMediaUsageResponseVideos {
7945    #[serde(default, skip_serializing_if = "Option::is_none")]
7946    pub monthly_used: Option<i64>,
7947    #[serde(default, skip_serializing_if = "Option::is_none")]
7948    pub monthly_limit: Option<i64>,
7949}
7950
7951/// `GetMemoriesByEntityResponse` model.
7952#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7953pub struct GetMemoriesByEntityResponse {
7954    #[serde(default, skip_serializing_if = "Option::is_none")]
7955    pub items: Option<Vec<MemoryEntry>>,
7956}
7957
7958/// `GetMeResponse` model.
7959#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7960pub struct GetMeResponse {
7961    #[serde(default, skip_serializing_if = "Option::is_none")]
7962    pub user: Option<GetMeResponseUser>,
7963    pub tenant: GetMeResponseTenant,
7964    pub role: String,
7965    pub scopes: Vec<String>,
7966    pub auth_method: GetMeResponseAuthMethod,
7967    pub memberships: Vec<GetMeResponseMembership>,
7968}
7969
7970/// `GetMeResponseAuthMethod` enumeration.
7971#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7972pub enum GetMeResponseAuthMethod {
7973    #[default]
7974    #[serde(rename = "api_key")]
7975    APIKey,
7976    #[serde(rename = "cookie")]
7977    Cookie,
7978    #[serde(rename = "jwt")]
7979    JWT,
7980    /// A value the API introduced after this SDK was generated.
7981    #[serde(untagged)]
7982    Other(String),
7983}
7984
7985impl GetMeResponseAuthMethod {
7986    /// The value as it appears on the wire.
7987    pub fn as_str(&self) -> &str {
7988        match self {
7989            Self::APIKey => "api_key",
7990            Self::Cookie => "cookie",
7991            Self::JWT => "jwt",
7992            Self::Other(value) => value.as_str(),
7993        }
7994    }
7995}
7996
7997impl std::fmt::Display for GetMeResponseAuthMethod {
7998    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7999        f.write_str(self.as_str())
8000    }
8001}
8002
8003impl From<&str> for GetMeResponseAuthMethod {
8004    fn from(value: &str) -> Self {
8005        match value {
8006            "api_key" => Self::APIKey,
8007            "cookie" => Self::Cookie,
8008            "jwt" => Self::JWT,
8009            other => Self::Other(other.to_string()),
8010        }
8011    }
8012}
8013
8014/// `GetMeResponseMembership` model.
8015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8016pub struct GetMeResponseMembership {
8017    #[serde(default, skip_serializing_if = "Option::is_none")]
8018    pub tenant_id: Option<String>,
8019    #[serde(default, skip_serializing_if = "Option::is_none")]
8020    pub user_id: Option<String>,
8021}
8022
8023/// `GetMeResponseTenant` model.
8024#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8025pub struct GetMeResponseTenant {
8026    pub tenant_id: String,
8027    pub name: String,
8028    pub slug: String,
8029    pub plan: String,
8030}
8031
8032/// `GetMeResponseUser` model.
8033#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8034pub struct GetMeResponseUser {
8035    #[serde(default, skip_serializing_if = "Option::is_none")]
8036    pub user_id: Option<String>,
8037    #[serde(default, skip_serializing_if = "Option::is_none")]
8038    pub email: Option<String>,
8039    #[serde(default, skip_serializing_if = "Option::is_none")]
8040    pub name: Option<String>,
8041    #[serde(default, skip_serializing_if = "Option::is_none")]
8042    pub role: Option<String>,
8043    #[serde(default, skip_serializing_if = "Option::is_none")]
8044    pub status: Option<String>,
8045    #[serde(default, skip_serializing_if = "Option::is_none")]
8046    pub avatar_url: Option<String>,
8047    #[serde(default, skip_serializing_if = "Option::is_none")]
8048    pub last_login_at: Option<String>,
8049    #[serde(default, skip_serializing_if = "Option::is_none")]
8050    pub created_at: Option<String>,
8051}
8052
8053/// `GetMfaStatusResponse` model.
8054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8055pub struct GetMfaStatusResponse {
8056    pub enrolled: bool,
8057    pub recovery_remaining: i64,
8058}
8059
8060/// `GetMyHeadAgentTemplateResponse` model.
8061#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8062pub struct GetMyHeadAgentTemplateResponse {
8063    pub plan: String,
8064    pub recommended: GetMyHeadAgentTemplateResponseRecommended,
8065    pub tiers: Vec<GetMyHeadAgentTemplateResponseTier>,
8066}
8067
8068/// `GetMyHeadAgentTemplateResponseRecommended` enumeration.
8069#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8070pub enum GetMyHeadAgentTemplateResponseRecommended {
8071    #[default]
8072    #[serde(rename = "basic")]
8073    Basic,
8074    #[serde(rename = "standard")]
8075    Standard,
8076    #[serde(rename = "full")]
8077    Full,
8078    /// A value the API introduced after this SDK was generated.
8079    #[serde(untagged)]
8080    Other(String),
8081}
8082
8083impl GetMyHeadAgentTemplateResponseRecommended {
8084    /// The value as it appears on the wire.
8085    pub fn as_str(&self) -> &str {
8086        match self {
8087            Self::Basic => "basic",
8088            Self::Standard => "standard",
8089            Self::Full => "full",
8090            Self::Other(value) => value.as_str(),
8091        }
8092    }
8093}
8094
8095impl std::fmt::Display for GetMyHeadAgentTemplateResponseRecommended {
8096    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8097        f.write_str(self.as_str())
8098    }
8099}
8100
8101impl From<&str> for GetMyHeadAgentTemplateResponseRecommended {
8102    fn from(value: &str) -> Self {
8103        match value {
8104            "basic" => Self::Basic,
8105            "standard" => Self::Standard,
8106            "full" => Self::Full,
8107            other => Self::Other(other.to_string()),
8108        }
8109    }
8110}
8111
8112/// `GetMyHeadAgentTemplateResponseTier` model.
8113#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8114pub struct GetMyHeadAgentTemplateResponseTier {
8115    #[serde(default, skip_serializing_if = "Option::is_none")]
8116    pub tier: Option<GetMyHeadAgentTemplateResponseTierTier>,
8117    #[serde(default, skip_serializing_if = "Option::is_none")]
8118    pub available: Option<bool>,
8119    #[serde(default, skip_serializing_if = "Option::is_none")]
8120    pub install_specs: Option<Vec<GetMyHeadAgentTemplateResponseTierInstallSpec>>,
8121    #[serde(default, skip_serializing_if = "Option::is_none")]
8122    pub auto_approve_tools: Option<Vec<String>>,
8123    #[serde(default, skip_serializing_if = "Option::is_none")]
8124    pub total_tool_count: Option<i64>,
8125}
8126
8127/// `GetMyHeadAgentTemplateResponseTierInstallSpec` model.
8128#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8129pub struct GetMyHeadAgentTemplateResponseTierInstallSpec {
8130    pub spec_id: String,
8131}
8132
8133/// `GetMyHeadAgentTemplateResponseTierTier` model.
8134#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8135pub struct GetMyHeadAgentTemplateResponseTierTier {
8136    #[serde(default, skip_serializing_if = "Option::is_none")]
8137    pub id: Option<GetMyHeadAgentTemplateResponseRecommended>,
8138    #[serde(default, skip_serializing_if = "Option::is_none")]
8139    pub name: Option<String>,
8140    #[serde(default, skip_serializing_if = "Option::is_none")]
8141    pub description: Option<String>,
8142    #[serde(default, skip_serializing_if = "Option::is_none")]
8143    pub required_plan: Option<GetMyHeadAgentTemplateResponseTierTierRequiredPlan>,
8144    #[serde(default, skip_serializing_if = "Option::is_none")]
8145    pub spec_ids: Option<Vec<String>>,
8146}
8147
8148/// `GetMyHeadAgentTemplateResponseTierTierRequiredPlan` enumeration.
8149#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8150pub enum GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
8151    #[default]
8152    #[serde(rename = "free")]
8153    Free,
8154    #[serde(rename = "starter")]
8155    Starter,
8156    #[serde(rename = "pro")]
8157    Pro,
8158    /// A value the API introduced after this SDK was generated.
8159    #[serde(untagged)]
8160    Other(String),
8161}
8162
8163impl GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
8164    /// The value as it appears on the wire.
8165    pub fn as_str(&self) -> &str {
8166        match self {
8167            Self::Free => "free",
8168            Self::Starter => "starter",
8169            Self::Pro => "pro",
8170            Self::Other(value) => value.as_str(),
8171        }
8172    }
8173}
8174
8175impl std::fmt::Display for GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
8176    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8177        f.write_str(self.as_str())
8178    }
8179}
8180
8181impl From<&str> for GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
8182    fn from(value: &str) -> Self {
8183        match value {
8184            "free" => Self::Free,
8185            "starter" => Self::Starter,
8186            "pro" => Self::Pro,
8187            other => Self::Other(other.to_string()),
8188        }
8189    }
8190}
8191
8192/// `GetPlatformURLSResponse` model.
8193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8194pub struct GetPlatformURLSResponse {
8195    #[serde(default, skip_serializing_if = "Option::is_none")]
8196    pub urls: Option<GetPlatformURLSResponseURLS>,
8197}
8198
8199/// `GetPlatformURLSResponseURLS` model.
8200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8201pub struct GetPlatformURLSResponseURLS {
8202    #[serde(default, skip_serializing_if = "Option::is_none")]
8203    pub public_base_url: Option<String>,
8204    #[serde(default, skip_serializing_if = "Option::is_none")]
8205    pub webhook_base_url: Option<String>,
8206}
8207
8208/// `GetPublicBlogPostResponse` model.
8209#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8210pub struct GetPublicBlogPostResponse {
8211    pub post: PublicBlogPost,
8212}
8213
8214/// `GetPublicFeaturedAgentResponse` model.
8215#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8216pub struct GetPublicFeaturedAgentResponse {
8217    #[serde(default, skip_serializing_if = "Option::is_none")]
8218    pub agent: Option<serde_json::Map<String, serde_json::Value>>,
8219}
8220
8221/// `GetRateLimitsResponse` model.
8222#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8223pub struct GetRateLimitsResponse {
8224    #[serde(default, skip_serializing_if = "Option::is_none")]
8225    pub endpoints: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
8226}
8227
8228/// `GetReadyResponse` model.
8229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8230pub struct GetReadyResponse {
8231    #[serde(default, skip_serializing_if = "Option::is_none")]
8232    pub status: Option<GetReadyResponseStatus>,
8233    #[serde(default, skip_serializing_if = "Option::is_none")]
8234    pub timestamp: Option<String>,
8235    #[serde(default, skip_serializing_if = "Option::is_none")]
8236    pub checks: Option<GetReadyResponseChecks>,
8237}
8238
8239/// `GetReadyResponseChecks` model.
8240#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8241pub struct GetReadyResponseChecks {
8242    #[serde(default, skip_serializing_if = "Option::is_none")]
8243    pub kv: Option<String>,
8244}
8245
8246/// `GetReadyResponseStatus` enumeration.
8247#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8248pub enum GetReadyResponseStatus {
8249    #[default]
8250    #[serde(rename = "ready")]
8251    Ready,
8252    #[serde(rename = "not_ready")]
8253    NotReady,
8254    /// A value the API introduced after this SDK was generated.
8255    #[serde(untagged)]
8256    Other(String),
8257}
8258
8259impl GetReadyResponseStatus {
8260    /// The value as it appears on the wire.
8261    pub fn as_str(&self) -> &str {
8262        match self {
8263            Self::Ready => "ready",
8264            Self::NotReady => "not_ready",
8265            Self::Other(value) => value.as_str(),
8266        }
8267    }
8268}
8269
8270impl std::fmt::Display for GetReadyResponseStatus {
8271    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8272        f.write_str(self.as_str())
8273    }
8274}
8275
8276impl From<&str> for GetReadyResponseStatus {
8277    fn from(value: &str) -> Self {
8278        match value {
8279            "ready" => Self::Ready,
8280            "not_ready" => Self::NotReady,
8281            other => Self::Other(other.to_string()),
8282        }
8283    }
8284}
8285
8286/// `GetRegistrationStatusResponse` model.
8287#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8288pub struct GetRegistrationStatusResponse {
8289    pub registration_open: bool,
8290}
8291
8292/// `GetRootAgentResponse` model.
8293#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8294pub struct GetRootAgentResponse {
8295    /// Designated root agent, or null when none is set.
8296    #[serde(default)]
8297    pub root_agent_id: Option<String>,
8298}
8299
8300/// `GetRunAuditLogResponse` model.
8301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8302pub struct GetRunAuditLogResponse {
8303    pub run_id: String,
8304    pub audit_log: Vec<AuditLogEntry>,
8305    pub total: i64,
8306}
8307
8308/// `GetRunChangedFiles` enumeration.
8309#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8310pub enum GetRunChangedFiles {
8311    #[default]
8312    #[serde(rename = "true")]
8313    True,
8314    /// A value the API introduced after this SDK was generated.
8315    #[serde(untagged)]
8316    Other(String),
8317}
8318
8319impl GetRunChangedFiles {
8320    /// The value as it appears on the wire.
8321    pub fn as_str(&self) -> &str {
8322        match self {
8323            Self::True => "true",
8324            Self::Other(value) => value.as_str(),
8325        }
8326    }
8327}
8328
8329impl std::fmt::Display for GetRunChangedFiles {
8330    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8331        f.write_str(self.as_str())
8332    }
8333}
8334
8335impl From<&str> for GetRunChangedFiles {
8336    fn from(value: &str) -> Self {
8337        match value {
8338            "true" => Self::True,
8339            other => Self::Other(other.to_string()),
8340        }
8341    }
8342}
8343
8344/// `GetRunQueuePositionResponse` model.
8345#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8346pub struct GetRunQueuePositionResponse {
8347    #[serde(default, skip_serializing_if = "Option::is_none")]
8348    pub run_id: Option<String>,
8349    /// 0 means not in queue or currently running
8350    #[serde(default, skip_serializing_if = "Option::is_none")]
8351    pub queue_position: Option<i64>,
8352}
8353
8354/// `GetRunResponse` model.
8355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8356pub struct GetRunResponse {
8357    pub run_id: String,
8358    pub tenant_id: String,
8359    pub agent_id: String,
8360    #[serde(default, skip_serializing_if = "Option::is_none")]
8361    pub session_id: Option<String>,
8362    pub status: RunStatus,
8363    #[serde(default, skip_serializing_if = "Option::is_none")]
8364    pub input: Option<serde_json::Map<String, serde_json::Value>>,
8365    /// Run output. When a run is truncated by its step-budget cutoff (output.truncated === true)
8366    /// AND the platform has UARP_CONTINUATION_TOKEN_KEY configured, output.continuation_token
8367    /// carries an opaque HMAC-signed token that resumes the run via POST /runs/{id}/continue. With
8368    /// no key configured no token is minted and the field is absent; the token is an opaque string
8369    /// to every client.
8370    #[serde(default, skip_serializing_if = "Option::is_none")]
8371    pub output: Option<serde_json::Map<String, serde_json::Value>>,
8372    #[serde(default, skip_serializing_if = "Option::is_none")]
8373    pub metrics: Option<RunMetrics>,
8374    #[serde(default, skip_serializing_if = "Option::is_none")]
8375    pub error: Option<String>,
8376    pub created_at: String,
8377    #[serde(default, skip_serializing_if = "Option::is_none")]
8378    pub started_at: Option<String>,
8379    #[serde(default, skip_serializing_if = "Option::is_none")]
8380    pub completed_at: Option<String>,
8381    /// Team run ID if part of a team execution
8382    #[serde(default, skip_serializing_if = "Option::is_none")]
8383    pub team_run_id: Option<String>,
8384    /// User-supplied metadata
8385    #[serde(default, skip_serializing_if = "Option::is_none")]
8386    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
8387    /// Current step sequence number
8388    #[serde(default, skip_serializing_if = "Option::is_none")]
8389    pub step_seq: Option<i64>,
8390    /// Run artifacts
8391    #[serde(default, skip_serializing_if = "Option::is_none")]
8392    pub artifacts: Option<Vec<Artifact>>,
8393    /// Resource limits for the run
8394    #[serde(default, skip_serializing_if = "Option::is_none")]
8395    pub resource_limits: Option<GetRunResponseResourceLimits>,
8396    /// Workspace paths this run WROTE, sorted, present only when the request carries
8397    /// `?changed_files=true`. Recorded per (run, path) at write time, so a file rewritten three
8398    /// times appears once and two concurrent tool calls cannot lose one another's entry.
8399    ///
8400    /// It is a record of writes, not a diff: a path the run DELETED or moved is not here, and
8401    /// neither is a change made by something else while the run was going. Recording is best-effort
8402    /// after the write has already succeeded — a failure to record is logged and leaves the list
8403    /// short rather than failing the edit — so treat it as "at least these" rather than proof that
8404    /// nothing else changed. Capped at 500 paths. Rows expire 30 days after the run.
8405    #[serde(default, skip_serializing_if = "Option::is_none")]
8406    pub changed_files: Option<Vec<String>>,
8407    /// Tool calls the run is blocked on, taken from the most recent `run.awaiting_approval` event.
8408    /// ABSENT — not empty — when the run is not awaiting approval, and absent too if the scan
8409    /// fails, which is deliberate: a failed scan must not turn a readable run into an error.
8410    #[serde(default, skip_serializing_if = "Option::is_none")]
8411    pub pending_approvals: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
8412    /// The question the run is blocked on, taken from the most recent `run.awaiting_input` event
8413    /// (runs.ts:673-681). Like `pending_approvals` it is ABSENT rather than empty when the run is
8414    /// not awaiting input. A squad chat reads this to render the prompt; the document never
8415    /// mentioned it, so a client written from the document alone showed a blocked run as merely
8416    /// running.
8417    #[serde(default, skip_serializing_if = "Option::is_none")]
8418    pub pending_input: Option<GetRunResponsePendingInput>,
8419}
8420
8421/// The question the run is blocked on, taken from the most recent `run.awaiting_input` event
8422/// (runs.ts:673-681). Like `pending_approvals` it is ABSENT rather than empty when the run is
8423/// not awaiting input. A squad chat reads this to render the prompt; the document never
8424/// mentioned it, so a client written from the document alone showed a blocked run as merely
8425/// running.
8426#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8427pub struct GetRunResponsePendingInput {
8428    #[serde(default, skip_serializing_if = "Option::is_none")]
8429    pub question: Option<String>,
8430    #[serde(default, skip_serializing_if = "Option::is_none")]
8431    pub context: Option<String>,
8432    #[serde(default, skip_serializing_if = "Option::is_none")]
8433    pub tool_call_id: Option<String>,
8434    #[serde(default, skip_serializing_if = "Option::is_none")]
8435    pub options: Option<Vec<serde_json::Value>>,
8436}
8437
8438/// Resource limits for the run
8439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8440pub struct GetRunResponseResourceLimits {
8441    #[serde(default, skip_serializing_if = "Option::is_none")]
8442    pub max_duration_ms: Option<i64>,
8443    #[serde(default, skip_serializing_if = "Option::is_none")]
8444    pub max_steps: Option<i64>,
8445    #[serde(default, skip_serializing_if = "Option::is_none")]
8446    pub max_tool_calls: Option<i64>,
8447    #[serde(default, skip_serializing_if = "Option::is_none")]
8448    pub max_tokens_per_run: Option<i64>,
8449}
8450
8451/// `GetRunStepsResponse` model.
8452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8453pub struct GetRunStepsResponse {
8454    pub steps: Vec<RunStep>,
8455    pub total: i64,
8456}
8457
8458/// `GetRuntimeConfigResponse` model.
8459#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8460pub struct GetRuntimeConfigResponse {
8461    #[serde(default, skip_serializing_if = "Option::is_none")]
8462    pub runtime: Option<serde_json::Map<String, serde_json::Value>>,
8463}
8464
8465/// `GetSessionAuditLogResponse` model.
8466#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8467pub struct GetSessionAuditLogResponse {
8468    pub session_id: String,
8469    pub audit_log: Vec<AuditLogEntry>,
8470    pub total: i64,
8471}
8472
8473/// `GetSessionMessagesResponse` model.
8474#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8475pub struct GetSessionMessagesResponse {
8476    pub messages: Vec<serde_json::Map<String, serde_json::Value>>,
8477    /// The same list as `messages`.
8478    pub items: Vec<serde_json::Map<String, serde_json::Value>>,
8479    pub total: i64,
8480    #[serde(default, skip_serializing_if = "Option::is_none")]
8481    pub active_run_id: Option<String>,
8482    #[serde(default, skip_serializing_if = "Option::is_none")]
8483    pub active_run_status: Option<String>,
8484    #[serde(default, skip_serializing_if = "Option::is_none")]
8485    pub active_run_partial_content: Option<String>,
8486}
8487
8488/// `GetSessionShareResponse` model.
8489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8490pub struct GetSessionShareResponse {
8491    #[serde(default, skip_serializing_if = "Option::is_none")]
8492    pub share_url: Option<String>,
8493    #[serde(default, skip_serializing_if = "Option::is_none")]
8494    pub role: Option<String>,
8495    #[serde(default, skip_serializing_if = "Option::is_none")]
8496    pub expires_at: Option<String>,
8497}
8498
8499/// `GetSquadChatHistoryResponse` model.
8500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8501pub struct GetSquadChatHistoryResponse {
8502    #[serde(default, skip_serializing_if = "Option::is_none")]
8503    pub team_id: Option<String>,
8504    #[serde(default, skip_serializing_if = "Option::is_none")]
8505    pub conversation_history: Option<Vec<TeamChatTurn>>,
8506    #[serde(default, skip_serializing_if = "Option::is_none")]
8507    pub total: Option<i64>,
8508    #[serde(default, skip_serializing_if = "Option::is_none")]
8509    pub chat_state: Option<serde_json::Map<String, serde_json::Value>>,
8510}
8511
8512/// `GetSquadGraphResponse` model.
8513#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8514pub struct GetSquadGraphResponse {
8515    #[serde(default, skip_serializing_if = "Option::is_none")]
8516    pub nodes: Option<Vec<TeamGraphNode>>,
8517    #[serde(default, skip_serializing_if = "Option::is_none")]
8518    pub edges: Option<Vec<TeamGraphEdge>>,
8519}
8520
8521/// `GetSquadRunMessagesResponse` model.
8522#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8523pub struct GetSquadRunMessagesResponse {
8524    pub team_id: String,
8525    pub team_run_id: String,
8526    pub messages: Vec<serde_json::Map<String, serde_json::Value>>,
8527    pub protocol_messages: Vec<serde_json::Map<String, serde_json::Value>>,
8528    pub total: i64,
8529}
8530
8531/// `GetTeamChatHistoryResponse` model.
8532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8533pub struct GetTeamChatHistoryResponse {
8534    #[serde(default, skip_serializing_if = "Option::is_none")]
8535    pub team_id: Option<String>,
8536    #[serde(default, skip_serializing_if = "Option::is_none")]
8537    pub conversation_history: Option<Vec<TeamChatTurn>>,
8538    #[serde(default, skip_serializing_if = "Option::is_none")]
8539    pub total: Option<i64>,
8540    #[serde(default, skip_serializing_if = "Option::is_none")]
8541    pub chat_state: Option<serde_json::Map<String, serde_json::Value>>,
8542}
8543
8544/// `GetTeamGraphResponse` model.
8545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8546pub struct GetTeamGraphResponse {
8547    #[serde(default, skip_serializing_if = "Option::is_none")]
8548    pub nodes: Option<Vec<TeamGraphNode>>,
8549    #[serde(default, skip_serializing_if = "Option::is_none")]
8550    pub edges: Option<Vec<TeamGraphEdge>>,
8551}
8552
8553/// `GetTeamRunMessagesResponse` model.
8554#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8555pub struct GetTeamRunMessagesResponse {
8556    pub team_id: String,
8557    pub team_run_id: String,
8558    pub messages: Vec<serde_json::Map<String, serde_json::Value>>,
8559    pub protocol_messages: Vec<serde_json::Map<String, serde_json::Value>>,
8560    pub total: i64,
8561}
8562
8563/// `GetTenantDomainHealthResponse` model.
8564#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8565pub struct GetTenantDomainHealthResponse {
8566    /// Hostname only — no scheme, no path.
8567    pub domain: String,
8568    pub created_at: String,
8569    #[serde(default, skip_serializing_if = "Option::is_none")]
8570    pub updated_at: Option<String>,
8571    #[serde(default, skip_serializing_if = "Option::is_none")]
8572    pub dns: Option<DomainDnsLifecycle>,
8573    #[serde(default, skip_serializing_if = "Option::is_none")]
8574    pub cert: Option<DomainCertLifecycle>,
8575}
8576
8577/// `GetTenantUsageResponse` model.
8578#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8579pub struct GetTenantUsageResponse {
8580    #[serde(default, skip_serializing_if = "Option::is_none")]
8581    pub tenant_id: Option<String>,
8582    #[serde(default, skip_serializing_if = "Option::is_none")]
8583    pub period: Option<String>,
8584    #[serde(default, skip_serializing_if = "Option::is_none")]
8585    pub usage: Option<serde_json::Map<String, serde_json::Value>>,
8586}
8587
8588/// `GetUnreadCountResponse` model.
8589#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8590pub struct GetUnreadCountResponse {
8591    pub count: i64,
8592    pub unread_count: i64,
8593    #[serde(rename = "unreadCount")]
8594    pub unread_count_: i64,
8595}
8596
8597/// `GetUsageTimeseriesMetric` enumeration.
8598#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8599pub enum GetUsageTimeseriesMetric {
8600    #[default]
8601    #[serde(rename = "runs")]
8602    Runs,
8603    #[serde(rename = "tokens")]
8604    Tokens,
8605    #[serde(rename = "cost")]
8606    Cost,
8607    /// A value the API introduced after this SDK was generated.
8608    #[serde(untagged)]
8609    Other(String),
8610}
8611
8612impl GetUsageTimeseriesMetric {
8613    /// The value as it appears on the wire.
8614    pub fn as_str(&self) -> &str {
8615        match self {
8616            Self::Runs => "runs",
8617            Self::Tokens => "tokens",
8618            Self::Cost => "cost",
8619            Self::Other(value) => value.as_str(),
8620        }
8621    }
8622}
8623
8624impl std::fmt::Display for GetUsageTimeseriesMetric {
8625    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8626        f.write_str(self.as_str())
8627    }
8628}
8629
8630impl From<&str> for GetUsageTimeseriesMetric {
8631    fn from(value: &str) -> Self {
8632        match value {
8633            "runs" => Self::Runs,
8634            "tokens" => Self::Tokens,
8635            "cost" => Self::Cost,
8636            other => Self::Other(other.to_string()),
8637        }
8638    }
8639}
8640
8641/// `GetUsageTimeseriesResponse` model.
8642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8643pub struct GetUsageTimeseriesResponse {
8644    #[serde(default, skip_serializing_if = "Option::is_none")]
8645    pub plan: Option<String>,
8646    #[serde(default, skip_serializing_if = "Option::is_none")]
8647    pub data: Option<Vec<GetUsageTimeseriesResponseDataItem>>,
8648}
8649
8650/// `GetUsageTimeseriesResponseDataItem` model.
8651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8652pub struct GetUsageTimeseriesResponseDataItem {
8653    /// The bucket's label — `M/D` in UTC without padding (`8/28`), not a date or an instant
8654    /// (usage-tracker.ts getTimeseries; measured 2026-09-10). Do not parse it as a Date.
8655    pub label: String,
8656    pub value: f64,
8657}
8658
8659/// `Goal` model.
8660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8661pub struct Goal {
8662    pub goal_id: String,
8663    pub tenant_id: String,
8664    pub agent_id: String,
8665    #[serde(default, skip_serializing_if = "Option::is_none")]
8666    pub title: Option<String>,
8667    #[serde(default, skip_serializing_if = "Option::is_none")]
8668    pub description: Option<String>,
8669    #[serde(default, skip_serializing_if = "Option::is_none")]
8670    pub rationale: Option<String>,
8671    /// How the goal squares with the constitution — written by the formulating agent.
8672    #[serde(default, skip_serializing_if = "Option::is_none")]
8673    pub alignment_justification: Option<String>,
8674    #[serde(default, skip_serializing_if = "Option::is_none")]
8675    pub expected_impact: Option<String>,
8676    #[serde(default, skip_serializing_if = "Option::is_none")]
8677    pub resource_estimate_usd: Option<f64>,
8678    pub status: GoalStatus,
8679    /// Set once the goal reaches a vote. Absent before that.
8680    #[serde(default, skip_serializing_if = "Option::is_none")]
8681    pub proposal_id: Option<String>,
8682    #[serde(default, skip_serializing_if = "Option::is_none")]
8683    pub constitution_check_passed: Option<bool>,
8684    pub created_at: String,
8685    #[serde(default, skip_serializing_if = "Option::is_none")]
8686    pub updated_at: Option<String>,
8687}
8688
8689/// `GoalStatus` enumeration.
8690#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8691pub enum GoalStatus {
8692    #[default]
8693    #[serde(rename = "proposed")]
8694    Proposed,
8695    #[serde(rename = "checking")]
8696    Checking,
8697    #[serde(rename = "voting")]
8698    Voting,
8699    #[serde(rename = "approved")]
8700    Approved,
8701    #[serde(rename = "rejected")]
8702    Rejected,
8703    #[serde(rename = "active")]
8704    Active,
8705    #[serde(rename = "completed")]
8706    Completed,
8707    /// A value the API introduced after this SDK was generated.
8708    #[serde(untagged)]
8709    Other(String),
8710}
8711
8712impl GoalStatus {
8713    /// The value as it appears on the wire.
8714    pub fn as_str(&self) -> &str {
8715        match self {
8716            Self::Proposed => "proposed",
8717            Self::Checking => "checking",
8718            Self::Voting => "voting",
8719            Self::Approved => "approved",
8720            Self::Rejected => "rejected",
8721            Self::Active => "active",
8722            Self::Completed => "completed",
8723            Self::Other(value) => value.as_str(),
8724        }
8725    }
8726}
8727
8728impl std::fmt::Display for GoalStatus {
8729    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8730        f.write_str(self.as_str())
8731    }
8732}
8733
8734impl From<&str> for GoalStatus {
8735    fn from(value: &str) -> Self {
8736        match value {
8737            "proposed" => Self::Proposed,
8738            "checking" => Self::Checking,
8739            "voting" => Self::Voting,
8740            "approved" => Self::Approved,
8741            "rejected" => Self::Rejected,
8742            "active" => Self::Active,
8743            "completed" => Self::Completed,
8744            other => Self::Other(other.to_string()),
8745        }
8746    }
8747}
8748
8749/// `GoogleOneTapAuthRequest` model.
8750#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8751pub struct GoogleOneTapAuthRequest {
8752    /// Google-signed JWT delivered by `google.accounts.id` to the GSI callback.
8753    pub credential: String,
8754    /// Optional device name surfaced on the minted api_key for `/me/sessions`.
8755    #[serde(default, skip_serializing_if = "Option::is_none")]
8756    pub device_label: Option<String>,
8757}
8758
8759/// `GoogleOneTapAuthResponse` model.
8760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8761pub struct GoogleOneTapAuthResponse {
8762    pub api_key: String,
8763    pub email: String,
8764}
8765
8766/// `GovernanceLedgerEntry` model.
8767#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8768pub struct GovernanceLedgerEntry {
8769    /// Position in the ONE global chain shared by all tenants — not a per-tenant sequence.
8770    /// Consecutive rows in a tenant's page usually have gaps here; the missing numbers are other
8771    /// tenants' entries (see the /governance/ledger description). For the tenant's own count use
8772    /// `tenant_total` on the list response.
8773    pub seq: i64,
8774    /// What happened, e.g. `run_complete`, `constitution_amended`.
8775    pub action: String,
8776    /// Coarse grouping, e.g. `execution`, `governance`.
8777    #[serde(default, skip_serializing_if = "Option::is_none")]
8778    pub category: Option<String>,
8779    #[serde(default, skip_serializing_if = "Option::is_none")]
8780    pub agent_id: Option<String>,
8781    #[serde(default, skip_serializing_if = "Option::is_none")]
8782    pub tenant_id: Option<String>,
8783    /// Action-specific detail; shape varies by `action`.
8784    #[serde(default, skip_serializing_if = "Option::is_none")]
8785    pub payload: Option<serde_json::Map<String, serde_json::Value>>,
8786    pub timestamp: String,
8787    /// Hash of the preceding entry. Null only for the genesis entry.
8788    #[serde(default)]
8789    pub prev_hash: Option<String>,
8790    pub hash: String,
8791}
8792
8793/// `GovernanceLedgerHead` model.
8794#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8795pub struct GovernanceLedgerHead {
8796    /// Global sequence of the newest ledger entry across ALL tenants — not the newest entry in the
8797    /// accompanying page. Measured 2026-08-20: `head.seq` was 6698 while the last visible entry was
8798    /// 6697, and the gap is another tenant's row. A client must not use this to decide whether it
8799    /// holds the latest page.
8800    pub seq: i64,
8801    pub hash: String,
8802}
8803
8804/// A webhook called before or after a run to allow, redact or block it.
8805#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8806pub struct Guardrail {
8807    pub guardrail_id: String,
8808    pub tenant_id: String,
8809    pub name: String,
8810    pub webhook_url: String,
8811    pub phase: GuardrailPhase,
8812    #[serde(default, skip_serializing_if = "Option::is_none")]
8813    pub action: Option<GuardrailAction>,
8814    #[serde(default, skip_serializing_if = "Option::is_none")]
8815    pub timeout_ms: Option<i64>,
8816    #[serde(default, skip_serializing_if = "Option::is_none")]
8817    pub created_at: Option<String>,
8818}
8819
8820/// `GuardrailAction` enumeration.
8821#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8822pub enum GuardrailAction {
8823    #[default]
8824    #[serde(rename = "block")]
8825    Block,
8826    #[serde(rename = "redact")]
8827    Redact,
8828    #[serde(rename = "warn")]
8829    Warn,
8830    #[serde(rename = "log")]
8831    Log,
8832    /// A value the API introduced after this SDK was generated.
8833    #[serde(untagged)]
8834    Other(String),
8835}
8836
8837impl GuardrailAction {
8838    /// The value as it appears on the wire.
8839    pub fn as_str(&self) -> &str {
8840        match self {
8841            Self::Block => "block",
8842            Self::Redact => "redact",
8843            Self::Warn => "warn",
8844            Self::Log => "log",
8845            Self::Other(value) => value.as_str(),
8846        }
8847    }
8848}
8849
8850impl std::fmt::Display for GuardrailAction {
8851    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8852        f.write_str(self.as_str())
8853    }
8854}
8855
8856impl From<&str> for GuardrailAction {
8857    fn from(value: &str) -> Self {
8858        match value {
8859            "block" => Self::Block,
8860            "redact" => Self::Redact,
8861            "warn" => Self::Warn,
8862            "log" => Self::Log,
8863            other => Self::Other(other.to_string()),
8864        }
8865    }
8866}
8867
8868/// `GuardrailPhase` enumeration.
8869#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8870pub enum GuardrailPhase {
8871    #[default]
8872    #[serde(rename = "input")]
8873    Input,
8874    #[serde(rename = "output")]
8875    Output,
8876    #[serde(rename = "both")]
8877    Both,
8878    /// A value the API introduced after this SDK was generated.
8879    #[serde(untagged)]
8880    Other(String),
8881}
8882
8883impl GuardrailPhase {
8884    /// The value as it appears on the wire.
8885    pub fn as_str(&self) -> &str {
8886        match self {
8887            Self::Input => "input",
8888            Self::Output => "output",
8889            Self::Both => "both",
8890            Self::Other(value) => value.as_str(),
8891        }
8892    }
8893}
8894
8895impl std::fmt::Display for GuardrailPhase {
8896    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8897        f.write_str(self.as_str())
8898    }
8899}
8900
8901impl From<&str> for GuardrailPhase {
8902    fn from(value: &str) -> Self {
8903        match value {
8904            "input" => Self::Input,
8905            "output" => Self::Output,
8906            "both" => Self::Both,
8907            other => Self::Other(other.to_string()),
8908        }
8909    }
8910}
8911
8912/// `HandleStripeWebhookRequest` model.
8913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8914pub struct HandleStripeWebhookRequest {
8915    pub r#type: String,
8916    pub data: serde_json::Map<String, serde_json::Value>,
8917}
8918
8919/// `HandleStripeWebhookResponse` model.
8920#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8921pub struct HandleStripeWebhookResponse {
8922    pub received: bool,
8923    pub handled: bool,
8924    #[serde(default, skip_serializing_if = "Option::is_none")]
8925    pub action: Option<String>,
8926    #[serde(default, skip_serializing_if = "Option::is_none")]
8927    pub duplicate: Option<bool>,
8928}
8929
8930/// `HealthCheckV1aliasResponse` model.
8931#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8932pub struct HealthCheckV1aliasResponse {
8933    #[serde(default, skip_serializing_if = "Option::is_none")]
8934    pub status: Option<GetHealthResponseStatus>,
8935    #[serde(default, skip_serializing_if = "Option::is_none")]
8936    pub timestamp: Option<String>,
8937    #[serde(default, skip_serializing_if = "Option::is_none")]
8938    pub kv_connected: Option<bool>,
8939    #[serde(default, skip_serializing_if = "Option::is_none")]
8940    pub uptime_seconds: Option<f64>,
8941    #[serde(default, skip_serializing_if = "Option::is_none")]
8942    pub version: Option<String>,
8943    #[serde(default, skip_serializing_if = "Option::is_none")]
8944    pub build_sha: Option<String>,
8945    #[serde(default, skip_serializing_if = "Option::is_none")]
8946    pub pending_resumes: Option<i64>,
8947    #[serde(default, skip_serializing_if = "Option::is_none")]
8948    pub runs_queued: Option<i64>,
8949}
8950
8951/// `HealthLiveResponse` model.
8952#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8953pub struct HealthLiveResponse {
8954    #[serde(default, skip_serializing_if = "Option::is_none")]
8955    pub status: Option<String>,
8956}
8957
8958/// `HealthzAliasResponse` model.
8959#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8960pub struct HealthzAliasResponse {
8961    #[serde(default, skip_serializing_if = "Option::is_none")]
8962    pub status: Option<String>,
8963}
8964
8965/// `HostDroplet` model.
8966#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8967pub struct HostDroplet {
8968    pub id: i64,
8969    pub name: String,
8970    pub status: String,
8971    pub region: String,
8972    pub size_slug: String,
8973    pub price_monthly_usd: f64,
8974    pub price_hourly_usd: f64,
8975    pub memory_mb: i64,
8976    pub vcpus: i64,
8977    pub disk_gb: i64,
8978    pub created_at: String,
8979}
8980
8981/// `ImageProviderList` model.
8982#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8983pub struct ImageProviderList {
8984    #[serde(default, skip_serializing_if = "Option::is_none")]
8985    pub providers: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
8986}
8987
8988/// `ImportAdminConfigRequest` model.
8989#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8990pub struct ImportAdminConfigRequest {
8991    #[serde(default, skip_serializing_if = "Option::is_none")]
8992    pub source: Option<String>,
8993    pub sections: serde_json::Map<String, serde_json::Value>,
8994}
8995
8996/// `ImportAgentMemoryRequest` model.
8997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8998pub struct ImportAgentMemoryRequest {
8999    #[serde(default, skip_serializing_if = "Option::is_none")]
9000    pub entries: Option<Vec<MemoryImportEntry>>,
9001    #[serde(default, skip_serializing_if = "Option::is_none")]
9002    pub agents: Option<Vec<ImportAgentMemoryRequestAgent>>,
9003}
9004
9005/// `ImportAgentMemoryRequestAgent` model.
9006#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9007pub struct ImportAgentMemoryRequestAgent {
9008    #[serde(default, skip_serializing_if = "Option::is_none")]
9009    pub agent_id: Option<String>,
9010    #[serde(default, skip_serializing_if = "Option::is_none")]
9011    pub agent_name: Option<String>,
9012    pub entries: Vec<MemoryImportEntry>,
9013}
9014
9015/// `ImportAgentMemoryResponse` model.
9016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9017pub struct ImportAgentMemoryResponse {
9018    pub imported: bool,
9019    pub agent_id: String,
9020    /// Entries in the file.
9021    pub offered: i64,
9022    /// New entries stored.
9023    pub added: i64,
9024    /// Entries the store already had.
9025    pub duplicates: i64,
9026}
9027
9028/// Self-improvement proposal — multi-stage state machine (proposed → arbiter_review → voting →
9029/// sandbox_testing → approved → applied | rejected at any step).
9030#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9031pub struct ImprovementProposal {
9032    pub proposal_id: String,
9033    pub tenant_id: String,
9034    pub agent_id: String,
9035    /// Was declared `string` here while the record has always carried a number.
9036    pub version: i64,
9037    pub r#type: ImprovementProposalType,
9038    /// The proposal's heading. Undeclared until now, so a client built from this document rendered
9039    /// the card without one.
9040    #[serde(default, skip_serializing_if = "Option::is_none")]
9041    pub title: Option<String>,
9042    #[serde(default, skip_serializing_if = "Option::is_none")]
9043    pub description: Option<String>,
9044    #[serde(default, skip_serializing_if = "Option::is_none")]
9045    pub rationale: Option<String>,
9046    /// The failed runs that prompted the proposal.
9047    #[serde(default, skip_serializing_if = "Option::is_none")]
9048    pub failed_run_ids: Option<Vec<String>>,
9049    /// The proposed changes. Declared as `diff` here and stored as `changes`, so a client reading
9050    /// the documented name found nothing and showed "no diff" over a proposal that had one.
9051    #[serde(default, skip_serializing_if = "Option::is_none")]
9052    pub changes: Option<serde_json::Map<String, serde_json::Value>>,
9053    #[serde(default, skip_serializing_if = "Option::is_none")]
9054    pub baseline_success_rate: Option<f64>,
9055    /// Present only after the sandbox stage has run.
9056    #[serde(default, skip_serializing_if = "Option::is_none")]
9057    pub sandbox_success_rate: Option<f64>,
9058    pub status: ImprovementProposalStatus,
9059    /// Set once the proposal reaches a vote.
9060    #[serde(default, skip_serializing_if = "Option::is_none")]
9061    pub vote_proposal_id: Option<String>,
9062    pub created_at: String,
9063    #[serde(default, skip_serializing_if = "Option::is_none")]
9064    pub updated_at: Option<String>,
9065}
9066
9067/// `ImprovementProposalStatus` enumeration.
9068#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9069pub enum ImprovementProposalStatus {
9070    #[default]
9071    #[serde(rename = "proposed")]
9072    Proposed,
9073    #[serde(rename = "arbiter_review")]
9074    ArbiterReview,
9075    #[serde(rename = "voting")]
9076    Voting,
9077    #[serde(rename = "sandbox_testing")]
9078    SandboxTesting,
9079    #[serde(rename = "approved")]
9080    Approved,
9081    #[serde(rename = "applied")]
9082    Applied,
9083    #[serde(rename = "rejected")]
9084    Rejected,
9085    /// A value the API introduced after this SDK was generated.
9086    #[serde(untagged)]
9087    Other(String),
9088}
9089
9090impl ImprovementProposalStatus {
9091    /// The value as it appears on the wire.
9092    pub fn as_str(&self) -> &str {
9093        match self {
9094            Self::Proposed => "proposed",
9095            Self::ArbiterReview => "arbiter_review",
9096            Self::Voting => "voting",
9097            Self::SandboxTesting => "sandbox_testing",
9098            Self::Approved => "approved",
9099            Self::Applied => "applied",
9100            Self::Rejected => "rejected",
9101            Self::Other(value) => value.as_str(),
9102        }
9103    }
9104}
9105
9106impl std::fmt::Display for ImprovementProposalStatus {
9107    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9108        f.write_str(self.as_str())
9109    }
9110}
9111
9112impl From<&str> for ImprovementProposalStatus {
9113    fn from(value: &str) -> Self {
9114        match value {
9115            "proposed" => Self::Proposed,
9116            "arbiter_review" => Self::ArbiterReview,
9117            "voting" => Self::Voting,
9118            "sandbox_testing" => Self::SandboxTesting,
9119            "approved" => Self::Approved,
9120            "applied" => Self::Applied,
9121            "rejected" => Self::Rejected,
9122            other => Self::Other(other.to_string()),
9123        }
9124    }
9125}
9126
9127/// `ImprovementProposalType` enumeration.
9128#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9129pub enum ImprovementProposalType {
9130    #[default]
9131    #[serde(rename = "prompt_change")]
9132    PromptChange,
9133    #[serde(rename = "tool_addition")]
9134    ToolAddition,
9135    #[serde(rename = "tool_removal")]
9136    ToolRemoval,
9137    #[serde(rename = "model_change")]
9138    ModelChange,
9139    #[serde(rename = "parameter_tuning")]
9140    ParameterTuning,
9141    #[serde(rename = "skill_addition")]
9142    SkillAddition,
9143    /// A value the API introduced after this SDK was generated.
9144    #[serde(untagged)]
9145    Other(String),
9146}
9147
9148impl ImprovementProposalType {
9149    /// The value as it appears on the wire.
9150    pub fn as_str(&self) -> &str {
9151        match self {
9152            Self::PromptChange => "prompt_change",
9153            Self::ToolAddition => "tool_addition",
9154            Self::ToolRemoval => "tool_removal",
9155            Self::ModelChange => "model_change",
9156            Self::ParameterTuning => "parameter_tuning",
9157            Self::SkillAddition => "skill_addition",
9158            Self::Other(value) => value.as_str(),
9159        }
9160    }
9161}
9162
9163impl std::fmt::Display for ImprovementProposalType {
9164    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9165        f.write_str(self.as_str())
9166    }
9167}
9168
9169impl From<&str> for ImprovementProposalType {
9170    fn from(value: &str) -> Self {
9171        match value {
9172            "prompt_change" => Self::PromptChange,
9173            "tool_addition" => Self::ToolAddition,
9174            "tool_removal" => Self::ToolRemoval,
9175            "model_change" => Self::ModelChange,
9176            "parameter_tuning" => Self::ParameterTuning,
9177            "skill_addition" => Self::SkillAddition,
9178            other => Self::Other(other.to_string()),
9179        }
9180    }
9181}
9182
9183/// One run waiting on a person, with what it is actually asking rather than just its status.
9184#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9185pub struct InboxItem {
9186    pub id: String,
9187    pub kind: InboxItemKind,
9188    pub run_id: String,
9189    pub agent_id: String,
9190    pub agent_name: String,
9191    #[serde(default)]
9192    pub session_id: Option<String>,
9193    pub status: String,
9194    #[serde(default)]
9195    pub created_at: Option<String>,
9196    /// One line: the tool being requested, the question, or the error.
9197    pub summary: String,
9198    /// Longer body — tool arguments, error detail, question context. Empty string when there is
9199    /// none.
9200    pub detail: String,
9201    /// The agent's own choices, for `input` items. Empty otherwise.
9202    pub options: Vec<String>,
9203}
9204
9205/// `InboxItemKind` enumeration.
9206#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9207pub enum InboxItemKind {
9208    #[default]
9209    #[serde(rename = "approval")]
9210    Approval,
9211    #[serde(rename = "input")]
9212    Input,
9213    #[serde(rename = "paused")]
9214    Paused,
9215    #[serde(rename = "failed")]
9216    Failed,
9217    /// A value the API introduced after this SDK was generated.
9218    #[serde(untagged)]
9219    Other(String),
9220}
9221
9222impl InboxItemKind {
9223    /// The value as it appears on the wire.
9224    pub fn as_str(&self) -> &str {
9225        match self {
9226            Self::Approval => "approval",
9227            Self::Input => "input",
9228            Self::Paused => "paused",
9229            Self::Failed => "failed",
9230            Self::Other(value) => value.as_str(),
9231        }
9232    }
9233}
9234
9235impl std::fmt::Display for InboxItemKind {
9236    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9237        f.write_str(self.as_str())
9238    }
9239}
9240
9241impl From<&str> for InboxItemKind {
9242    fn from(value: &str) -> Self {
9243        match value {
9244            "approval" => Self::Approval,
9245            "input" => Self::Input,
9246            "paused" => Self::Paused,
9247            "failed" => Self::Failed,
9248            other => Self::Other(other.to_string()),
9249        }
9250    }
9251}
9252
9253/// `IngestKbDocumentRequest` model.
9254#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9255pub struct IngestKbDocumentRequest {
9256    #[serde(default, skip_serializing_if = "Option::is_none")]
9257    pub file_id: Option<String>,
9258    #[serde(default, skip_serializing_if = "Option::is_none")]
9259    pub content: Option<String>,
9260    #[serde(default, skip_serializing_if = "Option::is_none")]
9261    pub filename: Option<String>,
9262}
9263
9264/// `IngestKbDocumentResponse` model.
9265#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9266pub struct IngestKbDocumentResponse {
9267    #[serde(default, skip_serializing_if = "Option::is_none")]
9268    pub document_id: Option<String>,
9269    #[serde(default, skip_serializing_if = "Option::is_none")]
9270    pub name: Option<String>,
9271    #[serde(default, skip_serializing_if = "Option::is_none")]
9272    pub chunks_created: Option<i64>,
9273    #[serde(default, skip_serializing_if = "Option::is_none")]
9274    pub status: Option<String>,
9275}
9276
9277/// `IngestMemoryRequest` model.
9278#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9279pub struct IngestMemoryRequest {
9280    /// Pre-uploaded file id (POST /api/v1/files first).
9281    #[serde(default, skip_serializing_if = "Option::is_none")]
9282    pub file_id: Option<String>,
9283    /// Inline text body when no file_id is provided. Max 2 MB.
9284    #[serde(default, skip_serializing_if = "Option::is_none")]
9285    pub content: Option<String>,
9286    /// Override stored filename; defaults to file metadata or `created-doc.md`.
9287    #[serde(default, skip_serializing_if = "Option::is_none")]
9288    pub filename: Option<String>,
9289    #[serde(default, skip_serializing_if = "Option::is_none")]
9290    pub tags: Option<Vec<String>>,
9291    /// Server default: `600`.
9292    #[serde(default, skip_serializing_if = "Option::is_none")]
9293    pub chunk_size: Option<i64>,
9294}
9295
9296/// `IngestMemoryResponse` model.
9297#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9298pub struct IngestMemoryResponse {
9299    pub ingested: bool,
9300    pub filename: String,
9301    pub text_length: i64,
9302    pub chunks_created: i64,
9303    #[serde(default, skip_serializing_if = "Option::is_none")]
9304    pub file_id: Option<String>,
9305    pub entries: Vec<IngestMemoryResponseEntry>,
9306}
9307
9308/// `IngestMemoryResponseEntry` model.
9309#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9310pub struct IngestMemoryResponseEntry {
9311    pub entry_id: String,
9312    pub r#type: String,
9313    pub content_preview: String,
9314    #[serde(default, skip_serializing_if = "Option::is_none")]
9315    pub tags: Option<Vec<String>>,
9316}
9317
9318/// OAuth/API integration record (Slack, GitHub, Linear, etc.).
9319#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9320pub struct Integration {
9321    pub id: String,
9322    pub tenant_id: String,
9323    /// Which connector this is: `github`, `slack`, `linear`, …
9324    pub connector_id: String,
9325    #[serde(default, skip_serializing_if = "Option::is_none")]
9326    pub name: Option<String>,
9327    /// Connector settings. Secrets are replaced with `\<redacted\>`.
9328    #[serde(default, skip_serializing_if = "Option::is_none")]
9329    pub config: Option<serde_json::Map<String, serde_json::Value>>,
9330    /// `active` is what the server sends for a working integration; the documented `connected` was
9331    /// never emitted.
9332    pub status: IntegrationStatus,
9333    #[serde(default, skip_serializing_if = "Option::is_none")]
9334    pub last_sync_at: Option<String>,
9335    #[serde(default, skip_serializing_if = "Option::is_none")]
9336    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
9337    #[serde(default, skip_serializing_if = "Option::is_none")]
9338    pub created_at: Option<String>,
9339    #[serde(default, skip_serializing_if = "Option::is_none")]
9340    pub updated_at: Option<String>,
9341    #[serde(default, skip_serializing_if = "Option::is_none")]
9342    pub migrated_at: Option<String>,
9343    /// Agents allowed to use this integration. Present on the live record and read by 7 files in
9344    /// the web; the document omitted it, so a generated client could not tell which agents an
9345    /// integration serves.
9346    #[serde(default, skip_serializing_if = "Option::is_none")]
9347    pub assigned_agent_ids: Option<Vec<String>>,
9348}
9349
9350/// Available integration (connector) type in the catalog
9351#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9352pub struct IntegrationCatalogItem {
9353    /// Connector id (e.g. github, stripe, notion, slack)
9354    pub id: String,
9355    pub name: String,
9356    pub description: String,
9357    pub icon: String,
9358    pub auth_type: IntegrationCatalogItemAuthType,
9359    /// Present when the connector authorises through another connector's OAuth provider
9360    /// (google_calendar, gmail, google_drive and google_sheets all say `google`). A client builds
9361    /// the authorize URL from this when set, from `id` otherwise. Absent for every other connector.
9362    #[serde(default, skip_serializing_if = "Option::is_none")]
9363    pub oauth_provider: Option<String>,
9364    /// The OAuth scopes the connector needs, so a client can show them BEFORE the visitor clicks
9365    /// Connect rather than leaving the IdP consent screen to be the first place they are seen.
9366    /// Absent — not empty — for api_key connectors and for OAuth connectors that declare none.
9367    #[serde(default, skip_serializing_if = "Option::is_none")]
9368    pub required_oauth_scopes: Option<Vec<String>>,
9369    pub config_schema: HashMap<String, ConnectorConfigField>,
9370}
9371
9372/// `IntegrationCatalogItemAuthType` enumeration.
9373#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9374pub enum IntegrationCatalogItemAuthType {
9375    #[default]
9376    #[serde(rename = "api_key")]
9377    APIKey,
9378    #[serde(rename = "oauth2")]
9379    Oauth2,
9380    #[serde(rename = "webhook")]
9381    Webhook,
9382    #[serde(rename = "none")]
9383    None,
9384    /// A value the API introduced after this SDK was generated.
9385    #[serde(untagged)]
9386    Other(String),
9387}
9388
9389impl IntegrationCatalogItemAuthType {
9390    /// The value as it appears on the wire.
9391    pub fn as_str(&self) -> &str {
9392        match self {
9393            Self::APIKey => "api_key",
9394            Self::Oauth2 => "oauth2",
9395            Self::Webhook => "webhook",
9396            Self::None => "none",
9397            Self::Other(value) => value.as_str(),
9398        }
9399    }
9400}
9401
9402impl std::fmt::Display for IntegrationCatalogItemAuthType {
9403    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9404        f.write_str(self.as_str())
9405    }
9406}
9407
9408impl From<&str> for IntegrationCatalogItemAuthType {
9409    fn from(value: &str) -> Self {
9410        match value {
9411            "api_key" => Self::APIKey,
9412            "oauth2" => Self::Oauth2,
9413            "webhook" => Self::Webhook,
9414            "none" => Self::None,
9415            other => Self::Other(other.to_string()),
9416        }
9417    }
9418}
9419
9420/// `active` is what the server sends for a working integration; the documented `connected` was
9421/// never emitted.
9422#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9423pub enum IntegrationStatus {
9424    #[default]
9425    #[serde(rename = "active")]
9426    Active,
9427    #[serde(rename = "inactive")]
9428    Inactive,
9429    #[serde(rename = "error")]
9430    Error,
9431    /// A value the API introduced after this SDK was generated.
9432    #[serde(untagged)]
9433    Other(String),
9434}
9435
9436impl IntegrationStatus {
9437    /// The value as it appears on the wire.
9438    pub fn as_str(&self) -> &str {
9439        match self {
9440            Self::Active => "active",
9441            Self::Inactive => "inactive",
9442            Self::Error => "error",
9443            Self::Other(value) => value.as_str(),
9444        }
9445    }
9446}
9447
9448impl std::fmt::Display for IntegrationStatus {
9449    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9450        f.write_str(self.as_str())
9451    }
9452}
9453
9454impl From<&str> for IntegrationStatus {
9455    fn from(value: &str) -> Self {
9456        match value {
9457            "active" => Self::Active,
9458            "inactive" => Self::Inactive,
9459            "error" => Self::Error,
9460            other => Self::Other(other.to_string()),
9461        }
9462    }
9463}
9464
9465/// `Invite` model.
9466#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9467pub struct Invite {
9468    #[serde(default, skip_serializing_if = "Option::is_none")]
9469    pub created_at: Option<String>,
9470    #[serde(default, skip_serializing_if = "Option::is_none")]
9471    pub email: Option<String>,
9472    #[serde(default, skip_serializing_if = "Option::is_none")]
9473    pub expires_at: Option<String>,
9474    #[serde(default, skip_serializing_if = "Option::is_none")]
9475    pub id: Option<String>,
9476    #[serde(default, skip_serializing_if = "Option::is_none")]
9477    pub invited_by: Option<String>,
9478    #[serde(default, skip_serializing_if = "Option::is_none")]
9479    pub role: Option<String>,
9480    #[serde(default, skip_serializing_if = "Option::is_none")]
9481    pub secret: Option<String>,
9482    #[serde(default, skip_serializing_if = "Option::is_none")]
9483    pub status: Option<String>,
9484    #[serde(default, skip_serializing_if = "Option::is_none")]
9485    pub tenant_id: Option<String>,
9486}
9487
9488/// `InviteUserRequest` model.
9489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9490pub struct InviteUserRequest {
9491    pub email: String,
9492    pub role: String,
9493}
9494
9495/// `InviteUserResponse` model.
9496#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9497pub struct InviteUserResponse {
9498    #[serde(default, skip_serializing_if = "Option::is_none")]
9499    pub created_at: Option<String>,
9500    #[serde(default, skip_serializing_if = "Option::is_none")]
9501    pub email: Option<String>,
9502    #[serde(default, skip_serializing_if = "Option::is_none")]
9503    pub expires_at: Option<String>,
9504    #[serde(default, skip_serializing_if = "Option::is_none")]
9505    pub id: Option<String>,
9506    #[serde(default, skip_serializing_if = "Option::is_none")]
9507    pub invited_by: Option<String>,
9508    #[serde(default, skip_serializing_if = "Option::is_none")]
9509    pub role: Option<String>,
9510    #[serde(default, skip_serializing_if = "Option::is_none")]
9511    pub secret: Option<String>,
9512    #[serde(default, skip_serializing_if = "Option::is_none")]
9513    pub status: Option<String>,
9514    #[serde(default, skip_serializing_if = "Option::is_none")]
9515    pub tenant_id: Option<String>,
9516    pub email_sent: bool,
9517}
9518
9519/// `InvokeListingAgentRequest` model.
9520#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9521pub struct InvokeListingAgentRequest {
9522    pub input: serde_json::Map<String, serde_json::Value>,
9523}
9524
9525/// `IssueArbiterRulingRequest` model.
9526#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9527pub struct IssueArbiterRulingRequest {
9528    pub decision: String,
9529    #[serde(default, skip_serializing_if = "Option::is_none")]
9530    pub penalties: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
9531}
9532
9533/// `IssueArbiterRulingResponse` model.
9534#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9535pub struct IssueArbiterRulingResponse {
9536    #[serde(default, skip_serializing_if = "Option::is_none")]
9537    pub ok: Option<bool>,
9538}
9539
9540/// `KnowledgeBase` model.
9541#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9542pub struct KnowledgeBase {
9543    pub id: String,
9544    pub tenant_id: String,
9545    pub name: String,
9546    #[serde(default, skip_serializing_if = "Option::is_none")]
9547    pub description: Option<String>,
9548    #[serde(default, skip_serializing_if = "Option::is_none")]
9549    pub embedding_model: Option<String>,
9550    #[serde(default, skip_serializing_if = "Option::is_none")]
9551    pub chunk_size: Option<i64>,
9552    #[serde(default, skip_serializing_if = "Option::is_none")]
9553    pub chunk_overlap: Option<i64>,
9554    #[serde(default, skip_serializing_if = "Option::is_none")]
9555    pub document_count: Option<i64>,
9556    #[serde(default, skip_serializing_if = "Option::is_none")]
9557    pub total_chunks: Option<i64>,
9558    /// Deliberately not an enum. The routes write several values for different notions of
9559    /// readiness, and publishing a guessed list is how a client comes to reject a state the server
9560    /// legitimately sends. `ready` is the one observed on a healthy base.
9561    #[serde(default, skip_serializing_if = "Option::is_none")]
9562    pub status: Option<String>,
9563    #[serde(default, skip_serializing_if = "Option::is_none")]
9564    pub attached_agents: Option<Vec<KnowledgeBaseAttachedAgent>>,
9565    #[serde(default, skip_serializing_if = "Option::is_none")]
9566    pub attached_agent_count: Option<i64>,
9567    #[serde(default, skip_serializing_if = "Option::is_none")]
9568    pub created_at: Option<String>,
9569    #[serde(default, skip_serializing_if = "Option::is_none")]
9570    pub updated_at: Option<String>,
9571}
9572
9573/// `KnowledgeBaseAttachedAgent` model.
9574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9575pub struct KnowledgeBaseAttachedAgent {
9576    pub agent_id: String,
9577    #[serde(default, skip_serializing_if = "Option::is_none")]
9578    pub name: Option<String>,
9579}
9580
9581/// Body for `POST /api/v1/knowledge-bases`.
9582#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9583pub struct KnowledgeBaseCreate {
9584    pub name: String,
9585    #[serde(default, skip_serializing_if = "Option::is_none")]
9586    pub description: Option<String>,
9587    #[serde(default, skip_serializing_if = "Option::is_none")]
9588    pub embedding_model: Option<String>,
9589}
9590
9591/// `KnowledgeBaseDocument` model.
9592#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9593pub struct KnowledgeBaseDocument {
9594    pub id: String,
9595    pub kb_id: String,
9596    pub tenant_id: String,
9597    pub name: String,
9598    pub r#type: KnowledgeBaseDocumentType,
9599    pub size_bytes: i64,
9600    pub chunk_count: i64,
9601    pub status: KnowledgeBaseDocumentStatus,
9602    #[serde(default, skip_serializing_if = "Option::is_none")]
9603    pub error_message: Option<String>,
9604    pub created_at: String,
9605    pub updated_at: String,
9606    #[serde(default)]
9607    pub chunk_preview: Option<String>,
9608    /// `embedded` when the document's chunks have vectors; `keyword_only` when no embedding
9609    /// provider answered and the document is searchable by keywords only.
9610    pub embedding_status: KnowledgeBaseDocumentEmbeddingStatus,
9611}
9612
9613/// `embedded` when the document's chunks have vectors; `keyword_only` when no embedding
9614/// provider answered and the document is searchable by keywords only.
9615#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9616pub enum KnowledgeBaseDocumentEmbeddingStatus {
9617    #[default]
9618    #[serde(rename = "embedded")]
9619    Embedded,
9620    #[serde(rename = "keyword_only")]
9621    KeywordOnly,
9622    /// A value the API introduced after this SDK was generated.
9623    #[serde(untagged)]
9624    Other(String),
9625}
9626
9627impl KnowledgeBaseDocumentEmbeddingStatus {
9628    /// The value as it appears on the wire.
9629    pub fn as_str(&self) -> &str {
9630        match self {
9631            Self::Embedded => "embedded",
9632            Self::KeywordOnly => "keyword_only",
9633            Self::Other(value) => value.as_str(),
9634        }
9635    }
9636}
9637
9638impl std::fmt::Display for KnowledgeBaseDocumentEmbeddingStatus {
9639    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9640        f.write_str(self.as_str())
9641    }
9642}
9643
9644impl From<&str> for KnowledgeBaseDocumentEmbeddingStatus {
9645    fn from(value: &str) -> Self {
9646        match value {
9647            "embedded" => Self::Embedded,
9648            "keyword_only" => Self::KeywordOnly,
9649            other => Self::Other(other.to_string()),
9650        }
9651    }
9652}
9653
9654/// `KnowledgeBaseDocumentStatus` enumeration.
9655#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9656pub enum KnowledgeBaseDocumentStatus {
9657    #[default]
9658    #[serde(rename = "uploading")]
9659    Uploading,
9660    #[serde(rename = "processing")]
9661    Processing,
9662    #[serde(rename = "ready")]
9663    Ready,
9664    #[serde(rename = "error")]
9665    Error,
9666    /// A value the API introduced after this SDK was generated.
9667    #[serde(untagged)]
9668    Other(String),
9669}
9670
9671impl KnowledgeBaseDocumentStatus {
9672    /// The value as it appears on the wire.
9673    pub fn as_str(&self) -> &str {
9674        match self {
9675            Self::Uploading => "uploading",
9676            Self::Processing => "processing",
9677            Self::Ready => "ready",
9678            Self::Error => "error",
9679            Self::Other(value) => value.as_str(),
9680        }
9681    }
9682}
9683
9684impl std::fmt::Display for KnowledgeBaseDocumentStatus {
9685    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9686        f.write_str(self.as_str())
9687    }
9688}
9689
9690impl From<&str> for KnowledgeBaseDocumentStatus {
9691    fn from(value: &str) -> Self {
9692        match value {
9693            "uploading" => Self::Uploading,
9694            "processing" => Self::Processing,
9695            "ready" => Self::Ready,
9696            "error" => Self::Error,
9697            other => Self::Other(other.to_string()),
9698        }
9699    }
9700}
9701
9702/// `KnowledgeBaseDocumentType` enumeration.
9703#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9704pub enum KnowledgeBaseDocumentType {
9705    #[default]
9706    #[serde(rename = "pdf")]
9707    PDF,
9708    #[serde(rename = "markdown")]
9709    Markdown,
9710    #[serde(rename = "csv")]
9711    CSV,
9712    #[serde(rename = "html")]
9713    Html,
9714    #[serde(rename = "plain")]
9715    Plain,
9716    #[serde(rename = "docx")]
9717    Docx,
9718    #[serde(rename = "image")]
9719    Image,
9720    /// A value the API introduced after this SDK was generated.
9721    #[serde(untagged)]
9722    Other(String),
9723}
9724
9725impl KnowledgeBaseDocumentType {
9726    /// The value as it appears on the wire.
9727    pub fn as_str(&self) -> &str {
9728        match self {
9729            Self::PDF => "pdf",
9730            Self::Markdown => "markdown",
9731            Self::CSV => "csv",
9732            Self::Html => "html",
9733            Self::Plain => "plain",
9734            Self::Docx => "docx",
9735            Self::Image => "image",
9736            Self::Other(value) => value.as_str(),
9737        }
9738    }
9739}
9740
9741impl std::fmt::Display for KnowledgeBaseDocumentType {
9742    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9743        f.write_str(self.as_str())
9744    }
9745}
9746
9747impl From<&str> for KnowledgeBaseDocumentType {
9748    fn from(value: &str) -> Self {
9749        match value {
9750            "pdf" => Self::PDF,
9751            "markdown" => Self::Markdown,
9752            "csv" => Self::CSV,
9753            "html" => Self::Html,
9754            "plain" => Self::Plain,
9755            "docx" => Self::Docx,
9756            "image" => Self::Image,
9757            other => Self::Other(other.to_string()),
9758        }
9759    }
9760}
9761
9762/// `KnowledgeBaseSearchResult` model.
9763#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9764pub struct KnowledgeBaseSearchResult {
9765    pub status: KnowledgeBaseSearchResultStatus,
9766    pub query: String,
9767    /// Which pass produced the results; null when the knowledge base is empty and neither ran.
9768    #[serde(default)]
9769    pub mode: Option<String>,
9770    pub count: i64,
9771    pub results: Vec<KnowledgeBaseSearchResultResult>,
9772}
9773
9774/// `KnowledgeBaseSearchResultResult` model.
9775#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9776pub struct KnowledgeBaseSearchResultResult {
9777    /// 1-based citation number.
9778    pub index: i64,
9779    /// Document label, sanitised before it is rendered into a prompt.
9780    pub source: String,
9781    #[serde(default, skip_serializing_if = "Option::is_none")]
9782    pub page: Option<i64>,
9783    pub text: String,
9784    pub score: f64,
9785}
9786
9787/// `KnowledgeBaseSearchResultStatus` enumeration.
9788#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9789pub enum KnowledgeBaseSearchResultStatus {
9790    #[default]
9791    #[serde(rename = "KB_EMPTY")]
9792    KbEmpty,
9793    #[serde(rename = "NO_MATCHES")]
9794    NoMatches,
9795    #[serde(rename = "RESULTS_FOUND")]
9796    ResultsFound,
9797    /// A value the API introduced after this SDK was generated.
9798    #[serde(untagged)]
9799    Other(String),
9800}
9801
9802impl KnowledgeBaseSearchResultStatus {
9803    /// The value as it appears on the wire.
9804    pub fn as_str(&self) -> &str {
9805        match self {
9806            Self::KbEmpty => "KB_EMPTY",
9807            Self::NoMatches => "NO_MATCHES",
9808            Self::ResultsFound => "RESULTS_FOUND",
9809            Self::Other(value) => value.as_str(),
9810        }
9811    }
9812}
9813
9814impl std::fmt::Display for KnowledgeBaseSearchResultStatus {
9815    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9816        f.write_str(self.as_str())
9817    }
9818}
9819
9820impl From<&str> for KnowledgeBaseSearchResultStatus {
9821    fn from(value: &str) -> Self {
9822        match value {
9823            "KB_EMPTY" => Self::KbEmpty,
9824            "NO_MATCHES" => Self::NoMatches,
9825            "RESULTS_FOUND" => Self::ResultsFound,
9826            other => Self::Other(other.to_string()),
9827        }
9828    }
9829}
9830
9831/// Body for `PUT /api/v1/knowledge-bases/{id}`. Every field optional.
9832#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9833pub struct KnowledgeBaseUpdate {
9834    #[serde(default, skip_serializing_if = "Option::is_none")]
9835    pub name: Option<String>,
9836    #[serde(default, skip_serializing_if = "Option::is_none")]
9837    pub description: Option<String>,
9838}
9839
9840/// Operator-set text and partner logos for the public landing page.
9841#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9842pub struct LandingOverrides {
9843    /// Override key → text. Empty when nothing is overridden.
9844    pub texts: serde_json::Map<String, serde_json::Value>,
9845    pub multilang_enabled: bool,
9846    pub default_locale: String,
9847    pub partners_enabled: bool,
9848    /// Null means never configured, which a client may render differently from an empty list.
9849    #[serde(default)]
9850    pub partners: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
9851    /// KV versionstamp of the stored record. The admin form sends it back on write so two operators
9852    /// cannot silently overwrite each other.
9853    #[serde(default)]
9854    pub version: Option<String>,
9855}
9856
9857/// `LandingStats` model.
9858#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9859pub struct LandingStats {
9860    #[serde(default, skip_serializing_if = "Option::is_none")]
9861    pub agents_deployed: Option<i64>,
9862    #[serde(default, skip_serializing_if = "Option::is_none")]
9863    pub llm_providers: Option<i64>,
9864    #[serde(default, skip_serializing_if = "Option::is_none")]
9865    pub registered_users: Option<i64>,
9866    #[serde(default, skip_serializing_if = "Option::is_none")]
9867    pub tool_calls_today: Option<i64>,
9868    #[serde(default, skip_serializing_if = "Option::is_none")]
9869    pub total_runs: Option<i64>,
9870    #[serde(default, skip_serializing_if = "Option::is_none")]
9871    pub total_sessions: Option<i64>,
9872    #[serde(default, skip_serializing_if = "Option::is_none")]
9873    pub total_tokens: Option<i64>,
9874}
9875
9876/// `LeaveTenantResponse` model.
9877#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9878pub struct LeaveTenantResponse {
9879    pub left: bool,
9880    pub tenant_id: String,
9881}
9882
9883/// `LedgerIntegrity` model.
9884#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9885pub struct LedgerIntegrity {
9886    pub valid: bool,
9887    pub entries_checked: i64,
9888    /// Sequence of the first entry that failed verification. Absent when `valid` is true.
9889    #[serde(default, skip_serializing_if = "Option::is_none")]
9890    pub first_invalid_seq: Option<i64>,
9891    #[serde(default, skip_serializing_if = "Option::is_none")]
9892    pub error: Option<String>,
9893    pub checked_at: String,
9894}
9895
9896/// `LinkPreview` model.
9897#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9898pub struct LinkPreview {
9899    pub url: String,
9900    pub site: String,
9901    #[serde(default, skip_serializing_if = "Option::is_none")]
9902    pub title: Option<String>,
9903    #[serde(default, skip_serializing_if = "Option::is_none")]
9904    pub description: Option<String>,
9905    #[serde(default, skip_serializing_if = "Option::is_none")]
9906    pub image: Option<String>,
9907    #[serde(default, skip_serializing_if = "Option::is_none")]
9908    pub favicon: Option<String>,
9909}
9910
9911/// `ListA2ATasksResponse` model.
9912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9913pub struct ListA2ATasksResponse {
9914    pub tasks: Vec<A2ATask>,
9915    /// Offset to pass as `offset` for the next page; absent on the last page.
9916    #[serde(default, skip_serializing_if = "Option::is_none")]
9917    pub cursor: Option<String>,
9918    /// Size of the whole set.
9919    #[serde(default, skip_serializing_if = "Option::is_none")]
9920    pub total: Option<i64>,
9921    #[serde(default, skip_serializing_if = "Option::is_none")]
9922    pub limit: Option<i64>,
9923    #[serde(default, skip_serializing_if = "Option::is_none")]
9924    pub offset: Option<i64>,
9925    #[serde(default, skip_serializing_if = "Option::is_none")]
9926    pub has_more: Option<bool>,
9927}
9928
9929/// `ListAdminBlogPostsResponse` model.
9930#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9931pub struct ListAdminBlogPostsResponse {
9932    pub posts: Vec<BlogPost>,
9933}
9934
9935/// `ListAdminDomainHealthResponse` model.
9936#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9937pub struct ListAdminDomainHealthResponse {
9938    pub count: i64,
9939    pub rows: Vec<ListAdminDomainHealthResponseRow>,
9940}
9941
9942/// `ListAdminDomainHealthResponseRow` model.
9943#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9944pub struct ListAdminDomainHealthResponseRow {
9945    pub tenant_id: String,
9946    #[serde(default, skip_serializing_if = "Option::is_none")]
9947    pub tenant_name: Option<String>,
9948    #[serde(default, skip_serializing_if = "Option::is_none")]
9949    pub tenant_slug: Option<String>,
9950    #[serde(default, skip_serializing_if = "Option::is_none")]
9951    pub plan: Option<String>,
9952    pub domain: String,
9953    pub dns: DomainDnsLifecycle,
9954    pub cert: DomainCertLifecycle,
9955    pub created_at: String,
9956    #[serde(default, skip_serializing_if = "Option::is_none")]
9957    pub updated_at: Option<String>,
9958}
9959
9960/// `ListAdminIntegrationOAuthProvidersResponse` model.
9961#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9962pub struct ListAdminIntegrationOAuthProvidersResponse {
9963    pub providers: Vec<ListAdminIntegrationOAuthProvidersResponseProvider>,
9964}
9965
9966/// `ListAdminIntegrationOAuthProvidersResponseProvider` model.
9967#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9968pub struct ListAdminIntegrationOAuthProvidersResponseProvider {
9969    pub id: String,
9970    /// A record exists for this provider.
9971    pub configured: bool,
9972    /// Enabled AND holding both a client id and a secret — a provider switched on with incomplete
9973    /// credentials reports false here, so this is readiness rather than the stored flag.
9974    pub enabled: bool,
9975}
9976
9977/// `ListAdminProvidersResponse` model.
9978#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9979pub struct ListAdminProvidersResponse {
9980    #[serde(default, skip_serializing_if = "Option::is_none")]
9981    pub providers: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
9982}
9983
9984/// `ListAgentBookmarksResponse` model.
9985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9986pub struct ListAgentBookmarksResponse {
9987    pub items: Vec<AgentBookmark>,
9988}
9989
9990/// `ListAgentIntegrationsResponse` model.
9991#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9992pub struct ListAgentIntegrationsResponse {
9993    #[serde(default, skip_serializing_if = "Option::is_none")]
9994    pub integrations: Option<Vec<AgentIntegration>>,
9995    #[serde(default, skip_serializing_if = "Option::is_none")]
9996    pub total: Option<i64>,
9997}
9998
9999/// `ListAgentMailResponse` model.
10000#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10001pub struct ListAgentMailResponse {
10002    pub messages: Vec<AgentMessage>,
10003    /// Agent id → name, resolved for display. An agent that no longer exists is simply absent.
10004    pub agent_names: serde_json::Map<String, serde_json::Value>,
10005    pub total_scanned: i64,
10006}
10007
10008/// `ListAgentScorersResponse` model.
10009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10010pub struct ListAgentScorersResponse {
10011    #[serde(default, skip_serializing_if = "Option::is_none")]
10012    pub scorers: Option<Vec<AgentScorer>>,
10013}
10014
10015/// `ListAgentsResponse` model.
10016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10017pub struct ListAgentsResponse {
10018    pub items: Vec<Agent>,
10019    /// Opaque cursor for the next page; null when no more pages.
10020    #[serde(default)]
10021    pub cursor: Option<String>,
10022    pub has_more: bool,
10023}
10024
10025/// `ListAgentVersionsResponse` model.
10026#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10027pub struct ListAgentVersionsResponse {
10028    pub items: Vec<AgentVersion>,
10029    /// Legacy alias for `items`. Will be removed in API v1.x.
10030    #[serde(default, skip_serializing_if = "Option::is_none")]
10031    pub versions: Option<Vec<AgentVersion>>,
10032    pub total: i64,
10033}
10034
10035/// `ListAgentWorkspaceFilesResponse` model.
10036#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10037pub struct ListAgentWorkspaceFilesResponse {
10038    pub workspace_id: String,
10039    pub path: String,
10040    pub directories: Vec<String>,
10041    pub files: Vec<WorkspaceFile>,
10042}
10043
10044/// `ListAllContentReportsResponse` model.
10045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10046pub struct ListAllContentReportsResponse {
10047    pub items: Vec<ContentReport>,
10048    #[serde(default)]
10049    pub cursor: Option<String>,
10050    pub has_more: bool,
10051}
10052
10053/// `ListAmbassadorRequestsResponse` model.
10054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10055pub struct ListAmbassadorRequestsResponse {
10056    pub requests: Vec<AmbassadorRequest>,
10057}
10058
10059/// `ListAmbassadorVetoesResponse` model.
10060#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10061pub struct ListAmbassadorVetoesResponse {
10062    #[serde(default, skip_serializing_if = "Option::is_none")]
10063    pub vetoes: Option<Vec<VetoRecord>>,
10064}
10065
10066/// `ListAndroidTestersResponse` model.
10067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10068pub struct ListAndroidTestersResponse {
10069    pub testers: Vec<AndroidTester>,
10070    pub count: i64,
10071    pub not_yet_emailed: i64,
10072    pub given_up: i64,
10073    #[serde(default)]
10074    pub cursor: Option<String>,
10075}
10076
10077/// `ListAPIKeysResponse` model.
10078#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10079pub struct ListAPIKeysResponse {
10080    pub keys: Vec<APIKeySummary>,
10081    pub total: i64,
10082}
10083
10084/// `ListArbiterCasesResponse` model.
10085#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10086pub struct ListArbiterCasesResponse {
10087    pub cases: Vec<ArbiterCase>,
10088}
10089
10090/// `ListAuthProvidersResponse` model.
10091#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10092pub struct ListAuthProvidersResponse {
10093    pub items: Vec<ListAuthProvidersResponseItem>,
10094    /// Legacy alias for `items`.
10095    #[serde(default, skip_serializing_if = "Option::is_none")]
10096    pub providers: Option<Vec<AuthProvider>>,
10097}
10098
10099/// `ListAuthProvidersResponseItem` model.
10100#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10101pub struct ListAuthProvidersResponseItem {
10102    pub id: ListAuthProvidersResponseItemId,
10103    pub linked: bool,
10104    #[serde(default, skip_serializing_if = "Option::is_none")]
10105    pub sub: Option<String>,
10106    #[serde(default, skip_serializing_if = "Option::is_none")]
10107    pub email: Option<String>,
10108    #[serde(default, skip_serializing_if = "Option::is_none")]
10109    pub linked_at: Option<String>,
10110}
10111
10112/// `ListAuthProvidersResponseItemId` enumeration.
10113#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10114pub enum ListAuthProvidersResponseItemId {
10115    #[default]
10116    #[serde(rename = "otp")]
10117    Otp,
10118    #[serde(rename = "github")]
10119    Github,
10120    #[serde(rename = "google")]
10121    Google,
10122    #[serde(rename = "apple")]
10123    Apple,
10124    /// A value the API introduced after this SDK was generated.
10125    #[serde(untagged)]
10126    Other(String),
10127}
10128
10129impl ListAuthProvidersResponseItemId {
10130    /// The value as it appears on the wire.
10131    pub fn as_str(&self) -> &str {
10132        match self {
10133            Self::Otp => "otp",
10134            Self::Github => "github",
10135            Self::Google => "google",
10136            Self::Apple => "apple",
10137            Self::Other(value) => value.as_str(),
10138        }
10139    }
10140}
10141
10142impl std::fmt::Display for ListAuthProvidersResponseItemId {
10143    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10144        f.write_str(self.as_str())
10145    }
10146}
10147
10148impl From<&str> for ListAuthProvidersResponseItemId {
10149    fn from(value: &str) -> Self {
10150        match value {
10151            "otp" => Self::Otp,
10152            "github" => Self::Github,
10153            "google" => Self::Google,
10154            "apple" => Self::Apple,
10155            other => Self::Other(other.to_string()),
10156        }
10157    }
10158}
10159
10160/// `ListBallotsResponse` model.
10161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10162pub struct ListBallotsResponse {
10163    #[serde(default, skip_serializing_if = "Option::is_none")]
10164    pub ballots: Option<Vec<Ballot>>,
10165}
10166
10167/// `ListBillingPlansResponse` model.
10168#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10169pub struct ListBillingPlansResponse {
10170    #[serde(default, skip_serializing_if = "Option::is_none")]
10171    pub plans: Option<Vec<ListBillingPlansResponsePlan>>,
10172}
10173
10174/// `ListBillingPlansResponsePlan` model.
10175#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10176pub struct ListBillingPlansResponsePlan {
10177    #[serde(default, skip_serializing_if = "Option::is_none")]
10178    pub id: Option<String>,
10179    #[serde(default, skip_serializing_if = "Option::is_none")]
10180    pub name: Option<String>,
10181    #[serde(default, skip_serializing_if = "Option::is_none")]
10182    pub limits: Option<serde_json::Map<String, serde_json::Value>>,
10183    #[serde(default, skip_serializing_if = "Option::is_none")]
10184    pub current: Option<bool>,
10185    #[serde(default, skip_serializing_if = "Option::is_none")]
10186    pub checkout_available: Option<bool>,
10187    #[serde(default, skip_serializing_if = "Option::is_none")]
10188    pub price_amount_cents: Option<i64>,
10189    #[serde(default, skip_serializing_if = "Option::is_none")]
10190    pub price_currency: Option<String>,
10191}
10192
10193/// `ListBillingSpecPackagesResponse` model.
10194#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10195pub struct ListBillingSpecPackagesResponse {
10196    pub packages: Vec<ListBillingSpecPackagesResponsePackage>,
10197}
10198
10199/// `ListBillingSpecPackagesResponsePackage` model.
10200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10201pub struct ListBillingSpecPackagesResponsePackage {
10202    pub package_id: String,
10203    pub name: String,
10204    pub description: String,
10205    pub category: String,
10206    pub included_specs: Vec<String>,
10207    pub included_in_plans: Vec<String>,
10208    #[serde(default, skip_serializing_if = "Option::is_none")]
10209    pub program: Option<SpecPackageProgram>,
10210    #[serde(default, skip_serializing_if = "Option::is_none")]
10211    pub price_amount_cents: Option<i64>,
10212    #[serde(default, skip_serializing_if = "Option::is_none")]
10213    pub price_currency: Option<String>,
10214    /// A Stripe price is wired. False means checkout will refuse with 400.
10215    pub checkout_available: bool,
10216    pub entitlement: ListBillingSpecPackagesResponsePackageEntitlement,
10217}
10218
10219/// `ListBillingSpecPackagesResponsePackageEntitlement` enumeration.
10220#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10221pub enum ListBillingSpecPackagesResponsePackageEntitlement {
10222    #[default]
10223    #[serde(rename = "plan_included")]
10224    PlanIncluded,
10225    #[serde(rename = "purchased")]
10226    Purchased,
10227    #[serde(rename = "available")]
10228    Available,
10229    /// A value the API introduced after this SDK was generated.
10230    #[serde(untagged)]
10231    Other(String),
10232}
10233
10234impl ListBillingSpecPackagesResponsePackageEntitlement {
10235    /// The value as it appears on the wire.
10236    pub fn as_str(&self) -> &str {
10237        match self {
10238            Self::PlanIncluded => "plan_included",
10239            Self::Purchased => "purchased",
10240            Self::Available => "available",
10241            Self::Other(value) => value.as_str(),
10242        }
10243    }
10244}
10245
10246impl std::fmt::Display for ListBillingSpecPackagesResponsePackageEntitlement {
10247    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10248        f.write_str(self.as_str())
10249    }
10250}
10251
10252impl From<&str> for ListBillingSpecPackagesResponsePackageEntitlement {
10253    fn from(value: &str) -> Self {
10254        match value {
10255            "plan_included" => Self::PlanIncluded,
10256            "purchased" => Self::Purchased,
10257            "available" => Self::Available,
10258            other => Self::Other(other.to_string()),
10259        }
10260    }
10261}
10262
10263/// `ListBuilderRequestsResponse` model.
10264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10265pub struct ListBuilderRequestsResponse {
10266    pub requests: Vec<DesignRequest>,
10267}
10268
10269/// `ListCompaniesResponse` model.
10270#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10271pub struct ListCompaniesResponse {
10272    pub items: Vec<Company>,
10273    /// Legacy alias for `items`. Will be removed in API v1.x.
10274    #[serde(default, skip_serializing_if = "Option::is_none")]
10275    pub companies: Option<Vec<Company>>,
10276    #[serde(default, skip_serializing_if = "Option::is_none")]
10277    pub total: Option<i64>,
10278}
10279
10280/// `ListContentReportsResponse` model.
10281#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10282pub struct ListContentReportsResponse {
10283    pub items: Vec<ContentReport>,
10284    #[serde(default)]
10285    pub cursor: Option<String>,
10286    pub has_more: bool,
10287}
10288
10289/// `ListCustomPlansResponse` model.
10290#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10291pub struct ListCustomPlansResponse {
10292    pub plans: Vec<CustomPlan>,
10293    pub count: i64,
10294}
10295
10296/// `ListDataExplorerKeysResponse` model.
10297#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10298pub struct ListDataExplorerKeysResponse {
10299    #[serde(default, skip_serializing_if = "Option::is_none")]
10300    pub keys: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
10301    /// Opaque cursor for the next page; null on the last page.
10302    #[serde(default, skip_serializing_if = "Option::is_none")]
10303    pub cursor: Option<String>,
10304    #[serde(default, skip_serializing_if = "Option::is_none")]
10305    pub has_more: Option<bool>,
10306}
10307
10308/// `ListDataExplorerNamespacesResponse` model.
10309#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10310pub struct ListDataExplorerNamespacesResponse {
10311    #[serde(default, skip_serializing_if = "Option::is_none")]
10312    pub namespaces: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
10313}
10314
10315/// `ListDatasetsResponse` model.
10316#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10317pub struct ListDatasetsResponse {
10318    pub datasets: Vec<serde_json::Map<String, serde_json::Value>>,
10319    pub total: i64,
10320}
10321
10322/// `ListEvalRunsResponse` model.
10323#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10324pub struct ListEvalRunsResponse {
10325    pub eval_runs: Vec<serde_json::Map<String, serde_json::Value>>,
10326    pub total: i64,
10327}
10328
10329/// `ListFeaturedSpecsResponse` model.
10330#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10331pub struct ListFeaturedSpecsResponse {
10332    pub featured: Vec<String>,
10333}
10334
10335/// `ListFeedbackResponse` model.
10336#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10337pub struct ListFeedbackResponse {
10338    pub reports: Vec<ErrorReport>,
10339    pub count: i64,
10340    pub new_count: i64,
10341}
10342
10343/// `ListFilesResponse` model.
10344#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10345pub struct ListFilesResponse {
10346    #[serde(default, skip_serializing_if = "Option::is_none")]
10347    pub items: Option<Vec<FileEntry>>,
10348    /// Opaque cursor for the next page; null when no more pages.
10349    #[serde(default, skip_serializing_if = "Option::is_none")]
10350    pub cursor: Option<String>,
10351    #[serde(default, skip_serializing_if = "Option::is_none")]
10352    pub has_more: Option<bool>,
10353}
10354
10355/// `ListGoalsResponse` model.
10356#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10357pub struct ListGoalsResponse {
10358    #[serde(default, skip_serializing_if = "Option::is_none")]
10359    pub goals: Option<Vec<Goal>>,
10360}
10361
10362/// `ListGuardrailsResponse` model.
10363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10364pub struct ListGuardrailsResponse {
10365    pub guardrails: Vec<Guardrail>,
10366    #[serde(default, skip_serializing_if = "Option::is_none")]
10367    pub total: Option<i64>,
10368}
10369
10370/// `ListIntegrationsCatalogResponse` model.
10371#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10372pub struct ListIntegrationsCatalogResponse {
10373    #[serde(default, skip_serializing_if = "Option::is_none")]
10374    pub connectors: Option<Vec<IntegrationCatalogItem>>,
10375}
10376
10377/// `ListIntegrationsResponse` model.
10378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10379pub struct ListIntegrationsResponse {
10380    pub integrations: Vec<Integration>,
10381    #[serde(default, skip_serializing_if = "Option::is_none")]
10382    pub total: Option<i64>,
10383}
10384
10385/// `ListInvitesResponse` model.
10386#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10387pub struct ListInvitesResponse {
10388    #[serde(default, skip_serializing_if = "Option::is_none")]
10389    pub items: Option<Vec<Invite>>,
10390    /// Legacy alias for `items`. Will be removed in API v1.x.
10391    #[serde(default, skip_serializing_if = "Option::is_none")]
10392    pub invites: Option<Vec<Invite>>,
10393    #[serde(default, skip_serializing_if = "Option::is_none")]
10394    pub total: Option<i64>,
10395}
10396
10397/// `ListKbDocumentsResponse` model.
10398#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10399pub struct ListKbDocumentsResponse {
10400    #[serde(default, skip_serializing_if = "Option::is_none")]
10401    pub documents: Option<Vec<KnowledgeBaseDocument>>,
10402    #[serde(default, skip_serializing_if = "Option::is_none")]
10403    pub total: Option<i64>,
10404}
10405
10406/// `ListKnowledgeBasesResponse` model.
10407#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10408pub struct ListKnowledgeBasesResponse {
10409    pub items: Vec<KnowledgeBase>,
10410    /// Legacy alias for `items`. Will be removed in API v1.x.
10411    #[serde(default, skip_serializing_if = "Option::is_none")]
10412    pub knowledge_bases: Option<Vec<KnowledgeBase>>,
10413    pub total: i64,
10414}
10415
10416/// `ListLLMCredentialsProvidersResponse` model.
10417#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10418pub struct ListLLMCredentialsProvidersResponse {
10419    #[serde(default, skip_serializing_if = "Option::is_none")]
10420    pub providers: Option<Vec<ListLLMCredentialsProvidersResponseProvider>>,
10421}
10422
10423/// `ListLLMCredentialsProvidersResponseProvider` model.
10424#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10425pub struct ListLLMCredentialsProvidersResponseProvider {
10426    #[serde(default, skip_serializing_if = "Option::is_none")]
10427    pub id: Option<String>,
10428    /// Display name for UI (e.g. OpenAI, Stels)
10429    #[serde(default, skip_serializing_if = "Option::is_none")]
10430    pub name: Option<String>,
10431    #[serde(default, skip_serializing_if = "Option::is_none")]
10432    pub configured: Option<bool>,
10433    #[serde(default, skip_serializing_if = "Option::is_none")]
10434    pub local: Option<bool>,
10435    #[serde(default, skip_serializing_if = "Option::is_none")]
10436    pub default_endpoint: Option<String>,
10437}
10438
10439/// `ListLLMModelsResponse` model.
10440#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10441pub struct ListLLMModelsResponse {
10442    #[serde(default, skip_serializing_if = "Option::is_none")]
10443    pub models: Option<Vec<LLMModel>>,
10444}
10445
10446/// `ListMCPServersResponse` model.
10447#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10448pub struct ListMCPServersResponse {
10449    pub servers: Vec<MCPServer>,
10450}
10451
10452/// `ListMemoriesResponse` model.
10453#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10454pub struct ListMemoriesResponse {
10455    pub memories: Vec<MemoryEntry>,
10456    pub total: i64,
10457}
10458
10459/// `ListMeSessionsResponse` model.
10460#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10461pub struct ListMeSessionsResponse {
10462    pub items: Vec<ActiveSession>,
10463    /// Legacy alias for `items`, byte-identical to it on the wire. It was described as a formless
10464    /// array while `items` carried the full shape, so a generated client saw one usable list and
10465    /// one bag of JSON for the same data.
10466    #[serde(default, skip_serializing_if = "Option::is_none")]
10467    pub sessions: Option<Vec<ActiveSession>>,
10468    pub total: i64,
10469}
10470
10471/// `ListMissionObjectivesResponse` model.
10472#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10473pub struct ListMissionObjectivesResponse {
10474    pub items: Vec<Objective>,
10475    pub total: i64,
10476}
10477
10478/// `ListMissionsResponse` model.
10479#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10480pub struct ListMissionsResponse {
10481    pub items: Vec<Mission>,
10482    /// Length of `items` in this response, not a tenant-wide count.
10483    pub total: i64,
10484}
10485
10486/// `ListModelsResponse` model.
10487#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10488pub struct ListModelsResponse {
10489    /// Always `list`.
10490    pub object: String,
10491    pub data: Vec<ListModelsResponseDataItem>,
10492}
10493
10494/// `ListModelsResponseDataItem` model.
10495#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10496pub struct ListModelsResponseDataItem {
10497    pub id: String,
10498    /// Always `model`.
10499    pub object: String,
10500    #[serde(default, skip_serializing_if = "Option::is_none")]
10501    pub created: Option<i64>,
10502    #[serde(default, skip_serializing_if = "Option::is_none")]
10503    pub owned_by: Option<String>,
10504}
10505
10506/// `ListMyTenantsResponse` model.
10507#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10508pub struct ListMyTenantsResponse {
10509    pub user_id: String,
10510    pub email: String,
10511    pub memberships: Vec<ListMyTenantsResponseMembership>,
10512    pub pending_invites: Vec<ListMyTenantsResponsePendingInvite>,
10513}
10514
10515/// `ListMyTenantsResponseMembership` model.
10516#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10517pub struct ListMyTenantsResponseMembership {
10518    pub tenant_id: String,
10519    pub user_id: String,
10520    pub name: String,
10521    #[serde(default, skip_serializing_if = "Option::is_none")]
10522    pub slug: Option<String>,
10523    #[serde(default, skip_serializing_if = "Option::is_none")]
10524    pub plan: Option<String>,
10525    #[serde(default, skip_serializing_if = "Option::is_none")]
10526    pub logo_url: Option<String>,
10527    pub role: String,
10528    pub is_sole_owner: bool,
10529    pub member_count: i64,
10530    #[serde(default, skip_serializing_if = "Option::is_none")]
10531    pub joined_at: Option<String>,
10532    /// Whether THIS credential can act in this tenant — its own tenant, or one an `X-Active-Tenant`
10533    /// override would be accepted for. The list is the PERSON's memberships and a credential may
10534    /// reach fewer of them: an api-key whose user has no record in the key's own tenant is refused
10535    /// everywhere but home. Without this field a client had to guess by matching `/me`.tenant.slug
10536    /// against the list. Describes the header only — `POST /me/tenants/switch` refuses every
10537    /// api-key regardless.
10538    pub accessible: bool,
10539}
10540
10541/// `ListMyTenantsResponsePendingInvite` model.
10542#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10543pub struct ListMyTenantsResponsePendingInvite {
10544    pub invite_id: String,
10545    pub tenant_id: String,
10546    pub tenant_name: String,
10547    pub role: String,
10548    pub expires_at: String,
10549    #[serde(default, skip_serializing_if = "Option::is_none")]
10550    pub invited_by_name: Option<String>,
10551    #[serde(default, skip_serializing_if = "Option::is_none")]
10552    pub secret: Option<String>,
10553}
10554
10555/// `ListNotificationsResponse` model.
10556#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10557pub struct ListNotificationsResponse {
10558    pub notifications: Vec<Notification>,
10559}
10560
10561/// `ListNotificationTargetsResponse` model.
10562#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10563pub struct ListNotificationTargetsResponse {
10564    pub targets: Vec<NotificationTarget>,
10565}
10566
10567/// `ListPlaygroundTemplatesResponse` model.
10568#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10569pub struct ListPlaygroundTemplatesResponse {
10570    pub templates: Vec<PlaygroundTemplate>,
10571}
10572
10573/// `ListProgramsResponse` model.
10574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10575pub struct ListProgramsResponse {
10576    pub programs: Vec<Program>,
10577}
10578
10579/// `ListProjectsResponse` model.
10580#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10581pub struct ListProjectsResponse {
10582    pub items: Vec<Project>,
10583    pub total: i64,
10584    pub archived_count: i64,
10585}
10586
10587/// `ListPromoCodesResponse` model.
10588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10589pub struct ListPromoCodesResponse {
10590    pub codes: Vec<PromoCode>,
10591    pub count: i64,
10592}
10593
10594/// `ListPromoRewardsResponse` model.
10595#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10596pub struct ListPromoRewardsResponse {
10597    pub rewards: Vec<ListPromoRewardsResponseReward>,
10598    pub count: i64,
10599}
10600
10601/// `ListPromoRewardsResponseReward` model.
10602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10603pub struct ListPromoRewardsResponseReward {
10604    pub code: String,
10605    pub owner_tenant_id: String,
10606    pub subscriber_tenant_id: String,
10607    pub tokens: i64,
10608    pub plan_id: String,
10609    pub granted_at: String,
10610}
10611
10612/// `ListProviderModelsResponse` model.
10613#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10614pub struct ListProviderModelsResponse {
10615    /// Registered provider id (admin → Providers).
10616    pub provider: String,
10617    /// Base URL for this provider's API (e.g. <https://api.openai.com/v1>). Empty for custom.
10618    pub endpoint_url: String,
10619    pub models: Vec<ListProviderModelsResponseModel>,
10620    /// Present when models could not be fetched (e.g. provider not configured).
10621    #[serde(default, skip_serializing_if = "Option::is_none")]
10622    pub error: Option<String>,
10623}
10624
10625/// `ListProviderModelsResponseModel` model.
10626#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10627pub struct ListProviderModelsResponseModel {
10628    #[serde(default, skip_serializing_if = "Option::is_none")]
10629    pub id: Option<String>,
10630    #[serde(default, skip_serializing_if = "Option::is_none")]
10631    pub name: Option<String>,
10632    #[serde(default, skip_serializing_if = "Option::is_none")]
10633    pub created: Option<i64>,
10634    #[serde(default, skip_serializing_if = "Option::is_none")]
10635    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
10636}
10637
10638/// `ListProvidersResponse` model.
10639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10640pub struct ListProvidersResponse {
10641    pub providers: Vec<LLMProvider>,
10642}
10643
10644/// `ListPublicBlogPostsResponse` model.
10645#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10646pub struct ListPublicBlogPostsResponse {
10647    pub blog: ListPublicBlogPostsResponseBlog,
10648    pub posts: Vec<PublicBlogPostSummary>,
10649    pub all_tags: Vec<String>,
10650    pub total: i64,
10651    pub page: i64,
10652    pub limit: i64,
10653    pub total_pages: i64,
10654}
10655
10656/// `ListPublicBlogPostsResponseBlog` model.
10657#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10658pub struct ListPublicBlogPostsResponseBlog {
10659    pub title: String,
10660    pub description: String,
10661}
10662
10663/// `ListPublicIntegrationsResponse` model.
10664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10665pub struct ListPublicIntegrationsResponse {
10666    pub connectors: Vec<ListPublicIntegrationsResponseConnector>,
10667    pub total: i64,
10668    /// Counted here rather than by the caller: a total a page derives is a total a page can get
10669    /// wrong, which is the defect this endpoint replaces.
10670    pub oauth_count: i64,
10671    pub api_key_count: i64,
10672}
10673
10674/// `ListPublicIntegrationsResponseConnector` model.
10675#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10676pub struct ListPublicIntegrationsResponseConnector {
10677    pub id: String,
10678    pub name: String,
10679    #[serde(default, skip_serializing_if = "Option::is_none")]
10680    pub description: Option<String>,
10681    #[serde(default, skip_serializing_if = "Option::is_none")]
10682    pub icon: Option<String>,
10683    pub auth_type: ListPublicIntegrationsResponseConnectorAuthType,
10684}
10685
10686/// `ListPublicIntegrationsResponseConnectorAuthType` enumeration.
10687#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10688pub enum ListPublicIntegrationsResponseConnectorAuthType {
10689    #[default]
10690    #[serde(rename = "oauth2")]
10691    Oauth2,
10692    #[serde(rename = "api_key")]
10693    APIKey,
10694    /// A value the API introduced after this SDK was generated.
10695    #[serde(untagged)]
10696    Other(String),
10697}
10698
10699impl ListPublicIntegrationsResponseConnectorAuthType {
10700    /// The value as it appears on the wire.
10701    pub fn as_str(&self) -> &str {
10702        match self {
10703            Self::Oauth2 => "oauth2",
10704            Self::APIKey => "api_key",
10705            Self::Other(value) => value.as_str(),
10706        }
10707    }
10708}
10709
10710impl std::fmt::Display for ListPublicIntegrationsResponseConnectorAuthType {
10711    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10712        f.write_str(self.as_str())
10713    }
10714}
10715
10716impl From<&str> for ListPublicIntegrationsResponseConnectorAuthType {
10717    fn from(value: &str) -> Self {
10718        match value {
10719            "oauth2" => Self::Oauth2,
10720            "api_key" => Self::APIKey,
10721            other => Self::Other(other.to_string()),
10722        }
10723    }
10724}
10725
10726/// `ListPublicPlansResponse` model.
10727#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10728pub struct ListPublicPlansResponse {
10729    #[serde(default, skip_serializing_if = "Option::is_none")]
10730    pub plans: Option<Vec<PublicPlan>>,
10731}
10732
10733/// `ListPublicStatesResponse` model.
10734#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10735pub struct ListPublicStatesResponse {
10736    #[serde(default, skip_serializing_if = "Option::is_none")]
10737    pub states: Option<Vec<PublicState>>,
10738}
10739
10740/// `ListPublicTenantsResponse` model.
10741#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10742pub struct ListPublicTenantsResponse {
10743    #[serde(default, skip_serializing_if = "Option::is_none")]
10744    pub items: Option<Vec<PublicTenant>>,
10745    /// Opaque cursor for the next page; null when no more pages.
10746    #[serde(default, skip_serializing_if = "Option::is_none")]
10747    pub cursor: Option<String>,
10748    #[serde(default, skip_serializing_if = "Option::is_none")]
10749    pub has_more: Option<bool>,
10750    #[serde(default, skip_serializing_if = "Option::is_none")]
10751    pub total: Option<i64>,
10752}
10753
10754/// `ListRunArtifactsResponse` model.
10755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10756pub struct ListRunArtifactsResponse {
10757    pub run_id: String,
10758    pub artifacts: Vec<Artifact>,
10759    pub total: i64,
10760}
10761
10762/// `ListRunCheckpointsResponse` model.
10763#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10764pub struct ListRunCheckpointsResponse {
10765    #[serde(default, skip_serializing_if = "Option::is_none")]
10766    pub checkpoints: Option<Vec<RunCheckpoint>>,
10767}
10768
10769/// `ListRunsOrder` enumeration.
10770#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10771pub enum ListRunsOrder {
10772    #[default]
10773    #[serde(rename = "asc")]
10774    Asc,
10775    #[serde(rename = "desc")]
10776    Desc,
10777    /// A value the API introduced after this SDK was generated.
10778    #[serde(untagged)]
10779    Other(String),
10780}
10781
10782impl ListRunsOrder {
10783    /// The value as it appears on the wire.
10784    pub fn as_str(&self) -> &str {
10785        match self {
10786            Self::Asc => "asc",
10787            Self::Desc => "desc",
10788            Self::Other(value) => value.as_str(),
10789        }
10790    }
10791}
10792
10793impl std::fmt::Display for ListRunsOrder {
10794    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10795        f.write_str(self.as_str())
10796    }
10797}
10798
10799impl From<&str> for ListRunsOrder {
10800    fn from(value: &str) -> Self {
10801        match value {
10802            "asc" => Self::Asc,
10803            "desc" => Self::Desc,
10804            other => Self::Other(other.to_string()),
10805        }
10806    }
10807}
10808
10809/// `ListRunsResponse` model.
10810#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10811pub struct ListRunsResponse {
10812    pub items: Vec<Run>,
10813    /// Opaque cursor for the next page; null on the last page.
10814    #[serde(default, skip_serializing_if = "Option::is_none")]
10815    pub cursor: Option<String>,
10816    pub has_more: bool,
10817}
10818
10819/// `ListSchedulesResponse` model.
10820#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10821pub struct ListSchedulesResponse {
10822    pub schedules: Vec<ScheduleSummary>,
10823}
10824
10825/// `ListSessionAnnotationsResponse` model.
10826#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10827pub struct ListSessionAnnotationsResponse {
10828    #[serde(default, skip_serializing_if = "Option::is_none")]
10829    pub items: Option<Vec<ListSessionAnnotationsResponseItem>>,
10830}
10831
10832/// `ListSessionAnnotationsResponseItem` model.
10833#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10834pub struct ListSessionAnnotationsResponseItem {
10835    #[serde(default, skip_serializing_if = "Option::is_none")]
10836    pub id: Option<String>,
10837    #[serde(default, skip_serializing_if = "Option::is_none")]
10838    pub message_id: Option<String>,
10839    #[serde(default, skip_serializing_if = "Option::is_none")]
10840    pub content: Option<String>,
10841    #[serde(default, skip_serializing_if = "Option::is_none")]
10842    pub author: Option<String>,
10843    #[serde(default, skip_serializing_if = "Option::is_none")]
10844    pub created_at: Option<String>,
10845    #[serde(default, skip_serializing_if = "Option::is_none")]
10846    pub resolved: Option<bool>,
10847}
10848
10849/// `ListSessionArtifactsResponse` model.
10850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10851pub struct ListSessionArtifactsResponse {
10852    #[serde(default, skip_serializing_if = "Option::is_none")]
10853    pub artifacts: Option<Vec<Artifact>>,
10854}
10855
10856/// `ListSessionBranchesResponse` model.
10857#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10858pub struct ListSessionBranchesResponse {
10859    pub session_id: String,
10860    pub branches: Vec<SessionBranch>,
10861    #[serde(default, skip_serializing_if = "Option::is_none")]
10862    pub active_branch: Option<String>,
10863    pub total: i64,
10864}
10865
10866/// `ListSessionsResponse` model.
10867#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10868pub struct ListSessionsResponse {
10869    pub items: Vec<ListSessionsResponseItem>,
10870    #[serde(default)]
10871    pub cursor: Option<String>,
10872    pub has_more: bool,
10873}
10874
10875/// `ListSessionsResponseItem` model.
10876#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10877pub struct ListSessionsResponseItem {
10878    #[serde(default, skip_serializing_if = "Option::is_none")]
10879    pub created_by: Option<String>,
10880    pub session_id: String,
10881    pub tenant_id: String,
10882    pub agent_id: String,
10883    pub status: SessionStatus,
10884    #[serde(default, skip_serializing_if = "Option::is_none")]
10885    pub conversation_history: Option<Vec<ConversationEntry>>,
10886    #[serde(default, skip_serializing_if = "Option::is_none")]
10887    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
10888    #[serde(default, skip_serializing_if = "Option::is_none")]
10889    pub runs: Option<Vec<String>>,
10890    #[serde(default, skip_serializing_if = "Option::is_none")]
10891    pub created_at: Option<String>,
10892    #[serde(default, skip_serializing_if = "Option::is_none")]
10893    pub updated_at: Option<String>,
10894    #[serde(default, skip_serializing_if = "Option::is_none")]
10895    pub expires_at: Option<String>,
10896    /// Team ID if session belongs to a team
10897    #[serde(default, skip_serializing_if = "Option::is_none")]
10898    pub team_id: Option<String>,
10899    /// Session branches for conversation forking
10900    #[serde(default, skip_serializing_if = "Option::is_none")]
10901    pub branches: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
10902    /// Currently active branch ID
10903    #[serde(default, skip_serializing_if = "Option::is_none")]
10904    pub active_branch: Option<String>,
10905    /// How to handle concurrent runs in this session
10906    #[serde(default, skip_serializing_if = "Option::is_none")]
10907    pub queue_mode: Option<SessionQueueMode>,
10908    /// Per-conversation model override (in-chat model switcher). When set, runs in this session
10909    /// resolve their LLM from this config instead of the agent's default. Absent → agent default.
10910    #[serde(default, skip_serializing_if = "Option::is_none")]
10911    pub model_override: Option<ListSessionsResponseItemModelOverride>,
10912    #[serde(default, skip_serializing_if = "Option::is_none")]
10913    pub agent_name: Option<String>,
10914    #[serde(default, skip_serializing_if = "Option::is_none")]
10915    pub first_user_message: Option<String>,
10916    #[serde(default, skip_serializing_if = "Option::is_none")]
10917    pub last_message: Option<String>,
10918    #[serde(default, skip_serializing_if = "Option::is_none")]
10919    pub message_count: Option<i64>,
10920}
10921
10922/// Per-conversation model override (in-chat model switcher). When set, runs in this session
10923/// resolve their LLM from this config instead of the agent's default. Absent → agent default.
10924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10925pub struct ListSessionsResponseItemModelOverride {
10926    pub provider: String,
10927    pub model_ref: String,
10928    #[serde(default, skip_serializing_if = "Option::is_none")]
10929    pub endpoint_url: Option<String>,
10930    #[serde(default, skip_serializing_if = "Option::is_none")]
10931    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
10932}
10933
10934/// `ListSessionTodosResponse` model.
10935#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10936pub struct ListSessionTodosResponse {
10937    #[serde(default, skip_serializing_if = "Option::is_none")]
10938    pub items: Option<Vec<Todo>>,
10939    /// Legacy alias for `items`. Will be removed in API v1.x.
10940    #[serde(default, skip_serializing_if = "Option::is_none")]
10941    pub todos: Option<Vec<Todo>>,
10942    #[serde(default, skip_serializing_if = "Option::is_none")]
10943    pub total: Option<i64>,
10944}
10945
10946/// `ListSquadGraphEdgesResponse` model.
10947#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10948pub struct ListSquadGraphEdgesResponse {
10949    #[serde(default, skip_serializing_if = "Option::is_none")]
10950    pub edges: Option<Vec<TeamGraphEdge>>,
10951    #[serde(default, skip_serializing_if = "Option::is_none")]
10952    pub total: Option<i64>,
10953}
10954
10955/// `ListSquadGraphNodesResponse` model.
10956#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10957pub struct ListSquadGraphNodesResponse {
10958    #[serde(default, skip_serializing_if = "Option::is_none")]
10959    pub nodes: Option<Vec<TeamGraphNode>>,
10960    #[serde(default, skip_serializing_if = "Option::is_none")]
10961    pub total: Option<i64>,
10962}
10963
10964/// `ListSquadRunsResponse` model.
10965#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10966pub struct ListSquadRunsResponse {
10967    #[serde(default, skip_serializing_if = "Option::is_none")]
10968    pub team_id: Option<String>,
10969    #[serde(default, skip_serializing_if = "Option::is_none")]
10970    pub runs: Option<Vec<TeamRunSummary>>,
10971    #[serde(default, skip_serializing_if = "Option::is_none")]
10972    pub total: Option<i64>,
10973}
10974
10975/// `ListSquadsResponse` model.
10976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10977pub struct ListSquadsResponse {
10978    pub items: Vec<Team>,
10979    /// Legacy alias for `items`. Will be removed in API v1.x.
10980    #[serde(default, skip_serializing_if = "Option::is_none")]
10981    pub teams: Option<Vec<Team>>,
10982    #[serde(default, skip_serializing_if = "Option::is_none")]
10983    pub total: Option<i64>,
10984}
10985
10986/// `ListSubscriptionsResponse` model.
10987#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10988pub struct ListSubscriptionsResponse {
10989    #[serde(default, skip_serializing_if = "Option::is_none")]
10990    pub subscriptions: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
10991}
10992
10993/// `ListTeamGraphEdgesResponse` model.
10994#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10995pub struct ListTeamGraphEdgesResponse {
10996    #[serde(default, skip_serializing_if = "Option::is_none")]
10997    pub edges: Option<Vec<TeamGraphEdge>>,
10998    #[serde(default, skip_serializing_if = "Option::is_none")]
10999    pub total: Option<i64>,
11000}
11001
11002/// `ListTeamGraphNodesResponse` model.
11003#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11004pub struct ListTeamGraphNodesResponse {
11005    #[serde(default, skip_serializing_if = "Option::is_none")]
11006    pub nodes: Option<Vec<TeamGraphNode>>,
11007    #[serde(default, skip_serializing_if = "Option::is_none")]
11008    pub total: Option<i64>,
11009}
11010
11011/// `ListTeamRunsResponse` model.
11012#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11013pub struct ListTeamRunsResponse {
11014    #[serde(default, skip_serializing_if = "Option::is_none")]
11015    pub team_id: Option<String>,
11016    #[serde(default, skip_serializing_if = "Option::is_none")]
11017    pub runs: Option<Vec<TeamRunSummary>>,
11018    /// Rows in THIS page, not the total across pages.
11019    #[serde(default, skip_serializing_if = "Option::is_none")]
11020    pub total: Option<i64>,
11021    /// Pass back as `cursor` to continue. Absent on the last page.
11022    #[serde(default, skip_serializing_if = "Option::is_none")]
11023    pub cursor: Option<String>,
11024    #[serde(default, skip_serializing_if = "Option::is_none")]
11025    pub has_more: Option<bool>,
11026}
11027
11028/// `ListTeamsResponse` model.
11029#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11030pub struct ListTeamsResponse {
11031    pub items: Vec<Team>,
11032    /// Legacy alias for `items`. Will be removed in API v1.x.
11033    #[serde(default, skip_serializing_if = "Option::is_none")]
11034    pub teams: Option<Vec<Team>>,
11035    #[serde(default, skip_serializing_if = "Option::is_none")]
11036    pub total: Option<i64>,
11037}
11038
11039/// `ListTenantsResponse` model.
11040#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11041pub struct ListTenantsResponse {
11042    #[serde(default, skip_serializing_if = "Option::is_none")]
11043    pub tenants: Option<Vec<Tenant>>,
11044    #[serde(default, skip_serializing_if = "Option::is_none")]
11045    pub total: Option<i64>,
11046}
11047
11048/// `ListTodosResponse` model.
11049#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11050pub struct ListTodosResponse {
11051    #[serde(default, skip_serializing_if = "Option::is_none")]
11052    pub todos: Option<Vec<Todo>>,
11053}
11054
11055/// `ListUsersResponse` model.
11056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11057pub struct ListUsersResponse {
11058    #[serde(default, skip_serializing_if = "Option::is_none")]
11059    pub items: Option<Vec<TenantUser>>,
11060    /// Legacy alias for `items`. Will be removed in API v1.x.
11061    #[serde(default, skip_serializing_if = "Option::is_none")]
11062    pub users: Option<Vec<TenantUser>>,
11063    #[serde(default, skip_serializing_if = "Option::is_none")]
11064    pub total: Option<i64>,
11065}
11066
11067/// `ListVideoProvidersResponse` model.
11068#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11069pub struct ListVideoProvidersResponse {
11070    #[serde(default, skip_serializing_if = "Option::is_none")]
11071    pub providers: Option<Vec<VideoProvider>>,
11072}
11073
11074/// `ListVotingProposalsResponse` model.
11075#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11076pub struct ListVotingProposalsResponse {
11077    #[serde(default, skip_serializing_if = "Option::is_none")]
11078    pub proposals: Option<Vec<VotingProposal>>,
11079}
11080
11081/// `ListWebhookDeliveriesResponse` model.
11082#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11083pub struct ListWebhookDeliveriesResponse {
11084    pub webhook_id: String,
11085    pub deliveries: Vec<serde_json::Map<String, serde_json::Value>>,
11086    pub total: i64,
11087}
11088
11089/// `ListWebhooksResponse` model.
11090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11091pub struct ListWebhooksResponse {
11092    pub webhooks: Vec<WebhookSubscription>,
11093    pub total: i64,
11094}
11095
11096/// `ListWorkspaceFileHistoryResponse` model.
11097#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11098pub struct ListWorkspaceFileHistoryResponse {
11099    /// The `path` as sent, not normalised.
11100    pub path: String,
11101    pub versions: Vec<WorkspaceFileVersion>,
11102    pub total: i64,
11103}
11104
11105/// The listing was documented as a description and nothing else, so a client could not learn
11106/// from the document that `etag` and `updated_at` are served here — the two fields a caller
11107/// needs to tell whether a file changed without downloading it, and the reason a console had to
11108/// diff whole workspaces. The projection is explicit in the handler: a field added to the
11109/// stored record does NOT appear here on its own.
11110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11111pub struct ListWorkspaceFilesResponse {
11112    pub workspace_id: String,
11113    /// The directory listed, empty string for the workspace root.
11114    pub path: String,
11115    pub directories: Vec<String>,
11116    pub files: Vec<ListWorkspaceFilesResponseFile>,
11117}
11118
11119/// `ListWorkspaceFilesResponseFile` model.
11120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11121pub struct ListWorkspaceFilesResponseFile {
11122    pub file_id: String,
11123    pub path: String,
11124    pub filename: String,
11125    pub mime_type: String,
11126    pub size_bytes: i64,
11127    #[serde(default, skip_serializing_if = "Option::is_none")]
11128    pub created_at: Option<String>,
11129    /// When this file was last written. Absent on records written before the field existed.
11130    #[serde(default, skip_serializing_if = "Option::is_none")]
11131    pub updated_at: Option<String>,
11132    /// Opaque version of this file's content. Compare two listings to find what a run changed
11133    /// without reading any bytes, and send it back as `If-Match` on a write to refuse an overwrite
11134    /// of something you have not seen. Absent on records written before the field existed — treat
11135    /// absence as UNKNOWN, not as unchanged.
11136    #[serde(default, skip_serializing_if = "Option::is_none")]
11137    pub etag: Option<String>,
11138}
11139
11140/// `ListWorkspacesResponse` model.
11141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11142pub struct ListWorkspacesResponse {
11143    pub workspaces: Vec<Workspace>,
11144    #[serde(default, skip_serializing_if = "Option::is_none")]
11145    pub total: Option<i64>,
11146}
11147
11148/// `ListWorkspaceTrashResponse` model.
11149#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11150pub struct ListWorkspaceTrashResponse {
11151    #[serde(default, skip_serializing_if = "Option::is_none")]
11152    pub items: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
11153}
11154
11155/// `LLMModel` model.
11156#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11157pub struct LLMModel {
11158    pub display_name: String,
11159    pub id: String,
11160    pub max_context_tokens: i64,
11161    pub max_output_tokens: i64,
11162    pub pricing: serde_json::Map<String, serde_json::Value>,
11163    pub provider: String,
11164    pub supports_json_mode: bool,
11165    pub supports_streaming: bool,
11166    pub supports_tool_calls: bool,
11167    pub supports_vision: bool,
11168    pub tier: String,
11169}
11170
11171/// An LLM provider the platform knows about, and whether a key is configured.
11172#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11173pub struct LLMProvider {
11174    pub id: String,
11175    pub name: String,
11176    #[serde(default, skip_serializing_if = "Option::is_none")]
11177    pub canonical: Option<String>,
11178    pub configured: bool,
11179    #[serde(default, skip_serializing_if = "Option::is_none")]
11180    pub configured_level: Option<String>,
11181    #[serde(default, skip_serializing_if = "Option::is_none")]
11182    pub default_endpoint: Option<String>,
11183    #[serde(default, skip_serializing_if = "Option::is_none")]
11184    pub api_key_env: Option<String>,
11185    #[serde(default, skip_serializing_if = "Option::is_none")]
11186    pub local: Option<bool>,
11187}
11188
11189/// `LLMSynthesizeSpeechRequest` model.
11190#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11191pub struct LLMSynthesizeSpeechRequest {
11192    #[serde(default, skip_serializing_if = "Option::is_none")]
11193    pub model: Option<String>,
11194    pub input: String,
11195    #[serde(default, skip_serializing_if = "Option::is_none")]
11196    pub voice: Option<String>,
11197    /// Passed THROUGH to the configured speech provider unchanged — the platform neither validates
11198    /// nor translates it, so a rejection here is the provider's, not ours, and its message is the
11199    /// provider's too. Deliberately not an enum: the accepted set belongs to whichever provider is
11200    /// configured, and pinning one here would refuse values a future provider accepts. Measured on
11201    /// production 2026-09-01 by the iOS lane against the current provider: `raw`, `wav` and `mp3`
11202    /// work; `pcm_s16le` and `pcm_f32le` answer 400. `raw` streams chunked pcm_f32le/44100/mono
11203    /// with a first byte at roughly 0.4s, which is what progressive playback needs.
11204    #[serde(default, skip_serializing_if = "Option::is_none")]
11205    pub response_format: Option<String>,
11206}
11207
11208/// `LLMTranscribeAudioRequest` model.
11209#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11210pub struct LLMTranscribeAudioRequest {
11211    pub file: FilePart,
11212    #[serde(default, skip_serializing_if = "Option::is_none")]
11213    pub model: Option<String>,
11214    #[serde(default, skip_serializing_if = "Option::is_none")]
11215    pub language: Option<String>,
11216}
11217
11218/// `LLMUsageSummary` model.
11219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11220pub struct LLMUsageSummary {
11221    #[serde(default, skip_serializing_if = "Option::is_none")]
11222    pub billing_period: Option<LLMUsageSummaryBillingPeriod>,
11223    #[serde(default, skip_serializing_if = "Option::is_none")]
11224    pub by_model: Option<Vec<String>>,
11225    #[serde(default, skip_serializing_if = "Option::is_none")]
11226    pub limits: Option<LLMUsageSummaryLimits>,
11227    #[serde(default, skip_serializing_if = "Option::is_none")]
11228    pub plan: Option<String>,
11229    #[serde(default, skip_serializing_if = "Option::is_none")]
11230    pub usage: Option<LLMUsageSummaryUsage>,
11231}
11232
11233/// `LLMUsageSummaryBillingPeriod` model.
11234#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11235pub struct LLMUsageSummaryBillingPeriod {
11236    #[serde(default, skip_serializing_if = "Option::is_none")]
11237    pub end: Option<String>,
11238    #[serde(default, skip_serializing_if = "Option::is_none")]
11239    pub start: Option<String>,
11240}
11241
11242/// `LLMUsageSummaryLimits` model.
11243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11244pub struct LLMUsageSummaryLimits {
11245    #[serde(default, skip_serializing_if = "Option::is_none")]
11246    pub requests_per_day: Option<i64>,
11247    #[serde(default, skip_serializing_if = "Option::is_none")]
11248    pub requests_per_hour: Option<i64>,
11249    #[serde(default, skip_serializing_if = "Option::is_none")]
11250    pub requests_per_minute: Option<i64>,
11251    #[serde(default, skip_serializing_if = "Option::is_none")]
11252    pub tokens_per_month: Option<i64>,
11253}
11254
11255/// `LLMUsageSummaryUsage` model.
11256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11257pub struct LLMUsageSummaryUsage {
11258    #[serde(default, skip_serializing_if = "Option::is_none")]
11259    pub requests_this_hour: Option<i64>,
11260    #[serde(default, skip_serializing_if = "Option::is_none")]
11261    pub requests_this_minute: Option<i64>,
11262    #[serde(default, skip_serializing_if = "Option::is_none")]
11263    pub requests_today: Option<i64>,
11264    #[serde(default, skip_serializing_if = "Option::is_none")]
11265    pub tokens_remaining: Option<i64>,
11266    #[serde(default, skip_serializing_if = "Option::is_none")]
11267    pub tokens_used: Option<i64>,
11268}
11269
11270/// `LocateMyAgentResponse` model.
11271#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11272pub struct LocateMyAgentResponse {
11273    pub tenant_id: String,
11274}
11275
11276/// `LogoutResponse` model.
11277#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11278pub struct LogoutResponse {
11279    pub ok: bool,
11280    #[serde(default, skip_serializing_if = "Option::is_none")]
11281    pub key_id: Option<String>,
11282    #[serde(default, skip_serializing_if = "Option::is_none")]
11283    pub already_revoked: Option<bool>,
11284}
11285
11286/// `MaintenanceState` model.
11287#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11288pub struct MaintenanceState {
11289    pub enabled: bool,
11290    /// Plain text rendered on the blocked page; the API does not render HTML. Absent when no
11291    /// message is set — a message that trims to empty is not stored.
11292    #[serde(default, skip_serializing_if = "Option::is_none")]
11293    pub message: Option<String>,
11294    /// When the most recent toggle happened.
11295    #[serde(default, skip_serializing_if = "Option::is_none")]
11296    pub enabled_at: Option<String>,
11297    /// Empty string for the synthetic default-off state — that state has no author.
11298    #[serde(default, skip_serializing_if = "Option::is_none")]
11299    pub enabled_by_email: Option<String>,
11300}
11301
11302/// Whether the platform is closed for maintenance. Unauthenticated: a client that cannot sign
11303/// in still needs to know why. `message` is plain text and is never rendered as HTML by the
11304/// API.
11305#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11306pub struct MaintenanceStatus {
11307    pub enabled: bool,
11308    /// Absent when no message was set.
11309    #[serde(default, skip_serializing_if = "Option::is_none")]
11310    pub message: Option<String>,
11311}
11312
11313/// `MarkAllNotificationsReadResponse` model.
11314#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11315pub struct MarkAllNotificationsReadResponse {
11316    #[serde(default, skip_serializing_if = "Option::is_none")]
11317    pub marked: Option<i64>,
11318}
11319
11320/// `MarketplaceInvocation` model.
11321#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11322pub struct MarketplaceInvocation {
11323    pub invocation_id: String,
11324    pub caller_tenant_id: String,
11325    pub publisher_tenant_id: String,
11326    pub listing_id: String,
11327    pub agent_id: String,
11328    pub agent_version: String,
11329    pub input: serde_json::Map<String, serde_json::Value>,
11330    pub status: MarketplaceInvocationStatus,
11331    #[serde(default, skip_serializing_if = "Option::is_none")]
11332    pub output: Option<serde_json::Map<String, serde_json::Value>>,
11333    #[serde(default, skip_serializing_if = "Option::is_none")]
11334    pub metrics: Option<serde_json::Map<String, serde_json::Value>>,
11335    /// Set when the run succeeded but the publisher payout failed — not a failed run.
11336    #[serde(default, skip_serializing_if = "Option::is_none")]
11337    pub revenue_error: Option<String>,
11338    pub created_at: String,
11339    #[serde(default, skip_serializing_if = "Option::is_none")]
11340    pub completed_at: Option<String>,
11341}
11342
11343/// `MarketplaceInvocationStatus` enumeration.
11344#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11345pub enum MarketplaceInvocationStatus {
11346    #[default]
11347    #[serde(rename = "pending")]
11348    Pending,
11349    #[serde(rename = "running")]
11350    Running,
11351    #[serde(rename = "completed")]
11352    Completed,
11353    #[serde(rename = "failed")]
11354    Failed,
11355    /// A value the API introduced after this SDK was generated.
11356    #[serde(untagged)]
11357    Other(String),
11358}
11359
11360impl MarketplaceInvocationStatus {
11361    /// The value as it appears on the wire.
11362    pub fn as_str(&self) -> &str {
11363        match self {
11364            Self::Pending => "pending",
11365            Self::Running => "running",
11366            Self::Completed => "completed",
11367            Self::Failed => "failed",
11368            Self::Other(value) => value.as_str(),
11369        }
11370    }
11371}
11372
11373impl std::fmt::Display for MarketplaceInvocationStatus {
11374    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11375        f.write_str(self.as_str())
11376    }
11377}
11378
11379impl From<&str> for MarketplaceInvocationStatus {
11380    fn from(value: &str) -> Self {
11381        match value {
11382            "pending" => Self::Pending,
11383            "running" => Self::Running,
11384            "completed" => Self::Completed,
11385            "failed" => Self::Failed,
11386            other => Self::Other(other.to_string()),
11387        }
11388    }
11389}
11390
11391/// `MarketplaceListing` model.
11392#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11393pub struct MarketplaceListing {
11394    pub listing_id: String,
11395    pub tenant_id: String,
11396    pub agent_id: String,
11397    pub agent_version: String,
11398    pub name: String,
11399    pub description: String,
11400    pub category: MarketplaceListingCategory,
11401    pub tags: Vec<String>,
11402    #[serde(default, skip_serializing_if = "Option::is_none")]
11403    pub icon_url: Option<String>,
11404    pub readme: String,
11405    pub pricing: MarketplaceListingPricing,
11406    pub stats: MarketplaceListingStats,
11407    pub status: MarketplaceListingStatus,
11408    pub a2a_enabled: bool,
11409    #[serde(default, skip_serializing_if = "Option::is_none")]
11410    pub program_id: Option<String>,
11411    pub created_at: String,
11412    pub updated_at: String,
11413}
11414
11415/// `MarketplaceListingCategory` enumeration.
11416#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11417pub enum MarketplaceListingCategory {
11418    #[default]
11419    #[serde(rename = "coding")]
11420    Coding,
11421    #[serde(rename = "writing")]
11422    Writing,
11423    #[serde(rename = "research")]
11424    Research,
11425    #[serde(rename = "data")]
11426    Data,
11427    #[serde(rename = "automation")]
11428    Automation,
11429    #[serde(rename = "creative")]
11430    Creative,
11431    #[serde(rename = "education")]
11432    Education,
11433    #[serde(rename = "business")]
11434    Business,
11435    #[serde(rename = "other")]
11436    Other,
11437    /// A value the API introduced after this SDK was generated.
11438    #[serde(untagged)]
11439    Unknown(String),
11440}
11441
11442impl MarketplaceListingCategory {
11443    /// The value as it appears on the wire.
11444    pub fn as_str(&self) -> &str {
11445        match self {
11446            Self::Coding => "coding",
11447            Self::Writing => "writing",
11448            Self::Research => "research",
11449            Self::Data => "data",
11450            Self::Automation => "automation",
11451            Self::Creative => "creative",
11452            Self::Education => "education",
11453            Self::Business => "business",
11454            Self::Other => "other",
11455            Self::Unknown(value) => value.as_str(),
11456        }
11457    }
11458}
11459
11460impl std::fmt::Display for MarketplaceListingCategory {
11461    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11462        f.write_str(self.as_str())
11463    }
11464}
11465
11466impl From<&str> for MarketplaceListingCategory {
11467    fn from(value: &str) -> Self {
11468        match value {
11469            "coding" => Self::Coding,
11470            "writing" => Self::Writing,
11471            "research" => Self::Research,
11472            "data" => Self::Data,
11473            "automation" => Self::Automation,
11474            "creative" => Self::Creative,
11475            "education" => Self::Education,
11476            "business" => Self::Business,
11477            "other" => Self::Other,
11478            other => Self::Unknown(other.to_string()),
11479        }
11480    }
11481}
11482
11483/// `MarketplaceListingPricing` model.
11484#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11485pub struct MarketplaceListingPricing {
11486    pub model: MarketplaceListingPricingModel,
11487    #[serde(default, skip_serializing_if = "Option::is_none")]
11488    pub price_per_run_usd: Option<f64>,
11489    #[serde(default, skip_serializing_if = "Option::is_none")]
11490    pub price_per_1k_tokens_usd: Option<f64>,
11491    #[serde(default, skip_serializing_if = "Option::is_none")]
11492    pub stripe_price_id: Option<String>,
11493}
11494
11495/// `MarketplaceListingPricingModel` enumeration.
11496#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11497pub enum MarketplaceListingPricingModel {
11498    #[default]
11499    #[serde(rename = "free")]
11500    Free,
11501    #[serde(rename = "per_run")]
11502    PerRun,
11503    #[serde(rename = "per_token")]
11504    PerToken,
11505    #[serde(rename = "subscription")]
11506    Subscription,
11507    /// A value the API introduced after this SDK was generated.
11508    #[serde(untagged)]
11509    Other(String),
11510}
11511
11512impl MarketplaceListingPricingModel {
11513    /// The value as it appears on the wire.
11514    pub fn as_str(&self) -> &str {
11515        match self {
11516            Self::Free => "free",
11517            Self::PerRun => "per_run",
11518            Self::PerToken => "per_token",
11519            Self::Subscription => "subscription",
11520            Self::Other(value) => value.as_str(),
11521        }
11522    }
11523}
11524
11525impl std::fmt::Display for MarketplaceListingPricingModel {
11526    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11527        f.write_str(self.as_str())
11528    }
11529}
11530
11531impl From<&str> for MarketplaceListingPricingModel {
11532    fn from(value: &str) -> Self {
11533        match value {
11534            "free" => Self::Free,
11535            "per_run" => Self::PerRun,
11536            "per_token" => Self::PerToken,
11537            "subscription" => Self::Subscription,
11538            other => Self::Other(other.to_string()),
11539        }
11540    }
11541}
11542
11543/// `MarketplaceListingRating` model.
11544#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11545pub struct MarketplaceListingRating {
11546    pub rating_id: String,
11547    pub listing_id: String,
11548    #[serde(default, skip_serializing_if = "Option::is_none")]
11549    pub tenant_id: Option<String>,
11550    pub rating: i64,
11551    #[serde(default, skip_serializing_if = "Option::is_none")]
11552    pub review: Option<String>,
11553    #[serde(default, skip_serializing_if = "Option::is_none")]
11554    pub comment: Option<String>,
11555    pub created_at: String,
11556}
11557
11558/// `MarketplaceListingStats` model.
11559#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11560pub struct MarketplaceListingStats {
11561    pub total_runs: i64,
11562    pub avg_rating: f64,
11563    pub total_ratings: i64,
11564    pub avg_latency_ms: f64,
11565    pub success_rate: f64,
11566}
11567
11568/// `MarketplaceListingStatus` enumeration.
11569#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11570pub enum MarketplaceListingStatus {
11571    #[default]
11572    #[serde(rename = "draft")]
11573    Draft,
11574    #[serde(rename = "published")]
11575    Published,
11576    #[serde(rename = "suspended")]
11577    Suspended,
11578    #[serde(rename = "archived")]
11579    Archived,
11580    /// A value the API introduced after this SDK was generated.
11581    #[serde(untagged)]
11582    Other(String),
11583}
11584
11585impl MarketplaceListingStatus {
11586    /// The value as it appears on the wire.
11587    pub fn as_str(&self) -> &str {
11588        match self {
11589            Self::Draft => "draft",
11590            Self::Published => "published",
11591            Self::Suspended => "suspended",
11592            Self::Archived => "archived",
11593            Self::Other(value) => value.as_str(),
11594        }
11595    }
11596}
11597
11598impl std::fmt::Display for MarketplaceListingStatus {
11599    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11600        f.write_str(self.as_str())
11601    }
11602}
11603
11604impl From<&str> for MarketplaceListingStatus {
11605    fn from(value: &str) -> Self {
11606        match value {
11607            "draft" => Self::Draft,
11608            "published" => Self::Published,
11609            "suspended" => Self::Suspended,
11610            "archived" => Self::Archived,
11611            other => Self::Other(other.to_string()),
11612        }
11613    }
11614}
11615
11616/// `MarkNotificationReadResponse` model.
11617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11618pub struct MarkNotificationReadResponse {
11619    pub ok: bool,
11620}
11621
11622/// `MaterializeCanvasSquadRequest` model.
11623#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11624pub struct MaterializeCanvasSquadRequest {
11625    pub supervisor_agent_id: String,
11626    /// Defaults to the saved layout's outgoing edges.
11627    #[serde(default, skip_serializing_if = "Option::is_none")]
11628    pub worker_ids: Option<Vec<String>>,
11629}
11630
11631/// `MaterializeCanvasSquadResponse` model.
11632#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11633pub struct MaterializeCanvasSquadResponse {
11634    pub team_id: String,
11635    pub created: bool,
11636    pub worker_count: i64,
11637}
11638
11639/// `McpjsonRpcRequest` model.
11640#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11641pub struct McpjsonRpcRequest {
11642    /// Always `2.0`.
11643    pub jsonrpc: String,
11644    pub method: String,
11645    #[serde(default, skip_serializing_if = "Option::is_none")]
11646    pub params: Option<serde_json::Map<String, serde_json::Value>>,
11647    #[serde(default, skip_serializing_if = "Option::is_none")]
11648    pub id: Option<serde_json::Value>,
11649}
11650
11651/// An MCP server as returned. `env` and `env_encrypted` are stripped; only the COUNT is
11652/// disclosed.
11653#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11654pub struct MCPServer {
11655    pub id: String,
11656    pub name: String,
11657    pub transport: MCPTransport,
11658    /// stdio only.
11659    #[serde(default, skip_serializing_if = "Option::is_none")]
11660    pub command: Option<String>,
11661    #[serde(default, skip_serializing_if = "Option::is_none")]
11662    pub args: Option<Vec<String>>,
11663    /// http / streamable_http only.
11664    #[serde(default, skip_serializing_if = "Option::is_none")]
11665    pub url: Option<String>,
11666    #[serde(default, skip_serializing_if = "Option::is_none")]
11667    pub api_key_ref: Option<String>,
11668    /// How many env vars are set. The values are never returned.
11669    #[serde(default, skip_serializing_if = "Option::is_none")]
11670    pub env_count: Option<i64>,
11671    #[serde(default, skip_serializing_if = "Option::is_none")]
11672    pub egress_allowlist: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
11673    pub enabled: bool,
11674    /// Tool names and resource URIs discovered from the server.
11675    #[serde(default, skip_serializing_if = "Option::is_none")]
11676    pub capabilities: Option<Vec<String>>,
11677    #[serde(default, skip_serializing_if = "Option::is_none")]
11678    pub status: Option<MCPServerStatus>,
11679    #[serde(default, skip_serializing_if = "Option::is_none")]
11680    pub last_synced: Option<String>,
11681    #[serde(default, skip_serializing_if = "Option::is_none")]
11682    pub tenant_id: Option<String>,
11683}
11684
11685/// `MCPServerStatus` enumeration.
11686#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11687pub enum MCPServerStatus {
11688    #[default]
11689    #[serde(rename = "active")]
11690    Active,
11691    #[serde(rename = "error")]
11692    Error,
11693    #[serde(rename = "disabled")]
11694    Disabled,
11695    /// A value the API introduced after this SDK was generated.
11696    #[serde(untagged)]
11697    Other(String),
11698}
11699
11700impl MCPServerStatus {
11701    /// The value as it appears on the wire.
11702    pub fn as_str(&self) -> &str {
11703        match self {
11704            Self::Active => "active",
11705            Self::Error => "error",
11706            Self::Disabled => "disabled",
11707            Self::Other(value) => value.as_str(),
11708        }
11709    }
11710}
11711
11712impl std::fmt::Display for MCPServerStatus {
11713    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11714        f.write_str(self.as_str())
11715    }
11716}
11717
11718impl From<&str> for MCPServerStatus {
11719    fn from(value: &str) -> Self {
11720        match value {
11721            "active" => Self::Active,
11722            "error" => Self::Error,
11723            "disabled" => Self::Disabled,
11724            other => Self::Other(other.to_string()),
11725        }
11726    }
11727}
11728
11729/// `MCPServerTestResult` model.
11730#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11731pub struct MCPServerTestResult {
11732    pub ok: bool,
11733    /// The MCP session status on success; the literal `error` when the probe failed.
11734    pub status: String,
11735    /// Present only when `ok` is true.
11736    #[serde(default, skip_serializing_if = "Option::is_none")]
11737    pub tool_count: Option<i64>,
11738    /// Present only when `ok` is true.
11739    #[serde(default, skip_serializing_if = "Option::is_none")]
11740    pub tools: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
11741    /// Present only when `ok` is false.
11742    #[serde(default, skip_serializing_if = "Option::is_none")]
11743    pub error: Option<String>,
11744    pub latency_ms: i64,
11745}
11746
11747/// `MCPServerWithConnectResult` model.
11748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11749pub struct MCPServerWithConnectResult {
11750    pub id: String,
11751    pub name: String,
11752    pub transport: MCPTransport,
11753    /// stdio only.
11754    #[serde(default, skip_serializing_if = "Option::is_none")]
11755    pub command: Option<String>,
11756    #[serde(default, skip_serializing_if = "Option::is_none")]
11757    pub args: Option<Vec<String>>,
11758    /// http / streamable_http only.
11759    #[serde(default, skip_serializing_if = "Option::is_none")]
11760    pub url: Option<String>,
11761    #[serde(default, skip_serializing_if = "Option::is_none")]
11762    pub api_key_ref: Option<String>,
11763    /// How many env vars are set. The values are never returned.
11764    #[serde(default, skip_serializing_if = "Option::is_none")]
11765    pub env_count: Option<i64>,
11766    #[serde(default, skip_serializing_if = "Option::is_none")]
11767    pub egress_allowlist: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
11768    pub enabled: bool,
11769    /// Tool names and resource URIs discovered from the server.
11770    #[serde(default, skip_serializing_if = "Option::is_none")]
11771    pub capabilities: Option<Vec<String>>,
11772    #[serde(default, skip_serializing_if = "Option::is_none")]
11773    pub status: Option<MCPServerStatus>,
11774    #[serde(default, skip_serializing_if = "Option::is_none")]
11775    pub last_synced: Option<String>,
11776    #[serde(default, skip_serializing_if = "Option::is_none")]
11777    pub tenant_id: Option<String>,
11778    /// Set when the record saved but the session could not be reconnected. This is the only field
11779    /// distinguishing 'saved' from 'saved and working', and it arrives on a 200.
11780    #[serde(default, skip_serializing_if = "Option::is_none")]
11781    pub connect_error: Option<String>,
11782}
11783
11784/// `stdio` is blocked in production unless UARP_ALLOW_MCP_STDIO=true.
11785#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11786pub enum MCPTransport {
11787    #[default]
11788    #[serde(rename = "stdio")]
11789    Stdio,
11790    #[serde(rename = "http")]
11791    HTTP,
11792    #[serde(rename = "streamable_http")]
11793    StreamableHTTP,
11794    /// A value the API introduced after this SDK was generated.
11795    #[serde(untagged)]
11796    Other(String),
11797}
11798
11799impl MCPTransport {
11800    /// The value as it appears on the wire.
11801    pub fn as_str(&self) -> &str {
11802        match self {
11803            Self::Stdio => "stdio",
11804            Self::HTTP => "http",
11805            Self::StreamableHTTP => "streamable_http",
11806            Self::Other(value) => value.as_str(),
11807        }
11808    }
11809}
11810
11811impl std::fmt::Display for MCPTransport {
11812    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11813        f.write_str(self.as_str())
11814    }
11815}
11816
11817impl From<&str> for MCPTransport {
11818    fn from(value: &str) -> Self {
11819        match value {
11820            "stdio" => Self::Stdio,
11821            "http" => Self::HTTP,
11822            "streamable_http" => Self::StreamableHTTP,
11823            other => Self::Other(other.to_string()),
11824        }
11825    }
11826}
11827
11828/// `MemoryEntry` model.
11829#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11830pub struct MemoryEntry {
11831    #[serde(default, skip_serializing_if = "Option::is_none")]
11832    pub agent_id: Option<String>,
11833    #[serde(default, skip_serializing_if = "Option::is_none")]
11834    pub tenant_id: Option<String>,
11835    #[serde(default, skip_serializing_if = "Option::is_none")]
11836    pub access_count: Option<i64>,
11837    #[serde(default, skip_serializing_if = "Option::is_none")]
11838    pub last_accessed_at: Option<String>,
11839    #[serde(default, skip_serializing_if = "Option::is_none")]
11840    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
11841    /// Present on entries written from a run (seen on some e2e-canon entries, absent on others).
11842    #[serde(default, skip_serializing_if = "Option::is_none")]
11843    pub run_outcome: Option<String>,
11844    /// Present on entity entries only (e2e-canon).
11845    #[serde(default, skip_serializing_if = "Option::is_none")]
11846    pub entity_name: Option<String>,
11847    /// Present on entity entries only (e2e-canon).
11848    #[serde(default, skip_serializing_if = "Option::is_none")]
11849    pub entity_type: Option<String>,
11850    pub entry_id: String,
11851    #[serde(default, skip_serializing_if = "Option::is_none")]
11852    pub r#type: Option<MemoryEntryType>,
11853    pub content: String,
11854    #[serde(default, skip_serializing_if = "Option::is_none")]
11855    pub tags: Option<Vec<String>>,
11856    #[serde(default, skip_serializing_if = "Option::is_none")]
11857    pub relevance_score: Option<f64>,
11858    #[serde(default, skip_serializing_if = "Option::is_none")]
11859    pub created_at: Option<String>,
11860    #[serde(default, skip_serializing_if = "Option::is_none")]
11861    pub source_run_id: Option<String>,
11862}
11863
11864/// `MemoryEntryType` enumeration.
11865#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11866pub enum MemoryEntryType {
11867    #[default]
11868    #[serde(rename = "episodic")]
11869    Episodic,
11870    #[serde(rename = "semantic")]
11871    Semantic,
11872    #[serde(rename = "procedural")]
11873    Procedural,
11874    #[serde(rename = "note")]
11875    Note,
11876    /// A value the API introduced after this SDK was generated.
11877    #[serde(untagged)]
11878    Other(String),
11879}
11880
11881impl MemoryEntryType {
11882    /// The value as it appears on the wire.
11883    pub fn as_str(&self) -> &str {
11884        match self {
11885            Self::Episodic => "episodic",
11886            Self::Semantic => "semantic",
11887            Self::Procedural => "procedural",
11888            Self::Note => "note",
11889            Self::Other(value) => value.as_str(),
11890        }
11891    }
11892}
11893
11894impl std::fmt::Display for MemoryEntryType {
11895    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11896        f.write_str(self.as_str())
11897    }
11898}
11899
11900impl From<&str> for MemoryEntryType {
11901    fn from(value: &str) -> Self {
11902        match value {
11903            "episodic" => Self::Episodic,
11904            "semantic" => Self::Semantic,
11905            "procedural" => Self::Procedural,
11906            "note" => Self::Note,
11907            other => Self::Other(other.to_string()),
11908        }
11909    }
11910}
11911
11912/// `MemoryImportEntry` model.
11913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11914pub struct MemoryImportEntry {
11915    pub content: String,
11916    #[serde(default, skip_serializing_if = "Option::is_none")]
11917    pub r#type: Option<String>,
11918    #[serde(default, skip_serializing_if = "Option::is_none")]
11919    pub tags: Option<Vec<String>>,
11920    #[serde(default, skip_serializing_if = "Option::is_none")]
11921    pub created_at: Option<String>,
11922}
11923
11924/// POST /auth/mfa/enrol (mfa.ts): the TOTP secret, its otpauth URL and the one-time recovery
11925/// codes — shown once.
11926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11927pub struct MfaEnrolment {
11928    pub otpauth_url: String,
11929    pub secret: String,
11930    pub recovery_codes: Vec<String>,
11931}
11932
11933/// `MintSSETokenResponse` model.
11934#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11935pub struct MintSSETokenResponse {
11936    /// Bearer-shape API key. Pass as `?token=\<token\>` on SSE/WS endpoints.
11937    pub token: String,
11938    pub expires_at: String,
11939}
11940
11941/// A Mission Execution Framework run: a goal decomposed into objectives, executed under an
11942/// authorization gate with checkpoints and an after-action review. Sent by every mission
11943/// endpoint that answers with the record itself.
11944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11945pub struct Mission {
11946    pub mission_id: String,
11947    pub tenant_id: String,
11948    /// Chat session the mission was started from.
11949    pub session_id: String,
11950    /// User id, or an agent id when a sub-mission was spawned by an agent.
11951    pub created_by: String,
11952    /// The requester's goal, verbatim.
11953    pub goal: String,
11954    /// Why MEF took the request. `quick_reply` never reaches execution.
11955    pub classification: MissionClassification,
11956    /// Lifecycle state. `completed`, `failed` and `aborted` are terminal.
11957    pub status: MissionStatus,
11958    /// Root objective ids in plan order.
11959    pub objective_ids: Vec<String>,
11960    /// Appended chronologically as objectives verify; a resume replays from the last one.
11961    pub checkpoint_ids: Vec<String>,
11962    /// Set once the after-action review is finalized — see GET /missions/{missionId}/aar.
11963    #[serde(default, skip_serializing_if = "Option::is_none")]
11964    pub aar_id: Option<String>,
11965    #[serde(default, skip_serializing_if = "Option::is_none")]
11966    pub metrics: Option<MissionMetrics>,
11967    /// Terminal outcome. `partial` means some objectives verified and some did not.
11968    #[serde(default, skip_serializing_if = "Option::is_none")]
11969    pub outcome: Option<MissionOutcome>,
11970    #[serde(default, skip_serializing_if = "Option::is_none")]
11971    pub result_summary: Option<String>,
11972    /// Subset of objective_ids that failed verification.
11973    #[serde(default, skip_serializing_if = "Option::is_none")]
11974    pub failed_objective_ids: Option<Vec<String>>,
11975    /// ISO 8601 hard deadline the runtime enforces against.
11976    #[serde(default, skip_serializing_if = "Option::is_none")]
11977    pub deadline: Option<String>,
11978    pub created_at: String,
11979    pub updated_at: String,
11980    /// Set when the status first leaves `draft`.
11981    #[serde(default, skip_serializing_if = "Option::is_none")]
11982    pub started_at: Option<String>,
11983    /// Set when the status becomes terminal.
11984    #[serde(default, skip_serializing_if = "Option::is_none")]
11985    pub completed_at: Option<String>,
11986}
11987
11988/// Why MEF took the request. `quick_reply` never reaches execution.
11989#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11990pub enum MissionClassification {
11991    #[default]
11992    #[serde(rename = "quick_reply")]
11993    QuickReply,
11994    #[serde(rename = "mission")]
11995    Mission,
11996    /// A value the API introduced after this SDK was generated.
11997    #[serde(untagged)]
11998    Other(String),
11999}
12000
12001impl MissionClassification {
12002    /// The value as it appears on the wire.
12003    pub fn as_str(&self) -> &str {
12004        match self {
12005            Self::QuickReply => "quick_reply",
12006            Self::Mission => "mission",
12007            Self::Other(value) => value.as_str(),
12008        }
12009    }
12010}
12011
12012impl std::fmt::Display for MissionClassification {
12013    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12014        f.write_str(self.as_str())
12015    }
12016}
12017
12018impl From<&str> for MissionClassification {
12019    fn from(value: &str) -> Self {
12020        match value {
12021            "quick_reply" => Self::QuickReply,
12022            "mission" => Self::Mission,
12023            other => Self::Other(other.to_string()),
12024        }
12025    }
12026}
12027
12028/// Aggregated spend for the whole mission. Written on the terminal transition, so it is absent
12029/// while the mission is still running.
12030#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12031pub struct MissionMetrics {
12032    pub total_cost_usd: f64,
12033    pub total_tokens: i64,
12034    pub total_duration_ms: i64,
12035    pub llm_calls: i64,
12036    /// Objective retries across the mission — a strike counter, not an HTTP retry count.
12037    pub retries: i64,
12038}
12039
12040/// Terminal outcome. `partial` means some objectives verified and some did not.
12041#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12042pub enum MissionOutcome {
12043    #[default]
12044    #[serde(rename = "success")]
12045    Success,
12046    #[serde(rename = "partial")]
12047    Partial,
12048    #[serde(rename = "failed")]
12049    Failed,
12050    #[serde(rename = "aborted")]
12051    Aborted,
12052    /// A value the API introduced after this SDK was generated.
12053    #[serde(untagged)]
12054    Other(String),
12055}
12056
12057impl MissionOutcome {
12058    /// The value as it appears on the wire.
12059    pub fn as_str(&self) -> &str {
12060        match self {
12061            Self::Success => "success",
12062            Self::Partial => "partial",
12063            Self::Failed => "failed",
12064            Self::Aborted => "aborted",
12065            Self::Other(value) => value.as_str(),
12066        }
12067    }
12068}
12069
12070impl std::fmt::Display for MissionOutcome {
12071    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12072        f.write_str(self.as_str())
12073    }
12074}
12075
12076impl From<&str> for MissionOutcome {
12077    fn from(value: &str) -> Self {
12078        match value {
12079            "success" => Self::Success,
12080            "partial" => Self::Partial,
12081            "failed" => Self::Failed,
12082            "aborted" => Self::Aborted,
12083            other => Self::Other(other.to_string()),
12084        }
12085    }
12086}
12087
12088/// What POST /missions answers. `plan` is echoed back only when the server planned the mission
12089/// from a goal.
12090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12091pub struct MissionStartResponse {
12092    pub mission_id: String,
12093    /// Persisted objective ids, in plan order.
12094    pub objective_ids: Vec<String>,
12095    /// The intake decision. A `quick_reply` mission is recorded but is not mission work.
12096    pub classification: MissionStartResponseClassification,
12097    #[serde(default, skip_serializing_if = "Option::is_none")]
12098    pub plan: Option<PlannedMission>,
12099}
12100
12101/// The intake decision. A `quick_reply` mission is recorded but is not mission work.
12102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12103pub struct MissionStartResponseClassification {
12104    pub classification: MissionClassification,
12105    pub score: f64,
12106    pub confidence: f64,
12107}
12108
12109/// Lifecycle state. `completed`, `failed` and `aborted` are terminal.
12110#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12111pub enum MissionStatus {
12112    #[default]
12113    #[serde(rename = "draft")]
12114    Draft,
12115    #[serde(rename = "planning")]
12116    Planning,
12117    #[serde(rename = "awaiting_authorization")]
12118    AwaitingAuthorization,
12119    #[serde(rename = "executing")]
12120    Executing,
12121    #[serde(rename = "paused")]
12122    Paused,
12123    #[serde(rename = "verifying")]
12124    Verifying,
12125    #[serde(rename = "completed")]
12126    Completed,
12127    #[serde(rename = "failed")]
12128    Failed,
12129    #[serde(rename = "aborted")]
12130    Aborted,
12131    /// A value the API introduced after this SDK was generated.
12132    #[serde(untagged)]
12133    Other(String),
12134}
12135
12136impl MissionStatus {
12137    /// The value as it appears on the wire.
12138    pub fn as_str(&self) -> &str {
12139        match self {
12140            Self::Draft => "draft",
12141            Self::Planning => "planning",
12142            Self::AwaitingAuthorization => "awaiting_authorization",
12143            Self::Executing => "executing",
12144            Self::Paused => "paused",
12145            Self::Verifying => "verifying",
12146            Self::Completed => "completed",
12147            Self::Failed => "failed",
12148            Self::Aborted => "aborted",
12149            Self::Other(value) => value.as_str(),
12150        }
12151    }
12152}
12153
12154impl std::fmt::Display for MissionStatus {
12155    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12156        f.write_str(self.as_str())
12157    }
12158}
12159
12160impl From<&str> for MissionStatus {
12161    fn from(value: &str) -> Self {
12162        match value {
12163            "draft" => Self::Draft,
12164            "planning" => Self::Planning,
12165            "awaiting_authorization" => Self::AwaitingAuthorization,
12166            "executing" => Self::Executing,
12167            "paused" => Self::Paused,
12168            "verifying" => Self::Verifying,
12169            "completed" => Self::Completed,
12170            "failed" => Self::Failed,
12171            "aborted" => Self::Aborted,
12172            other => Self::Other(other.to_string()),
12173        }
12174    }
12175}
12176
12177/// `MoveWorkspaceFileRequest` model.
12178#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12179pub struct MoveWorkspaceFileRequest {
12180    pub from_path: String,
12181    pub to_path: String,
12182}
12183
12184/// `Notification` model.
12185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12186pub struct Notification {
12187    pub id: String,
12188    pub tenant_id: String,
12189    #[serde(default, skip_serializing_if = "Option::is_none")]
12190    pub user_id: Option<String>,
12191    pub r#type: String,
12192    pub title: String,
12193    pub message: String,
12194    #[serde(default, skip_serializing_if = "Option::is_none")]
12195    pub data: Option<serde_json::Map<String, serde_json::Value>>,
12196    pub read: bool,
12197    #[serde(default, skip_serializing_if = "Option::is_none")]
12198    pub action_url: Option<String>,
12199    pub created_at: String,
12200    /// UI surface routing; defaults to `info` when omitted.
12201    #[serde(default, skip_serializing_if = "Option::is_none")]
12202    pub priority: Option<NotificationPriority>,
12203    /// Notifications sharing a dedup_key collapse in the bell with a count badge.
12204    #[serde(default, skip_serializing_if = "Option::is_none")]
12205    pub dedup_key: Option<String>,
12206    #[serde(default, skip_serializing_if = "Option::is_none")]
12207    pub source: Option<NotificationSource>,
12208}
12209
12210/// Delivery channel. `in_app` is always-on (bell drawer + SSE) and cannot be opted out of;
12211/// `telegram`/`whatsapp` are reserved and have no adapter yet.
12212#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12213pub enum NotificationChannel {
12214    #[default]
12215    #[serde(rename = "in_app")]
12216    InApp,
12217    #[serde(rename = "email")]
12218    Email,
12219    #[serde(rename = "webhook")]
12220    Webhook,
12221    #[serde(rename = "push")]
12222    Push,
12223    #[serde(rename = "web_push")]
12224    WebPush,
12225    #[serde(rename = "telegram")]
12226    Telegram,
12227    #[serde(rename = "whatsapp")]
12228    Whatsapp,
12229    /// A value the API introduced after this SDK was generated.
12230    #[serde(untagged)]
12231    Other(String),
12232}
12233
12234impl NotificationChannel {
12235    /// The value as it appears on the wire.
12236    pub fn as_str(&self) -> &str {
12237        match self {
12238            Self::InApp => "in_app",
12239            Self::Email => "email",
12240            Self::Webhook => "webhook",
12241            Self::Push => "push",
12242            Self::WebPush => "web_push",
12243            Self::Telegram => "telegram",
12244            Self::Whatsapp => "whatsapp",
12245            Self::Other(value) => value.as_str(),
12246        }
12247    }
12248}
12249
12250impl std::fmt::Display for NotificationChannel {
12251    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12252        f.write_str(self.as_str())
12253    }
12254}
12255
12256impl From<&str> for NotificationChannel {
12257    fn from(value: &str) -> Self {
12258        match value {
12259            "in_app" => Self::InApp,
12260            "email" => Self::Email,
12261            "webhook" => Self::Webhook,
12262            "push" => Self::Push,
12263            "web_push" => Self::WebPush,
12264            "telegram" => Self::Telegram,
12265            "whatsapp" => Self::Whatsapp,
12266            other => Self::Other(other.to_string()),
12267        }
12268    }
12269}
12270
12271/// `NotificationPreferences` model.
12272#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12273pub struct NotificationPreferences {
12274    /// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
12275    /// warning/info/success → \[in_app\].
12276    #[serde(default, skip_serializing_if = "Option::is_none")]
12277    pub priority_channels: Option<NotificationPreferencesPriorityChannels>,
12278    /// Per-event-type channel list. When present for a type it REPLACES the priority-level default
12279    /// for that type. Keys are NotificationType values.
12280    #[serde(default, skip_serializing_if = "Option::is_none")]
12281    pub type_overrides: Option<HashMap<String, Vec<NotificationChannel>>>,
12282    /// Event types muted for OUTBOUND delivery (email/webhook/push). The in-app bell still receives
12283    /// them — muting does not hide an event from the bell drawer, it only stops the outbound
12284    /// channels.
12285    #[serde(default, skip_serializing_if = "Option::is_none")]
12286    pub muted_types: Option<Vec<NotificationType>>,
12287    /// Window during which non-critical messages are suppressed; critical always bypasses. Set both
12288    /// start_local and end_local to enable, empty disables.
12289    #[serde(default, skip_serializing_if = "Option::is_none")]
12290    pub quiet_hours: Option<NotificationPreferencesQuietHours>,
12291    pub tenant_id: String,
12292    pub updated_at: String,
12293}
12294
12295/// Per-TENANT notification routing. Sent to PUT /notifications/prefs, which REPLACES the stored
12296/// value — an omitted field is stored as omitted (that is how a client clears `muted_types` or
12297/// drops `quiet_hours`). `tenant_id` and `updated_at` are ignored if sent: the server derives
12298/// them.
12299#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12300pub struct NotificationPreferencesInput {
12301    /// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
12302    /// warning/info/success → \[in_app\].
12303    #[serde(default, skip_serializing_if = "Option::is_none")]
12304    pub priority_channels: Option<NotificationPreferencesInputPriorityChannels>,
12305    /// Per-event-type channel list. When present for a type it REPLACES the priority-level default
12306    /// for that type. Keys are NotificationType values.
12307    #[serde(default, skip_serializing_if = "Option::is_none")]
12308    pub type_overrides: Option<HashMap<String, Vec<NotificationChannel>>>,
12309    /// Event types muted for OUTBOUND delivery (email/webhook/push). The in-app bell still receives
12310    /// them — muting does not hide an event from the bell drawer, it only stops the outbound
12311    /// channels.
12312    #[serde(default, skip_serializing_if = "Option::is_none")]
12313    pub muted_types: Option<Vec<NotificationType>>,
12314    /// Window during which non-critical messages are suppressed; critical always bypasses. Set both
12315    /// start_local and end_local to enable, empty disables.
12316    #[serde(default, skip_serializing_if = "Option::is_none")]
12317    pub quiet_hours: Option<NotificationPreferencesInputQuietHours>,
12318}
12319
12320/// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
12321/// warning/info/success → \[in_app\].
12322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12323pub struct NotificationPreferencesInputPriorityChannels {
12324    #[serde(default, skip_serializing_if = "Option::is_none")]
12325    pub critical: Option<Vec<NotificationChannel>>,
12326    #[serde(default, skip_serializing_if = "Option::is_none")]
12327    pub warning: Option<Vec<NotificationChannel>>,
12328    #[serde(default, skip_serializing_if = "Option::is_none")]
12329    pub info: Option<Vec<NotificationChannel>>,
12330    #[serde(default, skip_serializing_if = "Option::is_none")]
12331    pub success: Option<Vec<NotificationChannel>>,
12332}
12333
12334/// Window during which non-critical messages are suppressed; critical always bypasses. Set both
12335/// start_local and end_local to enable, empty disables.
12336#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12337pub struct NotificationPreferencesInputQuietHours {
12338    /// Local-time start "HH:mm".
12339    #[serde(default, skip_serializing_if = "Option::is_none")]
12340    pub start_local: Option<String>,
12341    /// Local-time end "HH:mm".
12342    #[serde(default, skip_serializing_if = "Option::is_none")]
12343    pub end_local: Option<String>,
12344    /// IANA timezone (e.g. "Europe/Kyiv"). Defaults to UTC when absent.
12345    #[serde(default, skip_serializing_if = "Option::is_none")]
12346    pub timezone: Option<String>,
12347    /// Legacy — use start_local + timezone.
12348    #[serde(default, skip_serializing_if = "Option::is_none")]
12349    pub start_utc: Option<String>,
12350    /// Legacy — use end_local + timezone.
12351    #[serde(default, skip_serializing_if = "Option::is_none")]
12352    pub end_utc: Option<String>,
12353}
12354
12355/// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
12356/// warning/info/success → \[in_app\].
12357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12358pub struct NotificationPreferencesPriorityChannels {
12359    #[serde(default, skip_serializing_if = "Option::is_none")]
12360    pub critical: Option<Vec<NotificationChannel>>,
12361    #[serde(default, skip_serializing_if = "Option::is_none")]
12362    pub warning: Option<Vec<NotificationChannel>>,
12363    #[serde(default, skip_serializing_if = "Option::is_none")]
12364    pub info: Option<Vec<NotificationChannel>>,
12365    #[serde(default, skip_serializing_if = "Option::is_none")]
12366    pub success: Option<Vec<NotificationChannel>>,
12367}
12368
12369/// Window during which non-critical messages are suppressed; critical always bypasses. Set both
12370/// start_local and end_local to enable, empty disables.
12371#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12372pub struct NotificationPreferencesQuietHours {
12373    /// Local-time start "HH:mm".
12374    #[serde(default, skip_serializing_if = "Option::is_none")]
12375    pub start_local: Option<String>,
12376    /// Local-time end "HH:mm".
12377    #[serde(default, skip_serializing_if = "Option::is_none")]
12378    pub end_local: Option<String>,
12379    /// IANA timezone (e.g. "Europe/Kyiv"). Defaults to UTC when absent.
12380    #[serde(default, skip_serializing_if = "Option::is_none")]
12381    pub timezone: Option<String>,
12382    /// Legacy — use start_local + timezone.
12383    #[serde(default, skip_serializing_if = "Option::is_none")]
12384    pub start_utc: Option<String>,
12385    /// Legacy — use end_local + timezone.
12386    #[serde(default, skip_serializing_if = "Option::is_none")]
12387    pub end_utc: Option<String>,
12388}
12389
12390/// UI surface routing; defaults to `info` when omitted.
12391#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12392pub enum NotificationPriority {
12393    #[default]
12394    #[serde(rename = "critical")]
12395    Critical,
12396    #[serde(rename = "warning")]
12397    Warning,
12398    #[serde(rename = "info")]
12399    Info,
12400    #[serde(rename = "success")]
12401    Success,
12402    /// A value the API introduced after this SDK was generated.
12403    #[serde(untagged)]
12404    Other(String),
12405}
12406
12407impl NotificationPriority {
12408    /// The value as it appears on the wire.
12409    pub fn as_str(&self) -> &str {
12410        match self {
12411            Self::Critical => "critical",
12412            Self::Warning => "warning",
12413            Self::Info => "info",
12414            Self::Success => "success",
12415            Self::Other(value) => value.as_str(),
12416        }
12417    }
12418}
12419
12420impl std::fmt::Display for NotificationPriority {
12421    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12422        f.write_str(self.as_str())
12423    }
12424}
12425
12426impl From<&str> for NotificationPriority {
12427    fn from(value: &str) -> Self {
12428        match value {
12429            "critical" => Self::Critical,
12430            "warning" => Self::Warning,
12431            "info" => Self::Info,
12432            "success" => Self::Success,
12433            other => Self::Other(other.to_string()),
12434        }
12435    }
12436}
12437
12438/// `NotificationSource` model.
12439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12440pub struct NotificationSource {
12441    #[serde(default, skip_serializing_if = "Option::is_none")]
12442    pub kind: Option<NotificationSourceKind>,
12443    #[serde(default, skip_serializing_if = "Option::is_none")]
12444    pub id: Option<String>,
12445}
12446
12447/// `NotificationSourceKind` enumeration.
12448#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12449pub enum NotificationSourceKind {
12450    #[default]
12451    #[serde(rename = "run")]
12452    Run,
12453    #[serde(rename = "agent")]
12454    Agent,
12455    #[serde(rename = "bridge")]
12456    Bridge,
12457    #[serde(rename = "budget")]
12458    Budget,
12459    #[serde(rename = "team")]
12460    Team,
12461    #[serde(rename = "task")]
12462    Task,
12463    /// A value the API introduced after this SDK was generated.
12464    #[serde(untagged)]
12465    Other(String),
12466}
12467
12468impl NotificationSourceKind {
12469    /// The value as it appears on the wire.
12470    pub fn as_str(&self) -> &str {
12471        match self {
12472            Self::Run => "run",
12473            Self::Agent => "agent",
12474            Self::Bridge => "bridge",
12475            Self::Budget => "budget",
12476            Self::Team => "team",
12477            Self::Task => "task",
12478            Self::Other(value) => value.as_str(),
12479        }
12480    }
12481}
12482
12483impl std::fmt::Display for NotificationSourceKind {
12484    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12485        f.write_str(self.as_str())
12486    }
12487}
12488
12489impl From<&str> for NotificationSourceKind {
12490    fn from(value: &str) -> Self {
12491        match value {
12492            "run" => Self::Run,
12493            "agent" => Self::Agent,
12494            "bridge" => Self::Bridge,
12495            "budget" => Self::Budget,
12496            "team" => Self::Team,
12497            "task" => Self::Task,
12498            other => Self::Other(other.to_string()),
12499        }
12500    }
12501}
12502
12503/// Where outbound notifications go. **Secrets never leave the server**: a webhook's signing
12504/// secret is reported only as `has_signing_secret`, a device token only by its last four
12505/// characters, and a Web Push endpoint only by host — the path carries a subscription
12506/// identifier.
12507#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12508pub struct NotificationTarget {
12509    pub id: String,
12510    pub tenant_id: String,
12511    pub channel: NotificationTargetChannel,
12512    /// Operator's own label — “Slack #ops”, “iPhone 15”.
12513    pub label: String,
12514    /// A disabled target is kept for audit and skipped at fan-out.
12515    pub enabled: bool,
12516    pub created_at: String,
12517    /// Last success — the field that tells a dead webhook from a quiet one.
12518    #[serde(default, skip_serializing_if = "Option::is_none")]
12519    pub last_delivered_at: Option<String>,
12520    #[serde(default, skip_serializing_if = "Option::is_none")]
12521    pub last_error: Option<String>,
12522    pub config: serde_json::Value,
12523}
12524
12525/// `NotificationTargetChannel` enumeration.
12526#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12527pub enum NotificationTargetChannel {
12528    #[default]
12529    #[serde(rename = "email")]
12530    Email,
12531    #[serde(rename = "webhook")]
12532    Webhook,
12533    #[serde(rename = "push")]
12534    Push,
12535    #[serde(rename = "web_push")]
12536    WebPush,
12537    /// A value the API introduced after this SDK was generated.
12538    #[serde(untagged)]
12539    Other(String),
12540}
12541
12542impl NotificationTargetChannel {
12543    /// The value as it appears on the wire.
12544    pub fn as_str(&self) -> &str {
12545        match self {
12546            Self::Email => "email",
12547            Self::Webhook => "webhook",
12548            Self::Push => "push",
12549            Self::WebPush => "web_push",
12550            Self::Other(value) => value.as_str(),
12551        }
12552    }
12553}
12554
12555impl std::fmt::Display for NotificationTargetChannel {
12556    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12557        f.write_str(self.as_str())
12558    }
12559}
12560
12561impl From<&str> for NotificationTargetChannel {
12562    fn from(value: &str) -> Self {
12563        match value {
12564            "email" => Self::Email,
12565            "webhook" => Self::Webhook,
12566            "push" => Self::Push,
12567            "web_push" => Self::WebPush,
12568            other => Self::Other(other.to_string()),
12569        }
12570    }
12571}
12572
12573/// `NotificationTargetConfigVariant1` model.
12574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12575pub struct NotificationTargetConfigVariant1 {
12576    pub kind: NotificationTargetConfigVariant1kind,
12577    pub address: String,
12578}
12579
12580/// `NotificationTargetConfigVariant1kind` enumeration.
12581#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12582pub enum NotificationTargetConfigVariant1kind {
12583    #[default]
12584    #[serde(rename = "email")]
12585    Email,
12586    /// A value the API introduced after this SDK was generated.
12587    #[serde(untagged)]
12588    Other(String),
12589}
12590
12591impl NotificationTargetConfigVariant1kind {
12592    /// The value as it appears on the wire.
12593    pub fn as_str(&self) -> &str {
12594        match self {
12595            Self::Email => "email",
12596            Self::Other(value) => value.as_str(),
12597        }
12598    }
12599}
12600
12601impl std::fmt::Display for NotificationTargetConfigVariant1kind {
12602    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12603        f.write_str(self.as_str())
12604    }
12605}
12606
12607impl From<&str> for NotificationTargetConfigVariant1kind {
12608    fn from(value: &str) -> Self {
12609        match value {
12610            "email" => Self::Email,
12611            other => Self::Other(other.to_string()),
12612        }
12613    }
12614}
12615
12616/// `NotificationTargetConfigVariant2` model.
12617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12618pub struct NotificationTargetConfigVariant2 {
12619    pub kind: AgentScorerConfigType,
12620    pub url: String,
12621    pub format: NotificationTargetConfigVariant2format,
12622    /// Whether a secret is configured. The secret itself is never returned.
12623    pub has_signing_secret: bool,
12624}
12625
12626/// `NotificationTargetConfigVariant2format` enumeration.
12627#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12628pub enum NotificationTargetConfigVariant2format {
12629    #[default]
12630    #[serde(rename = "generic")]
12631    Generic,
12632    #[serde(rename = "slack")]
12633    Slack,
12634    #[serde(rename = "discord")]
12635    Discord,
12636    /// A value the API introduced after this SDK was generated.
12637    #[serde(untagged)]
12638    Other(String),
12639}
12640
12641impl NotificationTargetConfigVariant2format {
12642    /// The value as it appears on the wire.
12643    pub fn as_str(&self) -> &str {
12644        match self {
12645            Self::Generic => "generic",
12646            Self::Slack => "slack",
12647            Self::Discord => "discord",
12648            Self::Other(value) => value.as_str(),
12649        }
12650    }
12651}
12652
12653impl std::fmt::Display for NotificationTargetConfigVariant2format {
12654    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12655        f.write_str(self.as_str())
12656    }
12657}
12658
12659impl From<&str> for NotificationTargetConfigVariant2format {
12660    fn from(value: &str) -> Self {
12661        match value {
12662            "generic" => Self::Generic,
12663            "slack" => Self::Slack,
12664            "discord" => Self::Discord,
12665            other => Self::Other(other.to_string()),
12666        }
12667    }
12668}
12669
12670/// `NotificationTargetConfigVariant3` model.
12671#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12672pub struct NotificationTargetConfigVariant3 {
12673    pub kind: NotificationTargetConfigVariant3kind,
12674    pub platform: NotificationTargetConfigVariant3platform,
12675    #[serde(default, skip_serializing_if = "Option::is_none")]
12676    pub device_label: Option<String>,
12677    /// Last four characters of the device token, for visual identification only.
12678    pub device_token_suffix: String,
12679}
12680
12681/// `NotificationTargetConfigVariant3kind` enumeration.
12682#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12683pub enum NotificationTargetConfigVariant3kind {
12684    #[default]
12685    #[serde(rename = "push")]
12686    Push,
12687    /// A value the API introduced after this SDK was generated.
12688    #[serde(untagged)]
12689    Other(String),
12690}
12691
12692impl NotificationTargetConfigVariant3kind {
12693    /// The value as it appears on the wire.
12694    pub fn as_str(&self) -> &str {
12695        match self {
12696            Self::Push => "push",
12697            Self::Other(value) => value.as_str(),
12698        }
12699    }
12700}
12701
12702impl std::fmt::Display for NotificationTargetConfigVariant3kind {
12703    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12704        f.write_str(self.as_str())
12705    }
12706}
12707
12708impl From<&str> for NotificationTargetConfigVariant3kind {
12709    fn from(value: &str) -> Self {
12710        match value {
12711            "push" => Self::Push,
12712            other => Self::Other(other.to_string()),
12713        }
12714    }
12715}
12716
12717/// `NotificationTargetConfigVariant3platform` enumeration.
12718#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12719pub enum NotificationTargetConfigVariant3platform {
12720    #[default]
12721    #[serde(rename = "apns")]
12722    Apns,
12723    #[serde(rename = "fcm")]
12724    Fcm,
12725    /// A value the API introduced after this SDK was generated.
12726    #[serde(untagged)]
12727    Other(String),
12728}
12729
12730impl NotificationTargetConfigVariant3platform {
12731    /// The value as it appears on the wire.
12732    pub fn as_str(&self) -> &str {
12733        match self {
12734            Self::Apns => "apns",
12735            Self::Fcm => "fcm",
12736            Self::Other(value) => value.as_str(),
12737        }
12738    }
12739}
12740
12741impl std::fmt::Display for NotificationTargetConfigVariant3platform {
12742    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12743        f.write_str(self.as_str())
12744    }
12745}
12746
12747impl From<&str> for NotificationTargetConfigVariant3platform {
12748    fn from(value: &str) -> Self {
12749        match value {
12750            "apns" => Self::Apns,
12751            "fcm" => Self::Fcm,
12752            other => Self::Other(other.to_string()),
12753        }
12754    }
12755}
12756
12757/// `NotificationTargetConfigVariant4` model.
12758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12759pub struct NotificationTargetConfigVariant4 {
12760    pub kind: NotificationTargetConfigVariant4kind,
12761    /// Host only — `(invalid endpoint)` when the stored URL will not parse.
12762    pub endpoint_host: String,
12763    #[serde(default, skip_serializing_if = "Option::is_none")]
12764    pub device_label: Option<String>,
12765    /// Browser-supplied expiry, ms since epoch.
12766    #[serde(default)]
12767    pub expiration_time: Option<i64>,
12768}
12769
12770/// `NotificationTargetConfigVariant4kind` enumeration.
12771#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12772pub enum NotificationTargetConfigVariant4kind {
12773    #[default]
12774    #[serde(rename = "web_push")]
12775    WebPush,
12776    /// A value the API introduced after this SDK was generated.
12777    #[serde(untagged)]
12778    Other(String),
12779}
12780
12781impl NotificationTargetConfigVariant4kind {
12782    /// The value as it appears on the wire.
12783    pub fn as_str(&self) -> &str {
12784        match self {
12785            Self::WebPush => "web_push",
12786            Self::Other(value) => value.as_str(),
12787        }
12788    }
12789}
12790
12791impl std::fmt::Display for NotificationTargetConfigVariant4kind {
12792    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12793        f.write_str(self.as_str())
12794    }
12795}
12796
12797impl From<&str> for NotificationTargetConfigVariant4kind {
12798    fn from(value: &str) -> Self {
12799        match value {
12800            "web_push" => Self::WebPush,
12801            other => Self::Other(other.to_string()),
12802        }
12803    }
12804}
12805
12806/// Fine-grained event type. There are no coarse buckets on the server — a UI that groups events
12807/// (e.g. "agents / failures / system") maps its groups onto these types itself.
12808#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12809pub enum NotificationType {
12810    #[default]
12811    #[serde(rename = "run.started")]
12812    RunStarted,
12813    #[serde(rename = "run.failed")]
12814    RunFailed,
12815    #[serde(rename = "run.completed")]
12816    RunCompleted,
12817    #[serde(rename = "run.awaiting_approval")]
12818    RunAwaitingApproval,
12819    #[serde(rename = "run.awaiting_input")]
12820    RunAwaitingInput,
12821    #[serde(rename = "approval.requested")]
12822    ApprovalRequested,
12823    #[serde(rename = "budget.warning")]
12824    BudgetWarning,
12825    #[serde(rename = "budget.exceeded")]
12826    BudgetExceeded,
12827    #[serde(rename = "bridge.online")]
12828    BridgeOnline,
12829    #[serde(rename = "bridge.offline")]
12830    BridgeOffline,
12831    #[serde(rename = "invite.accepted")]
12832    InviteAccepted,
12833    #[serde(rename = "marketplace.review")]
12834    MarketplaceReview,
12835    #[serde(rename = "workflow.triggered")]
12836    WorkflowTriggered,
12837    #[serde(rename = "system.alert")]
12838    SystemAlert,
12839    #[serde(rename = "task.completed")]
12840    TaskCompleted,
12841    #[serde(rename = "task.confirmation_required")]
12842    TaskConfirmationRequired,
12843    #[serde(rename = "agent.suspended")]
12844    AgentSuspended,
12845    #[serde(rename = "agent.terminated")]
12846    AgentTerminated,
12847    #[serde(rename = "billing.payment_failed")]
12848    BillingPaymentFailed,
12849    #[serde(rename = "billing.subscription_paused")]
12850    BillingSubscriptionPaused,
12851    #[serde(rename = "billing.subscription_cancelled")]
12852    BillingSubscriptionCancelled,
12853    #[serde(rename = "billing.dispute_opened")]
12854    BillingDisputeOpened,
12855    #[serde(rename = "domain.dns_drift")]
12856    DomainDnsDrift,
12857    #[serde(rename = "domain.cert_failed")]
12858    DomainCertFailed,
12859    #[serde(rename = "domain.cert_renewal_due")]
12860    DomainCertRenewalDue,
12861    /// A value the API introduced after this SDK was generated.
12862    #[serde(untagged)]
12863    Other(String),
12864}
12865
12866impl NotificationType {
12867    /// The value as it appears on the wire.
12868    pub fn as_str(&self) -> &str {
12869        match self {
12870            Self::RunStarted => "run.started",
12871            Self::RunFailed => "run.failed",
12872            Self::RunCompleted => "run.completed",
12873            Self::RunAwaitingApproval => "run.awaiting_approval",
12874            Self::RunAwaitingInput => "run.awaiting_input",
12875            Self::ApprovalRequested => "approval.requested",
12876            Self::BudgetWarning => "budget.warning",
12877            Self::BudgetExceeded => "budget.exceeded",
12878            Self::BridgeOnline => "bridge.online",
12879            Self::BridgeOffline => "bridge.offline",
12880            Self::InviteAccepted => "invite.accepted",
12881            Self::MarketplaceReview => "marketplace.review",
12882            Self::WorkflowTriggered => "workflow.triggered",
12883            Self::SystemAlert => "system.alert",
12884            Self::TaskCompleted => "task.completed",
12885            Self::TaskConfirmationRequired => "task.confirmation_required",
12886            Self::AgentSuspended => "agent.suspended",
12887            Self::AgentTerminated => "agent.terminated",
12888            Self::BillingPaymentFailed => "billing.payment_failed",
12889            Self::BillingSubscriptionPaused => "billing.subscription_paused",
12890            Self::BillingSubscriptionCancelled => "billing.subscription_cancelled",
12891            Self::BillingDisputeOpened => "billing.dispute_opened",
12892            Self::DomainDnsDrift => "domain.dns_drift",
12893            Self::DomainCertFailed => "domain.cert_failed",
12894            Self::DomainCertRenewalDue => "domain.cert_renewal_due",
12895            Self::Other(value) => value.as_str(),
12896        }
12897    }
12898}
12899
12900impl std::fmt::Display for NotificationType {
12901    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12902        f.write_str(self.as_str())
12903    }
12904}
12905
12906impl From<&str> for NotificationType {
12907    fn from(value: &str) -> Self {
12908        match value {
12909            "run.started" => Self::RunStarted,
12910            "run.failed" => Self::RunFailed,
12911            "run.completed" => Self::RunCompleted,
12912            "run.awaiting_approval" => Self::RunAwaitingApproval,
12913            "run.awaiting_input" => Self::RunAwaitingInput,
12914            "approval.requested" => Self::ApprovalRequested,
12915            "budget.warning" => Self::BudgetWarning,
12916            "budget.exceeded" => Self::BudgetExceeded,
12917            "bridge.online" => Self::BridgeOnline,
12918            "bridge.offline" => Self::BridgeOffline,
12919            "invite.accepted" => Self::InviteAccepted,
12920            "marketplace.review" => Self::MarketplaceReview,
12921            "workflow.triggered" => Self::WorkflowTriggered,
12922            "system.alert" => Self::SystemAlert,
12923            "task.completed" => Self::TaskCompleted,
12924            "task.confirmation_required" => Self::TaskConfirmationRequired,
12925            "agent.suspended" => Self::AgentSuspended,
12926            "agent.terminated" => Self::AgentTerminated,
12927            "billing.payment_failed" => Self::BillingPaymentFailed,
12928            "billing.subscription_paused" => Self::BillingSubscriptionPaused,
12929            "billing.subscription_cancelled" => Self::BillingSubscriptionCancelled,
12930            "billing.dispute_opened" => Self::BillingDisputeOpened,
12931            "domain.dns_drift" => Self::DomainDnsDrift,
12932            "domain.cert_failed" => Self::DomainCertFailed,
12933            "domain.cert_renewal_due" => Self::DomainCertRenewalDue,
12934            other => Self::Other(other.to_string()),
12935        }
12936    }
12937}
12938
12939/// `OAuthAppExchangeRequest` model.
12940#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12941pub struct OAuthAppExchangeRequest {
12942    /// The value delivered in the callback fragment.
12943    pub code: String,
12944    /// The secret whose SHA-256, base64url-encoded, was sent as `app_code_challenge` when the flow
12945    /// started. It never leaves the app, which is what makes an intercepted code worthless.
12946    pub code_verifier: String,
12947}
12948
12949/// `OAuthAppExchangeResponse` model.
12950#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12951pub struct OAuthAppExchangeResponse {
12952    pub api_key: String,
12953    #[serde(default, skip_serializing_if = "Option::is_none")]
12954    pub email: Option<String>,
12955}
12956
12957/// Body to complete OAuth after callback
12958#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12959pub struct OAuthCompleteRequest {
12960    pub state: String,
12961    pub code: String,
12962    pub agent_id: String,
12963    /// Display name for this connection
12964    #[serde(default, skip_serializing_if = "Option::is_none")]
12965    pub name: Option<String>,
12966}
12967
12968/// `OAuthIdentityConfig` model.
12969#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12970pub struct OAuthIdentityConfig {
12971    pub apple_services_id: String,
12972    pub apple_team_id: String,
12973    pub apple_bundle_id: String,
12974    /// Lower-cased hostnames. Empty means nothing is allowlisted.
12975    pub oauth_return_to_hosts: Vec<String>,
12976}
12977
12978/// Result after DELETE — record removed from admin KV
12979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12980pub struct OAuthLoginProviderConfigDeleted {
12981    pub provider: OAuthLoginProviderConfigStatusProvider,
12982    /// Always false after a successful DELETE
12983    pub configured: bool,
12984}
12985
12986/// Admin view of one provider's current config. client_secret is never echoed;
12987/// client_secret_hint shows the last 4 chars so the operator can confirm storage.
12988#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12989pub struct OAuthLoginProviderConfigStatus {
12990    pub provider: OAuthLoginProviderConfigStatusProvider,
12991    pub enabled: bool,
12992    /// false when no record exists yet; remaining fields are absent in that case
12993    pub configured: bool,
12994    #[serde(default, skip_serializing_if = "Option::is_none")]
12995    pub client_id: Option<String>,
12996    /// Masked tail of the stored secret (e.g. "••••a1b2"). null if no secret on file.
12997    #[serde(default, skip_serializing_if = "Option::is_none")]
12998    pub client_secret_hint: Option<String>,
12999    /// null when no override; provider defaults apply
13000    #[serde(default, skip_serializing_if = "Option::is_none")]
13001    pub scopes: Option<Vec<String>>,
13002}
13003
13004/// `OAuthLoginProviderConfigStatusProvider` enumeration.
13005#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13006pub enum OAuthLoginProviderConfigStatusProvider {
13007    #[default]
13008    #[serde(rename = "github")]
13009    Github,
13010    #[serde(rename = "google")]
13011    Google,
13012    /// A value the API introduced after this SDK was generated.
13013    #[serde(untagged)]
13014    Other(String),
13015}
13016
13017impl OAuthLoginProviderConfigStatusProvider {
13018    /// The value as it appears on the wire.
13019    pub fn as_str(&self) -> &str {
13020        match self {
13021            Self::Github => "github",
13022            Self::Google => "google",
13023            Self::Other(value) => value.as_str(),
13024        }
13025    }
13026}
13027
13028impl std::fmt::Display for OAuthLoginProviderConfigStatusProvider {
13029    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13030        f.write_str(self.as_str())
13031    }
13032}
13033
13034impl From<&str> for OAuthLoginProviderConfigStatusProvider {
13035    fn from(value: &str) -> Self {
13036        match value {
13037            "github" => Self::Github,
13038            "google" => Self::Google,
13039            other => Self::Other(other.to_string()),
13040        }
13041    }
13042}
13043
13044/// Body for PUT /api/v1/admin/oauth-login-providers/{provider}. Merges with existing record: an
13045/// operator flipping `enabled` or rotating `scopes` does not need to re-paste the secret. The
13046/// first-time PUT (no existing record) requires both client_id and client_secret.
13047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13048pub struct OAuthLoginProviderConfigUpdate {
13049    /// OAuth app client ID issued by the provider
13050    #[serde(default, skip_serializing_if = "Option::is_none")]
13051    pub client_id: Option<String>,
13052    /// OAuth app client secret. Stored verbatim in admin KV; never echoed back.
13053    #[serde(default, skip_serializing_if = "Option::is_none")]
13054    pub client_secret: Option<String>,
13055    /// Defaults to existing value, or true on first write if omitted
13056    #[serde(default, skip_serializing_if = "Option::is_none")]
13057    pub enabled: Option<bool>,
13058    /// Optional override of the provider's default scope list. Omit to inherit defaults.
13059    #[serde(default, skip_serializing_if = "Option::is_none")]
13060    pub scopes: Option<Vec<String>>,
13061}
13062
13063/// Result after PUT — confirms the persisted state
13064#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13065pub struct OAuthLoginProviderConfigUpdateResponse {
13066    pub provider: OAuthLoginProviderConfigStatusProvider,
13067    pub enabled: bool,
13068    pub configured: bool,
13069}
13070
13071/// Public-safe descriptor for an OAuth login (identity) provider. Surfaces only what the login
13072/// page needs to decide which buttons to render — never exposes client_secret.
13073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13074pub struct OAuthLoginProviderItem {
13075    /// Provider identifier used in /auth/oauth/{provider}/start path
13076    pub id: OAuthLoginProviderItemId,
13077    /// Human-readable provider name (e.g. "GitHub", "Google")
13078    pub name: String,
13079    /// true when the operator has configured client_id+client_secret AND set enabled=true. False
13080    /// values mean clicking the button would 404.
13081    pub enabled: bool,
13082}
13083
13084/// Provider identifier used in /auth/oauth/{provider}/start path
13085#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13086pub enum OAuthLoginProviderItemId {
13087    #[default]
13088    #[serde(rename = "github")]
13089    Github,
13090    #[serde(rename = "google")]
13091    Google,
13092    #[serde(rename = "apple")]
13093    Apple,
13094    /// A value the API introduced after this SDK was generated.
13095    #[serde(untagged)]
13096    Other(String),
13097}
13098
13099impl OAuthLoginProviderItemId {
13100    /// The value as it appears on the wire.
13101    pub fn as_str(&self) -> &str {
13102        match self {
13103            Self::Github => "github",
13104            Self::Google => "google",
13105            Self::Apple => "apple",
13106            Self::Other(value) => value.as_str(),
13107        }
13108    }
13109}
13110
13111impl std::fmt::Display for OAuthLoginProviderItemId {
13112    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13113        f.write_str(self.as_str())
13114    }
13115}
13116
13117impl From<&str> for OAuthLoginProviderItemId {
13118    fn from(value: &str) -> Self {
13119        match value {
13120            "github" => Self::Github,
13121            "google" => Self::Google,
13122            "apple" => Self::Apple,
13123            other => Self::Other(other.to_string()),
13124        }
13125    }
13126}
13127
13128/// Response from GET /api/v1/auth/oauth/providers
13129#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13130pub struct OAuthLoginProvidersList {
13131    pub providers: Vec<OAuthLoginProviderItem>,
13132    #[serde(default, skip_serializing_if = "Option::is_none")]
13133    pub google_one_tap_client_id: Option<String>,
13134}
13135
13136/// Response for starting OAuth flow
13137#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13138pub struct OAuthStartResponse {
13139    pub auth_url: String,
13140    pub state: String,
13141}
13142
13143/// One unit of mission work. Sent in full by GET /missions/{missionId}/objectives and by the
13144/// PATCH that edits one.
13145#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13146pub struct Objective {
13147    pub objective_id: String,
13148    pub tenant_id: String,
13149    #[serde(default, skip_serializing_if = "Option::is_none")]
13150    pub company_id: Option<String>,
13151    /// Parent objective, or null for a root objective of the mission.
13152    #[serde(default)]
13153    pub parent_id: Option<String>,
13154    pub title: String,
13155    pub description: String,
13156    /// What the verifier checks before the objective counts as done.
13157    pub success_criteria: Vec<String>,
13158    /// Lifecycle, owned by the executor — PATCH cannot set it.
13159    pub status: ObjectiveStatus,
13160    pub priority: ObjectivePriority,
13161    /// Agent that executes this objective. Mutually exclusive with assigned_team_id in practice.
13162    #[serde(default, skip_serializing_if = "Option::is_none")]
13163    pub assigned_agent_id: Option<String>,
13164    #[serde(default, skip_serializing_if = "Option::is_none")]
13165    pub assigned_team_id: Option<String>,
13166    /// Objective ids that must verify first. The plan is a DAG.
13167    pub dependencies: Vec<String>,
13168    pub budget: ObjectiveBudget,
13169    #[serde(default, skip_serializing_if = "Option::is_none")]
13170    pub result: Option<String>,
13171    #[serde(default, skip_serializing_if = "Option::is_none")]
13172    pub output_summary: Option<String>,
13173    pub progress_notes: Vec<String>,
13174    pub created_at: String,
13175    pub updated_at: String,
13176    #[serde(default, skip_serializing_if = "Option::is_none")]
13177    pub completed_at: Option<String>,
13178    /// The end state to preserve when the literal instruction stops fitting.
13179    #[serde(default, skip_serializing_if = "Option::is_none")]
13180    pub commanders_intent: Option<String>,
13181    #[serde(default, skip_serializing_if = "Option::is_none")]
13182    pub roe: Option<ObjectiveRoE>,
13183    #[serde(default, skip_serializing_if = "Option::is_none")]
13184    pub decision_points: Option<Vec<ObjectiveDecisionPoint>>,
13185    #[serde(default, skip_serializing_if = "Option::is_none")]
13186    pub deadline: Option<String>,
13187    #[serde(default, skip_serializing_if = "Option::is_none")]
13188    pub abort_reason: Option<String>,
13189}
13190
13191/// Per-objective ceiling and what has been spent against it. The executor stops an objective
13192/// that would cross a max.
13193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13194pub struct ObjectiveBudget {
13195    pub max_runs: i64,
13196    pub max_tokens: i64,
13197    pub max_cost_usd: f64,
13198    pub spent_runs: i64,
13199    pub spent_tokens: i64,
13200    pub spent_cost_usd: f64,
13201}
13202
13203/// A branch in the plan: when `condition` holds, execution continues at the matching branch's
13204/// objective instead of the next one in order.
13205#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13206pub struct ObjectiveDecisionPoint {
13207    pub condition: String,
13208    pub branches: Vec<ObjectiveDecisionPointBranch>,
13209    /// Taken when no branch matches.
13210    #[serde(default, skip_serializing_if = "Option::is_none")]
13211    pub fallback_objective_id: Option<String>,
13212}
13213
13214/// `ObjectiveDecisionPointBranch` model.
13215#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13216pub struct ObjectiveDecisionPointBranch {
13217    pub when: String,
13218    pub objective_id: String,
13219}
13220
13221/// `ObjectivePriority` enumeration.
13222#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13223pub enum ObjectivePriority {
13224    #[default]
13225    #[serde(rename = "low")]
13226    Low,
13227    #[serde(rename = "medium")]
13228    Medium,
13229    #[serde(rename = "high")]
13230    High,
13231    #[serde(rename = "critical")]
13232    Critical,
13233    /// A value the API introduced after this SDK was generated.
13234    #[serde(untagged)]
13235    Other(String),
13236}
13237
13238impl ObjectivePriority {
13239    /// The value as it appears on the wire.
13240    pub fn as_str(&self) -> &str {
13241        match self {
13242            Self::Low => "low",
13243            Self::Medium => "medium",
13244            Self::High => "high",
13245            Self::Critical => "critical",
13246            Self::Other(value) => value.as_str(),
13247        }
13248    }
13249}
13250
13251impl std::fmt::Display for ObjectivePriority {
13252    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13253        f.write_str(self.as_str())
13254    }
13255}
13256
13257impl From<&str> for ObjectivePriority {
13258    fn from(value: &str) -> Self {
13259        match value {
13260            "low" => Self::Low,
13261            "medium" => Self::Medium,
13262            "high" => Self::High,
13263            "critical" => Self::Critical,
13264            other => Self::Other(other.to_string()),
13265        }
13266    }
13267}
13268
13269/// Rules of engagement: what the objective may do alone, what needs a human, and what it must
13270/// never do.
13271#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13272pub struct ObjectiveRoE {
13273    pub autonomous_actions: Vec<String>,
13274    pub requires_approval: Vec<String>,
13275    pub prohibited: Vec<String>,
13276}
13277
13278/// Lifecycle, owned by the executor — PATCH cannot set it.
13279#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13280pub enum ObjectiveStatus {
13281    #[default]
13282    #[serde(rename = "pending")]
13283    Pending,
13284    #[serde(rename = "in_progress")]
13285    InProgress,
13286    #[serde(rename = "blocked")]
13287    Blocked,
13288    #[serde(rename = "completed")]
13289    Completed,
13290    #[serde(rename = "failed")]
13291    Failed,
13292    /// A value the API introduced after this SDK was generated.
13293    #[serde(untagged)]
13294    Other(String),
13295}
13296
13297impl ObjectiveStatus {
13298    /// The value as it appears on the wire.
13299    pub fn as_str(&self) -> &str {
13300        match self {
13301            Self::Pending => "pending",
13302            Self::InProgress => "in_progress",
13303            Self::Blocked => "blocked",
13304            Self::Completed => "completed",
13305            Self::Failed => "failed",
13306            Self::Other(value) => value.as_str(),
13307        }
13308    }
13309}
13310
13311impl std::fmt::Display for ObjectiveStatus {
13312    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13313        f.write_str(self.as_str())
13314    }
13315}
13316
13317impl From<&str> for ObjectiveStatus {
13318    fn from(value: &str) -> Self {
13319        match value {
13320            "pending" => Self::Pending,
13321            "in_progress" => Self::InProgress,
13322            "blocked" => Self::Blocked,
13323            "completed" => Self::Completed,
13324            "failed" => Self::Failed,
13325            other => Self::Other(other.to_string()),
13326        }
13327    }
13328}
13329
13330/// Error envelope used by the OpenAI-compatible surface (`/v1/*`). Deliberately NOT RFC 9457:
13331/// callers here are OpenAI SDKs pointed at this base URL, and they decode this shape.
13332#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13333pub struct OpenAiError {
13334    pub error: OpenAiErrorError,
13335}
13336
13337/// `OpenAiErrorError` model.
13338#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13339pub struct OpenAiErrorError {
13340    /// Human-readable cause, including where an operator fixes it.
13341    pub message: String,
13342    pub r#type: String,
13343    /// Machine-readable code. `embedding_unavailable` = no provider configured (501, permanent).
13344    /// `embedding_failed` = the configured provider did not answer (503, retryable).
13345    #[serde(default, skip_serializing_if = "Option::is_none")]
13346    pub code: Option<String>,
13347}
13348
13349/// `PatchMeRequest` model.
13350#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13351pub struct PatchMeRequest {
13352    /// `/api/v1/files/\<file_id\>/content` of an image uploaded with `POST /files`, or `null` to
13353    /// clear.
13354    #[serde(default)]
13355    pub avatar_url: Option<String>,
13356}
13357
13358/// `PatchMeResponse` model.
13359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13360pub struct PatchMeResponse {
13361    pub user: PatchMeResponseUser,
13362    pub updated_rows: i64,
13363}
13364
13365/// `PatchMeResponseUser` model.
13366#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13367pub struct PatchMeResponseUser {
13368    pub user_id: String,
13369    pub email: String,
13370    #[serde(default, skip_serializing_if = "Option::is_none")]
13371    pub name: Option<String>,
13372    pub role: String,
13373    pub status: String,
13374    #[serde(default)]
13375    pub avatar_url: Option<String>,
13376}
13377
13378/// `PauseCompanyResponse` model.
13379#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13380pub struct PauseCompanyResponse {
13381    #[serde(default, skip_serializing_if = "Option::is_none")]
13382    pub status: Option<String>,
13383}
13384
13385/// `PauseMissionResponse` model.
13386#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13387pub struct PauseMissionResponse {
13388    pub pausing: bool,
13389    pub mission: Mission,
13390}
13391
13392/// `PauseRunResponse` model.
13393#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13394pub struct PauseRunResponse {
13395    pub paused: bool,
13396    pub run_id: String,
13397}
13398
13399/// `PermissionCheckResult` model.
13400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13401pub struct PermissionCheckResult {
13402    pub allowed: bool,
13403    #[serde(default, skip_serializing_if = "Option::is_none")]
13404    pub reason: Option<String>,
13405    #[serde(default, skip_serializing_if = "Option::is_none")]
13406    pub denied_permissions: Option<Vec<String>>,
13407}
13408
13409/// Per-agent capability envelope. Invariant: PermissionSet(child) ⊆ PermissionSet(parent).
13410#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13411pub struct PermissionSet {
13412    pub agent_id: String,
13413    pub tenant_id: String,
13414    pub allowed_tools: Vec<String>,
13415    #[serde(default, skip_serializing_if = "Option::is_none")]
13416    pub allowed_roles: Option<Vec<String>>,
13417    #[serde(default, skip_serializing_if = "Option::is_none")]
13418    pub resource_permissions: Option<Vec<ResourcePermission>>,
13419    #[serde(default, skip_serializing_if = "Option::is_none")]
13420    pub max_budget_per_run_usd: Option<f64>,
13421    pub max_spawn_depth: i64,
13422    pub can_spawn: bool,
13423    #[serde(default, skip_serializing_if = "Option::is_none")]
13424    pub can_self_modify: Option<bool>,
13425    #[serde(default, skip_serializing_if = "Option::is_none")]
13426    pub parent_agent_id: Option<String>,
13427    #[serde(default, skip_serializing_if = "Option::is_none")]
13428    pub created_at: Option<String>,
13429    #[serde(default, skip_serializing_if = "Option::is_none")]
13430    pub updated_at: Option<String>,
13431}
13432
13433/// Body of PUT /governance/permissions/{agentId}. Every field optional: a field the body omits
13434/// keeps its stored value (mergePermissionSet), and only a first write falls back to the
13435/// defaults. `agent_id`, `tenant_id`, `created_at`, `updated_at` are set by the server and
13436/// ignored in the body.
13437#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13438pub struct PermissionSetUpdate {
13439    /// Sending this field REPLACES the stored list (the handler stores the array as sent, it does
13440    /// not merge).
13441    #[serde(default, skip_serializing_if = "Option::is_none")]
13442    pub allowed_tools: Option<Vec<String>>,
13443    /// Sending this field REPLACES the stored list (the handler stores the array as sent, it does
13444    /// not merge).
13445    #[serde(default, skip_serializing_if = "Option::is_none")]
13446    pub allowed_roles: Option<Vec<String>>,
13447    /// Sending this field REPLACES the stored list (the handler stores the array as sent, it does
13448    /// not merge).
13449    #[serde(default, skip_serializing_if = "Option::is_none")]
13450    pub resource_permissions: Option<Vec<ResourcePermission>>,
13451    #[serde(default, skip_serializing_if = "Option::is_none")]
13452    pub max_budget_per_run_usd: Option<f64>,
13453    #[serde(default, skip_serializing_if = "Option::is_none")]
13454    pub max_spawn_depth: Option<i64>,
13455    #[serde(default, skip_serializing_if = "Option::is_none")]
13456    pub can_spawn: Option<bool>,
13457    #[serde(default, skip_serializing_if = "Option::is_none")]
13458    pub can_self_modify: Option<bool>,
13459    #[serde(default, skip_serializing_if = "Option::is_none")]
13460    pub parent_agent_id: Option<String>,
13461}
13462
13463/// `PlanLLMLimits` model.
13464#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13465pub struct PlanLLMLimits {
13466    #[serde(default, skip_serializing_if = "Option::is_none")]
13467    pub tier_access: Option<Vec<PlanLLMLimitsTierAccessItem>>,
13468    #[serde(default, skip_serializing_if = "Option::is_none")]
13469    pub tokens_per_month: Option<i64>,
13470    #[serde(default, skip_serializing_if = "Option::is_none")]
13471    pub requests_per_minute: Option<i64>,
13472    #[serde(default, skip_serializing_if = "Option::is_none")]
13473    pub requests_per_hour: Option<i64>,
13474    #[serde(default, skip_serializing_if = "Option::is_none")]
13475    pub requests_per_day: Option<i64>,
13476}
13477
13478/// `PlanLLMLimitsTierAccessItem` enumeration.
13479#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13480pub enum PlanLLMLimitsTierAccessItem {
13481    #[default]
13482    #[serde(rename = "starter")]
13483    Starter,
13484    #[serde(rename = "pro")]
13485    Pro,
13486    #[serde(rename = "enterprise")]
13487    Enterprise,
13488    /// A value the API introduced after this SDK was generated.
13489    #[serde(untagged)]
13490    Other(String),
13491}
13492
13493impl PlanLLMLimitsTierAccessItem {
13494    /// The value as it appears on the wire.
13495    pub fn as_str(&self) -> &str {
13496        match self {
13497            Self::Starter => "starter",
13498            Self::Pro => "pro",
13499            Self::Enterprise => "enterprise",
13500            Self::Other(value) => value.as_str(),
13501        }
13502    }
13503}
13504
13505impl std::fmt::Display for PlanLLMLimitsTierAccessItem {
13506    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13507        f.write_str(self.as_str())
13508    }
13509}
13510
13511impl From<&str> for PlanLLMLimitsTierAccessItem {
13512    fn from(value: &str) -> Self {
13513        match value {
13514            "starter" => Self::Starter,
13515            "pro" => Self::Pro,
13516            "enterprise" => Self::Enterprise,
13517            other => Self::Other(other.to_string()),
13518        }
13519    }
13520}
13521
13522/// A fully decomposed plan. Supplying one skips the LLM planner entirely.
13523#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13524pub struct PlannedMission {
13525    pub goal: String,
13526    pub classification: MissionClassification,
13527    pub objectives: Vec<PlannedObjective>,
13528    /// When true the mission stops at `awaiting_authorization` instead of executing — the gate for
13529    /// destructive or externally visible plans.
13530    pub requires_authorization: bool,
13531    #[serde(default, skip_serializing_if = "Option::is_none")]
13532    pub deadline: Option<String>,
13533}
13534
13535/// An objective as supplied in a caller-written plan. Dependencies are INDICES into
13536/// `objectives`, because ids do not exist until the plan is persisted.
13537#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13538pub struct PlannedObjective {
13539    pub title: String,
13540    pub description: String,
13541    pub success_criteria: Vec<String>,
13542    pub priority: ObjectivePriority,
13543    /// Indices into `objectives`; must form a DAG or the plan is rejected.
13544    pub depends_on_indices: Vec<i64>,
13545    #[serde(default, skip_serializing_if = "Option::is_none")]
13546    pub assigned_agent_id: Option<String>,
13547    #[serde(default, skip_serializing_if = "Option::is_none")]
13548    pub assigned_team_id: Option<String>,
13549    /// Ceilings only — the spent_* counters are created by the server.
13550    pub budget: PlannedObjectiveBudget,
13551    #[serde(default, skip_serializing_if = "Option::is_none")]
13552    pub commanders_intent: Option<String>,
13553    #[serde(default, skip_serializing_if = "Option::is_none")]
13554    pub roe: Option<ObjectiveRoE>,
13555    #[serde(default, skip_serializing_if = "Option::is_none")]
13556    pub deadline: Option<String>,
13557    #[serde(default, skip_serializing_if = "Option::is_none")]
13558    pub decision_points: Option<Vec<ObjectiveDecisionPoint>>,
13559}
13560
13561/// Ceilings only — the spent_* counters are created by the server.
13562#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13563pub struct PlannedObjectiveBudget {
13564    pub max_runs: i64,
13565    pub max_tokens: i64,
13566    pub max_cost_usd: f64,
13567}
13568
13569/// Platform profit and loss: Stripe revenue against real host spend and the LLM provider bill.
13570/// Super-admin only. Served from a short-lived cache — `cache` says which.
13571#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13572pub struct PlatformEconomics {
13573    pub revenue: PlatformEconomicsRevenue,
13574    pub costs: PlatformEconomicsCosts,
13575    /// What the platform paid model providers for tokens, from the usage shards' pre-markup
13576    /// `provider_cost` summed over every tenant. The largest variable cost; absent from this report
13577    /// until 2026-09-02.
13578    pub llm: PlatformEconomicsLLM,
13579    pub economics: PlatformEconomicsEconomics,
13580    pub generated_at: String,
13581    /// `hit` — served from cache; `miss` — computed and cached; `bypass` — recomputed because
13582    /// `refresh=1`.
13583    pub cache: PlatformEconomicsCache,
13584}
13585
13586/// `hit` — served from cache; `miss` — computed and cached; `bypass` — recomputed because
13587/// `refresh=1`.
13588#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13589pub enum PlatformEconomicsCache {
13590    #[default]
13591    #[serde(rename = "hit")]
13592    Hit,
13593    #[serde(rename = "miss")]
13594    Miss,
13595    #[serde(rename = "bypass")]
13596    Bypass,
13597    /// A value the API introduced after this SDK was generated.
13598    #[serde(untagged)]
13599    Other(String),
13600}
13601
13602impl PlatformEconomicsCache {
13603    /// The value as it appears on the wire.
13604    pub fn as_str(&self) -> &str {
13605        match self {
13606            Self::Hit => "hit",
13607            Self::Miss => "miss",
13608            Self::Bypass => "bypass",
13609            Self::Other(value) => value.as_str(),
13610        }
13611    }
13612}
13613
13614impl std::fmt::Display for PlatformEconomicsCache {
13615    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13616        f.write_str(self.as_str())
13617    }
13618}
13619
13620impl From<&str> for PlatformEconomicsCache {
13621    fn from(value: &str) -> Self {
13622        match value {
13623            "hit" => Self::Hit,
13624            "miss" => Self::Miss,
13625            "bypass" => Self::Bypass,
13626            other => Self::Other(other.to_string()),
13627        }
13628    }
13629}
13630
13631/// `PlatformEconomicsCosts` model.
13632#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13633pub struct PlatformEconomicsCosts {
13634    pub provider: PlatformEconomicsCostsProvider,
13635    pub configured: bool,
13636    /// Real accrued spend from the provider's own meter.
13637    #[serde(default)]
13638    pub month_to_date_usd: Option<f64>,
13639    /// Negative means credit.
13640    #[serde(default)]
13641    pub account_balance_usd: Option<f64>,
13642    #[serde(default)]
13643    pub balance_generated_at: Option<String>,
13644    pub droplets: Vec<HostDroplet>,
13645    /// Sum of droplet list prices — steady state, not accrued.
13646    pub monthly_run_rate_usd: f64,
13647    #[serde(default, skip_serializing_if = "Option::is_none")]
13648    pub error: Option<String>,
13649}
13650
13651/// `PlatformEconomicsCostsProvider` enumeration.
13652#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13653pub enum PlatformEconomicsCostsProvider {
13654    #[default]
13655    #[serde(rename = "digitalocean")]
13656    Digitalocean,
13657    /// A value the API introduced after this SDK was generated.
13658    #[serde(untagged)]
13659    Other(String),
13660}
13661
13662impl PlatformEconomicsCostsProvider {
13663    /// The value as it appears on the wire.
13664    pub fn as_str(&self) -> &str {
13665        match self {
13666            Self::Digitalocean => "digitalocean",
13667            Self::Other(value) => value.as_str(),
13668        }
13669    }
13670}
13671
13672impl std::fmt::Display for PlatformEconomicsCostsProvider {
13673    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13674        f.write_str(self.as_str())
13675    }
13676}
13677
13678impl From<&str> for PlatformEconomicsCostsProvider {
13679    fn from(value: &str) -> Self {
13680        match value {
13681            "digitalocean" => Self::Digitalocean,
13682            other => Self::Other(other.to_string()),
13683        }
13684    }
13685}
13686
13687/// `PlatformEconomicsEconomics` model.
13688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13689pub struct PlatformEconomicsEconomics {
13690    pub monthly_revenue_usd: f64,
13691    pub monthly_infra_usd: f64,
13692    /// `llm.monthly_run_rate_usd` — see `llm.run_rate_basis` for how it was reached.
13693    pub monthly_llm_usd: f64,
13694    /// MRR − infra run rate − LLM run rate.
13695    pub monthly_margin_usd: f64,
13696    /// Null when there is no revenue to divide by — not zero, which would read as a 0% margin.
13697    #[serde(default)]
13698    pub margin_percent: Option<f64>,
13699    #[serde(default)]
13700    pub month_to_date_infra_usd: Option<f64>,
13701    #[serde(default)]
13702    pub markup_percent: Option<f64>,
13703    #[serde(default)]
13704    pub pricing_tiers: Option<serde_json::Map<String, serde_json::Value>>,
13705}
13706
13707/// What the platform paid model providers for tokens, from the usage shards' pre-markup
13708/// `provider_cost` summed over every tenant. The largest variable cost; absent from this report
13709/// until 2026-09-02.
13710#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13711pub struct PlatformEconomicsLLM {
13712    /// YYYY-MM, UTC — the period the usage shards are keyed by.
13713    pub period: String,
13714    pub month_to_date_provider_usd: f64,
13715    /// What tenants were billed for the same usage (provider × markup).
13716    pub month_to_date_billed_usd: f64,
13717    pub previous_period: String,
13718    pub previous_period_provider_usd: f64,
13719    pub previous_period_billed_usd: f64,
13720    /// The figure folded into `economics.monthly_llm_usd`.
13721    pub monthly_run_rate_usd: f64,
13722    /// `previous_period` — last month's full bill; `month_to_date_extrapolated` — this month's
13723    /// spend scaled to a full month, a guess that is loudest on the 1st; `none` — nothing recorded
13724    /// yet.
13725    pub run_rate_basis: PlatformEconomicsLLMRunRateBasis,
13726    pub tenants_with_usage: i64,
13727    pub by_model: Vec<PlatformEconomicsLLMByModelItem>,
13728    /// What the number does not know: own-key proxy traffic is counted although the tenant paid it;
13729    /// shards older than the field count 0.
13730    pub caveats: Vec<String>,
13731    #[serde(default, skip_serializing_if = "Option::is_none")]
13732    pub error: Option<String>,
13733}
13734
13735/// `PlatformEconomicsLLMByModelItem` model.
13736#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13737pub struct PlatformEconomicsLLMByModelItem {
13738    pub model: String,
13739    pub provider_usd: f64,
13740    pub billed_usd: f64,
13741    pub tokens: i64,
13742}
13743
13744/// `previous_period` — last month's full bill; `month_to_date_extrapolated` — this month's
13745/// spend scaled to a full month, a guess that is loudest on the 1st; `none` — nothing recorded
13746/// yet.
13747#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13748pub enum PlatformEconomicsLLMRunRateBasis {
13749    #[default]
13750    #[serde(rename = "previous_period")]
13751    PreviousPeriod,
13752    #[serde(rename = "month_to_date_extrapolated")]
13753    MonthToDateExtrapolated,
13754    #[serde(rename = "none")]
13755    None,
13756    /// A value the API introduced after this SDK was generated.
13757    #[serde(untagged)]
13758    Other(String),
13759}
13760
13761impl PlatformEconomicsLLMRunRateBasis {
13762    /// The value as it appears on the wire.
13763    pub fn as_str(&self) -> &str {
13764        match self {
13765            Self::PreviousPeriod => "previous_period",
13766            Self::MonthToDateExtrapolated => "month_to_date_extrapolated",
13767            Self::None => "none",
13768            Self::Other(value) => value.as_str(),
13769        }
13770    }
13771}
13772
13773impl std::fmt::Display for PlatformEconomicsLLMRunRateBasis {
13774    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13775        f.write_str(self.as_str())
13776    }
13777}
13778
13779impl From<&str> for PlatformEconomicsLLMRunRateBasis {
13780    fn from(value: &str) -> Self {
13781        match value {
13782            "previous_period" => Self::PreviousPeriod,
13783            "month_to_date_extrapolated" => Self::MonthToDateExtrapolated,
13784            "none" => Self::None,
13785            other => Self::Other(other.to_string()),
13786        }
13787    }
13788}
13789
13790/// `PlatformEconomicsRevenue` model.
13791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13792pub struct PlatformEconomicsRevenue {
13793    /// False on a deployment with no Stripe key; the figures are then zeros, not an error.
13794    pub stripe_configured: bool,
13795    pub mrr_usd: f64,
13796    pub arr_usd: f64,
13797    pub subscriptions: Vec<PlatformEconomicsRevenueSubscription>,
13798    pub by_status: serde_json::Map<String, serde_json::Value>,
13799    /// Present when Stripe could not be reached; the rest of the payload is still served.
13800    #[serde(default, skip_serializing_if = "Option::is_none")]
13801    pub error: Option<String>,
13802}
13803
13804/// `PlatformEconomicsRevenueSubscription` model.
13805#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13806pub struct PlatformEconomicsRevenueSubscription {
13807    pub subscription_id: String,
13808    pub customer_id: String,
13809    #[serde(default)]
13810    pub tenant_id: Option<String>,
13811    #[serde(default)]
13812    pub tenant_name: Option<String>,
13813    #[serde(default)]
13814    pub plan: Option<String>,
13815    #[serde(default)]
13816    pub billing_status: Option<String>,
13817    pub status: String,
13818    pub monthly_usd: f64,
13819    pub currency: String,
13820    pub interval: String,
13821    #[serde(default)]
13822    pub current_period_end: Option<String>,
13823    pub cancel_at_period_end: bool,
13824}
13825
13826/// What an unauthenticated page may know about this deployment. Deliberately minimal — no
13827/// secrets and no wizard step names, so a probe cannot enumerate what setup still has pending.
13828#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13829pub struct PlatformInfo {
13830    /// The platform's own base URL, so a client need not bake it into its bundle.
13831    pub public_base_url: String,
13832    /// Role → address. Always an object, possibly empty — a client gates each link on presence
13833    /// rather than handling nulls.
13834    pub contact_emails: serde_json::Map<String, serde_json::Value>,
13835    /// True once the platform is live.
13836    pub setup_complete: bool,
13837    pub registration_open: bool,
13838}
13839
13840/// `PlatformLLMDefaults` model.
13841#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13842pub struct PlatformLLMDefaults {
13843    #[serde(default, skip_serializing_if = "Option::is_none")]
13844    pub default_endpoint: Option<String>,
13845    /// Stored model half. May be bare (`minimax-m3`) or already provider-qualified
13846    /// (`ollama/glm-5.2`) — production holds both shapes. Dial `default_model_ref` instead of
13847    /// joining this yourself.
13848    #[serde(default, skip_serializing_if = "Option::is_none")]
13849    pub default_model: Option<String>,
13850    #[serde(default, skip_serializing_if = "Option::is_none")]
13851    pub default_provider: Option<String>,
13852    /// Stored model half of the fallback. A vendor path (`MiniMaxAI/MiniMax-M3`) carries a slash
13853    /// while naming no provider, so this string is NOT dialable on its own — use
13854    /// `fallback_model_ref`.
13855    #[serde(default, skip_serializing_if = "Option::is_none")]
13856    pub fallback_model: Option<String>,
13857    #[serde(default, skip_serializing_if = "Option::is_none")]
13858    pub fallback_provider: Option<String>,
13859    /// The default as the chat surface accepts it: `provider/model`, already de-duplicated against
13860    /// a model half that carries the provider head. Null when no default model is configured.
13861    #[serde(default, skip_serializing_if = "Option::is_none")]
13862    pub default_model_ref: Option<String>,
13863    /// Same for the fallback. Null when no fallback model is configured.
13864    #[serde(default, skip_serializing_if = "Option::is_none")]
13865    pub fallback_model_ref: Option<String>,
13866}
13867
13868/// The visual-builder canvas of an agent as GET /playground/agents/{agentId} serves it
13869/// (measured 2026-09-10 on e2e-canon); PUT returns the same shape after the write.
13870#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13871pub struct PlaygroundAgentState {
13872    pub agent_id: String,
13873    pub tenant_id: String,
13874    pub nodes: Vec<serde_json::Map<String, serde_json::Value>>,
13875    pub edges: Vec<serde_json::Map<String, serde_json::Value>>,
13876    pub metadata: serde_json::Map<String, serde_json::Value>,
13877    pub updated_at: String,
13878}
13879
13880/// One starter template from GET /playground/templates (element keys measured 2026-09-10).
13881#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13882pub struct PlaygroundTemplate {
13883    pub id: String,
13884    pub name: String,
13885    pub description: String,
13886    pub category: String,
13887    pub nodes: Vec<serde_json::Map<String, serde_json::Value>>,
13888    pub edges: Vec<serde_json::Map<String, serde_json::Value>>,
13889}
13890
13891/// An ordered curriculum an agent delivers.
13892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13893pub struct Program {
13894    pub program_id: String,
13895    pub tenant_id: String,
13896    pub agent_id: String,
13897    pub name: String,
13898    #[serde(default, skip_serializing_if = "Option::is_none")]
13899    pub description: Option<String>,
13900    #[serde(default, skip_serializing_if = "Option::is_none")]
13901    pub listing_id: Option<String>,
13902    pub steps: Vec<ProgramStep>,
13903    #[serde(default, skip_serializing_if = "Option::is_none")]
13904    pub created_at: Option<String>,
13905    #[serde(default, skip_serializing_if = "Option::is_none")]
13906    pub updated_at: Option<String>,
13907}
13908
13909/// `ProgramStep` model.
13910#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13911pub struct ProgramStep {
13912    /// Generated by the server.
13913    pub step_id: String,
13914    pub title: String,
13915    pub order_index: i64,
13916}
13917
13918/// A named body of work that chats belong to: standing instructions, the knowledge bases its
13919/// chats may search, and the files they can read. An agent is *who* answers; a project is *what
13920/// about*.
13921#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13922pub struct Project {
13923    pub project_id: String,
13924    pub tenant_id: String,
13925    pub name: String,
13926    #[serde(default, skip_serializing_if = "Option::is_none")]
13927    pub description: Option<String>,
13928    /// Injected into the system prompt below the agent's own prompt and above personal preferences.
13929    #[serde(default, skip_serializing_if = "Option::is_none")]
13930    pub instructions: Option<String>,
13931    #[serde(default, skip_serializing_if = "Option::is_none")]
13932    pub knowledge_base_ids: Option<Vec<String>>,
13933    /// Ids that no longer resolve to a file in this tenant are dropped on write — an attachment
13934    /// that lies is worse than a rejected one.
13935    #[serde(default, skip_serializing_if = "Option::is_none")]
13936    pub file_ids: Option<Vec<String>>,
13937    /// Owns a private project outright.
13938    #[serde(default, skip_serializing_if = "Option::is_none")]
13939    pub created_by: Option<String>,
13940    /// `tenant` (the default, and what every pre-existing project is) or `private`.
13941    #[serde(default, skip_serializing_if = "Option::is_none")]
13942    pub visibility: Option<ProjectVisibility>,
13943    /// Ignored while `visibility` is `tenant`.
13944    #[serde(default, skip_serializing_if = "Option::is_none")]
13945    pub shared_with: Option<Vec<ProjectGrant>>,
13946    /// Absent or null when the project is live. Archiving hides it from the default list and loses
13947    /// nothing.
13948    #[serde(default, skip_serializing_if = "Option::is_none")]
13949    pub archived_at: Option<String>,
13950    pub created_at: String,
13951    pub updated_at: String,
13952}
13953
13954/// A project with its chats and the caller's own access level.
13955#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13956pub struct ProjectDetail {
13957    pub project_id: String,
13958    pub tenant_id: String,
13959    pub name: String,
13960    #[serde(default, skip_serializing_if = "Option::is_none")]
13961    pub description: Option<String>,
13962    /// Injected into the system prompt below the agent's own prompt and above personal preferences.
13963    #[serde(default, skip_serializing_if = "Option::is_none")]
13964    pub instructions: Option<String>,
13965    #[serde(default, skip_serializing_if = "Option::is_none")]
13966    pub knowledge_base_ids: Option<Vec<String>>,
13967    /// Ids that no longer resolve to a file in this tenant are dropped on write — an attachment
13968    /// that lies is worse than a rejected one.
13969    #[serde(default, skip_serializing_if = "Option::is_none")]
13970    pub file_ids: Option<Vec<String>>,
13971    /// Owns a private project outright.
13972    #[serde(default, skip_serializing_if = "Option::is_none")]
13973    pub created_by: Option<String>,
13974    /// `tenant` (the default, and what every pre-existing project is) or `private`.
13975    #[serde(default, skip_serializing_if = "Option::is_none")]
13976    pub visibility: Option<ProjectVisibility>,
13977    /// Ignored while `visibility` is `tenant`.
13978    #[serde(default, skip_serializing_if = "Option::is_none")]
13979    pub shared_with: Option<Vec<ProjectGrant>>,
13980    /// Absent or null when the project is live. Archiving hides it from the default list and loses
13981    /// nothing.
13982    #[serde(default, skip_serializing_if = "Option::is_none")]
13983    pub archived_at: Option<String>,
13984    pub created_at: String,
13985    pub updated_at: String,
13986    /// The chats filed under this project, most recently updated first.
13987    pub sessions: Vec<ProjectDetailSession>,
13988    pub session_count: i64,
13989    /// What THIS caller may do. `none` never reaches a client — it is answered as 404.
13990    pub access: ProjectGrantAccess,
13991}
13992
13993/// `ProjectDetailSession` model.
13994#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13995pub struct ProjectDetailSession {
13996    pub session_id: String,
13997    pub agent_id: String,
13998    #[serde(default, skip_serializing_if = "Option::is_none")]
13999    pub updated_at: Option<String>,
14000    #[serde(default, skip_serializing_if = "Option::is_none")]
14001    pub title: Option<String>,
14002}
14003
14004/// One person's access to a private project.
14005#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14006pub struct ProjectGrant {
14007    pub user_id: String,
14008    /// `view` opens the chats and the brief; `edit` also rewrites them.
14009    pub access: ProjectGrantAccess,
14010}
14011
14012/// `view` opens the chats and the brief; `edit` also rewrites them.
14013#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
14014pub enum ProjectGrantAccess {
14015    #[default]
14016    #[serde(rename = "view")]
14017    View,
14018    #[serde(rename = "edit")]
14019    Edit,
14020    /// A value the API introduced after this SDK was generated.
14021    #[serde(untagged)]
14022    Other(String),
14023}
14024
14025impl ProjectGrantAccess {
14026    /// The value as it appears on the wire.
14027    pub fn as_str(&self) -> &str {
14028        match self {
14029            Self::View => "view",
14030            Self::Edit => "edit",
14031            Self::Other(value) => value.as_str(),
14032        }
14033    }
14034}
14035
14036impl std::fmt::Display for ProjectGrantAccess {
14037    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14038        f.write_str(self.as_str())
14039    }
14040}
14041
14042impl From<&str> for ProjectGrantAccess {
14043    fn from(value: &str) -> Self {
14044        match value {
14045            "view" => Self::View,
14046            "edit" => Self::Edit,
14047            other => Self::Other(other.to_string()),
14048        }
14049    }
14050}
14051
14052/// `tenant` (the default, and what every pre-existing project is) or `private`.
14053#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
14054pub enum ProjectVisibility {
14055    #[default]
14056    #[serde(rename = "tenant")]
14057    Tenant,
14058    #[serde(rename = "private")]
14059    Private,
14060    /// A value the API introduced after this SDK was generated.
14061    #[serde(untagged)]
14062    Other(String),
14063}
14064
14065impl ProjectVisibility {
14066    /// The value as it appears on the wire.
14067    pub fn as_str(&self) -> &str {
14068        match self {
14069            Self::Tenant => "tenant",
14070            Self::Private => "private",
14071            Self::Other(value) => value.as_str(),
14072        }
14073    }
14074}
14075
14076impl std::fmt::Display for ProjectVisibility {
14077    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14078        f.write_str(self.as_str())
14079    }
14080}
14081
14082impl From<&str> for ProjectVisibility {
14083    fn from(value: &str) -> Self {
14084        match value {
14085            "tenant" => Self::Tenant,
14086            "private" => Self::Private,
14087            other => Self::Other(other.to_string()),
14088        }
14089    }
14090}
14091
14092/// `PromoCode` model.
14093#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14094pub struct PromoCode {
14095    /// Upper-cased.
14096    pub code: String,
14097    /// Absent when unset.
14098    #[serde(default, skip_serializing_if = "Option::is_none")]
14099    pub program: Option<String>,
14100    /// The tenant that earns the reward.
14101    pub owner_tenant_id: String,
14102    pub reward_tokens_per_subscription: i64,
14103    /// Welcome grant to the redeeming tenant. Absent when unset.
14104    #[serde(default, skip_serializing_if = "Option::is_none")]
14105    pub subscriber_bonus_tokens: Option<i64>,
14106    /// Absent when unset.
14107    #[serde(default, skip_serializing_if = "Option::is_none")]
14108    pub discount_percent: Option<f64>,
14109    /// Scopes the code to ONE plan: the reward is skipped when it is set and does not match the
14110    /// plan being paid for. Absent means the code pays out on every plan.
14111    #[serde(default, skip_serializing_if = "Option::is_none")]
14112    pub target_plan_id: Option<String>,
14113    /// Absent means unlimited.
14114    #[serde(default, skip_serializing_if = "Option::is_none")]
14115    pub max_uses: Option<i64>,
14116    /// Server-maintained; carried across a replacing write.
14117    pub uses: i64,
14118    pub active: bool,
14119    /// Carried across a replacing write.
14120    pub created_at: String,
14121    pub updated_at: String,
14122}
14123
14124/// `PromoCodeInput` model.
14125#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14126pub struct PromoCodeInput {
14127    #[serde(default, skip_serializing_if = "Option::is_none")]
14128    pub program: Option<String>,
14129    pub owner_tenant_id: String,
14130    pub reward_tokens_per_subscription: i64,
14131    #[serde(default, skip_serializing_if = "Option::is_none")]
14132    pub subscriber_bonus_tokens: Option<i64>,
14133    #[serde(default, skip_serializing_if = "Option::is_none")]
14134    pub discount_percent: Option<f64>,
14135    /// Resend this on every update — the write replaces, so omitting it unscopes the code.
14136    #[serde(default, skip_serializing_if = "Option::is_none")]
14137    pub target_plan_id: Option<String>,
14138    #[serde(default, skip_serializing_if = "Option::is_none")]
14139    pub max_uses: Option<i64>,
14140    /// Omitting this on an update REACTIVATES a deactivated code.
14141    ///
14142    /// Server default: `true`.
14143    #[serde(default, skip_serializing_if = "Option::is_none")]
14144    pub active: Option<bool>,
14145}
14146
14147/// `PublicBlogPost` model.
14148#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14149pub struct PublicBlogPost {
14150    pub slug: String,
14151    pub title: String,
14152    /// Markdown.
14153    pub body: String,
14154    pub tags: Vec<String>,
14155    pub published_at: String,
14156    pub created_at: String,
14157    pub updated_at: String,
14158}
14159
14160/// `PublicBlogPostSummary` model.
14161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14162pub struct PublicBlogPostSummary {
14163    pub slug: String,
14164    pub title: String,
14165    pub tags: Vec<String>,
14166    /// Body with its leading heading and markdown punctuation stripped, first 240 characters.
14167    pub excerpt: String,
14168    pub published_at: String,
14169}
14170
14171/// Funnel for public (unauthenticated) chat surfaces: visits, engagement, messages, with the
14172/// usual breakdowns.
14173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14174pub struct PublicChatAnalytics {
14175    pub range: PublicChatAnalyticsRange,
14176    pub totals: PublicChatAnalyticsTotals,
14177    /// Ratios, not percentages: 0.25 means a quarter.
14178    pub conversion: PublicChatAnalyticsConversion,
14179    pub timeseries: Vec<PublicChatAnalyticsTimesery>,
14180    pub by_country: Vec<PublicChatAnalyticsByCountryItem>,
14181    pub by_device: Vec<PublicChatAnalyticsByDeviceItem>,
14182    pub by_browser: Vec<PublicChatAnalyticsByBrowserItem>,
14183    pub by_os: Vec<PublicChatAnalyticsByO>,
14184    pub by_referrer: Vec<PublicChatAnalyticsByReferrerItem>,
14185    pub by_utm_source: Vec<PublicChatAnalyticsByUtmSourceItem>,
14186    pub by_agent: Vec<PublicChatAnalyticsByAgentItem>,
14187}
14188
14189/// `PublicChatAnalyticsByAgentItem` model.
14190#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14191pub struct PublicChatAnalyticsByAgentItem {
14192    pub agent_id: String,
14193    pub visits: i64,
14194    pub engaged: i64,
14195    pub messages: i64,
14196}
14197
14198/// `PublicChatAnalyticsByBrowserItem` model.
14199#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14200pub struct PublicChatAnalyticsByBrowserItem {
14201    pub value: String,
14202    pub count: i64,
14203}
14204
14205/// `PublicChatAnalyticsByCountryItem` model.
14206#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14207pub struct PublicChatAnalyticsByCountryItem {
14208    pub value: String,
14209    pub count: i64,
14210}
14211
14212/// `PublicChatAnalyticsByDeviceItem` model.
14213#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14214pub struct PublicChatAnalyticsByDeviceItem {
14215    pub value: String,
14216    pub count: i64,
14217}
14218
14219/// `PublicChatAnalyticsByO` model.
14220#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14221pub struct PublicChatAnalyticsByO {
14222    pub value: String,
14223    pub count: i64,
14224}
14225
14226/// `PublicChatAnalyticsByReferrerItem` model.
14227#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14228pub struct PublicChatAnalyticsByReferrerItem {
14229    pub value: String,
14230    pub count: i64,
14231}
14232
14233/// `PublicChatAnalyticsByUtmSourceItem` model.
14234#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14235pub struct PublicChatAnalyticsByUtmSourceItem {
14236    pub value: String,
14237    pub count: i64,
14238}
14239
14240/// Ratios, not percentages: 0.25 means a quarter.
14241#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14242pub struct PublicChatAnalyticsConversion {
14243    /// engaged / visit.
14244    pub engagement_rate: f64,
14245    /// message / visit.
14246    pub message_rate: f64,
14247    /// message / engaged.
14248    pub engaged_to_message_rate: f64,
14249}
14250
14251/// `PublicChatAnalyticsRange` model.
14252#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14253pub struct PublicChatAnalyticsRange {
14254    pub from: String,
14255    pub to: String,
14256    pub days: i64,
14257}
14258
14259/// `PublicChatAnalyticsTimesery` model.
14260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14261pub struct PublicChatAnalyticsTimesery {
14262    pub date: String,
14263    pub visits: i64,
14264    pub engaged: i64,
14265    pub messages: i64,
14266}
14267
14268/// `PublicChatAnalyticsTotals` model.
14269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14270pub struct PublicChatAnalyticsTotals {
14271    pub public_chat_visit: i64,
14272    pub public_chat_engaged: i64,
14273    pub public_chat_message: i64,
14274}
14275
14276/// `PublicDomainLookupResponse` model.
14277#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14278pub struct PublicDomainLookupResponse {
14279    #[serde(default, skip_serializing_if = "Option::is_none")]
14280    pub tenant_id: Option<String>,
14281    #[serde(default, skip_serializing_if = "Option::is_none")]
14282    pub found: Option<bool>,
14283}
14284
14285/// `PublicPlan` model.
14286#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14287pub struct PublicPlan {
14288    pub id: String,
14289    pub name: String,
14290    pub price_amount_cents: i64,
14291    pub price_currency: String,
14292    pub quotas: serde_json::Map<String, serde_json::Value>,
14293}
14294
14295/// `PublicState` model.
14296#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14297pub struct PublicState {
14298    #[serde(default, skip_serializing_if = "Option::is_none")]
14299    pub marketplace: Option<serde_json::Map<String, serde_json::Value>>,
14300    #[serde(default, skip_serializing_if = "Option::is_none")]
14301    pub agents: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
14302    #[serde(default, skip_serializing_if = "Option::is_none")]
14303    pub governance: Option<serde_json::Map<String, serde_json::Value>>,
14304    #[serde(default, skip_serializing_if = "Option::is_none")]
14305    pub plan: Option<String>,
14306    #[serde(default, skip_serializing_if = "Option::is_none")]
14307    pub branding: Option<serde_json::Map<String, serde_json::Value>>,
14308    pub category: String,
14309    #[serde(default, skip_serializing_if = "Option::is_none")]
14310    pub description: Option<String>,
14311    #[serde(default, skip_serializing_if = "Option::is_none")]
14312    pub logo_url: Option<String>,
14313    pub name: String,
14314    #[serde(default, skip_serializing_if = "Option::is_none")]
14315    pub published_at: Option<String>,
14316    pub short_description: String,
14317    pub slug: String,
14318    #[serde(default, skip_serializing_if = "Option::is_none")]
14319    pub social_links: Option<serde_json::Map<String, serde_json::Value>>,
14320    #[serde(default, skip_serializing_if = "Option::is_none")]
14321    pub stats: Option<serde_json::Map<String, serde_json::Value>>,
14322    pub tags: Vec<String>,
14323    pub tenant_id: String,
14324}
14325
14326/// `PublicTenant` model.
14327#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14328pub struct PublicTenant {
14329    /// Served 2026-09-10; contents not asserted.
14330    #[serde(default, skip_serializing_if = "Option::is_none")]
14331    pub marketplace: Option<serde_json::Map<String, serde_json::Value>>,
14332    pub tenant_id: String,
14333    pub slug: String,
14334    pub name: String,
14335    #[serde(default, skip_serializing_if = "Option::is_none")]
14336    pub description: Option<String>,
14337    #[serde(default, skip_serializing_if = "Option::is_none")]
14338    pub logo_url: Option<String>,
14339    #[serde(default, skip_serializing_if = "Option::is_none")]
14340    pub category: Option<String>,
14341    pub tags: Vec<String>,
14342    pub agents_count: i64,
14343    pub agents: Vec<PublicTenantAgent>,
14344    pub stats: PublicTenantStats,
14345    #[serde(default, skip_serializing_if = "Option::is_none")]
14346    pub social_links: Option<serde_json::Map<String, serde_json::Value>>,
14347    #[serde(default, skip_serializing_if = "Option::is_none")]
14348    pub branding: Option<serde_json::Map<String, serde_json::Value>>,
14349    #[serde(default, skip_serializing_if = "Option::is_none")]
14350    pub published_at: Option<String>,
14351}
14352
14353/// `PublicTenantAgent` model.
14354#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14355pub struct PublicTenantAgent {
14356    pub agent_id: String,
14357    pub name: String,
14358    #[serde(default, skip_serializing_if = "Option::is_none")]
14359    pub description: Option<String>,
14360    #[serde(default, skip_serializing_if = "Option::is_none")]
14361    pub icon: Option<String>,
14362    #[serde(default, skip_serializing_if = "Option::is_none")]
14363    pub greeting: Option<String>,
14364}
14365
14366/// `PublicTenantStats` model.
14367#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14368pub struct PublicTenantStats {
14369    pub total_runs: i64,
14370    pub total_agents: i64,
14371    pub avg_rating: f64,
14372}
14373
14374/// `PublicTrackEventRequest` model.
14375#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14376pub struct PublicTrackEventRequest {
14377    pub event: String,
14378    #[serde(default, skip_serializing_if = "Option::is_none")]
14379    pub properties: Option<serde_json::Map<String, serde_json::Value>>,
14380}
14381
14382/// `PublishListingRequest` model.
14383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14384pub struct PublishListingRequest {
14385    pub agent_id: String,
14386    #[serde(default, skip_serializing_if = "Option::is_none")]
14387    pub agent_version: Option<String>,
14388    pub name: String,
14389    #[serde(default, skip_serializing_if = "Option::is_none")]
14390    pub description: Option<String>,
14391    pub category: String,
14392    #[serde(default, skip_serializing_if = "Option::is_none")]
14393    pub tags: Option<Vec<String>>,
14394    #[serde(default, skip_serializing_if = "Option::is_none")]
14395    pub readme: Option<String>,
14396    #[serde(default, skip_serializing_if = "Option::is_none")]
14397    pub pricing: Option<serde_json::Map<String, serde_json::Value>>,
14398    #[serde(default, skip_serializing_if = "Option::is_none")]
14399    pub a2a_enabled: Option<bool>,
14400}
14401
14402/// `PublishWorkspaceSnapshotRequest` model.
14403#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14404pub struct PublishWorkspaceSnapshotRequest {
14405    /// Self-contained HTML, ≤3 MB.
14406    pub html: String,
14407    /// Defaults to `Shared page`.
14408    #[serde(default, skip_serializing_if = "Option::is_none")]
14409    pub title: Option<String>,
14410}
14411
14412/// `PublishWorkspaceSnapshotResponse` model.
14413#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14414pub struct PublishWorkspaceSnapshotResponse {
14415    pub token: String,
14416    pub expires_at: String,
14417}
14418
14419/// `PurgeAdminTenantResponse` model.
14420#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14421pub struct PurgeAdminTenantResponse {
14422    #[serde(default, skip_serializing_if = "Option::is_none")]
14423    pub purged: Option<bool>,
14424    #[serde(default, skip_serializing_if = "Option::is_none")]
14425    pub tenant_id: Option<String>,
14426}
14427
14428/// `PushBridgeTaskEventsResponse` model.
14429#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14430pub struct PushBridgeTaskEventsResponse {
14431    #[serde(default, skip_serializing_if = "Option::is_none")]
14432    pub success: Option<bool>,
14433    #[serde(default, skip_serializing_if = "Option::is_none")]
14434    pub events_stored: Option<i64>,
14435}
14436
14437/// `RateListingRequest` model.
14438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14439pub struct RateListingRequest {
14440    pub rating: i64,
14441    #[serde(default, skip_serializing_if = "Option::is_none")]
14442    pub comment: Option<String>,
14443}
14444
14445/// GET /health/ready and GET /readyz (measured 2026-09-10): overall status, the check's
14446/// timestamp, and one entry per component — cron, events, kv, mcp, workers.
14447#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14448pub struct ReadinessReport {
14449    pub status: String,
14450    pub timestamp: String,
14451    pub components: serde_json::Map<String, serde_json::Value>,
14452}
14453
14454/// `RegisterAmbassadorRequest` model.
14455#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14456pub struct RegisterAmbassadorRequest {
14457    pub ambassador_id: String,
14458    #[serde(default, skip_serializing_if = "Option::is_none")]
14459    pub name: Option<String>,
14460    #[serde(default, skip_serializing_if = "Option::is_none")]
14461    pub role: Option<String>,
14462    #[serde(default, skip_serializing_if = "Option::is_none")]
14463    pub permissions: Option<serde_json::Map<String, serde_json::Value>>,
14464}
14465
14466/// `RegisterAmbassadorResponse` model.
14467#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14468pub struct RegisterAmbassadorResponse {
14469    pub ok: bool,
14470}
14471
14472/// `RegistryAdminListSpecsResponse` model.
14473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14474pub struct RegistryAdminListSpecsResponse {
14475    pub specs: Vec<RegistryAdminListSpecsResponseSpec>,
14476    #[serde(default, skip_serializing_if = "Option::is_none")]
14477    pub next_cursor: Option<String>,
14478}
14479
14480/// `RegistryAdminListSpecsResponseSpec` model.
14481#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14482pub struct RegistryAdminListSpecsResponseSpec {
14483    #[serde(default, skip_serializing_if = "Option::is_none")]
14484    pub scope: Option<String>,
14485    #[serde(default, skip_serializing_if = "Option::is_none")]
14486    pub name: Option<String>,
14487    #[serde(default, skip_serializing_if = "Option::is_none")]
14488    pub owner_tenant_id: Option<String>,
14489    #[serde(default, skip_serializing_if = "Option::is_none")]
14490    pub visibility: Option<SetRegistrySpecVisibilityRequestVisibility>,
14491    #[serde(default, skip_serializing_if = "Option::is_none")]
14492    pub latest_version: Option<String>,
14493    #[serde(default, skip_serializing_if = "Option::is_none")]
14494    pub published_at: Option<String>,
14495    #[serde(default, skip_serializing_if = "Option::is_none")]
14496    pub size_bytes: Option<i64>,
14497    #[serde(default, skip_serializing_if = "Option::is_none")]
14498    pub yanked: Option<bool>,
14499    #[serde(default, skip_serializing_if = "Option::is_none")]
14500    pub shared_with_count: Option<i64>,
14501    #[serde(default, skip_serializing_if = "Option::is_none")]
14502    pub categories: Option<Vec<String>>,
14503    #[serde(default, skip_serializing_if = "Option::is_none")]
14504    pub keywords: Option<Vec<String>>,
14505    #[serde(default, skip_serializing_if = "Option::is_none")]
14506    pub description: Option<String>,
14507}
14508
14509/// `RegistryGetFileResponse` model.
14510#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14511pub struct RegistryGetFileResponse {
14512    pub path: String,
14513    pub size: i64,
14514    pub binary: bool,
14515    pub truncated: bool,
14516    /// UTF-8 text body. `null` when `binary: true`.
14517    #[serde(default, skip_serializing_if = "Option::is_none")]
14518    pub content: Option<String>,
14519}
14520
14521/// `RegistryGetReadmeResponse` model.
14522#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14523pub struct RegistryGetReadmeResponse {
14524    pub readme: String,
14525}
14526
14527/// `RegistryGetShareResponse` model.
14528#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14529pub struct RegistryGetShareResponse {
14530    pub scope: String,
14531    pub name: String,
14532    pub shared_with: Vec<String>,
14533    pub owner_tenant_id: String,
14534    pub updated_at: String,
14535}
14536
14537/// `RegistryGetSparseIndexResponse` model.
14538#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14539pub struct RegistryGetSparseIndexResponse {
14540    pub scope: String,
14541    pub name: String,
14542    pub versions: Vec<RegistryGetSparseIndexResponseVersion>,
14543}
14544
14545/// `RegistryGetSparseIndexResponseVersion` model.
14546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14547pub struct RegistryGetSparseIndexResponseVersion {
14548    pub version: String,
14549    pub sha256: String,
14550    pub dependencies: Vec<ResolvedDep>,
14551    pub yanked: bool,
14552    #[serde(default, skip_serializing_if = "Option::is_none")]
14553    pub yank_reason: Option<String>,
14554    #[serde(default, skip_serializing_if = "Option::is_none")]
14555    pub size: Option<i64>,
14556    pub published_at: String,
14557}
14558
14559/// `RegistryGetSpecMetadataResponse` model.
14560#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14561pub struct RegistryGetSpecMetadataResponse {
14562    pub scope: String,
14563    pub name: String,
14564    pub description: String,
14565    pub license: String,
14566    #[serde(default, skip_serializing_if = "Option::is_none")]
14567    pub repository: Option<String>,
14568    #[serde(default, skip_serializing_if = "Option::is_none")]
14569    pub homepage: Option<String>,
14570    pub categories: Vec<String>,
14571    pub keywords: Vec<String>,
14572    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
14573    #[serde(default, skip_serializing_if = "Option::is_none")]
14574    pub shared_with: Option<Vec<String>>,
14575    pub owner_tenant_id: String,
14576    pub latest_version: String,
14577    pub versions: Vec<RegistryVersionEntry>,
14578    pub created_at: String,
14579    pub updated_at: String,
14580    pub tool_count: i64,
14581    pub skill_count: i64,
14582    pub capabilities: Vec<String>,
14583    #[serde(default, skip_serializing_if = "Option::is_none")]
14584    pub schema_version: Option<String>,
14585}
14586
14587/// `RegistryGetSpecVersionResponse` model.
14588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14589pub struct RegistryGetSpecVersionResponse {
14590    #[serde(default, skip_serializing_if = "Option::is_none")]
14591    pub scope: Option<String>,
14592    #[serde(default, skip_serializing_if = "Option::is_none")]
14593    pub name: Option<String>,
14594    #[serde(default, skip_serializing_if = "Option::is_none")]
14595    pub version: Option<String>,
14596    #[serde(default, skip_serializing_if = "Option::is_none")]
14597    pub manifest: Option<serde_json::Map<String, serde_json::Value>>,
14598    #[serde(default, skip_serializing_if = "Option::is_none")]
14599    pub sha256: Option<String>,
14600    #[serde(default, skip_serializing_if = "Option::is_none")]
14601    pub size_bytes: Option<i64>,
14602    #[serde(default, skip_serializing_if = "Option::is_none")]
14603    pub dependencies: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
14604    #[serde(default, skip_serializing_if = "Option::is_none")]
14605    pub yanked: Option<bool>,
14606    #[serde(default, skip_serializing_if = "Option::is_none")]
14607    pub visibility: Option<SetRegistrySpecVisibilityRequestVisibility>,
14608    #[serde(default, skip_serializing_if = "Option::is_none")]
14609    pub shared_with: Option<Vec<String>>,
14610    #[serde(default, skip_serializing_if = "Option::is_none")]
14611    pub published_at: Option<String>,
14612    #[serde(default, skip_serializing_if = "Option::is_none")]
14613    pub download_url: Option<String>,
14614}
14615
14616/// `RegistryListFilesResponse` model.
14617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14618pub struct RegistryListFilesResponse {
14619    pub files: Vec<RegistryListFilesResponseFile>,
14620}
14621
14622/// `RegistryListFilesResponseFile` model.
14623#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14624pub struct RegistryListFilesResponseFile {
14625    #[serde(default, skip_serializing_if = "Option::is_none")]
14626    pub path: Option<String>,
14627    #[serde(default, skip_serializing_if = "Option::is_none")]
14628    pub size: Option<i64>,
14629    #[serde(default, skip_serializing_if = "Option::is_none")]
14630    pub binary: Option<bool>,
14631}
14632
14633/// `RegistryPublishRequest` model.
14634#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14635pub struct RegistryPublishRequest {
14636    /// JSON-stringified SpecManifest, validated server-side.
14637    pub manifest: String,
14638    /// Spec bundle (.tar.zst). Size capped per platform config.
14639    pub artifact: FilePart,
14640    /// Lowercase hex sha256; verified if provided.
14641    #[serde(default, skip_serializing_if = "Option::is_none")]
14642    pub sha256: Option<String>,
14643    /// Optional JSON-stringified SLSA attestation.
14644    #[serde(default, skip_serializing_if = "Option::is_none")]
14645    pub attestation: Option<String>,
14646}
14647
14648/// `RegistryPublishResponse` model.
14649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14650pub struct RegistryPublishResponse {
14651    pub scope: String,
14652    pub name: String,
14653    pub version: String,
14654    pub publisher_tenant_id: String,
14655    pub manifest: serde_json::Map<String, serde_json::Value>,
14656    pub sha256: String,
14657    pub size_bytes: i64,
14658    #[serde(default, skip_serializing_if = "Option::is_none")]
14659    pub artifact_key: Option<String>,
14660    #[serde(default, skip_serializing_if = "Option::is_none")]
14661    pub dependencies: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
14662    #[serde(default, skip_serializing_if = "Option::is_none")]
14663    pub yanked: Option<bool>,
14664    #[serde(default, skip_serializing_if = "Option::is_none")]
14665    pub yanked_reason: Option<String>,
14666    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
14667    #[serde(default, skip_serializing_if = "Option::is_none")]
14668    pub shared_with: Option<Vec<String>>,
14669    #[serde(default, skip_serializing_if = "Option::is_none")]
14670    pub attestation: Option<serde_json::Map<String, serde_json::Value>>,
14671    pub published_at: String,
14672}
14673
14674/// `RegistrySearchResponse` model.
14675#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14676pub struct RegistrySearchResponse {
14677    pub hits: Vec<RegistrySearchResponseHit>,
14678    pub total: i64,
14679    #[serde(default, skip_serializing_if = "Option::is_none")]
14680    pub next_cursor: Option<String>,
14681}
14682
14683/// `RegistrySearchResponseHit` model.
14684#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14685pub struct RegistrySearchResponseHit {
14686    #[serde(default, skip_serializing_if = "Option::is_none")]
14687    pub scope: Option<String>,
14688    #[serde(default, skip_serializing_if = "Option::is_none")]
14689    pub name: Option<String>,
14690    #[serde(default, skip_serializing_if = "Option::is_none")]
14691    pub version: Option<String>,
14692    #[serde(default, skip_serializing_if = "Option::is_none")]
14693    pub description: Option<String>,
14694    #[serde(default, skip_serializing_if = "Option::is_none")]
14695    pub categories: Option<Vec<String>>,
14696    #[serde(default, skip_serializing_if = "Option::is_none")]
14697    pub keywords: Option<Vec<String>>,
14698    #[serde(default, skip_serializing_if = "Option::is_none")]
14699    pub publisher_tenant_id: Option<String>,
14700    #[serde(default, skip_serializing_if = "Option::is_none")]
14701    pub published_at: Option<String>,
14702}
14703
14704/// `RegistrySetShareRequest` model.
14705#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14706pub struct RegistrySetShareRequest {
14707    /// Tenant IDs allowed to read this private spec.
14708    pub shared_with: Vec<String>,
14709}
14710
14711/// `RegistrySetShareResponse` model.
14712#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14713pub struct RegistrySetShareResponse {
14714    #[serde(default, skip_serializing_if = "Option::is_none")]
14715    pub scope: Option<String>,
14716    #[serde(default, skip_serializing_if = "Option::is_none")]
14717    pub name: Option<String>,
14718    #[serde(default, skip_serializing_if = "Option::is_none")]
14719    pub shared_with: Option<Vec<String>>,
14720    #[serde(default, skip_serializing_if = "Option::is_none")]
14721    pub owner_tenant_id: Option<String>,
14722    #[serde(default, skip_serializing_if = "Option::is_none")]
14723    pub updated_at: Option<String>,
14724}
14725
14726/// `RegistrySpecFeatureState` model.
14727#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14728pub struct RegistrySpecFeatureState {
14729    pub scope: String,
14730    pub name: String,
14731    /// True after a POST, false after a DELETE.
14732    pub featured: bool,
14733}
14734
14735/// `RegistryUnyankVersionResponse` model.
14736#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14737pub struct RegistryUnyankVersionResponse {
14738    pub error: RevokeSessionShareResponseError,
14739    pub message: String,
14740    pub retry_after_seconds: i64,
14741}
14742
14743/// `RegistryVersionEntry` model.
14744#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14745pub struct RegistryVersionEntry {
14746    pub version: String,
14747    pub sha256: String,
14748    pub dependencies: Vec<ResolvedDep>,
14749    pub yanked: bool,
14750    #[serde(default, skip_serializing_if = "Option::is_none")]
14751    pub yank_reason: Option<String>,
14752    #[serde(default, skip_serializing_if = "Option::is_none")]
14753    pub size: Option<i64>,
14754    pub published_at: String,
14755}
14756
14757/// `RegistryYankVersionRequest` model.
14758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14759pub struct RegistryYankVersionRequest {
14760    #[serde(default, skip_serializing_if = "Option::is_none")]
14761    pub reason: Option<String>,
14762}
14763
14764/// `RegistryYankVersionResponse` model.
14765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14766pub struct RegistryYankVersionResponse {
14767    pub error: RevokeSessionShareResponseError,
14768    pub message: String,
14769    pub retry_after_seconds: i64,
14770}
14771
14772/// `ReindexKnowledgeBaseResponse` model.
14773#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14774pub struct ReindexKnowledgeBaseResponse {
14775    pub reindexed: bool,
14776    pub total_chunks: i64,
14777    /// Chunks that came back with a vector. Lower than `total_chunks` means some failed.
14778    pub embedded: i64,
14779    pub documents: i64,
14780    pub embedding_model: String,
14781    pub embedding_dimensions: i64,
14782}
14783
14784/// `RejectRunRequest` model.
14785#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14786pub struct RejectRunRequest {
14787    /// Why the tool was refused; recorded on the run and shown to the agent.
14788    #[serde(default, skip_serializing_if = "Option::is_none")]
14789    pub reason: Option<String>,
14790}
14791
14792/// `RejectRunResponse` model.
14793#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14794pub struct RejectRunResponse {
14795    pub rejected: bool,
14796    pub run_id: String,
14797    #[serde(default, skip_serializing_if = "Option::is_none")]
14798    pub reason: Option<String>,
14799}
14800
14801/// `RemoveScheduleResponse` model.
14802#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14803pub struct RemoveScheduleResponse {
14804    pub removed: bool,
14805    pub agent_id: String,
14806}
14807
14808/// `ReplaceConstitutionRequest` model.
14809#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14810pub struct ReplaceConstitutionRequest {
14811    pub rules: Vec<ConstitutionRule>,
14812    /// Why the constitution is being replaced. Recorded in the immutable ledger and on the
14813    /// amendment record; defaults to a generic string when omitted.
14814    #[serde(default, skip_serializing_if = "Option::is_none")]
14815    pub rationale: Option<String>,
14816}
14817
14818/// `ResendInviteResponse` model.
14819#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14820pub struct ResendInviteResponse {
14821    pub resent: bool,
14822    pub email_sent: bool,
14823    pub invite: serde_json::Map<String, serde_json::Value>,
14824}
14825
14826/// `ResetAgentResponse` model.
14827#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14828pub struct ResetAgentResponse {
14829    pub ok: bool,
14830    /// Sessions deleted
14831    pub sessions: i64,
14832    /// Runs deleted
14833    pub runs: i64,
14834}
14835
14836/// `ResolveAmbassadorRequestRequest` model.
14837#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14838pub struct ResolveAmbassadorRequestRequest {
14839    pub response: String,
14840}
14841
14842/// `ResolvedDep` model.
14843#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14844pub struct ResolvedDep {
14845    pub scope: String,
14846    pub name: String,
14847    pub version_req: String,
14848}
14849
14850/// `ResolveSharedSessionResponse` model.
14851#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14852pub struct ResolveSharedSessionResponse {
14853    #[serde(default, skip_serializing_if = "Option::is_none")]
14854    pub session_id: Option<String>,
14855    #[serde(default, skip_serializing_if = "Option::is_none")]
14856    pub agent_name: Option<String>,
14857    #[serde(default, skip_serializing_if = "Option::is_none")]
14858    pub role: Option<CreateSessionShareRequestRole>,
14859}
14860
14861/// Accepted, stored, and enforced by nothing (GOV-D01). The subset check that governs
14862/// agent-to-agent spawn examines tools, roles, budget, spawn depth and self-modify, and never
14863/// this field; no reader anywhere consults it to gate access to a resource. Granting or
14864/// revoking it changes what an operator sees stored and nothing about what an agent may do.
14865/// Documented rather than removed or enforced: removing it would break a field tenants may
14866/// already have populated, and enforcing it would invent an authorisation rule the platform has
14867/// never applied.
14868#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14869pub struct ResourcePermission {
14870    pub resource: String,
14871    pub actions: Vec<ResourcePermissionAction>,
14872}
14873
14874/// `ResourcePermissionAction` enumeration.
14875#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
14876pub enum ResourcePermissionAction {
14877    #[default]
14878    #[serde(rename = "read")]
14879    Read,
14880    #[serde(rename = "write")]
14881    Write,
14882    #[serde(rename = "delete")]
14883    Delete,
14884    #[serde(rename = "execute")]
14885    Execute,
14886    /// A value the API introduced after this SDK was generated.
14887    #[serde(untagged)]
14888    Other(String),
14889}
14890
14891impl ResourcePermissionAction {
14892    /// The value as it appears on the wire.
14893    pub fn as_str(&self) -> &str {
14894        match self {
14895            Self::Read => "read",
14896            Self::Write => "write",
14897            Self::Delete => "delete",
14898            Self::Execute => "execute",
14899            Self::Other(value) => value.as_str(),
14900        }
14901    }
14902}
14903
14904impl std::fmt::Display for ResourcePermissionAction {
14905    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14906        f.write_str(self.as_str())
14907    }
14908}
14909
14910impl From<&str> for ResourcePermissionAction {
14911    fn from(value: &str) -> Self {
14912        match value {
14913            "read" => Self::Read,
14914            "write" => Self::Write,
14915            "delete" => Self::Delete,
14916            "execute" => Self::Execute,
14917            other => Self::Other(other.to_string()),
14918        }
14919    }
14920}
14921
14922/// `RespondToPublicHitlRequest` model.
14923#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14924pub struct RespondToPublicHitlRequest {
14925    pub response: String,
14926}
14927
14928/// `RespondToRunRequest` model.
14929#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14930pub struct RespondToRunRequest {
14931    pub response: String,
14932}
14933
14934/// `RespondToRunResponse` model.
14935#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14936pub struct RespondToRunResponse {
14937    #[serde(default, skip_serializing_if = "Option::is_none")]
14938    pub accepted: Option<bool>,
14939}
14940
14941/// `RestoreWorkspaceTrashRequest` model.
14942#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14943pub struct RestoreWorkspaceTrashRequest {
14944    /// The `.trash/…` path from a trash listing or a soft-delete response.
14945    pub trash_path: String,
14946}
14947
14948/// `RestoreWorkspaceTrashResponse` model.
14949#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14950pub struct RestoreWorkspaceTrashResponse {
14951    pub restored: bool,
14952    pub original_path: String,
14953    pub original_workspace_id: String,
14954}
14955
14956/// `ResumeCompanyResponse` model.
14957#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14958pub struct ResumeCompanyResponse {
14959    #[serde(default, skip_serializing_if = "Option::is_none")]
14960    pub status: Option<String>,
14961}
14962
14963/// `ResumeMissionResponse` model.
14964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14965pub struct ResumeMissionResponse {
14966    pub accepted: bool,
14967    pub mission: Mission,
14968}
14969
14970/// `ResumeRunResponse` model.
14971#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14972pub struct ResumeRunResponse {
14973    pub resumed: bool,
14974    pub run_id: String,
14975}
14976
14977/// `RevokeAPIKeyResponse` model.
14978#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14979pub struct RevokeAPIKeyResponse {
14980    pub revoked: bool,
14981    pub key_id: String,
14982}
14983
14984/// `RevokeMeSessionResponse` model.
14985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14986pub struct RevokeMeSessionResponse {
14987    pub ok: bool,
14988    pub key_id: String,
14989    #[serde(default, skip_serializing_if = "Option::is_none")]
14990    pub already_revoked: Option<bool>,
14991}
14992
14993/// `RevokeSessionShareResponse` model.
14994#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14995pub struct RevokeSessionShareResponse {
14996    pub error: RevokeSessionShareResponseError,
14997    pub message: String,
14998    pub retry_after_seconds: i64,
14999}
15000
15001/// `RevokeSessionShareResponseError` enumeration.
15002#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15003pub enum RevokeSessionShareResponseError {
15004    #[default]
15005    #[serde(rename = "Accepted")]
15006    Accepted,
15007    /// A value the API introduced after this SDK was generated.
15008    #[serde(untagged)]
15009    Other(String),
15010}
15011
15012impl RevokeSessionShareResponseError {
15013    /// The value as it appears on the wire.
15014    pub fn as_str(&self) -> &str {
15015        match self {
15016            Self::Accepted => "Accepted",
15017            Self::Other(value) => value.as_str(),
15018        }
15019    }
15020}
15021
15022impl std::fmt::Display for RevokeSessionShareResponseError {
15023    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15024        f.write_str(self.as_str())
15025    }
15026}
15027
15028impl From<&str> for RevokeSessionShareResponseError {
15029    fn from(value: &str) -> Self {
15030        match value {
15031            "Accepted" => Self::Accepted,
15032            other => Self::Other(other.to_string()),
15033        }
15034    }
15035}
15036
15037/// EU AI Act (Article 9) classification for an agent.
15038#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15039pub struct RiskClassification {
15040    pub level: RiskClassificationUpdateLevel,
15041    /// Set when level is `high`.
15042    #[serde(default, skip_serializing_if = "Option::is_none")]
15043    pub annex_iii_category: Option<RiskClassificationUpdateAnnexIiiCategory>,
15044    pub justification: String,
15045    /// Key ID or user ID of whoever classified.
15046    pub assessor: String,
15047    pub assessed_at: String,
15048    pub review_due_at: String,
15049}
15050
15051/// Body for `PATCH /api/v1/agents/{agentId}/risk-classification`.
15052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15053pub struct RiskClassificationUpdate {
15054    pub level: RiskClassificationUpdateLevel,
15055    /// Set when level is `high`.
15056    #[serde(default, skip_serializing_if = "Option::is_none")]
15057    pub annex_iii_category: Option<RiskClassificationUpdateAnnexIiiCategory>,
15058    pub justification: String,
15059    pub assessor: String,
15060    /// Defaults to now when omitted.
15061    #[serde(default, skip_serializing_if = "Option::is_none")]
15062    pub assessed_at: Option<String>,
15063    pub review_due_at: String,
15064}
15065
15066/// Set when level is `high`.
15067#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15068pub enum RiskClassificationUpdateAnnexIiiCategory {
15069    #[default]
15070    #[serde(rename = "biometric")]
15071    Biometric,
15072    #[serde(rename = "critical-infrastructure")]
15073    CriticalInfrastructure,
15074    #[serde(rename = "education")]
15075    Education,
15076    #[serde(rename = "employment")]
15077    Employment,
15078    #[serde(rename = "essential-services")]
15079    EssentialServices,
15080    #[serde(rename = "law-enforcement")]
15081    LawEnforcement,
15082    #[serde(rename = "migration")]
15083    Migration,
15084    #[serde(rename = "democratic-processes")]
15085    DemocraticProcesses,
15086    /// A value the API introduced after this SDK was generated.
15087    #[serde(untagged)]
15088    Other(String),
15089}
15090
15091impl RiskClassificationUpdateAnnexIiiCategory {
15092    /// The value as it appears on the wire.
15093    pub fn as_str(&self) -> &str {
15094        match self {
15095            Self::Biometric => "biometric",
15096            Self::CriticalInfrastructure => "critical-infrastructure",
15097            Self::Education => "education",
15098            Self::Employment => "employment",
15099            Self::EssentialServices => "essential-services",
15100            Self::LawEnforcement => "law-enforcement",
15101            Self::Migration => "migration",
15102            Self::DemocraticProcesses => "democratic-processes",
15103            Self::Other(value) => value.as_str(),
15104        }
15105    }
15106}
15107
15108impl std::fmt::Display for RiskClassificationUpdateAnnexIiiCategory {
15109    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15110        f.write_str(self.as_str())
15111    }
15112}
15113
15114impl From<&str> for RiskClassificationUpdateAnnexIiiCategory {
15115    fn from(value: &str) -> Self {
15116        match value {
15117            "biometric" => Self::Biometric,
15118            "critical-infrastructure" => Self::CriticalInfrastructure,
15119            "education" => Self::Education,
15120            "employment" => Self::Employment,
15121            "essential-services" => Self::EssentialServices,
15122            "law-enforcement" => Self::LawEnforcement,
15123            "migration" => Self::Migration,
15124            "democratic-processes" => Self::DemocraticProcesses,
15125            other => Self::Other(other.to_string()),
15126        }
15127    }
15128}
15129
15130/// `RiskClassificationUpdateLevel` enumeration.
15131#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15132pub enum RiskClassificationUpdateLevel {
15133    #[default]
15134    #[serde(rename = "minimal")]
15135    Minimal,
15136    #[serde(rename = "limited")]
15137    Limited,
15138    #[serde(rename = "high")]
15139    High,
15140    #[serde(rename = "unacceptable")]
15141    Unacceptable,
15142    /// A value the API introduced after this SDK was generated.
15143    #[serde(untagged)]
15144    Other(String),
15145}
15146
15147impl RiskClassificationUpdateLevel {
15148    /// The value as it appears on the wire.
15149    pub fn as_str(&self) -> &str {
15150        match self {
15151            Self::Minimal => "minimal",
15152            Self::Limited => "limited",
15153            Self::High => "high",
15154            Self::Unacceptable => "unacceptable",
15155            Self::Other(value) => value.as_str(),
15156        }
15157    }
15158}
15159
15160impl std::fmt::Display for RiskClassificationUpdateLevel {
15161    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15162        f.write_str(self.as_str())
15163    }
15164}
15165
15166impl From<&str> for RiskClassificationUpdateLevel {
15167    fn from(value: &str) -> Self {
15168        match value {
15169            "minimal" => Self::Minimal,
15170            "limited" => Self::Limited,
15171            "high" => Self::High,
15172            "unacceptable" => Self::Unacceptable,
15173            other => Self::Other(other.to_string()),
15174        }
15175    }
15176}
15177
15178/// `RollbackAgentRequest` model.
15179#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15180pub struct RollbackAgentRequest {
15181    /// Version number to rollback to
15182    pub version: i64,
15183}
15184
15185/// `RotateAgentIdentityResponse` model.
15186#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15187pub struct RotateAgentIdentityResponse {
15188    #[serde(default, skip_serializing_if = "Option::is_none")]
15189    pub public_key: Option<String>,
15190    #[serde(default, skip_serializing_if = "Option::is_none")]
15191    pub rotated_at: Option<String>,
15192}
15193
15194/// `Run` model.
15195#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15196pub struct Run {
15197    pub run_id: String,
15198    pub tenant_id: String,
15199    pub agent_id: String,
15200    #[serde(default, skip_serializing_if = "Option::is_none")]
15201    pub session_id: Option<String>,
15202    pub status: RunStatus,
15203    #[serde(default, skip_serializing_if = "Option::is_none")]
15204    pub input: Option<serde_json::Map<String, serde_json::Value>>,
15205    /// Run output. When a run is truncated by its step-budget cutoff (output.truncated === true)
15206    /// AND the platform has UARP_CONTINUATION_TOKEN_KEY configured, output.continuation_token
15207    /// carries an opaque HMAC-signed token that resumes the run via POST /runs/{id}/continue. With
15208    /// no key configured no token is minted and the field is absent; the token is an opaque string
15209    /// to every client.
15210    #[serde(default, skip_serializing_if = "Option::is_none")]
15211    pub output: Option<serde_json::Map<String, serde_json::Value>>,
15212    #[serde(default, skip_serializing_if = "Option::is_none")]
15213    pub metrics: Option<RunMetrics>,
15214    #[serde(default, skip_serializing_if = "Option::is_none")]
15215    pub error: Option<String>,
15216    pub created_at: String,
15217    #[serde(default, skip_serializing_if = "Option::is_none")]
15218    pub started_at: Option<String>,
15219    #[serde(default, skip_serializing_if = "Option::is_none")]
15220    pub completed_at: Option<String>,
15221    /// Team run ID if part of a team execution
15222    #[serde(default, skip_serializing_if = "Option::is_none")]
15223    pub team_run_id: Option<String>,
15224    /// User-supplied metadata
15225    #[serde(default, skip_serializing_if = "Option::is_none")]
15226    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
15227    /// Current step sequence number
15228    #[serde(default, skip_serializing_if = "Option::is_none")]
15229    pub step_seq: Option<i64>,
15230    /// Run artifacts
15231    #[serde(default, skip_serializing_if = "Option::is_none")]
15232    pub artifacts: Option<Vec<Artifact>>,
15233    /// Resource limits for the run
15234    #[serde(default, skip_serializing_if = "Option::is_none")]
15235    pub resource_limits: Option<RunResourceLimits>,
15236}
15237
15238/// The body is optional and carries at most a `response` for the agent. An unknown field is
15239/// REFUSED, not ignored: `{"approved": false}` sent here used to be stripped in silence while
15240/// the endpoint approved anyway and answered `{"approved": true}`. To refuse a tool call, POST
15241/// /runs/{runId}/reject.
15242#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15243pub struct RunApproveRequest {
15244    /// Optional message passed back to the agent alongside the approval.
15245    #[serde(default, skip_serializing_if = "Option::is_none")]
15246    pub response: Option<String>,
15247}
15248
15249/// `RunCanvasLoopRequest` model.
15250#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15251pub struct RunCanvasLoopRequest {
15252    pub supervisor_agent_id: String,
15253    /// The agents drawn inside the loop. An empty array is 400 ("this loop has no worker agents
15254    /// inside it"), so it is required in practice and declared so here.
15255    pub worker_ids: Vec<String>,
15256    /// Which drawn loop to run. Required — the handler 400s without it, and it is the key the
15257    /// persisted layout is looked up by.
15258    pub loop_id: String,
15259    /// Overrides the exit condition stored on the drawn loop for this run only. Read at
15260    /// canvas.ts:234; was undocumented, so a client generated from this document could not send it.
15261    #[serde(default, skip_serializing_if = "Option::is_none")]
15262    pub condition: Option<String>,
15263    /// Overrides the loop's stored instruction for this run only. Read at canvas.ts:238.
15264    #[serde(default, skip_serializing_if = "Option::is_none")]
15265    pub prompt: Option<String>,
15266}
15267
15268/// `RunCanvasLoopResponse` model.
15269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15270pub struct RunCanvasLoopResponse {
15271    pub mission_id: String,
15272    pub team_id: String,
15273    pub worker_count: i64,
15274    pub max_passes: i64,
15275    pub budget_usd: f64,
15276    pub time_minutes: f64,
15277}
15278
15279/// `RunCanvasWorkflowRequest` model.
15280#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15281pub struct RunCanvasWorkflowRequest {
15282    /// The agent steps, in graph order. Fewer than two is 400 — a canvas of unconnected agents has
15283    /// no order to execute in. This was the whole body and the document did not carry it:
15284    /// `entry_agent_id` and `max_passes_per_step` were declared instead, and neither is read by any
15285    /// handler in the platform.
15286    pub steps: Vec<CanvasWorkflowStep>,
15287    /// Mission goal. Defaults to the literal "Workflow" when omitted (canvas.ts:313).
15288    #[serde(default, skip_serializing_if = "Option::is_none")]
15289    pub goal: Option<String>,
15290    #[serde(default, skip_serializing_if = "Option::is_none")]
15291    pub budget_usd_per_step: Option<f64>,
15292    #[serde(default, skip_serializing_if = "Option::is_none")]
15293    pub time_minutes: Option<f64>,
15294    /// Free text passed into the run.
15295    #[serde(default, skip_serializing_if = "Option::is_none")]
15296    pub feedback: Option<String>,
15297}
15298
15299/// `RunCanvasWorkflowResponse` model.
15300#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15301pub struct RunCanvasWorkflowResponse {
15302    pub mission_id: String,
15303    /// Objectives created — one per agent step.
15304    pub step_count: i64,
15305    /// Workflow edges the plan was built from.
15306    pub edge_count: i64,
15307}
15308
15309/// `RunCheckpoint` model.
15310#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15311pub struct RunCheckpoint {
15312    #[serde(default, skip_serializing_if = "Option::is_none")]
15313    pub step: Option<i64>,
15314    /// Conversation as it stood at this checkpoint. Left opaque: it mirrors the provider's message
15315    /// shape, which differs per adapter.
15316    #[serde(default, skip_serializing_if = "Option::is_none")]
15317    pub messages: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
15318    /// Accumulated run metrics — `RunMetricsAccumulator` (`runtime/core/step-executor.ts:156`):
15319    /// step and token counters, optionally provider cache hits.
15320    #[serde(default, skip_serializing_if = "Option::is_none")]
15321    pub metrics: Option<serde_json::Map<String, serde_json::Value>>,
15322}
15323
15324/// What a run is likely to cost before it is started. Nothing is dispatched and nothing is
15325/// stored — this is a read.
15326///
15327/// The numbers are an estimate built from the agent's own recent runs, and the `basis` block
15328/// says what they rest on so a client can present them honestly instead of showing every figure
15329/// with the same confidence.
15330#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15331pub struct RunCostEstimate {
15332    /// The model the estimate was priced against, after any per-session override.
15333    pub model: String,
15334    pub estimate: RunCostEstimateEstimate,
15335    /// What the estimate was computed from. A zero sample is not an error — it means the agent has
15336    /// no history yet and the defaults were used.
15337    pub basis: RunCostEstimateBasis,
15338}
15339
15340/// What the estimate was computed from. A zero sample is not an error — it means the agent has
15341/// no history yet and the defaults were used.
15342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15343pub struct RunCostEstimateBasis {
15344    /// Every cost in this response is at this rate. `user` — what the run will be billed (provider
15345    /// × markup); never the provider's own rate.
15346    pub rate: RunCostEstimateBasisRate,
15347    pub runs_sampled: i64,
15348    #[serde(default)]
15349    pub avg_steps: Option<i64>,
15350    #[serde(default)]
15351    pub avg_output_tokens_per_step: Option<i64>,
15352    /// Median of the sampled runs' actual cost.
15353    #[serde(default)]
15354    pub median_cost_usd: Option<f64>,
15355    /// What a bad run looked like — the number worth showing next to the estimate.
15356    #[serde(default)]
15357    pub p90_cost_usd: Option<f64>,
15358    /// `model` — a real per-model rate; `fallback` — the configured tier rate, i.e. a number with a
15359    /// shrug behind it; `unknown` — no rate at all, and the estimate is zero.
15360    pub pricing: RunCostEstimateBasisPricing,
15361}
15362
15363/// `model` — a real per-model rate; `fallback` — the configured tier rate, i.e. a number with a
15364/// shrug behind it; `unknown` — no rate at all, and the estimate is zero.
15365#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15366pub enum RunCostEstimateBasisPricing {
15367    #[default]
15368    #[serde(rename = "model")]
15369    Model,
15370    #[serde(rename = "fallback")]
15371    Fallback,
15372    #[serde(rename = "unknown")]
15373    Unknown,
15374    /// A value the API introduced after this SDK was generated.
15375    #[serde(untagged)]
15376    Other(String),
15377}
15378
15379impl RunCostEstimateBasisPricing {
15380    /// The value as it appears on the wire.
15381    pub fn as_str(&self) -> &str {
15382        match self {
15383            Self::Model => "model",
15384            Self::Fallback => "fallback",
15385            Self::Unknown => "unknown",
15386            Self::Other(value) => value.as_str(),
15387        }
15388    }
15389}
15390
15391impl std::fmt::Display for RunCostEstimateBasisPricing {
15392    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15393        f.write_str(self.as_str())
15394    }
15395}
15396
15397impl From<&str> for RunCostEstimateBasisPricing {
15398    fn from(value: &str) -> Self {
15399        match value {
15400            "model" => Self::Model,
15401            "fallback" => Self::Fallback,
15402            "unknown" => Self::Unknown,
15403            other => Self::Other(other.to_string()),
15404        }
15405    }
15406}
15407
15408/// Every cost in this response is at this rate. `user` — what the run will be billed (provider
15409/// × markup); never the provider's own rate.
15410#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15411pub enum RunCostEstimateBasisRate {
15412    #[default]
15413    #[serde(rename = "user")]
15414    User,
15415    /// A value the API introduced after this SDK was generated.
15416    #[serde(untagged)]
15417    Other(String),
15418}
15419
15420impl RunCostEstimateBasisRate {
15421    /// The value as it appears on the wire.
15422    pub fn as_str(&self) -> &str {
15423        match self {
15424            Self::User => "user",
15425            Self::Other(value) => value.as_str(),
15426        }
15427    }
15428}
15429
15430impl std::fmt::Display for RunCostEstimateBasisRate {
15431    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15432        f.write_str(self.as_str())
15433    }
15434}
15435
15436impl From<&str> for RunCostEstimateBasisRate {
15437    fn from(value: &str) -> Self {
15438        match value {
15439            "user" => Self::User,
15440            other => Self::Other(other.to_string()),
15441        }
15442    }
15443}
15444
15445/// `RunCostEstimateEstimate` model.
15446#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15447pub struct RunCostEstimateEstimate {
15448    /// At the user rate — the provider rate times the platform markup, the same rate
15449    /// `metrics.total_cost_usd` is written at — so it is comparable with `basis.median_cost_usd`
15450    /// and `basis.p90_cost_usd`.
15451    pub estimated_cost_usd: f64,
15452    /// `medium` only when past runs supplied a step count; `low` otherwise, including when no rate
15453    /// is known at all.
15454    pub confidence: RunCostEstimateEstimateConfidence,
15455    pub breakdown: RunCostEstimateEstimateBreakdown,
15456}
15457
15458/// `RunCostEstimateEstimateBreakdown` model.
15459#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15460pub struct RunCostEstimateEstimateBreakdown {
15461    pub input_tokens_est: i64,
15462    pub output_tokens_est: i64,
15463    pub input_cost_est: f64,
15464    pub output_cost_est: f64,
15465}
15466
15467/// `medium` only when past runs supplied a step count; `low` otherwise, including when no rate
15468/// is known at all.
15469#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15470pub enum RunCostEstimateEstimateConfidence {
15471    #[default]
15472    #[serde(rename = "low")]
15473    Low,
15474    #[serde(rename = "medium")]
15475    Medium,
15476    #[serde(rename = "high")]
15477    High,
15478    /// A value the API introduced after this SDK was generated.
15479    #[serde(untagged)]
15480    Other(String),
15481}
15482
15483impl RunCostEstimateEstimateConfidence {
15484    /// The value as it appears on the wire.
15485    pub fn as_str(&self) -> &str {
15486        match self {
15487            Self::Low => "low",
15488            Self::Medium => "medium",
15489            Self::High => "high",
15490            Self::Other(value) => value.as_str(),
15491        }
15492    }
15493}
15494
15495impl std::fmt::Display for RunCostEstimateEstimateConfidence {
15496    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15497        f.write_str(self.as_str())
15498    }
15499}
15500
15501impl From<&str> for RunCostEstimateEstimateConfidence {
15502    fn from(value: &str) -> Self {
15503        match value {
15504            "low" => Self::Low,
15505            "medium" => Self::Medium,
15506            "high" => Self::High,
15507            other => Self::Other(other.to_string()),
15508        }
15509    }
15510}
15511
15512/// `RunEvaluationRequest` model.
15513#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15514pub struct RunEvaluationRequest {
15515    pub dataset_id: String,
15516    #[serde(default, skip_serializing_if = "Option::is_none")]
15517    pub agent_version: Option<String>,
15518}
15519
15520/// GET …/feedback without `message_id`: every reaction the caller stored on the run (measured
15521/// 2026-09-10: `{"feedbacks":\[\]}` on a run with none).
15522#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15523pub struct RunFeedbackList {
15524    pub feedbacks: Vec<RunFeedbackListFeedback>,
15525}
15526
15527/// `RunFeedbackListFeedback` model.
15528#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15529pub struct RunFeedbackListFeedback {
15530    pub message_id: String,
15531    pub reaction: RunFeedbackListFeedbackReaction,
15532}
15533
15534/// `RunFeedbackListFeedbackReaction` enumeration.
15535#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15536pub enum RunFeedbackListFeedbackReaction {
15537    #[default]
15538    #[serde(rename = "up")]
15539    Up,
15540    #[serde(rename = "down")]
15541    Down,
15542    /// A value the API introduced after this SDK was generated.
15543    #[serde(untagged)]
15544    Other(String),
15545}
15546
15547impl RunFeedbackListFeedbackReaction {
15548    /// The value as it appears on the wire.
15549    pub fn as_str(&self) -> &str {
15550        match self {
15551            Self::Up => "up",
15552            Self::Down => "down",
15553            Self::Other(value) => value.as_str(),
15554        }
15555    }
15556}
15557
15558impl std::fmt::Display for RunFeedbackListFeedbackReaction {
15559    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15560        f.write_str(self.as_str())
15561    }
15562}
15563
15564impl From<&str> for RunFeedbackListFeedbackReaction {
15565    fn from(value: &str) -> Self {
15566        match value {
15567            "up" => Self::Up,
15568            "down" => Self::Down,
15569            other => Self::Other(other.to_string()),
15570        }
15571    }
15572}
15573
15574/// GET …/feedback with `message_id`: that one reaction, `null` when the caller has not reacted.
15575#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15576pub struct RunFeedbackOne {
15577    #[serde(default)]
15578    pub reaction: Option<String>,
15579}
15580
15581/// PUT …/feedback: the stored reaction, echoed (runs.ts putRunFeedback, sessions.ts
15582/// putSessionFeedback — the same literal).
15583#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15584pub struct RunFeedbackSet {
15585    pub reaction: RunFeedbackListFeedbackReaction,
15586    pub message_id: String,
15587}
15588
15589/// `RunMetrics` model.
15590#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15591pub struct RunMetrics {
15592    #[serde(default, skip_serializing_if = "Option::is_none")]
15593    pub duration_ms: Option<f64>,
15594    #[serde(default, skip_serializing_if = "Option::is_none")]
15595    pub steps_count: Option<i64>,
15596    #[serde(default, skip_serializing_if = "Option::is_none")]
15597    pub input_tokens: Option<i64>,
15598    #[serde(default, skip_serializing_if = "Option::is_none")]
15599    pub output_tokens: Option<i64>,
15600    #[serde(default, skip_serializing_if = "Option::is_none")]
15601    pub thinking_tokens: Option<i64>,
15602    #[serde(default, skip_serializing_if = "Option::is_none")]
15603    pub tool_calls_count: Option<i64>,
15604    #[serde(default, skip_serializing_if = "Option::is_none")]
15605    pub llm_calls_count: Option<i64>,
15606    #[serde(default, skip_serializing_if = "Option::is_none")]
15607    pub guardrail_checks: Option<i64>,
15608    #[serde(default, skip_serializing_if = "Option::is_none")]
15609    pub guardrail_violations: Option<i64>,
15610    #[serde(default, skip_serializing_if = "Option::is_none")]
15611    pub memory_retrievals: Option<i64>,
15612    #[serde(default, skip_serializing_if = "Option::is_none")]
15613    pub memory_extractions: Option<i64>,
15614    /// Estimated total cost in USD
15615    #[serde(default, skip_serializing_if = "Option::is_none")]
15616    pub total_cost_usd: Option<f64>,
15617}
15618
15619/// `RunMissionResponse` model.
15620#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15621pub struct RunMissionResponse {
15622    pub accepted: bool,
15623    pub already_running: bool,
15624    pub mission: Mission,
15625}
15626
15627/// Resource limits for the run
15628#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15629pub struct RunResourceLimits {
15630    #[serde(default, skip_serializing_if = "Option::is_none")]
15631    pub max_duration_ms: Option<i64>,
15632    #[serde(default, skip_serializing_if = "Option::is_none")]
15633    pub max_steps: Option<i64>,
15634    #[serde(default, skip_serializing_if = "Option::is_none")]
15635    pub max_tool_calls: Option<i64>,
15636    #[serde(default, skip_serializing_if = "Option::is_none")]
15637    pub max_tokens_per_run: Option<i64>,
15638}
15639
15640/// `RunStatus` enumeration.
15641#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15642pub enum RunStatus {
15643    #[default]
15644    #[serde(rename = "queued")]
15645    Queued,
15646    #[serde(rename = "running")]
15647    Running,
15648    #[serde(rename = "completed")]
15649    Completed,
15650    #[serde(rename = "failed")]
15651    Failed,
15652    #[serde(rename = "cancelled")]
15653    Cancelled,
15654    #[serde(rename = "timeout")]
15655    Timeout,
15656    #[serde(rename = "guardrail_blocked")]
15657    GuardrailBlocked,
15658    #[serde(rename = "paused")]
15659    Paused,
15660    #[serde(rename = "awaiting_approval")]
15661    AwaitingApproval,
15662    #[serde(rename = "awaiting_input")]
15663    AwaitingInput,
15664    #[serde(rename = "auth_required")]
15665    AuthRequired,
15666    #[serde(rename = "rejected")]
15667    Rejected,
15668    /// A value the API introduced after this SDK was generated.
15669    #[serde(untagged)]
15670    Other(String),
15671}
15672
15673impl RunStatus {
15674    /// The value as it appears on the wire.
15675    pub fn as_str(&self) -> &str {
15676        match self {
15677            Self::Queued => "queued",
15678            Self::Running => "running",
15679            Self::Completed => "completed",
15680            Self::Failed => "failed",
15681            Self::Cancelled => "cancelled",
15682            Self::Timeout => "timeout",
15683            Self::GuardrailBlocked => "guardrail_blocked",
15684            Self::Paused => "paused",
15685            Self::AwaitingApproval => "awaiting_approval",
15686            Self::AwaitingInput => "awaiting_input",
15687            Self::AuthRequired => "auth_required",
15688            Self::Rejected => "rejected",
15689            Self::Other(value) => value.as_str(),
15690        }
15691    }
15692}
15693
15694impl std::fmt::Display for RunStatus {
15695    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15696        f.write_str(self.as_str())
15697    }
15698}
15699
15700impl From<&str> for RunStatus {
15701    fn from(value: &str) -> Self {
15702        match value {
15703            "queued" => Self::Queued,
15704            "running" => Self::Running,
15705            "completed" => Self::Completed,
15706            "failed" => Self::Failed,
15707            "cancelled" => Self::Cancelled,
15708            "timeout" => Self::Timeout,
15709            "guardrail_blocked" => Self::GuardrailBlocked,
15710            "paused" => Self::Paused,
15711            "awaiting_approval" => Self::AwaitingApproval,
15712            "awaiting_input" => Self::AwaitingInput,
15713            "auth_required" => Self::AuthRequired,
15714            "rejected" => Self::Rejected,
15715            other => Self::Other(other.to_string()),
15716        }
15717    }
15718}
15719
15720/// `RunStep` model.
15721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15722pub struct RunStep {
15723    #[serde(default, skip_serializing_if = "Option::is_none")]
15724    pub step_id: Option<String>,
15725    #[serde(default, skip_serializing_if = "Option::is_none")]
15726    pub run_id: Option<String>,
15727    #[serde(default, skip_serializing_if = "Option::is_none")]
15728    pub tenant_id: Option<String>,
15729    #[serde(default, skip_serializing_if = "Option::is_none")]
15730    pub step_index: Option<i64>,
15731    #[serde(default, skip_serializing_if = "Option::is_none")]
15732    pub status: Option<RunStepStatus>,
15733    #[serde(default, skip_serializing_if = "Option::is_none")]
15734    pub metrics: Option<RunStepMetrics>,
15735    #[serde(default, skip_serializing_if = "Option::is_none")]
15736    pub tool_calls: Option<Vec<String>>,
15737    #[serde(default, skip_serializing_if = "Option::is_none")]
15738    pub error: Option<String>,
15739    #[serde(default, skip_serializing_if = "Option::is_none")]
15740    pub started_at: Option<String>,
15741    #[serde(default, skip_serializing_if = "Option::is_none")]
15742    pub completed_at: Option<String>,
15743}
15744
15745/// `RunStepMetrics` model.
15746#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15747pub struct RunStepMetrics {
15748    #[serde(default, skip_serializing_if = "Option::is_none")]
15749    pub duration_ms: Option<f64>,
15750    #[serde(default, skip_serializing_if = "Option::is_none")]
15751    pub input_tokens: Option<i64>,
15752    #[serde(default, skip_serializing_if = "Option::is_none")]
15753    pub output_tokens: Option<i64>,
15754    #[serde(default, skip_serializing_if = "Option::is_none")]
15755    pub thinking_tokens: Option<i64>,
15756    #[serde(default, skip_serializing_if = "Option::is_none")]
15757    pub llm_calls: Option<i64>,
15758    #[serde(default, skip_serializing_if = "Option::is_none")]
15759    pub tool_calls_count: Option<i64>,
15760    #[serde(default, skip_serializing_if = "Option::is_none")]
15761    pub cost_usd: Option<f64>,
15762}
15763
15764/// `RunStepStatus` enumeration.
15765#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15766pub enum RunStepStatus {
15767    #[default]
15768    #[serde(rename = "running")]
15769    Running,
15770    #[serde(rename = "completed")]
15771    Completed,
15772    #[serde(rename = "failed")]
15773    Failed,
15774    /// A value the API introduced after this SDK was generated.
15775    #[serde(untagged)]
15776    Other(String),
15777}
15778
15779impl RunStepStatus {
15780    /// The value as it appears on the wire.
15781    pub fn as_str(&self) -> &str {
15782        match self {
15783            Self::Running => "running",
15784            Self::Completed => "completed",
15785            Self::Failed => "failed",
15786            Self::Other(value) => value.as_str(),
15787        }
15788    }
15789}
15790
15791impl std::fmt::Display for RunStepStatus {
15792    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15793        f.write_str(self.as_str())
15794    }
15795}
15796
15797impl From<&str> for RunStepStatus {
15798    fn from(value: &str) -> Self {
15799        match value {
15800            "running" => Self::Running,
15801            "completed" => Self::Completed,
15802            "failed" => Self::Failed,
15803            other => Self::Other(other.to_string()),
15804        }
15805    }
15806}
15807
15808/// `RunWorkspaceCommandRequest` model.
15809#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15810pub struct RunWorkspaceCommandRequest {
15811    pub command: String,
15812    #[serde(default, skip_serializing_if = "Option::is_none")]
15813    pub workdir: Option<String>,
15814    #[serde(default, skip_serializing_if = "Option::is_none")]
15815    pub timeout_sec: Option<i64>,
15816}
15817
15818/// `RunWorkspaceCommandResponse` model.
15819#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15820pub struct RunWorkspaceCommandResponse {
15821    #[serde(default, skip_serializing_if = "Option::is_none")]
15822    pub output: Option<String>,
15823}
15824
15825/// What `GET /agents/{agentId}/schedule` returns: `agent_id`, the config fields flattened, and
15826/// the runtime state. Keys as served 2026-09-10; `last_fired_at`, `autonomous_mode` and
15827/// `reflection_prompt` appear only when set.
15828#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15829pub struct Schedule {
15830    pub agent_id: String,
15831    pub cron: String,
15832    pub enabled: bool,
15833    pub timezone: String,
15834    pub input: serde_json::Map<String, serde_json::Value>,
15835    pub max_concurrent_scheduled: i64,
15836    pub on_failure: AgentScheduleConfigOnFailure,
15837    #[serde(default, skip_serializing_if = "Option::is_none")]
15838    pub autonomous_mode: Option<bool>,
15839    #[serde(default, skip_serializing_if = "Option::is_none")]
15840    pub reflection_prompt: Option<String>,
15841    /// State of the scheduler ENTRY (ScheduleEntry.status in @uarp/scheduler), not whether the
15842    /// schedule is switched on: measured 2026-09-10, `active` on every live entry, including two
15843    /// with `enabled: false`. The human-facing on/off is `enabled`.
15844    pub status: ScheduleEntryStatus,
15845    /// The next fire when `enabled` is true. On a disabled schedule the server keeps the last
15846    /// computed instant, so it can lie in the past (measured 2026-09-10 on two disabled entries).
15847    #[serde(default, skip_serializing_if = "Option::is_none")]
15848    pub next_fire_at: Option<String>,
15849    #[serde(default, skip_serializing_if = "Option::is_none")]
15850    pub last_fired_at: Option<String>,
15851    pub consecutive_failures: i64,
15852}
15853
15854/// `ScheduleCanvasWorkflowRequest` model.
15855#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15856pub struct ScheduleCanvasWorkflowRequest {
15857    /// The trigger node's id on the canvas.
15858    pub trigger_id: String,
15859    pub cron: String,
15860    /// The agent steps the schedule fires, in graph order. Fewer than two is 400. Undeclared until
15861    /// now, alongside `goal` — while `entry_agent_id`, which WAS declared, is read by nothing: a
15862    /// client built from this document sent the one field the handler ignores and omitted the two
15863    /// it requires.
15864    pub steps: Vec<CanvasWorkflowStep>,
15865    /// Goal recorded on the schedule. Defaults to the literal "Workflow" (canvas.ts:415).
15866    #[serde(default, skip_serializing_if = "Option::is_none")]
15867    pub goal: Option<String>,
15868    /// Persisted on the schedule. Omitted, every scheduled fire silently reverts to the default
15869    /// per-step budget rather than the one the operator set for the run.
15870    #[serde(default, skip_serializing_if = "Option::is_none")]
15871    pub budget_usd_per_step: Option<f64>,
15872    #[serde(default, skip_serializing_if = "Option::is_none")]
15873    pub time_minutes: Option<f64>,
15874}
15875
15876/// `ScheduleCanvasWorkflowResponse` model.
15877#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15878pub struct ScheduleCanvasWorkflowResponse {
15879    pub trigger_id: String,
15880    pub cron: String,
15881    pub next_fire_at: String,
15882    pub status: ScheduleCanvasWorkflowResponseStatus,
15883}
15884
15885/// `ScheduleCanvasWorkflowResponseStatus` enumeration.
15886#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15887pub enum ScheduleCanvasWorkflowResponseStatus {
15888    #[default]
15889    #[serde(rename = "active")]
15890    Active,
15891    /// A value the API introduced after this SDK was generated.
15892    #[serde(untagged)]
15893    Other(String),
15894}
15895
15896impl ScheduleCanvasWorkflowResponseStatus {
15897    /// The value as it appears on the wire.
15898    pub fn as_str(&self) -> &str {
15899        match self {
15900            Self::Active => "active",
15901            Self::Other(value) => value.as_str(),
15902        }
15903    }
15904}
15905
15906impl std::fmt::Display for ScheduleCanvasWorkflowResponseStatus {
15907    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15908        f.write_str(self.as_str())
15909    }
15910}
15911
15912impl From<&str> for ScheduleCanvasWorkflowResponseStatus {
15913    fn from(value: &str) -> Self {
15914        match value {
15915            "active" => Self::Active,
15916            other => Self::Other(other.to_string()),
15917        }
15918    }
15919}
15920
15921/// What `PUT /agents/{agentId}/schedule` returns: the stored entry with its `config` nested
15922/// (ScheduleEntry in @uarp/scheduler). `GET` returns the flattened `Schedule` instead.
15923#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15924pub struct ScheduleEntry {
15925    pub tenant_id: String,
15926    pub agent_id: String,
15927    pub config: AgentScheduleConfig,
15928    #[serde(default, skip_serializing_if = "Option::is_none")]
15929    pub last_fired_at: Option<String>,
15930    /// The next fire when `enabled` is true. On a disabled schedule the server keeps the last
15931    /// computed instant, so it can lie in the past (measured 2026-09-10 on two disabled entries).
15932    #[serde(default, skip_serializing_if = "Option::is_none")]
15933    pub next_fire_at: Option<String>,
15934    pub consecutive_failures: i64,
15935    /// State of the scheduler ENTRY (ScheduleEntry.status in @uarp/scheduler), not whether the
15936    /// schedule is switched on: measured 2026-09-10, `active` on every live entry, including two
15937    /// with `enabled: false`. The human-facing on/off is `enabled`.
15938    pub status: ScheduleEntryStatus,
15939}
15940
15941/// State of the scheduler ENTRY (ScheduleEntry.status in @uarp/scheduler), not whether the
15942/// schedule is switched on: measured 2026-09-10, `active` on every live entry, including two
15943/// with `enabled: false`. The human-facing on/off is `enabled`.
15944#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15945pub enum ScheduleEntryStatus {
15946    #[default]
15947    #[serde(rename = "active")]
15948    Active,
15949    #[serde(rename = "paused")]
15950    Paused,
15951    #[serde(rename = "error")]
15952    Error,
15953    /// A value the API introduced after this SDK was generated.
15954    #[serde(untagged)]
15955    Other(String),
15956}
15957
15958impl ScheduleEntryStatus {
15959    /// The value as it appears on the wire.
15960    pub fn as_str(&self) -> &str {
15961        match self {
15962            Self::Active => "active",
15963            Self::Paused => "paused",
15964            Self::Error => "error",
15965            Self::Other(value) => value.as_str(),
15966        }
15967    }
15968}
15969
15970impl std::fmt::Display for ScheduleEntryStatus {
15971    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15972        f.write_str(self.as_str())
15973    }
15974}
15975
15976impl From<&str> for ScheduleEntryStatus {
15977    fn from(value: &str) -> Self {
15978        match value {
15979            "active" => Self::Active,
15980            "paused" => Self::Paused,
15981            "error" => Self::Error,
15982            other => Self::Other(other.to_string()),
15983        }
15984    }
15985}
15986
15987/// `ScheduleSummary` model.
15988#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15989pub struct ScheduleSummary {
15990    pub agent_id: String,
15991    /// Resolved for display; absent if the agent record is gone.
15992    #[serde(default, skip_serializing_if = "Option::is_none")]
15993    pub agent_name: Option<String>,
15994    pub cron: String,
15995    pub enabled: bool,
15996    /// `paused` or `error`, or accumulated failures, is what a “silently dead cron” looks like.
15997    pub status: String,
15998    #[serde(default, skip_serializing_if = "Option::is_none")]
15999    pub next_fire_at: Option<String>,
16000}
16001
16002/// `SearchKnowledgeBaseRequest` model.
16003#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16004pub struct SearchKnowledgeBaseRequest {
16005    pub query: String,
16006    /// Maximum chunks to return.
16007    #[serde(default, skip_serializing_if = "Option::is_none")]
16008    pub limit: Option<i64>,
16009}
16010
16011/// `SearchMarketplaceResponse` model.
16012#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16013pub struct SearchMarketplaceResponse {
16014    pub items: Vec<MarketplaceListing>,
16015    /// Legacy alias for `items`. Will be removed in API v1.x.
16016    #[serde(default, skip_serializing_if = "Option::is_none")]
16017    pub listings: Option<Vec<MarketplaceListing>>,
16018    #[serde(default, skip_serializing_if = "Option::is_none")]
16019    pub total: Option<i64>,
16020}
16021
16022/// `SearchMarketplaceSort` enumeration.
16023#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16024pub enum SearchMarketplaceSort {
16025    #[default]
16026    #[serde(rename = "rating")]
16027    Rating,
16028    #[serde(rename = "popularity")]
16029    Popularity,
16030    #[serde(rename = "recency")]
16031    Recency,
16032    /// A value the API introduced after this SDK was generated.
16033    #[serde(untagged)]
16034    Other(String),
16035}
16036
16037impl SearchMarketplaceSort {
16038    /// The value as it appears on the wire.
16039    pub fn as_str(&self) -> &str {
16040        match self {
16041            Self::Rating => "rating",
16042            Self::Popularity => "popularity",
16043            Self::Recency => "recency",
16044            Self::Other(value) => value.as_str(),
16045        }
16046    }
16047}
16048
16049impl std::fmt::Display for SearchMarketplaceSort {
16050    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16051        f.write_str(self.as_str())
16052    }
16053}
16054
16055impl From<&str> for SearchMarketplaceSort {
16056    fn from(value: &str) -> Self {
16057        match value {
16058            "rating" => Self::Rating,
16059            "popularity" => Self::Popularity,
16060            "recency" => Self::Recency,
16061            other => Self::Other(other.to_string()),
16062        }
16063    }
16064}
16065
16066/// `SearchMemoryResponse` model.
16067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16068pub struct SearchMemoryResponse {
16069    pub memories: Vec<MemoryEntry>,
16070    pub total: i64,
16071}
16072
16073/// `SearchType` enumeration.
16074#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16075pub enum SearchType {
16076    #[default]
16077    #[serde(rename = "agent")]
16078    Agent,
16079    #[serde(rename = "session")]
16080    Session,
16081    #[serde(rename = "run")]
16082    Run,
16083    /// A value the API introduced after this SDK was generated.
16084    #[serde(untagged)]
16085    Other(String),
16086}
16087
16088impl SearchType {
16089    /// The value as it appears on the wire.
16090    pub fn as_str(&self) -> &str {
16091        match self {
16092            Self::Agent => "agent",
16093            Self::Session => "session",
16094            Self::Run => "run",
16095            Self::Other(value) => value.as_str(),
16096        }
16097    }
16098}
16099
16100impl std::fmt::Display for SearchType {
16101    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16102        f.write_str(self.as_str())
16103    }
16104}
16105
16106impl From<&str> for SearchType {
16107    fn from(value: &str) -> Self {
16108        match value {
16109            "agent" => Self::Agent,
16110            "session" => Self::Session,
16111            "run" => Self::Run,
16112            other => Self::Other(other.to_string()),
16113        }
16114    }
16115}
16116
16117/// `SearchWorkspaceFilesRegex` enumeration.
16118#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16119pub enum SearchWorkspaceFilesRegex {
16120    #[default]
16121    #[serde(rename = "true")]
16122    True,
16123    #[serde(rename = "1")]
16124    V1,
16125    /// A value the API introduced after this SDK was generated.
16126    #[serde(untagged)]
16127    Other(String),
16128}
16129
16130impl SearchWorkspaceFilesRegex {
16131    /// The value as it appears on the wire.
16132    pub fn as_str(&self) -> &str {
16133        match self {
16134            Self::True => "true",
16135            Self::V1 => "1",
16136            Self::Other(value) => value.as_str(),
16137        }
16138    }
16139}
16140
16141impl std::fmt::Display for SearchWorkspaceFilesRegex {
16142    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16143        f.write_str(self.as_str())
16144    }
16145}
16146
16147impl From<&str> for SearchWorkspaceFilesRegex {
16148    fn from(value: &str) -> Self {
16149        match value {
16150            "true" => Self::True,
16151            "1" => Self::V1,
16152            other => Self::Other(other.to_string()),
16153        }
16154    }
16155}
16156
16157/// `SearchWorkspaceFilesResponse` model.
16158#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16159pub struct SearchWorkspaceFilesResponse {
16160    #[serde(default, skip_serializing_if = "Option::is_none")]
16161    pub results: Option<Vec<SearchWorkspaceFilesResponseResult>>,
16162    #[serde(default, skip_serializing_if = "Option::is_none")]
16163    pub total: Option<i64>,
16164}
16165
16166/// `SearchWorkspaceFilesResponseResult` model.
16167#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16168pub struct SearchWorkspaceFilesResponseResult {
16169    #[serde(default, skip_serializing_if = "Option::is_none")]
16170    pub path: Option<String>,
16171    #[serde(rename = "lineNumber", default, skip_serializing_if = "Option::is_none")]
16172    pub line_number: Option<i64>,
16173    #[serde(default, skip_serializing_if = "Option::is_none")]
16174    pub line: Option<String>,
16175    #[serde(default, skip_serializing_if = "Option::is_none")]
16176    pub r#match: Option<String>,
16177}
16178
16179/// `SeedStarterSpecsResponse` model.
16180#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16181pub struct SeedStarterSpecsResponse {
16182    /// Newly published.
16183    pub added: i64,
16184    /// Already present at the bundled version.
16185    pub skipped: i64,
16186    /// How many starter SPECs the build ships. `added + skipped` reaching this is the completion
16187    /// signal.
16188    pub total_starter: i64,
16189    pub entitlement_updated: bool,
16190    /// Absent when nothing failed.
16191    #[serde(default, skip_serializing_if = "Option::is_none")]
16192    pub errors: Option<Vec<SeedStarterSpecsResponseError>>,
16193}
16194
16195/// `SeedStarterSpecsResponseError` model.
16196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16197pub struct SeedStarterSpecsResponseError {
16198    pub name: String,
16199    pub error: String,
16200}
16201
16202/// `SendPublicMessageRequest` model.
16203#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16204pub struct SendPublicMessageRequest {
16205    pub content: String,
16206}
16207
16208/// `SendPublicMessageResponse` model.
16209#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16210pub struct SendPublicMessageResponse {
16211    #[serde(default, skip_serializing_if = "Option::is_none")]
16212    pub run_id: Option<String>,
16213    #[serde(default, skip_serializing_if = "Option::is_none")]
16214    pub messages_remaining: Option<i64>,
16215}
16216
16217/// `content` is always present in the body; it may be the empty string when `file_ids` carries
16218/// at least one id.
16219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16220pub struct SendSessionMessageRequest {
16221    /// Message body. May be empty when `file_ids` is non-empty — a photo with no caption is an
16222    /// ordinary message. A message with neither text nor files is refused.
16223    pub content: String,
16224    /// Optional slash-command string when the message is a builtin command.
16225    #[serde(default, skip_serializing_if = "Option::is_none")]
16226    pub command: Option<String>,
16227    /// Optional attached file ids previously uploaded via /api/v1/files.
16228    #[serde(default, skip_serializing_if = "Option::is_none")]
16229    pub file_ids: Option<Vec<String>>,
16230    /// Workspace override for this message; defaults to the agent's workspace.
16231    #[serde(default, skip_serializing_if = "Option::is_none")]
16232    pub workspace_id: Option<String>,
16233}
16234
16235/// `SendSessionMessageResponse` model.
16236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16237pub struct SendSessionMessageResponse {
16238    pub run_id: String,
16239}
16240
16241/// `SensorWebhookResponse` model.
16242#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16243pub struct SensorWebhookResponse {
16244    #[serde(default, skip_serializing_if = "Option::is_none")]
16245    pub accepted: Option<bool>,
16246}
16247
16248/// `Session` model.
16249#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16250pub struct Session {
16251    #[serde(default, skip_serializing_if = "Option::is_none")]
16252    pub created_by: Option<String>,
16253    pub session_id: String,
16254    pub tenant_id: String,
16255    pub agent_id: String,
16256    pub status: SessionStatus,
16257    #[serde(default, skip_serializing_if = "Option::is_none")]
16258    pub conversation_history: Option<Vec<ConversationEntry>>,
16259    #[serde(default, skip_serializing_if = "Option::is_none")]
16260    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
16261    #[serde(default, skip_serializing_if = "Option::is_none")]
16262    pub runs: Option<Vec<String>>,
16263    #[serde(default, skip_serializing_if = "Option::is_none")]
16264    pub created_at: Option<String>,
16265    #[serde(default, skip_serializing_if = "Option::is_none")]
16266    pub updated_at: Option<String>,
16267    #[serde(default, skip_serializing_if = "Option::is_none")]
16268    pub expires_at: Option<String>,
16269    /// Team ID if session belongs to a team
16270    #[serde(default, skip_serializing_if = "Option::is_none")]
16271    pub team_id: Option<String>,
16272    /// Session branches for conversation forking
16273    #[serde(default, skip_serializing_if = "Option::is_none")]
16274    pub branches: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
16275    /// Currently active branch ID
16276    #[serde(default, skip_serializing_if = "Option::is_none")]
16277    pub active_branch: Option<String>,
16278    /// How to handle concurrent runs in this session
16279    #[serde(default, skip_serializing_if = "Option::is_none")]
16280    pub queue_mode: Option<SessionQueueMode>,
16281    /// Per-conversation model override (in-chat model switcher). When set, runs in this session
16282    /// resolve their LLM from this config instead of the agent's default. Absent → agent default.
16283    #[serde(default, skip_serializing_if = "Option::is_none")]
16284    pub model_override: Option<SessionModelOverride>,
16285}
16286
16287/// `SessionBranch` model.
16288#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16289pub struct SessionBranch {
16290    pub branch_id: String,
16291    /// Absent on the main branch.
16292    #[serde(default, skip_serializing_if = "Option::is_none")]
16293    pub parent_branch_id: Option<String>,
16294    pub name: String,
16295    /// The run this branch forked after. Empty when the session had no runs yet.
16296    pub fork_point_run_id: String,
16297    pub fork_point_step_seq: i64,
16298    pub runs: Vec<String>,
16299    pub status: SessionBranchStatus,
16300    pub created_at: String,
16301}
16302
16303/// `SessionBranchStatus` enumeration.
16304#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16305pub enum SessionBranchStatus {
16306    #[default]
16307    #[serde(rename = "active")]
16308    Active,
16309    #[serde(rename = "abandoned")]
16310    Abandoned,
16311    #[serde(rename = "merged")]
16312    Merged,
16313    /// A value the API introduced after this SDK was generated.
16314    #[serde(untagged)]
16315    Other(String),
16316}
16317
16318impl SessionBranchStatus {
16319    /// The value as it appears on the wire.
16320    pub fn as_str(&self) -> &str {
16321        match self {
16322            Self::Active => "active",
16323            Self::Abandoned => "abandoned",
16324            Self::Merged => "merged",
16325            Self::Other(value) => value.as_str(),
16326        }
16327    }
16328}
16329
16330impl std::fmt::Display for SessionBranchStatus {
16331    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16332        f.write_str(self.as_str())
16333    }
16334}
16335
16336impl From<&str> for SessionBranchStatus {
16337    fn from(value: &str) -> Self {
16338        match value {
16339            "active" => Self::Active,
16340            "abandoned" => Self::Abandoned,
16341            "merged" => Self::Merged,
16342            other => Self::Other(other.to_string()),
16343        }
16344    }
16345}
16346
16347/// `SessionExport` model.
16348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16349pub struct SessionExport {
16350    pub exported_at: String,
16351    /// Always `snaga.chat.v1`.
16352    pub format: String,
16353    pub session_id: String,
16354    pub agent_id: String,
16355    #[serde(default, skip_serializing_if = "Option::is_none")]
16356    pub agent_name: Option<String>,
16357    pub title: String,
16358    #[serde(default, skip_serializing_if = "Option::is_none")]
16359    pub created_at: Option<String>,
16360    #[serde(default, skip_serializing_if = "Option::is_none")]
16361    pub updated_at: Option<String>,
16362    pub messages: Vec<SessionExportMessage>,
16363}
16364
16365/// `SessionExportMessage` model.
16366#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16367pub struct SessionExportMessage {
16368    pub role: String,
16369    pub content: String,
16370    #[serde(default, skip_serializing_if = "Option::is_none")]
16371    pub timestamp: Option<String>,
16372    #[serde(default, skip_serializing_if = "Option::is_none")]
16373    pub run_id: Option<String>,
16374    #[serde(default, skip_serializing_if = "Option::is_none")]
16375    pub tool_calls: Option<Vec<SessionExportMessageToolCall>>,
16376}
16377
16378/// `SessionExportMessageToolCall` model.
16379#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16380pub struct SessionExportMessageToolCall {
16381    #[serde(default, skip_serializing_if = "Option::is_none")]
16382    pub name: Option<String>,
16383    #[serde(default, skip_serializing_if = "Option::is_none")]
16384    pub status: Option<String>,
16385    #[serde(default, skip_serializing_if = "Option::is_none")]
16386    pub input: Option<serde_json::Map<String, serde_json::Value>>,
16387}
16388
16389/// Per-conversation model override (in-chat model switcher). When set, runs in this session
16390/// resolve their LLM from this config instead of the agent's default. Absent → agent default.
16391#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16392pub struct SessionModelOverride {
16393    pub provider: String,
16394    pub model_ref: String,
16395    #[serde(default, skip_serializing_if = "Option::is_none")]
16396    pub endpoint_url: Option<String>,
16397    #[serde(default, skip_serializing_if = "Option::is_none")]
16398    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
16399}
16400
16401/// How to handle concurrent runs in this session
16402#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16403pub enum SessionQueueMode {
16404    #[default]
16405    #[serde(rename = "allow")]
16406    Allow,
16407    #[serde(rename = "reject")]
16408    Reject,
16409    /// A value the API introduced after this SDK was generated.
16410    #[serde(untagged)]
16411    Other(String),
16412}
16413
16414impl SessionQueueMode {
16415    /// The value as it appears on the wire.
16416    pub fn as_str(&self) -> &str {
16417        match self {
16418            Self::Allow => "allow",
16419            Self::Reject => "reject",
16420            Self::Other(value) => value.as_str(),
16421        }
16422    }
16423}
16424
16425impl std::fmt::Display for SessionQueueMode {
16426    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16427        f.write_str(self.as_str())
16428    }
16429}
16430
16431impl From<&str> for SessionQueueMode {
16432    fn from(value: &str) -> Self {
16433        match value {
16434            "allow" => Self::Allow,
16435            "reject" => Self::Reject,
16436            other => Self::Other(other.to_string()),
16437        }
16438    }
16439}
16440
16441/// `SessionStatus` enumeration.
16442#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16443pub enum SessionStatus {
16444    #[default]
16445    #[serde(rename = "active")]
16446    Active,
16447    #[serde(rename = "closed")]
16448    Closed,
16449    #[serde(rename = "expired")]
16450    Expired,
16451    /// A value the API introduced after this SDK was generated.
16452    #[serde(untagged)]
16453    Other(String),
16454}
16455
16456impl SessionStatus {
16457    /// The value as it appears on the wire.
16458    pub fn as_str(&self) -> &str {
16459        match self {
16460            Self::Active => "active",
16461            Self::Closed => "closed",
16462            Self::Expired => "expired",
16463            Self::Other(value) => value.as_str(),
16464        }
16465    }
16466}
16467
16468impl std::fmt::Display for SessionStatus {
16469    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16470        f.write_str(self.as_str())
16471    }
16472}
16473
16474impl From<&str> for SessionStatus {
16475    fn from(value: &str) -> Self {
16476        match value {
16477            "active" => Self::Active,
16478            "closed" => Self::Closed,
16479            "expired" => Self::Expired,
16480            other => Self::Other(other.to_string()),
16481        }
16482    }
16483}
16484
16485/// `SetAdminIntegrationOAuthProviderRequest` model.
16486#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16487pub struct SetAdminIntegrationOAuthProviderRequest {
16488    #[serde(default, skip_serializing_if = "Option::is_none")]
16489    pub enabled: Option<bool>,
16490    #[serde(default, skip_serializing_if = "Option::is_none")]
16491    pub client_id: Option<String>,
16492    /// Never returned by any read. Omit to keep the stored one.
16493    #[serde(default, skip_serializing_if = "Option::is_none")]
16494    pub client_secret: Option<String>,
16495    #[serde(default, skip_serializing_if = "Option::is_none")]
16496    pub scopes: Option<Vec<String>>,
16497}
16498
16499/// `SetAdminIntegrationOAuthProviderResponse` model.
16500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16501pub struct SetAdminIntegrationOAuthProviderResponse {
16502    pub provider: String,
16503    pub enabled: bool,
16504    pub configured: bool,
16505}
16506
16507/// `SetAdminLLMDefaultRequest` model.
16508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16509pub struct SetAdminLLMDefaultRequest {
16510    pub api_key: String,
16511}
16512
16513/// `SetAdminLLMDefaultResponse` model.
16514#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16515pub struct SetAdminLLMDefaultResponse {
16516    #[serde(default, skip_serializing_if = "Option::is_none")]
16517    pub updated: Option<bool>,
16518}
16519
16520/// `SetAgentCapabilitiesResponse` model.
16521#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16522pub struct SetAgentCapabilitiesResponse {
16523    #[serde(default, skip_serializing_if = "Option::is_none")]
16524    pub status: Option<String>,
16525    #[serde(default, skip_serializing_if = "Option::is_none")]
16526    pub agent_id: Option<String>,
16527}
16528
16529/// `SetAgentIntegrationsRequest` model.
16530#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16531pub struct SetAgentIntegrationsRequest {
16532    /// The COMPLETE set after the call. Non-string members are ignored; ids the tenant does not own
16533    /// come back under `diff.unknown` rather than failing the call.
16534    pub integration_ids: Vec<String>,
16535}
16536
16537/// `SetAgentIntegrationsResponse` model.
16538#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16539pub struct SetAgentIntegrationsResponse {
16540    pub integrations: Vec<AgentIntegration>,
16541    pub total: i64,
16542    pub diff: SetAgentIntegrationsResponseDiff,
16543}
16544
16545/// `SetAgentIntegrationsResponseDiff` model.
16546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16547pub struct SetAgentIntegrationsResponseDiff {
16548    pub assigned: Vec<String>,
16549    pub unassigned: Vec<String>,
16550    pub unknown: Vec<String>,
16551}
16552
16553/// `SetAgentPermissionsResponse` model.
16554#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16555pub struct SetAgentPermissionsResponse {
16556    #[serde(default, skip_serializing_if = "Option::is_none")]
16557    pub ok: Option<bool>,
16558}
16559
16560/// `SetAgentTrafficRequest` model.
16561#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16562pub struct SetAgentTrafficRequest {
16563    pub entries: Vec<SetAgentTrafficRequestEntry>,
16564}
16565
16566/// `SetAgentTrafficRequestEntry` model.
16567#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16568pub struct SetAgentTrafficRequestEntry {
16569    pub version: i64,
16570    pub weight: f64,
16571}
16572
16573/// `SetAgentTrafficResponse` model.
16574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16575pub struct SetAgentTrafficResponse {
16576    pub agent_id: String,
16577    pub entries: Vec<serde_json::Map<String, serde_json::Value>>,
16578    #[serde(default)]
16579    pub updated_at: Option<String>,
16580}
16581
16582/// `SetArbiterRegistryResponse` model.
16583#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16584pub struct SetArbiterRegistryResponse {
16585    #[serde(default, skip_serializing_if = "Option::is_none")]
16586    pub ok: Option<bool>,
16587}
16588
16589/// `SetDataExplorerValueRequest` model.
16590#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16591pub struct SetDataExplorerValueRequest {
16592    pub namespace: String,
16593    pub key: Vec<serde_json::Value>,
16594    pub value: serde_json::Value,
16595}
16596
16597/// `SetDataExplorerValueResponse` model.
16598#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16599pub struct SetDataExplorerValueResponse {
16600    pub success: bool,
16601    pub size_bytes: i64,
16602}
16603
16604/// `SetLLMProviderKeyProvider` enumeration.
16605#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16606pub enum SetLLMProviderKeyProvider {
16607    #[default]
16608    #[serde(rename = "openai_compat")]
16609    OpenaiCompat,
16610    #[serde(rename = "custom")]
16611    Custom,
16612    /// A value the API introduced after this SDK was generated.
16613    #[serde(untagged)]
16614    Other(String),
16615}
16616
16617impl SetLLMProviderKeyProvider {
16618    /// The value as it appears on the wire.
16619    pub fn as_str(&self) -> &str {
16620        match self {
16621            Self::OpenaiCompat => "openai_compat",
16622            Self::Custom => "custom",
16623            Self::Other(value) => value.as_str(),
16624        }
16625    }
16626}
16627
16628impl std::fmt::Display for SetLLMProviderKeyProvider {
16629    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16630        f.write_str(self.as_str())
16631    }
16632}
16633
16634impl From<&str> for SetLLMProviderKeyProvider {
16635    fn from(value: &str) -> Self {
16636        match value {
16637            "openai_compat" => Self::OpenaiCompat,
16638            "custom" => Self::Custom,
16639            other => Self::Other(other.to_string()),
16640        }
16641    }
16642}
16643
16644/// WRITE SEMANTICS: mixed. `api_key` REPLACES on every call. `shared` MERGES — omit it and the
16645/// stored consent flag is kept. Verified against the handler and the store (ITG-05): omission
16646/// used to drop the flag, and since absent means shareable, a rotation silently returned an
16647/// opted-out personal key to the tenant-wide pool. Sending `shared: true` is the only way to
16648/// clear an opt-out.
16649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16650pub struct SetLLMProviderKeyRequest {
16651    /// Provider API key (stored encrypted)
16652    pub api_key: String,
16653    /// Consent for the tenant-wide fallback tier. `false` keeps this personal key out of other
16654    /// users' runs. Absent on a first write means shareable; absent on a later write means
16655    /// unchanged.
16656    #[serde(default, skip_serializing_if = "Option::is_none")]
16657    pub shared: Option<bool>,
16658}
16659
16660/// `SetLLMProviderKeyResponse` model.
16661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16662pub struct SetLLMProviderKeyResponse {
16663    #[serde(default, skip_serializing_if = "Option::is_none")]
16664    pub provider_id: Option<String>,
16665    #[serde(default, skip_serializing_if = "Option::is_none")]
16666    pub configured: Option<bool>,
16667    /// Effective consent flag after the write. Absent when never set. Returned so a client can send
16668    /// back what it read — before ITG-05 no read path exposed it, which is why every rotation
16669    /// cleared it.
16670    #[serde(default, skip_serializing_if = "Option::is_none")]
16671    pub shared: Option<bool>,
16672    #[serde(default, skip_serializing_if = "Option::is_none")]
16673    pub updated_at: Option<String>,
16674}
16675
16676/// `SetMaintenanceStateRequest` model.
16677#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16678pub struct SetMaintenanceStateRequest {
16679    /// Strictly a boolean — the string "true" is 400, not coerced.
16680    pub enabled: bool,
16681    /// Plain text shown on the blocked page; the API does not render HTML. Trimmed, and one that
16682    /// trims to empty is stored as no message at all. Over 500 characters is 400 — the cap exists
16683    /// so a misconfigured value cannot become an unbounded payload served at the edge.
16684    #[serde(default, skip_serializing_if = "Option::is_none")]
16685    pub message: Option<String>,
16686}
16687
16688/// `SetModelPricingOverrideRequest` model.
16689#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16690pub struct SetModelPricingOverrideRequest {
16691    pub input_per_million: f64,
16692    pub output_per_million: f64,
16693    /// Discounted rate for provider prefix-cache hits. Absent means cached tokens bill at the full
16694    /// input rate.
16695    #[serde(default, skip_serializing_if = "Option::is_none")]
16696    pub cached_input_per_million: Option<f64>,
16697}
16698
16699/// `SetModelPricingOverrideResponse` model.
16700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16701pub struct SetModelPricingOverrideResponse {
16702    #[serde(rename = "modelRef")]
16703    pub model_ref: String,
16704    pub input_per_million: f64,
16705    pub output_per_million: f64,
16706    /// Absent when not set.
16707    #[serde(default, skip_serializing_if = "Option::is_none")]
16708    pub cached_input_per_million: Option<f64>,
16709}
16710
16711/// `SetRegistrySpecVisibilityRequest` model.
16712#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16713pub struct SetRegistrySpecVisibilityRequest {
16714    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
16715}
16716
16717/// `SetRegistrySpecVisibilityRequestVisibility` enumeration.
16718#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16719pub enum SetRegistrySpecVisibilityRequestVisibility {
16720    #[default]
16721    #[serde(rename = "public")]
16722    Public,
16723    #[serde(rename = "private")]
16724    Private,
16725    /// A value the API introduced after this SDK was generated.
16726    #[serde(untagged)]
16727    Other(String),
16728}
16729
16730impl SetRegistrySpecVisibilityRequestVisibility {
16731    /// The value as it appears on the wire.
16732    pub fn as_str(&self) -> &str {
16733        match self {
16734            Self::Public => "public",
16735            Self::Private => "private",
16736            Self::Other(value) => value.as_str(),
16737        }
16738    }
16739}
16740
16741impl std::fmt::Display for SetRegistrySpecVisibilityRequestVisibility {
16742    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16743        f.write_str(self.as_str())
16744    }
16745}
16746
16747impl From<&str> for SetRegistrySpecVisibilityRequestVisibility {
16748    fn from(value: &str) -> Self {
16749        match value {
16750            "public" => Self::Public,
16751            "private" => Self::Private,
16752            other => Self::Other(other.to_string()),
16753        }
16754    }
16755}
16756
16757/// `SetRegistrySpecVisibilityResponse` model.
16758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16759pub struct SetRegistrySpecVisibilityResponse {
16760    pub scope: String,
16761    pub name: String,
16762    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
16763}
16764
16765/// `SetRootAgentRequest` model.
16766#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16767pub struct SetRootAgentRequest {
16768    pub agent_id: String,
16769}
16770
16771/// `SetRootAgentResponse` model.
16772#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16773pub struct SetRootAgentResponse {
16774    #[serde(default, skip_serializing_if = "Option::is_none")]
16775    pub ok: Option<bool>,
16776    #[serde(default, skip_serializing_if = "Option::is_none")]
16777    pub root_agent_id: Option<String>,
16778}
16779
16780/// `SetRootAttestationResponse` model.
16781#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16782pub struct SetRootAttestationResponse {
16783    #[serde(default, skip_serializing_if = "Option::is_none")]
16784    pub ok: Option<bool>,
16785}
16786
16787/// `SetRunFeedbackRequest` model.
16788#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16789pub struct SetRunFeedbackRequest {
16790    pub message_id: String,
16791    pub reaction: RunFeedbackListFeedbackReaction,
16792}
16793
16794/// `SetScheduleRequest` model.
16795#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16796pub struct SetScheduleRequest {
16797    pub cron: String,
16798    /// Server default: `true`.
16799    #[serde(default, skip_serializing_if = "Option::is_none")]
16800    pub enabled: Option<bool>,
16801    /// Server default: `{}`.
16802    #[serde(default, skip_serializing_if = "Option::is_none")]
16803    pub input: Option<serde_json::Map<String, serde_json::Value>>,
16804    /// Server default: `"UTC"`.
16805    #[serde(default, skip_serializing_if = "Option::is_none")]
16806    pub timezone: Option<String>,
16807    /// Server default: `"retry_next"`.
16808    #[serde(default, skip_serializing_if = "Option::is_none")]
16809    pub on_failure: Option<AgentScheduleConfigOnFailure>,
16810    /// Server default: `1`.
16811    #[serde(default, skip_serializing_if = "Option::is_none")]
16812    pub max_concurrent_scheduled: Option<f64>,
16813    /// When true, schedule is fired by autonomous tick with reflection prompt instead of cron run
16814    /// with input.
16815    #[serde(default, skip_serializing_if = "Option::is_none")]
16816    pub autonomous_mode: Option<bool>,
16817    /// Prompt injected into run input when autonomous_mode is true (e.g. review pending work, plan
16818    /// next steps).
16819    #[serde(default, skip_serializing_if = "Option::is_none")]
16820    pub reflection_prompt: Option<String>,
16821}
16822
16823/// `SetSpawnPolicyResponse` model.
16824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16825pub struct SetSpawnPolicyResponse {
16826    #[serde(default, skip_serializing_if = "Option::is_none")]
16827    pub ok: Option<bool>,
16828}
16829
16830/// `SetupStateResponse` model.
16831#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16832pub struct SetupStateResponse {
16833    pub state: SetupStateResponseState,
16834    /// The subset that gates going live. Read it rather than hard-coding it.
16835    pub required_steps: Vec<String>,
16836    /// Every known step id, required and optional.
16837    pub all_steps: Vec<String>,
16838    /// Required steps still outstanding. Non-empty means an attempt to open registration is refused
16839    /// and will name this list.
16840    pub missing_required: Vec<String>,
16841}
16842
16843/// `SetupStateResponseState` model.
16844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16845pub struct SetupStateResponseState {
16846    /// `live` is a one-way latch; closing registration afterwards does not undo it.
16847    pub status: SetupStateResponseStateStatus,
16848    pub completed_steps: Vec<String>,
16849    pub registration_open: bool,
16850    pub started_at: String,
16851    /// Set once setup first completed. Its presence is what makes the latch one-way.
16852    #[serde(default, skip_serializing_if = "Option::is_none")]
16853    pub completed_at: Option<String>,
16854    pub version: i64,
16855}
16856
16857/// `live` is a one-way latch; closing registration afterwards does not undo it.
16858#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16859pub enum SetupStateResponseStateStatus {
16860    #[default]
16861    #[serde(rename = "in_progress")]
16862    InProgress,
16863    #[serde(rename = "live")]
16864    Live,
16865    /// A value the API introduced after this SDK was generated.
16866    #[serde(untagged)]
16867    Other(String),
16868}
16869
16870impl SetupStateResponseStateStatus {
16871    /// The value as it appears on the wire.
16872    pub fn as_str(&self) -> &str {
16873        match self {
16874            Self::InProgress => "in_progress",
16875            Self::Live => "live",
16876            Self::Other(value) => value.as_str(),
16877        }
16878    }
16879}
16880
16881impl std::fmt::Display for SetupStateResponseStateStatus {
16882    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16883        f.write_str(self.as_str())
16884    }
16885}
16886
16887impl From<&str> for SetupStateResponseStateStatus {
16888    fn from(value: &str) -> Self {
16889        match value {
16890            "in_progress" => Self::InProgress,
16891            "live" => Self::Live,
16892            other => Self::Other(other.to_string()),
16893        }
16894    }
16895}
16896
16897/// `SetUserRoleRequest` model.
16898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16899pub struct SetUserRoleRequest {
16900    pub role: String,
16901}
16902
16903/// `SetUserRoleResponse` model.
16904#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16905pub struct SetUserRoleResponse {
16906    pub updated: bool,
16907    pub user_id: String,
16908    pub role: String,
16909}
16910
16911/// `SharePublicSessionResponse` model.
16912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16913pub struct SharePublicSessionResponse {
16914    pub token: String,
16915}
16916
16917/// `ShareWorkspaceRequest` model.
16918#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16919pub struct ShareWorkspaceRequest {
16920    pub agent_id: String,
16921}
16922
16923/// `SignUpForAndroidTestingRequest` model.
16924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16925pub struct SignUpForAndroidTestingRequest {
16926    pub email: String,
16927    /// Where the sign-up came from, e.g. `landing`. Truncated to 40 chars.
16928    #[serde(default, skip_serializing_if = "Option::is_none")]
16929    pub source: Option<String>,
16930}
16931
16932/// `SpawnPolicy` model.
16933#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16934pub struct SpawnPolicy {
16935    pub tenant_id: String,
16936    /// Child agent gets at most this fraction of parent's budget.
16937    pub child_budget_ratio: f64,
16938    pub max_depth: i64,
16939    pub allowed_roles: Vec<String>,
16940    pub require_approval_above_depth: i64,
16941    pub max_children_per_agent: i64,
16942}
16943
16944/// Body of PUT /governance/permissions/spawn-policy. The handler requires the whole record
16945/// (requireWholeRecord): all five fields, every time; `tenant_id` is the caller's and is not
16946/// accepted in the body.
16947#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16948pub struct SpawnPolicyUpdate {
16949    /// Child agent gets at most this fraction of parent's budget.
16950    pub child_budget_ratio: f64,
16951    pub max_depth: i64,
16952    /// Whole-record write: the array is stored as sent, REPLACING the stored list.
16953    pub allowed_roles: Vec<String>,
16954    pub require_approval_above_depth: i64,
16955    pub max_children_per_agent: i64,
16956}
16957
16958/// `SpecPackage` model.
16959#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16960pub struct SpecPackage {
16961    /// Lowercase alphanumeric and hyphens, 1-64 characters. Also the map key.
16962    pub package_id: String,
16963    pub name: String,
16964    /// Server default: `""`.
16965    #[serde(default, skip_serializing_if = "Option::is_none")]
16966    pub description: Option<String>,
16967    pub category: String,
16968    /// SPEC refs. Only non-emptiness is checked here; the registry resolver enforces the
16969    /// `@scope/name\[@version\]` shape at run time, so a malformed ref is accepted by this write
16970    /// and fails later.
16971    pub included_specs: Vec<String>,
16972    #[serde(default, skip_serializing_if = "Option::is_none")]
16973    pub included_in_plans: Option<Vec<SpecPackageIncludedInPlan>>,
16974    #[serde(default, skip_serializing_if = "Option::is_none")]
16975    pub pricing: Option<SpecPackagePricing>,
16976    #[serde(default, skip_serializing_if = "Option::is_none")]
16977    pub display_order: Option<i64>,
16978    #[serde(default, skip_serializing_if = "Option::is_none")]
16979    pub archived: Option<bool>,
16980    #[serde(default, skip_serializing_if = "Option::is_none")]
16981    pub program: Option<SpecPackageProgram>,
16982    /// Stamped by the server on every write; not read from the body.
16983    #[serde(default, skip_serializing_if = "Option::is_none")]
16984    pub updated_at: Option<String>,
16985}
16986
16987/// `SpecPackageIncludedInPlan` enumeration.
16988#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16989pub enum SpecPackageIncludedInPlan {
16990    #[default]
16991    #[serde(rename = "free")]
16992    Free,
16993    #[serde(rename = "starter")]
16994    Starter,
16995    #[serde(rename = "pro")]
16996    Pro,
16997    #[serde(rename = "enterprise")]
16998    Enterprise,
16999    /// A value the API introduced after this SDK was generated.
17000    #[serde(untagged)]
17001    Other(String),
17002}
17003
17004impl SpecPackageIncludedInPlan {
17005    /// The value as it appears on the wire.
17006    pub fn as_str(&self) -> &str {
17007        match self {
17008            Self::Free => "free",
17009            Self::Starter => "starter",
17010            Self::Pro => "pro",
17011            Self::Enterprise => "enterprise",
17012            Self::Other(value) => value.as_str(),
17013        }
17014    }
17015}
17016
17017impl std::fmt::Display for SpecPackageIncludedInPlan {
17018    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17019        f.write_str(self.as_str())
17020    }
17021}
17022
17023impl From<&str> for SpecPackageIncludedInPlan {
17024    fn from(value: &str) -> Self {
17025        match value {
17026            "free" => Self::Free,
17027            "starter" => Self::Starter,
17028            "pro" => Self::Pro,
17029            "enterprise" => Self::Enterprise,
17030            other => Self::Other(other.to_string()),
17031        }
17032    }
17033}
17034
17035/// `SpecPackagePricing` model.
17036#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17037pub struct SpecPackagePricing {
17038    #[serde(default, skip_serializing_if = "Option::is_none")]
17039    pub price_amount_cents: Option<i64>,
17040    #[serde(default, skip_serializing_if = "Option::is_none")]
17041    pub price_currency: Option<String>,
17042    #[serde(default, skip_serializing_if = "Option::is_none")]
17043    pub billing_interval: Option<SpecPackagePricingBillingInterval>,
17044    /// Never returned by the tenant-facing read. Its presence is what protects the package from a
17045    /// silent drop.
17046    #[serde(default, skip_serializing_if = "Option::is_none")]
17047    pub stripe_price_id: Option<String>,
17048}
17049
17050/// `SpecPackagePricingBillingInterval` enumeration.
17051#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17052pub enum SpecPackagePricingBillingInterval {
17053    #[default]
17054    #[serde(rename = "month")]
17055    Month,
17056    #[serde(rename = "year")]
17057    Year,
17058    /// A value the API introduced after this SDK was generated.
17059    #[serde(untagged)]
17060    Other(String),
17061}
17062
17063impl SpecPackagePricingBillingInterval {
17064    /// The value as it appears on the wire.
17065    pub fn as_str(&self) -> &str {
17066        match self {
17067            Self::Month => "month",
17068            Self::Year => "year",
17069            Self::Other(value) => value.as_str(),
17070        }
17071    }
17072}
17073
17074impl std::fmt::Display for SpecPackagePricingBillingInterval {
17075    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17076        f.write_str(self.as_str())
17077    }
17078}
17079
17080impl From<&str> for SpecPackagePricingBillingInterval {
17081    fn from(value: &str) -> Self {
17082        match value {
17083            "month" => Self::Month,
17084            "year" => Self::Year,
17085            other => Self::Other(other.to_string()),
17086        }
17087    }
17088}
17089
17090/// `SpecPackageProgram` model.
17091#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17092pub struct SpecPackageProgram {
17093    pub nav: SpecPackageProgramNav,
17094    pub pages: Vec<SpecPackageProgramPage>,
17095}
17096
17097/// `SpecPackageProgramNav` model.
17098#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17099pub struct SpecPackageProgramNav {
17100    pub label: String,
17101    #[serde(default, skip_serializing_if = "Option::is_none")]
17102    pub icon: Option<String>,
17103}
17104
17105/// `SpecPackageProgramPage` model.
17106#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17107pub struct SpecPackageProgramPage {
17108    pub id: String,
17109    pub title: String,
17110    #[serde(default, skip_serializing_if = "Option::is_none")]
17111    pub route: Option<String>,
17112}
17113
17114/// Which SPEC output view renders each tool's result, for the builder UI. Keyed by tool name;
17115/// the first view claiming a tool wins, and a view whose JSON will not parse is skipped rather
17116/// than failing the call.
17117#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17118pub struct SpecToolCatalog {
17119    pub agent_id: String,
17120    /// Tool name → the SPEC that owns it and the view to render its output with. Integration
17121    /// aliases map onto their base tool's view.
17122    pub tools: HashMap<String, Value>,
17123}
17124
17125/// `StartMissionRequest` model.
17126#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17127pub struct StartMissionRequest {
17128    /// Chat session the mission belongs to.
17129    pub session_id: String,
17130    /// What the mission is for, in the requester's words.
17131    pub goal: String,
17132    #[serde(default, skip_serializing_if = "Option::is_none")]
17133    pub plan: Option<PlannedMission>,
17134    /// Required when `plan` is omitted: the agents the planner may assign objectives to.
17135    #[serde(default, skip_serializing_if = "Option::is_none")]
17136    pub available_agents: Option<Vec<StartMissionRequestAvailableAgent>>,
17137    /// Skip the intake classifier and treat the request as mission work.
17138    #[serde(default, skip_serializing_if = "Option::is_none")]
17139    pub skip_classification: Option<bool>,
17140    /// ISO 8601. Honoured on the goal-only path.
17141    #[serde(default, skip_serializing_if = "Option::is_none")]
17142    pub deadline: Option<String>,
17143}
17144
17145/// `StartMissionRequestAvailableAgent` model.
17146#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17147pub struct StartMissionRequestAvailableAgent {
17148    pub agent_id: String,
17149    pub name: String,
17150    #[serde(default, skip_serializing_if = "Option::is_none")]
17151    pub description: Option<String>,
17152}
17153
17154/// `StartOAuthProvider` enumeration.
17155#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17156pub enum StartOAuthProvider {
17157    #[default]
17158    #[serde(rename = "github")]
17159    Github,
17160    #[serde(rename = "stripe")]
17161    Stripe,
17162    #[serde(rename = "notion")]
17163    Notion,
17164    #[serde(rename = "slack")]
17165    Slack,
17166    #[serde(rename = "x_twitter")]
17167    XTwitter,
17168    #[serde(rename = "linkedin")]
17169    Linkedin,
17170    #[serde(rename = "youtube")]
17171    Youtube,
17172    #[serde(rename = "instagram")]
17173    Instagram,
17174    /// A value the API introduced after this SDK was generated.
17175    #[serde(untagged)]
17176    Other(String),
17177}
17178
17179impl StartOAuthProvider {
17180    /// The value as it appears on the wire.
17181    pub fn as_str(&self) -> &str {
17182        match self {
17183            Self::Github => "github",
17184            Self::Stripe => "stripe",
17185            Self::Notion => "notion",
17186            Self::Slack => "slack",
17187            Self::XTwitter => "x_twitter",
17188            Self::Linkedin => "linkedin",
17189            Self::Youtube => "youtube",
17190            Self::Instagram => "instagram",
17191            Self::Other(value) => value.as_str(),
17192        }
17193    }
17194}
17195
17196impl std::fmt::Display for StartOAuthProvider {
17197    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17198        f.write_str(self.as_str())
17199    }
17200}
17201
17202impl From<&str> for StartOAuthProvider {
17203    fn from(value: &str) -> Self {
17204        match value {
17205            "github" => Self::Github,
17206            "stripe" => Self::Stripe,
17207            "notion" => Self::Notion,
17208            "slack" => Self::Slack,
17209            "x_twitter" => Self::XTwitter,
17210            "linkedin" => Self::Linkedin,
17211            "youtube" => Self::Youtube,
17212            "instagram" => Self::Instagram,
17213            other => Self::Other(other.to_string()),
17214        }
17215    }
17216}
17217
17218/// `StartOAuthRequest` model.
17219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17220pub struct StartOAuthRequest {
17221    /// Optional. Was declared REQUIRED here while the route has treated it as optional
17222    /// (`routes/integrations.ts`: "agent_id is now optional — if provided, validate it exists"), so
17223    /// a generated client had to invent one to connect an integration that belongs to no agent.
17224    #[serde(default, skip_serializing_if = "Option::is_none")]
17225    pub agent_id: Option<String>,
17226    #[serde(default, skip_serializing_if = "Option::is_none")]
17227    pub name: Option<String>,
17228    #[serde(default, skip_serializing_if = "Option::is_none")]
17229    pub scopes: Option<Vec<String>>,
17230    /// The destination connector when it differs from the OAuth provider in the path —
17231    /// `google_calendar` through `google`, for example. The route reads it and resolves scopes from
17232    /// it; the document did not declare it, so a client generated from this document could not send
17233    /// it and multi-connector OAuth silently asked for the provider's scopes instead of the
17234    /// connector's. Wrong scopes, no error.
17235    #[serde(default, skip_serializing_if = "Option::is_none")]
17236    pub connector_id: Option<String>,
17237    /// Provider-specific parameters the authorize URL needs, e.g. `{ "subdomain": "acme" }` for
17238    /// Zendesk. Read by the route, previously undeclared.
17239    #[serde(default, skip_serializing_if = "Option::is_none")]
17240    pub extra: Option<serde_json::Map<String, serde_json::Value>>,
17241}
17242
17243/// `StartSquadRunRequest` model.
17244#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17245pub struct StartSquadRunRequest {
17246    #[serde(default, skip_serializing_if = "Option::is_none")]
17247    pub input: Option<serde_json::Map<String, serde_json::Value>>,
17248    #[serde(default, skip_serializing_if = "Option::is_none")]
17249    pub addressed_to: Option<Vec<String>>,
17250    #[serde(default, skip_serializing_if = "Option::is_none")]
17251    pub message: Option<String>,
17252    #[serde(default, skip_serializing_if = "Option::is_none")]
17253    pub chat_mode: Option<StartTeamRunRequestInputVariant2chatMode>,
17254}
17255
17256/// `StartSquadRunResponse` model.
17257#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17258pub struct StartSquadRunResponse {
17259    pub team_run_id: String,
17260}
17261
17262/// `addressed_to`, `message` and `chat_mode` were declared at the TOP level here and the
17263/// handler's schema accepts only `input` and `metadata`, with `.strip()`. So a client written
17264/// from this document had its addressing and its chat mode dropped with no error at all: the
17265/// run started, it just was not the run that was asked for. They belong inside `input`, which
17266/// is where the handler reads them.
17267#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17268pub struct StartTeamRunRequest {
17269    /// The turn. A bare string is expanded to `{ message }`. `addressed_to` selects who answers;
17270    /// absent, @mentions in `message` are parsed for the same purpose.
17271    pub input: serde_json::Value,
17272    /// Accepted by the handler and undeclared here until now — the drift ran both ways.
17273    #[serde(default, skip_serializing_if = "Option::is_none")]
17274    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
17275}
17276
17277/// `StartTeamRunRequestInputVariant2` model.
17278#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17279pub struct StartTeamRunRequestInputVariant2 {
17280    #[serde(default, skip_serializing_if = "Option::is_none")]
17281    pub message: Option<String>,
17282    #[serde(default, skip_serializing_if = "Option::is_none")]
17283    pub addressed_to: Option<Vec<String>>,
17284    #[serde(default, skip_serializing_if = "Option::is_none")]
17285    pub chat_mode: Option<StartTeamRunRequestInputVariant2chatMode>,
17286}
17287
17288/// `StartTeamRunRequestInputVariant2chatMode` enumeration.
17289#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17290pub enum StartTeamRunRequestInputVariant2chatMode {
17291    #[default]
17292    #[serde(rename = "plan")]
17293    Plan,
17294    #[serde(rename = "chat")]
17295    Chat,
17296    /// A value the API introduced after this SDK was generated.
17297    #[serde(untagged)]
17298    Other(String),
17299}
17300
17301impl StartTeamRunRequestInputVariant2chatMode {
17302    /// The value as it appears on the wire.
17303    pub fn as_str(&self) -> &str {
17304        match self {
17305            Self::Plan => "plan",
17306            Self::Chat => "chat",
17307            Self::Other(value) => value.as_str(),
17308        }
17309    }
17310}
17311
17312impl std::fmt::Display for StartTeamRunRequestInputVariant2chatMode {
17313    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17314        f.write_str(self.as_str())
17315    }
17316}
17317
17318impl From<&str> for StartTeamRunRequestInputVariant2chatMode {
17319    fn from(value: &str) -> Self {
17320        match value {
17321            "plan" => Self::Plan,
17322            "chat" => Self::Chat,
17323            other => Self::Other(other.to_string()),
17324        }
17325    }
17326}
17327
17328/// `StartTeamRunResponse` model.
17329#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17330pub struct StartTeamRunResponse {
17331    pub team_run_id: String,
17332}
17333
17334/// `SubmitFeedbackRequest` model.
17335#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17336pub struct SubmitFeedbackRequest {
17337    /// Clipped at 8000 characters.
17338    pub message: String,
17339    /// Clipped at 300.
17340    #[serde(default, skip_serializing_if = "Option::is_none")]
17341    pub title: Option<String>,
17342    /// Clipped at 2000.
17343    #[serde(default, skip_serializing_if = "Option::is_none")]
17344    pub context: Option<String>,
17345    /// Clipped at 1000.
17346    #[serde(default, skip_serializing_if = "Option::is_none")]
17347    pub url: Option<String>,
17348    #[serde(default, skip_serializing_if = "Option::is_none")]
17349    pub run_id: Option<String>,
17350    /// Anything other than `feedback` is filed as an error.
17351    #[serde(default, skip_serializing_if = "Option::is_none")]
17352    pub kind: Option<ErrorReportKind>,
17353}
17354
17355/// `SubmitFeedbackResponse` model.
17356#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17357pub struct SubmitFeedbackResponse {
17358    pub ok: bool,
17359    pub id: String,
17360}
17361
17362/// `SubscribeToListingRequest` model.
17363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17364pub struct SubscribeToListingRequest {
17365    #[serde(default, skip_serializing_if = "Option::is_none")]
17366    pub stripe_subscription_id: Option<String>,
17367}
17368
17369/// `SuspendAgentRequest` model.
17370#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17371pub struct SuspendAgentRequest {
17372    #[serde(default, skip_serializing_if = "Option::is_none")]
17373    pub reason: Option<String>,
17374}
17375
17376/// `SuspendTenantRequest` model.
17377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17378pub struct SuspendTenantRequest {
17379    #[serde(default, skip_serializing_if = "Option::is_none")]
17380    pub reason: Option<String>,
17381}
17382
17383/// `SuspendUserResponse` model.
17384#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17385pub struct SuspendUserResponse {
17386    pub suspended: bool,
17387    pub user_id: String,
17388}
17389
17390/// `SwitchTenantRequest` model.
17391#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17392pub struct SwitchTenantRequest {
17393    pub tenant_id: String,
17394}
17395
17396/// `SwitchTenantResponse` model.
17397#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17398pub struct SwitchTenantResponse {
17399    pub switched: bool,
17400    pub tenant_id: String,
17401    pub user_id: String,
17402    pub role: String,
17403}
17404
17405/// `SyncProviderModelsResponse` model.
17406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17407pub struct SyncProviderModelsResponse {
17408    /// New catalogue entries.
17409    pub added: i64,
17410    /// Ids of the added entries; capped.
17411    #[serde(rename = "addedIds")]
17412    pub added_ids: Vec<String>,
17413    /// Catalogue size after the merge.
17414    pub total: i64,
17415    /// Models the provider reported.
17416    pub scanned: i64,
17417    /// Present when the run was scoped to one provider, as it is here.
17418    #[serde(default, skip_serializing_if = "Option::is_none")]
17419    pub provider: Option<String>,
17420}
17421
17422/// Multi-agent collaboration unit (tenant-scoped).
17423#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17424pub struct Team {
17425    pub team_id: String,
17426    pub tenant_id: String,
17427    pub name: String,
17428    #[serde(default, skip_serializing_if = "Option::is_none")]
17429    pub description: Option<String>,
17430    pub topology: TeamTopology,
17431    #[serde(default, skip_serializing_if = "Option::is_none")]
17432    pub delegation_strategy: Option<TeamDelegationStrategy>,
17433    #[serde(default, skip_serializing_if = "Option::is_none")]
17434    pub merge_strategy: Option<TeamMergeStrategy>,
17435    #[serde(default, skip_serializing_if = "Option::is_none")]
17436    pub message_protocol: Option<TeamMessageProtocol>,
17437    #[serde(default, skip_serializing_if = "Option::is_none")]
17438    pub orchestration_mode: Option<TeamOrchestrationMode>,
17439    #[serde(default, skip_serializing_if = "Option::is_none")]
17440    pub supervisor_mode: Option<TeamSupervisorMode>,
17441    pub supervisor_agent_id: String,
17442    pub workers: Vec<TeamWorker>,
17443    pub policies: TeamPolicies,
17444    #[serde(default, skip_serializing_if = "Option::is_none")]
17445    pub goal_config: Option<TeamGoalConfig>,
17446    #[serde(default, skip_serializing_if = "Option::is_none")]
17447    pub swarm_config: Option<TeamSwarmConfig>,
17448    #[serde(default, skip_serializing_if = "Option::is_none")]
17449    pub workspace_id: Option<String>,
17450    #[serde(default, skip_serializing_if = "Option::is_none")]
17451    pub created_at: Option<String>,
17452    #[serde(default, skip_serializing_if = "Option::is_none")]
17453    pub updated_at: Option<String>,
17454}
17455
17456/// `TeamChatTurn` model.
17457#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17458pub struct TeamChatTurn {
17459    #[serde(default, skip_serializing_if = "Option::is_none")]
17460    pub addressed_to: Option<Vec<String>>,
17461    pub content: String,
17462    pub from_task: bool,
17463    pub role: String,
17464    pub run_meta: serde_json::Map<String, serde_json::Value>,
17465    pub run_pending: bool,
17466    pub team_run_id: String,
17467    #[serde(default, skip_serializing_if = "Option::is_none")]
17468    pub thread_id: Option<String>,
17469    pub timestamp: String,
17470}
17471
17472/// Body for `POST /api/v1/teams` (`CreateTeamSchema`).
17473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17474pub struct TeamCreate {
17475    pub name: String,
17476    #[serde(default, skip_serializing_if = "Option::is_none")]
17477    pub description: Option<String>,
17478    #[serde(default, skip_serializing_if = "Option::is_none")]
17479    pub topology: Option<String>,
17480    #[serde(default, skip_serializing_if = "Option::is_none")]
17481    pub supervisor_agent_id: Option<String>,
17482    /// Each entry REQUIRES `agent_id` — omitting it answers `422 workers.0.agent_id: Required`.
17483    #[serde(default, skip_serializing_if = "Option::is_none")]
17484    pub workers: Option<Vec<TeamCreateWorker>>,
17485    #[serde(default, skip_serializing_if = "Option::is_none")]
17486    pub agent_ids: Option<Vec<String>>,
17487    #[serde(default, skip_serializing_if = "Option::is_none")]
17488    pub delegation_strategy: Option<String>,
17489    #[serde(default, skip_serializing_if = "Option::is_none")]
17490    pub merge_strategy: Option<String>,
17491    #[serde(default, skip_serializing_if = "Option::is_none")]
17492    pub orchestration_mode: Option<String>,
17493    #[serde(default, skip_serializing_if = "Option::is_none")]
17494    pub workspace_id: Option<String>,
17495}
17496
17497/// `TeamCreateWorker` model.
17498#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17499pub struct TeamCreateWorker {
17500    pub agent_id: String,
17501    #[serde(default, skip_serializing_if = "Option::is_none")]
17502    pub role: Option<String>,
17503}
17504
17505/// `TeamDelegationStrategy` enumeration.
17506#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17507pub enum TeamDelegationStrategy {
17508    #[default]
17509    #[serde(rename = "supervisor_decides")]
17510    SupervisorDecides,
17511    #[serde(rename = "round_robin")]
17512    RoundRobin,
17513    #[serde(rename = "capability_match")]
17514    CapabilityMatch,
17515    /// A value the API introduced after this SDK was generated.
17516    #[serde(untagged)]
17517    Other(String),
17518}
17519
17520impl TeamDelegationStrategy {
17521    /// The value as it appears on the wire.
17522    pub fn as_str(&self) -> &str {
17523        match self {
17524            Self::SupervisorDecides => "supervisor_decides",
17525            Self::RoundRobin => "round_robin",
17526            Self::CapabilityMatch => "capability_match",
17527            Self::Other(value) => value.as_str(),
17528        }
17529    }
17530}
17531
17532impl std::fmt::Display for TeamDelegationStrategy {
17533    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17534        f.write_str(self.as_str())
17535    }
17536}
17537
17538impl From<&str> for TeamDelegationStrategy {
17539    fn from(value: &str) -> Self {
17540        match value {
17541            "supervisor_decides" => Self::SupervisorDecides,
17542            "round_robin" => Self::RoundRobin,
17543            "capability_match" => Self::CapabilityMatch,
17544            other => Self::Other(other.to_string()),
17545        }
17546    }
17547}
17548
17549/// Goal-driven topology: the objective, the review cadence, the budget.
17550#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17551pub struct TeamGoalConfig {
17552    pub root_objective_id: String,
17553    #[serde(default, skip_serializing_if = "Option::is_none")]
17554    pub review_interval_ms: Option<i64>,
17555    #[serde(default, skip_serializing_if = "Option::is_none")]
17556    pub max_iterations: Option<i64>,
17557    #[serde(default, skip_serializing_if = "Option::is_none")]
17558    pub budget: Option<TeamObjectiveBudget>,
17559}
17560
17561/// `TeamGraphEdge` model.
17562#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17563pub struct TeamGraphEdge {
17564    pub edge_id: String,
17565    pub from: String,
17566    pub to: String,
17567    pub r#type: TeamGraphEdgeType,
17568    #[serde(default, skip_serializing_if = "Option::is_none")]
17569    pub task_id: Option<String>,
17570    pub created_at: String,
17571}
17572
17573/// `TeamGraphEdgeType` enumeration.
17574#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17575pub enum TeamGraphEdgeType {
17576    #[default]
17577    #[serde(rename = "delegation")]
17578    Delegation,
17579    #[serde(rename = "supervision")]
17580    Supervision,
17581    #[serde(rename = "peer")]
17582    Peer,
17583    /// A value the API introduced after this SDK was generated.
17584    #[serde(untagged)]
17585    Other(String),
17586}
17587
17588impl TeamGraphEdgeType {
17589    /// The value as it appears on the wire.
17590    pub fn as_str(&self) -> &str {
17591        match self {
17592            Self::Delegation => "delegation",
17593            Self::Supervision => "supervision",
17594            Self::Peer => "peer",
17595            Self::Other(value) => value.as_str(),
17596        }
17597    }
17598}
17599
17600impl std::fmt::Display for TeamGraphEdgeType {
17601    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17602        f.write_str(self.as_str())
17603    }
17604}
17605
17606impl From<&str> for TeamGraphEdgeType {
17607    fn from(value: &str) -> Self {
17608        match value {
17609            "delegation" => Self::Delegation,
17610            "supervision" => Self::Supervision,
17611            "peer" => Self::Peer,
17612            other => Self::Other(other.to_string()),
17613        }
17614    }
17615}
17616
17617/// `TeamGraphNode` model.
17618#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17619pub struct TeamGraphNode {
17620    pub agent_id: String,
17621    pub role: TeamGraphNodeRole,
17622    pub status: TeamGraphNodeStatus,
17623    pub spawned_by: String,
17624    pub spawned_at: String,
17625    pub goal_summary: String,
17626}
17627
17628/// `TeamGraphNodeRole` enumeration.
17629#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17630pub enum TeamGraphNodeRole {
17631    #[default]
17632    #[serde(rename = "orchestrator")]
17633    Orchestrator,
17634    #[serde(rename = "worker")]
17635    Worker,
17636    #[serde(rename = "arbiter")]
17637    Arbiter,
17638    /// A value the API introduced after this SDK was generated.
17639    #[serde(untagged)]
17640    Other(String),
17641}
17642
17643impl TeamGraphNodeRole {
17644    /// The value as it appears on the wire.
17645    pub fn as_str(&self) -> &str {
17646        match self {
17647            Self::Orchestrator => "orchestrator",
17648            Self::Worker => "worker",
17649            Self::Arbiter => "arbiter",
17650            Self::Other(value) => value.as_str(),
17651        }
17652    }
17653}
17654
17655impl std::fmt::Display for TeamGraphNodeRole {
17656    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17657        f.write_str(self.as_str())
17658    }
17659}
17660
17661impl From<&str> for TeamGraphNodeRole {
17662    fn from(value: &str) -> Self {
17663        match value {
17664            "orchestrator" => Self::Orchestrator,
17665            "worker" => Self::Worker,
17666            "arbiter" => Self::Arbiter,
17667            other => Self::Other(other.to_string()),
17668        }
17669    }
17670}
17671
17672/// `TeamGraphNodeStatus` enumeration.
17673#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17674pub enum TeamGraphNodeStatus {
17675    #[default]
17676    #[serde(rename = "active")]
17677    Active,
17678    #[serde(rename = "idle")]
17679    Idle,
17680    #[serde(rename = "terminated")]
17681    Terminated,
17682    /// A value the API introduced after this SDK was generated.
17683    #[serde(untagged)]
17684    Other(String),
17685}
17686
17687impl TeamGraphNodeStatus {
17688    /// The value as it appears on the wire.
17689    pub fn as_str(&self) -> &str {
17690        match self {
17691            Self::Active => "active",
17692            Self::Idle => "idle",
17693            Self::Terminated => "terminated",
17694            Self::Other(value) => value.as_str(),
17695        }
17696    }
17697}
17698
17699impl std::fmt::Display for TeamGraphNodeStatus {
17700    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17701        f.write_str(self.as_str())
17702    }
17703}
17704
17705impl From<&str> for TeamGraphNodeStatus {
17706    fn from(value: &str) -> Self {
17707        match value {
17708            "active" => Self::Active,
17709            "idle" => Self::Idle,
17710            "terminated" => Self::Terminated,
17711            other => Self::Other(other.to_string()),
17712        }
17713    }
17714}
17715
17716/// `TeamMergeStrategy` enumeration.
17717#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17718pub enum TeamMergeStrategy {
17719    #[default]
17720    #[serde(rename = "supervisor_merges")]
17721    SupervisorMerges,
17722    #[serde(rename = "concatenate")]
17723    Concatenate,
17724    #[serde(rename = "vote")]
17725    Vote,
17726    /// A value the API introduced after this SDK was generated.
17727    #[serde(untagged)]
17728    Other(String),
17729}
17730
17731impl TeamMergeStrategy {
17732    /// The value as it appears on the wire.
17733    pub fn as_str(&self) -> &str {
17734        match self {
17735            Self::SupervisorMerges => "supervisor_merges",
17736            Self::Concatenate => "concatenate",
17737            Self::Vote => "vote",
17738            Self::Other(value) => value.as_str(),
17739        }
17740    }
17741}
17742
17743impl std::fmt::Display for TeamMergeStrategy {
17744    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17745        f.write_str(self.as_str())
17746    }
17747}
17748
17749impl From<&str> for TeamMergeStrategy {
17750    fn from(value: &str) -> Self {
17751        match value {
17752            "supervisor_merges" => Self::SupervisorMerges,
17753            "concatenate" => Self::Concatenate,
17754            "vote" => Self::Vote,
17755            other => Self::Other(other.to_string()),
17756        }
17757    }
17758}
17759
17760/// `TeamMessageProtocol` enumeration.
17761#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17762pub enum TeamMessageProtocol {
17763    #[default]
17764    #[serde(rename = "shared_context")]
17765    SharedContext,
17766    #[serde(rename = "message_passing")]
17767    MessagePassing,
17768    /// A value the API introduced after this SDK was generated.
17769    #[serde(untagged)]
17770    Other(String),
17771}
17772
17773impl TeamMessageProtocol {
17774    /// The value as it appears on the wire.
17775    pub fn as_str(&self) -> &str {
17776        match self {
17777            Self::SharedContext => "shared_context",
17778            Self::MessagePassing => "message_passing",
17779            Self::Other(value) => value.as_str(),
17780        }
17781    }
17782}
17783
17784impl std::fmt::Display for TeamMessageProtocol {
17785    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17786        f.write_str(self.as_str())
17787    }
17788}
17789
17790impl From<&str> for TeamMessageProtocol {
17791    fn from(value: &str) -> Self {
17792        match value {
17793            "shared_context" => Self::SharedContext,
17794            "message_passing" => Self::MessagePassing,
17795            other => Self::Other(other.to_string()),
17796        }
17797    }
17798}
17799
17800/// Ceiling for a goal-driven team's pursuit of its objective.
17801#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17802pub struct TeamObjectiveBudget {
17803    #[serde(default, skip_serializing_if = "Option::is_none")]
17804    pub max_runs: Option<i64>,
17805    #[serde(default, skip_serializing_if = "Option::is_none")]
17806    pub max_tokens: Option<i64>,
17807    #[serde(default, skip_serializing_if = "Option::is_none")]
17808    pub max_cost_usd: Option<f64>,
17809}
17810
17811/// `TeamOrchestrationMode` enumeration.
17812#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17813pub enum TeamOrchestrationMode {
17814    #[default]
17815    #[serde(rename = "strict_addressed")]
17816    StrictAddressed,
17817    #[serde(rename = "peer_collab")]
17818    PeerCollab,
17819    #[serde(rename = "vote_based")]
17820    VoteBased,
17821    /// A value the API introduced after this SDK was generated.
17822    #[serde(untagged)]
17823    Other(String),
17824}
17825
17826impl TeamOrchestrationMode {
17827    /// The value as it appears on the wire.
17828    pub fn as_str(&self) -> &str {
17829        match self {
17830            Self::StrictAddressed => "strict_addressed",
17831            Self::PeerCollab => "peer_collab",
17832            Self::VoteBased => "vote_based",
17833            Self::Other(value) => value.as_str(),
17834        }
17835    }
17836}
17837
17838impl std::fmt::Display for TeamOrchestrationMode {
17839    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17840        f.write_str(self.as_str())
17841    }
17842}
17843
17844impl From<&str> for TeamOrchestrationMode {
17845    fn from(value: &str) -> Self {
17846        match value {
17847            "strict_addressed" => Self::StrictAddressed,
17848            "peer_collab" => Self::PeerCollab,
17849            "vote_based" => Self::VoteBased,
17850            other => Self::Other(other.to_string()),
17851        }
17852    }
17853}
17854
17855/// Limits and failure handling for a team run.
17856#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17857pub struct TeamPolicies {
17858    pub max_rounds: i64,
17859    /// Total team run timeout. Accepted at any value but only ever RAISED: anything below 3600000
17860    /// (1 hour) is enforced as 3600000, so that slow local models are not killed mid-run. 0 or
17861    /// absent means uncapped.
17862    pub timeout_ms: i64,
17863    pub early_termination: bool,
17864    #[serde(default, skip_serializing_if = "Option::is_none")]
17865    pub consensus_threshold: Option<f64>,
17866    pub effort: TeamPoliciesEffort,
17867    /// supervisor -\> worker -\> sub-worker.
17868    pub max_delegation_depth: i64,
17869    pub subtask_timeout_ms: i64,
17870    /// Applied by the auto_dispatch supervisor. Under tool_driven the failure is returned to the
17871    /// supervisor as a tool result instead, and this policy does not run.
17872    pub on_worker_failure: TeamPoliciesOnWorkerFailure,
17873    pub max_worker_retries: i64,
17874    pub require_all_workers: bool,
17875    #[serde(default, skip_serializing_if = "Option::is_none")]
17876    pub validation: Option<ValidationPolicy>,
17877    /// Default 50.
17878    #[serde(default, skip_serializing_if = "Option::is_none")]
17879    pub max_graph_nodes: Option<i64>,
17880    /// Concurrent worker runs in a fan-out (default 8).
17881    #[serde(default, skip_serializing_if = "Option::is_none")]
17882    pub max_concurrency: Option<i64>,
17883}
17884
17885/// `TeamPoliciesEffort` enumeration.
17886#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17887pub enum TeamPoliciesEffort {
17888    #[default]
17889    #[serde(rename = "low")]
17890    Low,
17891    #[serde(rename = "medium")]
17892    Medium,
17893    #[serde(rename = "high")]
17894    High,
17895    #[serde(rename = "max")]
17896    Max,
17897    /// A value the API introduced after this SDK was generated.
17898    #[serde(untagged)]
17899    Other(String),
17900}
17901
17902impl TeamPoliciesEffort {
17903    /// The value as it appears on the wire.
17904    pub fn as_str(&self) -> &str {
17905        match self {
17906            Self::Low => "low",
17907            Self::Medium => "medium",
17908            Self::High => "high",
17909            Self::Max => "max",
17910            Self::Other(value) => value.as_str(),
17911        }
17912    }
17913}
17914
17915impl std::fmt::Display for TeamPoliciesEffort {
17916    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17917        f.write_str(self.as_str())
17918    }
17919}
17920
17921impl From<&str> for TeamPoliciesEffort {
17922    fn from(value: &str) -> Self {
17923        match value {
17924            "low" => Self::Low,
17925            "medium" => Self::Medium,
17926            "high" => Self::High,
17927            "max" => Self::Max,
17928            other => Self::Other(other.to_string()),
17929        }
17930    }
17931}
17932
17933/// Applied by the auto_dispatch supervisor. Under tool_driven the failure is returned to the
17934/// supervisor as a tool result instead, and this policy does not run.
17935#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17936pub enum TeamPoliciesOnWorkerFailure {
17937    #[default]
17938    #[serde(rename = "retry")]
17939    Retry,
17940    #[serde(rename = "skip")]
17941    Skip,
17942    #[serde(rename = "abort_team")]
17943    AbortTeam,
17944    /// A value the API introduced after this SDK was generated.
17945    #[serde(untagged)]
17946    Other(String),
17947}
17948
17949impl TeamPoliciesOnWorkerFailure {
17950    /// The value as it appears on the wire.
17951    pub fn as_str(&self) -> &str {
17952        match self {
17953            Self::Retry => "retry",
17954            Self::Skip => "skip",
17955            Self::AbortTeam => "abort_team",
17956            Self::Other(value) => value.as_str(),
17957        }
17958    }
17959}
17960
17961impl std::fmt::Display for TeamPoliciesOnWorkerFailure {
17962    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17963        f.write_str(self.as_str())
17964    }
17965}
17966
17967impl From<&str> for TeamPoliciesOnWorkerFailure {
17968    fn from(value: &str) -> Self {
17969        match value {
17970            "retry" => Self::Retry,
17971            "skip" => Self::Skip,
17972            "abort_team" => Self::AbortTeam,
17973            other => Self::Other(other.to_string()),
17974        }
17975    }
17976}
17977
17978/// GET /teams/{teamId}/runs/{teamRunId} and GET /squads/{squadId}/runs/{teamRunId} (measured
17979/// 2026-09-10 on e2e-canon, identical on both routes): the team run and the member runs it
17980/// spawned.
17981#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17982pub struct TeamRunDetail {
17983    pub team_run_id: String,
17984    pub team_id: String,
17985    pub status: String,
17986    pub runs: Vec<Run>,
17987    pub total_runs: i64,
17988}
17989
17990/// `TeamRunSummary` model.
17991#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17992pub struct TeamRunSummary {
17993    pub team_run_id: String,
17994    pub run_id: String,
17995    pub agent_id: String,
17996    pub status: String,
17997    pub created_at: String,
17998}
17999
18000/// `TeamSupervisorMode` enumeration.
18001#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18002pub enum TeamSupervisorMode {
18003    #[default]
18004    #[serde(rename = "auto_dispatch")]
18005    AutoDispatch,
18006    #[serde(rename = "tool_driven")]
18007    ToolDriven,
18008    /// A value the API introduced after this SDK was generated.
18009    #[serde(untagged)]
18010    Other(String),
18011}
18012
18013impl TeamSupervisorMode {
18014    /// The value as it appears on the wire.
18015    pub fn as_str(&self) -> &str {
18016        match self {
18017            Self::AutoDispatch => "auto_dispatch",
18018            Self::ToolDriven => "tool_driven",
18019            Self::Other(value) => value.as_str(),
18020        }
18021    }
18022}
18023
18024impl std::fmt::Display for TeamSupervisorMode {
18025    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18026        f.write_str(self.as_str())
18027    }
18028}
18029
18030impl From<&str> for TeamSupervisorMode {
18031    fn from(value: &str) -> Self {
18032        match value {
18033            "auto_dispatch" => Self::AutoDispatch,
18034            "tool_driven" => Self::ToolDriven,
18035            other => Self::Other(other.to_string()),
18036        }
18037    }
18038}
18039
18040/// Swarm topology: who starts, and how context travels on handoff.
18041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18042pub struct TeamSwarmConfig {
18043    pub initial_agent_id: String,
18044    #[serde(default, skip_serializing_if = "Option::is_none")]
18045    pub max_handoffs: Option<i64>,
18046    #[serde(default, skip_serializing_if = "Option::is_none")]
18047    pub handoff_context_strategy: Option<TeamSwarmConfigHandoffContextStrategy>,
18048}
18049
18050/// `TeamSwarmConfigHandoffContextStrategy` enumeration.
18051#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18052pub enum TeamSwarmConfigHandoffContextStrategy {
18053    #[default]
18054    #[serde(rename = "full")]
18055    Full,
18056    #[serde(rename = "summary")]
18057    Summary,
18058    /// A value the API introduced after this SDK was generated.
18059    #[serde(untagged)]
18060    Other(String),
18061}
18062
18063impl TeamSwarmConfigHandoffContextStrategy {
18064    /// The value as it appears on the wire.
18065    pub fn as_str(&self) -> &str {
18066        match self {
18067            Self::Full => "full",
18068            Self::Summary => "summary",
18069            Self::Other(value) => value.as_str(),
18070        }
18071    }
18072}
18073
18074impl std::fmt::Display for TeamSwarmConfigHandoffContextStrategy {
18075    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18076        f.write_str(self.as_str())
18077    }
18078}
18079
18080impl From<&str> for TeamSwarmConfigHandoffContextStrategy {
18081    fn from(value: &str) -> Self {
18082        match value {
18083            "full" => Self::Full,
18084            "summary" => Self::Summary,
18085            other => Self::Other(other.to_string()),
18086        }
18087    }
18088}
18089
18090/// `TeamTopology` enumeration.
18091#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18092pub enum TeamTopology {
18093    #[default]
18094    #[serde(rename = "supervisor")]
18095    Supervisor,
18096    #[serde(rename = "round_robin")]
18097    RoundRobin,
18098    #[serde(rename = "pipeline")]
18099    Pipeline,
18100    #[serde(rename = "goal_driven")]
18101    GoalDriven,
18102    #[serde(rename = "swarm")]
18103    Swarm,
18104    /// A value the API introduced after this SDK was generated.
18105    #[serde(untagged)]
18106    Other(String),
18107}
18108
18109impl TeamTopology {
18110    /// The value as it appears on the wire.
18111    pub fn as_str(&self) -> &str {
18112        match self {
18113            Self::Supervisor => "supervisor",
18114            Self::RoundRobin => "round_robin",
18115            Self::Pipeline => "pipeline",
18116            Self::GoalDriven => "goal_driven",
18117            Self::Swarm => "swarm",
18118            Self::Other(value) => value.as_str(),
18119        }
18120    }
18121}
18122
18123impl std::fmt::Display for TeamTopology {
18124    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18125        f.write_str(self.as_str())
18126    }
18127}
18128
18129impl From<&str> for TeamTopology {
18130    fn from(value: &str) -> Self {
18131        match value {
18132            "supervisor" => Self::Supervisor,
18133            "round_robin" => Self::RoundRobin,
18134            "pipeline" => Self::Pipeline,
18135            "goal_driven" => Self::GoalDriven,
18136            "swarm" => Self::Swarm,
18137            other => Self::Other(other.to_string()),
18138        }
18139    }
18140}
18141
18142/// Body for `PUT /api/v1/teams/{teamId}`. Every field optional — send only what changes.
18143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18144pub struct TeamUpdate {
18145    #[serde(default, skip_serializing_if = "Option::is_none")]
18146    pub name: Option<String>,
18147    #[serde(default, skip_serializing_if = "Option::is_none")]
18148    pub description: Option<String>,
18149    #[serde(default, skip_serializing_if = "Option::is_none")]
18150    pub topology: Option<String>,
18151    #[serde(default, skip_serializing_if = "Option::is_none")]
18152    pub supervisor_agent_id: Option<String>,
18153    #[serde(default, skip_serializing_if = "Option::is_none")]
18154    pub workers: Option<Vec<TeamUpdateWorker>>,
18155}
18156
18157/// `TeamUpdateWorker` model.
18158#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18159pub struct TeamUpdateWorker {
18160    pub agent_id: String,
18161    #[serde(default, skip_serializing_if = "Option::is_none")]
18162    pub role: Option<String>,
18163}
18164
18165/// An agent acting in a team, with a role and permissions.
18166#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18167pub struct TeamWorker {
18168    pub agent_id: String,
18169    pub role: String,
18170    pub permissions: TeamWorkerPermissions,
18171    #[serde(default, skip_serializing_if = "Option::is_none")]
18172    pub external_a2a: Option<TeamWorkerExternalA2A>,
18173}
18174
18175/// Delegate this worker to another platform over the A2A protocol.
18176#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18177pub struct TeamWorkerExternalA2A {
18178    pub endpoint: String,
18179    pub agent_card_url: String,
18180    #[serde(default, skip_serializing_if = "Option::is_none")]
18181    pub auth: Option<TeamWorkerExternalA2AAuth>,
18182}
18183
18184/// `TeamWorkerExternalA2AAuth` model.
18185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18186pub struct TeamWorkerExternalA2AAuth {
18187    pub r#type: String,
18188    #[serde(default, skip_serializing_if = "Option::is_none")]
18189    pub token_ref: Option<String>,
18190}
18191
18192/// What a worker may do inside a team run.
18193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18194pub struct TeamWorkerPermissions {
18195    /// Tool names this worker may invoke. Defaults to the agent's own allowed_tools.
18196    pub tools: Vec<String>,
18197    pub can_read_other_results: bool,
18198    pub can_delegate: bool,
18199    pub can_abort: bool,
18200    #[serde(default, skip_serializing_if = "Option::is_none")]
18201    pub max_tokens: Option<i64>,
18202    #[serde(default, skip_serializing_if = "Option::is_none")]
18203    pub max_steps_per_subtask: Option<i64>,
18204}
18205
18206/// `Tenant` model.
18207#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18208pub struct Tenant {
18209    pub tenant_id: String,
18210    pub name: String,
18211    pub slug: String,
18212    pub status: TenantStatus,
18213    #[serde(default, skip_serializing_if = "Option::is_none")]
18214    pub plan: Option<String>,
18215    /// Resolved plan id — present on the normal answer, absent on the bootstrap branch.
18216    #[serde(default, skip_serializing_if = "Option::is_none")]
18217    pub plan_id: Option<String>,
18218    #[serde(default, skip_serializing_if = "Option::is_none")]
18219    pub quotas: Option<TenantQuotas>,
18220    #[serde(default, skip_serializing_if = "Option::is_none")]
18221    pub quota_overrides: Option<TenantQuotaOverrides>,
18222    #[serde(default, skip_serializing_if = "Option::is_none")]
18223    pub settings: Option<serde_json::Map<String, serde_json::Value>>,
18224    #[serde(default, skip_serializing_if = "Option::is_none")]
18225    pub billing: Option<TenantBilling>,
18226    #[serde(default, skip_serializing_if = "Option::is_none")]
18227    pub billing_status: Option<TenantBillingStatus>,
18228    #[serde(default, skip_serializing_if = "Option::is_none")]
18229    pub trial: Option<TenantTrial>,
18230    #[serde(default, skip_serializing_if = "Option::is_none")]
18231    pub trial_ends_at: Option<String>,
18232    #[serde(default, skip_serializing_if = "Option::is_none")]
18233    pub trial_recommended_plan: Option<String>,
18234    #[serde(default, skip_serializing_if = "Option::is_none")]
18235    pub trial_resolved: Option<bool>,
18236    #[serde(default, skip_serializing_if = "Option::is_none")]
18237    pub onboarding_completed: Option<bool>,
18238    #[serde(default, skip_serializing_if = "Option::is_none")]
18239    pub is_super_admin: Option<bool>,
18240    #[serde(default, skip_serializing_if = "Option::is_none")]
18241    pub is_platform_admin: Option<bool>,
18242    #[serde(default, skip_serializing_if = "Option::is_none")]
18243    pub head_agent_id: Option<String>,
18244    #[serde(default, skip_serializing_if = "Option::is_none")]
18245    pub shared_workspace_id: Option<String>,
18246    #[serde(default, skip_serializing_if = "Option::is_none")]
18247    pub public: Option<bool>,
18248    #[serde(default, skip_serializing_if = "Option::is_none")]
18249    pub description: Option<String>,
18250    #[serde(default, skip_serializing_if = "Option::is_none")]
18251    pub logo_url: Option<String>,
18252    #[serde(default, skip_serializing_if = "Option::is_none")]
18253    pub custom_domain: Option<TenantCustomDomain>,
18254    #[serde(default, skip_serializing_if = "Option::is_none")]
18255    pub branding: Option<TenantBranding>,
18256    #[serde(default, skip_serializing_if = "Option::is_none")]
18257    pub social_links: Option<serde_json::Map<String, serde_json::Value>>,
18258    #[serde(default, skip_serializing_if = "Option::is_none")]
18259    pub marketplace_listing: Option<serde_json::Map<String, serde_json::Value>>,
18260    #[serde(default, skip_serializing_if = "Option::is_none")]
18261    pub public_agent_id: Option<String>,
18262    #[serde(default, skip_serializing_if = "Option::is_none")]
18263    pub published_agent_ids: Option<Vec<String>>,
18264    #[serde(default, skip_serializing_if = "Option::is_none")]
18265    pub public_settings: Option<TenantPublicSettings>,
18266    #[serde(default, skip_serializing_if = "Option::is_none")]
18267    pub entitled_spec_packages: Option<Vec<String>>,
18268    #[serde(default, skip_serializing_if = "Option::is_none")]
18269    pub legal_hold: Option<bool>,
18270    #[serde(default, skip_serializing_if = "Option::is_none")]
18271    pub suspension_reason: Option<String>,
18272    #[serde(default, skip_serializing_if = "Option::is_none")]
18273    pub suspended_at: Option<String>,
18274    pub created_at: String,
18275    pub updated_at: String,
18276}
18277
18278/// `TenantBilling` model.
18279#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18280pub struct TenantBilling {
18281    #[serde(default, skip_serializing_if = "Option::is_none")]
18282    pub stripe_customer_id: Option<String>,
18283    #[serde(default, skip_serializing_if = "Option::is_none")]
18284    pub stripe_subscription_id: Option<String>,
18285    #[serde(default, skip_serializing_if = "Option::is_none")]
18286    pub cancel_at_period_end: Option<bool>,
18287    #[serde(default, skip_serializing_if = "Option::is_none")]
18288    pub current_period_end_ms: Option<i64>,
18289}
18290
18291/// `TenantBillingStatus` enumeration.
18292#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18293pub enum TenantBillingStatus {
18294    #[default]
18295    #[serde(rename = "active")]
18296    Active,
18297    #[serde(rename = "past_due")]
18298    PastDue,
18299    #[serde(rename = "disputed")]
18300    Disputed,
18301    #[serde(rename = "cancelled")]
18302    Cancelled,
18303    /// A value the API introduced after this SDK was generated.
18304    #[serde(untagged)]
18305    Other(String),
18306}
18307
18308impl TenantBillingStatus {
18309    /// The value as it appears on the wire.
18310    pub fn as_str(&self) -> &str {
18311        match self {
18312            Self::Active => "active",
18313            Self::PastDue => "past_due",
18314            Self::Disputed => "disputed",
18315            Self::Cancelled => "cancelled",
18316            Self::Other(value) => value.as_str(),
18317        }
18318    }
18319}
18320
18321impl std::fmt::Display for TenantBillingStatus {
18322    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18323        f.write_str(self.as_str())
18324    }
18325}
18326
18327impl From<&str> for TenantBillingStatus {
18328    fn from(value: &str) -> Self {
18329        match value {
18330            "active" => Self::Active,
18331            "past_due" => Self::PastDue,
18332            "disputed" => Self::Disputed,
18333            "cancelled" => Self::Cancelled,
18334            other => Self::Other(other.to_string()),
18335        }
18336    }
18337}
18338
18339/// `TenantBranding` model.
18340#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18341pub struct TenantBranding {
18342    #[serde(default, skip_serializing_if = "Option::is_none")]
18343    pub primary_color: Option<String>,
18344    #[serde(default, skip_serializing_if = "Option::is_none")]
18345    pub accent_color: Option<String>,
18346    #[serde(default, skip_serializing_if = "Option::is_none")]
18347    pub background_color: Option<String>,
18348    #[serde(default, skip_serializing_if = "Option::is_none")]
18349    pub foreground_color: Option<String>,
18350    #[serde(default, skip_serializing_if = "Option::is_none")]
18351    pub card_color: Option<String>,
18352    #[serde(default, skip_serializing_if = "Option::is_none")]
18353    pub border_color: Option<String>,
18354    #[serde(default, skip_serializing_if = "Option::is_none")]
18355    pub favicon_url: Option<String>,
18356    #[serde(default, skip_serializing_if = "Option::is_none")]
18357    pub custom_css: Option<String>,
18358    #[serde(default, skip_serializing_if = "Option::is_none")]
18359    pub font_family: Option<String>,
18360    #[serde(default, skip_serializing_if = "Option::is_none")]
18361    pub site_title: Option<String>,
18362    #[serde(default, skip_serializing_if = "Option::is_none")]
18363    pub seo_description: Option<String>,
18364    #[serde(default, skip_serializing_if = "Option::is_none")]
18365    pub og_image_url: Option<String>,
18366    #[serde(default, skip_serializing_if = "Option::is_none")]
18367    pub dark_mode: Option<bool>,
18368}
18369
18370/// `TenantCustomDomain` model.
18371#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18372pub struct TenantCustomDomain {
18373    pub domain: String,
18374    pub created_at: String,
18375    #[serde(default, skip_serializing_if = "Option::is_none")]
18376    pub updated_at: Option<String>,
18377    #[serde(default, skip_serializing_if = "Option::is_none")]
18378    pub status: Option<TenantCustomDomainStatus>,
18379    #[serde(default, skip_serializing_if = "Option::is_none")]
18380    pub verification_method: Option<TenantCustomDomainVerificationMethod>,
18381    #[serde(default, skip_serializing_if = "Option::is_none")]
18382    pub verification_value: Option<String>,
18383    #[serde(default, skip_serializing_if = "Option::is_none")]
18384    pub last_checked_at: Option<String>,
18385    #[serde(default, skip_serializing_if = "Option::is_none")]
18386    pub verified_at: Option<String>,
18387    #[serde(default, skip_serializing_if = "Option::is_none")]
18388    pub dns: Option<serde_json::Map<String, serde_json::Value>>,
18389    #[serde(default, skip_serializing_if = "Option::is_none")]
18390    pub cert: Option<serde_json::Map<String, serde_json::Value>>,
18391}
18392
18393/// `TenantCustomDomainStatus` enumeration.
18394#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18395pub enum TenantCustomDomainStatus {
18396    #[default]
18397    #[serde(rename = "pending")]
18398    Pending,
18399    #[serde(rename = "verified")]
18400    Verified,
18401    #[serde(rename = "failed")]
18402    Failed,
18403    #[serde(rename = "deactivated")]
18404    Deactivated,
18405    /// A value the API introduced after this SDK was generated.
18406    #[serde(untagged)]
18407    Other(String),
18408}
18409
18410impl TenantCustomDomainStatus {
18411    /// The value as it appears on the wire.
18412    pub fn as_str(&self) -> &str {
18413        match self {
18414            Self::Pending => "pending",
18415            Self::Verified => "verified",
18416            Self::Failed => "failed",
18417            Self::Deactivated => "deactivated",
18418            Self::Other(value) => value.as_str(),
18419        }
18420    }
18421}
18422
18423impl std::fmt::Display for TenantCustomDomainStatus {
18424    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18425        f.write_str(self.as_str())
18426    }
18427}
18428
18429impl From<&str> for TenantCustomDomainStatus {
18430    fn from(value: &str) -> Self {
18431        match value {
18432            "pending" => Self::Pending,
18433            "verified" => Self::Verified,
18434            "failed" => Self::Failed,
18435            "deactivated" => Self::Deactivated,
18436            other => Self::Other(other.to_string()),
18437        }
18438    }
18439}
18440
18441/// `TenantCustomDomainVerificationMethod` enumeration.
18442#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18443pub enum TenantCustomDomainVerificationMethod {
18444    #[default]
18445    #[serde(rename = "cname")]
18446    Cname,
18447    /// A value the API introduced after this SDK was generated.
18448    #[serde(untagged)]
18449    Other(String),
18450}
18451
18452impl TenantCustomDomainVerificationMethod {
18453    /// The value as it appears on the wire.
18454    pub fn as_str(&self) -> &str {
18455        match self {
18456            Self::Cname => "cname",
18457            Self::Other(value) => value.as_str(),
18458        }
18459    }
18460}
18461
18462impl std::fmt::Display for TenantCustomDomainVerificationMethod {
18463    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18464        f.write_str(self.as_str())
18465    }
18466}
18467
18468impl From<&str> for TenantCustomDomainVerificationMethod {
18469    fn from(value: &str) -> Self {
18470        match value {
18471            "cname" => Self::Cname,
18472            other => Self::Other(other.to_string()),
18473        }
18474    }
18475}
18476
18477/// The “what needs a human” queue. The overview answers how many; this answers which, and what
18478/// they are asking.
18479#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18480pub struct TenantInbox {
18481    pub generated_at: String,
18482    /// Counted over the whole scan, NOT over `items` — so `limit` truncating the list does not move
18483    /// them. The SCAN is capped too, though, and that cap they cannot see past: when `truncated` is
18484    /// true these are a floor, not a total.
18485    pub counts: TenantInboxCounts,
18486    pub items: Vec<InboxItem>,
18487    /// Run records inspected; the scan is capped.
18488    pub scanned: i64,
18489    /// The scan hit its cap, so `counts` is a floor rather than a total. `scanned` alone cannot
18490    /// tell you this — the number only means something to a caller who already knows what the cap
18491    /// is.
18492    #[serde(default, skip_serializing_if = "Option::is_none")]
18493    pub truncated: Option<bool>,
18494}
18495
18496/// Counted over the whole scan, NOT over `items` — so `limit` truncating the list does not move
18497/// them. The SCAN is capped too, though, and that cap they cannot see past: when `truncated` is
18498/// true these are a floor, not a total.
18499#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18500pub struct TenantInboxCounts {
18501    pub total: i64,
18502    pub approval: i64,
18503    pub input: i64,
18504    pub paused: i64,
18505    pub failed: i64,
18506}
18507
18508/// `TenantMefConfigResponse` model.
18509#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18510pub struct TenantMefConfigResponse {
18511    pub tenant_id: String,
18512    /// What an operator stored. Null when nothing is overridden — never an empty object.
18513    #[serde(default)]
18514    pub mef_config: Option<TenantMefConfigResponseMefConfig>,
18515    /// What the runtime will do. All false when the mission service is absent platform-wide,
18516    /// whatever the overrides say.
18517    pub effective: TenantMefConfigResponseEffective,
18518}
18519
18520/// What the runtime will do. All false when the mission service is absent platform-wide,
18521/// whatever the overrides say.
18522#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18523pub struct TenantMefConfigResponseEffective {
18524    pub enabled: bool,
18525    pub planner_enabled: bool,
18526    pub judge_enabled: bool,
18527    pub auto_classify: bool,
18528}
18529
18530/// What an operator stored. Null when nothing is overridden — never an empty object.
18531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18532pub struct TenantMefConfigResponseMefConfig {
18533    #[serde(default, skip_serializing_if = "Option::is_none")]
18534    pub enabled: Option<bool>,
18535    #[serde(default, skip_serializing_if = "Option::is_none")]
18536    pub planner_enabled: Option<bool>,
18537    #[serde(default, skip_serializing_if = "Option::is_none")]
18538    pub judge_enabled: Option<bool>,
18539    #[serde(default, skip_serializing_if = "Option::is_none")]
18540    pub auto_classify: Option<bool>,
18541}
18542
18543/// The single aggregate behind Mission Control: fleet, run buckets, approvals, quota, worker
18544/// health and schedule risk in one call instead of N.
18545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18546pub struct TenantOverview {
18547    pub generated_at: String,
18548    pub fleet: TenantOverviewFleet,
18549    pub runs: TenantOverviewRuns,
18550    pub approvals: TenantOverviewApprovals,
18551    pub usage: TenantOverviewUsage,
18552    pub cost: TenantOverviewCost,
18553    pub system: TenantOverviewSystem,
18554    pub schedules: TenantOverviewSchedules,
18555}
18556
18557/// `TenantOverviewApprovals` model.
18558#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18559pub struct TenantOverviewApprovals {
18560    pub pending_count: i64,
18561}
18562
18563/// `TenantOverviewCost` model.
18564#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18565pub struct TenantOverviewCost {
18566    pub total_usd: f64,
18567    pub range_days: i64,
18568}
18569
18570/// `TenantOverviewFleet` model.
18571#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18572pub struct TenantOverviewFleet {
18573    pub total: i64,
18574    pub active_agents: i64,
18575    pub suspended: i64,
18576    pub terminated: i64,
18577    pub by_execution_mode: TenantOverviewFleetByExecutionMode,
18578    pub bridge: TenantOverviewFleetBridge,
18579    #[serde(default)]
18580    pub head_agent_id: Option<String>,
18581    pub top_by_runs: Vec<AgentAnalyticsRow>,
18582    pub top_by_cost: Vec<AgentAnalyticsRow>,
18583    /// Agent id → the timestamp of its most recent run in the scanned window.
18584    pub last_run_at: serde_json::Map<String, serde_json::Value>,
18585}
18586
18587/// `TenantOverviewFleetBridge` model.
18588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18589pub struct TenantOverviewFleetBridge {
18590    pub online: i64,
18591    pub stale: i64,
18592    pub offline: i64,
18593    pub machines_total: i64,
18594}
18595
18596/// `TenantOverviewFleetByExecutionMode` model.
18597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18598pub struct TenantOverviewFleetByExecutionMode {
18599    pub cloud: i64,
18600    pub bridge: i64,
18601}
18602
18603/// `TenantOverviewRuns` model.
18604#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18605pub struct TenantOverviewRuns {
18606    pub by_status: serde_json::Map<String, serde_json::Value>,
18607    /// Queued, running, paused, awaiting approval or awaiting input.
18608    pub active_count: i64,
18609    pub failed_24h: i64,
18610    pub cost_24h_usd: f64,
18611    pub recent: Vec<TenantOverviewRunsRecentItem>,
18612    /// How many run records the aggregate actually looked at. The scan is capped, so a busy
18613    /// tenant's numbers describe the scanned window, not all history.
18614    pub scanned: i64,
18615}
18616
18617/// `TenantOverviewRunsRecentItem` model.
18618#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18619pub struct TenantOverviewRunsRecentItem {
18620    pub run_id: String,
18621    pub agent_id: String,
18622    pub status: String,
18623    #[serde(default, skip_serializing_if = "Option::is_none")]
18624    pub created_at: Option<String>,
18625    #[serde(default, skip_serializing_if = "Option::is_none")]
18626    pub cost_usd: Option<f64>,
18627    #[serde(default, skip_serializing_if = "Option::is_none")]
18628    pub duration_ms: Option<i64>,
18629    #[serde(default, skip_serializing_if = "Option::is_none")]
18630    pub error: Option<String>,
18631    /// Passed through from the run record (same values as `Run.execution_mode`); absent when the
18632    /// record has none. `bridge` marks a report from a local agent, which may carry no transcript.
18633    #[serde(default, skip_serializing_if = "Option::is_none")]
18634    pub execution_mode: Option<TenantOverviewRunsRecentItemExecutionMode>,
18635}
18636
18637/// Passed through from the run record (same values as `Run.execution_mode`); absent when the
18638/// record has none. `bridge` marks a report from a local agent, which may carry no transcript.
18639#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18640pub enum TenantOverviewRunsRecentItemExecutionMode {
18641    #[default]
18642    #[serde(rename = "async")]
18643    Async,
18644    #[serde(rename = "bridge")]
18645    Bridge,
18646    /// A value the API introduced after this SDK was generated.
18647    #[serde(untagged)]
18648    Other(String),
18649}
18650
18651impl TenantOverviewRunsRecentItemExecutionMode {
18652    /// The value as it appears on the wire.
18653    pub fn as_str(&self) -> &str {
18654        match self {
18655            Self::Async => "async",
18656            Self::Bridge => "bridge",
18657            Self::Other(value) => value.as_str(),
18658        }
18659    }
18660}
18661
18662impl std::fmt::Display for TenantOverviewRunsRecentItemExecutionMode {
18663    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18664        f.write_str(self.as_str())
18665    }
18666}
18667
18668impl From<&str> for TenantOverviewRunsRecentItemExecutionMode {
18669    fn from(value: &str) -> Self {
18670        match value {
18671            "async" => Self::Async,
18672            "bridge" => Self::Bridge,
18673            other => Self::Other(other.to_string()),
18674        }
18675    }
18676}
18677
18678/// `TenantOverviewSchedules` model.
18679#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18680pub struct TenantOverviewSchedules {
18681    pub total: i64,
18682    /// Paused, errored, or carrying consecutive failures — a silently dead cron.
18683    pub at_risk: i64,
18684    pub paused: i64,
18685}
18686
18687/// `TenantOverviewSystem` model.
18688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18689pub struct TenantOverviewSystem {
18690    /// False when no cron job is registered — the signal that scheduled work has stopped.
18691    pub healthy: bool,
18692    pub kv: bool,
18693    pub workers_active: i64,
18694    pub workers_queued: i64,
18695    pub cron_registered: i64,
18696}
18697
18698/// `TenantOverviewUsage` model.
18699#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18700pub struct TenantOverviewUsage {
18701    pub tokens_used: i64,
18702    pub runs_used: i64,
18703    pub cost_mtd_usd: f64,
18704}
18705
18706/// `TenantPublicSettings` model.
18707#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18708pub struct TenantPublicSettings {
18709    #[serde(default, skip_serializing_if = "Option::is_none")]
18710    pub max_messages_per_session: Option<i64>,
18711    #[serde(default, skip_serializing_if = "Option::is_none")]
18712    pub max_tokens_per_session: Option<i64>,
18713    #[serde(default, skip_serializing_if = "Option::is_none")]
18714    pub allow_tool_calls: Option<bool>,
18715    #[serde(default, skip_serializing_if = "Option::is_none")]
18716    pub allow_file_uploads: Option<bool>,
18717    #[serde(default, skip_serializing_if = "Option::is_none")]
18718    pub rate_limit_per_ip_per_hour: Option<i64>,
18719    #[serde(default, skip_serializing_if = "Option::is_none")]
18720    pub require_auth: Option<bool>,
18721}
18722
18723/// Per-tenant overrides applied on top of the plan's quotas. Partial by nature: only the keys
18724/// actually overridden are present.
18725#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18726pub struct TenantQuotaOverrides {
18727    #[serde(default, skip_serializing_if = "Option::is_none")]
18728    pub max_agents: Option<i64>,
18729    #[serde(default, skip_serializing_if = "Option::is_none")]
18730    pub max_teams: Option<i64>,
18731    #[serde(default, skip_serializing_if = "Option::is_none")]
18732    pub max_workers_per_team: Option<i64>,
18733    #[serde(default, skip_serializing_if = "Option::is_none")]
18734    pub max_concurrent_runs: Option<i64>,
18735    #[serde(default, skip_serializing_if = "Option::is_none")]
18736    pub max_concurrent_team_runs: Option<i64>,
18737    #[serde(default, skip_serializing_if = "Option::is_none")]
18738    pub max_active_sessions: Option<i64>,
18739    #[serde(default, skip_serializing_if = "Option::is_none")]
18740    pub max_monthly_tokens: Option<i64>,
18741    #[serde(default, skip_serializing_if = "Option::is_none")]
18742    pub max_monthly_tool_calls: Option<i64>,
18743    #[serde(default, skip_serializing_if = "Option::is_none")]
18744    pub max_monthly_runs: Option<i64>,
18745    #[serde(default, skip_serializing_if = "Option::is_none")]
18746    pub max_mcp_servers: Option<i64>,
18747    #[serde(default, skip_serializing_if = "Option::is_none")]
18748    pub max_storage_bytes: Option<i64>,
18749    #[serde(default, skip_serializing_if = "Option::is_none")]
18750    pub max_memory_entries_per_agent: Option<i64>,
18751    #[serde(default, skip_serializing_if = "Option::is_none")]
18752    pub max_memory_storage_bytes: Option<i64>,
18753    #[serde(default, skip_serializing_if = "Option::is_none")]
18754    pub max_agent_versions: Option<i64>,
18755    #[serde(default, skip_serializing_if = "Option::is_none")]
18756    pub max_knowledge_bases: Option<i64>,
18757    #[serde(default, skip_serializing_if = "Option::is_none")]
18758    pub max_workspaces: Option<i64>,
18759    #[serde(default, skip_serializing_if = "Option::is_none")]
18760    pub max_daily_tool_calls: Option<i64>,
18761    #[serde(default, skip_serializing_if = "Option::is_none")]
18762    pub max_monthly_images: Option<i64>,
18763    #[serde(default, skip_serializing_if = "Option::is_none")]
18764    pub max_daily_images: Option<i64>,
18765    #[serde(default, skip_serializing_if = "Option::is_none")]
18766    pub max_monthly_videos: Option<i64>,
18767}
18768
18769/// `TenantQuotas` model.
18770#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18771pub struct TenantQuotas {
18772    pub max_agents: i64,
18773    pub max_teams: i64,
18774    pub max_workers_per_team: i64,
18775    pub max_concurrent_runs: i64,
18776    pub max_concurrent_team_runs: i64,
18777    pub max_active_sessions: i64,
18778    pub max_monthly_tokens: i64,
18779    pub max_monthly_tool_calls: i64,
18780    pub max_monthly_runs: i64,
18781    pub max_mcp_servers: i64,
18782    pub max_storage_bytes: i64,
18783    pub max_memory_entries_per_agent: i64,
18784    pub max_memory_storage_bytes: i64,
18785    pub max_agent_versions: i64,
18786    pub max_knowledge_bases: i64,
18787    pub max_workspaces: i64,
18788    #[serde(default, skip_serializing_if = "Option::is_none")]
18789    pub max_daily_tool_calls: Option<i64>,
18790    #[serde(default, skip_serializing_if = "Option::is_none")]
18791    pub max_monthly_images: Option<i64>,
18792    #[serde(default, skip_serializing_if = "Option::is_none")]
18793    pub max_daily_images: Option<i64>,
18794    #[serde(default, skip_serializing_if = "Option::is_none")]
18795    pub max_monthly_videos: Option<i64>,
18796}
18797
18798/// `TenantStatus` enumeration.
18799#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18800pub enum TenantStatus {
18801    #[default]
18802    #[serde(rename = "active")]
18803    Active,
18804    #[serde(rename = "suspended")]
18805    Suspended,
18806    #[serde(rename = "trial")]
18807    Trial,
18808    #[serde(rename = "deleted")]
18809    Deleted,
18810    #[serde(rename = "waitlisted")]
18811    Waitlisted,
18812    /// A value the API introduced after this SDK was generated.
18813    #[serde(untagged)]
18814    Other(String),
18815}
18816
18817impl TenantStatus {
18818    /// The value as it appears on the wire.
18819    pub fn as_str(&self) -> &str {
18820        match self {
18821            Self::Active => "active",
18822            Self::Suspended => "suspended",
18823            Self::Trial => "trial",
18824            Self::Deleted => "deleted",
18825            Self::Waitlisted => "waitlisted",
18826            Self::Other(value) => value.as_str(),
18827        }
18828    }
18829}
18830
18831impl std::fmt::Display for TenantStatus {
18832    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18833        f.write_str(self.as_str())
18834    }
18835}
18836
18837impl From<&str> for TenantStatus {
18838    fn from(value: &str) -> Self {
18839        match value {
18840            "active" => Self::Active,
18841            "suspended" => Self::Suspended,
18842            "trial" => Self::Trial,
18843            "deleted" => Self::Deleted,
18844            "waitlisted" => Self::Waitlisted,
18845            other => Self::Other(other.to_string()),
18846        }
18847    }
18848}
18849
18850/// `TenantTrial` model.
18851#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18852pub struct TenantTrial {
18853    pub active: bool,
18854    #[serde(default)]
18855    pub ends_at: Option<String>,
18856    pub days_left: i64,
18857    #[serde(default)]
18858    pub recommended_plan: Option<String>,
18859}
18860
18861/// `TenantUser` model.
18862#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18863pub struct TenantUser {
18864    #[serde(default, skip_serializing_if = "Option::is_none")]
18865    pub created_at: Option<String>,
18866    #[serde(default, skip_serializing_if = "Option::is_none")]
18867    pub email: Option<String>,
18868    #[serde(default, skip_serializing_if = "Option::is_none")]
18869    pub id: Option<String>,
18870    #[serde(default, skip_serializing_if = "Option::is_none")]
18871    pub name: Option<String>,
18872    #[serde(default, skip_serializing_if = "Option::is_none")]
18873    pub role: Option<String>,
18874    #[serde(default, skip_serializing_if = "Option::is_none")]
18875    pub status: Option<String>,
18876    #[serde(default, skip_serializing_if = "Option::is_none")]
18877    pub tenant_id: Option<String>,
18878    #[serde(default, skip_serializing_if = "Option::is_none")]
18879    pub updated_at: Option<String>,
18880}
18881
18882/// `TerminateAgentResponse` model.
18883#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18884pub struct TerminateAgentResponse {
18885    #[serde(default, skip_serializing_if = "Option::is_none")]
18886    pub deleted: Option<bool>,
18887    #[serde(default, skip_serializing_if = "Option::is_none")]
18888    pub agent_id: Option<String>,
18889}
18890
18891/// `TestAdminSmtpConfigRequest` model.
18892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18893pub struct TestAdminSmtpConfigRequest {
18894    pub to: String,
18895}
18896
18897/// `TestAdminSmtpConfigResponse` model.
18898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18899pub struct TestAdminSmtpConfigResponse {
18900    pub ok: bool,
18901    pub sent_to: String,
18902}
18903
18904/// `TestAgentIntegrationResponse` model.
18905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18906pub struct TestAgentIntegrationResponse {
18907    /// False when the connector could not reach the remote or the credentials were refused. This is
18908    /// the only field that says so; the status will be 200 either way.
18909    pub success: bool,
18910    /// Why it failed. Absent on success.
18911    #[serde(default, skip_serializing_if = "Option::is_none")]
18912    pub message: Option<String>,
18913}
18914
18915/// `TestIntegrationResponse` model.
18916#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18917pub struct TestIntegrationResponse {
18918    #[serde(default, skip_serializing_if = "Option::is_none")]
18919    pub success: Option<bool>,
18920    #[serde(default, skip_serializing_if = "Option::is_none")]
18921    pub message: Option<String>,
18922}
18923
18924/// `TestLLMProviderKeyResponse` model.
18925#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18926pub struct TestLLMProviderKeyResponse {
18927    /// False when the connector could not reach the remote or the credentials were refused. This is
18928    /// the only field that says so; the status will be 200 either way.
18929    pub success: bool,
18930    /// Why it failed. Absent on success.
18931    #[serde(default, skip_serializing_if = "Option::is_none")]
18932    pub message: Option<String>,
18933}
18934
18935/// `TestNotificationTargetResponse` model.
18936#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18937pub struct TestNotificationTargetResponse {
18938    pub ok: bool,
18939    pub message: String,
18940}
18941
18942/// `TestWebhookResponse` model.
18943#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18944pub struct TestWebhookResponse {
18945    pub test_sent: bool,
18946    pub webhook_id: String,
18947    /// The subscription's first configured event, or `run.completed` when it has none.
18948    pub event_type: String,
18949}
18950
18951/// `Todo` model.
18952#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18953pub struct Todo {
18954    pub todo_id: String,
18955    pub session_id: String,
18956    pub tenant_id: String,
18957    pub title: String,
18958    #[serde(default, skip_serializing_if = "Option::is_none")]
18959    pub instructions: Option<String>,
18960    #[serde(default, skip_serializing_if = "Option::is_none")]
18961    pub due_at: Option<String>,
18962    #[serde(default, skip_serializing_if = "Option::is_none")]
18963    pub assign_agent_id: Option<String>,
18964    #[serde(default, skip_serializing_if = "Option::is_none")]
18965    pub assign_team_id: Option<String>,
18966    pub status: TodoStatus,
18967    pub created_at: String,
18968    pub updated_at: String,
18969    #[serde(default, skip_serializing_if = "Option::is_none")]
18970    pub run_id: Option<String>,
18971    #[serde(default, skip_serializing_if = "Option::is_none")]
18972    pub team_run_id: Option<String>,
18973    #[serde(default, skip_serializing_if = "Option::is_none")]
18974    pub recurrence: Option<TodoRecurrence>,
18975    #[serde(default, skip_serializing_if = "Option::is_none")]
18976    pub next_fire_at: Option<String>,
18977    #[serde(default, skip_serializing_if = "Option::is_none")]
18978    pub last_fired_at: Option<String>,
18979    #[serde(default, skip_serializing_if = "Option::is_none")]
18980    pub last_run_status: Option<String>,
18981    #[serde(default, skip_serializing_if = "Option::is_none")]
18982    pub require_confirmation: Option<bool>,
18983    #[serde(default, skip_serializing_if = "Option::is_none")]
18984    pub delivery: Option<TodoDelivery>,
18985    #[serde(default, skip_serializing_if = "Option::is_none")]
18986    pub order_index: Option<i64>,
18987    #[serde(default, skip_serializing_if = "Option::is_none")]
18988    pub parent_task_id: Option<String>,
18989    /// Present only on the session-scoped list; absent from GET /todos.
18990    #[serde(default, skip_serializing_if = "Option::is_none")]
18991    pub agent_name: Option<String>,
18992}
18993
18994/// `TodoDelivery` model.
18995#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18996pub struct TodoDelivery {
18997    pub channels: Vec<TodoDeliveryChannel>,
18998    #[serde(default, skip_serializing_if = "Option::is_none")]
18999    pub target: Option<String>,
19000}
19001
19002/// `TodoDeliveryChannel` enumeration.
19003#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19004pub enum TodoDeliveryChannel {
19005    #[default]
19006    #[serde(rename = "email")]
19007    Email,
19008    #[serde(rename = "telegram")]
19009    Telegram,
19010    #[serde(rename = "whatsapp")]
19011    Whatsapp,
19012    /// A value the API introduced after this SDK was generated.
19013    #[serde(untagged)]
19014    Other(String),
19015}
19016
19017impl TodoDeliveryChannel {
19018    /// The value as it appears on the wire.
19019    pub fn as_str(&self) -> &str {
19020        match self {
19021            Self::Email => "email",
19022            Self::Telegram => "telegram",
19023            Self::Whatsapp => "whatsapp",
19024            Self::Other(value) => value.as_str(),
19025        }
19026    }
19027}
19028
19029impl std::fmt::Display for TodoDeliveryChannel {
19030    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19031        f.write_str(self.as_str())
19032    }
19033}
19034
19035impl From<&str> for TodoDeliveryChannel {
19036    fn from(value: &str) -> Self {
19037        match value {
19038            "email" => Self::Email,
19039            "telegram" => Self::Telegram,
19040            "whatsapp" => Self::Whatsapp,
19041            other => Self::Other(other.to_string()),
19042        }
19043    }
19044}
19045
19046/// `TodoRecurrence` model.
19047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19048pub struct TodoRecurrence {
19049    pub cron: String,
19050    #[serde(default, skip_serializing_if = "Option::is_none")]
19051    pub timezone: Option<String>,
19052}
19053
19054/// `TodoStatus` enumeration.
19055#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19056pub enum TodoStatus {
19057    #[default]
19058    #[serde(rename = "pending")]
19059    Pending,
19060    #[serde(rename = "pending_confirmation")]
19061    PendingConfirmation,
19062    #[serde(rename = "in_progress")]
19063    InProgress,
19064    #[serde(rename = "done")]
19065    Done,
19066    #[serde(rename = "cancelled")]
19067    Cancelled,
19068    /// A value the API introduced after this SDK was generated.
19069    #[serde(untagged)]
19070    Other(String),
19071}
19072
19073impl TodoStatus {
19074    /// The value as it appears on the wire.
19075    pub fn as_str(&self) -> &str {
19076        match self {
19077            Self::Pending => "pending",
19078            Self::PendingConfirmation => "pending_confirmation",
19079            Self::InProgress => "in_progress",
19080            Self::Done => "done",
19081            Self::Cancelled => "cancelled",
19082            Self::Other(value) => value.as_str(),
19083        }
19084    }
19085}
19086
19087impl std::fmt::Display for TodoStatus {
19088    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19089        f.write_str(self.as_str())
19090    }
19091}
19092
19093impl From<&str> for TodoStatus {
19094    fn from(value: &str) -> Self {
19095        match value {
19096            "pending" => Self::Pending,
19097            "pending_confirmation" => Self::PendingConfirmation,
19098            "in_progress" => Self::InProgress,
19099            "done" => Self::Done,
19100            "cancelled" => Self::Cancelled,
19101            other => Self::Other(other.to_string()),
19102        }
19103    }
19104}
19105
19106/// `ToolOverride` model.
19107#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19108pub struct ToolOverride {
19109    #[serde(default, skip_serializing_if = "Option::is_none")]
19110    pub category: Option<String>,
19111    #[serde(default, skip_serializing_if = "Option::is_none")]
19112    pub description: Option<String>,
19113    /// Hides the catalogue row. Presentation only — the runtime still serves the tool. Stored only
19114    /// when true.
19115    #[serde(default, skip_serializing_if = "Option::is_none")]
19116    pub hidden: Option<bool>,
19117}
19118
19119/// `TransferTenantOwnershipResponse` model.
19120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19121pub struct TransferTenantOwnershipResponse {
19122    pub transferred: bool,
19123    pub new_owner: String,
19124    pub previous_owner: String,
19125}
19126
19127/// Exactly one of the three. The handler trims each and acts on the first non-empty one.
19128#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19129pub struct UnassignWorkspaceRequest {
19130    #[serde(default, skip_serializing_if = "Option::is_none")]
19131    pub agent_id: Option<String>,
19132    #[serde(default, skip_serializing_if = "Option::is_none")]
19133    pub team_id: Option<String>,
19134    #[serde(default, skip_serializing_if = "Option::is_none")]
19135    pub company_id: Option<String>,
19136}
19137
19138/// `UnlinkAuthProviderResponse` model.
19139#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19140pub struct UnlinkAuthProviderResponse {
19141    pub ok: bool,
19142    pub provider: String,
19143    #[serde(default, skip_serializing_if = "Option::is_none")]
19144    pub remaining_factors: Option<i64>,
19145    #[serde(default, skip_serializing_if = "Option::is_none")]
19146    pub already_unlinked: Option<bool>,
19147}
19148
19149/// `UnpublishListingResponse` model.
19150#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19151pub struct UnpublishListingResponse {
19152    pub error: RevokeSessionShareResponseError,
19153    pub message: String,
19154    pub retry_after_seconds: i64,
19155}
19156
19157/// `UnscheduleCanvasWorkflowResponse` model.
19158#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19159pub struct UnscheduleCanvasWorkflowResponse {
19160    pub trigger_id: String,
19161    pub status: UnscheduleCanvasWorkflowResponseStatus,
19162}
19163
19164/// `UnscheduleCanvasWorkflowResponseStatus` enumeration.
19165#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19166pub enum UnscheduleCanvasWorkflowResponseStatus {
19167    #[default]
19168    #[serde(rename = "removed")]
19169    Removed,
19170    /// A value the API introduced after this SDK was generated.
19171    #[serde(untagged)]
19172    Other(String),
19173}
19174
19175impl UnscheduleCanvasWorkflowResponseStatus {
19176    /// The value as it appears on the wire.
19177    pub fn as_str(&self) -> &str {
19178        match self {
19179            Self::Removed => "removed",
19180            Self::Other(value) => value.as_str(),
19181        }
19182    }
19183}
19184
19185impl std::fmt::Display for UnscheduleCanvasWorkflowResponseStatus {
19186    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19187        f.write_str(self.as_str())
19188    }
19189}
19190
19191impl From<&str> for UnscheduleCanvasWorkflowResponseStatus {
19192    fn from(value: &str) -> Self {
19193        match value {
19194            "removed" => Self::Removed,
19195            other => Self::Other(other.to_string()),
19196        }
19197    }
19198}
19199
19200/// `UnsubscribeFromListingResponse` model.
19201#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19202pub struct UnsubscribeFromListingResponse {
19203    #[serde(default, skip_serializing_if = "Option::is_none")]
19204    pub unsubscribed: Option<bool>,
19205    #[serde(default, skip_serializing_if = "Option::is_none")]
19206    pub listing_id: Option<String>,
19207}
19208
19209/// `UnsuspendUserResponse` model.
19210#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19211pub struct UnsuspendUserResponse {
19212    pub unsuspended: bool,
19213    pub user_id: String,
19214}
19215
19216/// `UpdateAdminBlogConfigRequest` model.
19217#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19218pub struct UpdateAdminBlogConfigRequest {
19219    #[serde(default, skip_serializing_if = "Option::is_none")]
19220    pub enabled: Option<bool>,
19221    #[serde(default, skip_serializing_if = "Option::is_none")]
19222    pub title: Option<String>,
19223    #[serde(default, skip_serializing_if = "Option::is_none")]
19224    pub description: Option<String>,
19225    /// Null detaches the author and clears the pinned tenant.
19226    #[serde(default, skip_serializing_if = "Option::is_none")]
19227    pub agent_id: Option<String>,
19228    /// `manual` never auto-generates.
19229    #[serde(default, skip_serializing_if = "Option::is_none")]
19230    pub frequency: Option<BlogConfigFrequency>,
19231    #[serde(default, skip_serializing_if = "Option::is_none")]
19232    pub schedule_hour: Option<i64>,
19233    /// 0 = Sunday, UTC.
19234    #[serde(default, skip_serializing_if = "Option::is_none")]
19235    pub schedule_weekday: Option<i64>,
19236    #[serde(default, skip_serializing_if = "Option::is_none")]
19237    pub topic_prompt: Option<String>,
19238    #[serde(default, skip_serializing_if = "Option::is_none")]
19239    pub conditions: Option<String>,
19240    #[serde(default, skip_serializing_if = "Option::is_none")]
19241    pub auto_publish: Option<bool>,
19242}
19243
19244/// `UpdateAdminBlogConfigResponse` model.
19245#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19246pub struct UpdateAdminBlogConfigResponse {
19247    pub config: BlogConfig,
19248}
19249
19250/// `UpdateAdminBlogPostRequest` model.
19251#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19252pub struct UpdateAdminBlogPostRequest {
19253    #[serde(default, skip_serializing_if = "Option::is_none")]
19254    pub title: Option<String>,
19255    #[serde(default, skip_serializing_if = "Option::is_none")]
19256    pub body: Option<String>,
19257    #[serde(default, skip_serializing_if = "Option::is_none")]
19258    pub tags: Option<Vec<String>>,
19259    #[serde(default, skip_serializing_if = "Option::is_none")]
19260    pub status: Option<BlogPostStatus>,
19261}
19262
19263/// `UpdateAdminBlogPostResponse` model.
19264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19265pub struct UpdateAdminBlogPostResponse {
19266    pub post: BlogPost,
19267}
19268
19269/// `UpdateAdminDisabledToolsResponse` model.
19270#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19271pub struct UpdateAdminDisabledToolsResponse {
19272    pub ok: bool,
19273    pub disabled_tools: Vec<String>,
19274}
19275
19276/// `UpdateAdminFounderConfigRequest` model.
19277#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19278pub struct UpdateAdminFounderConfigRequest {
19279    #[serde(default, skip_serializing_if = "Option::is_none")]
19280    pub founder_id: Option<String>,
19281    #[serde(default, skip_serializing_if = "Option::is_none")]
19282    pub founder_name: Option<String>,
19283    #[serde(default, skip_serializing_if = "Option::is_none")]
19284    pub founder_public_key: Option<String>,
19285}
19286
19287/// `UpdateAdminOAuthIdentityConfigRequest` model.
19288#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19289pub struct UpdateAdminOAuthIdentityConfigRequest {
19290    #[serde(default, skip_serializing_if = "Option::is_none")]
19291    pub apple_services_id: Option<String>,
19292    #[serde(default, skip_serializing_if = "Option::is_none")]
19293    pub apple_team_id: Option<String>,
19294    #[serde(default, skip_serializing_if = "Option::is_none")]
19295    pub apple_bundle_id: Option<String>,
19296    #[serde(default, skip_serializing_if = "Option::is_none")]
19297    pub oauth_return_to_hosts: Option<Vec<String>>,
19298}
19299
19300/// `UpdateAdminPlansRequest` model.
19301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19302pub struct UpdateAdminPlansRequest {
19303    #[serde(default, skip_serializing_if = "Option::is_none")]
19304    pub plans: Option<serde_json::Map<String, serde_json::Value>>,
19305}
19306
19307/// `UpdateAdminPlansResponse` model.
19308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19309pub struct UpdateAdminPlansResponse {
19310    #[serde(default, skip_serializing_if = "Option::is_none")]
19311    pub plans: Option<serde_json::Map<String, serde_json::Value>>,
19312    #[serde(default, skip_serializing_if = "Option::is_none")]
19313    pub updated: Option<bool>,
19314}
19315
19316/// `UpdateAdminRegistrationConfigRequest` model.
19317#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19318pub struct UpdateAdminRegistrationConfigRequest {
19319    #[serde(default, skip_serializing_if = "Option::is_none")]
19320    pub registration_open: Option<bool>,
19321    /// Required alongside `registration_open: true` when registration is currently closed. Ignored
19322    /// otherwise.
19323    #[serde(default, skip_serializing_if = "Option::is_none")]
19324    pub confirm_open: Option<bool>,
19325    #[serde(default, skip_serializing_if = "Option::is_none")]
19326    pub default_signup_plan: Option<String>,
19327    #[serde(default, skip_serializing_if = "Option::is_none")]
19328    pub allowed_email_domains: Option<Vec<String>>,
19329}
19330
19331/// `UpdateAdminSetupStateRequest` model.
19332#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19333pub struct UpdateAdminSetupStateRequest {
19334    /// Unioned with what is stored. Unknown ids are rejected.
19335    #[serde(default, skip_serializing_if = "Option::is_none")]
19336    pub completed_steps: Option<Vec<UpdateAdminSetupStateRequestCompletedStep>>,
19337    #[serde(default, skip_serializing_if = "Option::is_none")]
19338    pub registration_open: Option<bool>,
19339    /// Required alongside `registration_open: true` when registration is currently closed.
19340    #[serde(default, skip_serializing_if = "Option::is_none")]
19341    pub confirm_open: Option<bool>,
19342}
19343
19344/// `UpdateAdminSetupStateRequestCompletedStep` enumeration.
19345#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19346pub enum UpdateAdminSetupStateRequestCompletedStep {
19347    #[default]
19348    #[serde(rename = "super_admin_login")]
19349    SuperAdminLogin,
19350    #[serde(rename = "platform_identity")]
19351    PlatformIdentity,
19352    #[serde(rename = "public_url")]
19353    PublicURL,
19354    #[serde(rename = "llm_provider")]
19355    LLMProvider,
19356    #[serde(rename = "registration_open")]
19357    RegistrationOpen,
19358    #[serde(rename = "smtp")]
19359    Smtp,
19360    #[serde(rename = "oauth_login")]
19361    OauthLogin,
19362    #[serde(rename = "stripe")]
19363    Stripe,
19364    #[serde(rename = "spec_seed")]
19365    SpecSeed,
19366    #[serde(rename = "custom_domain")]
19367    CustomDomain,
19368    #[serde(rename = "integrations")]
19369    Integrations,
19370    /// A value the API introduced after this SDK was generated.
19371    #[serde(untagged)]
19372    Other(String),
19373}
19374
19375impl UpdateAdminSetupStateRequestCompletedStep {
19376    /// The value as it appears on the wire.
19377    pub fn as_str(&self) -> &str {
19378        match self {
19379            Self::SuperAdminLogin => "super_admin_login",
19380            Self::PlatformIdentity => "platform_identity",
19381            Self::PublicURL => "public_url",
19382            Self::LLMProvider => "llm_provider",
19383            Self::RegistrationOpen => "registration_open",
19384            Self::Smtp => "smtp",
19385            Self::OauthLogin => "oauth_login",
19386            Self::Stripe => "stripe",
19387            Self::SpecSeed => "spec_seed",
19388            Self::CustomDomain => "custom_domain",
19389            Self::Integrations => "integrations",
19390            Self::Other(value) => value.as_str(),
19391        }
19392    }
19393}
19394
19395impl std::fmt::Display for UpdateAdminSetupStateRequestCompletedStep {
19396    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19397        f.write_str(self.as_str())
19398    }
19399}
19400
19401impl From<&str> for UpdateAdminSetupStateRequestCompletedStep {
19402    fn from(value: &str) -> Self {
19403        match value {
19404            "super_admin_login" => Self::SuperAdminLogin,
19405            "platform_identity" => Self::PlatformIdentity,
19406            "public_url" => Self::PublicURL,
19407            "llm_provider" => Self::LLMProvider,
19408            "registration_open" => Self::RegistrationOpen,
19409            "smtp" => Self::Smtp,
19410            "oauth_login" => Self::OauthLogin,
19411            "stripe" => Self::Stripe,
19412            "spec_seed" => Self::SpecSeed,
19413            "custom_domain" => Self::CustomDomain,
19414            "integrations" => Self::Integrations,
19415            other => Self::Other(other.to_string()),
19416        }
19417    }
19418}
19419
19420/// `UpdateAdminSmtpConfigRequest` model.
19421#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19422pub struct UpdateAdminSmtpConfigRequest {
19423    #[serde(default, skip_serializing_if = "Option::is_none")]
19424    pub host: Option<String>,
19425    #[serde(default, skip_serializing_if = "Option::is_none")]
19426    pub port: Option<i64>,
19427    #[serde(default, skip_serializing_if = "Option::is_none")]
19428    pub user: Option<String>,
19429    /// Empty string clears the stored credential.
19430    #[serde(default, skip_serializing_if = "Option::is_none")]
19431    pub password: Option<String>,
19432    #[serde(default, skip_serializing_if = "Option::is_none")]
19433    pub from: Option<String>,
19434    #[serde(default, skip_serializing_if = "Option::is_none")]
19435    pub from_name: Option<String>,
19436}
19437
19438/// `UpdateAdminSpecPackagesRequest` model.
19439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19440pub struct UpdateAdminSpecPackagesRequest {
19441    /// Keyed by `package_id`.
19442    pub packages: HashMap<String, SpecPackage>,
19443}
19444
19445/// `UpdateAdminStripeConfigRequest` model.
19446#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19447pub struct UpdateAdminStripeConfigRequest {
19448    #[serde(default, skip_serializing_if = "Option::is_none")]
19449    pub enabled: Option<bool>,
19450    #[serde(default, skip_serializing_if = "Option::is_none")]
19451    pub mode: Option<UpdateAdminStripeConfigRequestMode>,
19452    #[serde(default, skip_serializing_if = "Option::is_none")]
19453    pub secret_key: Option<String>,
19454    #[serde(default, skip_serializing_if = "Option::is_none")]
19455    pub webhook_secret: Option<String>,
19456    #[serde(default, skip_serializing_if = "Option::is_none")]
19457    pub publishable_key: Option<String>,
19458    #[serde(default, skip_serializing_if = "Option::is_none")]
19459    pub price_id_starter: Option<String>,
19460    #[serde(default, skip_serializing_if = "Option::is_none")]
19461    pub price_id_pro: Option<String>,
19462    #[serde(default, skip_serializing_if = "Option::is_none")]
19463    pub price_id_enterprise: Option<String>,
19464}
19465
19466/// `UpdateAdminStripeConfigRequestMode` enumeration.
19467#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19468pub enum UpdateAdminStripeConfigRequestMode {
19469    #[default]
19470    #[serde(rename = "test")]
19471    Test,
19472    #[serde(rename = "live")]
19473    Live,
19474    /// A value the API introduced after this SDK was generated.
19475    #[serde(untagged)]
19476    Other(String),
19477}
19478
19479impl UpdateAdminStripeConfigRequestMode {
19480    /// The value as it appears on the wire.
19481    pub fn as_str(&self) -> &str {
19482        match self {
19483            Self::Test => "test",
19484            Self::Live => "live",
19485            Self::Other(value) => value.as_str(),
19486        }
19487    }
19488}
19489
19490impl std::fmt::Display for UpdateAdminStripeConfigRequestMode {
19491    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19492        f.write_str(self.as_str())
19493    }
19494}
19495
19496impl From<&str> for UpdateAdminStripeConfigRequestMode {
19497    fn from(value: &str) -> Self {
19498        match value {
19499            "test" => Self::Test,
19500            "live" => Self::Live,
19501            other => Self::Other(other.to_string()),
19502        }
19503    }
19504}
19505
19506/// `UpdateAdminToolOverridesRequest` model.
19507#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19508pub struct UpdateAdminToolOverridesRequest {
19509    pub overrides: HashMap<String, ToolOverride>,
19510}
19511
19512/// `UpdateAdminToolOverridesResponse` model.
19513#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19514pub struct UpdateAdminToolOverridesResponse {
19515    pub ok: bool,
19516    pub overrides: HashMap<String, ToolOverride>,
19517}
19518
19519/// `UpdateAgentIntegrationRequest` model.
19520#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19521pub struct UpdateAgentIntegrationRequest {
19522    #[serde(default, skip_serializing_if = "Option::is_none")]
19523    pub name: Option<String>,
19524    #[serde(default, skip_serializing_if = "Option::is_none")]
19525    pub config: Option<serde_json::Map<String, serde_json::Value>>,
19526}
19527
19528/// `UpdateBridgeAgentCapabilityRequest` model.
19529#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19530pub struct UpdateBridgeAgentCapabilityRequest {
19531    pub capabilities: Vec<String>,
19532    /// Where the bridge process is running. Stored on the connection record and shown to the
19533    /// operator; read at bridge.ts:3479.
19534    #[serde(default, skip_serializing_if = "Option::is_none")]
19535    pub working_directory: Option<String>,
19536    /// The reporting machine's hostname; read at bridge.ts:3480.
19537    #[serde(default, skip_serializing_if = "Option::is_none")]
19538    pub hostname: Option<String>,
19539    /// Outcome of the local spec sync, feeding the web drawer's "Installed locally" badges. Bounded
19540    /// server-side: at most 100 entries, 200 tool names each, errors truncated to 500 characters.
19541    /// Entries without a string `spec_id` are dropped, and `reported_at` is ignored on input — the
19542    /// server stamps its own.
19543    #[serde(default, skip_serializing_if = "Option::is_none")]
19544    pub installed_specs: Option<Vec<BridgeInstalledSpec>>,
19545}
19546
19547/// `UpdateBridgeAgentCapabilityResponse` model.
19548#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19549pub struct UpdateBridgeAgentCapabilityResponse {
19550    pub status: UpdateBridgeAgentCapabilityResponseStatus,
19551}
19552
19553/// `UpdateBridgeAgentCapabilityResponseStatus` enumeration.
19554#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19555pub enum UpdateBridgeAgentCapabilityResponseStatus {
19556    #[default]
19557    #[serde(rename = "ok")]
19558    Ok,
19559    /// A value the API introduced after this SDK was generated.
19560    #[serde(untagged)]
19561    Other(String),
19562}
19563
19564impl UpdateBridgeAgentCapabilityResponseStatus {
19565    /// The value as it appears on the wire.
19566    pub fn as_str(&self) -> &str {
19567        match self {
19568            Self::Ok => "ok",
19569            Self::Other(value) => value.as_str(),
19570        }
19571    }
19572}
19573
19574impl std::fmt::Display for UpdateBridgeAgentCapabilityResponseStatus {
19575    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19576        f.write_str(self.as_str())
19577    }
19578}
19579
19580impl From<&str> for UpdateBridgeAgentCapabilityResponseStatus {
19581    fn from(value: &str) -> Self {
19582        match value {
19583            "ok" => Self::Ok,
19584            other => Self::Other(other.to_string()),
19585        }
19586    }
19587}
19588
19589/// `UpdateBuilderRequestStatusRequest` model.
19590#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19591pub struct UpdateBuilderRequestStatusRequest {
19592    pub status: DesignRequestStatus,
19593}
19594
19595/// `UpdateCoreMemoryBlockRequest` model.
19596#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19597pub struct UpdateCoreMemoryBlockRequest {
19598    pub content: String,
19599    #[serde(default, skip_serializing_if = "Option::is_none")]
19600    pub max_tokens: Option<i64>,
19601}
19602
19603/// `UpdateFeedbackReportStatusRequest` model.
19604#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19605pub struct UpdateFeedbackReportStatusRequest {
19606    /// Anything other than the exact string `resolved` — including an absent body — results in
19607    /// `new`.
19608    #[serde(default, skip_serializing_if = "Option::is_none")]
19609    pub status: Option<UpdateFeedbackReportStatusRequestStatus>,
19610}
19611
19612/// Anything other than the exact string `resolved` — including an absent body — results in
19613/// `new`.
19614#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19615pub enum UpdateFeedbackReportStatusRequestStatus {
19616    #[default]
19617    #[serde(rename = "resolved")]
19618    Resolved,
19619    #[serde(rename = "new")]
19620    New,
19621    /// A value the API introduced after this SDK was generated.
19622    #[serde(untagged)]
19623    Other(String),
19624}
19625
19626impl UpdateFeedbackReportStatusRequestStatus {
19627    /// The value as it appears on the wire.
19628    pub fn as_str(&self) -> &str {
19629        match self {
19630            Self::Resolved => "resolved",
19631            Self::New => "new",
19632            Self::Other(value) => value.as_str(),
19633        }
19634    }
19635}
19636
19637impl std::fmt::Display for UpdateFeedbackReportStatusRequestStatus {
19638    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19639        f.write_str(self.as_str())
19640    }
19641}
19642
19643impl From<&str> for UpdateFeedbackReportStatusRequestStatus {
19644    fn from(value: &str) -> Self {
19645        match value {
19646            "resolved" => Self::Resolved,
19647            "new" => Self::New,
19648            other => Self::Other(other.to_string()),
19649        }
19650    }
19651}
19652
19653/// `UpdateFeedbackReportStatusResponse` model.
19654#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19655pub struct UpdateFeedbackReportStatusResponse {
19656    pub ok: bool,
19657    /// Read this back — it is how a caller learns its value was not understood.
19658    pub status: UpdateFeedbackReportStatusRequestStatus,
19659}
19660
19661/// `UpdateGoalStatusRequest` model.
19662#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19663pub struct UpdateGoalStatusRequest {
19664    pub status: String,
19665}
19666
19667/// `UpdateImprovementStatusRequest` model.
19668#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19669pub struct UpdateImprovementStatusRequest {
19670    pub status: ImprovementProposalStatus,
19671}
19672
19673/// `UpdateIntegrationRequest` model.
19674#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19675pub struct UpdateIntegrationRequest {
19676    #[serde(default, skip_serializing_if = "Option::is_none")]
19677    pub name: Option<String>,
19678    #[serde(default, skip_serializing_if = "Option::is_none")]
19679    pub config: Option<serde_json::Map<String, serde_json::Value>>,
19680}
19681
19682/// At least one editable field.
19683#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19684pub struct UpdateMissionObjectiveRequest {
19685    #[serde(default, skip_serializing_if = "Option::is_none")]
19686    pub title: Option<String>,
19687    #[serde(default, skip_serializing_if = "Option::is_none")]
19688    pub description: Option<String>,
19689    #[serde(default, skip_serializing_if = "Option::is_none")]
19690    pub success_criteria: Option<Vec<String>>,
19691    #[serde(default, skip_serializing_if = "Option::is_none")]
19692    pub priority: Option<ObjectivePriority>,
19693    /// Empty string clears the assignment.
19694    #[serde(default, skip_serializing_if = "Option::is_none")]
19695    pub assigned_agent_id: Option<String>,
19696    /// Empty string clears the assignment.
19697    #[serde(default, skip_serializing_if = "Option::is_none")]
19698    pub assigned_team_id: Option<String>,
19699    /// Ceilings only; the spent counters are not writable.
19700    #[serde(default, skip_serializing_if = "Option::is_none")]
19701    pub budget: Option<UpdateMissionObjectiveRequestBudget>,
19702    #[serde(default, skip_serializing_if = "Option::is_none")]
19703    pub deadline: Option<String>,
19704    #[serde(default, skip_serializing_if = "Option::is_none")]
19705    pub commanders_intent: Option<String>,
19706    #[serde(default, skip_serializing_if = "Option::is_none")]
19707    pub roe: Option<ObjectiveRoE>,
19708    #[serde(default, skip_serializing_if = "Option::is_none")]
19709    pub decision_points: Option<Vec<ObjectiveDecisionPoint>>,
19710}
19711
19712/// Ceilings only; the spent counters are not writable.
19713#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19714pub struct UpdateMissionObjectiveRequestBudget {
19715    #[serde(default, skip_serializing_if = "Option::is_none")]
19716    pub max_runs: Option<i64>,
19717    #[serde(default, skip_serializing_if = "Option::is_none")]
19718    pub max_tokens: Option<i64>,
19719    #[serde(default, skip_serializing_if = "Option::is_none")]
19720    pub max_cost_usd: Option<f64>,
19721}
19722
19723/// `UpdateMyPreferencesRequest` model.
19724#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19725pub struct UpdateMyPreferencesRequest {
19726    #[serde(default, skip_serializing_if = "Option::is_none")]
19727    pub custom_instructions: Option<String>,
19728    #[serde(default, skip_serializing_if = "Option::is_none")]
19729    pub enabled: Option<bool>,
19730}
19731
19732/// `UpdatePlatformURLSRequest` model.
19733#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19734pub struct UpdatePlatformURLSRequest {
19735    #[serde(default, skip_serializing_if = "Option::is_none")]
19736    pub public_base_url: Option<String>,
19737    #[serde(default, skip_serializing_if = "Option::is_none")]
19738    pub webhook_base_url: Option<String>,
19739}
19740
19741/// `UpdateProjectRequest` model.
19742#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19743pub struct UpdateProjectRequest {
19744    #[serde(default, skip_serializing_if = "Option::is_none")]
19745    pub name: Option<String>,
19746    #[serde(default, skip_serializing_if = "Option::is_none")]
19747    pub description: Option<String>,
19748    #[serde(default, skip_serializing_if = "Option::is_none")]
19749    pub instructions: Option<String>,
19750    #[serde(default, skip_serializing_if = "Option::is_none")]
19751    pub knowledge_base_ids: Option<Vec<String>>,
19752    #[serde(default, skip_serializing_if = "Option::is_none")]
19753    pub file_ids: Option<Vec<String>>,
19754    #[serde(default, skip_serializing_if = "Option::is_none")]
19755    pub visibility: Option<ProjectVisibility>,
19756    #[serde(default, skip_serializing_if = "Option::is_none")]
19757    pub shared_with: Option<Vec<ProjectGrant>>,
19758    /// Timestamp to archive, null to restore.
19759    #[serde(default, skip_serializing_if = "Option::is_none")]
19760    pub archived_at: Option<String>,
19761}
19762
19763/// `UpdateSecurityPoliciesRequest` model.
19764#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19765pub struct UpdateSecurityPoliciesRequest {
19766    #[serde(default, skip_serializing_if = "Option::is_none")]
19767    pub cors_allowed_origins: Option<Vec<String>>,
19768    #[serde(default, skip_serializing_if = "Option::is_none")]
19769    pub webhook_url_denylist: Option<Vec<String>>,
19770    #[serde(default, skip_serializing_if = "Option::is_none")]
19771    pub file_upload_max_size_bytes: Option<i64>,
19772    #[serde(default, skip_serializing_if = "Option::is_none")]
19773    pub file_upload_allowed_mime_types: Option<Vec<String>>,
19774    #[serde(default, skip_serializing_if = "Option::is_none")]
19775    pub admin_provider_settings_require_super_admin: Option<bool>,
19776}
19777
19778/// `UpdateSessionAnnotationRequest` model.
19779#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19780pub struct UpdateSessionAnnotationRequest {
19781    #[serde(default, skip_serializing_if = "Option::is_none")]
19782    pub resolved: Option<bool>,
19783}
19784
19785/// `UpdateSessionRequest` model.
19786#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19787pub struct UpdateSessionRequest {
19788    #[serde(default, skip_serializing_if = "Option::is_none")]
19789    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
19790    /// Per-conversation model override. Send null to clear (revert to agent default), or {
19791    /// provider, model_ref, endpoint_url?, capabilities? } to set. The runtime governance allowlist
19792    /// is still enforced at run time.
19793    #[serde(default, skip_serializing_if = "Option::is_none")]
19794    pub model_override: Option<UpdateSessionRequestModelOverride>,
19795}
19796
19797/// Per-conversation model override. Send null to clear (revert to agent default), or {
19798/// provider, model_ref, endpoint_url?, capabilities? } to set. The runtime governance allowlist
19799/// is still enforced at run time.
19800#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19801pub struct UpdateSessionRequestModelOverride {
19802    pub provider: String,
19803    pub model_ref: String,
19804    #[serde(default, skip_serializing_if = "Option::is_none")]
19805    pub endpoint_url: Option<String>,
19806    #[serde(default, skip_serializing_if = "Option::is_none")]
19807    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
19808}
19809
19810/// `UpdateSquadGraphNodeRequest` model.
19811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19812pub struct UpdateSquadGraphNodeRequest {
19813    #[serde(default, skip_serializing_if = "Option::is_none")]
19814    pub status: Option<TeamGraphNodeStatus>,
19815    #[serde(default, skip_serializing_if = "Option::is_none")]
19816    pub goal_summary: Option<String>,
19817}
19818
19819/// `UpdateTeamGraphNodeRequest` model.
19820#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19821pub struct UpdateTeamGraphNodeRequest {
19822    #[serde(default, skip_serializing_if = "Option::is_none")]
19823    pub status: Option<TeamGraphNodeStatus>,
19824    #[serde(default, skip_serializing_if = "Option::is_none")]
19825    pub goal_summary: Option<String>,
19826}
19827
19828/// Null clears an override. Any other non-boolean is 422.
19829#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19830pub struct UpdateTenantMefConfigRequest {
19831    #[serde(default, skip_serializing_if = "Option::is_none")]
19832    pub enabled: Option<bool>,
19833    #[serde(default, skip_serializing_if = "Option::is_none")]
19834    pub planner_enabled: Option<bool>,
19835    #[serde(default, skip_serializing_if = "Option::is_none")]
19836    pub judge_enabled: Option<bool>,
19837    #[serde(default, skip_serializing_if = "Option::is_none")]
19838    pub auto_classify: Option<bool>,
19839}
19840
19841/// `UpdateTenantPlanRequest` model.
19842#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19843pub struct UpdateTenantPlanRequest {
19844    /// A built-in plan (`free`, `starter`, `pro`, `enterprise`) or the id of an ACTIVE custom plan
19845    /// from `/admin/config/custom-plans`. Matched case-insensitively and trimmed. Anything else is
19846    /// 400 rather than a silently stored value.
19847    pub plan: String,
19848    #[serde(default, skip_serializing_if = "Option::is_none")]
19849    pub quotas: Option<TenantQuotas>,
19850    /// Partial quota grant that outlives subscription changes — only the dimensions being raised
19851    /// need be present.
19852    #[serde(default, skip_serializing_if = "Option::is_none")]
19853    pub quota_overrides: Option<serde_json::Map<String, serde_json::Value>>,
19854    #[serde(default, skip_serializing_if = "Option::is_none")]
19855    pub name: Option<String>,
19856    /// Lowercase letters, numbers and hyphens. Changing it re-points the public tenant index.
19857    #[serde(default, skip_serializing_if = "Option::is_none")]
19858    pub slug: Option<String>,
19859}
19860
19861/// `UpdateTenantPlanResponse` model.
19862#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19863pub struct UpdateTenantPlanResponse {
19864    pub tenant_id: String,
19865    /// The RESOLVED plan id, which may differ in case from what was sent.
19866    pub plan: String,
19867    pub quotas: TenantQuotas,
19868}
19869
19870/// `UpdateTenantRequest` model.
19871#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19872pub struct UpdateTenantRequest {
19873    #[serde(default, skip_serializing_if = "Option::is_none")]
19874    pub name: Option<String>,
19875    #[serde(default, skip_serializing_if = "Option::is_none")]
19876    pub settings: Option<serde_json::Map<String, serde_json::Value>>,
19877    #[serde(default, skip_serializing_if = "Option::is_none")]
19878    pub description: Option<String>,
19879    #[serde(default, skip_serializing_if = "Option::is_none")]
19880    pub head_agent_id: Option<String>,
19881    #[serde(default, skip_serializing_if = "Option::is_none")]
19882    pub shared_workspace_id: Option<String>,
19883}
19884
19885/// `UpdateWebhooksPolicyRequest` model.
19886#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19887pub struct UpdateWebhooksPolicyRequest {
19888    #[serde(default, skip_serializing_if = "Option::is_none")]
19889    pub ssrf_check_at_subscription: Option<bool>,
19890    #[serde(default, skip_serializing_if = "Option::is_none")]
19891    pub stripe_signature_tolerance_sec: Option<i64>,
19892    #[serde(default, skip_serializing_if = "Option::is_none")]
19893    pub delivery_max_retries: Option<i64>,
19894    #[serde(default, skip_serializing_if = "Option::is_none")]
19895    pub delivery_backoff_base_ms: Option<i64>,
19896    #[serde(default, skip_serializing_if = "Option::is_none")]
19897    pub delivery_max_window_hours: Option<i64>,
19898}
19899
19900/// `UpdateWorkspaceRequest` model.
19901#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19902pub struct UpdateWorkspaceRequest {
19903    pub name: String,
19904}
19905
19906/// `UploadFileRequest` model.
19907#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19908pub struct UploadFileRequest {
19909    /// Base64-encoded file content
19910    pub data: FilePart,
19911    pub mime_type: String,
19912    #[serde(default, skip_serializing_if = "Option::is_none")]
19913    pub filename: Option<String>,
19914}
19915
19916/// `UploadFileResponse` model.
19917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19918pub struct UploadFileResponse {
19919    pub file_id: String,
19920    pub tenant_id: String,
19921    pub filename: String,
19922    pub mime_type: String,
19923    pub size_bytes: i64,
19924    pub sha256: String,
19925    pub created_at: String,
19926    pub url: String,
19927}
19928
19929/// `UploadPublicSessionImageResponse` model.
19930#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19931pub struct UploadPublicSessionImageResponse {
19932    pub file_id: String,
19933    pub mime_type: String,
19934    /// Bytes stored.
19935    pub size: i64,
19936}
19937
19938/// `UploadWorkspaceFileRequest` model.
19939#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19940pub struct UploadWorkspaceFileRequest {
19941    pub file: FilePart,
19942}
19943
19944/// `UpsertAgentToolOverrideResponse` model.
19945#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19946pub struct UpsertAgentToolOverrideResponse {
19947    pub tool_overrides: Vec<AgentToolOverride>,
19948}
19949
19950/// `UpsertCustomPlanResponse` model.
19951#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19952pub struct UpsertCustomPlanResponse {
19953    pub plan: CustomPlan,
19954}
19955
19956/// `UpsertNotificationTargetRequest` model.
19957#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19958pub struct UpsertNotificationTargetRequest {
19959    /// Rewrites this target when it exists.
19960    #[serde(default, skip_serializing_if = "Option::is_none")]
19961    pub id: Option<String>,
19962    /// Defaults to something channel-specific when omitted.
19963    #[serde(default, skip_serializing_if = "Option::is_none")]
19964    pub label: Option<String>,
19965    /// Defaults to true; only an explicit `false` disables.
19966    #[serde(default, skip_serializing_if = "Option::is_none")]
19967    pub enabled: Option<bool>,
19968    pub config: serde_json::Value,
19969}
19970
19971/// `UpsertNotificationTargetRequestConfigVariant1` model.
19972#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19973pub struct UpsertNotificationTargetRequestConfigVariant1 {
19974    pub kind: NotificationTargetConfigVariant1kind,
19975    pub address: String,
19976}
19977
19978/// `UpsertNotificationTargetRequestConfigVariant2` model.
19979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19980pub struct UpsertNotificationTargetRequestConfigVariant2 {
19981    pub kind: AgentScorerConfigType,
19982    /// Must be https.
19983    pub url: String,
19984    #[serde(default, skip_serializing_if = "Option::is_none")]
19985    pub signing_secret: Option<String>,
19986    #[serde(default, skip_serializing_if = "Option::is_none")]
19987    pub format: Option<NotificationTargetConfigVariant2format>,
19988}
19989
19990/// `UpsertNotificationTargetRequestConfigVariant3` model.
19991#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19992pub struct UpsertNotificationTargetRequestConfigVariant3 {
19993    pub kind: NotificationTargetConfigVariant3kind,
19994    pub platform: NotificationTargetConfigVariant3platform,
19995    pub device_token: String,
19996    #[serde(default, skip_serializing_if = "Option::is_none")]
19997    pub device_label: Option<String>,
19998}
19999
20000/// `UpsertNotificationTargetRequestConfigVariant4` model.
20001#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20002pub struct UpsertNotificationTargetRequestConfigVariant4 {
20003    pub kind: NotificationTargetConfigVariant4kind,
20004    pub endpoint: String,
20005    pub keys: UpsertNotificationTargetRequestConfigVariant4keys,
20006    #[serde(default, skip_serializing_if = "Option::is_none")]
20007    pub device_label: Option<String>,
20008    #[serde(default, skip_serializing_if = "Option::is_none")]
20009    pub expiration_time: Option<i64>,
20010}
20011
20012/// `UpsertNotificationTargetRequestConfigVariant4keys` model.
20013#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20014pub struct UpsertNotificationTargetRequestConfigVariant4keys {
20015    pub p256dh: String,
20016    pub auth: String,
20017}
20018
20019/// `UpsertPromoCodeResponse` model.
20020#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20021pub struct UpsertPromoCodeResponse {
20022    pub promo_code: PromoCode,
20023}
20024
20025/// `UsageMarginSummary` model.
20026#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20027pub struct UsageMarginSummary {
20028    pub platform_markup_percent: f64,
20029    pub provider_cost_usd: f64,
20030    pub user_cost_usd: f64,
20031    pub margin_usd: f64,
20032    pub effective_margin_percent: f64,
20033}
20034
20035/// Tenant usage for one billing period. Flat — the counters are top-level, not nested under a
20036/// `usage` object.
20037#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20038pub struct UsageSummary {
20039    pub plan: String,
20040    /// `YYYY-MM`.
20041    pub period: String,
20042    pub period_days: i64,
20043    pub input_tokens: i64,
20044    pub output_tokens: i64,
20045    pub thinking_tokens: i64,
20046    pub total_tokens: i64,
20047    pub runs_count: i64,
20048    pub tool_calls_count: i64,
20049    #[serde(default, skip_serializing_if = "Option::is_none")]
20050    pub bridge_tasks: Option<i64>,
20051    pub storage_bytes: i64,
20052    /// What the tenant is billed, in USD.
20053    pub total_cost: f64,
20054    /// What the upstream providers charged, in USD.
20055    pub provider_cost: f64,
20056    pub non_run_cost: f64,
20057    #[serde(default, skip_serializing_if = "Option::is_none")]
20058    pub margin_summary: Option<UsageMarginSummary>,
20059}
20060
20061/// Personal instructions that apply to every conversation this person has, whichever agent
20062/// answers.
20063#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20064pub struct UserPreferences {
20065    pub custom_instructions: String,
20066    /// Off keeps the text but stops it reaching any run — the switch people actually want when an
20067    /// instruction misfires.
20068    pub enabled: bool,
20069    #[serde(default, skip_serializing_if = "Option::is_none")]
20070    pub updated_at: Option<String>,
20071    /// Server-enforced ceiling for `custom_instructions`. Sent on every response so a client does
20072    /// not hard-code it.
20073    pub max_chars: i64,
20074}
20075
20076/// One rubric line for LLM-as-judge validation.
20077#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20078pub struct ValidationCriterion {
20079    pub name: String,
20080    pub description: String,
20081    /// 0.0-1.0; weights should sum to ~1.0.
20082    pub weight: f64,
20083}
20084
20085/// Optional gate scoring worker outputs before synthesis.
20086#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20087pub struct ValidationPolicy {
20088    pub enabled: bool,
20089    pub criteria: Vec<ValidationCriterion>,
20090    /// Pass threshold 0.0-1.0 (default 0.7).
20091    pub min_score: f64,
20092    pub max_revision_rounds: i64,
20093    /// Dedicated validator; omitted means the supervisor judges its own workers.
20094    #[serde(default, skip_serializing_if = "Option::is_none")]
20095    pub validator_agent_id: Option<String>,
20096    /// Re-run the workers with the validator's feedback when a round fails, up to
20097    /// `max_revision_rounds`. Defaults to true — the server treats only an explicit `false` as off.
20098    pub auto_revise: bool,
20099    /// Re-run only the workers whose output failed, rather than the whole round. Defaults to false.
20100    pub selective: bool,
20101}
20102
20103/// `Value` model.
20104#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20105pub struct Value {
20106    pub spec_id: String,
20107    /// The parsed view document, or null when the stored view was unparseable.
20108    pub output_view: serde_json::Value,
20109}
20110
20111/// `Value2` model.
20112#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20113pub struct Value2 {
20114    pub x: f64,
20115    pub y: f64,
20116}
20117
20118/// `Value3` model.
20119#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20120pub struct Value3 {
20121    pub x: f64,
20122    pub y: f64,
20123}
20124
20125/// `Value4` model.
20126#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20127pub struct Value4 {
20128    #[serde(default, skip_serializing_if = "Option::is_none")]
20129    pub from: Option<serde_json::Value>,
20130    #[serde(default, skip_serializing_if = "Option::is_none")]
20131    pub to: Option<serde_json::Value>,
20132}
20133
20134/// `VerifyMfaRecoveryRequest` model.
20135#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20136pub struct VerifyMfaRecoveryRequest {
20137    pub code: String,
20138}
20139
20140/// `VerifyMfaRecoveryResponse` model.
20141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20142pub struct VerifyMfaRecoveryResponse {
20143    pub verified: bool,
20144    pub recovery_remaining: i64,
20145}
20146
20147/// `VerifyMfaRequest` model.
20148#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20149pub struct VerifyMfaRequest {
20150    /// 6-digit TOTP code.
20151    pub code: String,
20152}
20153
20154/// `VerifyMfaResponse` model.
20155#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20156pub struct VerifyMfaResponse {
20157    pub verified: bool,
20158    #[serde(default, skip_serializing_if = "Option::is_none")]
20159    pub recovery_remaining: Option<i64>,
20160}
20161
20162/// `VerifyTenantDomainResponse` model.
20163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20164pub struct VerifyTenantDomainResponse {
20165    #[serde(default, skip_serializing_if = "Option::is_none")]
20166    pub verified: Option<bool>,
20167}
20168
20169/// `VetoProposalRequest` model.
20170#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20171pub struct VetoProposalRequest {
20172    #[serde(default, skip_serializing_if = "Option::is_none")]
20173    pub founder_id: Option<String>,
20174}
20175
20176/// `VetoProposalResponse` model.
20177#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20178pub struct VetoProposalResponse {
20179    #[serde(default, skip_serializing_if = "Option::is_none")]
20180    pub ok: Option<bool>,
20181}
20182
20183/// A veto as issued and listed (VetoRecord in @uarp/governance). Shape from the store's record;
20184/// no tenant in reach had a veto to measure on 2026-09-10.
20185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20186pub struct VetoRecord {
20187    pub veto_id: String,
20188    pub issued_by: String,
20189    pub target_type: VetoRecordTargetType,
20190    pub target_id: String,
20191    pub reason: String,
20192    pub issued_at: String,
20193}
20194
20195/// `VetoRecordTargetType` enumeration.
20196#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20197pub enum VetoRecordTargetType {
20198    #[default]
20199    #[serde(rename = "proposal")]
20200    Proposal,
20201    #[serde(rename = "action")]
20202    Action,
20203    #[serde(rename = "agent")]
20204    Agent,
20205    #[serde(rename = "case")]
20206    Case,
20207    /// A value the API introduced after this SDK was generated.
20208    #[serde(untagged)]
20209    Other(String),
20210}
20211
20212impl VetoRecordTargetType {
20213    /// The value as it appears on the wire.
20214    pub fn as_str(&self) -> &str {
20215        match self {
20216            Self::Proposal => "proposal",
20217            Self::Action => "action",
20218            Self::Agent => "agent",
20219            Self::Case => "case",
20220            Self::Other(value) => value.as_str(),
20221        }
20222    }
20223}
20224
20225impl std::fmt::Display for VetoRecordTargetType {
20226    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20227        f.write_str(self.as_str())
20228    }
20229}
20230
20231impl From<&str> for VetoRecordTargetType {
20232    fn from(value: &str) -> Self {
20233        match value {
20234            "proposal" => Self::Proposal,
20235            "action" => Self::Action,
20236            "agent" => Self::Agent,
20237            "case" => Self::Case,
20238            other => Self::Other(other.to_string()),
20239        }
20240    }
20241}
20242
20243/// `VideoProvider` model.
20244#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20245pub struct VideoProvider {
20246    #[serde(default, skip_serializing_if = "Option::is_none")]
20247    pub configured: Option<bool>,
20248    #[serde(default, skip_serializing_if = "Option::is_none")]
20249    pub id: Option<String>,
20250    #[serde(default, skip_serializing_if = "Option::is_none")]
20251    pub local: Option<bool>,
20252    #[serde(default, skip_serializing_if = "Option::is_none")]
20253    pub models: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
20254    #[serde(default, skip_serializing_if = "Option::is_none")]
20255    pub name: Option<String>,
20256}
20257
20258/// `VoiceConfig` model.
20259#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20260pub struct VoiceConfig {
20261    #[serde(default, skip_serializing_if = "Option::is_none")]
20262    pub stt: Option<VoiceConfigStt>,
20263    #[serde(default, skip_serializing_if = "Option::is_none")]
20264    pub tts: Option<VoiceConfigTts>,
20265}
20266
20267/// `VoiceConfigStt` model.
20268#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20269pub struct VoiceConfigStt {
20270    #[serde(default, skip_serializing_if = "Option::is_none")]
20271    pub configured: Option<bool>,
20272    #[serde(default, skip_serializing_if = "Option::is_none")]
20273    pub endpoint: Option<String>,
20274    #[serde(default, skip_serializing_if = "Option::is_none")]
20275    pub model: Option<String>,
20276    #[serde(default, skip_serializing_if = "Option::is_none")]
20277    pub provider: Option<String>,
20278}
20279
20280/// `VoiceConfigTts` model.
20281#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20282pub struct VoiceConfigTts {
20283    #[serde(default, skip_serializing_if = "Option::is_none")]
20284    pub configured: Option<bool>,
20285    #[serde(default, skip_serializing_if = "Option::is_none")]
20286    pub endpoint: Option<String>,
20287    #[serde(default, skip_serializing_if = "Option::is_none")]
20288    pub model: Option<String>,
20289    #[serde(default, skip_serializing_if = "Option::is_none")]
20290    pub provider: Option<String>,
20291    #[serde(default, skip_serializing_if = "Option::is_none")]
20292    pub voice: Option<String>,
20293}
20294
20295/// `VoiceProviderList` model.
20296#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20297pub struct VoiceProviderList {
20298    #[serde(default, skip_serializing_if = "Option::is_none")]
20299    pub providers: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
20300}
20301
20302/// `VoteResult` model.
20303#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20304pub struct VoteResult {
20305    pub proposal_id: String,
20306    pub status: VoteResultStatus,
20307    pub total_votes: i64,
20308    pub approve_weight: f64,
20309    pub reject_weight: f64,
20310    pub abstain_weight: f64,
20311    pub quorum_met: bool,
20312    pub tallied_at: String,
20313}
20314
20315/// `VoteResultStatus` enumeration.
20316#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20317pub enum VoteResultStatus {
20318    #[default]
20319    #[serde(rename = "passed")]
20320    Passed,
20321    #[serde(rename = "rejected")]
20322    Rejected,
20323    #[serde(rename = "expired")]
20324    Expired,
20325    #[serde(rename = "vetoed")]
20326    Vetoed,
20327    /// A value the API introduced after this SDK was generated.
20328    #[serde(untagged)]
20329    Other(String),
20330}
20331
20332impl VoteResultStatus {
20333    /// The value as it appears on the wire.
20334    pub fn as_str(&self) -> &str {
20335        match self {
20336            Self::Passed => "passed",
20337            Self::Rejected => "rejected",
20338            Self::Expired => "expired",
20339            Self::Vetoed => "vetoed",
20340            Self::Other(value) => value.as_str(),
20341        }
20342    }
20343}
20344
20345impl std::fmt::Display for VoteResultStatus {
20346    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20347        f.write_str(self.as_str())
20348    }
20349}
20350
20351impl From<&str> for VoteResultStatus {
20352    fn from(value: &str) -> Self {
20353        match value {
20354            "passed" => Self::Passed,
20355            "rejected" => Self::Rejected,
20356            "expired" => Self::Expired,
20357            "vetoed" => Self::Vetoed,
20358            other => Self::Other(other.to_string()),
20359        }
20360    }
20361}
20362
20363/// `VotingProposal` model.
20364#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20365pub struct VotingProposal {
20366    pub proposal_id: String,
20367    pub tenant_id: String,
20368    pub r#type: String,
20369    pub title: String,
20370    pub description: String,
20371    pub proposed_by: String,
20372    pub payload: serde_json::Map<String, serde_json::Value>,
20373    pub quorum: f64,
20374    pub status: VotingProposalStatus,
20375    pub deadline: String,
20376    pub created_at: String,
20377    pub updated_at: String,
20378}
20379
20380/// `VotingProposalStatus` enumeration.
20381#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20382pub enum VotingProposalStatus {
20383    #[default]
20384    #[serde(rename = "open")]
20385    Open,
20386    #[serde(rename = "passed")]
20387    Passed,
20388    #[serde(rename = "rejected")]
20389    Rejected,
20390    #[serde(rename = "expired")]
20391    Expired,
20392    #[serde(rename = "vetoed")]
20393    Vetoed,
20394    /// A value the API introduced after this SDK was generated.
20395    #[serde(untagged)]
20396    Other(String),
20397}
20398
20399impl VotingProposalStatus {
20400    /// The value as it appears on the wire.
20401    pub fn as_str(&self) -> &str {
20402        match self {
20403            Self::Open => "open",
20404            Self::Passed => "passed",
20405            Self::Rejected => "rejected",
20406            Self::Expired => "expired",
20407            Self::Vetoed => "vetoed",
20408            Self::Other(value) => value.as_str(),
20409        }
20410    }
20411}
20412
20413impl std::fmt::Display for VotingProposalStatus {
20414    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20415        f.write_str(self.as_str())
20416    }
20417}
20418
20419impl From<&str> for VotingProposalStatus {
20420    fn from(value: &str) -> Self {
20421        match value {
20422            "open" => Self::Open,
20423            "passed" => Self::Passed,
20424            "rejected" => Self::Rejected,
20425            "expired" => Self::Expired,
20426            "vetoed" => Self::Vetoed,
20427            other => Self::Other(other.to_string()),
20428        }
20429    }
20430}
20431
20432/// `WebhookSubscription` model.
20433#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20434pub struct WebhookSubscription {
20435    pub webhook_id: String,
20436    #[serde(default, skip_serializing_if = "Option::is_none")]
20437    pub tenant_id: Option<String>,
20438    pub url: String,
20439    pub events: Vec<String>,
20440    pub status: WebhookSubscriptionStatus,
20441    #[serde(default, skip_serializing_if = "Option::is_none")]
20442    pub created_at: Option<String>,
20443}
20444
20445/// `WebhookSubscriptionStatus` enumeration.
20446#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20447pub enum WebhookSubscriptionStatus {
20448    #[default]
20449    #[serde(rename = "active")]
20450    Active,
20451    #[serde(rename = "disabled")]
20452    Disabled,
20453    #[serde(rename = "failing")]
20454    Failing,
20455    /// A value the API introduced after this SDK was generated.
20456    #[serde(untagged)]
20457    Other(String),
20458}
20459
20460impl WebhookSubscriptionStatus {
20461    /// The value as it appears on the wire.
20462    pub fn as_str(&self) -> &str {
20463        match self {
20464            Self::Active => "active",
20465            Self::Disabled => "disabled",
20466            Self::Failing => "failing",
20467            Self::Other(value) => value.as_str(),
20468        }
20469    }
20470}
20471
20472impl std::fmt::Display for WebhookSubscriptionStatus {
20473    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20474        f.write_str(self.as_str())
20475    }
20476}
20477
20478impl From<&str> for WebhookSubscriptionStatus {
20479    fn from(value: &str) -> Self {
20480        match value {
20481            "active" => Self::Active,
20482            "disabled" => Self::Disabled,
20483            "failing" => Self::Failing,
20484            other => Self::Other(other.to_string()),
20485        }
20486    }
20487}
20488
20489/// `Workspace` model.
20490#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20491pub struct Workspace {
20492    #[serde(default, skip_serializing_if = "Option::is_none")]
20493    pub file_count: Option<i64>,
20494    #[serde(default, skip_serializing_if = "Option::is_none")]
20495    pub total_size_bytes: Option<i64>,
20496    pub workspace_id: String,
20497    pub tenant_id: String,
20498    #[serde(default, skip_serializing_if = "Option::is_none")]
20499    pub owner_type: Option<WorkspaceOwnerType>,
20500    #[serde(default, skip_serializing_if = "Option::is_none")]
20501    pub owner_id: Option<String>,
20502    pub name: String,
20503    #[serde(default, skip_serializing_if = "Option::is_none")]
20504    pub shared_with: Option<Vec<String>>,
20505    pub assigned_agents: Vec<String>,
20506    #[serde(default, skip_serializing_if = "Option::is_none")]
20507    pub assigned_teams: Option<Vec<String>>,
20508    #[serde(default, skip_serializing_if = "Option::is_none")]
20509    pub assigned_companies: Option<Vec<String>>,
20510    pub created_at: String,
20511    #[serde(default, skip_serializing_if = "Option::is_none")]
20512    pub updated_at: Option<String>,
20513}
20514
20515/// `WorkspaceFile` model.
20516#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20517pub struct WorkspaceFile {
20518    pub file_id: String,
20519    #[serde(default, skip_serializing_if = "Option::is_none")]
20520    pub tenant_id: Option<String>,
20521    pub workspace_id: String,
20522    pub path: String,
20523    #[serde(default, skip_serializing_if = "Option::is_none")]
20524    pub parent_path: Option<String>,
20525    pub filename: String,
20526    #[serde(default, skip_serializing_if = "Option::is_none")]
20527    pub mime_type: Option<String>,
20528    pub size_bytes: i64,
20529    #[serde(default, skip_serializing_if = "Option::is_none")]
20530    pub created_at: Option<String>,
20531    #[serde(default, skip_serializing_if = "Option::is_none")]
20532    pub updated_at: Option<String>,
20533}
20534
20535/// One kept version of a workspace file. Keys as served 2026-09-10.
20536#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20537pub struct WorkspaceFileVersion {
20538    pub file_id: String,
20539    pub tenant_id: String,
20540    pub workspace_id: String,
20541    pub path: String,
20542    pub parent_path: String,
20543    pub filename: String,
20544    pub mime_type: String,
20545    pub size_bytes: i64,
20546    pub created_at: String,
20547}
20548
20549/// `WorkspaceOwnerType` enumeration.
20550#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20551pub enum WorkspaceOwnerType {
20552    #[default]
20553    #[serde(rename = "agent")]
20554    Agent,
20555    #[serde(rename = "team")]
20556    Team,
20557    #[serde(rename = "standalone")]
20558    Standalone,
20559    /// A value the API introduced after this SDK was generated.
20560    #[serde(untagged)]
20561    Other(String),
20562}
20563
20564impl WorkspaceOwnerType {
20565    /// The value as it appears on the wire.
20566    pub fn as_str(&self) -> &str {
20567        match self {
20568            Self::Agent => "agent",
20569            Self::Team => "team",
20570            Self::Standalone => "standalone",
20571            Self::Other(value) => value.as_str(),
20572        }
20573    }
20574}
20575
20576impl std::fmt::Display for WorkspaceOwnerType {
20577    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20578        f.write_str(self.as_str())
20579    }
20580}
20581
20582impl From<&str> for WorkspaceOwnerType {
20583    fn from(value: &str) -> Self {
20584        match value {
20585            "agent" => Self::Agent,
20586            "team" => Self::Team,
20587            "standalone" => Self::Standalone,
20588            other => Self::Other(other.to_string()),
20589        }
20590    }
20591}