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/// a2a/agent-card.ts A2AAgentCard, built by buildAgentCard. `provider` is declared on the type
14/// and never emitted.
15#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16pub struct A2AAgentCard {
17    pub name: String,
18    pub description: String,
19    /// `{origin}/api/v1/a2a`.
20    pub url: String,
21    pub agent_id: String,
22    pub version: String,
23    pub schema_version: A2AAgentCardSchemaVersion,
24    pub protocol_version: A2AAgentCardProtocolVersion,
25    pub capabilities: A2AAgentCardCapabilities,
26    pub skills: Vec<A2AAgentCardSkill>,
27    pub authentication: A2AAgentCardAuthentication,
28    pub default_input_modes: Vec<String>,
29    pub default_output_modes: Vec<String>,
30    pub mcp_resources: Vec<String>,
31}
32
33/// `A2AAgentCardAuthentication` model.
34#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
35pub struct A2AAgentCardAuthentication {
36    pub r#type: A2AAgentCardAuthenticationType,
37    #[serde(default, skip_serializing_if = "Option::is_none")]
38    pub header: Option<A2AAgentCardAuthenticationHeader>,
39}
40
41/// `A2AAgentCardAuthenticationHeader` enumeration.
42#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
43pub enum A2AAgentCardAuthenticationHeader {
44    #[default]
45    #[serde(rename = "Authorization")]
46    Authorization,
47    /// A value the API introduced after this SDK was generated.
48    #[serde(untagged)]
49    Other(String),
50}
51
52impl A2AAgentCardAuthenticationHeader {
53    /// The value as it appears on the wire.
54    pub fn as_str(&self) -> &str {
55        match self {
56            Self::Authorization => "Authorization",
57            Self::Other(value) => value.as_str(),
58        }
59    }
60}
61
62impl std::fmt::Display for A2AAgentCardAuthenticationHeader {
63    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
64        f.write_str(self.as_str())
65    }
66}
67
68impl From<&str> for A2AAgentCardAuthenticationHeader {
69    fn from(value: &str) -> Self {
70        match value {
71            "Authorization" => Self::Authorization,
72            other => Self::Other(other.to_string()),
73        }
74    }
75}
76
77/// `A2AAgentCardAuthenticationType` enumeration.
78#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
79pub enum A2AAgentCardAuthenticationType {
80    #[default]
81    #[serde(rename = "none")]
82    None,
83    #[serde(rename = "apiKey")]
84    APIKey,
85    /// A value the API introduced after this SDK was generated.
86    #[serde(untagged)]
87    Other(String),
88}
89
90impl A2AAgentCardAuthenticationType {
91    /// The value as it appears on the wire.
92    pub fn as_str(&self) -> &str {
93        match self {
94            Self::None => "none",
95            Self::APIKey => "apiKey",
96            Self::Other(value) => value.as_str(),
97        }
98    }
99}
100
101impl std::fmt::Display for A2AAgentCardAuthenticationType {
102    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
103        f.write_str(self.as_str())
104    }
105}
106
107impl From<&str> for A2AAgentCardAuthenticationType {
108    fn from(value: &str) -> Self {
109        match value {
110            "none" => Self::None,
111            "apiKey" => Self::APIKey,
112            other => Self::Other(other.to_string()),
113        }
114    }
115}
116
117/// `A2AAgentCardCapabilities` model.
118#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
119pub struct A2AAgentCardCapabilities {
120    pub streaming: bool,
121    pub push_notifications: bool,
122    pub state_transition_history: bool,
123}
124
125/// `A2AAgentCardProtocolVersion` enumeration.
126#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
127pub enum A2AAgentCardProtocolVersion {
128    #[default]
129    #[serde(rename = "0.2")]
130    V02,
131    #[serde(rename = "0.3")]
132    V03,
133    /// A value the API introduced after this SDK was generated.
134    #[serde(untagged)]
135    Other(String),
136}
137
138impl A2AAgentCardProtocolVersion {
139    /// The value as it appears on the wire.
140    pub fn as_str(&self) -> &str {
141        match self {
142            Self::V02 => "0.2",
143            Self::V03 => "0.3",
144            Self::Other(value) => value.as_str(),
145        }
146    }
147}
148
149impl std::fmt::Display for A2AAgentCardProtocolVersion {
150    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
151        f.write_str(self.as_str())
152    }
153}
154
155impl From<&str> for A2AAgentCardProtocolVersion {
156    fn from(value: &str) -> Self {
157        match value {
158            "0.2" => Self::V02,
159            "0.3" => Self::V03,
160            other => Self::Other(other.to_string()),
161        }
162    }
163}
164
165/// `A2AAgentCardSchemaVersion` enumeration.
166#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
167pub enum A2AAgentCardSchemaVersion {
168    #[default]
169    #[serde(rename = "1.0")]
170    V10,
171    /// A value the API introduced after this SDK was generated.
172    #[serde(untagged)]
173    Other(String),
174}
175
176impl A2AAgentCardSchemaVersion {
177    /// The value as it appears on the wire.
178    pub fn as_str(&self) -> &str {
179        match self {
180            Self::V10 => "1.0",
181            Self::Other(value) => value.as_str(),
182        }
183    }
184}
185
186impl std::fmt::Display for A2AAgentCardSchemaVersion {
187    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
188        f.write_str(self.as_str())
189    }
190}
191
192impl From<&str> for A2AAgentCardSchemaVersion {
193    fn from(value: &str) -> Self {
194        match value {
195            "1.0" => Self::V10,
196            other => Self::Other(other.to_string()),
197        }
198    }
199}
200
201/// `A2AAgentCardSkill` model.
202#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
203pub struct A2AAgentCardSkill {
204    pub id: String,
205    pub name: String,
206    pub description: String,
207    pub tags: Vec<String>,
208    pub examples: Vec<String>,
209}
210
211/// `A2ajsonRpcRequest` model.
212#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
213pub struct A2ajsonRpcRequest {
214    /// Always `2.0`.
215    pub jsonrpc: String,
216    pub method: A2ajsonRpcRequestMethod,
217    #[serde(default, skip_serializing_if = "Option::is_none")]
218    pub params: Option<serde_json::Map<String, serde_json::Value>>,
219    #[serde(default, skip_serializing_if = "Option::is_none")]
220    pub id: Option<serde_json::Value>,
221}
222
223/// `A2ajsonRpcRequestMethod` enumeration.
224#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
225pub enum A2ajsonRpcRequestMethod {
226    #[default]
227    #[serde(rename = "tasks/send")]
228    TasksSend,
229    #[serde(rename = "tasks/sendSubscribe")]
230    TasksSendSubscribe,
231    #[serde(rename = "tasks/get")]
232    TasksGet,
233    #[serde(rename = "tasks/cancel")]
234    TasksCancel,
235    #[serde(rename = "tasks/pushNotification/set")]
236    TasksPushNotificationSet,
237    #[serde(rename = "tasks/pushNotification/get")]
238    TasksPushNotificationGet,
239    /// A value the API introduced after this SDK was generated.
240    #[serde(untagged)]
241    Other(String),
242}
243
244impl A2ajsonRpcRequestMethod {
245    /// The value as it appears on the wire.
246    pub fn as_str(&self) -> &str {
247        match self {
248            Self::TasksSend => "tasks/send",
249            Self::TasksSendSubscribe => "tasks/sendSubscribe",
250            Self::TasksGet => "tasks/get",
251            Self::TasksCancel => "tasks/cancel",
252            Self::TasksPushNotificationSet => "tasks/pushNotification/set",
253            Self::TasksPushNotificationGet => "tasks/pushNotification/get",
254            Self::Other(value) => value.as_str(),
255        }
256    }
257}
258
259impl std::fmt::Display for A2ajsonRpcRequestMethod {
260    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
261        f.write_str(self.as_str())
262    }
263}
264
265impl From<&str> for A2ajsonRpcRequestMethod {
266    fn from(value: &str) -> Self {
267        match value {
268            "tasks/send" => Self::TasksSend,
269            "tasks/sendSubscribe" => Self::TasksSendSubscribe,
270            "tasks/get" => Self::TasksGet,
271            "tasks/cancel" => Self::TasksCancel,
272            "tasks/pushNotification/set" => Self::TasksPushNotificationSet,
273            "tasks/pushNotification/get" => Self::TasksPushNotificationGet,
274            other => Self::Other(other.to_string()),
275        }
276    }
277}
278
279/// a2a/agent-card.ts A2APart — `text`, `file` or `data` by `type`. The platform itself emits
280/// one text or data part per message; file parts arrive from remote agents.
281#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
282pub struct A2APart {
283    pub r#type: A2APartType,
284    #[serde(default, skip_serializing_if = "Option::is_none")]
285    pub text: Option<String>,
286    #[serde(default, skip_serializing_if = "Option::is_none")]
287    pub file: Option<A2APartFile>,
288    #[serde(default, skip_serializing_if = "Option::is_none")]
289    pub data: Option<serde_json::Map<String, serde_json::Value>>,
290}
291
292/// `A2APartFile` model.
293#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
294pub struct A2APartFile {
295    pub name: String,
296    pub mime_type: String,
297    /// Inline base64.
298    #[serde(default, skip_serializing_if = "Option::is_none")]
299    pub data: Option<String>,
300    #[serde(default, skip_serializing_if = "Option::is_none")]
301    pub uri: Option<String>,
302}
303
304/// `A2APartType` enumeration.
305#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
306pub enum A2APartType {
307    #[default]
308    #[serde(rename = "text")]
309    Text,
310    #[serde(rename = "file")]
311    File,
312    #[serde(rename = "data")]
313    Data,
314    /// A value the API introduced after this SDK was generated.
315    #[serde(untagged)]
316    Other(String),
317}
318
319impl A2APartType {
320    /// The value as it appears on the wire.
321    pub fn as_str(&self) -> &str {
322        match self {
323            Self::Text => "text",
324            Self::File => "file",
325            Self::Data => "data",
326            Self::Other(value) => value.as_str(),
327        }
328    }
329}
330
331impl std::fmt::Display for A2APartType {
332    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
333        f.write_str(self.as_str())
334    }
335}
336
337impl From<&str> for A2APartType {
338    fn from(value: &str) -> Self {
339        match value {
340            "text" => Self::Text,
341            "file" => Self::File,
342            "data" => Self::Data,
343            other => Self::Other(other.to_string()),
344        }
345    }
346}
347
348/// `A2ATask` model.
349#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
350pub struct A2ATask {
351    pub id: String,
352    #[serde(default, skip_serializing_if = "Option::is_none")]
353    pub agent_id: Option<String>,
354    #[serde(default, skip_serializing_if = "Option::is_none")]
355    pub session_id: Option<String>,
356    pub status: A2ATaskStatus,
357    pub messages: Vec<A2ATaskMessage>,
358    pub artifacts: Vec<A2ATaskArtifact>,
359    pub metadata: serde_json::Map<String, serde_json::Value>,
360    #[serde(default, skip_serializing_if = "Option::is_none")]
361    pub created_at: Option<String>,
362    #[serde(default, skip_serializing_if = "Option::is_none")]
363    pub updated_at: Option<String>,
364}
365
366/// `A2ATaskArtifact` model.
367#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
368pub struct A2ATaskArtifact {
369    pub name: String,
370    #[serde(default, skip_serializing_if = "Option::is_none")]
371    pub description: Option<String>,
372    pub parts: Vec<A2APart>,
373    pub index: i64,
374}
375
376/// `A2ATaskMessage` model.
377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
378pub struct A2ATaskMessage {
379    pub role: DrawingJournalEntryAuthorKind,
380    pub parts: Vec<A2APart>,
381}
382
383/// `A2ATaskStatus` enumeration.
384#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
385pub enum A2ATaskStatus {
386    #[default]
387    #[serde(rename = "submitted")]
388    Submitted,
389    #[serde(rename = "working")]
390    Working,
391    #[serde(rename = "input-required")]
392    InputRequired,
393    #[serde(rename = "completed")]
394    Completed,
395    #[serde(rename = "canceled")]
396    Canceled,
397    #[serde(rename = "failed")]
398    Failed,
399    /// A value the API introduced after this SDK was generated.
400    #[serde(untagged)]
401    Other(String),
402}
403
404impl A2ATaskStatus {
405    /// The value as it appears on the wire.
406    pub fn as_str(&self) -> &str {
407        match self {
408            Self::Submitted => "submitted",
409            Self::Working => "working",
410            Self::InputRequired => "input-required",
411            Self::Completed => "completed",
412            Self::Canceled => "canceled",
413            Self::Failed => "failed",
414            Self::Other(value) => value.as_str(),
415        }
416    }
417}
418
419impl std::fmt::Display for A2ATaskStatus {
420    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
421        f.write_str(self.as_str())
422    }
423}
424
425impl From<&str> for A2ATaskStatus {
426    fn from(value: &str) -> Self {
427        match value {
428            "submitted" => Self::Submitted,
429            "working" => Self::Working,
430            "input-required" => Self::InputRequired,
431            "completed" => Self::Completed,
432            "canceled" => Self::Canceled,
433            "failed" => Self::Failed,
434            other => Self::Other(other.to_string()),
435        }
436    }
437}
438
439/// After-action review, built once when the mission reaches a terminal status.
440/// `failure_analysis` is present only when something failed.
441#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
442pub struct Aar {
443    pub aar_id: String,
444    pub mission_id: String,
445    pub tenant_id: String,
446    pub created_at: String,
447    pub outcome: MissionOutcome,
448    pub phases: Vec<AarPhaseRecord>,
449    pub objective_outcomes: Vec<AarObjectiveOutcome>,
450    #[serde(default, skip_serializing_if = "Option::is_none")]
451    pub failure_analysis: Option<AarFailureAnalysis>,
452}
453
454/// `AarFailureAnalysis` model.
455#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
456pub struct AarFailureAnalysis {
457    pub failed_objective_ids: Vec<String>,
458    pub root_causes: Vec<AarRootCause>,
459    pub lessons: Vec<AarLesson>,
460}
461
462/// A pattern seen in this mission and what to do about it next time.
463#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
464pub struct AarLesson {
465    pub pattern: String,
466    pub recommendation: String,
467}
468
469/// `AarObjectiveOutcome` model.
470#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
471pub struct AarObjectiveOutcome {
472    pub objective_id: String,
473    /// The objective's status when the mission ended.
474    pub final_status: String,
475    /// Retries spent on this objective before it settled — read from the objective record, so it
476    /// agrees with `GET /missions/{missionId}/objectives`.
477    pub strikes_used: i64,
478    /// The objective record's `abort_reason`, copied. Absent when it has none.
479    #[serde(default, skip_serializing_if = "Option::is_none")]
480    pub abort_reason: Option<String>,
481    #[serde(default, skip_serializing_if = "Option::is_none")]
482    pub final_agent_id: Option<String>,
483    #[serde(default, skip_serializing_if = "Option::is_none")]
484    pub final_model: Option<String>,
485    #[serde(default, skip_serializing_if = "Option::is_none")]
486    pub duration_ms: Option<i64>,
487    #[serde(default, skip_serializing_if = "Option::is_none")]
488    pub cost_usd: Option<f64>,
489    /// Whether the success criteria were checked and held.
490    pub verified: bool,
491}
492
493/// `AarPhaseRecord` model.
494#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
495pub struct AarPhaseRecord {
496    pub phase: AarPhaseRecordPhase,
497    pub started_at: String,
498    pub completed_at: String,
499    pub duration_ms: i64,
500}
501
502/// `AarPhaseRecordPhase` enumeration.
503#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
504pub enum AarPhaseRecordPhase {
505    #[default]
506    #[serde(rename = "recon")]
507    Recon,
508    #[serde(rename = "plan")]
509    Plan,
510    #[serde(rename = "authorize")]
511    Authorize,
512    #[serde(rename = "execute")]
513    Execute,
514    #[serde(rename = "verify")]
515    Verify,
516    /// A value the API introduced after this SDK was generated.
517    #[serde(untagged)]
518    Other(String),
519}
520
521impl AarPhaseRecordPhase {
522    /// The value as it appears on the wire.
523    pub fn as_str(&self) -> &str {
524        match self {
525            Self::Recon => "recon",
526            Self::Plan => "plan",
527            Self::Authorize => "authorize",
528            Self::Execute => "execute",
529            Self::Verify => "verify",
530            Self::Other(value) => value.as_str(),
531        }
532    }
533}
534
535impl std::fmt::Display for AarPhaseRecordPhase {
536    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
537        f.write_str(self.as_str())
538    }
539}
540
541impl From<&str> for AarPhaseRecordPhase {
542    fn from(value: &str) -> Self {
543        match value {
544            "recon" => Self::Recon,
545            "plan" => Self::Plan,
546            "authorize" => Self::Authorize,
547            "execute" => Self::Execute,
548            "verify" => Self::Verify,
549            other => Self::Other(other.to_string()),
550        }
551    }
552}
553
554/// `AarRootCause` model.
555#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
556pub struct AarRootCause {
557    pub objective_id: String,
558    /// Coarse and closed. Derived from the objective's `abort_reason`: `budget_exhausted` and
559    /// `exhausted_strikes_\<n\>` → `max_duration_exceeded`; `dependency_failed` and
560    /// `verifier_error` → `external_error`. Branch on `code` for the precise reason.
561    pub category: AarRootCauseCategory,
562    pub details: String,
563    /// The objective's `abort_reason` verbatim (e.g. `budget_exhausted`, `verifier_error`). Absent
564    /// when the objective recorded none.
565    #[serde(default, skip_serializing_if = "Option::is_none")]
566    pub code: Option<String>,
567}
568
569/// Coarse and closed. Derived from the objective's `abort_reason`: `budget_exhausted` and
570/// `exhausted_strikes_\<n\>` → `max_duration_exceeded`; `dependency_failed` and
571/// `verifier_error` → `external_error`. Branch on `code` for the precise reason.
572#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
573pub enum AarRootCauseCategory {
574    #[default]
575    #[serde(rename = "llm_timeout")]
576    LLMTimeout,
577    #[serde(rename = "llm_idle")]
578    LLMIdle,
579    #[serde(rename = "llm_loop")]
580    LLMLoop,
581    #[serde(rename = "tool_error")]
582    ToolError,
583    #[serde(rename = "tool_truncation")]
584    ToolTruncation,
585    #[serde(rename = "verification_failed")]
586    VerificationFailed,
587    #[serde(rename = "authorization_denied")]
588    AuthorizationDenied,
589    #[serde(rename = "external_error")]
590    ExternalError,
591    #[serde(rename = "max_duration_exceeded")]
592    MaxDurationExceeded,
593    #[serde(rename = "unknown")]
594    Unknown,
595    /// A value the API introduced after this SDK was generated.
596    #[serde(untagged)]
597    Other(String),
598}
599
600impl AarRootCauseCategory {
601    /// The value as it appears on the wire.
602    pub fn as_str(&self) -> &str {
603        match self {
604            Self::LLMTimeout => "llm_timeout",
605            Self::LLMIdle => "llm_idle",
606            Self::LLMLoop => "llm_loop",
607            Self::ToolError => "tool_error",
608            Self::ToolTruncation => "tool_truncation",
609            Self::VerificationFailed => "verification_failed",
610            Self::AuthorizationDenied => "authorization_denied",
611            Self::ExternalError => "external_error",
612            Self::MaxDurationExceeded => "max_duration_exceeded",
613            Self::Unknown => "unknown",
614            Self::Other(value) => value.as_str(),
615        }
616    }
617}
618
619impl std::fmt::Display for AarRootCauseCategory {
620    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
621        f.write_str(self.as_str())
622    }
623}
624
625impl From<&str> for AarRootCauseCategory {
626    fn from(value: &str) -> Self {
627        match value {
628            "llm_timeout" => Self::LLMTimeout,
629            "llm_idle" => Self::LLMIdle,
630            "llm_loop" => Self::LLMLoop,
631            "tool_error" => Self::ToolError,
632            "tool_truncation" => Self::ToolTruncation,
633            "verification_failed" => Self::VerificationFailed,
634            "authorization_denied" => Self::AuthorizationDenied,
635            "external_error" => Self::ExternalError,
636            "max_duration_exceeded" => Self::MaxDurationExceeded,
637            "unknown" => Self::Unknown,
638            other => Self::Other(other.to_string()),
639        }
640    }
641}
642
643/// `AbortMissionRequest` model.
644#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
645pub struct AbortMissionRequest {
646    /// Recorded on the mission; blank or missing is fine.
647    #[serde(default, skip_serializing_if = "Option::is_none")]
648    pub reason: Option<String>,
649}
650
651/// `AcceptInviteFromPickerRequest` model.
652#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
653pub struct AcceptInviteFromPickerRequest {
654    /// The invite secret, echoed to the picker by `GET /api/v1/me/tenants`. Compared in constant
655    /// time. Defence in depth rather than the primary gate — the email match is that — and it
656    /// catches the class where the listing ever shows an invite not addressed to the caller.
657    /// Invites created before secrets exist accept without one.
658    #[serde(default, skip_serializing_if = "Option::is_none")]
659    pub token: Option<String>,
660    /// Display name for the new member. Omitted, the local part of the invited email is used.
661    #[serde(default, skip_serializing_if = "Option::is_none")]
662    pub name: Option<String>,
663}
664
665/// `AcceptInviteFromPickerResponse` model.
666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
667pub struct AcceptInviteFromPickerResponse {
668    pub accepted: bool,
669    pub tenant_id: String,
670    pub user_id: String,
671    pub role: String,
672}
673
674/// `AcceptInviteRequest` model.
675#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
676pub struct AcceptInviteRequest {
677    /// Display name. Omitted, the local part of the invited email is used.
678    #[serde(default, skip_serializing_if = "Option::is_none")]
679    pub name: Option<String>,
680    /// The invite secret from the email link's `?t=`, forwarded in the body.
681    #[serde(default, skip_serializing_if = "Option::is_none")]
682    pub token: Option<String>,
683}
684
685/// `AcceptInviteResponse` model.
686#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
687pub struct AcceptInviteResponse {
688    pub accepted: bool,
689    pub user_id: String,
690    pub tenant_id: String,
691    pub role: String,
692}
693
694/// The JSON form of an account export. The same bundle the zip contains, as one document.
695#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
696pub struct AccountExport {
697    pub format: AccountExportFormat,
698    pub exported_at: String,
699    pub counts: AccountExportCounts,
700    /// False when a size ceiling was hit; `omitted` then says what was left out. An export that
701    /// quietly drops things is worse than one that admits it.
702    pub complete: bool,
703    pub omitted: Vec<String>,
704    /// Path inside the bundle → its contents (`account.json`, `projects.md`, `memory.md`,
705    /// `chats/…`).
706    pub files: serde_json::Map<String, serde_json::Value>,
707}
708
709/// `AccountExportCounts` model.
710#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
711pub struct AccountExportCounts {
712    pub chats: i64,
713    pub projects: i64,
714    pub memories: i64,
715}
716
717/// `AccountExportFormat` enumeration.
718#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
719pub enum AccountExportFormat {
720    #[default]
721    #[serde(rename = "snaga.export.v1")]
722    SnagaExportV1,
723    /// A value the API introduced after this SDK was generated.
724    #[serde(untagged)]
725    Other(String),
726}
727
728impl AccountExportFormat {
729    /// The value as it appears on the wire.
730    pub fn as_str(&self) -> &str {
731        match self {
732            Self::SnagaExportV1 => "snaga.export.v1",
733            Self::Other(value) => value.as_str(),
734        }
735    }
736}
737
738impl std::fmt::Display for AccountExportFormat {
739    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
740        f.write_str(self.as_str())
741    }
742}
743
744impl From<&str> for AccountExportFormat {
745    fn from(value: &str) -> Self {
746        match value {
747            "snaga.export.v1" => Self::SnagaExportV1,
748            other => Self::Other(other.to_string()),
749        }
750    }
751}
752
753/// `ActivateSafeModeRequest` model.
754#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
755pub struct ActivateSafeModeRequest {
756    pub reason: String,
757    #[serde(default, skip_serializing_if = "Option::is_none")]
758    pub activated_by: Option<String>,
759    #[serde(default, skip_serializing_if = "Option::is_none")]
760    pub deadline_hours: Option<f64>,
761}
762
763/// `ActivateSessionBranchResponse` model.
764#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
765pub struct ActivateSessionBranchResponse {
766    pub session_id: String,
767    pub active_branch: String,
768}
769
770/// `ActiveSession` model.
771#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
772pub struct ActiveSession {
773    pub key_id: String,
774    pub name: String,
775    pub prefix: String,
776    pub scopes: Vec<String>,
777    pub status: APIKeySummaryStatus,
778    pub is_current: bool,
779    #[serde(default, skip_serializing_if = "Option::is_none")]
780    pub created_at: Option<String>,
781    #[serde(default, skip_serializing_if = "Option::is_none")]
782    pub expires_at: Option<String>,
783    #[serde(default, skip_serializing_if = "Option::is_none")]
784    pub last_used_at: Option<String>,
785}
786
787/// `AddAndroidTestersRequest` model.
788#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
789pub struct AddAndroidTestersRequest {
790    pub emails: Vec<String>,
791    /// Server default: `"admin"`.
792    #[serde(default, skip_serializing_if = "Option::is_none")]
793    pub source: Option<String>,
794}
795
796/// `AddAndroidTestersResponse` model.
797#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
798pub struct AddAndroidTestersResponse {
799    pub added: Vec<String>,
800    pub already: Vec<String>,
801    pub invalid: Vec<String>,
802}
803
804/// `AddSquadGraphEdgeRequest` model.
805#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
806pub struct AddSquadGraphEdgeRequest {
807    pub from: String,
808    pub to: String,
809    pub r#type: TeamGraphEdgeType,
810    #[serde(default, skip_serializing_if = "Option::is_none")]
811    pub task_id: Option<String>,
812}
813
814/// `AddSquadGraphNodeRequest` model.
815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
816pub struct AddSquadGraphNodeRequest {
817    pub agent_id: String,
818    pub role: TeamGraphNodeRole,
819    #[serde(default, skip_serializing_if = "Option::is_none")]
820    pub spawned_by: Option<String>,
821    #[serde(default, skip_serializing_if = "Option::is_none")]
822    pub goal_summary: Option<String>,
823}
824
825/// `AddTeamGraphEdgeRequest` model.
826#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
827pub struct AddTeamGraphEdgeRequest {
828    pub from: String,
829    pub to: String,
830    pub r#type: TeamGraphEdgeType,
831    #[serde(default, skip_serializing_if = "Option::is_none")]
832    pub task_id: Option<String>,
833}
834
835/// `AddTeamGraphNodeRequest` model.
836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
837pub struct AddTeamGraphNodeRequest {
838    pub agent_id: String,
839    pub role: TeamGraphNodeRole,
840    #[serde(default, skip_serializing_if = "Option::is_none")]
841    pub spawned_by: Option<String>,
842    #[serde(default, skip_serializing_if = "Option::is_none")]
843    pub goal_summary: Option<String>,
844}
845
846/// `AdminAnalyticsEventsResponse` model.
847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
848pub struct AdminAnalyticsEventsResponse {
849    pub items: Vec<AdminAnalyticsEventsResponseItem>,
850    pub count: i64,
851}
852
853/// `AdminAnalyticsEventsResponseItem` model.
854#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
855pub struct AdminAnalyticsEventsResponseItem {
856    #[serde(default, skip_serializing_if = "Option::is_none")]
857    pub event_id: Option<String>,
858    #[serde(default, skip_serializing_if = "Option::is_none")]
859    pub ts: Option<String>,
860    #[serde(default, skip_serializing_if = "Option::is_none")]
861    pub r#type: Option<String>,
862    #[serde(default, skip_serializing_if = "Option::is_none")]
863    pub visitor_id: Option<String>,
864    #[serde(default, skip_serializing_if = "Option::is_none")]
865    pub tenant_id: Option<String>,
866    #[serde(default, skip_serializing_if = "Option::is_none")]
867    pub country: Option<String>,
868    #[serde(default, skip_serializing_if = "Option::is_none")]
869    pub device_type: Option<AdminAnalyticsEventsResponseItemDeviceType>,
870    #[serde(default, skip_serializing_if = "Option::is_none")]
871    pub browser: Option<String>,
872    #[serde(default, skip_serializing_if = "Option::is_none")]
873    pub os: Option<String>,
874    #[serde(default, skip_serializing_if = "Option::is_none")]
875    pub language: Option<String>,
876    #[serde(default, skip_serializing_if = "Option::is_none")]
877    pub referrer_host: Option<String>,
878    #[serde(default, skip_serializing_if = "Option::is_none")]
879    pub path: Option<String>,
880    #[serde(default, skip_serializing_if = "Option::is_none")]
881    pub utm_source: Option<String>,
882    #[serde(default, skip_serializing_if = "Option::is_none")]
883    pub utm_medium: Option<String>,
884    #[serde(default, skip_serializing_if = "Option::is_none")]
885    pub utm_campaign: Option<String>,
886    #[serde(default, skip_serializing_if = "Option::is_none")]
887    pub ip_hash: Option<String>,
888}
889
890/// `AdminAnalyticsEventsResponseItemDeviceType` enumeration.
891#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
892pub enum AdminAnalyticsEventsResponseItemDeviceType {
893    #[default]
894    #[serde(rename = "mobile")]
895    Mobile,
896    #[serde(rename = "tablet")]
897    Tablet,
898    #[serde(rename = "desktop")]
899    Desktop,
900    #[serde(rename = "bot")]
901    Bot,
902    #[serde(rename = "unknown")]
903    Unknown,
904    /// A value the API introduced after this SDK was generated.
905    #[serde(untagged)]
906    Other(String),
907}
908
909impl AdminAnalyticsEventsResponseItemDeviceType {
910    /// The value as it appears on the wire.
911    pub fn as_str(&self) -> &str {
912        match self {
913            Self::Mobile => "mobile",
914            Self::Tablet => "tablet",
915            Self::Desktop => "desktop",
916            Self::Bot => "bot",
917            Self::Unknown => "unknown",
918            Self::Other(value) => value.as_str(),
919        }
920    }
921}
922
923impl std::fmt::Display for AdminAnalyticsEventsResponseItemDeviceType {
924    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
925        f.write_str(self.as_str())
926    }
927}
928
929impl From<&str> for AdminAnalyticsEventsResponseItemDeviceType {
930    fn from(value: &str) -> Self {
931        match value {
932            "mobile" => Self::Mobile,
933            "tablet" => Self::Tablet,
934            "desktop" => Self::Desktop,
935            "bot" => Self::Bot,
936            "unknown" => Self::Unknown,
937            other => Self::Other(other.to_string()),
938        }
939    }
940}
941
942/// `AdminAnalyticsOverviewResponse` model.
943#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
944pub struct AdminAnalyticsOverviewResponse {
945    #[serde(default, skip_serializing_if = "Option::is_none")]
946    pub range: Option<AdminAnalyticsOverviewResponseRange>,
947    #[serde(default, skip_serializing_if = "Option::is_none")]
948    pub totals: Option<AdminAnalyticsOverviewResponseTotals>,
949    #[serde(default, skip_serializing_if = "Option::is_none")]
950    pub unique_visitors_30d: Option<i64>,
951    #[serde(default, skip_serializing_if = "Option::is_none")]
952    pub signups_30d: Option<i64>,
953    #[serde(default, skip_serializing_if = "Option::is_none")]
954    pub conversion_rate: Option<f64>,
955    #[serde(default, skip_serializing_if = "Option::is_none")]
956    pub timeseries: Option<Vec<AnalyticsTimeseriesPoint>>,
957    #[serde(default, skip_serializing_if = "Option::is_none")]
958    pub top_countries: Option<Vec<AnalyticsTopValue>>,
959    #[serde(default, skip_serializing_if = "Option::is_none")]
960    pub top_devices: Option<Vec<AnalyticsTopValue>>,
961    #[serde(default, skip_serializing_if = "Option::is_none")]
962    pub top_browsers: Option<Vec<AnalyticsTopValue>>,
963    #[serde(default, skip_serializing_if = "Option::is_none")]
964    pub top_referrers: Option<Vec<AnalyticsTopValue>>,
965    #[serde(default, skip_serializing_if = "Option::is_none")]
966    pub top_utm_sources: Option<Vec<AnalyticsTopValue>>,
967}
968
969/// `AdminAnalyticsOverviewResponseRange` model.
970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
971pub struct AdminAnalyticsOverviewResponseRange {
972    #[serde(default, skip_serializing_if = "Option::is_none")]
973    pub from: Option<String>,
974    #[serde(default, skip_serializing_if = "Option::is_none")]
975    pub to: Option<String>,
976    #[serde(default, skip_serializing_if = "Option::is_none")]
977    pub days: Option<i64>,
978}
979
980/// `AdminAnalyticsOverviewResponseTotals` model.
981#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
982pub struct AdminAnalyticsOverviewResponseTotals {
983    #[serde(default, skip_serializing_if = "Option::is_none")]
984    pub landing_visit: Option<i64>,
985    #[serde(default, skip_serializing_if = "Option::is_none")]
986    pub page_view: Option<i64>,
987    #[serde(default, skip_serializing_if = "Option::is_none")]
988    pub signup: Option<i64>,
989    #[serde(default, skip_serializing_if = "Option::is_none")]
990    pub login: Option<i64>,
991    #[serde(default, skip_serializing_if = "Option::is_none")]
992    pub app_open: Option<i64>,
993}
994
995/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z; types/security.ts
996/// AdminAuditEntry — actor_* and ip_address conditional.
997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
998pub struct AdminAuditList {
999    pub entries: Vec<AdminAuditListEntry>,
1000    pub total: i64,
1001}
1002
1003/// `AdminAuditListEntry` model.
1004#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1005pub struct AdminAuditListEntry {
1006    pub entry_id: String,
1007    #[serde(default, skip_serializing_if = "Option::is_none")]
1008    pub actor_tenant_id: Option<String>,
1009    pub action: String,
1010    pub target_type: String,
1011    pub target_id: String,
1012    pub details: serde_json::Map<String, serde_json::Value>,
1013    #[serde(default, skip_serializing_if = "Option::is_none")]
1014    pub ip_address: Option<String>,
1015    pub timestamp: String,
1016    #[serde(default, skip_serializing_if = "Option::is_none")]
1017    pub actor_key_id: Option<String>,
1018    #[serde(default, skip_serializing_if = "Option::is_none")]
1019    pub actor_user_id: Option<String>,
1020}
1021
1022/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `agent_memory` is the
1023/// effective section — platform defaults under the stored override (admin-config.ts
1024/// getEffectiveSection); keys measured present are required unless the handler marks them
1025/// optional.
1026#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1027pub struct AdminConfigAgentMemoryConfig {
1028    pub agent_memory: AdminConfigAgentMemoryConfigAgentMemory,
1029}
1030
1031/// `AdminConfigAgentMemoryConfigAgentMemory` model.
1032#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1033pub struct AdminConfigAgentMemoryConfigAgentMemory {
1034    pub enabled: bool,
1035    pub use_shared_store: bool,
1036    pub default_max_entries: i64,
1037    pub default_retrieval_limit: i64,
1038    pub default_retrieval_strategy: String,
1039    pub decay_enabled: bool,
1040    pub decay_half_life_days: i64,
1041    pub decay_job_interval_ms: i64,
1042    pub extraction_max_tokens: i64,
1043    pub extraction_model: String,
1044    pub eviction_threshold: i64,
1045    pub embedding_dimensions: i64,
1046    pub embedding_provider: String,
1047    pub embedding_model: String,
1048    pub compression_model: String,
1049}
1050
1051/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `auth` is the effective
1052/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1053/// keys measured present are required unless the handler marks them optional.
1054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1055pub struct AdminConfigAuthConfig {
1056    pub auth: AdminConfigAuthConfigAuth,
1057}
1058
1059/// `AdminConfigAuthConfigAuth` model.
1060#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1061pub struct AdminConfigAuthConfigAuth {
1062    pub super_admin_email: String,
1063    pub otp_ttl_ms: i64,
1064    pub verification_ttl_ms: i64,
1065    pub jwks_cache_ttl_ms: i64,
1066    pub jwks_grace_ttl_ms: i64,
1067    pub api_key_cache_ttl_s: i64,
1068    pub api_key_rotation_grace_period_h: i64,
1069}
1070
1071/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `backpressure` is the
1072/// effective section — platform defaults under the stored override (admin-config.ts
1073/// getEffectiveSection); keys measured present are required unless the handler marks them
1074/// optional.
1075#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1076pub struct AdminConfigBackpressureConfig {
1077    pub backpressure: AdminConfigBackpressureConfigBackpressure,
1078}
1079
1080/// `AdminConfigBackpressureConfigBackpressure` model.
1081#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1082pub struct AdminConfigBackpressureConfigBackpressure {
1083    pub sse_buffer_max: i64,
1084    pub sse_high_watermark: i64,
1085    pub sse_low_watermark: i64,
1086    pub tool_queue_max_depth: i64,
1087    pub tool_queue_high_watermark: i64,
1088}
1089
1090/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `code_interpreter` is the
1091/// effective section — platform defaults under the stored override (admin-config.ts
1092/// getEffectiveSection); keys measured present are required unless the handler marks them
1093/// optional.
1094#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1095pub struct AdminConfigCodeInterpreterConfig {
1096    pub code_interpreter: AdminConfigCodeInterpreterConfigCodeInterpreter,
1097}
1098
1099/// `AdminConfigCodeInterpreterConfigCodeInterpreter` model.
1100#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1101pub struct AdminConfigCodeInterpreterConfigCodeInterpreter {
1102    pub isolation: String,
1103    #[serde(default, skip_serializing_if = "Option::is_none")]
1104    pub timeout_ms: Option<i64>,
1105    #[serde(default, skip_serializing_if = "Option::is_none")]
1106    pub max_memory_mb: Option<i64>,
1107    #[serde(default, skip_serializing_if = "Option::is_none")]
1108    pub container_image: Option<String>,
1109    #[serde(default, skip_serializing_if = "Option::is_none")]
1110    pub python_container_image: Option<String>,
1111    #[serde(default, skip_serializing_if = "Option::is_none")]
1112    pub python_sandbox_host_dir: Option<String>,
1113}
1114
1115/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `evaluation` is the
1116/// effective section — platform defaults under the stored override (admin-config.ts
1117/// getEffectiveSection); keys measured present are required unless the handler marks them
1118/// optional.
1119#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1120pub struct AdminConfigEvaluationConfig {
1121    pub evaluation: AdminConfigEvaluationConfigEvaluation,
1122}
1123
1124/// `AdminConfigEvaluationConfigEvaluation` model.
1125#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1126pub struct AdminConfigEvaluationConfigEvaluation {
1127    pub enabled: bool,
1128    pub max_concurrent_eval_cases: i64,
1129    pub regression_threshold: f64,
1130    pub default_scorers: Vec<String>,
1131    pub max_cases_per_dataset: i64,
1132    pub eval_run_timeout_ms: i64,
1133    pub auto_rollback_enabled: bool,
1134}
1135
1136/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `idempotency` is the
1137/// effective section — platform defaults under the stored override (admin-config.ts
1138/// getEffectiveSection); keys measured present are required unless the handler marks them
1139/// optional.
1140#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1141pub struct AdminConfigIdempotencyConfig {
1142    pub idempotency: AdminConfigIdempotencyConfigIdempotency,
1143}
1144
1145/// `AdminConfigIdempotencyConfigIdempotency` model.
1146#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1147pub struct AdminConfigIdempotencyConfigIdempotency {
1148    pub enabled: bool,
1149    pub ttl_hours: i64,
1150    pub max_response_cache_bytes: i64,
1151}
1152
1153/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `llm_adapters` is the
1154/// effective section — platform defaults under the stored override (admin-config.ts
1155/// getEffectiveSection); keys measured present are required unless the handler marks them
1156/// optional.
1157#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1158pub struct AdminConfigLLMAdaptersConfig {
1159    pub llm_adapters: AdminConfigLLMAdaptersConfigLLMAdapters,
1160}
1161
1162/// `AdminConfigLLMAdaptersConfigLLMAdapters` model.
1163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1164pub struct AdminConfigLLMAdaptersConfigLLMAdapters {
1165    #[serde(default, skip_serializing_if = "Option::is_none")]
1166    pub max_retries: Option<i64>,
1167    #[serde(default, skip_serializing_if = "Option::is_none")]
1168    pub retry_base_delay_ms: Option<i64>,
1169    #[serde(default, skip_serializing_if = "Option::is_none")]
1170    pub retry_max_delay_ms: Option<i64>,
1171    #[serde(default, skip_serializing_if = "Option::is_none")]
1172    pub stream_empty_timeout_ms: Option<i64>,
1173    #[serde(default, skip_serializing_if = "Option::is_none")]
1174    pub circuit_breaker: Option<AdminConfigLLMAdaptersConfigLLMAdaptersCircuitBreaker>,
1175    #[serde(default, skip_serializing_if = "Option::is_none")]
1176    pub provider_rate_limits: Option<serde_json::Map<String, serde_json::Value>>,
1177}
1178
1179/// `AdminConfigLLMAdaptersConfigLLMAdaptersCircuitBreaker` model.
1180#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1181pub struct AdminConfigLLMAdaptersConfigLLMAdaptersCircuitBreaker {
1182    #[serde(default, skip_serializing_if = "Option::is_none")]
1183    pub failure_threshold: Option<i64>,
1184    #[serde(default, skip_serializing_if = "Option::is_none")]
1185    pub reset_timeout_ms: Option<i64>,
1186    #[serde(default, skip_serializing_if = "Option::is_none")]
1187    pub half_open_max_requests: Option<i64>,
1188}
1189
1190/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `logging` is the effective
1191/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1192/// keys measured present are required unless the handler marks them optional.
1193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1194pub struct AdminConfigLoggingConfig {
1195    pub logging: AdminConfigLoggingConfigLogging,
1196}
1197
1198/// `AdminConfigLoggingConfigLogging` model.
1199#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1200pub struct AdminConfigLoggingConfigLogging {
1201    pub pii_mode: String,
1202    pub log_agent_responses: bool,
1203    pub file_enabled: bool,
1204    pub file_max_size_mb: i64,
1205    pub file_retention_days: i64,
1206    pub file_level: String,
1207    pub file_separate_error: bool,
1208    pub activity_log_verbosity: String,
1209}
1210
1211/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `long_running` is the
1212/// effective section — platform defaults under the stored override (admin-config.ts
1213/// getEffectiveSection); keys measured present are required unless the handler marks them
1214/// optional.
1215#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1216pub struct AdminConfigLongRunningConfig {
1217    pub long_running: AdminConfigLongRunningConfigLongRunning,
1218}
1219
1220/// `AdminConfigLongRunningConfigLongRunning` model.
1221#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1222pub struct AdminConfigLongRunningConfigLongRunning {
1223    pub enabled: bool,
1224    pub max_duration_ms: i64,
1225    pub checkpoint_interval_ms: i64,
1226    pub idle_timeout_ms: i64,
1227    pub continuation_token_ttl_days: i64,
1228    pub max_background_runs_per_tenant: i64,
1229}
1230
1231/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `mcp` is the effective
1232/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1233/// keys measured present are required unless the handler marks them optional.
1234#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1235pub struct AdminConfigMCPConfig {
1236    pub mcp: AdminConfigMCPConfigMCP,
1237}
1238
1239/// `AdminConfigMCPConfigMCP` model.
1240#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1241pub struct AdminConfigMCPConfigMCP {
1242    pub max_sessions_per_server: i64,
1243    pub max_total_stdio_sessions: i64,
1244    pub session_idle_timeout_ms: i64,
1245}
1246
1247/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `multimodal` is the
1248/// effective section — platform defaults under the stored override (admin-config.ts
1249/// getEffectiveSection); keys measured present are required unless the handler marks them
1250/// optional.
1251#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1252pub struct AdminConfigMultimodalConfig {
1253    pub multimodal: AdminConfigMultimodalConfigMultimodal,
1254}
1255
1256/// `AdminConfigMultimodalConfigMultimodal` model.
1257#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1258pub struct AdminConfigMultimodalConfigMultimodal {
1259    pub enabled: bool,
1260    pub max_image_size_bytes: i64,
1261    pub max_audio_duration_s: i64,
1262    pub max_video_duration_s: i64,
1263    pub auto_resize_images: bool,
1264    pub supported_image_formats: Vec<String>,
1265    pub supported_audio_formats: Vec<String>,
1266}
1267
1268/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `persistence` is the
1269/// effective section — platform defaults under the stored override (admin-config.ts
1270/// getEffectiveSection); keys measured present are required unless the handler marks them
1271/// optional.
1272#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1273pub struct AdminConfigPersistenceConfig {
1274    pub persistence: AdminConfigPersistenceConfigPersistence,
1275}
1276
1277/// `AdminConfigPersistenceConfigPersistence` model.
1278#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1279pub struct AdminConfigPersistenceConfigPersistence {
1280    pub snapshot_every_n_events: i64,
1281    pub checkpoint_after_tool_calls: bool,
1282    pub usage_shards: i64,
1283    pub auto_cap_kv_values: bool,
1284}
1285
1286/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `retention` is the effective
1287/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1288/// keys measured present are required unless the handler marks them optional.
1289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1290pub struct AdminConfigRetentionConfig {
1291    pub retention: AdminConfigRetentionConfigRetention,
1292}
1293
1294/// `AdminConfigRetentionConfigRetention` model.
1295#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1296pub struct AdminConfigRetentionConfigRetention {
1297    pub completed_run_ttl_days: i64,
1298    pub event_ttl_days: i64,
1299    pub archive_to_sqlite: bool,
1300    pub audit_log_ttl_days: i64,
1301    pub archive_job_interval_ms: i64,
1302    pub archive_batch_size: i64,
1303    pub feed_ttl_days: i64,
1304    pub artifact_ttl_days: i64,
1305    /// Notification retention in days. 0 (the default) means no expiry. Applies to rows written
1306    /// after the setting changes.
1307    #[serde(default, skip_serializing_if = "Option::is_none")]
1308    pub notification_ttl_days: Option<i64>,
1309    pub checkpoint_ttl_hours: i64,
1310}
1311
1312/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `run_command` is the
1313/// effective section — platform defaults under the stored override (admin-config.ts
1314/// getEffectiveSection); keys measured present are required unless the handler marks them
1315/// optional.
1316#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1317pub struct AdminConfigRunCommandConfig {
1318    pub run_command: AdminConfigRunCommandConfigRunCommand,
1319}
1320
1321/// `AdminConfigRunCommandConfigRunCommand` model.
1322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1323pub struct AdminConfigRunCommandConfigRunCommand {
1324    pub enabled: bool,
1325    pub isolation: String,
1326    pub timeout_ms: i64,
1327    pub max_output_bytes: i64,
1328    pub allowed_commands: Vec<String>,
1329    pub deno_allow: Vec<String>,
1330}
1331
1332/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `policies` is the effective
1333/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1334/// keys measured present are required unless the handler marks them optional.
1335#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1336pub struct AdminConfigSecurityPoliciesConfig {
1337    pub policies: AdminConfigSecurityPoliciesConfigPolicies,
1338}
1339
1340/// `AdminConfigSecurityPoliciesConfigPolicies` model.
1341#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1342pub struct AdminConfigSecurityPoliciesConfigPolicies {
1343    pub cors_allowed_origins: Vec<String>,
1344    pub webhook_url_denylist: Vec<String>,
1345    pub file_upload_max_size_bytes: i64,
1346    pub file_upload_allowed_mime_types: Vec<String>,
1347    pub admin_provider_settings_require_super_admin: bool,
1348}
1349
1350/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `server` is the effective
1351/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1352/// keys measured present are required unless the handler marks them optional.
1353#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1354pub struct AdminConfigServerConfig {
1355    pub server: AdminConfigServerConfigServer,
1356}
1357
1358/// `AdminConfigServerConfigServer` model.
1359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1360pub struct AdminConfigServerConfigServer {
1361    pub trust_proxy: bool,
1362    pub max_body_bytes: i64,
1363    #[serde(default, skip_serializing_if = "Option::is_none")]
1364    pub graceful_shutdown_timeout_ms: Option<i64>,
1365}
1366
1367/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `sse` is the effective
1368/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1369/// keys measured present are required unless the handler marks them optional.
1370#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1371pub struct AdminConfigSSEConfig {
1372    pub sse: AdminConfigSSEConfigSSE,
1373}
1374
1375/// `AdminConfigSSEConfigSSE` model.
1376#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1377pub struct AdminConfigSSEConfigSSE {
1378    pub heartbeat_interval_ms: i64,
1379    pub watch_timeout_ms: i64,
1380    pub poll_interval_ms: i64,
1381    pub max_poll_interval_ms: i64,
1382    pub reconnect_hint_ms: i64,
1383    pub run_wait_timeout_sec: i64,
1384}
1385
1386/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `tool_security` is the
1387/// effective section — platform defaults under the stored override (admin-config.ts
1388/// getEffectiveSection); keys measured present are required unless the handler marks them
1389/// optional.
1390#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1391pub struct AdminConfigToolSecurityConfig {
1392    pub tool_security: AdminConfigToolSecurityConfigToolSecurity,
1393}
1394
1395/// `AdminConfigToolSecurityConfigToolSecurity` model.
1396#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1397pub struct AdminConfigToolSecurityConfigToolSecurity {
1398    #[serde(default, skip_serializing_if = "Option::is_none")]
1399    pub egress_allowlist_per_tenant: Option<Vec<String>>,
1400    pub default_tool_timeout_ms: i64,
1401    pub default_tool_max_payload_bytes: i64,
1402    pub default_tool_max_concurrency: i64,
1403    pub stdio_inherit_env: bool,
1404}
1405
1406/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `webhooks` is the effective
1407/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1408/// keys measured present are required unless the handler marks them optional.
1409#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1410pub struct AdminConfigWebhooksConfig {
1411    pub webhooks: AdminConfigWebhooksConfigWebhooks,
1412}
1413
1414/// `AdminConfigWebhooksConfigWebhooks` model.
1415#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1416pub struct AdminConfigWebhooksConfigWebhooks {
1417    pub enabled: bool,
1418    pub max_subscriptions_per_tenant: i64,
1419    pub delivery_timeout_ms: i64,
1420    pub max_retry_attempts: i64,
1421    pub require_https: bool,
1422    pub max_payload_bytes: i64,
1423}
1424
1425/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `policy` is the effective
1426/// section — platform defaults under the stored override (admin-config.ts getEffectiveSection);
1427/// keys measured present are required unless the handler marks them optional.
1428#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1429pub struct AdminConfigWebhooksPolicyConfig {
1430    pub policy: AdminConfigWebhooksPolicyConfigPolicy,
1431}
1432
1433/// `AdminConfigWebhooksPolicyConfigPolicy` model.
1434#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1435pub struct AdminConfigWebhooksPolicyConfigPolicy {
1436    pub ssrf_check_at_subscription: bool,
1437    pub stripe_signature_tolerance_sec: i64,
1438    pub delivery_max_retries: i64,
1439    pub delivery_backoff_base_ms: i64,
1440    pub delivery_max_window_hours: i64,
1441}
1442
1443/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. `worker_pool` is the
1444/// effective section — platform defaults under the stored override (admin-config.ts
1445/// getEffectiveSection); keys measured present are required unless the handler marks them
1446/// optional.
1447#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1448pub struct AdminConfigWorkerPoolConfig {
1449    pub worker_pool: AdminConfigWorkerPoolConfigWorkerPool,
1450}
1451
1452/// `AdminConfigWorkerPoolConfigWorkerPool` model.
1453#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1454pub struct AdminConfigWorkerPoolConfigWorkerPool {
1455    pub max_workers: i64,
1456    pub default_mode: String,
1457    pub max_run_duration_ms: i64,
1458    pub reconciliation_interval_ms: i64,
1459    pub schedule_max_retries: i64,
1460    pub schedule_base_delay_ms: i64,
1461    #[serde(default, skip_serializing_if = "Option::is_none")]
1462    pub max_queue_size: Option<i64>,
1463}
1464
1465/// `AdminDataExplorerRawKeysResponse` model.
1466#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1467pub struct AdminDataExplorerRawKeysResponse {
1468    pub keys: Vec<AdminDataExplorerRawKeysResponseKey>,
1469    #[serde(default, skip_serializing_if = "Option::is_none")]
1470    pub cursor: Option<String>,
1471    pub total: i64,
1472}
1473
1474/// `AdminDataExplorerRawKeysResponseKey` model.
1475#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1476pub struct AdminDataExplorerRawKeysResponseKey {
1477    #[serde(default, skip_serializing_if = "Option::is_none")]
1478    pub key: Option<Vec<serde_json::Value>>,
1479    #[serde(default, skip_serializing_if = "Option::is_none")]
1480    pub namespace: Option<String>,
1481    #[serde(default, skip_serializing_if = "Option::is_none")]
1482    pub value_preview: Option<String>,
1483    #[serde(default, skip_serializing_if = "Option::is_none")]
1484    pub size: Option<i64>,
1485    #[serde(default, skip_serializing_if = "Option::is_none")]
1486    pub r#type: Option<AdminDataExplorerRawKeysResponseKeyType>,
1487    #[serde(default, skip_serializing_if = "Option::is_none")]
1488    pub sensitive: Option<bool>,
1489}
1490
1491/// `AdminDataExplorerRawKeysResponseKeyType` enumeration.
1492#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1493pub enum AdminDataExplorerRawKeysResponseKeyType {
1494    #[default]
1495    #[serde(rename = "null")]
1496    Null,
1497    #[serde(rename = "array")]
1498    Array,
1499    #[serde(rename = "string")]
1500    String,
1501    #[serde(rename = "number")]
1502    Number,
1503    #[serde(rename = "boolean")]
1504    Boolean,
1505    #[serde(rename = "object")]
1506    Object,
1507    #[serde(rename = "undefined")]
1508    Undefined,
1509    /// A value the API introduced after this SDK was generated.
1510    #[serde(untagged)]
1511    Other(String),
1512}
1513
1514impl AdminDataExplorerRawKeysResponseKeyType {
1515    /// The value as it appears on the wire.
1516    pub fn as_str(&self) -> &str {
1517        match self {
1518            Self::Null => "null",
1519            Self::Array => "array",
1520            Self::String => "string",
1521            Self::Number => "number",
1522            Self::Boolean => "boolean",
1523            Self::Object => "object",
1524            Self::Undefined => "undefined",
1525            Self::Other(value) => value.as_str(),
1526        }
1527    }
1528}
1529
1530impl std::fmt::Display for AdminDataExplorerRawKeysResponseKeyType {
1531    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1532        f.write_str(self.as_str())
1533    }
1534}
1535
1536impl From<&str> for AdminDataExplorerRawKeysResponseKeyType {
1537    fn from(value: &str) -> Self {
1538        match value {
1539            "null" => Self::Null,
1540            "array" => Self::Array,
1541            "string" => Self::String,
1542            "number" => Self::Number,
1543            "boolean" => Self::Boolean,
1544            "object" => Self::Object,
1545            "undefined" => Self::Undefined,
1546            other => Self::Other(other.to_string()),
1547        }
1548    }
1549}
1550
1551/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
1552#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1553pub struct AdminFeatureFlagsConfig {
1554    #[serde(default, skip_serializing_if = "Option::is_none")]
1555    pub flags: Option<Vec<FeatureFlag>>,
1556}
1557
1558/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
1559#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1560pub struct AdminFounderConfig {
1561    pub kv: FounderIdentity,
1562    pub env: FounderIdentity,
1563    pub effective: FounderIdentity,
1564}
1565
1566/// `AdminGetLandingConfigResponse` model.
1567#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1568pub struct AdminGetLandingConfigResponse {
1569    pub landing: LandingConfigSection,
1570    pub source: AdminGetLandingConfigResponseSource,
1571    /// KV versionstamp; echo it as `expected_version` on PUT.
1572    #[serde(default)]
1573    pub version: Option<String>,
1574}
1575
1576/// `AdminGetLandingConfigResponseSource` enumeration.
1577#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1578pub enum AdminGetLandingConfigResponseSource {
1579    #[default]
1580    #[serde(rename = "kv")]
1581    Kv,
1582    #[serde(rename = "none")]
1583    None,
1584    /// A value the API introduced after this SDK was generated.
1585    #[serde(untagged)]
1586    Other(String),
1587}
1588
1589impl AdminGetLandingConfigResponseSource {
1590    /// The value as it appears on the wire.
1591    pub fn as_str(&self) -> &str {
1592        match self {
1593            Self::Kv => "kv",
1594            Self::None => "none",
1595            Self::Other(value) => value.as_str(),
1596        }
1597    }
1598}
1599
1600impl std::fmt::Display for AdminGetLandingConfigResponseSource {
1601    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1602        f.write_str(self.as_str())
1603    }
1604}
1605
1606impl From<&str> for AdminGetLandingConfigResponseSource {
1607    fn from(value: &str) -> Self {
1608        match value {
1609            "kv" => Self::Kv,
1610            "none" => Self::None,
1611            other => Self::Other(other.to_string()),
1612        }
1613    }
1614}
1615
1616/// `AdminGetReconciliationResponse` model.
1617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1618pub struct AdminGetReconciliationResponse {
1619    pub tenant_id: String,
1620    pub reconciliation: AdminGetReconciliationResponseReconciliation,
1621}
1622
1623/// `AdminGetReconciliationResponseReconciliation` model.
1624#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1625pub struct AdminGetReconciliationResponseReconciliation {
1626    #[serde(default, skip_serializing_if = "Option::is_none")]
1627    pub period: Option<String>,
1628    /// Any additional properties the server returned.
1629    #[serde(flatten)]
1630    pub extra: HashMap<String, serde_json::Value>,
1631}
1632
1633/// `AdminGetVoiceConfigResponse` model.
1634#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1635pub struct AdminGetVoiceConfigResponse {
1636    #[serde(default)]
1637    pub voice: Option<AdminGetVoiceConfigResponseVoiceVariant1>,
1638    pub source: AdminGetLandingConfigResponseSource,
1639}
1640
1641/// `AdminGetVoiceConfigResponseVoiceVariant1` model.
1642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1643pub struct AdminGetVoiceConfigResponseVoiceVariant1 {
1644    pub stt: AdminGetVoiceConfigResponseVoiceVariant1stt,
1645    pub tts: AdminGetVoiceConfigResponseVoiceVariant1tts,
1646}
1647
1648/// `AdminGetVoiceConfigResponseVoiceVariant1stt` model.
1649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1650pub struct AdminGetVoiceConfigResponseVoiceVariant1stt {
1651    pub provider: String,
1652    pub model: String,
1653}
1654
1655/// `AdminGetVoiceConfigResponseVoiceVariant1tts` model.
1656#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1657pub struct AdminGetVoiceConfigResponseVoiceVariant1tts {
1658    pub provider: String,
1659    pub model: String,
1660    pub voice: String,
1661}
1662
1663/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
1664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1665pub struct AdminGuardrailsConfig {
1666    #[serde(default, skip_serializing_if = "Option::is_none")]
1667    pub guardrails: Option<Vec<GuardrailConfigItem>>,
1668}
1669
1670/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
1671#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1672pub struct AdminIntegrationsConfig {
1673    pub integrations: Vec<AdminIntegrationsConfigIntegration>,
1674}
1675
1676/// `AdminIntegrationsConfigIntegration` model.
1677#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1678pub struct AdminIntegrationsConfigIntegration {
1679    pub id: String,
1680    pub name: String,
1681    #[serde(default, skip_serializing_if = "Option::is_none")]
1682    pub icon: Option<String>,
1683    #[serde(default, skip_serializing_if = "Option::is_none")]
1684    pub auth_type: Option<AdminIntegrationsConfigIntegrationAuthType>,
1685    #[serde(default, skip_serializing_if = "Option::is_none")]
1686    pub category: Option<String>,
1687    pub enabled: bool,
1688    #[serde(default, skip_serializing_if = "Option::is_none")]
1689    pub beta: Option<bool>,
1690    /// `kv` when an operator overrode the shipped default, `default` otherwise.
1691    #[serde(default, skip_serializing_if = "Option::is_none")]
1692    pub source: Option<String>,
1693}
1694
1695/// `AdminIntegrationsConfigIntegrationAuthType` enumeration.
1696#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1697pub enum AdminIntegrationsConfigIntegrationAuthType {
1698    #[default]
1699    #[serde(rename = "oauth2")]
1700    Oauth2,
1701    #[serde(rename = "api_key")]
1702    APIKey,
1703    #[serde(rename = "none")]
1704    None,
1705    /// A value the API introduced after this SDK was generated.
1706    #[serde(untagged)]
1707    Other(String),
1708}
1709
1710impl AdminIntegrationsConfigIntegrationAuthType {
1711    /// The value as it appears on the wire.
1712    pub fn as_str(&self) -> &str {
1713        match self {
1714            Self::Oauth2 => "oauth2",
1715            Self::APIKey => "api_key",
1716            Self::None => "none",
1717            Self::Other(value) => value.as_str(),
1718        }
1719    }
1720}
1721
1722impl std::fmt::Display for AdminIntegrationsConfigIntegrationAuthType {
1723    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1724        f.write_str(self.as_str())
1725    }
1726}
1727
1728impl From<&str> for AdminIntegrationsConfigIntegrationAuthType {
1729    fn from(value: &str) -> Self {
1730        match value {
1731            "oauth2" => Self::Oauth2,
1732            "api_key" => Self::APIKey,
1733            "none" => Self::None,
1734            other => Self::Other(other.to_string()),
1735        }
1736    }
1737}
1738
1739/// `AdminListToolsResponse` model.
1740#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1741pub struct AdminListToolsResponse {
1742    pub tools: Vec<AdminListToolsResponseTool>,
1743    pub count: i64,
1744}
1745
1746/// `AdminListToolsResponseTool` model.
1747#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1748pub struct AdminListToolsResponseTool {
1749    #[serde(default, skip_serializing_if = "Option::is_none")]
1750    pub id: Option<String>,
1751    #[serde(default, skip_serializing_if = "Option::is_none")]
1752    pub name: Option<String>,
1753    #[serde(default, skip_serializing_if = "Option::is_none")]
1754    pub description: Option<String>,
1755    /// JSON Schema for tool parameters.
1756    #[serde(default, skip_serializing_if = "Option::is_none")]
1757    pub parameters: Option<serde_json::Map<String, serde_json::Value>>,
1758}
1759
1760/// `AdminListWebhookDLQResponse` model.
1761#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1762pub struct AdminListWebhookDLQResponse {
1763    pub entries: Vec<AdminListWebhookDLQResponseEntry>,
1764}
1765
1766/// `AdminListWebhookDLQResponseEntry` model.
1767#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1768pub struct AdminListWebhookDLQResponseEntry {
1769    /// Deprecated spelling of `event_id` — the same value, kept for the compatibility window and
1770    /// removed in the next breaking release (the one that moves `X-API-Version`). Read `event_id`.
1771    #[serde(rename = "eventId")]
1772    pub event_id: String,
1773    /// Deprecated spelling of `event_type` — the same value, kept for the compatibility window and
1774    /// removed in the next breaking release (the one that moves `X-API-Version`). Read
1775    /// `event_type`.
1776    #[serde(rename = "eventType")]
1777    pub event_type: String,
1778    #[serde(default, skip_serializing_if = "Option::is_none")]
1779    pub payload: Option<serde_json::Map<String, serde_json::Value>>,
1780    /// Deprecated spelling of `error_message` — the same value, kept for the compatibility window
1781    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
1782    /// `error_message`.
1783    #[serde(rename = "errorMessage")]
1784    pub error_message: String,
1785    pub timestamp: String,
1786    /// Deprecated spelling of `tenant_id` — the same value, kept for the compatibility window and
1787    /// removed in the next breaking release (the one that moves `X-API-Version`). Read `tenant_id`.
1788    #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")]
1789    pub tenant_id: Option<String>,
1790    #[serde(rename = "event_id")]
1791    pub event_id_: String,
1792    #[serde(rename = "event_type")]
1793    pub event_type_: String,
1794    #[serde(rename = "error_message")]
1795    pub error_message_: String,
1796    #[serde(rename = "tenant_id", default, skip_serializing_if = "Option::is_none")]
1797    pub tenant_id_: Option<String>,
1798}
1799
1800/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. The stored catalogue or,
1801/// with `source: seed`, the built-in registry; rows carry computed
1802/// `effective_pricing`/`effective_tier`.
1803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1804pub struct AdminModelCatalog {
1805    pub models: Vec<AdminModelCatalogModel>,
1806    pub source: AdminModelCatalogSource,
1807    pub count: i64,
1808    #[serde(default)]
1809    pub version: Option<String>,
1810}
1811
1812/// `AdminModelCatalogModel` model.
1813#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1814pub struct AdminModelCatalogModel {
1815    pub id: String,
1816    pub provider: String,
1817    pub display_name: String,
1818    pub max_context_tokens: i64,
1819    pub max_output_tokens: i64,
1820    pub supports_streaming: bool,
1821    pub supports_tool_calls: bool,
1822    pub supports_json_mode: bool,
1823    #[serde(default, skip_serializing_if = "Option::is_none")]
1824    pub supports_vision: Option<bool>,
1825    #[serde(default, skip_serializing_if = "Option::is_none")]
1826    pub tier: Option<String>,
1827    /// Read-only, computed on read (admin-config.ts withEffectiveEconomics); absent from PUT and
1828    /// seed answers.
1829    #[serde(default, skip_serializing_if = "Option::is_none")]
1830    pub effective_pricing: Option<AdminModelCatalogModelEffectivePricing>,
1831    /// Read-only, computed on read (admin-config.ts withEffectiveEconomics); absent from PUT and
1832    /// seed answers.
1833    #[serde(default, skip_serializing_if = "Option::is_none")]
1834    pub effective_tier: Option<String>,
1835}
1836
1837/// Read-only, computed on read (admin-config.ts withEffectiveEconomics); absent from PUT and
1838/// seed answers.
1839#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1840pub struct AdminModelCatalogModelEffectivePricing {
1841    pub input_per_million: f64,
1842    pub output_per_million: f64,
1843    pub cached_input_per_million: f64,
1844    pub source: String,
1845    pub layer: String,
1846    pub key: String,
1847    pub r#match: String,
1848    pub confidence: String,
1849}
1850
1851/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z; the built-in registry merged
1852/// with every configured provider's live model list — no `source`, no `version`, no computed
1853/// economics.
1854#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1855pub struct AdminModelCatalogSeed {
1856    pub models: Vec<AdminModelCatalogSeedModel>,
1857    pub count: i64,
1858}
1859
1860/// `AdminModelCatalogSeedModel` model.
1861#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1862pub struct AdminModelCatalogSeedModel {
1863    pub id: String,
1864    pub provider: String,
1865    pub display_name: String,
1866    pub max_context_tokens: i64,
1867    pub max_output_tokens: i64,
1868    pub supports_streaming: bool,
1869    pub supports_tool_calls: bool,
1870    pub supports_json_mode: bool,
1871    #[serde(default, skip_serializing_if = "Option::is_none")]
1872    pub supports_vision: Option<bool>,
1873    #[serde(default, skip_serializing_if = "Option::is_none")]
1874    pub tier: Option<String>,
1875}
1876
1877/// `AdminModelCatalogSource` enumeration.
1878#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1879pub enum AdminModelCatalogSource {
1880    #[default]
1881    #[serde(rename = "kv")]
1882    Kv,
1883    #[serde(rename = "seed")]
1884    Seed,
1885    /// A value the API introduced after this SDK was generated.
1886    #[serde(untagged)]
1887    Other(String),
1888}
1889
1890impl AdminModelCatalogSource {
1891    /// The value as it appears on the wire.
1892    pub fn as_str(&self) -> &str {
1893        match self {
1894            Self::Kv => "kv",
1895            Self::Seed => "seed",
1896            Self::Other(value) => value.as_str(),
1897        }
1898    }
1899}
1900
1901impl std::fmt::Display for AdminModelCatalogSource {
1902    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1903        f.write_str(self.as_str())
1904    }
1905}
1906
1907impl From<&str> for AdminModelCatalogSource {
1908    fn from(value: &str) -> Self {
1909        match value {
1910            "kv" => Self::Kv,
1911            "seed" => Self::Seed,
1912            other => Self::Other(other.to_string()),
1913        }
1914    }
1915}
1916
1917/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z; billing/cost-estimator.ts
1918/// listAllPricing — a live in-memory view, `layer` says where each price comes from.
1919#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1920pub struct AdminModelPricingList {
1921    pub models: Vec<AdminModelPricingListModel>,
1922    pub count: i64,
1923    pub source: String,
1924}
1925
1926/// `AdminModelPricingListModel` model.
1927#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1928pub struct AdminModelPricingListModel {
1929    pub model: String,
1930    pub layer: String,
1931    pub input_per_million: f64,
1932    pub output_per_million: f64,
1933}
1934
1935/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
1936#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1937pub struct AdminOAuthIdentityConfig {
1938    pub kv: OAuthIdentityConfig,
1939    pub env: OAuthIdentityConfig,
1940    pub effective: OAuthIdentityConfig,
1941}
1942
1943/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
1944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1945pub struct AdminPlatformURLSConfig {
1946    #[serde(default, skip_serializing_if = "Option::is_none")]
1947    pub urls: Option<AdminPlatformURLSConfigURLS>,
1948}
1949
1950/// `AdminPlatformURLSConfigURLS` model.
1951#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1952pub struct AdminPlatformURLSConfigURLS {
1953    #[serde(default, skip_serializing_if = "Option::is_none")]
1954    pub public_base_url: Option<String>,
1955    #[serde(default, skip_serializing_if = "Option::is_none")]
1956    pub webhook_base_url: Option<String>,
1957}
1958
1959/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. The whole stored override
1960/// when one exists, else the config defaults; `source` says which (admin-config.ts
1961/// getEffectivePricing).
1962#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1963pub struct AdminPricingConfig {
1964    pub pricing: AdminPricingConfigPricing,
1965    pub source: AdminPricingConfigSource,
1966}
1967
1968/// `AdminPricingConfigPricing` model.
1969#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1970pub struct AdminPricingConfigPricing {
1971    pub openai_compat_input: f64,
1972    pub openai_compat_output: f64,
1973    pub anthropic_input: i64,
1974    pub anthropic_output: f64,
1975    pub anthropic_thinking: f64,
1976}
1977
1978/// `AdminPricingConfigSource` enumeration.
1979#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
1980pub enum AdminPricingConfigSource {
1981    #[default]
1982    #[serde(rename = "kv")]
1983    Kv,
1984    #[serde(rename = "config")]
1985    Config,
1986    /// A value the API introduced after this SDK was generated.
1987    #[serde(untagged)]
1988    Other(String),
1989}
1990
1991impl AdminPricingConfigSource {
1992    /// The value as it appears on the wire.
1993    pub fn as_str(&self) -> &str {
1994        match self {
1995            Self::Kv => "kv",
1996            Self::Config => "config",
1997            Self::Other(value) => value.as_str(),
1998        }
1999    }
2000}
2001
2002impl std::fmt::Display for AdminPricingConfigSource {
2003    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2004        f.write_str(self.as_str())
2005    }
2006}
2007
2008impl From<&str> for AdminPricingConfigSource {
2009    fn from(value: &str) -> Self {
2010        match value {
2011            "kv" => Self::Kv,
2012            "config" => Self::Config,
2013            other => Self::Other(other.to_string()),
2014        }
2015    }
2016}
2017
2018/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z; admin.ts — a projection over
2019/// the custom provider, its settings and catalogue status; never the API key.
2020#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2021pub struct AdminProvider {
2022    pub id: String,
2023    pub name: String,
2024    pub canonical: String,
2025    pub default_endpoint: String,
2026    pub local: bool,
2027    pub enabled: bool,
2028    pub model_allowlist: Vec<String>,
2029    pub is_custom: bool,
2030    pub requires_api_key: bool,
2031    pub models_in_catalog: i64,
2032    pub catalog_model_ids: Vec<String>,
2033    #[serde(default, skip_serializing_if = "Option::is_none")]
2034    pub last_models_sync: Option<AdminProviderLastModelsSync>,
2035}
2036
2037/// `AdminProviderLastModelsSync` model.
2038#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2039pub struct AdminProviderLastModelsSync {
2040    pub at: String,
2041    pub added: i64,
2042    pub live: i64,
2043}
2044
2045/// admin.ts — the list projection of a custom provider (the single GET adds catalogue fields;
2046/// see AdminProvider).
2047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2048pub struct AdminProviderSummary {
2049    pub id: String,
2050    pub name: String,
2051    pub canonical: String,
2052    pub default_endpoint: String,
2053    pub local: bool,
2054    pub enabled: bool,
2055    pub model_allowlist: Vec<String>,
2056    pub is_custom: bool,
2057    pub requires_api_key: bool,
2058}
2059
2060/// `AdminPutLandingConfigResponse` model.
2061#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2062pub struct AdminPutLandingConfigResponse {
2063    pub landing: LandingConfigSection,
2064    pub source: AdminPutLandingConfigResponseSource,
2065    pub updated: bool,
2066    #[serde(default)]
2067    pub version: Option<String>,
2068}
2069
2070/// `AdminPutLandingConfigResponseSource` enumeration.
2071#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2072pub enum AdminPutLandingConfigResponseSource {
2073    #[default]
2074    #[serde(rename = "kv")]
2075    Kv,
2076    /// A value the API introduced after this SDK was generated.
2077    #[serde(untagged)]
2078    Other(String),
2079}
2080
2081impl AdminPutLandingConfigResponseSource {
2082    /// The value as it appears on the wire.
2083    pub fn as_str(&self) -> &str {
2084        match self {
2085            Self::Kv => "kv",
2086            Self::Other(value) => value.as_str(),
2087        }
2088    }
2089}
2090
2091impl std::fmt::Display for AdminPutLandingConfigResponseSource {
2092    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2093        f.write_str(self.as_str())
2094    }
2095}
2096
2097impl From<&str> for AdminPutLandingConfigResponseSource {
2098    fn from(value: &str) -> Self {
2099        match value {
2100            "kv" => Self::Kv,
2101            other => Self::Other(other.to_string()),
2102        }
2103    }
2104}
2105
2106/// `AdminPutModelCatalogResponse` model.
2107#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2108pub struct AdminPutModelCatalogResponse {
2109    pub models: Vec<AdminPutModelCatalogResponseModel>,
2110    pub source: AdminPutLandingConfigResponseSource,
2111    pub count: i64,
2112    #[serde(default)]
2113    pub version: Option<String>,
2114}
2115
2116/// `AdminPutModelCatalogResponseModel` model.
2117#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2118pub struct AdminPutModelCatalogResponseModel {
2119    pub id: String,
2120    pub provider: String,
2121    pub display_name: String,
2122    pub max_context_tokens: i64,
2123    pub max_output_tokens: i64,
2124    pub supports_streaming: bool,
2125    pub supports_tool_calls: bool,
2126    pub supports_json_mode: bool,
2127    #[serde(default, skip_serializing_if = "Option::is_none")]
2128    pub supports_vision: Option<bool>,
2129    #[serde(default, skip_serializing_if = "Option::is_none")]
2130    pub tier: Option<String>,
2131}
2132
2133/// `AdminPutVoiceConfigResponse` model.
2134#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2135pub struct AdminPutVoiceConfigResponse {
2136    pub voice: AdminPutVoiceConfigResponseVoice,
2137    pub updated: bool,
2138}
2139
2140/// `AdminPutVoiceConfigResponseVoice` model.
2141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2142pub struct AdminPutVoiceConfigResponseVoice {
2143    pub stt: AdminPutVoiceConfigResponseVoiceStt,
2144    pub tts: AdminPutVoiceConfigResponseVoiceTts,
2145}
2146
2147/// `AdminPutVoiceConfigResponseVoiceStt` model.
2148#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2149pub struct AdminPutVoiceConfigResponseVoiceStt {
2150    pub provider: String,
2151    pub model: String,
2152}
2153
2154/// `AdminPutVoiceConfigResponseVoiceTts` model.
2155#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2156pub struct AdminPutVoiceConfigResponseVoiceTts {
2157    pub provider: String,
2158    pub model: String,
2159    pub voice: String,
2160}
2161
2162/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
2163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2164pub struct AdminRateLimitsConfig {
2165    #[serde(default, skip_serializing_if = "Option::is_none")]
2166    pub endpoints: Option<Vec<EndpointRateLimit>>,
2167}
2168
2169/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
2170#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2171pub struct AdminRegistrationConfig {
2172    pub registration_open: bool,
2173    /// `free` when nothing is stored.
2174    pub default_signup_plan: String,
2175    /// Empty means no domain restriction.
2176    pub allowed_email_domains: Vec<String>,
2177    pub setup_status: AdminRegistrationConfigSetupStatus,
2178    /// Setup steps still outstanding. Non-empty means an attempt to open registration is refused,
2179    /// and this is the list it will name.
2180    pub missing_required: Vec<String>,
2181    /// How many tenants are waitlisted — ALL of them, counted by walking every KV page. It used to
2182    /// be `waitlist.length`, from a single unpaginated read, so past a thousand signups the number
2183    /// froze at exactly 1000 with nothing saying it had been cut (ADM-04). This is the number an
2184    /// admin uses to decide when to open registration, so it is the one that must be complete
2185    /// rather than the roster.
2186    pub waitlist_count: i64,
2187    /// True when `waitlist` holds fewer rows than `waitlist_count`. The roster is a display list
2188    /// and stays bounded at 1000; the count is not.
2189    #[serde(default, skip_serializing_if = "Option::is_none")]
2190    pub waitlist_truncated: Option<bool>,
2191    /// Oldest first. Bounded at 1000 rows — check `waitlist_truncated` rather than taking
2192    /// `waitlist.length` as the total.
2193    pub waitlist: Vec<AdminRegistrationConfigWaitlistItem>,
2194}
2195
2196/// `AdminRegistrationConfigSetupStatus` enumeration.
2197#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2198pub enum AdminRegistrationConfigSetupStatus {
2199    #[default]
2200    #[serde(rename = "in_progress")]
2201    InProgress,
2202    #[serde(rename = "live")]
2203    Live,
2204    /// A value the API introduced after this SDK was generated.
2205    #[serde(untagged)]
2206    Other(String),
2207}
2208
2209impl AdminRegistrationConfigSetupStatus {
2210    /// The value as it appears on the wire.
2211    pub fn as_str(&self) -> &str {
2212        match self {
2213            Self::InProgress => "in_progress",
2214            Self::Live => "live",
2215            Self::Other(value) => value.as_str(),
2216        }
2217    }
2218}
2219
2220impl std::fmt::Display for AdminRegistrationConfigSetupStatus {
2221    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2222        f.write_str(self.as_str())
2223    }
2224}
2225
2226impl From<&str> for AdminRegistrationConfigSetupStatus {
2227    fn from(value: &str) -> Self {
2228        match value {
2229            "in_progress" => Self::InProgress,
2230            "live" => Self::Live,
2231            other => Self::Other(other.to_string()),
2232        }
2233    }
2234}
2235
2236/// `AdminRegistrationConfigWaitlistItem` model.
2237#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2238pub struct AdminRegistrationConfigWaitlistItem {
2239    pub tenant_id: String,
2240    pub email: String,
2241    pub created_at: String,
2242}
2243
2244/// `AdminReplayWebhookDLQResponse` model.
2245#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2246pub struct AdminReplayWebhookDLQResponse {
2247    pub success: bool,
2248    /// Deprecated spelling of `event_id` — the same value, kept for the compatibility window and
2249    /// removed in the next breaking release (the one that moves `X-API-Version`). Read `event_id`.
2250    #[serde(rename = "eventId")]
2251    pub event_id: String,
2252    pub action: String,
2253    pub message: String,
2254    #[serde(rename = "event_id")]
2255    pub event_id_: String,
2256}
2257
2258/// Hoisted from the typed GET (handler: admin-config.ts) so the PUT can name the same shape.
2259#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2260pub struct AdminSmtpConfig {
2261    /// What is stored. Empty strings and a `port` of 0 mean nothing has been saved for that field.
2262    pub kv: AdminSmtpConfigKv,
2263    /// What the environment supplies. `port` defaults to 465 when unset or unparseable.
2264    pub env: AdminSmtpConfigEnv,
2265    /// Which layer is in force, decided by the stored HOST alone: a saved host makes it `kv`,
2266    /// otherwise an environment host makes it `env`, otherwise `none`. Note the consequence —
2267    /// saving a user or a password WITHOUT a host leaves `source` at `env` and the stored fields
2268    /// inert.
2269    pub source: AdminSmtpConfigSource,
2270}
2271
2272/// What the environment supplies. `port` defaults to 465 when unset or unparseable.
2273#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2274pub struct AdminSmtpConfigEnv {
2275    #[serde(default, skip_serializing_if = "Option::is_none")]
2276    pub host: Option<String>,
2277    #[serde(default, skip_serializing_if = "Option::is_none")]
2278    pub port: Option<i64>,
2279    #[serde(default, skip_serializing_if = "Option::is_none")]
2280    pub user: Option<String>,
2281    #[serde(default, skip_serializing_if = "Option::is_none")]
2282    pub from: Option<String>,
2283    #[serde(default, skip_serializing_if = "Option::is_none")]
2284    pub from_name: Option<String>,
2285    /// Whether a credential is stored. The password itself is never returned by any read.
2286    #[serde(default, skip_serializing_if = "Option::is_none")]
2287    pub has_password: Option<bool>,
2288}
2289
2290/// What is stored. Empty strings and a `port` of 0 mean nothing has been saved for that field.
2291#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2292pub struct AdminSmtpConfigKv {
2293    #[serde(default, skip_serializing_if = "Option::is_none")]
2294    pub host: Option<String>,
2295    #[serde(default, skip_serializing_if = "Option::is_none")]
2296    pub port: Option<i64>,
2297    #[serde(default, skip_serializing_if = "Option::is_none")]
2298    pub user: Option<String>,
2299    #[serde(default, skip_serializing_if = "Option::is_none")]
2300    pub from: Option<String>,
2301    #[serde(default, skip_serializing_if = "Option::is_none")]
2302    pub from_name: Option<String>,
2303    /// Whether a credential is stored. The password itself is never returned by any read.
2304    #[serde(default, skip_serializing_if = "Option::is_none")]
2305    pub has_password: Option<bool>,
2306}
2307
2308/// Which layer is in force, decided by the stored HOST alone: a saved host makes it `kv`,
2309/// otherwise an environment host makes it `env`, otherwise `none`. Note the consequence —
2310/// saving a user or a password WITHOUT a host leaves `source` at `env` and the stored fields
2311/// inert.
2312#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2313pub enum AdminSmtpConfigSource {
2314    #[default]
2315    #[serde(rename = "kv")]
2316    Kv,
2317    #[serde(rename = "env")]
2318    Env,
2319    #[serde(rename = "none")]
2320    None,
2321    /// A value the API introduced after this SDK was generated.
2322    #[serde(untagged)]
2323    Other(String),
2324}
2325
2326impl AdminSmtpConfigSource {
2327    /// The value as it appears on the wire.
2328    pub fn as_str(&self) -> &str {
2329        match self {
2330            Self::Kv => "kv",
2331            Self::Env => "env",
2332            Self::None => "none",
2333            Self::Other(value) => value.as_str(),
2334        }
2335    }
2336}
2337
2338impl std::fmt::Display for AdminSmtpConfigSource {
2339    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2340        f.write_str(self.as_str())
2341    }
2342}
2343
2344impl From<&str> for AdminSmtpConfigSource {
2345    fn from(value: &str) -> Self {
2346        match value {
2347            "kv" => Self::Kv,
2348            "env" => Self::Env,
2349            "none" => Self::None,
2350            other => Self::Other(other.to_string()),
2351        }
2352    }
2353}
2354
2355/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z. Secrets are redacted to
2356/// their last four characters or empty (admin-config.ts getEffectiveStripeAdminConfig).
2357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2358pub struct AdminStripeConfig {
2359    pub stripe: AdminStripeConfigStripe,
2360    pub has_secret_key: bool,
2361    pub has_webhook_secret: bool,
2362}
2363
2364/// `AdminStripeConfigStripe` model.
2365#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2366pub struct AdminStripeConfigStripe {
2367    pub enabled: bool,
2368    pub mode: String,
2369    pub secret_key: String,
2370    pub webhook_secret: String,
2371    pub publishable_key: String,
2372    pub price_id_starter: String,
2373    pub price_id_pro: String,
2374    pub price_id_enterprise: String,
2375}
2376
2377/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z; provider/model → voice ids;
2378/// `defaults` is always empty, `effective` equals `override` (admin-config.ts
2379/// handleGetVoicePresets).
2380#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2381pub struct AdminVoicePresets {
2382    pub defaults: serde_json::Map<String, serde_json::Value>,
2383    pub r#override: HashMap<String, Vec<String>>,
2384    pub effective: HashMap<String, Vec<String>>,
2385}
2386
2387/// `Agent` model.
2388#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2389pub struct Agent {
2390    /// SPECs installed on this agent, with version pin and granted permissions.
2391    #[serde(default, skip_serializing_if = "Option::is_none")]
2392    pub specs: Option<Vec<AgentSpec>>,
2393    /// Tools this agent may call without a human-in-the-loop prompt.
2394    #[serde(default, skip_serializing_if = "Option::is_none")]
2395    pub auto_approve_tools: Option<Vec<String>>,
2396    /// Command hierarchy (MVP: opcon only).
2397    #[serde(default, skip_serializing_if = "Option::is_none")]
2398    pub command_relationships: Option<AgentCommandRelationships>,
2399    /// Security clearance and compartment access.
2400    #[serde(default, skip_serializing_if = "Option::is_none")]
2401    pub access_control: Option<AgentAccessControl>,
2402    /// Free-form caller-supplied metadata; `ui` is the one key with a shared, documented shape.
2403    #[serde(default, skip_serializing_if = "Option::is_none")]
2404    pub metadata: Option<AgentMetadata>,
2405    pub agent_id: String,
2406    pub tenant_id: String,
2407    pub name: String,
2408    #[serde(default, skip_serializing_if = "Option::is_none")]
2409    pub description: Option<String>,
2410    #[serde(default, skip_serializing_if = "Option::is_none")]
2411    pub version: Option<String>,
2412    pub model: AgentModelConfig,
2413    #[serde(default, skip_serializing_if = "Option::is_none")]
2414    pub prompts: Option<AgentPrompts>,
2415    #[serde(default, skip_serializing_if = "Option::is_none")]
2416    pub mcp: Option<serde_json::Map<String, serde_json::Value>>,
2417    #[serde(default, skip_serializing_if = "Option::is_none")]
2418    pub policies: Option<serde_json::Map<String, serde_json::Value>>,
2419    #[serde(default, skip_serializing_if = "Option::is_none")]
2420    pub thinking: Option<serde_json::Map<String, serde_json::Value>>,
2421    #[serde(default, skip_serializing_if = "Option::is_none")]
2422    pub effort_policy: Option<serde_json::Map<String, serde_json::Value>>,
2423    #[serde(default, skip_serializing_if = "Option::is_none")]
2424    pub resource_limits: Option<serde_json::Map<String, serde_json::Value>>,
2425    #[serde(default, skip_serializing_if = "Option::is_none")]
2426    pub memory: Option<serde_json::Map<String, serde_json::Value>>,
2427    #[serde(default, skip_serializing_if = "Option::is_none")]
2428    pub guardrails: Option<serde_json::Map<String, serde_json::Value>>,
2429    /// Tool names requiring human approval before execution
2430    #[serde(default, skip_serializing_if = "Option::is_none")]
2431    pub approval_required_tools: Option<Vec<String>>,
2432    /// Built-in tool names enabled for this agent
2433    #[serde(default, skip_serializing_if = "Option::is_none")]
2434    pub built_in_tools: Option<Vec<String>>,
2435    /// Image generation configuration
2436    #[serde(default, skip_serializing_if = "Option::is_none")]
2437    pub image_generation: Option<serde_json::Map<String, serde_json::Value>>,
2438    /// Deprecated in `packages/types/agent.ts:296`; kept for pre-migration records. Use
2439    /// `knowledge_base_ids`. Documenting only the singular is why a client reading this schema
2440    /// could link one base to an agent that supports several.
2441    #[serde(default, skip_serializing_if = "Option::is_none")]
2442    pub knowledge_base_id: Option<String>,
2443    /// Every knowledge base linked to the agent. `search_kb` searches all of them by default.
2444    #[serde(default, skip_serializing_if = "Option::is_none")]
2445    pub knowledge_base_ids: Option<Vec<String>>,
2446    /// Who can reach the agent. The publication screen is built on this field — but `public` alone
2447    /// does not open the agent to the world: the anonymous routes (`GET /public/agents/{agentId}`,
2448    /// public sessions) answer only when `visibility` is `public` AND `public_config.enabled` is
2449    /// true AND `status` is `active` (public.ts loadPublicAgent). A client that shows "anyone with
2450    /// the link can reach this agent" on `visibility` alone shows it a step too early. Measured
2451    /// 2026-09-10 on a real tenant: the one agent with both switches answered 200 without a key,
2452    /// every other `public` one 404.
2453    #[serde(default, skip_serializing_if = "Option::is_none")]
2454    pub visibility: Option<AgentUpdateVisibility>,
2455    /// Governance state, distinct from a run's status.
2456    #[serde(default, skip_serializing_if = "Option::is_none")]
2457    pub status: Option<AgentStatus>,
2458    #[serde(default, skip_serializing_if = "Option::is_none")]
2459    pub status_changed_at: Option<String>,
2460    /// Why the agent is in this status, as a sentence. One field with six writers — a person, an
2461    /// operator, four governance paths and a plan downgrade — so its language is whichever the
2462    /// writer used, and every reader sees that one. Branch on `status_reason_code`; render this.
2463    #[serde(default, skip_serializing_if = "Option::is_none")]
2464    pub status_reason: Option<String>,
2465    /// Who wrote `status_reason`. `manual` means the sentence is the caller's own and should be
2466    /// rendered as-is; the other five are the platform's English, and a client may say them in the
2467    /// reader's language using `status_reason_details` for the identifier. Added 2026-09-21.
2468    #[serde(default, skip_serializing_if = "Option::is_none")]
2469    pub status_reason_code: Option<AgentStatusReasonCode>,
2470    /// The identifier the platform's sentence quotes: `case_id`, `proposal_id`, `rule_id`. Absent
2471    /// for `manual`.
2472    #[serde(default, skip_serializing_if = "Option::is_none")]
2473    pub status_reason_details: Option<serde_json::Map<String, serde_json::Value>>,
2474    #[serde(default, skip_serializing_if = "Option::is_none")]
2475    pub autonomy: Option<AgentAutonomy>,
2476    /// Per-tool trust, overriding the agent's default approval policy.
2477    #[serde(default, skip_serializing_if = "Option::is_none")]
2478    pub tool_overrides: Option<Vec<AgentToolOverride>>,
2479    #[serde(default, skip_serializing_if = "Option::is_none")]
2480    pub public_config: Option<AgentPublicConfig>,
2481    /// Present only on `GET /agents/{id}`, and only for a bridge agent. Computed at read time from
2482    /// the machines currently registered, never stored on the record.
2483    #[serde(default, skip_serializing_if = "Option::is_none")]
2484    pub bridge: Option<AgentBridgeState>,
2485    /// Fallback model configuration
2486    #[serde(default, skip_serializing_if = "Option::is_none")]
2487    pub fallback_model: Option<serde_json::Map<String, serde_json::Value>>,
2488    #[serde(default, skip_serializing_if = "Option::is_none")]
2489    pub execution_mode: Option<AgentExecutionMode>,
2490    #[serde(default, skip_serializing_if = "Option::is_none")]
2491    pub worker_reuse: Option<bool>,
2492    /// Cron schedule configuration
2493    #[serde(default, skip_serializing_if = "Option::is_none")]
2494    pub schedule: Option<serde_json::Map<String, serde_json::Value>>,
2495    /// Agent-to-Agent protocol configuration
2496    #[serde(default, skip_serializing_if = "Option::is_none")]
2497    pub a2a: Option<serde_json::Map<String, serde_json::Value>>,
2498    /// EU AI Act risk classification
2499    #[serde(default, skip_serializing_if = "Option::is_none")]
2500    pub risk_classification: Option<serde_json::Map<String, serde_json::Value>>,
2501    /// Workspace this agent belongs to
2502    #[serde(default, skip_serializing_if = "Option::is_none")]
2503    pub workspace_id: Option<String>,
2504    #[serde(default, skip_serializing_if = "Option::is_none")]
2505    pub context_strategy: Option<AgentContextStrategy>,
2506    /// Number of recent MESSAGES to keep — not a token budget, and read only when
2507    /// `context_strategy` is `sliding_window`. Default 20. Under any other strategy it is ignored
2508    /// entirely.
2509    ///
2510    /// Said explicitly because the name reads like a token ceiling and was used as one: the Head
2511    /// Agent tier template set it to 65536/131072/262144 as if it capped context, and a client
2512    /// posted those values believing they sized the window. The window is the model's — see
2513    /// `model.capabilities.max_context_tokens` — and what bounds history per call is
2514    /// `resource_limits.max_tokens_per_run` together with the platform's history-budget ratio.
2515    #[serde(default, skip_serializing_if = "Option::is_none")]
2516    pub context_window_size: Option<i64>,
2517    pub created_at: String,
2518    #[serde(default, skip_serializing_if = "Option::is_none")]
2519    pub updated_at: Option<String>,
2520}
2521
2522/// Security clearance and compartment access.
2523#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2524pub struct AgentAccessControl {
2525    /// 0=public, 1=internal, 2=restricted, 3=confidential, 4=secret.
2526    pub clearance: i64,
2527    #[serde(default, skip_serializing_if = "Option::is_none")]
2528    pub compartments: Option<Vec<String>>,
2529    #[serde(default, skip_serializing_if = "Option::is_none")]
2530    pub caveats: Option<Vec<String>>,
2531}
2532
2533/// `AgentAnalyticsRow` model.
2534#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2535pub struct AgentAnalyticsRow {
2536    pub agent_id: String,
2537    pub tenant_id: String,
2538    pub name: String,
2539    pub execution_mode: AgentExecutionMode,
2540    pub status: String,
2541    /// Bridge agents only.
2542    #[serde(default, skip_serializing_if = "Option::is_none")]
2543    pub bridge_status: Option<AgentSummaryBridgeStatus>,
2544    /// Bridge agents only.
2545    #[serde(default, skip_serializing_if = "Option::is_none")]
2546    pub machine_count: Option<i64>,
2547    pub runs: i64,
2548    pub cost_usd: f64,
2549    pub tokens: i64,
2550}
2551
2552/// Output of summariseAgents (analytics.ts) — same shape for /admin/analytics/agents and
2553/// /analytics/agents (tenant-scoped).
2554#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2555pub struct AgentAnalyticsSummary {
2556    pub range: AgentAnalyticsSummaryRange,
2557    pub total: i64,
2558    #[serde(default, skip_serializing_if = "Option::is_none")]
2559    pub by_execution_mode: Option<AgentAnalyticsSummaryByExecutionMode>,
2560    #[serde(default, skip_serializing_if = "Option::is_none")]
2561    pub bridge: Option<AgentAnalyticsSummaryBridge>,
2562    #[serde(default, skip_serializing_if = "Option::is_none")]
2563    pub runs_total: Option<i64>,
2564    #[serde(default, skip_serializing_if = "Option::is_none")]
2565    pub cost_total_usd: Option<f64>,
2566    #[serde(default, skip_serializing_if = "Option::is_none")]
2567    pub tokens_total: Option<i64>,
2568    #[serde(default, skip_serializing_if = "Option::is_none")]
2569    pub top_by_runs: Option<Vec<AgentSummary>>,
2570    #[serde(default, skip_serializing_if = "Option::is_none")]
2571    pub top_by_cost: Option<Vec<AgentSummary>>,
2572    pub agents: Vec<AgentSummary>,
2573}
2574
2575/// `AgentAnalyticsSummaryBridge` model.
2576#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2577pub struct AgentAnalyticsSummaryBridge {
2578    #[serde(default, skip_serializing_if = "Option::is_none")]
2579    pub online: Option<i64>,
2580    #[serde(default, skip_serializing_if = "Option::is_none")]
2581    pub stale: Option<i64>,
2582    #[serde(default, skip_serializing_if = "Option::is_none")]
2583    pub offline: Option<i64>,
2584    #[serde(default, skip_serializing_if = "Option::is_none")]
2585    pub machines_total: Option<i64>,
2586}
2587
2588/// `AgentAnalyticsSummaryByExecutionMode` model.
2589#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2590pub struct AgentAnalyticsSummaryByExecutionMode {
2591    #[serde(default, skip_serializing_if = "Option::is_none")]
2592    pub cloud: Option<i64>,
2593    #[serde(default, skip_serializing_if = "Option::is_none")]
2594    pub bridge: Option<i64>,
2595}
2596
2597/// `AgentAnalyticsSummaryRange` model.
2598#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2599pub struct AgentAnalyticsSummaryRange {
2600    pub days: i64,
2601}
2602
2603/// `AgentAutonomy` model.
2604#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2605pub struct AgentAutonomy {
2606    pub level: AgentAutonomyLevel,
2607}
2608
2609/// `AgentAutonomyLevel` enumeration.
2610#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2611pub enum AgentAutonomyLevel {
2612    #[default]
2613    #[serde(rename = "manual")]
2614    Manual,
2615    #[serde(rename = "approve_risky")]
2616    ApproveRisky,
2617    #[serde(rename = "full_auto")]
2618    FullAuto,
2619    /// A value the API introduced after this SDK was generated.
2620    #[serde(untagged)]
2621    Other(String),
2622}
2623
2624impl AgentAutonomyLevel {
2625    /// The value as it appears on the wire.
2626    pub fn as_str(&self) -> &str {
2627        match self {
2628            Self::Manual => "manual",
2629            Self::ApproveRisky => "approve_risky",
2630            Self::FullAuto => "full_auto",
2631            Self::Other(value) => value.as_str(),
2632        }
2633    }
2634}
2635
2636impl std::fmt::Display for AgentAutonomyLevel {
2637    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2638        f.write_str(self.as_str())
2639    }
2640}
2641
2642impl From<&str> for AgentAutonomyLevel {
2643    fn from(value: &str) -> Self {
2644        match value {
2645            "manual" => Self::Manual,
2646            "approve_risky" => Self::ApproveRisky,
2647            "full_auto" => Self::FullAuto,
2648            other => Self::Other(other.to_string()),
2649        }
2650    }
2651}
2652
2653/// A message pinned under an agent. Keyed by `message_id`; the platform keeps the text the
2654/// client sent, it does not look the message up.
2655#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2656pub struct AgentBookmark {
2657    pub message_id: String,
2658    pub agent_id: String,
2659    pub tenant_id: String,
2660    pub kind: AgentBookmarkKind,
2661    pub content: String,
2662    #[serde(default, skip_serializing_if = "Option::is_none")]
2663    pub session_id: Option<String>,
2664    pub created_at: String,
2665}
2666
2667/// `AgentBookmarkKind` enumeration.
2668#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2669pub enum AgentBookmarkKind {
2670    #[default]
2671    #[serde(rename = "user")]
2672    User,
2673    #[serde(rename = "assistant")]
2674    Assistant,
2675    /// A value the API introduced after this SDK was generated.
2676    #[serde(untagged)]
2677    Other(String),
2678}
2679
2680impl AgentBookmarkKind {
2681    /// The value as it appears on the wire.
2682    pub fn as_str(&self) -> &str {
2683        match self {
2684            Self::User => "user",
2685            Self::Assistant => "assistant",
2686            Self::Other(value) => value.as_str(),
2687        }
2688    }
2689}
2690
2691impl std::fmt::Display for AgentBookmarkKind {
2692    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2693        f.write_str(self.as_str())
2694    }
2695}
2696
2697impl From<&str> for AgentBookmarkKind {
2698    fn from(value: &str) -> Self {
2699        match value {
2700            "user" => Self::User,
2701            "assistant" => Self::Assistant,
2702            other => Self::Other(other.to_string()),
2703        }
2704    }
2705}
2706
2707/// `AgentBridgeState` model.
2708#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2709pub struct AgentBridgeState {
2710    pub online_machines: i64,
2711    pub total_machines: i64,
2712    pub platforms: Vec<String>,
2713    pub working_directories: Vec<String>,
2714    pub machine_names: Vec<String>,
2715    pub latest_heartbeat: String,
2716    pub installed_specs: Vec<BridgeInstalledSpec>,
2717}
2718
2719/// What GET /agents/{agentId}/capabilities serves. Measured 2026-09-10 on the e2e-canon tenant;
2720/// `tools\[\]` and `kb_ids\[\]` were empty there, so their element shape is not asserted.
2721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2722pub struct AgentCapabilities {
2723    pub agent_id: String,
2724    pub skills: Vec<AgentCapabilitiesSkill>,
2725    pub constraints: AgentCapabilitiesConstraints,
2726    pub tools: Vec<String>,
2727    pub kb_ids: Vec<String>,
2728    pub updated_at: String,
2729}
2730
2731/// `AgentCapabilitiesConstraints` model.
2732#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2733pub struct AgentCapabilitiesConstraints {
2734    #[serde(default, skip_serializing_if = "Option::is_none")]
2735    pub max_context_tokens: Option<i64>,
2736    #[serde(default, skip_serializing_if = "Option::is_none")]
2737    pub rate_limit_rpm: Option<i64>,
2738    #[serde(default, skip_serializing_if = "Option::is_none")]
2739    pub supported_languages: Option<Vec<String>>,
2740}
2741
2742/// `AgentCapabilitiesSkill` model.
2743#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2744pub struct AgentCapabilitiesSkill {
2745    pub id: String,
2746    pub name: String,
2747    #[serde(default, skip_serializing_if = "Option::is_none")]
2748    pub description: Option<String>,
2749    #[serde(default, skip_serializing_if = "Option::is_none")]
2750    pub input_types: Option<Vec<String>>,
2751    #[serde(default, skip_serializing_if = "Option::is_none")]
2752    pub output_types: Option<Vec<String>>,
2753}
2754
2755/// Command hierarchy (MVP: opcon only).
2756#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2757pub struct AgentCommandRelationships {
2758    /// Agent ID holding operational control.
2759    #[serde(default, skip_serializing_if = "Option::is_none")]
2760    pub opcon: Option<String>,
2761    #[serde(default, skip_serializing_if = "Option::is_none")]
2762    pub coordinates_with: Option<Vec<String>>,
2763}
2764
2765/// `AgentContextStrategy` enumeration.
2766#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2767pub enum AgentContextStrategy {
2768    #[default]
2769    #[serde(rename = "compaction")]
2770    Compaction,
2771    #[serde(rename = "summarize")]
2772    Summarize,
2773    #[serde(rename = "truncate")]
2774    Truncate,
2775    #[serde(rename = "sliding_window")]
2776    SlidingWindow,
2777    /// A value the API introduced after this SDK was generated.
2778    #[serde(untagged)]
2779    Other(String),
2780}
2781
2782impl AgentContextStrategy {
2783    /// The value as it appears on the wire.
2784    pub fn as_str(&self) -> &str {
2785        match self {
2786            Self::Compaction => "compaction",
2787            Self::Summarize => "summarize",
2788            Self::Truncate => "truncate",
2789            Self::SlidingWindow => "sliding_window",
2790            Self::Other(value) => value.as_str(),
2791        }
2792    }
2793}
2794
2795impl std::fmt::Display for AgentContextStrategy {
2796    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2797        f.write_str(self.as_str())
2798    }
2799}
2800
2801impl From<&str> for AgentContextStrategy {
2802    fn from(value: &str) -> Self {
2803        match value {
2804            "compaction" => Self::Compaction,
2805            "summarize" => Self::Summarize,
2806            "truncate" => Self::Truncate,
2807            "sliding_window" => Self::SlidingWindow,
2808            other => Self::Other(other.to_string()),
2809        }
2810    }
2811}
2812
2813/// `AgentExecutionMode` enumeration.
2814#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2815pub enum AgentExecutionMode {
2816    #[default]
2817    #[serde(rename = "async")]
2818    Async,
2819    #[serde(rename = "worker")]
2820    Worker,
2821    #[serde(rename = "bridge")]
2822    Bridge,
2823    /// A value the API introduced after this SDK was generated.
2824    #[serde(untagged)]
2825    Other(String),
2826}
2827
2828impl AgentExecutionMode {
2829    /// The value as it appears on the wire.
2830    pub fn as_str(&self) -> &str {
2831        match self {
2832            Self::Async => "async",
2833            Self::Worker => "worker",
2834            Self::Bridge => "bridge",
2835            Self::Other(value) => value.as_str(),
2836        }
2837    }
2838}
2839
2840impl std::fmt::Display for AgentExecutionMode {
2841    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2842        f.write_str(self.as_str())
2843    }
2844}
2845
2846impl From<&str> for AgentExecutionMode {
2847    fn from(value: &str) -> Self {
2848        match value {
2849            "async" => Self::Async,
2850            "worker" => Self::Worker,
2851            "bridge" => Self::Bridge,
2852            other => Self::Other(other.to_string()),
2853        }
2854    }
2855}
2856
2857/// Agent-scoped integration (connection) instance
2858#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2859pub struct AgentIntegration {
2860    pub id: String,
2861    pub agent_id: String,
2862    #[serde(default, skip_serializing_if = "Option::is_none")]
2863    pub tenant_id: Option<String>,
2864    pub connector_id: String,
2865    pub name: String,
2866    pub status: IntegrationStatus,
2867    /// Redacted config (no secrets)
2868    #[serde(default, skip_serializing_if = "Option::is_none")]
2869    pub config: Option<serde_json::Map<String, serde_json::Value>>,
2870    #[serde(default, skip_serializing_if = "Option::is_none")]
2871    pub created_at: Option<String>,
2872    #[serde(default, skip_serializing_if = "Option::is_none")]
2873    pub updated_at: Option<String>,
2874}
2875
2876/// `AgentLineage` model.
2877#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2878pub struct AgentLineage {
2879    pub agent_id: String,
2880    /// Full chain from root to this agent.
2881    pub chain: Vec<String>,
2882    pub depth: i64,
2883    #[serde(default, skip_serializing_if = "Option::is_none")]
2884    pub parent_id: Option<String>,
2885    pub spawned_by: String,
2886    #[serde(default, skip_serializing_if = "Option::is_none")]
2887    pub spawned_at: Option<String>,
2888}
2889
2890/// One message between two agents.
2891#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2892pub struct AgentMessage {
2893    pub message_id: String,
2894    pub thread_id: String,
2895    pub from_agent_id: String,
2896    pub to_agent_id: String,
2897    pub message: String,
2898    pub created_at: String,
2899    /// Integrity signature, when the message carries one.
2900    #[serde(default, skip_serializing_if = "Option::is_none")]
2901    pub signature: Option<String>,
2902    /// Communications precedence; absent means routine.
2903    #[serde(default, skip_serializing_if = "Option::is_none")]
2904    pub precedence: Option<AgentMessagePrecedence>,
2905}
2906
2907/// Communications precedence; absent means routine.
2908#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
2909pub enum AgentMessagePrecedence {
2910    #[default]
2911    #[serde(rename = "flash")]
2912    Flash,
2913    #[serde(rename = "immediate")]
2914    Immediate,
2915    #[serde(rename = "priority")]
2916    Priority,
2917    #[serde(rename = "routine")]
2918    Routine,
2919    /// A value the API introduced after this SDK was generated.
2920    #[serde(untagged)]
2921    Other(String),
2922}
2923
2924impl AgentMessagePrecedence {
2925    /// The value as it appears on the wire.
2926    pub fn as_str(&self) -> &str {
2927        match self {
2928            Self::Flash => "flash",
2929            Self::Immediate => "immediate",
2930            Self::Priority => "priority",
2931            Self::Routine => "routine",
2932            Self::Other(value) => value.as_str(),
2933        }
2934    }
2935}
2936
2937impl std::fmt::Display for AgentMessagePrecedence {
2938    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2939        f.write_str(self.as_str())
2940    }
2941}
2942
2943impl From<&str> for AgentMessagePrecedence {
2944    fn from(value: &str) -> Self {
2945        match value {
2946            "flash" => Self::Flash,
2947            "immediate" => Self::Immediate,
2948            "priority" => Self::Priority,
2949            "routine" => Self::Routine,
2950            other => Self::Other(other.to_string()),
2951        }
2952    }
2953}
2954
2955/// Free-form caller-supplied metadata; `ui` is the one key with a shared, documented shape.
2956#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2957pub struct AgentMetadata {
2958    #[serde(default, skip_serializing_if = "Option::is_none")]
2959    pub ui: Option<AgentMetadataUi>,
2960    /// Any additional properties the server returned.
2961    #[serde(flatten)]
2962    pub extra: HashMap<String, serde_json::Value>,
2963}
2964
2965/// The `metadata.ui` record three clients and the platform share. PATCH merges it one level,
2966/// and `avatar` one level deeper: a client that sends `{protocol, variant}` keeps the stored
2967/// `hue`, one that sends `{hue}` keeps `protocol` and `variant` (agent-genome.ts
2968/// mergeAgentMetadata; owner 2026-09-10).
2969#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2970pub struct AgentMetadataUi {
2971    /// Identity: which drawing protocol, which variant, and the hue (degrees). Merged field by
2972    /// field on PATCH.
2973    #[serde(default, skip_serializing_if = "Option::is_none")]
2974    pub avatar: Option<AgentMetadataUiAvatar>,
2975    #[serde(default, skip_serializing_if = "Option::is_none")]
2976    pub drop_genome: Option<DropGenome>,
2977    /// Provenance of the FIRST server-written genome — set only by the platform (ensureAgentGenome
2978    /// / the create path), never by a client, and left untouched by client PATCHes of
2979    /// `drop_genome`. Absent when the genome was client-authored or predates the field.
2980    #[serde(default, skip_serializing_if = "Option::is_none")]
2981    pub drop_genome_source: Option<AgentMetadataUiDropGenomeSource>,
2982}
2983
2984/// Identity: which drawing protocol, which variant, and the hue (degrees). Merged field by
2985/// field on PATCH.
2986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2987pub struct AgentMetadataUiAvatar {
2988    #[serde(default, skip_serializing_if = "Option::is_none")]
2989    pub protocol: Option<String>,
2990    #[serde(default, skip_serializing_if = "Option::is_none")]
2991    pub variant: Option<i64>,
2992    #[serde(default, skip_serializing_if = "Option::is_none")]
2993    pub hue: Option<f64>,
2994}
2995
2996/// Provenance of the FIRST server-written genome — set only by the platform (ensureAgentGenome
2997/// / the create path), never by a client, and left untouched by client PATCHes of
2998/// `drop_genome`. Absent when the genome was client-authored or predates the field.
2999#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3000pub enum AgentMetadataUiDropGenomeSource {
3001    #[default]
3002    #[serde(rename = "llm")]
3003    LLM,
3004    #[serde(rename = "fallback")]
3005    Fallback,
3006    /// A value the API introduced after this SDK was generated.
3007    #[serde(untagged)]
3008    Other(String),
3009}
3010
3011impl AgentMetadataUiDropGenomeSource {
3012    /// The value as it appears on the wire.
3013    pub fn as_str(&self) -> &str {
3014        match self {
3015            Self::LLM => "llm",
3016            Self::Fallback => "fallback",
3017            Self::Other(value) => value.as_str(),
3018        }
3019    }
3020}
3021
3022impl std::fmt::Display for AgentMetadataUiDropGenomeSource {
3023    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3024        f.write_str(self.as_str())
3025    }
3026}
3027
3028impl From<&str> for AgentMetadataUiDropGenomeSource {
3029    fn from(value: &str) -> Self {
3030        match value {
3031            "llm" => Self::LLM,
3032            "fallback" => Self::Fallback,
3033            other => Self::Other(other.to_string()),
3034        }
3035    }
3036}
3037
3038/// Model capabilities. Deliberately carries no provider or model identifier — see the model
3039/// lockdown.
3040#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3041pub struct AgentModelConfig {
3042    /// Feature flags the client may branch on (e.g. `vision`, `tool_calls`, `streaming`). Absent
3043    /// when the platform has published none.
3044    #[serde(default, skip_serializing_if = "Option::is_none")]
3045    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
3046}
3047
3048/// Accepted and IGNORED. The platform default is applied on create and preserved on update, so
3049/// sending this changes nothing. Kept so existing clients do not start failing validation.
3050#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3051pub struct AgentModelConfigInput {
3052    #[serde(default, skip_serializing_if = "Option::is_none")]
3053    pub provider: Option<String>,
3054    #[serde(default, skip_serializing_if = "Option::is_none")]
3055    pub model_ref: Option<String>,
3056    #[serde(default, skip_serializing_if = "Option::is_none")]
3057    pub endpoint_url: Option<String>,
3058    #[serde(default, skip_serializing_if = "Option::is_none")]
3059    pub api_key_ref: Option<String>,
3060    #[serde(default, skip_serializing_if = "Option::is_none")]
3061    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
3062}
3063
3064/// `AgentPrompts` model.
3065#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3066pub struct AgentPrompts {
3067    #[serde(default, skip_serializing_if = "Option::is_none")]
3068    pub system: Option<String>,
3069    #[serde(default, skip_serializing_if = "Option::is_none")]
3070    pub developer: Option<String>,
3071}
3072
3073/// `AgentPublicConfig` model.
3074#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3075pub struct AgentPublicConfig {
3076    /// One of the three switches that make the agent reachable without a key (public.ts
3077    /// loadPublicAgent): `visibility` must be `public`, this must be true, and `status` must be
3078    /// `active` (or absent). Any one of them alone does nothing visible.
3079    pub enabled: bool,
3080    #[serde(default, skip_serializing_if = "Option::is_none")]
3081    pub system_prompt: Option<String>,
3082    #[serde(default, skip_serializing_if = "Option::is_none")]
3083    pub greeting: Option<String>,
3084    #[serde(default, skip_serializing_if = "Option::is_none")]
3085    pub allowed_tools: Option<Vec<String>>,
3086    #[serde(default, skip_serializing_if = "Option::is_none")]
3087    pub max_messages_per_session: Option<i64>,
3088    #[serde(default, skip_serializing_if = "Option::is_none")]
3089    pub max_concurrent_sessions: Option<i64>,
3090    #[serde(default, skip_serializing_if = "Option::is_none")]
3091    pub rate_limit_sessions_per_ip: Option<i64>,
3092    #[serde(default, skip_serializing_if = "Option::is_none")]
3093    pub rate_limit_messages_per_min: Option<i64>,
3094    /// Messages per UTC day per visitor identity (a hash of IP + anonymous visitor id). Enforced
3095    /// ONLY for the featured landing agent — the one `GET /admin/config/landing` names as
3096    /// `public_agent_id`; every other public agent keeps its per-session caps and ignores this.
3097    /// Over the cap the server answers 429 with `code: "DAILY_LIMIT"`. Unset means the platform
3098    /// default of 15.
3099    #[serde(default, skip_serializing_if = "Option::is_none")]
3100    pub daily_message_limit: Option<i64>,
3101}
3102
3103/// The stored schedule configuration (AgentScheduleConfig in @uarp/scheduler).
3104#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3105pub struct AgentScheduleConfig {
3106    pub cron: String,
3107    pub enabled: bool,
3108    /// IANA zone; `UTC` when not given.
3109    pub timezone: String,
3110    pub input: serde_json::Map<String, serde_json::Value>,
3111    pub max_concurrent_scheduled: i64,
3112    pub on_failure: AgentScheduleConfigOnFailure,
3113    #[serde(default, skip_serializing_if = "Option::is_none")]
3114    pub autonomous_mode: Option<bool>,
3115    #[serde(default, skip_serializing_if = "Option::is_none")]
3116    pub reflection_prompt: Option<String>,
3117}
3118
3119/// `AgentScheduleConfigOnFailure` enumeration.
3120#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3121pub enum AgentScheduleConfigOnFailure {
3122    #[default]
3123    #[serde(rename = "retry_next")]
3124    RetryNext,
3125    #[serde(rename = "pause_schedule")]
3126    PauseSchedule,
3127    #[serde(rename = "notify")]
3128    Notify,
3129    /// A value the API introduced after this SDK was generated.
3130    #[serde(untagged)]
3131    Other(String),
3132}
3133
3134impl AgentScheduleConfigOnFailure {
3135    /// The value as it appears on the wire.
3136    pub fn as_str(&self) -> &str {
3137        match self {
3138            Self::RetryNext => "retry_next",
3139            Self::PauseSchedule => "pause_schedule",
3140            Self::Notify => "notify",
3141            Self::Other(value) => value.as_str(),
3142        }
3143    }
3144}
3145
3146impl std::fmt::Display for AgentScheduleConfigOnFailure {
3147    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3148        f.write_str(self.as_str())
3149    }
3150}
3151
3152impl From<&str> for AgentScheduleConfigOnFailure {
3153    fn from(value: &str) -> Self {
3154        match value {
3155            "retry_next" => Self::RetryNext,
3156            "pause_schedule" => Self::PauseSchedule,
3157            "notify" => Self::Notify,
3158            other => Self::Other(other.to_string()),
3159        }
3160    }
3161}
3162
3163/// `AgentScorer` model.
3164#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3165pub struct AgentScorer {
3166    pub scorer_id: String,
3167    pub agent_id: String,
3168    pub tenant_id: String,
3169    pub name: String,
3170    pub config: AgentScorerConfig,
3171    pub created_at: String,
3172}
3173
3174/// `AgentScorerConfig` model.
3175#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3176pub struct AgentScorerConfig {
3177    pub r#type: AgentScorerConfigType,
3178    pub url: String,
3179    #[serde(default, skip_serializing_if = "Option::is_none")]
3180    pub timeout_ms: Option<i64>,
3181    /// Any additional properties the server returned.
3182    #[serde(flatten)]
3183    pub extra: HashMap<String, serde_json::Value>,
3184}
3185
3186/// `AgentScorerConfigType` enumeration.
3187#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3188pub enum AgentScorerConfigType {
3189    #[default]
3190    #[serde(rename = "webhook")]
3191    Webhook,
3192    /// A value the API introduced after this SDK was generated.
3193    #[serde(untagged)]
3194    Other(String),
3195}
3196
3197impl AgentScorerConfigType {
3198    /// The value as it appears on the wire.
3199    pub fn as_str(&self) -> &str {
3200        match self {
3201            Self::Webhook => "webhook",
3202            Self::Other(value) => value.as_str(),
3203        }
3204    }
3205}
3206
3207impl std::fmt::Display for AgentScorerConfigType {
3208    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3209        f.write_str(self.as_str())
3210    }
3211}
3212
3213impl From<&str> for AgentScorerConfigType {
3214    fn from(value: &str) -> Self {
3215        match value {
3216            "webhook" => Self::Webhook,
3217            other => Self::Other(other.to_string()),
3218        }
3219    }
3220}
3221
3222/// `AgentSpec` model.
3223#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3224pub struct AgentSpec {
3225    pub spec_id: String,
3226    #[serde(default, skip_serializing_if = "Option::is_none")]
3227    pub version: Option<String>,
3228    /// Soft-disable. false keeps the install history but skips injection.
3229    #[serde(default, skip_serializing_if = "Option::is_none")]
3230    pub enabled: Option<bool>,
3231    #[serde(default, skip_serializing_if = "Option::is_none")]
3232    pub permissions_granted: Option<Vec<AgentSpecPermissionsGrantedItem>>,
3233}
3234
3235/// `AgentSpecPermissionsGrantedItem` model.
3236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3237pub struct AgentSpecPermissionsGrantedItem {
3238    pub cap: String,
3239    #[serde(default, skip_serializing_if = "Option::is_none")]
3240    pub scope: Option<String>,
3241    #[serde(default, skip_serializing_if = "Option::is_none")]
3242    pub reason: Option<String>,
3243    pub granted_by: AgentSpecPermissionsGrantedItemGrantedBy,
3244    pub granted_at: String,
3245}
3246
3247/// `AgentSpecPermissionsGrantedItemGrantedBy` enumeration.
3248#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3249pub enum AgentSpecPermissionsGrantedItemGrantedBy {
3250    #[default]
3251    #[serde(rename = "wizard")]
3252    Wizard,
3253    #[serde(rename = "admin")]
3254    Admin,
3255    #[serde(rename = "bootstrap")]
3256    Bootstrap,
3257    #[serde(rename = "migrated")]
3258    Migrated,
3259    /// A value the API introduced after this SDK was generated.
3260    #[serde(untagged)]
3261    Other(String),
3262}
3263
3264impl AgentSpecPermissionsGrantedItemGrantedBy {
3265    /// The value as it appears on the wire.
3266    pub fn as_str(&self) -> &str {
3267        match self {
3268            Self::Wizard => "wizard",
3269            Self::Admin => "admin",
3270            Self::Bootstrap => "bootstrap",
3271            Self::Migrated => "migrated",
3272            Self::Other(value) => value.as_str(),
3273        }
3274    }
3275}
3276
3277impl std::fmt::Display for AgentSpecPermissionsGrantedItemGrantedBy {
3278    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3279        f.write_str(self.as_str())
3280    }
3281}
3282
3283impl From<&str> for AgentSpecPermissionsGrantedItemGrantedBy {
3284    fn from(value: &str) -> Self {
3285        match value {
3286            "wizard" => Self::Wizard,
3287            "admin" => Self::Admin,
3288            "bootstrap" => Self::Bootstrap,
3289            "migrated" => Self::Migrated,
3290            other => Self::Other(other.to_string()),
3291        }
3292    }
3293}
3294
3295/// Governance state, distinct from a run's status.
3296#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3297pub enum AgentStatus {
3298    #[default]
3299    #[serde(rename = "active")]
3300    Active,
3301    #[serde(rename = "suspended")]
3302    Suspended,
3303    #[serde(rename = "terminated")]
3304    Terminated,
3305    #[serde(rename = "deposed")]
3306    Deposed,
3307    /// A value the API introduced after this SDK was generated.
3308    #[serde(untagged)]
3309    Other(String),
3310}
3311
3312impl AgentStatus {
3313    /// The value as it appears on the wire.
3314    pub fn as_str(&self) -> &str {
3315        match self {
3316            Self::Active => "active",
3317            Self::Suspended => "suspended",
3318            Self::Terminated => "terminated",
3319            Self::Deposed => "deposed",
3320            Self::Other(value) => value.as_str(),
3321        }
3322    }
3323}
3324
3325impl std::fmt::Display for AgentStatus {
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 AgentStatus {
3332    fn from(value: &str) -> Self {
3333        match value {
3334            "active" => Self::Active,
3335            "suspended" => Self::Suspended,
3336            "terminated" => Self::Terminated,
3337            "deposed" => Self::Deposed,
3338            other => Self::Other(other.to_string()),
3339        }
3340    }
3341}
3342
3343/// Who wrote `status_reason`. `manual` means the sentence is the caller's own and should be
3344/// rendered as-is; the other five are the platform's English, and a client may say them in the
3345/// reader's language using `status_reason_details` for the identifier. Added 2026-09-21.
3346#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3347pub enum AgentStatusReasonCode {
3348    #[default]
3349    #[serde(rename = "manual")]
3350    Manual,
3351    #[serde(rename = "proposal_passed")]
3352    ProposalPassed,
3353    #[serde(rename = "arbiter_ruling")]
3354    ArbiterRuling,
3355    #[serde(rename = "arbiter_penalty")]
3356    ArbiterPenalty,
3357    #[serde(rename = "constitutional_penalty")]
3358    ConstitutionalPenalty,
3359    #[serde(rename = "plan_downgrade")]
3360    PlanDowngrade,
3361    /// A value the API introduced after this SDK was generated.
3362    #[serde(untagged)]
3363    Other(String),
3364}
3365
3366impl AgentStatusReasonCode {
3367    /// The value as it appears on the wire.
3368    pub fn as_str(&self) -> &str {
3369        match self {
3370            Self::Manual => "manual",
3371            Self::ProposalPassed => "proposal_passed",
3372            Self::ArbiterRuling => "arbiter_ruling",
3373            Self::ArbiterPenalty => "arbiter_penalty",
3374            Self::ConstitutionalPenalty => "constitutional_penalty",
3375            Self::PlanDowngrade => "plan_downgrade",
3376            Self::Other(value) => value.as_str(),
3377        }
3378    }
3379}
3380
3381impl std::fmt::Display for AgentStatusReasonCode {
3382    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3383        f.write_str(self.as_str())
3384    }
3385}
3386
3387impl From<&str> for AgentStatusReasonCode {
3388    fn from(value: &str) -> Self {
3389        match value {
3390            "manual" => Self::Manual,
3391            "proposal_passed" => Self::ProposalPassed,
3392            "arbiter_ruling" => Self::ArbiterRuling,
3393            "arbiter_penalty" => Self::ArbiterPenalty,
3394            "constitutional_penalty" => Self::ConstitutionalPenalty,
3395            "plan_downgrade" => Self::PlanDowngrade,
3396            other => Self::Other(other.to_string()),
3397        }
3398    }
3399}
3400
3401/// `AgentSummary` model.
3402#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3403pub struct AgentSummary {
3404    pub agent_id: String,
3405    pub tenant_id: String,
3406    pub name: String,
3407    pub execution_mode: AgentSummaryExecutionMode,
3408    pub status: String,
3409    #[serde(default, skip_serializing_if = "Option::is_none")]
3410    pub bridge_status: Option<AgentSummaryBridgeStatus>,
3411    #[serde(default, skip_serializing_if = "Option::is_none")]
3412    pub machine_count: Option<i64>,
3413    #[serde(default, skip_serializing_if = "Option::is_none")]
3414    pub runs: Option<i64>,
3415    #[serde(default, skip_serializing_if = "Option::is_none")]
3416    pub cost_usd: Option<f64>,
3417    #[serde(default, skip_serializing_if = "Option::is_none")]
3418    pub tokens: Option<i64>,
3419}
3420
3421/// `AgentSummaryBridgeStatus` enumeration.
3422#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3423pub enum AgentSummaryBridgeStatus {
3424    #[default]
3425    #[serde(rename = "online")]
3426    Online,
3427    #[serde(rename = "stale")]
3428    Stale,
3429    #[serde(rename = "offline")]
3430    Offline,
3431    /// A value the API introduced after this SDK was generated.
3432    #[serde(untagged)]
3433    Other(String),
3434}
3435
3436impl AgentSummaryBridgeStatus {
3437    /// The value as it appears on the wire.
3438    pub fn as_str(&self) -> &str {
3439        match self {
3440            Self::Online => "online",
3441            Self::Stale => "stale",
3442            Self::Offline => "offline",
3443            Self::Other(value) => value.as_str(),
3444        }
3445    }
3446}
3447
3448impl std::fmt::Display for AgentSummaryBridgeStatus {
3449    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3450        f.write_str(self.as_str())
3451    }
3452}
3453
3454impl From<&str> for AgentSummaryBridgeStatus {
3455    fn from(value: &str) -> Self {
3456        match value {
3457            "online" => Self::Online,
3458            "stale" => Self::Stale,
3459            "offline" => Self::Offline,
3460            other => Self::Other(other.to_string()),
3461        }
3462    }
3463}
3464
3465/// `AgentSummaryExecutionMode` enumeration.
3466#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3467pub enum AgentSummaryExecutionMode {
3468    #[default]
3469    #[serde(rename = "async")]
3470    Async,
3471    #[serde(rename = "worker")]
3472    Worker,
3473    #[serde(rename = "bridge")]
3474    Bridge,
3475    #[serde(rename = "cloud")]
3476    Cloud,
3477    /// A value the API introduced after this SDK was generated.
3478    #[serde(untagged)]
3479    Other(String),
3480}
3481
3482impl AgentSummaryExecutionMode {
3483    /// The value as it appears on the wire.
3484    pub fn as_str(&self) -> &str {
3485        match self {
3486            Self::Async => "async",
3487            Self::Worker => "worker",
3488            Self::Bridge => "bridge",
3489            Self::Cloud => "cloud",
3490            Self::Other(value) => value.as_str(),
3491        }
3492    }
3493}
3494
3495impl std::fmt::Display for AgentSummaryExecutionMode {
3496    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3497        f.write_str(self.as_str())
3498    }
3499}
3500
3501impl From<&str> for AgentSummaryExecutionMode {
3502    fn from(value: &str) -> Self {
3503        match value {
3504            "async" => Self::Async,
3505            "worker" => Self::Worker,
3506            "bridge" => Self::Bridge,
3507            "cloud" => Self::Cloud,
3508            other => Self::Other(other.to_string()),
3509        }
3510    }
3511}
3512
3513/// `AgentToolOverride` model.
3514#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3515pub struct AgentToolOverride {
3516    pub tool_name: String,
3517    pub trust_level: AgentToolOverrideTrustLevel,
3518}
3519
3520/// `AgentToolOverrideTrustLevel` enumeration.
3521#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3522pub enum AgentToolOverrideTrustLevel {
3523    #[default]
3524    #[serde(rename = "always_allow")]
3525    AlwaysAllow,
3526    #[serde(rename = "ask_first")]
3527    AskFirst,
3528    #[serde(rename = "never_allow")]
3529    NeverAllow,
3530    /// A value the API introduced after this SDK was generated.
3531    #[serde(untagged)]
3532    Other(String),
3533}
3534
3535impl AgentToolOverrideTrustLevel {
3536    /// The value as it appears on the wire.
3537    pub fn as_str(&self) -> &str {
3538        match self {
3539            Self::AlwaysAllow => "always_allow",
3540            Self::AskFirst => "ask_first",
3541            Self::NeverAllow => "never_allow",
3542            Self::Other(value) => value.as_str(),
3543        }
3544    }
3545}
3546
3547impl std::fmt::Display for AgentToolOverrideTrustLevel {
3548    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3549        f.write_str(self.as_str())
3550    }
3551}
3552
3553impl From<&str> for AgentToolOverrideTrustLevel {
3554    fn from(value: &str) -> Self {
3555        match value {
3556            "always_allow" => Self::AlwaysAllow,
3557            "ask_first" => Self::AskFirst,
3558            "never_allow" => Self::NeverAllow,
3559            other => Self::Other(other.to_string()),
3560        }
3561    }
3562}
3563
3564/// `AgentToolOverrideUpdate` model.
3565#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3566pub struct AgentToolOverrideUpdate {
3567    pub tool_name: String,
3568    pub trust_level: AgentToolOverrideTrustLevel,
3569}
3570
3571/// Body for `PUT /api/v1/agents/{agentId}`. Every field optional — an omitted field means NO
3572/// CHANGE, not 'clear it'. `model` and `fallback_model` are accepted and ignored (see the model
3573/// lockdown).
3574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3575pub struct AgentUpdate {
3576    #[serde(default, skip_serializing_if = "Option::is_none")]
3577    pub name: Option<String>,
3578    #[serde(default, skip_serializing_if = "Option::is_none")]
3579    pub description: Option<String>,
3580    /// `prompts.system` is accepted and IGNORED: the per-agent system prompt is managed by the Head
3581    /// Agent (system prompt lockdown, 2026-08-04). A new agent stores a neutral default; an update
3582    /// keeps the stored prompt. `prompts.developer` is stored. For the prompt a public chat uses,
3583    /// set `public_config.system_prompt`.
3584    #[serde(default, skip_serializing_if = "Option::is_none")]
3585    pub prompts: Option<serde_json::Map<String, serde_json::Value>>,
3586    #[serde(default, skip_serializing_if = "Option::is_none")]
3587    pub model: Option<AgentModelConfigInput>,
3588    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
3589    /// leaves the agent with exactly that one — read the current value and send the full set. The
3590    /// incoming list is normalised and persisted whole; the previous list is consulted only to keep
3591    /// permission-grant timestamps stable for SPECs that were already installed.
3592    #[serde(default, skip_serializing_if = "Option::is_none")]
3593    pub specs: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
3594    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
3595    /// leaves the agent with exactly that one — read the current value and send the full set. 
3596    #[serde(default, skip_serializing_if = "Option::is_none")]
3597    pub approval_required_tools: Option<Vec<String>>,
3598    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
3599    /// leaves the agent with exactly that one — read the current value and send the full set. 
3600    #[serde(default, skip_serializing_if = "Option::is_none")]
3601    pub auto_approve_tools: Option<Vec<String>>,
3602    #[serde(default, skip_serializing_if = "Option::is_none")]
3603    pub knowledge_base_id: Option<String>,
3604    /// Sending this field REPLACES the stored list; it is not merged. A PATCH carrying one id
3605    /// leaves the agent with exactly that one — read the current value and send the full set. Note
3606    /// the legacy singular `knowledge_base_id` is UNIONED with this array within the same request —
3607    /// the server-side helper is named `mergeKbIds` for that reason, and merges the two REQUEST
3608    /// fields, never the request with what is stored.
3609    #[serde(default, skip_serializing_if = "Option::is_none")]
3610    pub knowledge_base_ids: Option<Vec<String>>,
3611    #[serde(default, skip_serializing_if = "Option::is_none")]
3612    pub workspace_id: Option<String>,
3613    #[serde(default, skip_serializing_if = "Option::is_none")]
3614    pub visibility: Option<AgentUpdateVisibility>,
3615    /// Partial: the handler merges it one level over the stored `public_config` (agents.ts, `{
3616    /// ...existing.public_config, ...body.public_config }`), so `{ public_config: { enabled: true }
3617    /// }` flips the switch and keeps the greeting, limits and allowed tools. Sending `enabled`
3618    /// alone does not make the agent reachable — see `Agent.visibility`.
3619    #[serde(default, skip_serializing_if = "Option::is_none")]
3620    pub public_config: Option<AgentUpdatePublicConfig>,
3621}
3622
3623/// Partial: the handler merges it one level over the stored `public_config` (agents.ts, `{
3624/// ...existing.public_config, ...body.public_config }`), so `{ public_config: { enabled: true }
3625/// }` flips the switch and keeps the greeting, limits and allowed tools. Sending `enabled`
3626/// alone does not make the agent reachable — see `Agent.visibility`.
3627#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3628pub struct AgentUpdatePublicConfig {
3629    /// One of the three switches that make the agent reachable without a key (public.ts
3630    /// loadPublicAgent): `visibility` must be `public`, this must be true, and `status` must be
3631    /// `active` (or absent). Any one of them alone does nothing visible.
3632    pub enabled: bool,
3633    #[serde(default, skip_serializing_if = "Option::is_none")]
3634    pub system_prompt: Option<String>,
3635    #[serde(default, skip_serializing_if = "Option::is_none")]
3636    pub greeting: Option<String>,
3637    #[serde(default, skip_serializing_if = "Option::is_none")]
3638    pub allowed_tools: Option<Vec<String>>,
3639    #[serde(default, skip_serializing_if = "Option::is_none")]
3640    pub max_messages_per_session: Option<i64>,
3641    #[serde(default, skip_serializing_if = "Option::is_none")]
3642    pub max_concurrent_sessions: Option<i64>,
3643    #[serde(default, skip_serializing_if = "Option::is_none")]
3644    pub rate_limit_sessions_per_ip: Option<i64>,
3645    #[serde(default, skip_serializing_if = "Option::is_none")]
3646    pub rate_limit_messages_per_min: Option<i64>,
3647    /// Messages per UTC day per visitor identity (a hash of IP + anonymous visitor id). Enforced
3648    /// ONLY for the featured landing agent — the one `GET /admin/config/landing` names as
3649    /// `public_agent_id`; every other public agent keeps its per-session caps and ignores this.
3650    /// Over the cap the server answers 429 with `code: "DAILY_LIMIT"`. Unset means the platform
3651    /// default of 15.
3652    #[serde(default, skip_serializing_if = "Option::is_none")]
3653    pub daily_message_limit: Option<i64>,
3654}
3655
3656/// `AgentUpdateVisibility` enumeration.
3657#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3658pub enum AgentUpdateVisibility {
3659    #[default]
3660    #[serde(rename = "private")]
3661    Private,
3662    #[serde(rename = "team")]
3663    Team,
3664    #[serde(rename = "public")]
3665    Public,
3666    /// A value the API introduced after this SDK was generated.
3667    #[serde(untagged)]
3668    Other(String),
3669}
3670
3671impl AgentUpdateVisibility {
3672    /// The value as it appears on the wire.
3673    pub fn as_str(&self) -> &str {
3674        match self {
3675            Self::Private => "private",
3676            Self::Team => "team",
3677            Self::Public => "public",
3678            Self::Other(value) => value.as_str(),
3679        }
3680    }
3681}
3682
3683impl std::fmt::Display for AgentUpdateVisibility {
3684    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3685        f.write_str(self.as_str())
3686    }
3687}
3688
3689impl From<&str> for AgentUpdateVisibility {
3690    fn from(value: &str) -> Self {
3691        match value {
3692            "private" => Self::Private,
3693            "team" => Self::Team,
3694            "public" => Self::Public,
3695            other => Self::Other(other.to_string()),
3696        }
3697    }
3698}
3699
3700/// `AgentVersion` model.
3701#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3702pub struct AgentVersion {
3703    pub version_id: String,
3704    pub agent_id: String,
3705    #[serde(default, skip_serializing_if = "Option::is_none")]
3706    pub tenant_id: Option<String>,
3707    pub version: i64,
3708    /// Free text when a client sent one with POST /agents/{agentId}/versions. The SERVER writes
3709    /// these fixed values of its own on the versions it mints — known values a client may match on,
3710    /// and therefore part of the contract (a test keeps this list equal to the literals in the
3711    /// code): `Initial version`, `Initial version (auto-created)`, `Initial version (created by
3712    /// agent factory)`, `Auto-versioned before update`, `Auto-versioned after update`,
3713    /// `Auto-versioned after update (retry)`, `Updated by agent factory`, `Head Agent orchestration
3714    /// kernel installed (agent-factory + discovery)`, `Head Agent orchestration kernel back-filled
3715    /// (agent-factory + discovery)`, `Head Agent promoted`, `Head Agent system prompt synced to
3716    /// canonical`, `Head Agent system prompt restored from backup`, `Tier SPECs synced`, `Model
3717    /// provider healed to the platform default`, `Core memory enabled`, `Tool trust override
3718    /// updated`, `Platform agent provisioned`, `Platform agent config migrated on boot`, `Rollback
3719    /// to version N` (N = the version rolled back to), `Self-improvement: N changes based on N
3720    /// analysis` (the self-improvement loop: the first N is a count, the second is one of errors,
3721    /// ratings or feedback — words, not a number). A reason code beside the prose is the owner's
3722    /// decision (DEC 11).
3723    #[serde(default, skip_serializing_if = "Option::is_none")]
3724    pub changelog: Option<String>,
3725    pub created_at: String,
3726    #[serde(default, skip_serializing_if = "Option::is_none")]
3727    pub created_by: Option<String>,
3728    /// The full agent configuration as it stood at this version. Shape follows `Agent`; not pinned
3729    /// here so the two cannot drift.
3730    #[serde(default, skip_serializing_if = "Option::is_none")]
3731    pub config: Option<serde_json::Map<String, serde_json::Value>>,
3732}
3733
3734/// `AiSystemCard` model.
3735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3736pub struct AiSystemCard {
3737    pub system_name: String,
3738    pub provider: String,
3739    pub version: String,
3740    #[serde(default, skip_serializing_if = "Option::is_none")]
3741    pub risk_classification: Option<RiskClassification>,
3742    pub intended_purpose: String,
3743    pub technical_specifications: AiSystemCardTechnicalSpecifications,
3744    #[serde(default, skip_serializing_if = "Option::is_none")]
3745    pub training_data_summary: Option<String>,
3746    #[serde(default, skip_serializing_if = "Option::is_none")]
3747    pub performance_metrics: Option<serde_json::Map<String, serde_json::Value>>,
3748    pub limitations: Vec<String>,
3749    pub guardrails_summary: Vec<String>,
3750    pub human_oversight_measures: Vec<String>,
3751    pub generated_at: String,
3752}
3753
3754/// `AiSystemCardTechnicalSpecifications` model.
3755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3756pub struct AiSystemCardTechnicalSpecifications {
3757    #[serde(default, skip_serializing_if = "Option::is_none")]
3758    pub model_provider: Option<String>,
3759    #[serde(default, skip_serializing_if = "Option::is_none")]
3760    pub model_ref: Option<String>,
3761    #[serde(default, skip_serializing_if = "Option::is_none")]
3762    pub max_context_tokens: Option<i64>,
3763    #[serde(default, skip_serializing_if = "Option::is_none")]
3764    pub built_in_tools: Option<Vec<String>>,
3765    #[serde(default, skip_serializing_if = "Option::is_none")]
3766    pub guardrails_enabled: Option<bool>,
3767    #[serde(default, skip_serializing_if = "Option::is_none")]
3768    pub guardrail_ids: Option<Vec<String>>,
3769}
3770
3771/// Keys as served by GET /governance/ambassador/ambassadors and …/{id} (measured 2026-09-10).
3772#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3773pub struct Ambassador {
3774    pub ambassador_id: String,
3775    pub tenant_id: String,
3776    pub name: String,
3777    pub role: AmbassadorRole,
3778    pub permissions: AmbassadorPermissions,
3779    pub created_at: String,
3780}
3781
3782/// `AmbassadorPermissions` model.
3783#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3784pub struct AmbassadorPermissions {
3785    pub can_veto: bool,
3786    pub can_audit: bool,
3787    pub can_propose: bool,
3788}
3789
3790/// `AmbassadorRequest` model.
3791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3792pub struct AmbassadorRequest {
3793    pub request_id: String,
3794    pub tenant_id: String,
3795    pub from_agent_id: String,
3796    pub r#type: AmbassadorRequestType,
3797    pub subject: String,
3798    pub body: String,
3799    pub status: AmbassadorRequestStatus,
3800    #[serde(default, skip_serializing_if = "Option::is_none")]
3801    pub response: Option<String>,
3802    pub created_at: String,
3803    #[serde(default, skip_serializing_if = "Option::is_none")]
3804    pub resolved_at: Option<String>,
3805}
3806
3807/// `AmbassadorRequestStatus` enumeration.
3808#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3809pub enum AmbassadorRequestStatus {
3810    #[default]
3811    #[serde(rename = "pending")]
3812    Pending,
3813    #[serde(rename = "acknowledged")]
3814    Acknowledged,
3815    #[serde(rename = "resolved")]
3816    Resolved,
3817    /// A value the API introduced after this SDK was generated.
3818    #[serde(untagged)]
3819    Other(String),
3820}
3821
3822impl AmbassadorRequestStatus {
3823    /// The value as it appears on the wire.
3824    pub fn as_str(&self) -> &str {
3825        match self {
3826            Self::Pending => "pending",
3827            Self::Acknowledged => "acknowledged",
3828            Self::Resolved => "resolved",
3829            Self::Other(value) => value.as_str(),
3830        }
3831    }
3832}
3833
3834impl std::fmt::Display for AmbassadorRequestStatus {
3835    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3836        f.write_str(self.as_str())
3837    }
3838}
3839
3840impl From<&str> for AmbassadorRequestStatus {
3841    fn from(value: &str) -> Self {
3842        match value {
3843            "pending" => Self::Pending,
3844            "acknowledged" => Self::Acknowledged,
3845            "resolved" => Self::Resolved,
3846            other => Self::Other(other.to_string()),
3847        }
3848    }
3849}
3850
3851/// `AmbassadorRequestType` enumeration.
3852#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3853pub enum AmbassadorRequestType {
3854    #[default]
3855    #[serde(rename = "clarification")]
3856    Clarification,
3857    #[serde(rename = "approval")]
3858    Approval,
3859    #[serde(rename = "escalation")]
3860    Escalation,
3861    #[serde(rename = "report")]
3862    Report,
3863    /// A value the API introduced after this SDK was generated.
3864    #[serde(untagged)]
3865    Other(String),
3866}
3867
3868impl AmbassadorRequestType {
3869    /// The value as it appears on the wire.
3870    pub fn as_str(&self) -> &str {
3871        match self {
3872            Self::Clarification => "clarification",
3873            Self::Approval => "approval",
3874            Self::Escalation => "escalation",
3875            Self::Report => "report",
3876            Self::Other(value) => value.as_str(),
3877        }
3878    }
3879}
3880
3881impl std::fmt::Display for AmbassadorRequestType {
3882    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3883        f.write_str(self.as_str())
3884    }
3885}
3886
3887impl From<&str> for AmbassadorRequestType {
3888    fn from(value: &str) -> Self {
3889        match value {
3890            "clarification" => Self::Clarification,
3891            "approval" => Self::Approval,
3892            "escalation" => Self::Escalation,
3893            "report" => Self::Report,
3894            other => Self::Other(other.to_string()),
3895        }
3896    }
3897}
3898
3899/// `AmbassadorRole` enumeration.
3900#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
3901pub enum AmbassadorRole {
3902    #[default]
3903    #[serde(rename = "founder")]
3904    Founder,
3905    #[serde(rename = "ambassador")]
3906    Ambassador,
3907    #[serde(rename = "observer")]
3908    Observer,
3909    /// A value the API introduced after this SDK was generated.
3910    #[serde(untagged)]
3911    Other(String),
3912}
3913
3914impl AmbassadorRole {
3915    /// The value as it appears on the wire.
3916    pub fn as_str(&self) -> &str {
3917        match self {
3918            Self::Founder => "founder",
3919            Self::Ambassador => "ambassador",
3920            Self::Observer => "observer",
3921            Self::Other(value) => value.as_str(),
3922        }
3923    }
3924}
3925
3926impl std::fmt::Display for AmbassadorRole {
3927    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3928        f.write_str(self.as_str())
3929    }
3930}
3931
3932impl From<&str> for AmbassadorRole {
3933    fn from(value: &str) -> Self {
3934        match value {
3935            "founder" => Self::Founder,
3936            "ambassador" => Self::Ambassador,
3937            "observer" => Self::Observer,
3938            other => Self::Other(other.to_string()),
3939        }
3940    }
3941}
3942
3943/// `AmbassadorVetoRequest` model.
3944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3945pub struct AmbassadorVetoRequest {
3946    pub target_type: String,
3947    pub target_id: String,
3948    pub reason: String,
3949}
3950
3951/// `AmendConstitutionRequest` model.
3952#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3953pub struct AmendConstitutionRequest {
3954    pub rule_id: String,
3955    pub action: String,
3956    #[serde(default, skip_serializing_if = "Option::is_none")]
3957    pub rule: Option<serde_json::Map<String, serde_json::Value>>,
3958    #[serde(default, skip_serializing_if = "Option::is_none")]
3959    pub rationale: Option<String>,
3960}
3961
3962/// `AnalyticsTimeseriesPoint` model.
3963#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3964pub struct AnalyticsTimeseriesPoint {
3965    pub date: String,
3966    pub landing_visit: i64,
3967    pub page_view: i64,
3968    pub otp_requested: i64,
3969    pub signup: i64,
3970    pub login: i64,
3971    pub app_open: i64,
3972    pub activated: i64,
3973    pub checkout_started: i64,
3974    pub subscribed: i64,
3975}
3976
3977/// `AnalyticsTopValue` model.
3978#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3979pub struct AnalyticsTopValue {
3980    pub value: String,
3981    pub count: i64,
3982}
3983
3984/// `AndroidTester` model.
3985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3986pub struct AndroidTester {
3987    pub email: String,
3988    #[serde(default, skip_serializing_if = "Option::is_none")]
3989    pub source: Option<String>,
3990    /// Truncated hash of the first submitting address. The raw IP is never stored.
3991    #[serde(default, skip_serializing_if = "Option::is_none")]
3992    pub first_ip_hash: Option<String>,
3993    pub created_at: String,
3994    pub emails_sent: i64,
3995    /// `last_email_at` under the name the admin table renders; null rather than absent so a column
3996    /// can bind to it.
3997    #[serde(default)]
3998    pub emailed_at: Option<String>,
3999    #[serde(default, skip_serializing_if = "Option::is_none")]
4000    pub send_failures: Option<i64>,
4001}
4002
4003/// `AndroidTesterSignupResult` model.
4004#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4005pub struct AndroidTesterSignupResult {
4006    pub ok: bool,
4007    pub already_registered: bool,
4008    /// Whether a letter went out on THIS request. False when no testing URL is configured, when
4009    /// SMTP refused, when the address is inside its 24-hour resend cooldown, or when the
4010    /// platform-wide hourly send ceiling is reached. The address is recorded in every one of those
4011    /// cases — a "here is your link" letter without a link is worse than silence — so a client must
4012    /// NOT read `emailed: false` as "testing has not opened yet".
4013    pub emailed: bool,
4014}
4015
4016/// `APIKeyResponse` model.
4017#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4018pub struct APIKeyResponse {
4019    #[serde(default, skip_serializing_if = "Option::is_none")]
4020    pub key_id: Option<String>,
4021    #[serde(default, skip_serializing_if = "Option::is_none")]
4022    pub prefix: Option<String>,
4023    /// Shown once. Save immediately.
4024    #[serde(default, skip_serializing_if = "Option::is_none")]
4025    pub raw_key: Option<String>,
4026    #[serde(default, skip_serializing_if = "Option::is_none")]
4027    pub name: Option<String>,
4028    #[serde(default, skip_serializing_if = "Option::is_none")]
4029    pub scopes: Option<Vec<String>>,
4030    #[serde(default, skip_serializing_if = "Option::is_none")]
4031    pub created_at: Option<String>,
4032    #[serde(default, skip_serializing_if = "Option::is_none")]
4033    pub warning: Option<String>,
4034}
4035
4036/// An API key as listed. The secret is shown once, at creation, and never here.
4037#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4038pub struct APIKeySummary {
4039    pub key_id: String,
4040    pub name: String,
4041    pub prefix: String,
4042    /// What the key IS: `session` was minted by an OTP/OAuth sign-in and carries a user_id;
4043    /// `api_key` was created deliberately from Settings or the CLI.
4044    pub kind: APIKeySummaryKind,
4045    pub scopes: Vec<String>,
4046    pub status: APIKeySummaryStatus,
4047    pub created_at: String,
4048    #[serde(default, skip_serializing_if = "Option::is_none")]
4049    pub expires_at: Option<String>,
4050    #[serde(default, skip_serializing_if = "Option::is_none")]
4051    pub last_used_at: Option<String>,
4052}
4053
4054/// What the key IS: `session` was minted by an OTP/OAuth sign-in and carries a user_id;
4055/// `api_key` was created deliberately from Settings or the CLI.
4056#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4057pub enum APIKeySummaryKind {
4058    #[default]
4059    #[serde(rename = "session")]
4060    Session,
4061    #[serde(rename = "api_key")]
4062    APIKey,
4063    /// A value the API introduced after this SDK was generated.
4064    #[serde(untagged)]
4065    Other(String),
4066}
4067
4068impl APIKeySummaryKind {
4069    /// The value as it appears on the wire.
4070    pub fn as_str(&self) -> &str {
4071        match self {
4072            Self::Session => "session",
4073            Self::APIKey => "api_key",
4074            Self::Other(value) => value.as_str(),
4075        }
4076    }
4077}
4078
4079impl std::fmt::Display for APIKeySummaryKind {
4080    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4081        f.write_str(self.as_str())
4082    }
4083}
4084
4085impl From<&str> for APIKeySummaryKind {
4086    fn from(value: &str) -> Self {
4087        match value {
4088            "session" => Self::Session,
4089            "api_key" => Self::APIKey,
4090            other => Self::Other(other.to_string()),
4091        }
4092    }
4093}
4094
4095/// `APIKeySummaryStatus` enumeration.
4096#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4097pub enum APIKeySummaryStatus {
4098    #[default]
4099    #[serde(rename = "active")]
4100    Active,
4101    #[serde(rename = "revoked")]
4102    Revoked,
4103    /// A value the API introduced after this SDK was generated.
4104    #[serde(untagged)]
4105    Other(String),
4106}
4107
4108impl APIKeySummaryStatus {
4109    /// The value as it appears on the wire.
4110    pub fn as_str(&self) -> &str {
4111        match self {
4112            Self::Active => "active",
4113            Self::Revoked => "revoked",
4114            Self::Other(value) => value.as_str(),
4115        }
4116    }
4117}
4118
4119impl std::fmt::Display for APIKeySummaryStatus {
4120    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4121        f.write_str(self.as_str())
4122    }
4123}
4124
4125impl From<&str> for APIKeySummaryStatus {
4126    fn from(value: &str) -> Self {
4127        match value {
4128            "active" => Self::Active,
4129            "revoked" => Self::Revoked,
4130            other => Self::Other(other.to_string()),
4131        }
4132    }
4133}
4134
4135/// `AppendDrawingOpsRequest` model.
4136#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4137pub struct AppendDrawingOpsRequest {
4138    pub ops: Vec<AppendDrawingOpsRequestOp>,
4139}
4140
4141/// `AppendDrawingOpsRequestOp` model.
4142#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4143pub struct AppendDrawingOpsRequestOp {
4144    pub client_op_id: String,
4145    pub op: DrawingOp,
4146}
4147
4148/// `AppendDrawingOpsResponse` model.
4149#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4150pub struct AppendDrawingOpsResponse {
4151    pub items: Vec<AppendDrawingOpsResponseItem>,
4152    /// The drawing's head after the batch.
4153    pub seq: i64,
4154}
4155
4156/// `AppendDrawingOpsResponseItem` model.
4157#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4158pub struct AppendDrawingOpsResponseItem {
4159    pub client_op_id: String,
4160    pub seq: i64,
4161}
4162
4163/// `AppleNativeAuthRequest` model.
4164#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4165pub struct AppleNativeAuthRequest {
4166    /// Apple-signed JWT from `ASAuthorizationAppleIDCredential.identityToken`.
4167    pub identity_token: String,
4168    /// Apple's stable `userIdentifier` (informational only — server reads `sub` from the JWT).
4169    #[serde(default, skip_serializing_if = "Option::is_none")]
4170    pub user: Option<String>,
4171    /// User profile name from Apple. Apple supplies this only on first sign-in; iOS should cache it
4172    /// locally and resend if the user record needs to be bootstrapped.
4173    #[serde(default, skip_serializing_if = "Option::is_none")]
4174    pub name: Option<String>,
4175    /// Device name (e.g. `iPhone 15 Pro`) surfaced on the minted api_key for `/me/sessions`.
4176    #[serde(default, skip_serializing_if = "Option::is_none")]
4177    pub device_label: Option<String>,
4178}
4179
4180/// `AppleNativeAuthResponse` model.
4181#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4182pub struct AppleNativeAuthResponse {
4183    pub api_key: String,
4184    pub email: String,
4185}
4186
4187/// `ApplyProgramRequest` model.
4188#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4189pub struct ApplyProgramRequest {
4190    pub session_id: String,
4191    pub start_date: String,
4192    #[serde(default, skip_serializing_if = "Option::is_none")]
4193    pub agent_id: Option<String>,
4194}
4195
4196/// `ApplyProgramResponse` model.
4197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4198pub struct ApplyProgramResponse {
4199    pub applied: bool,
4200    pub program_id: String,
4201    pub todos: Vec<Todo>,
4202}
4203
4204/// `ApproveRunResponse` model.
4205#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4206pub struct ApproveRunResponse {
4207    pub approved: bool,
4208    pub run_id: String,
4209}
4210
4211/// `ArbiterCase` model.
4212#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4213pub struct ArbiterCase {
4214    pub case_id: String,
4215    pub tenant_id: String,
4216    pub filed_by: String,
4217    pub against_agent_id: String,
4218    pub rule_ids: Vec<String>,
4219    pub description: String,
4220    pub evidence: serde_json::Map<String, serde_json::Value>,
4221    pub status: ArbiterCaseStatus,
4222    #[serde(default, skip_serializing_if = "Option::is_none")]
4223    pub assigned_arbiter_id: Option<String>,
4224    pub created_at: String,
4225    pub deadline: String,
4226    pub updated_at: String,
4227}
4228
4229/// `ArbiterCaseStatus` enumeration.
4230#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4231pub enum ArbiterCaseStatus {
4232    #[default]
4233    #[serde(rename = "open")]
4234    Open,
4235    #[serde(rename = "under_review")]
4236    UnderReview,
4237    #[serde(rename = "ruled")]
4238    Ruled,
4239    #[serde(rename = "appealed")]
4240    Appealed,
4241    #[serde(rename = "closed")]
4242    Closed,
4243    /// A value the API introduced after this SDK was generated.
4244    #[serde(untagged)]
4245    Other(String),
4246}
4247
4248impl ArbiterCaseStatus {
4249    /// The value as it appears on the wire.
4250    pub fn as_str(&self) -> &str {
4251        match self {
4252            Self::Open => "open",
4253            Self::UnderReview => "under_review",
4254            Self::Ruled => "ruled",
4255            Self::Appealed => "appealed",
4256            Self::Closed => "closed",
4257            Self::Other(value) => value.as_str(),
4258        }
4259    }
4260}
4261
4262impl std::fmt::Display for ArbiterCaseStatus {
4263    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4264        f.write_str(self.as_str())
4265    }
4266}
4267
4268impl From<&str> for ArbiterCaseStatus {
4269    fn from(value: &str) -> Self {
4270        match value {
4271            "open" => Self::Open,
4272            "under_review" => Self::UnderReview,
4273            "ruled" => Self::Ruled,
4274            "appealed" => Self::Appealed,
4275            "closed" => Self::Closed,
4276            other => Self::Other(other.to_string()),
4277        }
4278    }
4279}
4280
4281/// `ArbiterRegistry` model.
4282#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4283pub struct ArbiterRegistry {
4284    #[serde(default, skip_serializing_if = "Option::is_none")]
4285    pub arbiter_agent_ids: Option<Vec<String>>,
4286    #[serde(default, skip_serializing_if = "Option::is_none")]
4287    pub max_appeals: Option<i64>,
4288    #[serde(default, skip_serializing_if = "Option::is_none")]
4289    pub panel_size: Option<i64>,
4290    #[serde(default, skip_serializing_if = "Option::is_none")]
4291    pub ruling_deadline_hours: Option<i64>,
4292    #[serde(default, skip_serializing_if = "Option::is_none")]
4293    pub tenant_id: Option<String>,
4294    #[serde(default, skip_serializing_if = "Option::is_none")]
4295    pub updated_at: Option<String>,
4296}
4297
4298/// `Artifact` model.
4299#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4300pub struct Artifact {
4301    pub artifact_id: String,
4302    pub run_id: String,
4303    #[serde(default, skip_serializing_if = "Option::is_none")]
4304    pub tenant_id: Option<String>,
4305    pub name: String,
4306    pub mime_type: String,
4307    pub size_bytes: i64,
4308    #[serde(default, skip_serializing_if = "Option::is_none")]
4309    pub storage_ref: Option<String>,
4310    pub created_at: String,
4311}
4312
4313/// `AssignWorkspaceRequest` model.
4314#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4315pub struct AssignWorkspaceRequest {
4316    #[serde(default, skip_serializing_if = "Option::is_none")]
4317    pub agent_id: Option<String>,
4318    #[serde(default, skip_serializing_if = "Option::is_none")]
4319    pub team_id: Option<String>,
4320    #[serde(default, skip_serializing_if = "Option::is_none")]
4321    pub company_id: Option<String>,
4322}
4323
4324/// One audit-log row as served by GET /runs/{runId}/audit-log and GET
4325/// /sessions/{sessionId}/audit-log. Keys measured 2026-09-10 on the e2e-canon tenant (runs and
4326/// sessions alike).
4327#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4328pub struct AuditLogEntry {
4329    pub entry_id: String,
4330    pub action: String,
4331    pub actor_tenant_id: String,
4332    pub target_type: String,
4333    pub target_id: String,
4334    pub details: serde_json::Map<String, serde_json::Value>,
4335    pub ip_address: String,
4336    pub timestamp: String,
4337}
4338
4339/// `AuthProvider` model.
4340#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4341pub struct AuthProvider {
4342    pub email: String,
4343    pub id: String,
4344    pub linked: bool,
4345    #[serde(default, skip_serializing_if = "Option::is_none")]
4346    pub linked_at: Option<String>,
4347    #[serde(default, skip_serializing_if = "Option::is_none")]
4348    pub sub: Option<String>,
4349}
4350
4351/// Body for POST /api/v1/auth/verify-code. No request_id; code is bound to email only.
4352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4353pub struct AuthVerifyCodeRequest {
4354    /// Same email used in request-code
4355    pub email: String,
4356    /// OTP from email (6 digits); spaces are stripped server-side
4357    pub code: String,
4358}
4359
4360/// Success response: API key to use as Bearer token
4361#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4362pub struct AuthVerifyCodeResponse {
4363    /// uarp_\<prefix\>_\<secret\>; store and use as Authorization: Bearer \<api_key\>
4364    pub api_key: String,
4365}
4366
4367/// `Ballot` model.
4368#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4369pub struct Ballot {
4370    pub proposal_id: String,
4371    pub agent_id: String,
4372    pub vote: BallotVote,
4373    pub weight: f64,
4374    #[serde(default, skip_serializing_if = "Option::is_none")]
4375    pub reasoning: Option<String>,
4376    #[serde(default, skip_serializing_if = "Option::is_none")]
4377    pub signature: Option<String>,
4378    pub cast_at: String,
4379}
4380
4381/// `BallotVote` enumeration.
4382#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4383pub enum BallotVote {
4384    #[default]
4385    #[serde(rename = "approve")]
4386    Approve,
4387    #[serde(rename = "reject")]
4388    Reject,
4389    #[serde(rename = "abstain")]
4390    Abstain,
4391    /// A value the API introduced after this SDK was generated.
4392    #[serde(untagged)]
4393    Other(String),
4394}
4395
4396impl BallotVote {
4397    /// The value as it appears on the wire.
4398    pub fn as_str(&self) -> &str {
4399        match self {
4400            Self::Approve => "approve",
4401            Self::Reject => "reject",
4402            Self::Abstain => "abstain",
4403            Self::Other(value) => value.as_str(),
4404        }
4405    }
4406}
4407
4408impl std::fmt::Display for BallotVote {
4409    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4410        f.write_str(self.as_str())
4411    }
4412}
4413
4414impl From<&str> for BallotVote {
4415    fn from(value: &str) -> Self {
4416        match value {
4417            "approve" => Self::Approve,
4418            "reject" => Self::Reject,
4419            "abstain" => Self::Abstain,
4420            other => Self::Other(other.to_string()),
4421        }
4422    }
4423}
4424
4425/// `BlogConfig` model.
4426#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4427pub struct BlogConfig {
4428    pub enabled: bool,
4429    pub title: String,
4430    pub description: String,
4431    #[serde(default)]
4432    pub agent_id: Option<String>,
4433    /// Derived, never sent by a client: set from the caller's tenant when `agent_id` is assigned,
4434    /// so the cron can run the author without a request context.
4435    #[serde(default)]
4436    pub agent_tenant_id: Option<String>,
4437    pub frequency: BlogConfigFrequency,
4438    pub schedule_hour: i64,
4439    pub schedule_weekday: i64,
4440    pub topic_prompt: String,
4441    pub conditions: String,
4442    pub auto_publish: bool,
4443    /// Drives scheduling. Null until the first successful generation.
4444    #[serde(default)]
4445    pub last_generated_at: Option<String>,
4446}
4447
4448/// `BlogConfigFrequency` enumeration.
4449#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4450pub enum BlogConfigFrequency {
4451    #[default]
4452    #[serde(rename = "manual")]
4453    Manual,
4454    #[serde(rename = "hourly")]
4455    Hourly,
4456    #[serde(rename = "daily")]
4457    Daily,
4458    #[serde(rename = "weekly")]
4459    Weekly,
4460    /// A value the API introduced after this SDK was generated.
4461    #[serde(untagged)]
4462    Other(String),
4463}
4464
4465impl BlogConfigFrequency {
4466    /// The value as it appears on the wire.
4467    pub fn as_str(&self) -> &str {
4468        match self {
4469            Self::Manual => "manual",
4470            Self::Hourly => "hourly",
4471            Self::Daily => "daily",
4472            Self::Weekly => "weekly",
4473            Self::Other(value) => value.as_str(),
4474        }
4475    }
4476}
4477
4478impl std::fmt::Display for BlogConfigFrequency {
4479    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4480        f.write_str(self.as_str())
4481    }
4482}
4483
4484impl From<&str> for BlogConfigFrequency {
4485    fn from(value: &str) -> Self {
4486        match value {
4487            "manual" => Self::Manual,
4488            "hourly" => Self::Hourly,
4489            "daily" => Self::Daily,
4490            "weekly" => Self::Weekly,
4491            other => Self::Other(other.to_string()),
4492        }
4493    }
4494}
4495
4496/// `BlogPost` model.
4497#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4498pub struct BlogPost {
4499    pub id: String,
4500    /// Derived from the title and unique. Re-minted whenever the title changes.
4501    pub slug: String,
4502    pub title: String,
4503    pub body: String,
4504    pub tags: Vec<String>,
4505    pub status: BlogPostStatus,
4506    /// Who last shaped it, not who started it — an edit to the title or body of an agent-written
4507    /// post re-stamps this to `manual`.
4508    pub source: BlogPostSource,
4509    #[serde(default)]
4510    pub agent_id: Option<String>,
4511    #[serde(default)]
4512    pub run_id: Option<String>,
4513    pub created_at: String,
4514    pub updated_at: String,
4515    /// Null while a draft. Stamped on transition to published and cleared on a return to draft, so
4516    /// a republished post carries a new timestamp rather than its original.
4517    #[serde(default)]
4518    pub published_at: Option<String>,
4519}
4520
4521/// Who last shaped it, not who started it — an edit to the title or body of an agent-written
4522/// post re-stamps this to `manual`.
4523#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4524pub enum BlogPostSource {
4525    #[default]
4526    #[serde(rename = "agent")]
4527    Agent,
4528    #[serde(rename = "manual")]
4529    Manual,
4530    /// A value the API introduced after this SDK was generated.
4531    #[serde(untagged)]
4532    Other(String),
4533}
4534
4535impl BlogPostSource {
4536    /// The value as it appears on the wire.
4537    pub fn as_str(&self) -> &str {
4538        match self {
4539            Self::Agent => "agent",
4540            Self::Manual => "manual",
4541            Self::Other(value) => value.as_str(),
4542        }
4543    }
4544}
4545
4546impl std::fmt::Display for BlogPostSource {
4547    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4548        f.write_str(self.as_str())
4549    }
4550}
4551
4552impl From<&str> for BlogPostSource {
4553    fn from(value: &str) -> Self {
4554        match value {
4555            "agent" => Self::Agent,
4556            "manual" => Self::Manual,
4557            other => Self::Other(other.to_string()),
4558        }
4559    }
4560}
4561
4562/// `BlogPostStatus` enumeration.
4563#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4564pub enum BlogPostStatus {
4565    #[default]
4566    #[serde(rename = "draft")]
4567    Draft,
4568    #[serde(rename = "published")]
4569    Published,
4570    /// A value the API introduced after this SDK was generated.
4571    #[serde(untagged)]
4572    Other(String),
4573}
4574
4575impl BlogPostStatus {
4576    /// The value as it appears on the wire.
4577    pub fn as_str(&self) -> &str {
4578        match self {
4579            Self::Draft => "draft",
4580            Self::Published => "published",
4581            Self::Other(value) => value.as_str(),
4582        }
4583    }
4584}
4585
4586impl std::fmt::Display for BlogPostStatus {
4587    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4588        f.write_str(self.as_str())
4589    }
4590}
4591
4592impl From<&str> for BlogPostStatus {
4593    fn from(value: &str) -> Self {
4594        match value {
4595            "draft" => Self::Draft,
4596            "published" => Self::Published,
4597            other => Self::Other(other.to_string()),
4598        }
4599    }
4600}
4601
4602/// `BootstrapRequest` model.
4603#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4604pub struct BootstrapRequest {
4605    /// Server default: `"Admin Tenant"`.
4606    #[serde(default, skip_serializing_if = "Option::is_none")]
4607    pub tenant_name: Option<String>,
4608    /// Server default: `"admin"`.
4609    #[serde(default, skip_serializing_if = "Option::is_none")]
4610    pub tenant_slug: Option<String>,
4611}
4612
4613/// `BootstrapResponse` model.
4614#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4615pub struct BootstrapResponse {
4616    pub message: String,
4617    pub tenant: BootstrapResponseTenant,
4618    pub api_key: BootstrapResponseAPIKey,
4619}
4620
4621/// `BootstrapResponseAPIKey` model.
4622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4623pub struct BootstrapResponseAPIKey {
4624    pub key_id: String,
4625    pub prefix: String,
4626    pub raw_key: String,
4627    pub scopes: Vec<String>,
4628    pub warning: String,
4629}
4630
4631/// `BootstrapResponseTenant` model.
4632#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4633pub struct BootstrapResponseTenant {
4634    pub tenant_id: String,
4635    pub name: String,
4636    pub slug: String,
4637    pub plan: String,
4638}
4639
4640/// `BridgeAgentSummary` model.
4641#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4642pub struct BridgeAgentSummary {
4643    pub agent_id: String,
4644    pub machine_id: String,
4645    pub machine_name: String,
4646    pub capabilities: Vec<String>,
4647    pub working_directory: String,
4648    pub status: String,
4649    pub last_heartbeat: String,
4650}
4651
4652/// `BridgeConnection` model.
4653#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4654pub struct BridgeConnection {
4655    pub agent_id: String,
4656    #[serde(default, skip_serializing_if = "Option::is_none")]
4657    pub tenant_id: Option<String>,
4658    pub machine_id: String,
4659    #[serde(default, skip_serializing_if = "Option::is_none")]
4660    pub machine_name: Option<String>,
4661    pub capabilities: Vec<String>,
4662    pub working_directory: String,
4663    pub version: String,
4664    pub last_heartbeat: String,
4665    pub status: AgentSummaryBridgeStatus,
4666    #[serde(default, skip_serializing_if = "Option::is_none")]
4667    pub registered_at: Option<String>,
4668    #[serde(default, skip_serializing_if = "Option::is_none")]
4669    pub os: Option<String>,
4670}
4671
4672/// `BridgeDelegateRequest` model.
4673#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4674pub struct BridgeDelegateRequest {
4675    /// The bridge agent to hand the task to.
4676    pub agent_id: String,
4677    /// The task itself. Required: the handler answers 400 when either this or agent_id is missing.
4678    /// This block used to omit it entirely while requiring `context`, which the handler never
4679    /// checks — so a body written from the document was refused for a field it was told to send,
4680    /// and accepted without the one that is actually needed. Measured 2026-09-18.
4681    pub message: String,
4682    /// Optional.
4683    #[serde(default, skip_serializing_if = "Option::is_none")]
4684    pub priority: Option<String>,
4685    /// Optional. Rendered into the message ahead of it when present.
4686    #[serde(default, skip_serializing_if = "Option::is_none")]
4687    pub context: Option<serde_json::Map<String, serde_json::Value>>,
4688}
4689
4690/// `BridgeDelegateResponse` model.
4691#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4692pub struct BridgeDelegateResponse {
4693    #[serde(default, skip_serializing_if = "Option::is_none")]
4694    pub success: Option<bool>,
4695    #[serde(default, skip_serializing_if = "Option::is_none")]
4696    pub task_id: Option<String>,
4697}
4698
4699/// `BridgeDeregisterRequest` model.
4700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4701pub struct BridgeDeregisterRequest {
4702    pub machine_id: String,
4703}
4704
4705/// `BridgeDeregisterResponse` model.
4706#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4707pub struct BridgeDeregisterResponse {
4708    pub status: BridgeDeregisterResponseStatus,
4709}
4710
4711/// `BridgeDeregisterResponseStatus` enumeration.
4712#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4713pub enum BridgeDeregisterResponseStatus {
4714    #[default]
4715    #[serde(rename = "offline")]
4716    Offline,
4717    /// A value the API introduced after this SDK was generated.
4718    #[serde(untagged)]
4719    Other(String),
4720}
4721
4722impl BridgeDeregisterResponseStatus {
4723    /// The value as it appears on the wire.
4724    pub fn as_str(&self) -> &str {
4725        match self {
4726            Self::Offline => "offline",
4727            Self::Other(value) => value.as_str(),
4728        }
4729    }
4730}
4731
4732impl std::fmt::Display for BridgeDeregisterResponseStatus {
4733    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4734        f.write_str(self.as_str())
4735    }
4736}
4737
4738impl From<&str> for BridgeDeregisterResponseStatus {
4739    fn from(value: &str) -> Self {
4740        match value {
4741            "offline" => Self::Offline,
4742            other => Self::Other(other.to_string()),
4743        }
4744    }
4745}
4746
4747/// `BridgeHeartbeatRequest` model.
4748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4749pub struct BridgeHeartbeatRequest {
4750    #[serde(default, skip_serializing_if = "Option::is_none")]
4751    pub machine_id: Option<String>,
4752    #[serde(default, skip_serializing_if = "Option::is_none")]
4753    pub agent_id: Option<String>,
4754    #[serde(default, skip_serializing_if = "Option::is_none")]
4755    pub status: Option<String>,
4756}
4757
4758/// `BridgeHeartbeatResponse` model.
4759#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4760pub struct BridgeHeartbeatResponse {
4761    pub ok: bool,
4762    #[serde(default, skip_serializing_if = "Option::is_none")]
4763    pub timestamp: Option<String>,
4764}
4765
4766/// `BridgeInstalledSpec` model.
4767#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4768pub struct BridgeInstalledSpec {
4769    /// `@scope/name`.
4770    pub spec_id: String,
4771    /// Resolved exactly, never a range.
4772    #[serde(default, skip_serializing_if = "Option::is_none")]
4773    pub version: Option<String>,
4774    /// Tool names the SPEC registered into the local runtime.
4775    #[serde(default, skip_serializing_if = "Option::is_none")]
4776    pub tools: Option<Vec<String>>,
4777    pub status: BridgeInstalledSpecStatus,
4778    /// Failure detail when `status` is `failed` — artifact 404, SHA mismatch, capability conflict.
4779    #[serde(default, skip_serializing_if = "Option::is_none")]
4780    pub error: Option<String>,
4781    #[serde(default, skip_serializing_if = "Option::is_none")]
4782    pub reported_at: Option<String>,
4783}
4784
4785/// `BridgeInstalledSpecStatus` enumeration.
4786#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4787pub enum BridgeInstalledSpecStatus {
4788    #[default]
4789    #[serde(rename = "installed")]
4790    Installed,
4791    #[serde(rename = "failed")]
4792    Failed,
4793    /// A value the API introduced after this SDK was generated.
4794    #[serde(untagged)]
4795    Other(String),
4796}
4797
4798impl BridgeInstalledSpecStatus {
4799    /// The value as it appears on the wire.
4800    pub fn as_str(&self) -> &str {
4801        match self {
4802            Self::Installed => "installed",
4803            Self::Failed => "failed",
4804            Self::Other(value) => value.as_str(),
4805        }
4806    }
4807}
4808
4809impl std::fmt::Display for BridgeInstalledSpecStatus {
4810    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4811        f.write_str(self.as_str())
4812    }
4813}
4814
4815impl From<&str> for BridgeInstalledSpecStatus {
4816    fn from(value: &str) -> Self {
4817        match value {
4818            "installed" => Self::Installed,
4819            "failed" => Self::Failed,
4820            other => Self::Other(other.to_string()),
4821        }
4822    }
4823}
4824
4825/// `BridgePendingTask` model.
4826#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4827pub struct BridgePendingTask {
4828    pub task_id: String,
4829    pub agent_id: String,
4830    #[serde(default, skip_serializing_if = "Option::is_none")]
4831    pub session_id: Option<String>,
4832    #[serde(default, skip_serializing_if = "Option::is_none")]
4833    pub run_id: Option<String>,
4834    pub input: BridgePendingTaskInput,
4835    pub queued_at: String,
4836    pub expires_at: String,
4837    pub source: BridgePendingTaskSource,
4838}
4839
4840/// `BridgePendingTaskInput` model.
4841#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4842pub struct BridgePendingTaskInput {
4843    pub message: String,
4844    #[serde(default, skip_serializing_if = "Option::is_none")]
4845    pub conversation_history: Option<Vec<BridgePendingTaskInputConversationHistoryItem>>,
4846    /// Attachment ids the user added to this message. Fetch each with GET /files/{fileId}/content
4847    /// (scope files:read). Absent when the message had no attachment.
4848    #[serde(default, skip_serializing_if = "Option::is_none")]
4849    pub files: Option<Vec<String>>,
4850    /// The attachments, in the same order as `files`, with what a client needs BEFORE it spends a
4851    /// fetch: a 40 MB video and a 2 KB note are not the same decision, and an error that cannot
4852    /// name the file leaves the model answering about a document it never opened. This is the
4853    /// SUBSET of `files` whose artifact record still exists when the task is enqueued — a run
4854    /// dispatched from a schedule was written earlier and the file may have been deleted since. An
4855    /// id present in `files` with no entry here means the file is gone, not that its metadata was
4856    /// omitted; fetching it will 404, which is how the client reports the attachment as not
4857    /// delivered.
4858    #[serde(default, skip_serializing_if = "Option::is_none")]
4859    pub attachments: Option<Vec<BridgePendingTaskInputAttachment>>,
4860}
4861
4862/// `BridgePendingTaskInputAttachment` model.
4863#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4864pub struct BridgePendingTaskInputAttachment {
4865    pub file_id: String,
4866    pub filename: String,
4867    pub mime_type: String,
4868    pub size_bytes: i64,
4869}
4870
4871/// `BridgePendingTaskInputConversationHistoryItem` model.
4872#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4873pub struct BridgePendingTaskInputConversationHistoryItem {
4874    #[serde(default, skip_serializing_if = "Option::is_none")]
4875    pub role: Option<String>,
4876    #[serde(default, skip_serializing_if = "Option::is_none")]
4877    pub content: Option<String>,
4878}
4879
4880/// `BridgePendingTaskSource` model.
4881#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4882pub struct BridgePendingTaskSource {
4883    pub r#type: BridgePendingTaskSourceType,
4884    #[serde(default, skip_serializing_if = "Option::is_none")]
4885    pub agent_id: Option<String>,
4886    #[serde(default, skip_serializing_if = "Option::is_none")]
4887    pub user_id: Option<String>,
4888}
4889
4890/// `BridgePendingTaskSourceType` enumeration.
4891#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
4892pub enum BridgePendingTaskSourceType {
4893    #[default]
4894    #[serde(rename = "head_agent")]
4895    HeadAgent,
4896    #[serde(rename = "user")]
4897    User,
4898    #[serde(rename = "team")]
4899    Team,
4900    /// A value the API introduced after this SDK was generated.
4901    #[serde(untagged)]
4902    Other(String),
4903}
4904
4905impl BridgePendingTaskSourceType {
4906    /// The value as it appears on the wire.
4907    pub fn as_str(&self) -> &str {
4908        match self {
4909            Self::HeadAgent => "head_agent",
4910            Self::User => "user",
4911            Self::Team => "team",
4912            Self::Other(value) => value.as_str(),
4913        }
4914    }
4915}
4916
4917impl std::fmt::Display for BridgePendingTaskSourceType {
4918    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4919        f.write_str(self.as_str())
4920    }
4921}
4922
4923impl From<&str> for BridgePendingTaskSourceType {
4924    fn from(value: &str) -> Self {
4925        match value {
4926            "head_agent" => Self::HeadAgent,
4927            "user" => Self::User,
4928            "team" => Self::Team,
4929            other => Self::Other(other.to_string()),
4930        }
4931    }
4932}
4933
4934/// `BridgePollResponse` model.
4935#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4936pub struct BridgePollResponse {
4937    pub tasks: Vec<BridgePendingTask>,
4938}
4939
4940/// `BridgeRegisterRequest` model.
4941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4942pub struct BridgeRegisterRequest {
4943    pub machine_id: String,
4944    pub capabilities: Vec<String>,
4945    pub working_directory: String,
4946    pub version: String,
4947    #[serde(default, skip_serializing_if = "Option::is_none")]
4948    pub machine_name: Option<String>,
4949    #[serde(default, skip_serializing_if = "Option::is_none")]
4950    pub agent_name: Option<String>,
4951    #[serde(default, skip_serializing_if = "Option::is_none")]
4952    pub os: Option<String>,
4953}
4954
4955/// `BridgeRegisterResponse` model.
4956#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4957pub struct BridgeRegisterResponse {
4958    pub agent_id: String,
4959    /// Always `online`.
4960    pub status: String,
4961    #[serde(default, skip_serializing_if = "Option::is_none")]
4962    pub registered: Option<bool>,
4963}
4964
4965/// `BridgeStatusResponse` model.
4966#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4967pub struct BridgeStatusResponse {
4968    pub connections: Vec<BridgeConnection>,
4969}
4970
4971/// A progress frame from the Snaga bridge (BridgeTaskEvent in @uarp/types); `type` decides
4972/// which optional fields are present.
4973#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4974pub struct BridgeTaskEvent {
4975    #[serde(default, skip_serializing_if = "Option::is_none")]
4976    pub event_id: Option<String>,
4977    pub r#type: BridgeTaskEventType,
4978    pub timestamp: String,
4979    #[serde(default, skip_serializing_if = "Option::is_none")]
4980    pub approval_id: Option<String>,
4981    #[serde(default, skip_serializing_if = "Option::is_none")]
4982    pub status: Option<String>,
4983    #[serde(default, skip_serializing_if = "Option::is_none")]
4984    pub options: Option<Vec<String>>,
4985    #[serde(default, skip_serializing_if = "Option::is_none")]
4986    pub kind: Option<String>,
4987    #[serde(default, skip_serializing_if = "Option::is_none")]
4988    pub message: Option<String>,
4989    #[serde(default, skip_serializing_if = "Option::is_none")]
4990    pub tool_name: Option<String>,
4991    #[serde(default, skip_serializing_if = "Option::is_none")]
4992    pub tool_args_preview: Option<String>,
4993    #[serde(default, skip_serializing_if = "Option::is_none")]
4994    pub tool_call_id: Option<String>,
4995    #[serde(default, skip_serializing_if = "Option::is_none")]
4996    pub tool_result_preview: Option<String>,
4997    #[serde(default, skip_serializing_if = "Option::is_none")]
4998    pub tool_duration_ms: Option<i64>,
4999    #[serde(default, skip_serializing_if = "Option::is_none")]
5000    pub content: Option<String>,
5001    #[serde(default, skip_serializing_if = "Option::is_none")]
5002    pub metrics: Option<BridgeTaskEventMetrics>,
5003    #[serde(default, skip_serializing_if = "Option::is_none")]
5004    pub input_tokens: Option<i64>,
5005    #[serde(default, skip_serializing_if = "Option::is_none")]
5006    pub output_tokens: Option<i64>,
5007    #[serde(default, skip_serializing_if = "Option::is_none")]
5008    pub error: Option<String>,
5009    #[serde(default, skip_serializing_if = "Option::is_none")]
5010    pub output: Option<String>,
5011    #[serde(default, skip_serializing_if = "Option::is_none")]
5012    pub capabilities: Option<Vec<String>>,
5013    #[serde(default, skip_serializing_if = "Option::is_none")]
5014    pub working_directory: Option<String>,
5015    #[serde(default, skip_serializing_if = "Option::is_none")]
5016    pub hostname: Option<String>,
5017    #[serde(default, skip_serializing_if = "Option::is_none")]
5018    pub platform: Option<String>,
5019    #[serde(default, skip_serializing_if = "Option::is_none")]
5020    pub reason: Option<String>,
5021    #[serde(default, skip_serializing_if = "Option::is_none")]
5022    pub context: Option<String>,
5023    #[serde(default, skip_serializing_if = "Option::is_none")]
5024    pub model: Option<String>,
5025}
5026
5027/// `BridgeTaskEventMetrics` model.
5028#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5029pub struct BridgeTaskEventMetrics {
5030    #[serde(default, skip_serializing_if = "Option::is_none")]
5031    pub tool_calls_count: Option<i64>,
5032    #[serde(default, skip_serializing_if = "Option::is_none")]
5033    pub files_modified: Option<i64>,
5034    #[serde(default, skip_serializing_if = "Option::is_none")]
5035    pub commands_executed: Option<i64>,
5036    #[serde(default, skip_serializing_if = "Option::is_none")]
5037    pub llm_calls: Option<i64>,
5038    #[serde(default, skip_serializing_if = "Option::is_none")]
5039    pub execution_time_ms: Option<i64>,
5040}
5041
5042/// `BridgeTaskEventType` enumeration.
5043#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5044pub enum BridgeTaskEventType {
5045    #[default]
5046    #[serde(rename = "status")]
5047    Status,
5048    #[serde(rename = "tool_call")]
5049    ToolCall,
5050    #[serde(rename = "tool_result")]
5051    ToolResult,
5052    #[serde(rename = "content")]
5053    Content,
5054    #[serde(rename = "thinking")]
5055    Thinking,
5056    #[serde(rename = "text")]
5057    Text,
5058    #[serde(rename = "metrics")]
5059    Metrics,
5060    #[serde(rename = "approval_request")]
5061    ApprovalRequest,
5062    #[serde(rename = "error")]
5063    Error,
5064    #[serde(rename = "completed")]
5065    Completed,
5066    #[serde(rename = "capability_report")]
5067    CapabilityReport,
5068    #[serde(rename = "escalation")]
5069    Escalation,
5070    #[serde(rename = "approval_denied")]
5071    ApprovalDenied,
5072    /// A value the API introduced after this SDK was generated.
5073    #[serde(untagged)]
5074    Other(String),
5075}
5076
5077impl BridgeTaskEventType {
5078    /// The value as it appears on the wire.
5079    pub fn as_str(&self) -> &str {
5080        match self {
5081            Self::Status => "status",
5082            Self::ToolCall => "tool_call",
5083            Self::ToolResult => "tool_result",
5084            Self::Content => "content",
5085            Self::Thinking => "thinking",
5086            Self::Text => "text",
5087            Self::Metrics => "metrics",
5088            Self::ApprovalRequest => "approval_request",
5089            Self::Error => "error",
5090            Self::Completed => "completed",
5091            Self::CapabilityReport => "capability_report",
5092            Self::Escalation => "escalation",
5093            Self::ApprovalDenied => "approval_denied",
5094            Self::Other(value) => value.as_str(),
5095        }
5096    }
5097}
5098
5099impl std::fmt::Display for BridgeTaskEventType {
5100    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5101        f.write_str(self.as_str())
5102    }
5103}
5104
5105impl From<&str> for BridgeTaskEventType {
5106    fn from(value: &str) -> Self {
5107        match value {
5108            "status" => Self::Status,
5109            "tool_call" => Self::ToolCall,
5110            "tool_result" => Self::ToolResult,
5111            "content" => Self::Content,
5112            "thinking" => Self::Thinking,
5113            "text" => Self::Text,
5114            "metrics" => Self::Metrics,
5115            "approval_request" => Self::ApprovalRequest,
5116            "error" => Self::Error,
5117            "completed" => Self::Completed,
5118            "capability_report" => Self::CapabilityReport,
5119            "escalation" => Self::Escalation,
5120            "approval_denied" => Self::ApprovalDenied,
5121            other => Self::Other(other.to_string()),
5122        }
5123    }
5124}
5125
5126/// `BulkDeleteNotificationsResponse` model.
5127#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5128pub struct BulkDeleteNotificationsResponse {
5129    pub deleted: i64,
5130    pub scope: BulkDeleteNotificationsScope,
5131}
5132
5133/// `BulkDeleteNotificationsScope` enumeration.
5134#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5135pub enum BulkDeleteNotificationsScope {
5136    #[default]
5137    #[serde(rename = "read")]
5138    Read,
5139    #[serde(rename = "all")]
5140    All,
5141    /// A value the API introduced after this SDK was generated.
5142    #[serde(untagged)]
5143    Other(String),
5144}
5145
5146impl BulkDeleteNotificationsScope {
5147    /// The value as it appears on the wire.
5148    pub fn as_str(&self) -> &str {
5149        match self {
5150            Self::Read => "read",
5151            Self::All => "all",
5152            Self::Other(value) => value.as_str(),
5153        }
5154    }
5155}
5156
5157impl std::fmt::Display for BulkDeleteNotificationsScope {
5158    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5159        f.write_str(self.as_str())
5160    }
5161}
5162
5163impl From<&str> for BulkDeleteNotificationsScope {
5164    fn from(value: &str) -> Self {
5165        match value {
5166            "read" => Self::Read,
5167            "all" => Self::All,
5168            other => Self::Other(other.to_string()),
5169        }
5170    }
5171}
5172
5173/// `BulkDeleteSessionsRequest` model.
5174#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5175pub struct BulkDeleteSessionsRequest {
5176    pub session_ids: Vec<String>,
5177}
5178
5179/// `BulkDeleteSessionsResponse` model.
5180#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5181pub struct BulkDeleteSessionsResponse {
5182    pub deleted: i64,
5183    pub failed: Vec<String>,
5184}
5185
5186/// `CancelA2ATaskResponse` model.
5187#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5188pub struct CancelA2ATaskResponse {
5189    pub cancelled: bool,
5190    pub task_id: String,
5191}
5192
5193/// `CancelPublicSessionRunResponse` model.
5194#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5195pub struct CancelPublicSessionRunResponse {
5196    pub cancelled: bool,
5197    pub run_id: String,
5198}
5199
5200/// `CancelRunResponse` model.
5201#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5202pub struct CancelRunResponse {
5203    pub cancelled: bool,
5204    pub run_id: String,
5205}
5206
5207/// `CancelSquadRunResponse` model.
5208#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5209pub struct CancelSquadRunResponse {
5210    pub cancelled: bool,
5211    pub team_run_id: String,
5212    /// Child runs actually stopped. Zero is normal for a run whose children had already finished.
5213    /// Deprecated spelling of `cancelled_count` — the same value, kept for the compatibility window
5214    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
5215    /// `cancelled_count`.
5216    #[serde(rename = "cancelledCount")]
5217    pub cancelled_count: i64,
5218    /// False when no orchestration loop was in flight in this process — the run had already
5219    /// settled, or it belongs to another replica.
5220    pub orchestrator_stopped: bool,
5221    /// Child runs actually stopped. Zero is normal for a run whose children had already finished.
5222    #[serde(rename = "cancelled_count")]
5223    pub cancelled_count_: i64,
5224}
5225
5226/// `CancelTeamRunResponse` model.
5227#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5228pub struct CancelTeamRunResponse {
5229    pub cancelled: bool,
5230    pub team_run_id: String,
5231    /// Child runs actually stopped. Zero is normal for a run whose children had already finished.
5232    /// Deprecated spelling of `cancelled_count` — the same value, kept for the compatibility window
5233    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
5234    /// `cancelled_count`.
5235    #[serde(rename = "cancelledCount")]
5236    pub cancelled_count: i64,
5237    /// False when no orchestration loop was in flight in this process — the run had already
5238    /// settled, or it belongs to another replica.
5239    pub orchestrator_stopped: bool,
5240    /// Child runs actually stopped. Zero is normal for a run whose children had already finished.
5241    #[serde(rename = "cancelled_count")]
5242    pub cancelled_count_: i64,
5243}
5244
5245/// visual-builder.ts CanvasEdge.
5246#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5247pub struct CanvasEdge {
5248    pub id: String,
5249    pub source: String,
5250    pub target: String,
5251    #[serde(default, skip_serializing_if = "Option::is_none")]
5252    pub label: Option<String>,
5253}
5254
5255/// visual-builder.ts CanvasNode.
5256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5257pub struct CanvasNode {
5258    pub id: String,
5259    pub r#type: CanvasNodeType,
5260    pub label: String,
5261    pub position: CanvasNodePosition,
5262    pub config: serde_json::Map<String, serde_json::Value>,
5263}
5264
5265/// `CanvasNodePosition` model.
5266#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5267pub struct CanvasNodePosition {
5268    pub x: f64,
5269    pub y: f64,
5270}
5271
5272/// `CanvasNodeType` enumeration.
5273#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5274pub enum CanvasNodeType {
5275    #[default]
5276    #[serde(rename = "llm")]
5277    LLM,
5278    #[serde(rename = "tool")]
5279    Tool,
5280    #[serde(rename = "guardrail")]
5281    Guardrail,
5282    #[serde(rename = "memory")]
5283    Memory,
5284    #[serde(rename = "condition")]
5285    Condition,
5286    #[serde(rename = "input")]
5287    Input,
5288    #[serde(rename = "output")]
5289    Output,
5290    /// A value the API introduced after this SDK was generated.
5291    #[serde(untagged)]
5292    Other(String),
5293}
5294
5295impl CanvasNodeType {
5296    /// The value as it appears on the wire.
5297    pub fn as_str(&self) -> &str {
5298        match self {
5299            Self::LLM => "llm",
5300            Self::Tool => "tool",
5301            Self::Guardrail => "guardrail",
5302            Self::Memory => "memory",
5303            Self::Condition => "condition",
5304            Self::Input => "input",
5305            Self::Output => "output",
5306            Self::Other(value) => value.as_str(),
5307        }
5308    }
5309}
5310
5311impl std::fmt::Display for CanvasNodeType {
5312    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5313        f.write_str(self.as_str())
5314    }
5315}
5316
5317impl From<&str> for CanvasNodeType {
5318    fn from(value: &str) -> Self {
5319        match value {
5320            "llm" => Self::LLM,
5321            "tool" => Self::Tool,
5322            "guardrail" => Self::Guardrail,
5323            "memory" => Self::Memory,
5324            "condition" => Self::Condition,
5325            "input" => Self::Input,
5326            "output" => Self::Output,
5327            other => Self::Other(other.to_string()),
5328        }
5329    }
5330}
5331
5332/// `CanvasWorkflowStep` model.
5333#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5334pub struct CanvasWorkflowStep {
5335    /// The agent this step runs. An entry without it is silently discarded.
5336    pub agent_id: String,
5337    /// Display name for the step; falls back to the agent's own name.
5338    #[serde(default, skip_serializing_if = "Option::is_none")]
5339    pub label: Option<String>,
5340    /// Per-step instruction. Carried through the SCHEDULE too — dropping it there made every
5341    /// scheduled run fall back to the bare label while the manual run honoured it.
5342    #[serde(default, skip_serializing_if = "Option::is_none")]
5343    pub prompt: Option<String>,
5344}
5345
5346/// `CastBallotRequest` model.
5347#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5348pub struct CastBallotRequest {
5349    pub agent_id: String,
5350    pub vote: String,
5351    /// Voting weight; 0 \< w ≤ 1 (the same cap the cast_vote tool applies; 100 was accepted until
5352    /// 2026-09-16).
5353    #[serde(default, skip_serializing_if = "Option::is_none")]
5354    pub weight: Option<f64>,
5355    #[serde(default, skip_serializing_if = "Option::is_none")]
5356    pub reasoning: Option<String>,
5357    /// Optional cryptographic ballot signature.
5358    #[serde(default, skip_serializing_if = "Option::is_none")]
5359    pub signature: Option<String>,
5360}
5361
5362/// `ChatCompletionRequest` model.
5363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5364pub struct ChatCompletionRequest {
5365    /// Agent ID or 'agent/\<agent_id\>'
5366    pub model: String,
5367    pub messages: Vec<ChatCompletionRequestMessage>,
5368    #[serde(default, skip_serializing_if = "Option::is_none")]
5369    pub temperature: Option<f64>,
5370    /// Values below 1 are clamped, not refused.
5371    #[serde(default, skip_serializing_if = "Option::is_none")]
5372    pub max_tokens: Option<i64>,
5373    /// Server default: `false`.
5374    #[serde(default, skip_serializing_if = "Option::is_none")]
5375    pub stream: Option<bool>,
5376    #[serde(default, skip_serializing_if = "Option::is_none")]
5377    pub tools: Option<Vec<ChatCompletionRequestTool>>,
5378    #[serde(default, skip_serializing_if = "Option::is_none")]
5379    pub tool_choice: Option<serde_json::Value>,
5380}
5381
5382/// `ChatCompletionRequestMessage` model.
5383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5384pub struct ChatCompletionRequestMessage {
5385    #[serde(default, skip_serializing_if = "Option::is_none")]
5386    pub role: Option<ChatCompletionRequestMessageRole>,
5387    #[serde(default, skip_serializing_if = "Option::is_none")]
5388    pub content: Option<String>,
5389}
5390
5391/// `ChatCompletionRequestMessageRole` enumeration.
5392#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5393pub enum ChatCompletionRequestMessageRole {
5394    #[default]
5395    #[serde(rename = "system")]
5396    System,
5397    #[serde(rename = "user")]
5398    User,
5399    #[serde(rename = "assistant")]
5400    Assistant,
5401    #[serde(rename = "tool")]
5402    Tool,
5403    /// A value the API introduced after this SDK was generated.
5404    #[serde(untagged)]
5405    Other(String),
5406}
5407
5408impl ChatCompletionRequestMessageRole {
5409    /// The value as it appears on the wire.
5410    pub fn as_str(&self) -> &str {
5411        match self {
5412            Self::System => "system",
5413            Self::User => "user",
5414            Self::Assistant => "assistant",
5415            Self::Tool => "tool",
5416            Self::Other(value) => value.as_str(),
5417        }
5418    }
5419}
5420
5421impl std::fmt::Display for ChatCompletionRequestMessageRole {
5422    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5423        f.write_str(self.as_str())
5424    }
5425}
5426
5427impl From<&str> for ChatCompletionRequestMessageRole {
5428    fn from(value: &str) -> Self {
5429        match value {
5430            "system" => Self::System,
5431            "user" => Self::User,
5432            "assistant" => Self::Assistant,
5433            "tool" => Self::Tool,
5434            other => Self::Other(other.to_string()),
5435        }
5436    }
5437}
5438
5439/// `ChatCompletionRequestTool` model.
5440#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5441pub struct ChatCompletionRequestTool {
5442    pub r#type: OpenAiToolCallType,
5443    pub function: ChatCompletionRequestToolFunction,
5444}
5445
5446/// `ChatCompletionRequestToolFunction` model.
5447#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5448pub struct ChatCompletionRequestToolFunction {
5449    pub name: String,
5450    pub description: String,
5451    /// JSON Schema Draft 2020-12 for tool parameters
5452    #[serde(default, skip_serializing_if = "Option::is_none")]
5453    pub parameters: Option<serde_json::Map<String, serde_json::Value>>,
5454}
5455
5456/// types/llm.ts ChatMessage — the model-facing message a checkpoint stores.
5457#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5458pub struct ChatMessage {
5459    pub role: ChatMessageRole,
5460    pub content: serde_json::Value,
5461    #[serde(default, skip_serializing_if = "Option::is_none")]
5462    pub name: Option<String>,
5463    #[serde(default, skip_serializing_if = "Option::is_none")]
5464    pub tool_call_id: Option<String>,
5465    #[serde(default, skip_serializing_if = "Option::is_none")]
5466    pub tool_calls: Option<Vec<ChatMessageToolCall>>,
5467    #[serde(default, skip_serializing_if = "Option::is_none")]
5468    pub reasoning_content: Option<String>,
5469}
5470
5471/// `ChatMessageContentVariant2item` model.
5472#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5473pub struct ChatMessageContentVariant2item {
5474    pub r#type: ChatMessageContentVariant2itemType,
5475    #[serde(default, skip_serializing_if = "Option::is_none")]
5476    pub text: Option<String>,
5477    #[serde(default, skip_serializing_if = "Option::is_none")]
5478    pub media: Option<serde_json::Map<String, serde_json::Value>>,
5479}
5480
5481/// `ChatMessageContentVariant2itemType` enumeration.
5482#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5483pub enum ChatMessageContentVariant2itemType {
5484    #[default]
5485    #[serde(rename = "text")]
5486    Text,
5487    #[serde(rename = "image")]
5488    Image,
5489    #[serde(rename = "audio")]
5490    Audio,
5491    #[serde(rename = "video")]
5492    Video,
5493    #[serde(rename = "file")]
5494    File,
5495    /// A value the API introduced after this SDK was generated.
5496    #[serde(untagged)]
5497    Other(String),
5498}
5499
5500impl ChatMessageContentVariant2itemType {
5501    /// The value as it appears on the wire.
5502    pub fn as_str(&self) -> &str {
5503        match self {
5504            Self::Text => "text",
5505            Self::Image => "image",
5506            Self::Audio => "audio",
5507            Self::Video => "video",
5508            Self::File => "file",
5509            Self::Other(value) => value.as_str(),
5510        }
5511    }
5512}
5513
5514impl std::fmt::Display for ChatMessageContentVariant2itemType {
5515    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5516        f.write_str(self.as_str())
5517    }
5518}
5519
5520impl From<&str> for ChatMessageContentVariant2itemType {
5521    fn from(value: &str) -> Self {
5522        match value {
5523            "text" => Self::Text,
5524            "image" => Self::Image,
5525            "audio" => Self::Audio,
5526            "video" => Self::Video,
5527            "file" => Self::File,
5528            other => Self::Other(other.to_string()),
5529        }
5530    }
5531}
5532
5533/// `ChatMessageRole` enumeration.
5534#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5535pub enum ChatMessageRole {
5536    #[default]
5537    #[serde(rename = "user")]
5538    User,
5539    #[serde(rename = "assistant")]
5540    Assistant,
5541    #[serde(rename = "system")]
5542    System,
5543    #[serde(rename = "tool")]
5544    Tool,
5545    /// A value the API introduced after this SDK was generated.
5546    #[serde(untagged)]
5547    Other(String),
5548}
5549
5550impl ChatMessageRole {
5551    /// The value as it appears on the wire.
5552    pub fn as_str(&self) -> &str {
5553        match self {
5554            Self::User => "user",
5555            Self::Assistant => "assistant",
5556            Self::System => "system",
5557            Self::Tool => "tool",
5558            Self::Other(value) => value.as_str(),
5559        }
5560    }
5561}
5562
5563impl std::fmt::Display for ChatMessageRole {
5564    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5565        f.write_str(self.as_str())
5566    }
5567}
5568
5569impl From<&str> for ChatMessageRole {
5570    fn from(value: &str) -> Self {
5571        match value {
5572            "user" => Self::User,
5573            "assistant" => Self::Assistant,
5574            "system" => Self::System,
5575            "tool" => Self::Tool,
5576            other => Self::Other(other.to_string()),
5577        }
5578    }
5579}
5580
5581/// `ChatMessageToolCall` model.
5582#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5583pub struct ChatMessageToolCall {
5584    pub id: String,
5585    pub name: String,
5586    pub arguments: serde_json::Map<String, serde_json::Value>,
5587}
5588
5589/// `CheckGovernanceRequest` model.
5590#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5591pub struct CheckGovernanceRequest {
5592    pub agent_id: String,
5593    pub action: String,
5594    #[serde(default, skip_serializing_if = "Option::is_none")]
5595    pub run_id: Option<String>,
5596    #[serde(default, skip_serializing_if = "Option::is_none")]
5597    pub team_id: Option<String>,
5598}
5599
5600/// `CheckSpawnPermissionRequest` model.
5601#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5602pub struct CheckSpawnPermissionRequest {
5603    pub parent_agent_id: String,
5604    pub child_permissions: PermissionSet,
5605}
5606
5607/// `ClearBillingBudgetResponse` model.
5608#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5609pub struct ClearBillingBudgetResponse {
5610    #[serde(default, skip_serializing_if = "Option::is_none")]
5611    pub configured: Option<bool>,
5612    #[serde(default, skip_serializing_if = "Option::is_none")]
5613    pub budget: Option<serde_json::Map<String, serde_json::Value>>,
5614}
5615
5616/// `CloseSessionResponse` model.
5617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5618pub struct CloseSessionResponse {
5619    pub deleted: bool,
5620    pub session_id: String,
5621}
5622
5623/// Autonomous agent company — strategist + teams pursuing strategic goals.
5624#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5625pub struct Company {
5626    pub company_id: String,
5627    pub tenant_id: String,
5628    pub name: String,
5629    #[serde(default, skip_serializing_if = "Option::is_none")]
5630    pub description: Option<String>,
5631    #[serde(default, skip_serializing_if = "Option::is_none")]
5632    pub mission: Option<String>,
5633    #[serde(default, skip_serializing_if = "Option::is_none")]
5634    pub strategic_goals: Option<Vec<StrategicGoal>>,
5635    pub strategist_agent_id: String,
5636    #[serde(default, skip_serializing_if = "Option::is_none")]
5637    pub team_ids: Option<Vec<String>>,
5638    #[serde(default, skip_serializing_if = "Option::is_none")]
5639    pub created_agent_ids: Option<Vec<String>>,
5640    #[serde(default, skip_serializing_if = "Option::is_none")]
5641    pub budget: Option<serde_json::Map<String, serde_json::Value>>,
5642    #[serde(default, skip_serializing_if = "Option::is_none")]
5643    pub status: Option<String>,
5644    #[serde(default, skip_serializing_if = "Option::is_none")]
5645    pub config: Option<serde_json::Map<String, serde_json::Value>>,
5646    #[serde(default, skip_serializing_if = "Option::is_none")]
5647    pub workspace_id: Option<String>,
5648    #[serde(default, skip_serializing_if = "Option::is_none")]
5649    pub created_at: Option<String>,
5650    #[serde(default, skip_serializing_if = "Option::is_none")]
5651    pub updated_at: Option<String>,
5652    /// When the company loop last ATTEMPTED a tick, success or failure. The tick schedule is
5653    /// computed from this (falling back to updated_at while absent), so an ordinary edit no longer
5654    /// postpones the next tick.
5655    #[serde(default, skip_serializing_if = "Option::is_none")]
5656    pub last_tick_at: Option<String>,
5657    /// When the company loop last completed a tick whose strategist run SUCCEEDED. The `stuck`
5658    /// escalation reads this (falling back to updated_at while absent).
5659    #[serde(default, skip_serializing_if = "Option::is_none")]
5660    pub last_successful_tick_at: Option<String>,
5661}
5662
5663/// companies.ts — a company_activity row; `success` only when recorded.
5664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5665pub struct CompanyActivityEntry {
5666    #[serde(default, skip_serializing_if = "Option::is_none")]
5667    pub run_id: Option<String>,
5668    #[serde(default, skip_serializing_if = "Option::is_none")]
5669    pub created_at: Option<String>,
5670    #[serde(default, skip_serializing_if = "Option::is_none")]
5671    pub success: Option<bool>,
5672}
5673
5674/// Body for `POST /api/v1/companies` (`CreateCompanySchema`).
5675#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5676pub struct CompanyCreate {
5677    pub name: String,
5678    /// What the company exists to do.
5679    pub mission: String,
5680    /// Spend ceiling and pacing for the company.
5681    pub budget: CompanyCreateBudget,
5682    #[serde(default, skip_serializing_if = "Option::is_none")]
5683    pub description: Option<String>,
5684    #[serde(default, skip_serializing_if = "Option::is_none")]
5685    pub strategic_goals: Option<Vec<String>>,
5686    #[serde(default, skip_serializing_if = "Option::is_none")]
5687    pub config: Option<serde_json::Map<String, serde_json::Value>>,
5688    #[serde(default, skip_serializing_if = "Option::is_none")]
5689    pub workspace_id: Option<String>,
5690}
5691
5692/// Spend ceiling and pacing for the company.
5693#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5694pub struct CompanyCreateBudget {
5695    pub total_usd: f64,
5696    pub daily_limit_usd: f64,
5697    pub alert_threshold_pct: f64,
5698    /// Metered by the platform. Ignored on create (set to 0) and on update.
5699    #[serde(default, skip_serializing_if = "Option::is_none")]
5700    pub spent_usd: Option<f64>,
5701}
5702
5703/// Body for `PUT /api/v1/companies/{companyId}`. Every field optional — send only what changes.
5704#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5705pub struct CompanyUpdate {
5706    #[serde(default, skip_serializing_if = "Option::is_none")]
5707    pub name: Option<String>,
5708    #[serde(default, skip_serializing_if = "Option::is_none")]
5709    pub mission: Option<String>,
5710    #[serde(default, skip_serializing_if = "Option::is_none")]
5711    pub budget: Option<f64>,
5712    #[serde(default, skip_serializing_if = "Option::is_none")]
5713    pub description: Option<String>,
5714    #[serde(default, skip_serializing_if = "Option::is_none")]
5715    pub strategic_goals: Option<Vec<String>>,
5716    #[serde(default, skip_serializing_if = "Option::is_none")]
5717    pub config: Option<serde_json::Map<String, serde_json::Value>>,
5718}
5719
5720/// `CompleteOAuthLoginResponse` model.
5721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5722pub struct CompleteOAuthLoginResponse {
5723    pub api_key: String,
5724    pub email: String,
5725}
5726
5727/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z; api/lib/conformity-report.ts
5728/// — three sections, plus the same content as markdown. `?format=markdown` answers
5729/// text/markdown instead.
5730#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5731pub struct ConformityReport {
5732    pub tenant_id: String,
5733    pub sections: Vec<ConformityReportSection>,
5734    pub markdown: String,
5735}
5736
5737/// `ConformityReportSection` model.
5738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5739pub struct ConformityReportSection {
5740    pub title: String,
5741    pub content: String,
5742}
5743
5744/// `ConnectorConfigField` model.
5745#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5746pub struct ConnectorConfigField {
5747    pub r#type: String,
5748    #[serde(default, skip_serializing_if = "Option::is_none")]
5749    pub required: Option<bool>,
5750    #[serde(default, skip_serializing_if = "Option::is_none")]
5751    pub description: Option<String>,
5752}
5753
5754/// `ConstitutionAmendment` model.
5755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5756pub struct ConstitutionAmendment {
5757    pub amendment_id: String,
5758    pub rule_id: String,
5759    pub action: ConstitutionAmendmentAction,
5760    /// The new rule, for `add` and `modify`. Absent on `remove`.
5761    #[serde(default, skip_serializing_if = "Option::is_none")]
5762    pub rule: Option<ConstitutionRule>,
5763    pub proposed_by: String,
5764    /// The founder, or the consensus that carried it.
5765    pub approved_by: String,
5766    pub rationale: String,
5767    pub applied_at: String,
5768}
5769
5770/// `ConstitutionAmendmentAction` enumeration.
5771#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5772pub enum ConstitutionAmendmentAction {
5773    #[default]
5774    #[serde(rename = "add")]
5775    Add,
5776    #[serde(rename = "modify")]
5777    Modify,
5778    #[serde(rename = "remove")]
5779    Remove,
5780    /// A value the API introduced after this SDK was generated.
5781    #[serde(untagged)]
5782    Other(String),
5783}
5784
5785impl ConstitutionAmendmentAction {
5786    /// The value as it appears on the wire.
5787    pub fn as_str(&self) -> &str {
5788        match self {
5789            Self::Add => "add",
5790            Self::Modify => "modify",
5791            Self::Remove => "remove",
5792            Self::Other(value) => value.as_str(),
5793        }
5794    }
5795}
5796
5797impl std::fmt::Display for ConstitutionAmendmentAction {
5798    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5799        f.write_str(self.as_str())
5800    }
5801}
5802
5803impl From<&str> for ConstitutionAmendmentAction {
5804    fn from(value: &str) -> Self {
5805        match value {
5806            "add" => Self::Add,
5807            "modify" => Self::Modify,
5808            "remove" => Self::Remove,
5809            other => Self::Other(other.to_string()),
5810        }
5811    }
5812}
5813
5814/// `ConstitutionDocument` model.
5815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5816pub struct ConstitutionDocument {
5817    pub tenant_id: String,
5818    pub version: i64,
5819    pub rules: Vec<ConstitutionRule>,
5820    pub amendments: Vec<ConstitutionAmendment>,
5821    /// Who created the genesis document.
5822    pub founder_id: String,
5823    pub created_at: String,
5824    /// Present and `true` only when no document is stored and these are the genesis defaults
5825    /// computed on read; absent on a stored document (measured 2026-09-10).
5826    #[serde(default, skip_serializing_if = "Option::is_none")]
5827    pub r#virtual: Option<bool>,
5828    pub updated_at: String,
5829}
5830
5831/// `ConstitutionRule` model.
5832#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5833pub struct ConstitutionRule {
5834    /// Stable slug, e.g. `no-privilege-escalation`.
5835    pub id: String,
5836    pub rule_type: ConstitutionRuleRuleType,
5837    /// Who the rule binds. The document previously listed `global`/`tenant`/`agent`, none of which
5838    /// the server has ever emitted.
5839    pub scope: ConstitutionRuleScope,
5840    /// Agent ids, team ids or role names, depending on `scope`. Absent for `all_agents`.
5841    #[serde(default, skip_serializing_if = "Option::is_none")]
5842    pub scope_targets: Option<Vec<String>>,
5843    /// The action the rule governs, e.g. `modify_constitution`.
5844    pub action: String,
5845    /// For `requirement` rules: the action that must be performed.
5846    #[serde(default, skip_serializing_if = "Option::is_none")]
5847    pub obligated_action: Option<String>,
5848    pub penalty: ConstitutionRulePenalty,
5849    #[serde(default, skip_serializing_if = "Option::is_none")]
5850    pub description: Option<String>,
5851    /// Genesis rules cannot be amended or removed.
5852    #[serde(default, skip_serializing_if = "Option::is_none")]
5853    pub immutable: Option<bool>,
5854    /// Conflict resolution — higher wins. Defaults to 0.
5855    #[serde(default, skip_serializing_if = "Option::is_none")]
5856    pub priority: Option<i64>,
5857    /// True when no code path can ever raise this rule — the platform emits no such action (the
5858    /// constitution digest lists it under ADVISORY and boot logs "Constitution rules that can never
5859    /// fire"). A rulebook used to show these as enforced and LOCKED over an audit page with no such
5860    /// entries. Served since 2026-09-11; absent on older servers means unknown, not false.
5861    #[serde(default, skip_serializing_if = "Option::is_none")]
5862    pub advisory: Option<bool>,
5863}
5864
5865/// `ConstitutionRulePenalty` enumeration.
5866#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5867pub enum ConstitutionRulePenalty {
5868    #[default]
5869    #[serde(rename = "block")]
5870    Block,
5871    #[serde(rename = "warn")]
5872    Warn,
5873    #[serde(rename = "log")]
5874    Log,
5875    #[serde(rename = "terminate_agent")]
5876    TerminateAgent,
5877    #[serde(rename = "revoke_permissions")]
5878    RevokePermissions,
5879    /// A value the API introduced after this SDK was generated.
5880    #[serde(untagged)]
5881    Other(String),
5882}
5883
5884impl ConstitutionRulePenalty {
5885    /// The value as it appears on the wire.
5886    pub fn as_str(&self) -> &str {
5887        match self {
5888            Self::Block => "block",
5889            Self::Warn => "warn",
5890            Self::Log => "log",
5891            Self::TerminateAgent => "terminate_agent",
5892            Self::RevokePermissions => "revoke_permissions",
5893            Self::Other(value) => value.as_str(),
5894        }
5895    }
5896}
5897
5898impl std::fmt::Display for ConstitutionRulePenalty {
5899    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5900        f.write_str(self.as_str())
5901    }
5902}
5903
5904impl From<&str> for ConstitutionRulePenalty {
5905    fn from(value: &str) -> Self {
5906        match value {
5907            "block" => Self::Block,
5908            "warn" => Self::Warn,
5909            "log" => Self::Log,
5910            "terminate_agent" => Self::TerminateAgent,
5911            "revoke_permissions" => Self::RevokePermissions,
5912            other => Self::Other(other.to_string()),
5913        }
5914    }
5915}
5916
5917/// `ConstitutionRuleRuleType` enumeration.
5918#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5919pub enum ConstitutionRuleRuleType {
5920    #[default]
5921    #[serde(rename = "prohibition")]
5922    Prohibition,
5923    #[serde(rename = "requirement")]
5924    Requirement,
5925    #[serde(rename = "permission")]
5926    Permission,
5927    /// A value the API introduced after this SDK was generated.
5928    #[serde(untagged)]
5929    Other(String),
5930}
5931
5932impl ConstitutionRuleRuleType {
5933    /// The value as it appears on the wire.
5934    pub fn as_str(&self) -> &str {
5935        match self {
5936            Self::Prohibition => "prohibition",
5937            Self::Requirement => "requirement",
5938            Self::Permission => "permission",
5939            Self::Other(value) => value.as_str(),
5940        }
5941    }
5942}
5943
5944impl std::fmt::Display for ConstitutionRuleRuleType {
5945    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5946        f.write_str(self.as_str())
5947    }
5948}
5949
5950impl From<&str> for ConstitutionRuleRuleType {
5951    fn from(value: &str) -> Self {
5952        match value {
5953            "prohibition" => Self::Prohibition,
5954            "requirement" => Self::Requirement,
5955            "permission" => Self::Permission,
5956            other => Self::Other(other.to_string()),
5957        }
5958    }
5959}
5960
5961/// Who the rule binds. The document previously listed `global`/`tenant`/`agent`, none of which
5962/// the server has ever emitted.
5963#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
5964pub enum ConstitutionRuleScope {
5965    #[default]
5966    #[serde(rename = "all_agents")]
5967    AllAgents,
5968    #[serde(rename = "team")]
5969    Team,
5970    #[serde(rename = "agent")]
5971    Agent,
5972    #[serde(rename = "role")]
5973    Role,
5974    /// A value the API introduced after this SDK was generated.
5975    #[serde(untagged)]
5976    Other(String),
5977}
5978
5979impl ConstitutionRuleScope {
5980    /// The value as it appears on the wire.
5981    pub fn as_str(&self) -> &str {
5982        match self {
5983            Self::AllAgents => "all_agents",
5984            Self::Team => "team",
5985            Self::Agent => "agent",
5986            Self::Role => "role",
5987            Self::Other(value) => value.as_str(),
5988        }
5989    }
5990}
5991
5992impl std::fmt::Display for ConstitutionRuleScope {
5993    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5994        f.write_str(self.as_str())
5995    }
5996}
5997
5998impl From<&str> for ConstitutionRuleScope {
5999    fn from(value: &str) -> Self {
6000        match value {
6001            "all_agents" => Self::AllAgents,
6002            "team" => Self::Team,
6003            "agent" => Self::Agent,
6004            "role" => Self::Role,
6005            other => Self::Other(other.to_string()),
6006        }
6007    }
6008}
6009
6010/// `ConstitutionViolation` model.
6011#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6012pub struct ConstitutionViolation {
6013    pub rule_id: String,
6014    pub rule_type: ConstitutionRuleRuleType,
6015    pub action: String,
6016    pub agent_id: String,
6017    pub penalty: ConstitutionRulePenalty,
6018    #[serde(default, skip_serializing_if = "Option::is_none")]
6019    pub description: Option<String>,
6020    pub timestamp: String,
6021}
6022
6023/// `ContentReport` model.
6024#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6025pub struct ContentReport {
6026    pub id: String,
6027    pub target_type: ContentReportInputTargetType,
6028    pub target_id: String,
6029    pub reason: ContentReportInputReason,
6030    #[serde(default, skip_serializing_if = "Option::is_none")]
6031    pub details: Option<String>,
6032    /// Tenant that owns the reported content — the queue this report lands in.
6033    pub tenant_id: String,
6034    #[serde(default, skip_serializing_if = "Option::is_none")]
6035    pub agent_id: Option<String>,
6036    #[serde(default, skip_serializing_if = "Option::is_none")]
6037    pub session_id: Option<String>,
6038    pub origin: ContentReportOrigin,
6039    #[serde(default, skip_serializing_if = "Option::is_none")]
6040    pub reporter_tenant_id: Option<String>,
6041    #[serde(default, skip_serializing_if = "Option::is_none")]
6042    pub reporter_user_id: Option<String>,
6043    /// Truncated SHA-256 of the reporter's IP. Never the raw address; enough to spot one source
6044    /// flooding the queue.
6045    #[serde(default, skip_serializing_if = "Option::is_none")]
6046    pub reporter_fingerprint: Option<String>,
6047    pub status: ContentReportStatus,
6048    pub severity: ContentReportSeverity,
6049    pub created_at: String,
6050}
6051
6052/// `ContentReportAccepted` model.
6053#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6054pub struct ContentReportAccepted {
6055    pub report_id: String,
6056    pub status: ContentReportAcceptedStatus,
6057}
6058
6059/// `ContentReportAcceptedStatus` enumeration.
6060#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6061pub enum ContentReportAcceptedStatus {
6062    #[default]
6063    #[serde(rename = "received")]
6064    Received,
6065    /// A value the API introduced after this SDK was generated.
6066    #[serde(untagged)]
6067    Other(String),
6068}
6069
6070impl ContentReportAcceptedStatus {
6071    /// The value as it appears on the wire.
6072    pub fn as_str(&self) -> &str {
6073        match self {
6074            Self::Received => "received",
6075            Self::Other(value) => value.as_str(),
6076        }
6077    }
6078}
6079
6080impl std::fmt::Display for ContentReportAcceptedStatus {
6081    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6082        f.write_str(self.as_str())
6083    }
6084}
6085
6086impl From<&str> for ContentReportAcceptedStatus {
6087    fn from(value: &str) -> Self {
6088        match value {
6089            "received" => Self::Received,
6090            other => Self::Other(other.to_string()),
6091        }
6092    }
6093}
6094
6095/// An abuse/moderation report. Same body shape for the authenticated and anonymous endpoints.
6096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6097pub struct ContentReportInput {
6098    pub target_type: ContentReportInputTargetType,
6099    pub target_id: String,
6100    /// Closed vocabulary — unknown values are rejected with 422. `self_harm` raises the resulting
6101    /// operator notification to critical priority.
6102    pub reason: ContentReportInputReason,
6103    /// Optional free-text note from the reporter.
6104    #[serde(default, skip_serializing_if = "Option::is_none")]
6105    pub details: Option<String>,
6106}
6107
6108/// Closed vocabulary — unknown values are rejected with 422. `self_harm` raises the resulting
6109/// operator notification to critical priority.
6110#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6111pub enum ContentReportInputReason {
6112    #[default]
6113    #[serde(rename = "harassment")]
6114    Harassment,
6115    #[serde(rename = "hate")]
6116    Hate,
6117    #[serde(rename = "sexual")]
6118    Sexual,
6119    #[serde(rename = "violence")]
6120    Violence,
6121    #[serde(rename = "self_harm")]
6122    SelfHarm,
6123    #[serde(rename = "illegal")]
6124    Illegal,
6125    #[serde(rename = "spam")]
6126    Spam,
6127    #[serde(rename = "other")]
6128    Other,
6129    /// A value the API introduced after this SDK was generated.
6130    #[serde(untagged)]
6131    Unknown(String),
6132}
6133
6134impl ContentReportInputReason {
6135    /// The value as it appears on the wire.
6136    pub fn as_str(&self) -> &str {
6137        match self {
6138            Self::Harassment => "harassment",
6139            Self::Hate => "hate",
6140            Self::Sexual => "sexual",
6141            Self::Violence => "violence",
6142            Self::SelfHarm => "self_harm",
6143            Self::Illegal => "illegal",
6144            Self::Spam => "spam",
6145            Self::Other => "other",
6146            Self::Unknown(value) => value.as_str(),
6147        }
6148    }
6149}
6150
6151impl std::fmt::Display for ContentReportInputReason {
6152    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6153        f.write_str(self.as_str())
6154    }
6155}
6156
6157impl From<&str> for ContentReportInputReason {
6158    fn from(value: &str) -> Self {
6159        match value {
6160            "harassment" => Self::Harassment,
6161            "hate" => Self::Hate,
6162            "sexual" => Self::Sexual,
6163            "violence" => Self::Violence,
6164            "self_harm" => Self::SelfHarm,
6165            "illegal" => Self::Illegal,
6166            "spam" => Self::Spam,
6167            "other" => Self::Other,
6168            other => Self::Unknown(other.to_string()),
6169        }
6170    }
6171}
6172
6173/// `ContentReportInputTargetType` enumeration.
6174#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6175pub enum ContentReportInputTargetType {
6176    #[default]
6177    #[serde(rename = "message")]
6178    Message,
6179    #[serde(rename = "session")]
6180    Session,
6181    #[serde(rename = "agent")]
6182    Agent,
6183    /// A value the API introduced after this SDK was generated.
6184    #[serde(untagged)]
6185    Other(String),
6186}
6187
6188impl ContentReportInputTargetType {
6189    /// The value as it appears on the wire.
6190    pub fn as_str(&self) -> &str {
6191        match self {
6192            Self::Message => "message",
6193            Self::Session => "session",
6194            Self::Agent => "agent",
6195            Self::Other(value) => value.as_str(),
6196        }
6197    }
6198}
6199
6200impl std::fmt::Display for ContentReportInputTargetType {
6201    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6202        f.write_str(self.as_str())
6203    }
6204}
6205
6206impl From<&str> for ContentReportInputTargetType {
6207    fn from(value: &str) -> Self {
6208        match value {
6209            "message" => Self::Message,
6210            "session" => Self::Session,
6211            "agent" => Self::Agent,
6212            other => Self::Other(other.to_string()),
6213        }
6214    }
6215}
6216
6217/// `ContentReportOrigin` enumeration.
6218#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6219pub enum ContentReportOrigin {
6220    #[default]
6221    #[serde(rename = "authenticated")]
6222    Authenticated,
6223    #[serde(rename = "public_session")]
6224    PublicSession,
6225    /// A value the API introduced after this SDK was generated.
6226    #[serde(untagged)]
6227    Other(String),
6228}
6229
6230impl ContentReportOrigin {
6231    /// The value as it appears on the wire.
6232    pub fn as_str(&self) -> &str {
6233        match self {
6234            Self::Authenticated => "authenticated",
6235            Self::PublicSession => "public_session",
6236            Self::Other(value) => value.as_str(),
6237        }
6238    }
6239}
6240
6241impl std::fmt::Display for ContentReportOrigin {
6242    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6243        f.write_str(self.as_str())
6244    }
6245}
6246
6247impl From<&str> for ContentReportOrigin {
6248    fn from(value: &str) -> Self {
6249        match value {
6250            "authenticated" => Self::Authenticated,
6251            "public_session" => Self::PublicSession,
6252            other => Self::Other(other.to_string()),
6253        }
6254    }
6255}
6256
6257/// `ContentReportSeverity` enumeration.
6258#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6259pub enum ContentReportSeverity {
6260    #[default]
6261    #[serde(rename = "critical")]
6262    Critical,
6263    #[serde(rename = "high")]
6264    High,
6265    #[serde(rename = "normal")]
6266    Normal,
6267    /// A value the API introduced after this SDK was generated.
6268    #[serde(untagged)]
6269    Other(String),
6270}
6271
6272impl ContentReportSeverity {
6273    /// The value as it appears on the wire.
6274    pub fn as_str(&self) -> &str {
6275        match self {
6276            Self::Critical => "critical",
6277            Self::High => "high",
6278            Self::Normal => "normal",
6279            Self::Other(value) => value.as_str(),
6280        }
6281    }
6282}
6283
6284impl std::fmt::Display for ContentReportSeverity {
6285    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6286        f.write_str(self.as_str())
6287    }
6288}
6289
6290impl From<&str> for ContentReportSeverity {
6291    fn from(value: &str) -> Self {
6292        match value {
6293            "critical" => Self::Critical,
6294            "high" => Self::High,
6295            "normal" => Self::Normal,
6296            other => Self::Other(other.to_string()),
6297        }
6298    }
6299}
6300
6301/// `ContentReportStatus` enumeration.
6302#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6303pub enum ContentReportStatus {
6304    #[default]
6305    #[serde(rename = "received")]
6306    Received,
6307    #[serde(rename = "reviewing")]
6308    Reviewing,
6309    #[serde(rename = "actioned")]
6310    Actioned,
6311    #[serde(rename = "dismissed")]
6312    Dismissed,
6313    /// A value the API introduced after this SDK was generated.
6314    #[serde(untagged)]
6315    Other(String),
6316}
6317
6318impl ContentReportStatus {
6319    /// The value as it appears on the wire.
6320    pub fn as_str(&self) -> &str {
6321        match self {
6322            Self::Received => "received",
6323            Self::Reviewing => "reviewing",
6324            Self::Actioned => "actioned",
6325            Self::Dismissed => "dismissed",
6326            Self::Other(value) => value.as_str(),
6327        }
6328    }
6329}
6330
6331impl std::fmt::Display for ContentReportStatus {
6332    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6333        f.write_str(self.as_str())
6334    }
6335}
6336
6337impl From<&str> for ContentReportStatus {
6338    fn from(value: &str) -> Self {
6339        match value {
6340            "received" => Self::Received,
6341            "reviewing" => Self::Reviewing,
6342            "actioned" => Self::Actioned,
6343            "dismissed" => Self::Dismissed,
6344            other => Self::Other(other.to_string()),
6345        }
6346    }
6347}
6348
6349/// `ContinueRunRequest` model.
6350#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6351pub struct ContinueRunRequest {
6352    /// Opaque base64-encoded continuation token
6353    pub continuation_token: String,
6354}
6355
6356/// `ContinueRunResponse` model.
6357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6358pub struct ContinueRunResponse {
6359    pub continued: bool,
6360    pub run_id: String,
6361    #[serde(default, skip_serializing_if = "Option::is_none")]
6362    pub checkpoint: Option<String>,
6363    #[serde(default, skip_serializing_if = "Option::is_none")]
6364    pub resume_step: Option<i64>,
6365}
6366
6367/// One entry of a session transcript — what GET /sessions/{sessionId}/messages serves in both
6368/// `messages` and `items` (types/session.ts ConversationEntry, enriched on read by sessions.ts
6369/// with the run's metrics and cost). Measured 2026-09-10 on e2e-canon: a user turn carries
6370/// role, content, run_id, timestamp, compacted, importance; an assistant turn adds tool_calls,
6371/// thinking, run_metrics, cost_usd.
6372#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6373pub struct ConversationEntry {
6374    /// The stable id of this entry — derived on read (lib/message-ids.ts), never stored, so every
6375    /// transcript has it: the first user turn of a run is `{run_id}`, the first assistant reply
6376    /// `{run_id}-reply`, further replies `{run_id}-reply-2`…, a second human turn of the same run
6377    /// `{run_id}-user-2`… (lib/message-ids.ts:16-19), tool results `{run_id}-tool-N` and system
6378    /// entries `{run_id}-system-N` numbered from 1 (the first is `-tool-1`, never bare `-tool`).
6379    /// Counted per run over the whole history before compaction, so it does not move. This is the
6380    /// canonical `message_id` for reactions (PUT /runs/{runId}/feedback), bookmarks
6381    /// (/agents/{agentId}/bookmarks/{messageId}) and annotations (POST
6382    /// /sessions/{sessionId}/annotations); it is a safe path segment.
6383    pub message_id: String,
6384    pub role: PublicSessionViewMessageRole,
6385    /// The text, or content parts for a multimodal turn (types/llm.ts MessageContent). v1 emits the
6386    /// string arm: every writer (renderUserTurn, SessionMessageSchema.content,
6387    /// ImportSessionMessageSchema) stores a string, and every stored entry on production is one (8
6388    /// 427 of 8 427, measured 2026-09-11). The array arm is the LLM wire type (types/llm.ts
6389    /// MessageContent) the schema inherits; a v2 server accepts only the string.
6390    pub content: serde_json::Value,
6391    pub run_id: String,
6392    pub timestamp: String,
6393    #[serde(default, skip_serializing_if = "Option::is_none")]
6394    pub compacted: Option<bool>,
6395    /// Persisted on assistant entries when the run executed tools. Reload re-paints these blocks
6396    /// underneath the assistant turn (matches what the SSE stream renders during the live run).
6397    #[serde(default, skip_serializing_if = "Option::is_none")]
6398    pub tool_calls: Option<Vec<ConversationEntryToolCall>>,
6399    /// Reasoning / thinking content (DeepSeek `reasoning_content`, Anthropic extended thinking,
6400    /// GLM/Qwen `\<think\>` blocks). Persisted on assistant entries so reload re-paints the
6401    /// Thinking section above the assistant text.
6402    #[serde(default, skip_serializing_if = "Option::is_none")]
6403    pub thinking: Option<String>,
6404    #[serde(default, skip_serializing_if = "Option::is_none")]
6405    pub importance: Option<ConversationEntryImportance>,
6406    #[serde(default, skip_serializing_if = "Option::is_none")]
6407    pub attachments: Option<Vec<ConversationEntryAttachment>>,
6408    /// On an assistant entry: the run's metrics as served by GET /runs/{runId} (sessions.ts
6409    /// publicRunMetrics).
6410    #[serde(default, skip_serializing_if = "Option::is_none")]
6411    pub run_metrics: Option<ConversationEntryRunMetrics>,
6412    /// On an assistant entry, when the run recorded a cost.
6413    #[serde(default, skip_serializing_if = "Option::is_none")]
6414    pub cost_usd: Option<f64>,
6415    /// The reply came from a run a Todo triggered.
6416    #[serde(default, skip_serializing_if = "Option::is_none")]
6417    pub from_todo: Option<bool>,
6418    /// The model ran out of output tokens — see RunOutput.output_truncated.
6419    #[serde(default, skip_serializing_if = "Option::is_none")]
6420    pub output_truncated: Option<bool>,
6421}
6422
6423/// `ConversationEntryAttachment` model.
6424#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6425pub struct ConversationEntryAttachment {
6426    pub file_id: String,
6427    pub filename: String,
6428    pub mime_type: String,
6429    #[serde(default, skip_serializing_if = "Option::is_none")]
6430    pub size_bytes: Option<i64>,
6431}
6432
6433/// `ConversationEntryContentVariant2item` model.
6434#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6435pub struct ConversationEntryContentVariant2item {
6436    pub r#type: ChatMessageContentVariant2itemType,
6437    #[serde(default, skip_serializing_if = "Option::is_none")]
6438    pub text: Option<String>,
6439    #[serde(default, skip_serializing_if = "Option::is_none")]
6440    pub media: Option<ConversationEntryContentVariant2itemMedia>,
6441}
6442
6443/// `ConversationEntryContentVariant2itemMedia` model.
6444#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6445pub struct ConversationEntryContentVariant2itemMedia {
6446    pub mime_type: String,
6447    #[serde(default, skip_serializing_if = "Option::is_none")]
6448    pub data: Option<String>,
6449    #[serde(default, skip_serializing_if = "Option::is_none")]
6450    pub url: Option<String>,
6451}
6452
6453/// `ConversationEntryImportance` enumeration.
6454#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6455pub enum ConversationEntryImportance {
6456    #[default]
6457    #[serde(rename = "high")]
6458    High,
6459    #[serde(rename = "normal")]
6460    Normal,
6461    /// A value the API introduced after this SDK was generated.
6462    #[serde(untagged)]
6463    Other(String),
6464}
6465
6466impl ConversationEntryImportance {
6467    /// The value as it appears on the wire.
6468    pub fn as_str(&self) -> &str {
6469        match self {
6470            Self::High => "high",
6471            Self::Normal => "normal",
6472            Self::Other(value) => value.as_str(),
6473        }
6474    }
6475}
6476
6477impl std::fmt::Display for ConversationEntryImportance {
6478    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6479        f.write_str(self.as_str())
6480    }
6481}
6482
6483impl From<&str> for ConversationEntryImportance {
6484    fn from(value: &str) -> Self {
6485        match value {
6486            "high" => Self::High,
6487            "normal" => Self::Normal,
6488            other => Self::Other(other.to_string()),
6489        }
6490    }
6491}
6492
6493/// On an assistant entry: the run's metrics as served by GET /runs/{runId} (sessions.ts
6494/// publicRunMetrics).
6495#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6496pub struct ConversationEntryRunMetrics {
6497    /// How the cost was priced (measured 2026-09-10 on e2e-canon; billing/cost-estimator.ts).
6498    #[serde(default, skip_serializing_if = "Option::is_none")]
6499    pub pricing_confidence: Option<String>,
6500    #[serde(default, skip_serializing_if = "Option::is_none")]
6501    pub duration_ms: Option<f64>,
6502    #[serde(default, skip_serializing_if = "Option::is_none")]
6503    pub steps_count: Option<i64>,
6504    #[serde(default, skip_serializing_if = "Option::is_none")]
6505    pub input_tokens: Option<i64>,
6506    #[serde(default, skip_serializing_if = "Option::is_none")]
6507    pub output_tokens: Option<i64>,
6508    #[serde(default, skip_serializing_if = "Option::is_none")]
6509    pub thinking_tokens: Option<i64>,
6510    #[serde(default, skip_serializing_if = "Option::is_none")]
6511    pub tool_calls_count: Option<i64>,
6512    #[serde(default, skip_serializing_if = "Option::is_none")]
6513    pub llm_calls_count: Option<i64>,
6514    #[serde(default, skip_serializing_if = "Option::is_none")]
6515    pub guardrail_checks: Option<i64>,
6516    #[serde(default, skip_serializing_if = "Option::is_none")]
6517    pub guardrail_violations: Option<i64>,
6518    #[serde(default, skip_serializing_if = "Option::is_none")]
6519    pub memory_retrievals: Option<i64>,
6520    #[serde(default, skip_serializing_if = "Option::is_none")]
6521    pub memory_extractions: Option<i64>,
6522    /// Estimated total cost in USD
6523    #[serde(default, skip_serializing_if = "Option::is_none")]
6524    pub total_cost_usd: Option<f64>,
6525}
6526
6527/// `ConversationEntryToolCall` model.
6528#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6529pub struct ConversationEntryToolCall {
6530    pub id: String,
6531    pub name: String,
6532    pub status: ConversationEntryToolCallStatus,
6533    #[serde(default, skip_serializing_if = "Option::is_none")]
6534    pub input: Option<String>,
6535    #[serde(default, skip_serializing_if = "Option::is_none")]
6536    pub output: Option<String>,
6537    #[serde(default, skip_serializing_if = "Option::is_none")]
6538    pub duration_ms: Option<i64>,
6539    #[serde(default, skip_serializing_if = "Option::is_none")]
6540    pub error: Option<String>,
6541}
6542
6543/// `ConversationEntryToolCallStatus` enumeration.
6544#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6545pub enum ConversationEntryToolCallStatus {
6546    #[default]
6547    #[serde(rename = "done")]
6548    Done,
6549    #[serde(rename = "error")]
6550    Error,
6551    /// A value the API introduced after this SDK was generated.
6552    #[serde(untagged)]
6553    Other(String),
6554}
6555
6556impl ConversationEntryToolCallStatus {
6557    /// The value as it appears on the wire.
6558    pub fn as_str(&self) -> &str {
6559        match self {
6560            Self::Done => "done",
6561            Self::Error => "error",
6562            Self::Other(value) => value.as_str(),
6563        }
6564    }
6565}
6566
6567impl std::fmt::Display for ConversationEntryToolCallStatus {
6568    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6569        f.write_str(self.as_str())
6570    }
6571}
6572
6573impl From<&str> for ConversationEntryToolCallStatus {
6574    fn from(value: &str) -> Self {
6575        match value {
6576            "done" => Self::Done,
6577            "error" => Self::Error,
6578            other => Self::Other(other.to_string()),
6579        }
6580    }
6581}
6582
6583/// `CopyWorkspaceFileRequest` model.
6584#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6585pub struct CopyWorkspaceFileRequest {
6586    pub source_path: String,
6587    pub dest_path: String,
6588}
6589
6590/// `CoreMemoryBlock` model.
6591#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6592pub struct CoreMemoryBlock {
6593    #[serde(default, skip_serializing_if = "Option::is_none")]
6594    pub block_id: 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 tenant_id: Option<String>,
6599    #[serde(default, skip_serializing_if = "Option::is_none")]
6600    pub label: Option<String>,
6601    #[serde(default, skip_serializing_if = "Option::is_none")]
6602    pub content: Option<String>,
6603    #[serde(default, skip_serializing_if = "Option::is_none")]
6604    pub max_tokens: Option<i64>,
6605    #[serde(default, skip_serializing_if = "Option::is_none")]
6606    pub updated_at: Option<String>,
6607}
6608
6609/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z;
6610/// billing/cost-reconciliation.ts ReconciliationResult — `truncated` and `details` conditional.
6611#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6612pub struct CostReconciliationResult {
6613    pub tenant_id: String,
6614    pub period: String,
6615    pub runs_total_cost_usd: f64,
6616    pub usage_tracker_cost_usd: f64,
6617    pub drift_usd: f64,
6618    pub drift_pct: f64,
6619    pub runs_scanned: i64,
6620    pub runs_missing_cost: i64,
6621    pub status: String,
6622    #[serde(default, skip_serializing_if = "Option::is_none")]
6623    pub details: Option<String>,
6624    #[serde(default, skip_serializing_if = "Option::is_none")]
6625    pub truncated: Option<bool>,
6626}
6627
6628/// `CreateA2ATaskRequest` model.
6629#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6630pub struct CreateA2ATaskRequest {
6631    pub agent_id: String,
6632    /// At least one `user` message must carry input: a text part with non-empty `text`, a `data`
6633    /// part, or a `file` part with inline `data` (a `uri`-only file is not fetched on this route).
6634    /// Anything else is refused with **422** before a task or run exists (schemas/mod.ts
6635    /// A2AMessagesSchema).
6636    pub messages: Vec<CreateA2ATaskRequestMessage>,
6637    #[serde(default, skip_serializing_if = "Option::is_none")]
6638    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
6639}
6640
6641/// `CreateA2ATaskRequestMessage` model.
6642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6643pub struct CreateA2ATaskRequestMessage {
6644    pub role: DrawingJournalEntryAuthorKind,
6645    pub parts: Vec<A2APart>,
6646}
6647
6648/// `CreateAdminBlogPostRequest` model.
6649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6650pub struct CreateAdminBlogPostRequest {
6651    pub title: String,
6652    pub body: String,
6653    #[serde(default, skip_serializing_if = "Option::is_none")]
6654    pub tags: Option<Vec<String>>,
6655    #[serde(default, skip_serializing_if = "Option::is_none")]
6656    pub status: Option<BlogPostStatus>,
6657}
6658
6659/// `CreateAdminBlogPostResponse` model.
6660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6661pub struct CreateAdminBlogPostResponse {
6662    pub post: BlogPost,
6663}
6664
6665/// `CreateAdminProviderResponse` model.
6666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6667pub struct CreateAdminProviderResponse {
6668    pub id: String,
6669    pub name: String,
6670    pub default_endpoint: String,
6671    pub is_custom: bool,
6672    pub requires_api_key: bool,
6673    pub canonical: String,
6674    /// Only when the body sent it.
6675    #[serde(default, skip_serializing_if = "Option::is_none")]
6676    pub default_capabilities: Option<CreateAdminProviderResponseDefaultCapabilities>,
6677}
6678
6679/// Only when the body sent it.
6680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6681pub struct CreateAdminProviderResponseDefaultCapabilities {
6682    #[serde(default, skip_serializing_if = "Option::is_none")]
6683    pub supports_tool_calls: Option<bool>,
6684    #[serde(default, skip_serializing_if = "Option::is_none")]
6685    pub supports_streaming: Option<bool>,
6686    #[serde(default, skip_serializing_if = "Option::is_none")]
6687    pub supports_json_mode: Option<bool>,
6688    #[serde(default, skip_serializing_if = "Option::is_none")]
6689    pub supports_vision: Option<bool>,
6690    #[serde(default, skip_serializing_if = "Option::is_none")]
6691    pub max_context_tokens: Option<i64>,
6692    #[serde(default, skip_serializing_if = "Option::is_none")]
6693    pub max_output_tokens: Option<i64>,
6694}
6695
6696/// `CreateAgentBookmarkRequest` model.
6697#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6698pub struct CreateAgentBookmarkRequest {
6699    pub message_id: String,
6700    pub kind: AgentBookmarkKind,
6701    pub content: String,
6702    #[serde(default, skip_serializing_if = "Option::is_none")]
6703    pub session_id: Option<String>,
6704}
6705
6706/// `CreateAgentFriaRequest` model.
6707#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6708pub struct CreateAgentFriaRequest {
6709    /// One entry per fundamental right considered.
6710    pub rights_assessed: Vec<CreateAgentFriaRequestRightsAssessedItem>,
6711    pub mitigations: String,
6712    pub assessor: String,
6713    /// When the assessment must be revisited.
6714    pub next_review: String,
6715}
6716
6717/// `CreateAgentFriaRequestRightsAssessedItem` model.
6718#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6719pub struct CreateAgentFriaRequestRightsAssessedItem {
6720    pub right: String,
6721    pub impact: FriaRightImpact,
6722    pub justification: String,
6723    #[serde(default, skip_serializing_if = "Option::is_none")]
6724    pub mitigation: Option<String>,
6725}
6726
6727/// `CreateAgentRequest` model.
6728#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6729pub struct CreateAgentRequest {
6730    pub name: String,
6731    #[serde(default, skip_serializing_if = "Option::is_none")]
6732    pub model: Option<AgentModelConfigInput>,
6733    #[serde(default, skip_serializing_if = "Option::is_none")]
6734    pub description: Option<String>,
6735    /// `prompts.system` is accepted and IGNORED: the per-agent system prompt is managed by the Head
6736    /// Agent (system prompt lockdown, 2026-08-04). A new agent stores a neutral default; an update
6737    /// keeps the stored prompt. `prompts.developer` is stored. For the prompt a public chat uses,
6738    /// set `public_config.system_prompt`.
6739    #[serde(default, skip_serializing_if = "Option::is_none")]
6740    pub prompts: Option<serde_json::Map<String, serde_json::Value>>,
6741    #[serde(default, skip_serializing_if = "Option::is_none")]
6742    pub thinking: Option<serde_json::Map<String, serde_json::Value>>,
6743    /// How runs execute. Accepted by `CreateAgentSchema` (schemas/mod.ts:499) and undocumented
6744    /// until now — `bridge` is deliberately NOT selectable here: bridge agents are created by the
6745    /// bridge registration path, not by this route.
6746    #[serde(default, skip_serializing_if = "Option::is_none")]
6747    pub execution_mode: Option<CreateAgentRequestExecutionMode>,
6748    #[serde(default, skip_serializing_if = "Option::is_none")]
6749    pub resource_limits: Option<serde_json::Map<String, serde_json::Value>>,
6750    #[serde(default, skip_serializing_if = "Option::is_none")]
6751    pub memory: Option<serde_json::Map<String, serde_json::Value>>,
6752    #[serde(default, skip_serializing_if = "Option::is_none")]
6753    pub guardrails: Option<serde_json::Map<String, serde_json::Value>>,
6754}
6755
6756/// How runs execute. Accepted by `CreateAgentSchema` (schemas/mod.ts:499) and undocumented
6757/// until now — `bridge` is deliberately NOT selectable here: bridge agents are created by the
6758/// bridge registration path, not by this route.
6759#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6760pub enum CreateAgentRequestExecutionMode {
6761    #[default]
6762    #[serde(rename = "async")]
6763    Async,
6764    #[serde(rename = "worker")]
6765    Worker,
6766    /// A value the API introduced after this SDK was generated.
6767    #[serde(untagged)]
6768    Other(String),
6769}
6770
6771impl CreateAgentRequestExecutionMode {
6772    /// The value as it appears on the wire.
6773    pub fn as_str(&self) -> &str {
6774        match self {
6775            Self::Async => "async",
6776            Self::Worker => "worker",
6777            Self::Other(value) => value.as_str(),
6778        }
6779    }
6780}
6781
6782impl std::fmt::Display for CreateAgentRequestExecutionMode {
6783    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6784        f.write_str(self.as_str())
6785    }
6786}
6787
6788impl From<&str> for CreateAgentRequestExecutionMode {
6789    fn from(value: &str) -> Self {
6790        match value {
6791            "async" => Self::Async,
6792            "worker" => Self::Worker,
6793            other => Self::Other(other.to_string()),
6794        }
6795    }
6796}
6797
6798/// `CreateAgentVersionRequest` model.
6799#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6800pub struct CreateAgentVersionRequest {
6801    #[serde(default, skip_serializing_if = "Option::is_none")]
6802    pub changelog: Option<String>,
6803}
6804
6805/// `CreateAmbassadorRequestRequest` model.
6806#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6807pub struct CreateAmbassadorRequestRequest {
6808    pub from_agent_id: String,
6809    pub r#type: String,
6810    pub subject: String,
6811    pub body: String,
6812}
6813
6814/// `CreateAPIKeyRequest` model.
6815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6816pub struct CreateAPIKeyRequest {
6817    pub name: String,
6818    /// Server default:
6819    /// `\["agents:read","agents:write","runs:create","runs:read","notifications:read","notifications:write","memory:read","memory:write","files:read","files:write"\]`.
6820    #[serde(default, skip_serializing_if = "Option::is_none")]
6821    pub scopes: Option<Vec<String>>,
6822}
6823
6824/// `CreateBillingPortalSessionRequest` model.
6825#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6826pub struct CreateBillingPortalSessionRequest {
6827    /// Where to send the customer afterwards (billing.ts resolveReturnTarget, since #457): a path,
6828    /// resolved against the caller's origin (`Origin`, then `Referer`) or, without one, the public
6829    /// web origin (<https://snaga.ai> on production); an absolute URL on one of those two origins;
6830    /// or the app's own scheme — `snaga://…`, the same test the OAuth callback uses
6831    /// (isMobileReturnTo), which is what the iOS and Android apps send. Anything else is 422.
6832    /// Absent or empty: the billing settings page (`/browser/settings/billing`) on that origin.
6833    #[serde(default, skip_serializing_if = "Option::is_none")]
6834    pub return_url: Option<String>,
6835}
6836
6837/// `CreateBillingPortalSessionResponse` model.
6838#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6839pub struct CreateBillingPortalSessionResponse {
6840    pub url: String,
6841}
6842
6843/// `CreateCheckoutSessionRequest` model.
6844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6845pub struct CreateCheckoutSessionRequest {
6846    pub plan_id: String,
6847    /// Where to send the customer afterwards (billing.ts resolveReturnTarget, since #457): a path,
6848    /// resolved against the caller's origin (`Origin`, then `Referer`) or, without one, the public
6849    /// web origin (<https://snaga.ai> on production); an absolute URL on one of those two origins;
6850    /// or the app's own scheme — `snaga://…`, the same test the OAuth callback uses
6851    /// (isMobileReturnTo), which is what the iOS and Android apps send. Anything else is 422.
6852    /// Absent or empty: `/browser/settings/billing?success=1` on that origin.
6853    #[serde(default, skip_serializing_if = "Option::is_none")]
6854    pub success_url: Option<String>,
6855    /// Where to send the customer afterwards (billing.ts resolveReturnTarget, since #457): a path,
6856    /// resolved against the caller's origin (`Origin`, then `Referer`) or, without one, the public
6857    /// web origin (<https://snaga.ai> on production); an absolute URL on one of those two origins;
6858    /// or the app's own scheme — `snaga://…`, the same test the OAuth callback uses
6859    /// (isMobileReturnTo), which is what the iOS and Android apps send. Anything else is 422.
6860    /// Absent or empty: the billing settings page (`/browser/settings/billing`) on that origin.
6861    #[serde(default, skip_serializing_if = "Option::is_none")]
6862    pub cancel_url: Option<String>,
6863}
6864
6865/// `CreateCheckoutSessionResponse` model.
6866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6867pub struct CreateCheckoutSessionResponse {
6868    #[serde(default, skip_serializing_if = "Option::is_none")]
6869    pub url: Option<String>,
6870}
6871
6872/// `CreateDatasetRequest` model.
6873#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6874pub struct CreateDatasetRequest {
6875    pub name: String,
6876    pub cases: Vec<CreateDatasetRequestCas>,
6877}
6878
6879/// `CreateDatasetRequestCas` model.
6880#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6881pub struct CreateDatasetRequestCas {
6882    #[serde(default, skip_serializing_if = "Option::is_none")]
6883    pub input: Option<serde_json::Map<String, serde_json::Value>>,
6884    #[serde(default, skip_serializing_if = "Option::is_none")]
6885    pub expected_output: Option<serde_json::Map<String, serde_json::Value>>,
6886    #[serde(default, skip_serializing_if = "Option::is_none")]
6887    pub tags: Option<Vec<String>>,
6888}
6889
6890/// `CreateDrawingMaskRequest` model.
6891#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6892pub struct CreateDrawingMaskRequest {
6893    #[serde(default, skip_serializing_if = "Option::is_none")]
6894    pub shape: Option<DrawingSelectionShape>,
6895    /// An L8 PNG of the drawing's exact size.
6896    #[serde(default, skip_serializing_if = "Option::is_none")]
6897    pub file_id: Option<String>,
6898}
6899
6900/// sessions.ts handleCreateTask — a projection, not the Todo record. `parent_task_id` only on a
6901/// multi-agent fan-out; `due_at` omitted for a backlog task; per item, `agent_id`/`team_id`
6902/// name the assignee and `run_id`/`team_run_id` appear only when the item was dispatched
6903/// immediately.
6904#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6905pub struct CreatedTask {
6906    pub task_id: String,
6907    #[serde(default, skip_serializing_if = "Option::is_none")]
6908    pub parent_task_id: Option<String>,
6909    pub title: String,
6910    #[serde(default, skip_serializing_if = "Option::is_none")]
6911    pub due_at: Option<String>,
6912    pub items: Vec<CreatedTaskItem>,
6913}
6914
6915/// `CreatedTaskItem` model.
6916#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6917pub struct CreatedTaskItem {
6918    pub session_id: String,
6919    pub todo_id: String,
6920    #[serde(default, skip_serializing_if = "Option::is_none")]
6921    pub agent_id: Option<String>,
6922    #[serde(default, skip_serializing_if = "Option::is_none")]
6923    pub team_id: Option<String>,
6924    #[serde(default, skip_serializing_if = "Option::is_none")]
6925    pub run_id: Option<String>,
6926    #[serde(default, skip_serializing_if = "Option::is_none")]
6927    pub team_run_id: Option<String>,
6928    pub status: CreatedTaskItemStatus,
6929}
6930
6931/// `CreatedTaskItemStatus` enumeration.
6932#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6933pub enum CreatedTaskItemStatus {
6934    #[default]
6935    #[serde(rename = "pending")]
6936    Pending,
6937    #[serde(rename = "pending_confirmation")]
6938    PendingConfirmation,
6939    #[serde(rename = "in_progress")]
6940    InProgress,
6941    #[serde(rename = "cancelled")]
6942    Cancelled,
6943    /// A value the API introduced after this SDK was generated.
6944    #[serde(untagged)]
6945    Other(String),
6946}
6947
6948impl CreatedTaskItemStatus {
6949    /// The value as it appears on the wire.
6950    pub fn as_str(&self) -> &str {
6951        match self {
6952            Self::Pending => "pending",
6953            Self::PendingConfirmation => "pending_confirmation",
6954            Self::InProgress => "in_progress",
6955            Self::Cancelled => "cancelled",
6956            Self::Other(value) => value.as_str(),
6957        }
6958    }
6959}
6960
6961impl std::fmt::Display for CreatedTaskItemStatus {
6962    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6963        f.write_str(self.as_str())
6964    }
6965}
6966
6967impl From<&str> for CreatedTaskItemStatus {
6968    fn from(value: &str) -> Self {
6969        match value {
6970            "pending" => Self::Pending,
6971            "pending_confirmation" => Self::PendingConfirmation,
6972            "in_progress" => Self::InProgress,
6973            "cancelled" => Self::Cancelled,
6974            other => Self::Other(other.to_string()),
6975        }
6976    }
6977}
6978
6979/// `CreateExperimentRequest` model.
6980#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6981pub struct CreateExperimentRequest {
6982    pub name: String,
6983    pub dataset_id: String,
6984    pub variants: Vec<CreateExperimentRequestVariant>,
6985}
6986
6987/// `CreateExperimentRequestVariant` model.
6988#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6989pub struct CreateExperimentRequestVariant {
6990    #[serde(default, skip_serializing_if = "Option::is_none")]
6991    pub version: Option<String>,
6992    #[serde(default, skip_serializing_if = "Option::is_none")]
6993    pub eval_run_id: Option<String>,
6994}
6995
6996/// `CreateGoalRequest` model.
6997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6998pub struct CreateGoalRequest {
6999    /// The agent the goal is for.
7000    pub agent_id: String,
7001    pub title: String,
7002    pub description: String,
7003    pub rationale: String,
7004    /// How the goal sits with the constitution — what the later check reads.
7005    pub alignment_justification: String,
7006    pub expected_impact: String,
7007    /// What it is expected to cost. The vote acts on this number.
7008    pub resource_estimate_usd: f64,
7009}
7010
7011/// `CreateGuardrailRequest` model.
7012#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7013pub struct CreateGuardrailRequest {
7014    pub name: String,
7015    /// Where the guardrail is called. Checked against the security-policy denylist and resolved
7016    /// through DNS before it is accepted.
7017    pub webhook_url: String,
7018    pub phase: GuardrailConfigItemPhase,
7019    #[serde(default, skip_serializing_if = "Option::is_none")]
7020    pub action: Option<GuardrailAction>,
7021    #[serde(default, skip_serializing_if = "Option::is_none")]
7022    pub timeout_ms: Option<i64>,
7023    /// Shared secret used to sign calls to `webhook_url`.
7024    #[serde(default, skip_serializing_if = "Option::is_none")]
7025    pub secret: Option<String>,
7026}
7027
7028/// `CreateImprovementProposalRequest` model.
7029#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7030pub struct CreateImprovementProposalRequest {
7031    /// What kind of change is proposed.
7032    pub r#type: String,
7033    pub title: String,
7034    pub description: String,
7035    pub rationale: String,
7036    /// The runs this is a response to — the evidence the review stages judge.
7037    pub failed_run_ids: Vec<String>,
7038    /// The change itself, in the shape the proposal type implies.
7039    pub changes: serde_json::Map<String, serde_json::Value>,
7040    /// What the agent achieves today, so it can be measured against something.
7041    pub baseline_success_rate: f64,
7042}
7043
7044/// `CreateIntegrationRequest` model.
7045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7046pub struct CreateIntegrationRequest {
7047    pub connector_id: String,
7048    pub name: String,
7049    #[serde(default, skip_serializing_if = "Option::is_none")]
7050    pub config: Option<serde_json::Map<String, serde_json::Value>>,
7051    #[serde(default, skip_serializing_if = "Option::is_none")]
7052    pub agent_id: Option<String>,
7053}
7054
7055/// `CreateMCPServerRequest` model.
7056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7057pub struct CreateMCPServerRequest {
7058    pub name: String,
7059    pub transport: MCPTransport,
7060    #[serde(default, skip_serializing_if = "Option::is_none")]
7061    pub url: Option<String>,
7062    #[serde(default, skip_serializing_if = "Option::is_none")]
7063    pub command: Option<String>,
7064    #[serde(default, skip_serializing_if = "Option::is_none")]
7065    pub args: Option<Vec<String>>,
7066    /// Secrets for this server. Encrypted at rest and never returned; only `env_count` is
7067    /// disclosed. For an http server the key named by `auth.env_key` (default `MCP_API_KEY`) is the
7068    /// one sent as the credential.
7069    #[serde(default, skip_serializing_if = "Option::is_none")]
7070    pub env: Option<serde_json::Map<String, serde_json::Value>>,
7071    #[serde(default, skip_serializing_if = "Option::is_none")]
7072    pub auth: Option<MCPServerAuth>,
7073    /// Agents to connect the server to. Omit or leave empty and no agent sees its tools.
7074    #[serde(default, skip_serializing_if = "Option::is_none")]
7075    pub assigned_agent_ids: Option<Vec<String>>,
7076    #[serde(default, skip_serializing_if = "Option::is_none")]
7077    pub enabled: Option<bool>,
7078    /// Names an environment variable of the API process whose value is sent to this server as a
7079    /// bearer token. It MUST begin `MCP_` — 422 otherwise. The namespace is the whole security
7080    /// boundary: before it existed, the HTTP transport read ANY variable of the API process, so a
7081    /// tenant admin registering `{url: \<their server\>, api_key_ref: "UARP_ENCRYPTION_KEY"}` was
7082    /// mailed the platform's at-rest key on the first connect (found 2026-09-15). The variable is
7083    /// never echoed back; only the ref is stored.
7084    #[serde(default, skip_serializing_if = "Option::is_none")]
7085    pub api_key_ref: Option<String>,
7086    /// Hosts this server may be reached at, checked with DNS resolution.
7087    #[serde(default, skip_serializing_if = "Option::is_none")]
7088    pub egress_allowlist: Option<Vec<String>>,
7089}
7090
7091/// `CreateMyTenantRequest` model.
7092#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7093pub struct CreateMyTenantRequest {
7094    pub name: String,
7095    #[serde(default, skip_serializing_if = "Option::is_none")]
7096    pub slug: Option<String>,
7097}
7098
7099/// `CreateMyTenantResponse` model.
7100#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7101pub struct CreateMyTenantResponse {
7102    pub created: bool,
7103    pub tenant_id: String,
7104    pub name: String,
7105    pub slug: String,
7106    pub role: String,
7107    pub user_id: String,
7108}
7109
7110/// `CreatePlanStripePriceRequest` model.
7111#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7112pub struct CreatePlanStripePriceRequest {
7113    pub amount_cents: i64,
7114    /// Server default: `"usd"`.
7115    #[serde(default, skip_serializing_if = "Option::is_none")]
7116    pub currency: Option<String>,
7117    /// Server default: `"month"`.
7118    #[serde(default, skip_serializing_if = "Option::is_none")]
7119    pub interval: Option<CreatePlanStripePriceRequestInterval>,
7120    #[serde(default, skip_serializing_if = "Option::is_none")]
7121    pub product_name: Option<String>,
7122}
7123
7124/// `CreatePlanStripePriceRequestInterval` enumeration.
7125#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7126pub enum CreatePlanStripePriceRequestInterval {
7127    #[default]
7128    #[serde(rename = "month")]
7129    Month,
7130    #[serde(rename = "year")]
7131    Year,
7132    /// A value the API introduced after this SDK was generated.
7133    #[serde(untagged)]
7134    Other(String),
7135}
7136
7137impl CreatePlanStripePriceRequestInterval {
7138    /// The value as it appears on the wire.
7139    pub fn as_str(&self) -> &str {
7140        match self {
7141            Self::Month => "month",
7142            Self::Year => "year",
7143            Self::Other(value) => value.as_str(),
7144        }
7145    }
7146}
7147
7148impl std::fmt::Display for CreatePlanStripePriceRequestInterval {
7149    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7150        f.write_str(self.as_str())
7151    }
7152}
7153
7154impl From<&str> for CreatePlanStripePriceRequestInterval {
7155    fn from(value: &str) -> Self {
7156        match value {
7157            "month" => Self::Month,
7158            "year" => Self::Year,
7159            other => Self::Other(other.to_string()),
7160        }
7161    }
7162}
7163
7164/// `CreatePlanStripePriceResponse` model.
7165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7166pub struct CreatePlanStripePriceResponse {
7167    #[serde(default, skip_serializing_if = "Option::is_none")]
7168    pub plan_id: Option<String>,
7169    #[serde(default, skip_serializing_if = "Option::is_none")]
7170    pub stripe_price_id: Option<String>,
7171    #[serde(default, skip_serializing_if = "Option::is_none")]
7172    pub stripe_product_id: Option<String>,
7173    #[serde(default, skip_serializing_if = "Option::is_none")]
7174    pub amount_cents: Option<i64>,
7175    #[serde(default, skip_serializing_if = "Option::is_none")]
7176    pub currency: Option<String>,
7177    #[serde(default, skip_serializing_if = "Option::is_none")]
7178    pub interval: Option<String>,
7179}
7180
7181/// `CreateProgramRequest` model.
7182#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7183pub struct CreateProgramRequest {
7184    pub name: String,
7185    pub agent_id: String,
7186    #[serde(default, skip_serializing_if = "Option::is_none")]
7187    pub listing_id: Option<String>,
7188    #[serde(default, skip_serializing_if = "Option::is_none")]
7189    pub description: Option<String>,
7190    pub steps: Vec<CreateProgramRequestStep>,
7191}
7192
7193/// `CreateProgramRequestStep` model.
7194#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7195pub struct CreateProgramRequestStep {
7196    pub title: String,
7197    #[serde(default, skip_serializing_if = "Option::is_none")]
7198    pub description: Option<String>,
7199    #[serde(default, skip_serializing_if = "Option::is_none")]
7200    pub order_index: Option<f64>,
7201    #[serde(default, skip_serializing_if = "Option::is_none")]
7202    pub suggested_due_offset_days: Option<f64>,
7203}
7204
7205/// `CreateProjectRequest` model.
7206#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7207pub struct CreateProjectRequest {
7208    pub name: String,
7209    #[serde(default, skip_serializing_if = "Option::is_none")]
7210    pub description: Option<String>,
7211    #[serde(default, skip_serializing_if = "Option::is_none")]
7212    pub instructions: Option<String>,
7213    #[serde(default, skip_serializing_if = "Option::is_none")]
7214    pub knowledge_base_ids: Option<Vec<String>>,
7215    #[serde(default, skip_serializing_if = "Option::is_none")]
7216    pub file_ids: Option<Vec<String>>,
7217    #[serde(default, skip_serializing_if = "Option::is_none")]
7218    pub visibility: Option<ProjectVisibility>,
7219    #[serde(default, skip_serializing_if = "Option::is_none")]
7220    pub shared_with: Option<Vec<ProjectGrant>>,
7221}
7222
7223/// `CreatePublicSessionRequest` model.
7224#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7225pub struct CreatePublicSessionRequest {
7226    pub agent_id: String,
7227}
7228
7229/// `CreatePublicSessionResponse` model.
7230#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7231pub struct CreatePublicSessionResponse {
7232    #[serde(default, skip_serializing_if = "Option::is_none")]
7233    pub session_id: Option<String>,
7234    #[serde(default, skip_serializing_if = "Option::is_none")]
7235    pub token: Option<String>,
7236    #[serde(default, skip_serializing_if = "Option::is_none")]
7237    pub agent_name: Option<String>,
7238    #[serde(default, skip_serializing_if = "Option::is_none")]
7239    pub greeting: Option<String>,
7240}
7241
7242/// `CreateResponseRequest` model.
7243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7244pub struct CreateResponseRequest {
7245    /// Agent ID or model alias resolvable via `/v1/models`.
7246    pub model: String,
7247    /// Input string or structured turn array.
7248    pub input: serde_json::Value,
7249    /// Chain to an earlier response in the same conversation.
7250    #[serde(default, skip_serializing_if = "Option::is_none")]
7251    pub previous_response_id: Option<String>,
7252    /// System-prompt override for this call only.
7253    #[serde(default, skip_serializing_if = "Option::is_none")]
7254    pub instructions: Option<String>,
7255    /// Server default: `false`.
7256    #[serde(default, skip_serializing_if = "Option::is_none")]
7257    pub stream: Option<bool>,
7258    #[serde(default, skip_serializing_if = "Option::is_none")]
7259    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
7260}
7261
7262/// `CreateResponseResponse` model.
7263#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7264pub struct CreateResponseResponse {
7265    pub id: String,
7266    /// Always `response`.
7267    pub object: String,
7268    #[serde(default, skip_serializing_if = "Option::is_none")]
7269    pub created_at: Option<i64>,
7270    pub model: String,
7271    pub output: Vec<ResponsesOutputItem>,
7272    #[serde(default, skip_serializing_if = "Option::is_none")]
7273    pub usage: Option<CreateResponseResponseUsage>,
7274}
7275
7276/// `CreateResponseResponseUsage` model.
7277#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7278pub struct CreateResponseResponseUsage {
7279    #[serde(default, skip_serializing_if = "Option::is_none")]
7280    pub input_tokens: Option<i64>,
7281    #[serde(default, skip_serializing_if = "Option::is_none")]
7282    pub output_tokens: Option<i64>,
7283    #[serde(default, skip_serializing_if = "Option::is_none")]
7284    pub total_tokens: Option<i64>,
7285}
7286
7287/// runs.ts createRunCheckpoint — the checkpoint record; it carries no messages (those live in
7288/// the stored checkpoint read back by GET /runs/{runId}/checkpoints).
7289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7290pub struct CreateRunCheckpointResponse {
7291    pub checkpoint_id: String,
7292    pub run_id: String,
7293    pub status: String,
7294    pub step_seq: i64,
7295    #[serde(default, skip_serializing_if = "Option::is_none")]
7296    pub metrics: Option<serde_json::Map<String, serde_json::Value>>,
7297    pub created_at: String,
7298}
7299
7300/// `CreateRunRequest` model.
7301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7302pub struct CreateRunRequest {
7303    pub agent_id: String,
7304    #[serde(default, skip_serializing_if = "Option::is_none")]
7305    pub session_id: Option<String>,
7306    /// Free-form input for the agent; `message` is the conventional field. `file_ids` attaches
7307    /// uploaded files (at most 20): every id is resolved against THIS tenant before the run is
7308    /// created, and an id with no file here is refused with 422 rather than accepted and dropped —
7309    /// an unresolvable id would otherwise travel to the agent, and to a bridge agent's machine, as
7310    /// an attachment that cannot be fetched.
7311    ///
7312    /// Server default: `{}`.
7313    #[serde(default, skip_serializing_if = "Option::is_none")]
7314    pub input: Option<CreateRunRequestInput>,
7315    /// Pin to a specific agent version (1-based). When omitted, runs against the agent's current
7316    /// head version.
7317    #[serde(default, skip_serializing_if = "Option::is_none")]
7318    pub version: Option<i64>,
7319    #[serde(default, skip_serializing_if = "Option::is_none")]
7320    pub resource_limits: Option<serde_json::Map<String, serde_json::Value>>,
7321    #[serde(default, skip_serializing_if = "Option::is_none")]
7322    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
7323}
7324
7325/// Free-form input for the agent; `message` is the conventional field. `file_ids` attaches
7326/// uploaded files (at most 20): every id is resolved against THIS tenant before the run is
7327/// created, and an id with no file here is refused with 422 rather than accepted and dropped —
7328/// an unresolvable id would otherwise travel to the agent, and to a bridge agent's machine, as
7329/// an attachment that cannot be fetched.
7330#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7331pub struct CreateRunRequestInput {
7332    #[serde(default, skip_serializing_if = "Option::is_none")]
7333    pub message: Option<String>,
7334    #[serde(default, skip_serializing_if = "Option::is_none")]
7335    pub file_ids: Option<Vec<String>>,
7336}
7337
7338/// `CreateSessionAnnotationRequest` model.
7339#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7340pub struct CreateSessionAnnotationRequest {
7341    pub message_id: String,
7342    pub content: String,
7343}
7344
7345/// `CreateSessionAnnotationResponse` model.
7346#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7347pub struct CreateSessionAnnotationResponse {
7348    #[serde(default, skip_serializing_if = "Option::is_none")]
7349    pub id: Option<String>,
7350    #[serde(default, skip_serializing_if = "Option::is_none")]
7351    pub message_id: Option<String>,
7352    #[serde(default, skip_serializing_if = "Option::is_none")]
7353    pub content: Option<String>,
7354    #[serde(default, skip_serializing_if = "Option::is_none")]
7355    pub author: Option<String>,
7356    #[serde(default, skip_serializing_if = "Option::is_none")]
7357    pub created_at: Option<String>,
7358    #[serde(default, skip_serializing_if = "Option::is_none")]
7359    pub resolved: Option<bool>,
7360}
7361
7362/// `CreateSessionBranchRequest` model.
7363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7364pub struct CreateSessionBranchRequest {
7365    /// Defaults to the session's most recent run.
7366    #[serde(default, skip_serializing_if = "Option::is_none")]
7367    pub fork_point_run_id: Option<String>,
7368    /// Defaults to 0.
7369    #[serde(default, skip_serializing_if = "Option::is_none")]
7370    pub fork_point_step_seq: Option<i64>,
7371    /// Defaults to the session's active branch.
7372    #[serde(default, skip_serializing_if = "Option::is_none")]
7373    pub parent_branch_id: Option<String>,
7374    /// Defaults to `branch-\<first 8 characters of the branch id\>`.
7375    #[serde(default, skip_serializing_if = "Option::is_none")]
7376    pub name: Option<String>,
7377}
7378
7379/// `CreateSessionDrawingRequest` model.
7380#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7381pub struct CreateSessionDrawingRequest {
7382    pub width: i64,
7383    pub height: i64,
7384    /// `#rrggbb` or `transparent`; default `#ffffff`.
7385    #[serde(default, skip_serializing_if = "Option::is_none")]
7386    pub background: Option<String>,
7387    #[serde(default, skip_serializing_if = "Option::is_none")]
7388    pub dpi: Option<i64>,
7389    /// Name of the first layer.
7390    #[serde(default, skip_serializing_if = "Option::is_none")]
7391    pub name: Option<String>,
7392}
7393
7394/// `CreateSessionRequest` model.
7395#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7396pub struct CreateSessionRequest {
7397    pub agent_id: String,
7398    #[serde(default, skip_serializing_if = "Option::is_none")]
7399    pub team_id: Option<String>,
7400    #[serde(default, skip_serializing_if = "Option::is_none")]
7401    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
7402}
7403
7404/// `CreateSessionShareRequest` model.
7405#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7406pub struct CreateSessionShareRequest {
7407    pub role: CreateSessionShareRequestRole,
7408    #[serde(default, skip_serializing_if = "Option::is_none")]
7409    pub expires_in_hours: Option<f64>,
7410}
7411
7412/// `CreateSessionShareRequestRole` enumeration.
7413#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7414pub enum CreateSessionShareRequestRole {
7415    #[default]
7416    #[serde(rename = "viewer")]
7417    Viewer,
7418    #[serde(rename = "editor")]
7419    Editor,
7420    /// A value the API introduced after this SDK was generated.
7421    #[serde(untagged)]
7422    Other(String),
7423}
7424
7425impl CreateSessionShareRequestRole {
7426    /// The value as it appears on the wire.
7427    pub fn as_str(&self) -> &str {
7428        match self {
7429            Self::Viewer => "viewer",
7430            Self::Editor => "editor",
7431            Self::Other(value) => value.as_str(),
7432        }
7433    }
7434}
7435
7436impl std::fmt::Display for CreateSessionShareRequestRole {
7437    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7438        f.write_str(self.as_str())
7439    }
7440}
7441
7442impl From<&str> for CreateSessionShareRequestRole {
7443    fn from(value: &str) -> Self {
7444        match value {
7445            "viewer" => Self::Viewer,
7446            "editor" => Self::Editor,
7447            other => Self::Other(other.to_string()),
7448        }
7449    }
7450}
7451
7452/// `CreateSessionShareResponse` model.
7453#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7454pub struct CreateSessionShareResponse {
7455    #[serde(default, skip_serializing_if = "Option::is_none")]
7456    pub share_url: Option<String>,
7457    #[serde(default, skip_serializing_if = "Option::is_none")]
7458    pub role: Option<String>,
7459    #[serde(default, skip_serializing_if = "Option::is_none")]
7460    pub expires_at: Option<String>,
7461}
7462
7463/// `CreateSessionTodoRequest` model.
7464#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7465pub struct CreateSessionTodoRequest {
7466    pub title: String,
7467    #[serde(default, skip_serializing_if = "Option::is_none")]
7468    pub description: Option<String>,
7469    #[serde(default, skip_serializing_if = "Option::is_none")]
7470    pub due_at: Option<String>,
7471    #[serde(default, skip_serializing_if = "Option::is_none")]
7472    pub assign_agent_id: Option<String>,
7473    #[serde(default, skip_serializing_if = "Option::is_none")]
7474    pub status: Option<String>,
7475}
7476
7477/// `CreateSpecPackageCheckoutSessionResponse` model.
7478#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7479pub struct CreateSpecPackageCheckoutSessionResponse {
7480    pub error: InvokeListingAgentResponseError,
7481    pub message: String,
7482    pub retry_after_seconds: i64,
7483}
7484
7485/// `CreateVotingProposalRequest` model.
7486#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7487pub struct CreateVotingProposalRequest {
7488    pub title: String,
7489    pub description: String,
7490    pub proposal_type: String,
7491}
7492
7493/// `CreateWebhookRequest` model.
7494#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7495pub struct CreateWebhookRequest {
7496    pub url: String,
7497    pub events: Vec<WebhookDeliveryAttemptEventType>,
7498}
7499
7500/// `CreateWorkspaceRequest` model.
7501#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7502pub struct CreateWorkspaceRequest {
7503    #[serde(default, skip_serializing_if = "Option::is_none")]
7504    pub name: Option<String>,
7505}
7506
7507/// `CustomPlan` model.
7508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7509pub struct CustomPlan {
7510    /// Lower-cased. The identity — not settable through the body.
7511    pub id: String,
7512    pub name: String,
7513    /// Absent when unset.
7514    #[serde(default, skip_serializing_if = "Option::is_none")]
7515    pub description: Option<String>,
7516    /// Pairs the plan with a promo program. Absent when unset.
7517    #[serde(default, skip_serializing_if = "Option::is_none")]
7518    pub program: Option<String>,
7519    pub base_plan: CustomPlanBasePlan,
7520    pub price_amount_cents: i64,
7521    pub price_currency: String,
7522    /// Absent when unset.
7523    #[serde(default, skip_serializing_if = "Option::is_none")]
7524    pub stripe_price_id: Option<String>,
7525    #[serde(default, skip_serializing_if = "Option::is_none")]
7526    pub quotas: Option<TenantQuotas>,
7527    #[serde(default, skip_serializing_if = "Option::is_none")]
7528    pub llm: Option<PlanLLMLimits>,
7529    pub visibility: CustomPlanVisibility,
7530    pub active: bool,
7531    pub created_at: String,
7532    pub updated_at: String,
7533}
7534
7535/// `CustomPlanBasePlan` enumeration.
7536#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7537pub enum CustomPlanBasePlan {
7538    #[default]
7539    #[serde(rename = "free")]
7540    Free,
7541    #[serde(rename = "starter")]
7542    Starter,
7543    #[serde(rename = "pro")]
7544    Pro,
7545    #[serde(rename = "enterprise")]
7546    Enterprise,
7547    /// A value the API introduced after this SDK was generated.
7548    #[serde(untagged)]
7549    Other(String),
7550}
7551
7552impl CustomPlanBasePlan {
7553    /// The value as it appears on the wire.
7554    pub fn as_str(&self) -> &str {
7555        match self {
7556            Self::Free => "free",
7557            Self::Starter => "starter",
7558            Self::Pro => "pro",
7559            Self::Enterprise => "enterprise",
7560            Self::Other(value) => value.as_str(),
7561        }
7562    }
7563}
7564
7565impl std::fmt::Display for CustomPlanBasePlan {
7566    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7567        f.write_str(self.as_str())
7568    }
7569}
7570
7571impl From<&str> for CustomPlanBasePlan {
7572    fn from(value: &str) -> Self {
7573        match value {
7574            "free" => Self::Free,
7575            "starter" => Self::Starter,
7576            "pro" => Self::Pro,
7577            "enterprise" => Self::Enterprise,
7578            other => Self::Other(other.to_string()),
7579        }
7580    }
7581}
7582
7583/// `CustomPlanInput` model.
7584#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7585pub struct CustomPlanInput {
7586    pub name: String,
7587    #[serde(default, skip_serializing_if = "Option::is_none")]
7588    pub description: Option<String>,
7589    #[serde(default, skip_serializing_if = "Option::is_none")]
7590    pub program: Option<String>,
7591    pub base_plan: CustomPlanBasePlan,
7592    pub price_amount_cents: i64,
7593    /// Server default: `"usd"`.
7594    #[serde(default, skip_serializing_if = "Option::is_none")]
7595    pub price_currency: Option<String>,
7596    #[serde(default, skip_serializing_if = "Option::is_none")]
7597    pub stripe_price_id: Option<String>,
7598    #[serde(default, skip_serializing_if = "Option::is_none")]
7599    pub quotas: Option<TenantQuotas>,
7600    #[serde(default, skip_serializing_if = "Option::is_none")]
7601    pub llm: Option<PlanLLMLimits>,
7602    /// Omitting this on an update HIDES a previously public plan.
7603    ///
7604    /// Server default: `"hidden"`.
7605    #[serde(default, skip_serializing_if = "Option::is_none")]
7606    pub visibility: Option<CustomPlanVisibility>,
7607    /// Omitting this on an update REACTIVATES a deactivated plan. Send it explicitly on every
7608    /// write.
7609    ///
7610    /// Server default: `true`.
7611    #[serde(default, skip_serializing_if = "Option::is_none")]
7612    pub active: Option<bool>,
7613}
7614
7615/// `CustomPlanVisibility` enumeration.
7616#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
7617pub enum CustomPlanVisibility {
7618    #[default]
7619    #[serde(rename = "public")]
7620    Public,
7621    #[serde(rename = "hidden")]
7622    Hidden,
7623    /// A value the API introduced after this SDK was generated.
7624    #[serde(untagged)]
7625    Other(String),
7626}
7627
7628impl CustomPlanVisibility {
7629    /// The value as it appears on the wire.
7630    pub fn as_str(&self) -> &str {
7631        match self {
7632            Self::Public => "public",
7633            Self::Hidden => "hidden",
7634            Self::Other(value) => value.as_str(),
7635        }
7636    }
7637}
7638
7639impl std::fmt::Display for CustomPlanVisibility {
7640    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7641        f.write_str(self.as_str())
7642    }
7643}
7644
7645impl From<&str> for CustomPlanVisibility {
7646    fn from(value: &str) -> Self {
7647        match value {
7648            "public" => Self::Public,
7649            "hidden" => Self::Hidden,
7650            other => Self::Other(other.to_string()),
7651        }
7652    }
7653}
7654
7655/// admin-data-explorer.ts handleGetKeys — one KV entry, prefix stripped.
7656#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7657pub struct DataExplorerKey {
7658    pub key: Vec<serde_json::Value>,
7659    pub value_preview: String,
7660    pub size_bytes: i64,
7661    pub r#type: String,
7662    pub sensitive: bool,
7663}
7664
7665/// `DataExplorerNamespace` model.
7666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7667pub struct DataExplorerNamespace {
7668    pub id: String,
7669    pub label: String,
7670    pub description: String,
7671    pub count: i64,
7672}
7673
7674/// data-subject.ts dataSubjectAccess — ids per store plus their counts; every field always
7675/// present.
7676#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7677pub struct DataSubjectAccessReport {
7678    pub subject_id: String,
7679    pub tenant_id: String,
7680    pub runs: Vec<String>,
7681    pub sessions: Vec<String>,
7682    pub memory: Vec<String>,
7683    pub files: Vec<String>,
7684    pub feedback: Vec<String>,
7685    /// Core-memory labels, when the subject is an agent. A human subject has no core-memory rows of
7686    /// their own.
7687    pub core_memory: Vec<String>,
7688    pub runs_count: i64,
7689    pub sessions_count: i64,
7690    pub memory_count: i64,
7691    pub core_memory_count: i64,
7692    pub files_count: i64,
7693    pub feedback_count: i64,
7694    /// What this endpoint does NOT return, named rather than left to be assumed: the record
7695    /// CONTENTS (each list is identifiers, to be fetched through the per-record routes), and the
7696    /// families that carry no subject identifier at all — knowledge-base documents and workspace
7697    /// files.
7698    pub not_exported: Vec<String>,
7699    pub swept: SubjectSweep,
7700}
7701
7702/// data-subject.ts dataSubjectErasure — `erased` plus the SubjectErasureCounts spread.
7703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7704pub struct DataSubjectErasureResult {
7705    pub erased: bool,
7706    pub subject_id: String,
7707    pub runs_deleted: i64,
7708    pub sessions_deleted: i64,
7709    pub memory_deleted: i64,
7710    pub core_memory_deleted: i64,
7711    pub files_deleted: i64,
7712    pub feedback_deleted: i64,
7713    /// Record families this sweep did not touch, and why. Knowledge-base documents and workspace
7714    /// files carry no subject identifier of any kind, so there is nothing to match a subject on and
7715    /// no honest way to erase theirs without erasing everyone's — the caller is told, with the
7716    /// route to do it by hand.
7717    pub not_erased: Vec<String>,
7718    pub swept: SubjectSweep,
7719}
7720
7721/// `DeactivateSafeModeResponse` model.
7722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7723pub struct DeactivateSafeModeResponse {
7724    #[serde(default, skip_serializing_if = "Option::is_none")]
7725    pub ok: Option<bool>,
7726    #[serde(default, skip_serializing_if = "Option::is_none")]
7727    pub mode: Option<String>,
7728}
7729
7730/// governance/emergency.ts DeadlockReport — computed, not stored. Field names are camelCase on
7731/// the wire.
7732#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7733pub struct DeadlockReport {
7734    /// Deprecated spelling of `has_deadlock` — the same value, kept for the compatibility window
7735    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
7736    /// `has_deadlock`.
7737    #[serde(rename = "hasDeadlock")]
7738    pub has_deadlock: bool,
7739    /// Deprecated spelling of `conflicting_rules` — the same value, kept for the compatibility
7740    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
7741    /// `conflicting_rules`.
7742    #[serde(rename = "conflictingRules")]
7743    pub conflicting_rules: Vec<DeadlockReportConflictingRule>,
7744    pub recommendation: String,
7745    pub checked_at: String,
7746    #[serde(rename = "has_deadlock")]
7747    pub has_deadlock_: bool,
7748    #[serde(rename = "conflicting_rules")]
7749    pub conflicting_rules_: Vec<DeadlockReportConflictingRule2>,
7750}
7751
7752/// `DeadlockReportConflictingRule` model.
7753#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7754pub struct DeadlockReportConflictingRule {
7755    pub prohibition: String,
7756    pub requirement: String,
7757}
7758
7759/// `DeadlockReportConflictingRule2` model.
7760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7761pub struct DeadlockReportConflictingRule2 {
7762    pub prohibition: String,
7763    pub requirement: String,
7764}
7765
7766/// `DeclineInviteFromPickerResponse` model.
7767#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7768pub struct DeclineInviteFromPickerResponse {
7769    pub declined: bool,
7770    pub invite: Invite,
7771}
7772
7773/// `DeleteAdminBlogPostResponse` model.
7774#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7775pub struct DeleteAdminBlogPostResponse {
7776    pub deleted: bool,
7777}
7778
7779/// `DeleteAdminIntegrationOAuthProviderResponse` model.
7780#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7781pub struct DeleteAdminIntegrationOAuthProviderResponse {
7782    pub provider: String,
7783    /// Always false here.
7784    pub configured: bool,
7785}
7786
7787/// `DeleteAdminLLMDefaultResponse` model.
7788#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7789pub struct DeleteAdminLLMDefaultResponse {
7790    pub provider: String,
7791    /// Always false here — the key is gone.
7792    pub configured: bool,
7793}
7794
7795/// `DeleteAdminProviderResponse` model.
7796#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7797pub struct DeleteAdminProviderResponse {
7798    pub deleted: bool,
7799    pub id: String,
7800}
7801
7802/// `DeleteAgentBookmarkResponse` model.
7803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7804pub struct DeleteAgentBookmarkResponse {
7805    pub removed: bool,
7806    pub message_id: String,
7807}
7808
7809/// `DeleteAgentResponse` model.
7810#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7811pub struct DeleteAgentResponse {
7812    pub deleted: bool,
7813    pub agent_id: String,
7814}
7815
7816/// `DeleteAllAgentBookmarksResponse` model.
7817#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7818pub struct DeleteAllAgentBookmarksResponse {
7819    pub removed: i64,
7820}
7821
7822/// `DeleteCustomPlanResponse` model.
7823#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7824pub struct DeleteCustomPlanResponse {
7825    pub deleted: bool,
7826    pub id: String,
7827    /// Tenants moved off the plan, when forced.
7828    #[serde(default, skip_serializing_if = "Option::is_none")]
7829    pub reassigned: Option<i64>,
7830}
7831
7832/// `DeleteDataExplorerValueResponse` model.
7833#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7834pub struct DeleteDataExplorerValueResponse {
7835    #[serde(default, skip_serializing_if = "Option::is_none")]
7836    pub success: Option<bool>,
7837}
7838
7839/// `DeleteDrawingResponse` model.
7840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7841pub struct DeleteDrawingResponse {
7842    pub deleted: bool,
7843    pub drawing_id: String,
7844    /// Journal entries the cascade removed.
7845    pub ops: i64,
7846    pub masks: i64,
7847}
7848
7849/// `DeleteGuardrailResponse` model.
7850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7851pub struct DeleteGuardrailResponse {
7852    #[serde(default, skip_serializing_if = "Option::is_none")]
7853    pub deleted: Option<bool>,
7854    #[serde(default, skip_serializing_if = "Option::is_none")]
7855    pub guardrail_id: Option<String>,
7856}
7857
7858/// `DeleteLLMProviderKeyResponse` model.
7859#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7860pub struct DeleteLLMProviderKeyResponse {
7861    #[serde(default, skip_serializing_if = "Option::is_none")]
7862    pub deleted: Option<bool>,
7863    #[serde(default, skip_serializing_if = "Option::is_none")]
7864    pub provider_id: Option<String>,
7865}
7866
7867/// `DeleteMCPServerResponse` model.
7868#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7869pub struct DeleteMCPServerResponse {
7870    pub ok: bool,
7871    pub cascade: DeleteMCPServerResponseCascade,
7872}
7873
7874/// `DeleteMCPServerResponseCascade` model.
7875#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7876pub struct DeleteMCPServerResponseCascade {
7877    pub agents_with_stale_ref: i64,
7878    /// Capped at 50.
7879    pub agent_ids: Vec<String>,
7880}
7881
7882/// `DeleteMeResponse` model.
7883#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7884pub struct DeleteMeResponse {
7885    pub deleted: bool,
7886    pub tenants: Vec<DeleteMeResponseTenant>,
7887    pub sessions_revoked: i64,
7888    /// What the data sweep actually removed, summed across every membership. Present since
7889    /// 2026-09-16: the sweep's counts used to be discarded here, so `deleted: true` sat beside a
7890    /// real `sessions_revoked` number while the sweep itself matched a field nothing writes and
7891    /// deleted nothing.
7892    pub erased: DeleteMeResponseErased,
7893    /// Record families the sweep cannot reach, named rather than left to be assumed. Same list as
7894    /// `/data-subject/erasure`.
7895    pub not_erased: Vec<String>,
7896}
7897
7898/// What the data sweep actually removed, summed across every membership. Present since
7899/// 2026-09-16: the sweep's counts used to be discarded here, so `deleted: true` sat beside a
7900/// real `sessions_revoked` number while the sweep itself matched a field nothing writes and
7901/// deleted nothing.
7902#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7903pub struct DeleteMeResponseErased {
7904    pub runs: i64,
7905    pub sessions: i64,
7906    pub memory: i64,
7907    pub core_memory: i64,
7908    pub files: i64,
7909    pub feedback: i64,
7910}
7911
7912/// `DeleteMeResponseTenant` model.
7913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7914pub struct DeleteMeResponseTenant {
7915    pub tenant_id: String,
7916}
7917
7918/// `DeleteModelPricingOverrideResponse` model.
7919#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7920pub struct DeleteModelPricingOverrideResponse {
7921    /// Deprecated spelling of `model_ref` — the same value, kept for the compatibility window and
7922    /// removed in the next breaking release (the one that moves `X-API-Version`). Read `model_ref`.
7923    #[serde(rename = "modelRef")]
7924    pub model_ref: String,
7925    pub deleted: bool,
7926    #[serde(rename = "model_ref")]
7927    pub model_ref_: String,
7928}
7929
7930/// `DeleteNotificationResponse` model.
7931#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7932pub struct DeleteNotificationResponse {
7933    #[serde(default, skip_serializing_if = "Option::is_none")]
7934    pub ok: Option<bool>,
7935}
7936
7937/// `DeleteNotificationTargetResponse` model.
7938#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7939pub struct DeleteNotificationTargetResponse {
7940    pub ok: bool,
7941}
7942
7943/// `DeleteProjectResponse` model.
7944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7945pub struct DeleteProjectResponse {
7946    pub deleted: bool,
7947    pub project_id: String,
7948    pub chats_kept: i64,
7949}
7950
7951/// `DeletePromoCodeResponse` model.
7952#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7953pub struct DeletePromoCodeResponse {
7954    pub deleted: bool,
7955    /// Upper-cased, which may differ from what was sent.
7956    pub code: String,
7957}
7958
7959/// `DeleteSessionBranchResponse` model.
7960#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7961pub struct DeleteSessionBranchResponse {
7962    pub deleted: bool,
7963    pub session_id: String,
7964    pub branch_id: String,
7965    /// How many runs the branch listed and the cascade removed.
7966    pub runs: i64,
7967}
7968
7969/// `DeleteSessionTodoResponse` model.
7970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7971pub struct DeleteSessionTodoResponse {
7972    #[serde(default, skip_serializing_if = "Option::is_none")]
7973    pub deleted: Option<bool>,
7974    #[serde(default, skip_serializing_if = "Option::is_none")]
7975    pub todo_id: Option<String>,
7976    #[serde(default, skip_serializing_if = "Option::is_none")]
7977    pub session_id: Option<String>,
7978}
7979
7980/// `DeleteSpawnPolicyResponse` model.
7981#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7982pub struct DeleteSpawnPolicyResponse {
7983    #[serde(default, skip_serializing_if = "Option::is_none")]
7984    pub ok: Option<bool>,
7985}
7986
7987/// `DeleteSquadGraphEdgeResponse` model.
7988#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7989pub struct DeleteSquadGraphEdgeResponse {
7990    #[serde(default, skip_serializing_if = "Option::is_none")]
7991    pub deleted: Option<bool>,
7992    #[serde(default, skip_serializing_if = "Option::is_none")]
7993    pub edge_id: Option<String>,
7994}
7995
7996/// `DeleteSquadGraphNodeResponse` model.
7997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7998pub struct DeleteSquadGraphNodeResponse {
7999    #[serde(default, skip_serializing_if = "Option::is_none")]
8000    pub deleted: Option<bool>,
8001    #[serde(default, skip_serializing_if = "Option::is_none")]
8002    pub agent_id: Option<String>,
8003}
8004
8005/// `DeleteSquadResponse` model.
8006#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8007pub struct DeleteSquadResponse {
8008    #[serde(default, skip_serializing_if = "Option::is_none")]
8009    pub deleted: Option<bool>,
8010}
8011
8012/// `DeleteTeamGraphEdgeResponse` model.
8013#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8014pub struct DeleteTeamGraphEdgeResponse {
8015    #[serde(default, skip_serializing_if = "Option::is_none")]
8016    pub deleted: Option<bool>,
8017    #[serde(default, skip_serializing_if = "Option::is_none")]
8018    pub edge_id: Option<String>,
8019}
8020
8021/// `DeleteTeamGraphNodeResponse` model.
8022#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8023pub struct DeleteTeamGraphNodeResponse {
8024    #[serde(default, skip_serializing_if = "Option::is_none")]
8025    pub deleted: Option<bool>,
8026    #[serde(default, skip_serializing_if = "Option::is_none")]
8027    pub agent_id: Option<String>,
8028}
8029
8030/// `DeleteTeamResponse` model.
8031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8032pub struct DeleteTeamResponse {
8033    pub deleted: bool,
8034    pub team_id: String,
8035}
8036
8037/// `DeleteUserResponse` model.
8038#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8039pub struct DeleteUserResponse {
8040    #[serde(default, skip_serializing_if = "Option::is_none")]
8041    pub deleted: Option<bool>,
8042}
8043
8044/// `DeleteWebhookResponse` model.
8045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8046pub struct DeleteWebhookResponse {
8047    pub deleted: bool,
8048    pub webhook_id: String,
8049}
8050
8051/// `DeleteWorkspaceFileResponse` model.
8052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8053pub struct DeleteWorkspaceFileResponse {
8054    pub trashed: bool,
8055    pub trash_path: String,
8056    pub original_path: String,
8057}
8058
8059/// `DeleteWorkspaceFileTrash` enumeration.
8060#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8061pub enum DeleteWorkspaceFileTrash {
8062    #[default]
8063    #[serde(rename = "false")]
8064    False,
8065    /// A value the API introduced after this SDK was generated.
8066    #[serde(untagged)]
8067    Other(String),
8068}
8069
8070impl DeleteWorkspaceFileTrash {
8071    /// The value as it appears on the wire.
8072    pub fn as_str(&self) -> &str {
8073        match self {
8074            Self::False => "false",
8075            Self::Other(value) => value.as_str(),
8076        }
8077    }
8078}
8079
8080impl std::fmt::Display for DeleteWorkspaceFileTrash {
8081    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8082        f.write_str(self.as_str())
8083    }
8084}
8085
8086impl From<&str> for DeleteWorkspaceFileTrash {
8087    fn from(value: &str) -> Self {
8088        match value {
8089            "false" => Self::False,
8090            other => Self::Other(other.to_string()),
8091        }
8092    }
8093}
8094
8095/// Governance-builder request to design a new agent (packages/governance/builder-flow.ts).
8096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8097pub struct DesignRequest {
8098    pub request_id: String,
8099    pub tenant_id: String,
8100    #[serde(default, skip_serializing_if = "Option::is_none")]
8101    pub submitted_by: Option<String>,
8102    #[serde(default, skip_serializing_if = "Option::is_none")]
8103    pub agent_name: Option<String>,
8104    #[serde(default, skip_serializing_if = "Option::is_none")]
8105    pub agent_description: Option<String>,
8106    #[serde(default, skip_serializing_if = "Option::is_none")]
8107    pub agent_role: Option<String>,
8108    #[serde(default, skip_serializing_if = "Option::is_none")]
8109    pub tools: Option<Vec<String>>,
8110    #[serde(default, skip_serializing_if = "Option::is_none")]
8111    pub parent_agent_id: Option<String>,
8112    #[serde(default, skip_serializing_if = "Option::is_none")]
8113    pub rationale: Option<String>,
8114    pub status: DesignRequestStatus,
8115    /// Set once the request enters a vote.
8116    #[serde(default, skip_serializing_if = "Option::is_none")]
8117    pub proposal_id: Option<String>,
8118    /// Set once the approved design has been created.
8119    #[serde(default, skip_serializing_if = "Option::is_none")]
8120    pub spawned_agent_id: Option<String>,
8121    pub created_at: String,
8122    pub updated_at: String,
8123}
8124
8125/// Body for `POST /api/v1/governance/builder/requests`. What `DesignRequestSubmitSchema`
8126/// requires: `agent_name` and `agent_description`, neither optional. `submitted_by` is NOT
8127/// accepted from the body — it comes from the authenticated caller. The block carried no
8128/// `required` at all until 2026-09-18.
8129#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8130pub struct DesignRequestCreate {
8131    #[serde(default, skip_serializing_if = "Option::is_none")]
8132    pub submitted_by: Option<String>,
8133    pub agent_name: String,
8134    pub agent_description: String,
8135    #[serde(default, skip_serializing_if = "Option::is_none")]
8136    pub agent_role: Option<String>,
8137    #[serde(default, skip_serializing_if = "Option::is_none")]
8138    pub tools: Option<Vec<String>>,
8139    #[serde(default, skip_serializing_if = "Option::is_none")]
8140    pub parent_agent_id: Option<String>,
8141    #[serde(default, skip_serializing_if = "Option::is_none")]
8142    pub rationale: Option<String>,
8143}
8144
8145/// `DesignRequestStatus` enumeration.
8146#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8147pub enum DesignRequestStatus {
8148    #[default]
8149    #[serde(rename = "pending")]
8150    Pending,
8151    #[serde(rename = "voting")]
8152    Voting,
8153    #[serde(rename = "approved")]
8154    Approved,
8155    #[serde(rename = "rejected")]
8156    Rejected,
8157    #[serde(rename = "spawned")]
8158    Spawned,
8159    /// A value the API introduced after this SDK was generated.
8160    #[serde(untagged)]
8161    Other(String),
8162}
8163
8164impl DesignRequestStatus {
8165    /// The value as it appears on the wire.
8166    pub fn as_str(&self) -> &str {
8167        match self {
8168            Self::Pending => "pending",
8169            Self::Voting => "voting",
8170            Self::Approved => "approved",
8171            Self::Rejected => "rejected",
8172            Self::Spawned => "spawned",
8173            Self::Other(value) => value.as_str(),
8174        }
8175    }
8176}
8177
8178impl std::fmt::Display for DesignRequestStatus {
8179    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8180        f.write_str(self.as_str())
8181    }
8182}
8183
8184impl From<&str> for DesignRequestStatus {
8185    fn from(value: &str) -> Self {
8186        match value {
8187            "pending" => Self::Pending,
8188            "voting" => Self::Voting,
8189            "approved" => Self::Approved,
8190            "rejected" => Self::Rejected,
8191            "spawned" => Self::Spawned,
8192            other => Self::Other(other.to_string()),
8193        }
8194    }
8195}
8196
8197/// `DisableMfaResponse` model.
8198#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8199pub struct DisableMfaResponse {
8200    pub disabled: bool,
8201}
8202
8203/// `DomainCertLifecycle` model.
8204#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8205pub struct DomainCertLifecycle {
8206    /// `renewal_due` is entered 14 days or less before `not_after`.
8207    pub state: DomainCertLifecycleState,
8208    #[serde(default, skip_serializing_if = "Option::is_none")]
8209    pub not_before: Option<String>,
8210    #[serde(default, skip_serializing_if = "Option::is_none")]
8211    pub not_after: Option<String>,
8212    /// Issuer CN, so a CA migration is visible without parsing the leaf.
8213    #[serde(default, skip_serializing_if = "Option::is_none")]
8214    pub issuer_cn: Option<String>,
8215    #[serde(default, skip_serializing_if = "Option::is_none")]
8216    pub last_checked_at: Option<String>,
8217    #[serde(default, skip_serializing_if = "Option::is_none")]
8218    pub last_error: Option<String>,
8219}
8220
8221/// `renewal_due` is entered 14 days or less before `not_after`.
8222#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8223pub enum DomainCertLifecycleState {
8224    #[default]
8225    #[serde(rename = "none")]
8226    None,
8227    #[serde(rename = "provisioning")]
8228    Provisioning,
8229    #[serde(rename = "active")]
8230    Active,
8231    #[serde(rename = "renewal_due")]
8232    RenewalDue,
8233    #[serde(rename = "failed")]
8234    Failed,
8235    #[serde(rename = "revoked")]
8236    Revoked,
8237    /// A value the API introduced after this SDK was generated.
8238    #[serde(untagged)]
8239    Other(String),
8240}
8241
8242impl DomainCertLifecycleState {
8243    /// The value as it appears on the wire.
8244    pub fn as_str(&self) -> &str {
8245        match self {
8246            Self::None => "none",
8247            Self::Provisioning => "provisioning",
8248            Self::Active => "active",
8249            Self::RenewalDue => "renewal_due",
8250            Self::Failed => "failed",
8251            Self::Revoked => "revoked",
8252            Self::Other(value) => value.as_str(),
8253        }
8254    }
8255}
8256
8257impl std::fmt::Display for DomainCertLifecycleState {
8258    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8259        f.write_str(self.as_str())
8260    }
8261}
8262
8263impl From<&str> for DomainCertLifecycleState {
8264    fn from(value: &str) -> Self {
8265        match value {
8266            "none" => Self::None,
8267            "provisioning" => Self::Provisioning,
8268            "active" => Self::Active,
8269            "renewal_due" => Self::RenewalDue,
8270            "failed" => Self::Failed,
8271            "revoked" => Self::Revoked,
8272            other => Self::Other(other.to_string()),
8273        }
8274    }
8275}
8276
8277/// `DomainDnsLifecycle` model.
8278#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8279pub struct DomainDnsLifecycle {
8280    /// `drift` means it verified once and no longer matches — distinct from `failed`, which never
8281    /// verified.
8282    pub state: DomainDnsLifecycleState,
8283    pub method: DomainDnsLifecycleMethod,
8284    /// What the customer points DNS at. Stored per record so changing the platform target does not
8285    /// silently invalidate domains already pinned to the old one.
8286    pub target: String,
8287    /// Most recent lookup, whatever its result.
8288    #[serde(default, skip_serializing_if = "Option::is_none")]
8289    pub last_checked_at: Option<String>,
8290    /// First time it matched. Sticky across verified → drift → verified, so it is not the time of
8291    /// the LAST success.
8292    #[serde(default, skip_serializing_if = "Option::is_none")]
8293    pub verified_at: Option<String>,
8294    #[serde(default, skip_serializing_if = "Option::is_none")]
8295    pub last_error: Option<String>,
8296}
8297
8298/// `DomainDnsLifecycleMethod` enumeration.
8299#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8300pub enum DomainDnsLifecycleMethod {
8301    #[default]
8302    #[serde(rename = "cname")]
8303    Cname,
8304    #[serde(rename = "a")]
8305    A,
8306    /// A value the API introduced after this SDK was generated.
8307    #[serde(untagged)]
8308    Other(String),
8309}
8310
8311impl DomainDnsLifecycleMethod {
8312    /// The value as it appears on the wire.
8313    pub fn as_str(&self) -> &str {
8314        match self {
8315            Self::Cname => "cname",
8316            Self::A => "a",
8317            Self::Other(value) => value.as_str(),
8318        }
8319    }
8320}
8321
8322impl std::fmt::Display for DomainDnsLifecycleMethod {
8323    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8324        f.write_str(self.as_str())
8325    }
8326}
8327
8328impl From<&str> for DomainDnsLifecycleMethod {
8329    fn from(value: &str) -> Self {
8330        match value {
8331            "cname" => Self::Cname,
8332            "a" => Self::A,
8333            other => Self::Other(other.to_string()),
8334        }
8335    }
8336}
8337
8338/// `drift` means it verified once and no longer matches — distinct from `failed`, which never
8339/// verified.
8340#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8341pub enum DomainDnsLifecycleState {
8342    #[default]
8343    #[serde(rename = "pending")]
8344    Pending,
8345    #[serde(rename = "verified")]
8346    Verified,
8347    #[serde(rename = "failed")]
8348    Failed,
8349    #[serde(rename = "drift")]
8350    Drift,
8351    #[serde(rename = "deactivated")]
8352    Deactivated,
8353    /// A value the API introduced after this SDK was generated.
8354    #[serde(untagged)]
8355    Other(String),
8356}
8357
8358impl DomainDnsLifecycleState {
8359    /// The value as it appears on the wire.
8360    pub fn as_str(&self) -> &str {
8361        match self {
8362            Self::Pending => "pending",
8363            Self::Verified => "verified",
8364            Self::Failed => "failed",
8365            Self::Drift => "drift",
8366            Self::Deactivated => "deactivated",
8367            Self::Other(value) => value.as_str(),
8368        }
8369    }
8370}
8371
8372impl std::fmt::Display for DomainDnsLifecycleState {
8373    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8374        f.write_str(self.as_str())
8375    }
8376}
8377
8378impl From<&str> for DomainDnsLifecycleState {
8379    fn from(value: &str) -> Self {
8380        match value {
8381            "pending" => Self::Pending,
8382            "verified" => Self::Verified,
8383            "failed" => Self::Failed,
8384            "drift" => Self::Drift,
8385            "deactivated" => Self::Deactivated,
8386            other => Self::Other(other.to_string()),
8387        }
8388    }
8389}
8390
8391/// A drawing a person and an agent share in real time (docs/DESIGNER-CANVAS.md §4.1). Pixels
8392/// live in 256×256 tiles behind the journal; this record is the structure.
8393#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8394pub struct Drawing {
8395    pub drawing_id: String,
8396    pub session_id: String,
8397    pub workspace_id: String,
8398    pub width: i64,
8399    pub height: i64,
8400    pub dpi: i64,
8401    /// `#rrggbb` or `transparent`.
8402    pub background: String,
8403    pub layers: Vec<DrawingLayer>,
8404    /// The last journal entry applied to this drawing.
8405    pub seq: i64,
8406    /// The seq up to which tiles are materialised; 0 until the first snapshot.
8407    pub snapshot_seq: i64,
8408    pub created_at: String,
8409    pub updated_at: String,
8410}
8411
8412/// `DrawingBrush` model.
8413#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8414pub struct DrawingBrush {
8415    pub preset: String,
8416    /// Diameter in canvas pixels.
8417    pub size: f64,
8418    pub hardness: i64,
8419    pub opacity: i64,
8420    pub flow: i64,
8421    /// Percent of `size` between dabs; the client spaces the points, the renderer stamps every
8422    /// point it is given.
8423    pub spacing: f64,
8424    /// Absent on `erase`.
8425    #[serde(default, skip_serializing_if = "Option::is_none")]
8426    pub color: Option<String>,
8427}
8428
8429/// `DrawingJournalEntry` model.
8430#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8431pub struct DrawingJournalEntry {
8432    pub seq: i64,
8433    pub client_op_id: String,
8434    pub author: DrawingJournalEntryAuthor,
8435    pub at: String,
8436    pub op: DrawingOp,
8437}
8438
8439/// `DrawingJournalEntryAuthor` model.
8440#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8441pub struct DrawingJournalEntryAuthor {
8442    pub kind: DrawingJournalEntryAuthorKind,
8443    pub id: String,
8444    #[serde(default, skip_serializing_if = "Option::is_none")]
8445    pub run_id: Option<String>,
8446}
8447
8448/// `DrawingJournalEntryAuthorKind` enumeration.
8449#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8450pub enum DrawingJournalEntryAuthorKind {
8451    #[default]
8452    #[serde(rename = "user")]
8453    User,
8454    #[serde(rename = "agent")]
8455    Agent,
8456    /// A value the API introduced after this SDK was generated.
8457    #[serde(untagged)]
8458    Other(String),
8459}
8460
8461impl DrawingJournalEntryAuthorKind {
8462    /// The value as it appears on the wire.
8463    pub fn as_str(&self) -> &str {
8464        match self {
8465            Self::User => "user",
8466            Self::Agent => "agent",
8467            Self::Other(value) => value.as_str(),
8468        }
8469    }
8470}
8471
8472impl std::fmt::Display for DrawingJournalEntryAuthorKind {
8473    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8474        f.write_str(self.as_str())
8475    }
8476}
8477
8478impl From<&str> for DrawingJournalEntryAuthorKind {
8479    fn from(value: &str) -> Self {
8480        match value {
8481            "user" => Self::User,
8482            "agent" => Self::Agent,
8483            other => Self::Other(other.to_string()),
8484        }
8485    }
8486}
8487
8488/// `DrawingLayer` model.
8489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8490pub struct DrawingLayer {
8491    pub layer_id: String,
8492    pub name: String,
8493    /// An integer 0–255, like every channel value in a drawing (docs/DESIGNER-CANVAS.md §4.4).
8494    pub opacity: i64,
8495    pub blend: DrawingLayerBlend,
8496    pub visible: bool,
8497    pub locked: bool,
8498    pub kind: DrawingLayerKind,
8499    /// Set when the layer was placed from a generated or uploaded image.
8500    #[serde(default, skip_serializing_if = "Option::is_none")]
8501    pub source: Option<DrawingLayerSource>,
8502}
8503
8504/// `DrawingLayerBlend` enumeration.
8505#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8506pub enum DrawingLayerBlend {
8507    #[default]
8508    #[serde(rename = "normal")]
8509    Normal,
8510    #[serde(rename = "multiply")]
8511    Multiply,
8512    #[serde(rename = "screen")]
8513    Screen,
8514    #[serde(rename = "overlay")]
8515    Overlay,
8516    #[serde(rename = "darken")]
8517    Darken,
8518    #[serde(rename = "lighten")]
8519    Lighten,
8520    #[serde(rename = "add")]
8521    Add,
8522    /// A value the API introduced after this SDK was generated.
8523    #[serde(untagged)]
8524    Other(String),
8525}
8526
8527impl DrawingLayerBlend {
8528    /// The value as it appears on the wire.
8529    pub fn as_str(&self) -> &str {
8530        match self {
8531            Self::Normal => "normal",
8532            Self::Multiply => "multiply",
8533            Self::Screen => "screen",
8534            Self::Overlay => "overlay",
8535            Self::Darken => "darken",
8536            Self::Lighten => "lighten",
8537            Self::Add => "add",
8538            Self::Other(value) => value.as_str(),
8539        }
8540    }
8541}
8542
8543impl std::fmt::Display for DrawingLayerBlend {
8544    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8545        f.write_str(self.as_str())
8546    }
8547}
8548
8549impl From<&str> for DrawingLayerBlend {
8550    fn from(value: &str) -> Self {
8551        match value {
8552            "normal" => Self::Normal,
8553            "multiply" => Self::Multiply,
8554            "screen" => Self::Screen,
8555            "overlay" => Self::Overlay,
8556            "darken" => Self::Darken,
8557            "lighten" => Self::Lighten,
8558            "add" => Self::Add,
8559            other => Self::Other(other.to_string()),
8560        }
8561    }
8562}
8563
8564/// `DrawingLayerKind` enumeration.
8565#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8566pub enum DrawingLayerKind {
8567    #[default]
8568    #[serde(rename = "raster")]
8569    Raster,
8570    /// A value the API introduced after this SDK was generated.
8571    #[serde(untagged)]
8572    Other(String),
8573}
8574
8575impl DrawingLayerKind {
8576    /// The value as it appears on the wire.
8577    pub fn as_str(&self) -> &str {
8578        match self {
8579            Self::Raster => "raster",
8580            Self::Other(value) => value.as_str(),
8581        }
8582    }
8583}
8584
8585impl std::fmt::Display for DrawingLayerKind {
8586    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8587        f.write_str(self.as_str())
8588    }
8589}
8590
8591impl From<&str> for DrawingLayerKind {
8592    fn from(value: &str) -> Self {
8593        match value {
8594            "raster" => Self::Raster,
8595            other => Self::Other(other.to_string()),
8596        }
8597    }
8598}
8599
8600/// Set when the layer was placed from a generated or uploaded image.
8601#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8602pub struct DrawingLayerSource {
8603    pub file_id: String,
8604    pub tool: String,
8605}
8606
8607/// What a person hands the agent (docs/DESIGNER-CANVAS.md §4.3): the selection as an L8 PNG of
8608/// the drawing's size plus its bounding box.
8609#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8610pub struct DrawingMask {
8611    pub mask_id: String,
8612    pub drawing_id: String,
8613    pub width: i64,
8614    pub height: i64,
8615    pub bbox: DrawingMaskBbox,
8616    /// The L8 PNG in the workspace; also served by `…/masks/{maskId}/content`.
8617    pub file_id: String,
8618    pub created_at: String,
8619}
8620
8621/// `DrawingMaskBbox` model.
8622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8623pub struct DrawingMaskBbox {
8624    pub x: i64,
8625    pub y: i64,
8626    pub w: i64,
8627    pub h: i64,
8628}
8629
8630/// One journal op (docs/DESIGNER-CANVAS.md §4.2), discriminated by `type`: stroke, erase, fill,
8631/// place_image, layer_add, layer_remove, layer_update, layer_reorder, undo, redo. A stroke
8632/// longer than 1 024 points is sent in parts that share `stroke_id`, count `part` from 0 and
8633/// carry `continues: true` on every part but the last; `t` runs across the parts. `encoding` is
8634/// required and is `json` in v1.
8635#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8636pub struct DrawingOp {
8637    pub r#type: DrawingOpType,
8638    #[serde(default, skip_serializing_if = "Option::is_none")]
8639    pub layer_id: Option<String>,
8640    #[serde(default, skip_serializing_if = "Option::is_none")]
8641    pub brush: Option<DrawingBrush>,
8642    #[serde(default, skip_serializing_if = "Option::is_none")]
8643    pub encoding: Option<DrawingOpEncoding>,
8644    #[serde(default, skip_serializing_if = "Option::is_none")]
8645    pub points: Option<Vec<DrawingStrokePoint>>,
8646    #[serde(default, skip_serializing_if = "Option::is_none")]
8647    pub stroke_id: Option<String>,
8648    #[serde(default, skip_serializing_if = "Option::is_none")]
8649    pub part: Option<i64>,
8650    #[serde(default, skip_serializing_if = "Option::is_none")]
8651    pub continues: Option<bool>,
8652    #[serde(default, skip_serializing_if = "Option::is_none")]
8653    pub x: Option<f64>,
8654    #[serde(default, skip_serializing_if = "Option::is_none")]
8655    pub y: Option<f64>,
8656    #[serde(default, skip_serializing_if = "Option::is_none")]
8657    pub w: Option<i64>,
8658    #[serde(default, skip_serializing_if = "Option::is_none")]
8659    pub h: Option<i64>,
8660    #[serde(default, skip_serializing_if = "Option::is_none")]
8661    pub color: Option<String>,
8662    #[serde(default, skip_serializing_if = "Option::is_none")]
8663    pub tolerance: Option<i64>,
8664    #[serde(default, skip_serializing_if = "Option::is_none")]
8665    pub contiguous: Option<bool>,
8666    #[serde(default, skip_serializing_if = "Option::is_none")]
8667    pub file_id: Option<String>,
8668    #[serde(default, skip_serializing_if = "Option::is_none")]
8669    pub fit: Option<DrawingOpFit>,
8670    #[serde(default, skip_serializing_if = "Option::is_none")]
8671    pub layer: Option<DrawingLayer>,
8672    /// Values below 0 are clamped, not refused.
8673    #[serde(default, skip_serializing_if = "Option::is_none")]
8674    pub index: Option<i64>,
8675    #[serde(default, skip_serializing_if = "Option::is_none")]
8676    pub patch: Option<DrawingOpPatch>,
8677    #[serde(default, skip_serializing_if = "Option::is_none")]
8678    pub order: Option<Vec<String>>,
8679    #[serde(default, skip_serializing_if = "Option::is_none")]
8680    pub undo_of: Option<i64>,
8681    #[serde(default, skip_serializing_if = "Option::is_none")]
8682    pub redo_of: Option<i64>,
8683}
8684
8685/// `DrawingOpEncoding` enumeration.
8686#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8687pub enum DrawingOpEncoding {
8688    #[default]
8689    #[serde(rename = "json")]
8690    JSON,
8691    /// A value the API introduced after this SDK was generated.
8692    #[serde(untagged)]
8693    Other(String),
8694}
8695
8696impl DrawingOpEncoding {
8697    /// The value as it appears on the wire.
8698    pub fn as_str(&self) -> &str {
8699        match self {
8700            Self::JSON => "json",
8701            Self::Other(value) => value.as_str(),
8702        }
8703    }
8704}
8705
8706impl std::fmt::Display for DrawingOpEncoding {
8707    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8708        f.write_str(self.as_str())
8709    }
8710}
8711
8712impl From<&str> for DrawingOpEncoding {
8713    fn from(value: &str) -> Self {
8714        match value {
8715            "json" => Self::JSON,
8716            other => Self::Other(other.to_string()),
8717        }
8718    }
8719}
8720
8721/// `DrawingOpFit` enumeration.
8722#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8723pub enum DrawingOpFit {
8724    #[default]
8725    #[serde(rename = "stretch")]
8726    Stretch,
8727    #[serde(rename = "contain")]
8728    Contain,
8729    /// A value the API introduced after this SDK was generated.
8730    #[serde(untagged)]
8731    Other(String),
8732}
8733
8734impl DrawingOpFit {
8735    /// The value as it appears on the wire.
8736    pub fn as_str(&self) -> &str {
8737        match self {
8738            Self::Stretch => "stretch",
8739            Self::Contain => "contain",
8740            Self::Other(value) => value.as_str(),
8741        }
8742    }
8743}
8744
8745impl std::fmt::Display for DrawingOpFit {
8746    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8747        f.write_str(self.as_str())
8748    }
8749}
8750
8751impl From<&str> for DrawingOpFit {
8752    fn from(value: &str) -> Self {
8753        match value {
8754            "stretch" => Self::Stretch,
8755            "contain" => Self::Contain,
8756            other => Self::Other(other.to_string()),
8757        }
8758    }
8759}
8760
8761/// `DrawingOpPatch` model.
8762#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8763pub struct DrawingOpPatch {
8764    #[serde(default, skip_serializing_if = "Option::is_none")]
8765    pub name: Option<String>,
8766    #[serde(default, skip_serializing_if = "Option::is_none")]
8767    pub opacity: Option<i64>,
8768    #[serde(default, skip_serializing_if = "Option::is_none")]
8769    pub blend: Option<DrawingLayerBlend>,
8770    #[serde(default, skip_serializing_if = "Option::is_none")]
8771    pub visible: Option<bool>,
8772    #[serde(default, skip_serializing_if = "Option::is_none")]
8773    pub locked: Option<bool>,
8774}
8775
8776/// `DrawingOpType` enumeration.
8777#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8778pub enum DrawingOpType {
8779    #[default]
8780    #[serde(rename = "stroke")]
8781    Stroke,
8782    #[serde(rename = "erase")]
8783    Erase,
8784    #[serde(rename = "fill")]
8785    Fill,
8786    #[serde(rename = "place_image")]
8787    PlaceImage,
8788    #[serde(rename = "layer_add")]
8789    LayerAdd,
8790    #[serde(rename = "layer_remove")]
8791    LayerRemove,
8792    #[serde(rename = "layer_update")]
8793    LayerUpdate,
8794    #[serde(rename = "layer_reorder")]
8795    LayerReorder,
8796    #[serde(rename = "undo")]
8797    Undo,
8798    #[serde(rename = "redo")]
8799    Redo,
8800    /// A value the API introduced after this SDK was generated.
8801    #[serde(untagged)]
8802    Other(String),
8803}
8804
8805impl DrawingOpType {
8806    /// The value as it appears on the wire.
8807    pub fn as_str(&self) -> &str {
8808        match self {
8809            Self::Stroke => "stroke",
8810            Self::Erase => "erase",
8811            Self::Fill => "fill",
8812            Self::PlaceImage => "place_image",
8813            Self::LayerAdd => "layer_add",
8814            Self::LayerRemove => "layer_remove",
8815            Self::LayerUpdate => "layer_update",
8816            Self::LayerReorder => "layer_reorder",
8817            Self::Undo => "undo",
8818            Self::Redo => "redo",
8819            Self::Other(value) => value.as_str(),
8820        }
8821    }
8822}
8823
8824impl std::fmt::Display for DrawingOpType {
8825    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8826        f.write_str(self.as_str())
8827    }
8828}
8829
8830impl From<&str> for DrawingOpType {
8831    fn from(value: &str) -> Self {
8832        match value {
8833            "stroke" => Self::Stroke,
8834            "erase" => Self::Erase,
8835            "fill" => Self::Fill,
8836            "place_image" => Self::PlaceImage,
8837            "layer_add" => Self::LayerAdd,
8838            "layer_remove" => Self::LayerRemove,
8839            "layer_update" => Self::LayerUpdate,
8840            "layer_reorder" => Self::LayerReorder,
8841            "undo" => Self::Undo,
8842            "redo" => Self::Redo,
8843            other => Self::Other(other.to_string()),
8844        }
8845    }
8846}
8847
8848/// A selection in canvas pixels: `rect` {x, y, w, h}, `ellipse` {cx, cy, rx, ry} or `lasso`
8849/// {points\[\]}.
8850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8851pub struct DrawingSelectionShape {
8852    pub kind: DrawingSelectionShapeKind,
8853    #[serde(default, skip_serializing_if = "Option::is_none")]
8854    pub x: Option<f64>,
8855    #[serde(default, skip_serializing_if = "Option::is_none")]
8856    pub y: Option<f64>,
8857    #[serde(default, skip_serializing_if = "Option::is_none")]
8858    pub w: Option<f64>,
8859    #[serde(default, skip_serializing_if = "Option::is_none")]
8860    pub h: Option<f64>,
8861    #[serde(default, skip_serializing_if = "Option::is_none")]
8862    pub cx: Option<f64>,
8863    #[serde(default, skip_serializing_if = "Option::is_none")]
8864    pub cy: Option<f64>,
8865    #[serde(default, skip_serializing_if = "Option::is_none")]
8866    pub rx: Option<f64>,
8867    #[serde(default, skip_serializing_if = "Option::is_none")]
8868    pub ry: Option<f64>,
8869    #[serde(default, skip_serializing_if = "Option::is_none")]
8870    pub points: Option<Vec<DrawingSelectionShapePoint>>,
8871}
8872
8873/// `DrawingSelectionShapeKind` enumeration.
8874#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
8875pub enum DrawingSelectionShapeKind {
8876    #[default]
8877    #[serde(rename = "rect")]
8878    Rect,
8879    #[serde(rename = "ellipse")]
8880    Ellipse,
8881    #[serde(rename = "lasso")]
8882    Lasso,
8883    /// A value the API introduced after this SDK was generated.
8884    #[serde(untagged)]
8885    Other(String),
8886}
8887
8888impl DrawingSelectionShapeKind {
8889    /// The value as it appears on the wire.
8890    pub fn as_str(&self) -> &str {
8891        match self {
8892            Self::Rect => "rect",
8893            Self::Ellipse => "ellipse",
8894            Self::Lasso => "lasso",
8895            Self::Other(value) => value.as_str(),
8896        }
8897    }
8898}
8899
8900impl std::fmt::Display for DrawingSelectionShapeKind {
8901    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8902        f.write_str(self.as_str())
8903    }
8904}
8905
8906impl From<&str> for DrawingSelectionShapeKind {
8907    fn from(value: &str) -> Self {
8908        match value {
8909            "rect" => Self::Rect,
8910            "ellipse" => Self::Ellipse,
8911            "lasso" => Self::Lasso,
8912            other => Self::Other(other.to_string()),
8913        }
8914    }
8915}
8916
8917/// `DrawingSelectionShapePoint` model.
8918#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8919pub struct DrawingSelectionShapePoint {
8920    pub x: f64,
8921    pub y: f64,
8922}
8923
8924/// `DrawingStrokePoint` model.
8925#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8926pub struct DrawingStrokePoint {
8927    pub x: f64,
8928    pub y: f64,
8929    /// Pressure.
8930    pub p: i64,
8931    /// Tilt.
8932    pub tx: f64,
8933    pub ty: f64,
8934    /// Milliseconds from the start of the stroke, across every part.
8935    pub t: f64,
8936}
8937
8938/// The mascot character of an agent (DropGenome in @uarp/runtime): silhouette, motion and
8939/// affect parameters plus a signature pose. Written by the platform at create/backfill or by a
8940/// client from the builder.
8941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8942pub struct DropGenome {
8943    pub v: i64,
8944    pub archetype: String,
8945    pub silhouette: DropGenomeSilhouette,
8946    pub motion: DropGenomeMotion,
8947    pub affect: DropGenomeAffect,
8948    pub signature_pose: String,
8949}
8950
8951/// `DropGenomeAffect` model.
8952#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8953pub struct DropGenomeAffect {
8954    #[serde(default, skip_serializing_if = "Option::is_none")]
8955    pub expressiveness: Option<f64>,
8956    #[serde(default, skip_serializing_if = "Option::is_none")]
8957    pub baseline_valence: Option<f64>,
8958    #[serde(default, skip_serializing_if = "Option::is_none")]
8959    pub reactivity: Option<f64>,
8960}
8961
8962/// `DropGenomeMotion` model.
8963#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8964pub struct DropGenomeMotion {
8965    #[serde(default, skip_serializing_if = "Option::is_none")]
8966    pub tempo: Option<f64>,
8967    #[serde(default, skip_serializing_if = "Option::is_none")]
8968    pub springiness: Option<f64>,
8969    #[serde(default, skip_serializing_if = "Option::is_none")]
8970    pub amplitude: Option<f64>,
8971    #[serde(default, skip_serializing_if = "Option::is_none")]
8972    pub jitter: Option<f64>,
8973    #[serde(default, skip_serializing_if = "Option::is_none")]
8974    pub settle_bias: Option<f64>,
8975}
8976
8977/// `DropGenomeSilhouette` model.
8978#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8979pub struct DropGenomeSilhouette {
8980    #[serde(default, skip_serializing_if = "Option::is_none")]
8981    pub height: Option<f64>,
8982    #[serde(default, skip_serializing_if = "Option::is_none")]
8983    pub width: Option<f64>,
8984    #[serde(default, skip_serializing_if = "Option::is_none")]
8985    pub tip: Option<f64>,
8986    #[serde(default, skip_serializing_if = "Option::is_none")]
8987    pub weight: Option<f64>,
8988}
8989
8990/// types/mcp.ts EgressRule — a host glob with optional ports (default \[443\]) and protocol
8991/// (default https).
8992#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8993pub struct EgressRule {
8994    pub host_pattern: String,
8995    #[serde(default, skip_serializing_if = "Option::is_none")]
8996    pub ports: Option<Vec<i64>>,
8997    #[serde(default, skip_serializing_if = "Option::is_none")]
8998    pub protocol: Option<EgressRuleProtocol>,
8999}
9000
9001/// `EgressRuleProtocol` enumeration.
9002#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9003pub enum EgressRuleProtocol {
9004    #[default]
9005    #[serde(rename = "https")]
9006    HTTPS,
9007    #[serde(rename = "http")]
9008    HTTP,
9009    /// A value the API introduced after this SDK was generated.
9010    #[serde(untagged)]
9011    Other(String),
9012}
9013
9014impl EgressRuleProtocol {
9015    /// The value as it appears on the wire.
9016    pub fn as_str(&self) -> &str {
9017        match self {
9018            Self::HTTPS => "https",
9019            Self::HTTP => "http",
9020            Self::Other(value) => value.as_str(),
9021        }
9022    }
9023}
9024
9025impl std::fmt::Display for EgressRuleProtocol {
9026    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9027        f.write_str(self.as_str())
9028    }
9029}
9030
9031impl From<&str> for EgressRuleProtocol {
9032    fn from(value: &str) -> Self {
9033        match value {
9034            "https" => Self::HTTPS,
9035            "http" => Self::HTTP,
9036            other => Self::Other(other.to_string()),
9037        }
9038    }
9039}
9040
9041/// `EmbeddingsRequest` model.
9042#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9043pub struct EmbeddingsRequest {
9044    /// Embedding model (optional; platform default used)
9045    #[serde(default, skip_serializing_if = "Option::is_none")]
9046    pub model: Option<String>,
9047    /// Input text or array of texts
9048    pub input: serde_json::Value,
9049    /// Server default: `"float"`.
9050    #[serde(default, skip_serializing_if = "Option::is_none")]
9051    pub encoding_format: Option<EmbeddingsRequestEncodingFormat>,
9052    /// Requested embedding dimensions. **Currently ignored**: handler always emits the
9053    /// platform-configured dimension (256 for the default `multilingual-e5-large-instruct` model).
9054    #[serde(default, skip_serializing_if = "Option::is_none")]
9055    pub dimensions: Option<i64>,
9056}
9057
9058/// `EmbeddingsRequestEncodingFormat` enumeration.
9059#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9060pub enum EmbeddingsRequestEncodingFormat {
9061    #[default]
9062    #[serde(rename = "float")]
9063    Float,
9064    #[serde(rename = "base64")]
9065    Base64,
9066    /// A value the API introduced after this SDK was generated.
9067    #[serde(untagged)]
9068    Other(String),
9069}
9070
9071impl EmbeddingsRequestEncodingFormat {
9072    /// The value as it appears on the wire.
9073    pub fn as_str(&self) -> &str {
9074        match self {
9075            Self::Float => "float",
9076            Self::Base64 => "base64",
9077            Self::Other(value) => value.as_str(),
9078        }
9079    }
9080}
9081
9082impl std::fmt::Display for EmbeddingsRequestEncodingFormat {
9083    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9084        f.write_str(self.as_str())
9085    }
9086}
9087
9088impl From<&str> for EmbeddingsRequestEncodingFormat {
9089    fn from(value: &str) -> Self {
9090        match value {
9091            "float" => Self::Float,
9092            "base64" => Self::Base64,
9093            other => Self::Other(other.to_string()),
9094        }
9095    }
9096}
9097
9098/// `EmbeddingsResponse` model.
9099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9100pub struct EmbeddingsResponse {
9101    /// Always `list`.
9102    pub object: String,
9103    pub data: Vec<EmbeddingsResponseDataItem>,
9104    pub model: String,
9105    #[serde(default, skip_serializing_if = "Option::is_none")]
9106    pub usage: Option<EmbeddingsResponseUsage>,
9107}
9108
9109/// `EmbeddingsResponseDataItem` model.
9110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9111pub struct EmbeddingsResponseDataItem {
9112    /// Always `embedding`.
9113    pub object: String,
9114    pub embedding: Vec<f64>,
9115    pub index: i64,
9116}
9117
9118/// `EmbeddingsResponseUsage` model.
9119#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9120pub struct EmbeddingsResponseUsage {
9121    #[serde(default, skip_serializing_if = "Option::is_none")]
9122    pub prompt_tokens: Option<i64>,
9123    #[serde(default, skip_serializing_if = "Option::is_none")]
9124    pub total_tokens: Option<i64>,
9125}
9126
9127/// `EmergencyState` model.
9128#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9129pub struct EmergencyState {
9130    pub mode: EmergencyStateMode,
9131    #[serde(default, skip_serializing_if = "Option::is_none")]
9132    pub reason: Option<String>,
9133    #[serde(default, skip_serializing_if = "Option::is_none")]
9134    pub activated_at: Option<String>,
9135    #[serde(default, skip_serializing_if = "Option::is_none")]
9136    pub activated_by: Option<String>,
9137    #[serde(default, skip_serializing_if = "Option::is_none")]
9138    pub deadline: Option<String>,
9139}
9140
9141/// `EmergencyStateMode` enumeration.
9142#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9143pub enum EmergencyStateMode {
9144    #[default]
9145    #[serde(rename = "normal")]
9146    Normal,
9147    #[serde(rename = "safe_mode")]
9148    SafeMode,
9149    #[serde(rename = "arbitration_safe_mode")]
9150    ArbitrationSafeMode,
9151    #[serde(rename = "bootstrap")]
9152    Bootstrap,
9153    /// A value the API introduced after this SDK was generated.
9154    #[serde(untagged)]
9155    Other(String),
9156}
9157
9158impl EmergencyStateMode {
9159    /// The value as it appears on the wire.
9160    pub fn as_str(&self) -> &str {
9161        match self {
9162            Self::Normal => "normal",
9163            Self::SafeMode => "safe_mode",
9164            Self::ArbitrationSafeMode => "arbitration_safe_mode",
9165            Self::Bootstrap => "bootstrap",
9166            Self::Other(value) => value.as_str(),
9167        }
9168    }
9169}
9170
9171impl std::fmt::Display for EmergencyStateMode {
9172    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9173        f.write_str(self.as_str())
9174    }
9175}
9176
9177impl From<&str> for EmergencyStateMode {
9178    fn from(value: &str) -> Self {
9179        match value {
9180            "normal" => Self::Normal,
9181            "safe_mode" => Self::SafeMode,
9182            "arbitration_safe_mode" => Self::ArbitrationSafeMode,
9183            "bootstrap" => Self::Bootstrap,
9184            other => Self::Other(other.to_string()),
9185        }
9186    }
9187}
9188
9189/// `EmptyWorkspaceTrashResponse` model.
9190#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9191pub struct EmptyWorkspaceTrashResponse {
9192    pub deleted_count: i64,
9193    pub message: String,
9194}
9195
9196/// middleware/rate-limit.ts EndpointRateLimitConfig — camelCase on the wire.
9197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9198pub struct EndpointRateLimit {
9199    pub pattern: String,
9200    /// Deprecated spelling of `max_requests` — the same value, kept for the compatibility window
9201    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
9202    /// `max_requests`.
9203    #[serde(rename = "maxRequests")]
9204    pub max_requests: i64,
9205    /// Deprecated spelling of `window_sec` — the same value, kept for the compatibility window and
9206    /// removed in the next breaking release (the one that moves `X-API-Version`). Read
9207    /// `window_sec`.
9208    #[serde(rename = "windowSec")]
9209    pub window_sec: i64,
9210    pub source: GuardrailConfigItemSource,
9211    #[serde(rename = "max_requests")]
9212    pub max_requests_: i64,
9213    #[serde(rename = "window_sec")]
9214    pub window_sec_: i64,
9215}
9216
9217/// `EnforcementResult` model.
9218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9219pub struct EnforcementResult {
9220    /// False when any matched rule carries a blocking penalty.
9221    pub allowed: bool,
9222    /// Deprecated spelling of `check_result` — the same value, kept for the compatibility window
9223    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
9224    /// `check_result`.
9225    #[serde(rename = "checkResult")]
9226    pub check_result: EnforcementResultCheckResult,
9227    /// What the matched rules call for. Empty when nothing matched.
9228    pub penalties: Vec<EnforcementResultPenalty>,
9229    #[serde(rename = "check_result")]
9230    pub check_result_: EnforcementResultCheckResult2,
9231}
9232
9233/// Deprecated spelling of `check_result` — the same value, kept for the compatibility window
9234/// and removed in the next breaking release (the one that moves `X-API-Version`). Read
9235/// `check_result`.
9236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9237pub struct EnforcementResultCheckResult {
9238    pub allowed: bool,
9239    /// Rule ids actually evaluated. Empty means no rule applied — never that nothing was checked.
9240    pub checked_rules: Vec<String>,
9241    pub violations: Vec<ConstitutionViolation>,
9242    pub checked_at: String,
9243}
9244
9245/// `EnforcementResultCheckResult2` model.
9246#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9247pub struct EnforcementResultCheckResult2 {
9248    pub allowed: bool,
9249    /// Rule ids actually evaluated. Empty means no rule applied — never that nothing was checked.
9250    pub checked_rules: Vec<String>,
9251    pub violations: Vec<ConstitutionViolation>,
9252    pub checked_at: String,
9253}
9254
9255/// `EnforcementResultPenalty` model.
9256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9257pub struct EnforcementResultPenalty {
9258    /// Deprecated spelling of `rule_id` — the same value, kept for the compatibility window and
9259    /// removed in the next breaking release (the one that moves `X-API-Version`). Read `rule_id`.
9260    #[serde(rename = "ruleId")]
9261    pub rule_id: String,
9262    pub penalty: ConstitutionRulePenalty,
9263    #[serde(rename = "rule_id")]
9264    pub rule_id_: String,
9265}
9266
9267/// `EnrolMfaRequest` model.
9268#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9269pub struct EnrolMfaRequest {
9270    /// Account label embedded in otpauth URL (defaults to user id).
9271    #[serde(default, skip_serializing_if = "Option::is_none")]
9272    pub label: Option<String>,
9273    /// Issuer string embedded in otpauth URL (defaults to `UARP`).
9274    #[serde(default, skip_serializing_if = "Option::is_none")]
9275    pub issuer: Option<String>,
9276    #[serde(default, skip_serializing_if = "Option::is_none")]
9277    pub algorithm: Option<EnrolMfaRequestAlgorithm>,
9278}
9279
9280/// `EnrolMfaRequestAlgorithm` enumeration.
9281#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9282pub enum EnrolMfaRequestAlgorithm {
9283    #[default]
9284    #[serde(rename = "SHA-1")]
9285    Sha1,
9286    #[serde(rename = "SHA-256")]
9287    Sha256,
9288    #[serde(rename = "SHA-512")]
9289    Sha512,
9290    /// A value the API introduced after this SDK was generated.
9291    #[serde(untagged)]
9292    Other(String),
9293}
9294
9295impl EnrolMfaRequestAlgorithm {
9296    /// The value as it appears on the wire.
9297    pub fn as_str(&self) -> &str {
9298        match self {
9299            Self::Sha1 => "SHA-1",
9300            Self::Sha256 => "SHA-256",
9301            Self::Sha512 => "SHA-512",
9302            Self::Other(value) => value.as_str(),
9303        }
9304    }
9305}
9306
9307impl std::fmt::Display for EnrolMfaRequestAlgorithm {
9308    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9309        f.write_str(self.as_str())
9310    }
9311}
9312
9313impl From<&str> for EnrolMfaRequestAlgorithm {
9314    fn from(value: &str) -> Self {
9315        match value {
9316            "SHA-1" => Self::Sha1,
9317            "SHA-256" => Self::Sha256,
9318            "SHA-512" => Self::Sha512,
9319            other => Self::Other(other.to_string()),
9320        }
9321    }
9322}
9323
9324/// RFC 9457 problem document; `correlation_id` (the request id, echoed from `X-Request-Id`) for
9325/// tracing — `correlationId` is the same value for the compatibility window.
9326#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9327pub struct Error {
9328    pub r#type: String,
9329    /// The HTTP reason phrase of `status` — one dictionary for every status the platform answers
9330    /// with (lib/error-titles.ts; the enum is built from it). The one deliberate exception: 422
9331    /// says "Validation Error", as it always has. Never an exception class name; that lives in
9332    /// `code`.
9333    pub title: ErrorTitle,
9334    pub status: i64,
9335    /// The sentence a person reads — specific to this occurrence, never empty, never a repeat of
9336    /// `title`. On a 500 it is the fixed sentence the sanitizer allows; 501–504 carry the handler's
9337    /// own operator guidance.
9338    pub detail: String,
9339    /// What a client should DO about this, as a value it can switch on — `detail` is for the person
9340    /// reading. The enum is built from the one dictionary in `types/error-codes.ts`, so the
9341    /// document and the wire cannot drift apart. Two casings are on the wire and both are
9342    /// load-bearing: SCREAMING_SNAKE came from the `UarpError` hierarchy, lower_snake from the
9343    /// hand-written limit refusals, and clients match on each exactly. Absent when the refusal has
9344    /// no machine-readable class.
9345    #[serde(default, skip_serializing_if = "Option::is_none")]
9346    pub code: Option<ErrorCode>,
9347    /// Request ID for tracing Deprecated spelling of `correlation_id` — the same value, kept for
9348    /// the compatibility window and removed in the next breaking release (the one that moves
9349    /// `X-API-Version`). Read `correlation_id`.
9350    #[serde(rename = "correlationId", default, skip_serializing_if = "Option::is_none")]
9351    pub correlation_id: Option<String>,
9352    /// Field-level validation errors (present on 422 responses)
9353    #[serde(default, skip_serializing_if = "Option::is_none")]
9354    pub errors: Option<Vec<ErrorError>>,
9355    /// Request ID for tracing
9356    #[serde(rename = "correlation_id", default, skip_serializing_if = "Option::is_none")]
9357    pub correlation_id_: Option<String>,
9358}
9359
9360/// What a client should DO about this, as a value it can switch on — `detail` is for the person
9361/// reading. The enum is built from the one dictionary in `types/error-codes.ts`, so the
9362/// document and the wire cannot drift apart. Two casings are on the wire and both are
9363/// load-bearing: SCREAMING_SNAKE came from the `UarpError` hierarchy, lower_snake from the
9364/// hand-written limit refusals, and clients match on each exactly. Absent when the refusal has
9365/// no machine-readable class.
9366#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9367pub enum ErrorCode {
9368    #[default]
9369    #[serde(rename = "AAR_NOT_AVAILABLE")]
9370    AarNotAvailable,
9371    #[serde(rename = "ARTIFACT_INTEGRITY_ERROR")]
9372    ArtifactIntegrityError,
9373    #[serde(rename = "AUTH_ERROR")]
9374    AuthError,
9375    #[serde(rename = "BILLING_CANCELLED")]
9376    BillingCancelled,
9377    #[serde(rename = "BILLING_DISPUTED")]
9378    BillingDisputed,
9379    #[serde(rename = "BILLING_PAST_DUE")]
9380    BillingPastDue,
9381    #[serde(rename = "BUDGET_EXCEEDED")]
9382    BudgetExceeded,
9383    #[serde(rename = "CHECKSUM_MISMATCH")]
9384    ChecksumMismatch,
9385    #[serde(rename = "CONFIGURATION_ERROR")]
9386    ConfigurationError,
9387    #[serde(rename = "EVENT_STORE_ERROR")]
9388    EventStoreError,
9389    #[serde(rename = "EXTERNAL_SERVICE_ERROR")]
9390    ExternalServiceError,
9391    #[serde(rename = "FORBIDDEN")]
9392    Forbidden,
9393    #[serde(rename = "GUARDRAIL_VIOLATION")]
9394    GuardrailViolation,
9395    #[serde(rename = "INVALID_QUERY")]
9396    InvalidQuery,
9397    #[serde(rename = "INVALID_SHARE_LIST")]
9398    InvalidShareList,
9399    #[serde(rename = "INVALID_SHARE_TARGET")]
9400    InvalidShareTarget,
9401    #[serde(rename = "LLM_ERROR")]
9402    LLMError,
9403    #[serde(rename = "MAX_DURATION_EXCEEDED")]
9404    MaxDurationExceeded,
9405    #[serde(rename = "MAX_TOKENS_EXCEEDED")]
9406    MaxTokensExceeded,
9407    #[serde(rename = "MIGRATION_CONFLICT")]
9408    MigrationConflict,
9409    #[serde(rename = "MISSION_ALREADY_RUNNING")]
9410    MissionAlreadyRunning,
9411    #[serde(rename = "MISSION_CONCURRENCY_LIMIT")]
9412    MissionConcurrencyLimit,
9413    #[serde(rename = "MISSION_NOT_FOUND")]
9414    MissionNotFound,
9415    #[serde(rename = "MISSION_NOT_RUNNABLE")]
9416    MissionNotRunnable,
9417    #[serde(rename = "MISSION_NOT_RUNNING")]
9418    MissionNotRunning,
9419    #[serde(rename = "MISSION_ROUTE_NOT_FOUND")]
9420    MissionRouteNotFound,
9421    #[serde(rename = "NOT_FOUND")]
9422    NotFound,
9423    #[serde(rename = "NOT_YANKED")]
9424    NotYanked,
9425    #[serde(rename = "PAYLOAD_TOO_LARGE")]
9426    PayloadTooLarge,
9427    #[serde(rename = "PERSISTENCE_ERROR")]
9428    PersistenceError,
9429    #[serde(rename = "PLANNER_OUTPUT_INVALID")]
9430    PlannerOutputInvalid,
9431    #[serde(rename = "PLANNER_REFUSED")]
9432    PlannerRefused,
9433    #[serde(rename = "PRECONDITION_FAILED")]
9434    PreconditionFailed,
9435    #[serde(rename = "PRIVATE_NOT_SHARED")]
9436    PrivateNotShared,
9437    #[serde(rename = "PROMO_REDEMPTION_FAILED")]
9438    PromoRedemptionFailed,
9439    #[serde(rename = "QUOTA_EXCEEDED")]
9440    QuotaExceeded,
9441    #[serde(rename = "RATE_LIMIT_EXCEEDED")]
9442    RateLimitExceeded,
9443    #[serde(rename = "RESERVED_SCOPE")]
9444    ReservedScope,
9445    #[serde(rename = "RUN_CANCELLED")]
9446    RunCancelled,
9447    #[serde(rename = "SCOPE_MISMATCH")]
9448    ScopeMismatch,
9449    #[serde(rename = "SCOPE_TAKEN")]
9450    ScopeTaken,
9451    #[serde(rename = "SHARE_LIST_CONFLICT")]
9452    ShareListConflict,
9453    #[serde(rename = "SIZE_LIMIT")]
9454    SizeLimit,
9455    #[serde(rename = "SPEC_NOT_FOUND")]
9456    SpecNotFound,
9457    #[serde(rename = "TASK_GRAPH_FAILED")]
9458    TaskGraphFailed,
9459    #[serde(rename = "TEAM_ABORT")]
9460    TeamAbort,
9461    #[serde(rename = "VALIDATION_ERROR")]
9462    ValidationError,
9463    #[serde(rename = "VERSION_CONFLICT")]
9464    VersionConflict,
9465    #[serde(rename = "VERSION_NOT_FOUND")]
9466    VersionNotFound,
9467    #[serde(rename = "WORKSPACE_STORAGE_LIMIT")]
9468    WorkspaceStorageLimit,
9469    #[serde(rename = "YANK_CONFLICT")]
9470    YankConflict,
9471    #[serde(rename = "agent_not_found")]
9472    AgentNotFound,
9473    #[serde(rename = "already_bootstrapped")]
9474    AlreadyBootstrapped,
9475    #[serde(rename = "approval_rejected")]
9476    ApprovalRejected,
9477    #[serde(rename = "billing_not_configured")]
9478    BillingNotConfigured,
9479    #[serde(rename = "governance_not_enabled")]
9480    GovernanceNotEnabled,
9481    #[serde(rename = "incomplete_record")]
9482    IncompleteRecord,
9483    #[serde(rename = "inert_policy_field")]
9484    InertPolicyField,
9485    #[serde(rename = "inert_public_config_field")]
9486    InertPublicConfigField,
9487    #[serde(rename = "kb_chunk_limit")]
9488    KbChunkLimit,
9489    #[serde(rename = "kb_document_body_invalid")]
9490    KbDocumentBodyInvalid,
9491    #[serde(rename = "kb_document_too_large")]
9492    KbDocumentTooLarge,
9493    #[serde(rename = "kb_embedding_failed")]
9494    KbEmbeddingFailed,
9495    #[serde(rename = "kb_storage_limit")]
9496    KbStorageLimit,
9497    #[serde(rename = "kb_text_extraction_failed")]
9498    KbTextExtractionFailed,
9499    #[serde(rename = "limit_reached")]
9500    LimitReached,
9501    #[serde(rename = "plan_upgrade_required")]
9502    PlanUpgradeRequired,
9503    #[serde(rename = "provider_auth_failed")]
9504    ProviderAuthFailed,
9505    #[serde(rename = "provider_circuit_open")]
9506    ProviderCircuitOpen,
9507    #[serde(rename = "provider_not_configured")]
9508    ProviderNotConfigured,
9509    #[serde(rename = "provider_rate_limited")]
9510    ProviderRateLimited,
9511    #[serde(rename = "quota_exceeded")]
9512    QuotaExceeded2,
9513    #[serde(rename = "rate_limited")]
9514    RateLimited,
9515    #[serde(rename = "resource_limit_reached")]
9516    ResourceLimitReached,
9517    #[serde(rename = "run_input_timeout")]
9518    RunInputTimeout,
9519    #[serde(rename = "run_never_claimed")]
9520    RunNeverClaimed,
9521    #[serde(rename = "run_orphaned_restart")]
9522    RunOrphanedRestart,
9523    #[serde(rename = "run_quota_exceeded")]
9524    RunQuotaExceeded,
9525    /// A value the API introduced after this SDK was generated.
9526    #[serde(untagged)]
9527    Other(String),
9528}
9529
9530impl ErrorCode {
9531    /// The value as it appears on the wire.
9532    pub fn as_str(&self) -> &str {
9533        match self {
9534            Self::AarNotAvailable => "AAR_NOT_AVAILABLE",
9535            Self::ArtifactIntegrityError => "ARTIFACT_INTEGRITY_ERROR",
9536            Self::AuthError => "AUTH_ERROR",
9537            Self::BillingCancelled => "BILLING_CANCELLED",
9538            Self::BillingDisputed => "BILLING_DISPUTED",
9539            Self::BillingPastDue => "BILLING_PAST_DUE",
9540            Self::BudgetExceeded => "BUDGET_EXCEEDED",
9541            Self::ChecksumMismatch => "CHECKSUM_MISMATCH",
9542            Self::ConfigurationError => "CONFIGURATION_ERROR",
9543            Self::EventStoreError => "EVENT_STORE_ERROR",
9544            Self::ExternalServiceError => "EXTERNAL_SERVICE_ERROR",
9545            Self::Forbidden => "FORBIDDEN",
9546            Self::GuardrailViolation => "GUARDRAIL_VIOLATION",
9547            Self::InvalidQuery => "INVALID_QUERY",
9548            Self::InvalidShareList => "INVALID_SHARE_LIST",
9549            Self::InvalidShareTarget => "INVALID_SHARE_TARGET",
9550            Self::LLMError => "LLM_ERROR",
9551            Self::MaxDurationExceeded => "MAX_DURATION_EXCEEDED",
9552            Self::MaxTokensExceeded => "MAX_TOKENS_EXCEEDED",
9553            Self::MigrationConflict => "MIGRATION_CONFLICT",
9554            Self::MissionAlreadyRunning => "MISSION_ALREADY_RUNNING",
9555            Self::MissionConcurrencyLimit => "MISSION_CONCURRENCY_LIMIT",
9556            Self::MissionNotFound => "MISSION_NOT_FOUND",
9557            Self::MissionNotRunnable => "MISSION_NOT_RUNNABLE",
9558            Self::MissionNotRunning => "MISSION_NOT_RUNNING",
9559            Self::MissionRouteNotFound => "MISSION_ROUTE_NOT_FOUND",
9560            Self::NotFound => "NOT_FOUND",
9561            Self::NotYanked => "NOT_YANKED",
9562            Self::PayloadTooLarge => "PAYLOAD_TOO_LARGE",
9563            Self::PersistenceError => "PERSISTENCE_ERROR",
9564            Self::PlannerOutputInvalid => "PLANNER_OUTPUT_INVALID",
9565            Self::PlannerRefused => "PLANNER_REFUSED",
9566            Self::PreconditionFailed => "PRECONDITION_FAILED",
9567            Self::PrivateNotShared => "PRIVATE_NOT_SHARED",
9568            Self::PromoRedemptionFailed => "PROMO_REDEMPTION_FAILED",
9569            Self::QuotaExceeded => "QUOTA_EXCEEDED",
9570            Self::RateLimitExceeded => "RATE_LIMIT_EXCEEDED",
9571            Self::ReservedScope => "RESERVED_SCOPE",
9572            Self::RunCancelled => "RUN_CANCELLED",
9573            Self::ScopeMismatch => "SCOPE_MISMATCH",
9574            Self::ScopeTaken => "SCOPE_TAKEN",
9575            Self::ShareListConflict => "SHARE_LIST_CONFLICT",
9576            Self::SizeLimit => "SIZE_LIMIT",
9577            Self::SpecNotFound => "SPEC_NOT_FOUND",
9578            Self::TaskGraphFailed => "TASK_GRAPH_FAILED",
9579            Self::TeamAbort => "TEAM_ABORT",
9580            Self::ValidationError => "VALIDATION_ERROR",
9581            Self::VersionConflict => "VERSION_CONFLICT",
9582            Self::VersionNotFound => "VERSION_NOT_FOUND",
9583            Self::WorkspaceStorageLimit => "WORKSPACE_STORAGE_LIMIT",
9584            Self::YankConflict => "YANK_CONFLICT",
9585            Self::AgentNotFound => "agent_not_found",
9586            Self::AlreadyBootstrapped => "already_bootstrapped",
9587            Self::ApprovalRejected => "approval_rejected",
9588            Self::BillingNotConfigured => "billing_not_configured",
9589            Self::GovernanceNotEnabled => "governance_not_enabled",
9590            Self::IncompleteRecord => "incomplete_record",
9591            Self::InertPolicyField => "inert_policy_field",
9592            Self::InertPublicConfigField => "inert_public_config_field",
9593            Self::KbChunkLimit => "kb_chunk_limit",
9594            Self::KbDocumentBodyInvalid => "kb_document_body_invalid",
9595            Self::KbDocumentTooLarge => "kb_document_too_large",
9596            Self::KbEmbeddingFailed => "kb_embedding_failed",
9597            Self::KbStorageLimit => "kb_storage_limit",
9598            Self::KbTextExtractionFailed => "kb_text_extraction_failed",
9599            Self::LimitReached => "limit_reached",
9600            Self::PlanUpgradeRequired => "plan_upgrade_required",
9601            Self::ProviderAuthFailed => "provider_auth_failed",
9602            Self::ProviderCircuitOpen => "provider_circuit_open",
9603            Self::ProviderNotConfigured => "provider_not_configured",
9604            Self::ProviderRateLimited => "provider_rate_limited",
9605            Self::QuotaExceeded2 => "quota_exceeded",
9606            Self::RateLimited => "rate_limited",
9607            Self::ResourceLimitReached => "resource_limit_reached",
9608            Self::RunInputTimeout => "run_input_timeout",
9609            Self::RunNeverClaimed => "run_never_claimed",
9610            Self::RunOrphanedRestart => "run_orphaned_restart",
9611            Self::RunQuotaExceeded => "run_quota_exceeded",
9612            Self::Other(value) => value.as_str(),
9613        }
9614    }
9615}
9616
9617impl std::fmt::Display for ErrorCode {
9618    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9619        f.write_str(self.as_str())
9620    }
9621}
9622
9623impl From<&str> for ErrorCode {
9624    fn from(value: &str) -> Self {
9625        match value {
9626            "AAR_NOT_AVAILABLE" => Self::AarNotAvailable,
9627            "ARTIFACT_INTEGRITY_ERROR" => Self::ArtifactIntegrityError,
9628            "AUTH_ERROR" => Self::AuthError,
9629            "BILLING_CANCELLED" => Self::BillingCancelled,
9630            "BILLING_DISPUTED" => Self::BillingDisputed,
9631            "BILLING_PAST_DUE" => Self::BillingPastDue,
9632            "BUDGET_EXCEEDED" => Self::BudgetExceeded,
9633            "CHECKSUM_MISMATCH" => Self::ChecksumMismatch,
9634            "CONFIGURATION_ERROR" => Self::ConfigurationError,
9635            "EVENT_STORE_ERROR" => Self::EventStoreError,
9636            "EXTERNAL_SERVICE_ERROR" => Self::ExternalServiceError,
9637            "FORBIDDEN" => Self::Forbidden,
9638            "GUARDRAIL_VIOLATION" => Self::GuardrailViolation,
9639            "INVALID_QUERY" => Self::InvalidQuery,
9640            "INVALID_SHARE_LIST" => Self::InvalidShareList,
9641            "INVALID_SHARE_TARGET" => Self::InvalidShareTarget,
9642            "LLM_ERROR" => Self::LLMError,
9643            "MAX_DURATION_EXCEEDED" => Self::MaxDurationExceeded,
9644            "MAX_TOKENS_EXCEEDED" => Self::MaxTokensExceeded,
9645            "MIGRATION_CONFLICT" => Self::MigrationConflict,
9646            "MISSION_ALREADY_RUNNING" => Self::MissionAlreadyRunning,
9647            "MISSION_CONCURRENCY_LIMIT" => Self::MissionConcurrencyLimit,
9648            "MISSION_NOT_FOUND" => Self::MissionNotFound,
9649            "MISSION_NOT_RUNNABLE" => Self::MissionNotRunnable,
9650            "MISSION_NOT_RUNNING" => Self::MissionNotRunning,
9651            "MISSION_ROUTE_NOT_FOUND" => Self::MissionRouteNotFound,
9652            "NOT_FOUND" => Self::NotFound,
9653            "NOT_YANKED" => Self::NotYanked,
9654            "PAYLOAD_TOO_LARGE" => Self::PayloadTooLarge,
9655            "PERSISTENCE_ERROR" => Self::PersistenceError,
9656            "PLANNER_OUTPUT_INVALID" => Self::PlannerOutputInvalid,
9657            "PLANNER_REFUSED" => Self::PlannerRefused,
9658            "PRECONDITION_FAILED" => Self::PreconditionFailed,
9659            "PRIVATE_NOT_SHARED" => Self::PrivateNotShared,
9660            "PROMO_REDEMPTION_FAILED" => Self::PromoRedemptionFailed,
9661            "QUOTA_EXCEEDED" => Self::QuotaExceeded,
9662            "RATE_LIMIT_EXCEEDED" => Self::RateLimitExceeded,
9663            "RESERVED_SCOPE" => Self::ReservedScope,
9664            "RUN_CANCELLED" => Self::RunCancelled,
9665            "SCOPE_MISMATCH" => Self::ScopeMismatch,
9666            "SCOPE_TAKEN" => Self::ScopeTaken,
9667            "SHARE_LIST_CONFLICT" => Self::ShareListConflict,
9668            "SIZE_LIMIT" => Self::SizeLimit,
9669            "SPEC_NOT_FOUND" => Self::SpecNotFound,
9670            "TASK_GRAPH_FAILED" => Self::TaskGraphFailed,
9671            "TEAM_ABORT" => Self::TeamAbort,
9672            "VALIDATION_ERROR" => Self::ValidationError,
9673            "VERSION_CONFLICT" => Self::VersionConflict,
9674            "VERSION_NOT_FOUND" => Self::VersionNotFound,
9675            "WORKSPACE_STORAGE_LIMIT" => Self::WorkspaceStorageLimit,
9676            "YANK_CONFLICT" => Self::YankConflict,
9677            "agent_not_found" => Self::AgentNotFound,
9678            "already_bootstrapped" => Self::AlreadyBootstrapped,
9679            "approval_rejected" => Self::ApprovalRejected,
9680            "billing_not_configured" => Self::BillingNotConfigured,
9681            "governance_not_enabled" => Self::GovernanceNotEnabled,
9682            "incomplete_record" => Self::IncompleteRecord,
9683            "inert_policy_field" => Self::InertPolicyField,
9684            "inert_public_config_field" => Self::InertPublicConfigField,
9685            "kb_chunk_limit" => Self::KbChunkLimit,
9686            "kb_document_body_invalid" => Self::KbDocumentBodyInvalid,
9687            "kb_document_too_large" => Self::KbDocumentTooLarge,
9688            "kb_embedding_failed" => Self::KbEmbeddingFailed,
9689            "kb_storage_limit" => Self::KbStorageLimit,
9690            "kb_text_extraction_failed" => Self::KbTextExtractionFailed,
9691            "limit_reached" => Self::LimitReached,
9692            "plan_upgrade_required" => Self::PlanUpgradeRequired,
9693            "provider_auth_failed" => Self::ProviderAuthFailed,
9694            "provider_circuit_open" => Self::ProviderCircuitOpen,
9695            "provider_not_configured" => Self::ProviderNotConfigured,
9696            "provider_rate_limited" => Self::ProviderRateLimited,
9697            "quota_exceeded" => Self::QuotaExceeded2,
9698            "rate_limited" => Self::RateLimited,
9699            "resource_limit_reached" => Self::ResourceLimitReached,
9700            "run_input_timeout" => Self::RunInputTimeout,
9701            "run_never_claimed" => Self::RunNeverClaimed,
9702            "run_orphaned_restart" => Self::RunOrphanedRestart,
9703            "run_quota_exceeded" => Self::RunQuotaExceeded,
9704            other => Self::Other(other.to_string()),
9705        }
9706    }
9707}
9708
9709/// `ErrorError` model.
9710#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9711pub struct ErrorError {
9712    #[serde(default, skip_serializing_if = "Option::is_none")]
9713    pub field: Option<String>,
9714    #[serde(default, skip_serializing_if = "Option::is_none")]
9715    pub message: Option<String>,
9716}
9717
9718/// What a person reported from the “report to the team” button, or general feedback. Reports
9719/// are stored in ONE global inbox across all tenants, and expire after 90 days — the inbox is a
9720/// working queue, not an archive.
9721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9722pub struct ErrorReport {
9723    pub id: String,
9724    /// The tenant the report came FROM, not the inbox it is stored in.
9725    pub tenant_id: String,
9726    #[serde(default, skip_serializing_if = "Option::is_none")]
9727    pub user_id: Option<String>,
9728    #[serde(default, skip_serializing_if = "Option::is_none")]
9729    pub key_id: Option<String>,
9730    /// The toast headline. Defaults to “Reported error” when the caller sends none.
9731    pub title: String,
9732    pub message: String,
9733    /// What the person was doing — action, component.
9734    #[serde(default, skip_serializing_if = "Option::is_none")]
9735    pub context: Option<String>,
9736    #[serde(default, skip_serializing_if = "Option::is_none")]
9737    pub url: Option<String>,
9738    #[serde(default, skip_serializing_if = "Option::is_none")]
9739    pub run_id: Option<String>,
9740    #[serde(default, skip_serializing_if = "Option::is_none")]
9741    pub user_agent: Option<String>,
9742    /// Anything other than `feedback` is filed as an `error`.
9743    pub kind: ErrorReportKind,
9744    pub status: ErrorReportStatus,
9745    pub created_at: String,
9746}
9747
9748/// Anything other than `feedback` is filed as an `error`.
9749#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9750pub enum ErrorReportKind {
9751    #[default]
9752    #[serde(rename = "error")]
9753    Error,
9754    #[serde(rename = "feedback")]
9755    Feedback,
9756    /// A value the API introduced after this SDK was generated.
9757    #[serde(untagged)]
9758    Other(String),
9759}
9760
9761impl ErrorReportKind {
9762    /// The value as it appears on the wire.
9763    pub fn as_str(&self) -> &str {
9764        match self {
9765            Self::Error => "error",
9766            Self::Feedback => "feedback",
9767            Self::Other(value) => value.as_str(),
9768        }
9769    }
9770}
9771
9772impl std::fmt::Display for ErrorReportKind {
9773    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9774        f.write_str(self.as_str())
9775    }
9776}
9777
9778impl From<&str> for ErrorReportKind {
9779    fn from(value: &str) -> Self {
9780        match value {
9781            "error" => Self::Error,
9782            "feedback" => Self::Feedback,
9783            other => Self::Other(other.to_string()),
9784        }
9785    }
9786}
9787
9788/// `ErrorReportStatus` enumeration.
9789#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9790pub enum ErrorReportStatus {
9791    #[default]
9792    #[serde(rename = "new")]
9793    New,
9794    #[serde(rename = "resolved")]
9795    Resolved,
9796    /// A value the API introduced after this SDK was generated.
9797    #[serde(untagged)]
9798    Other(String),
9799}
9800
9801impl ErrorReportStatus {
9802    /// The value as it appears on the wire.
9803    pub fn as_str(&self) -> &str {
9804        match self {
9805            Self::New => "new",
9806            Self::Resolved => "resolved",
9807            Self::Other(value) => value.as_str(),
9808        }
9809    }
9810}
9811
9812impl std::fmt::Display for ErrorReportStatus {
9813    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9814        f.write_str(self.as_str())
9815    }
9816}
9817
9818impl From<&str> for ErrorReportStatus {
9819    fn from(value: &str) -> Self {
9820        match value {
9821            "new" => Self::New,
9822            "resolved" => Self::Resolved,
9823            other => Self::Other(other.to_string()),
9824        }
9825    }
9826}
9827
9828/// The HTTP reason phrase of `status` — one dictionary for every status the platform answers
9829/// with (lib/error-titles.ts; the enum is built from it). The one deliberate exception: 422
9830/// says "Validation Error", as it always has. Never an exception class name; that lives in
9831/// `code`.
9832#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9833pub enum ErrorTitle {
9834    #[default]
9835    #[serde(rename = "Bad Request")]
9836    BadRequest,
9837    #[serde(rename = "Unauthorized")]
9838    Unauthorized,
9839    #[serde(rename = "Payment Required")]
9840    PaymentRequired,
9841    #[serde(rename = "Forbidden")]
9842    Forbidden,
9843    #[serde(rename = "Not Found")]
9844    NotFound,
9845    #[serde(rename = "Method Not Allowed")]
9846    MethodNotAllowed,
9847    #[serde(rename = "Conflict")]
9848    Conflict,
9849    #[serde(rename = "Gone")]
9850    Gone,
9851    #[serde(rename = "Length Required")]
9852    LengthRequired,
9853    #[serde(rename = "Precondition Failed")]
9854    PreconditionFailed,
9855    #[serde(rename = "Payload Too Large")]
9856    PayloadTooLarge,
9857    #[serde(rename = "Unsupported Media Type")]
9858    UnsupportedMediaType,
9859    #[serde(rename = "Validation Error")]
9860    ValidationError,
9861    #[serde(rename = "Locked")]
9862    Locked,
9863    #[serde(rename = "Precondition Required")]
9864    PreconditionRequired,
9865    #[serde(rename = "Too Many Requests")]
9866    TooManyRequests,
9867    #[serde(rename = "Internal Server Error")]
9868    InternalServerError,
9869    #[serde(rename = "Not Implemented")]
9870    NotImplemented,
9871    #[serde(rename = "Bad Gateway")]
9872    BadGateway,
9873    #[serde(rename = "Service Unavailable")]
9874    ServiceUnavailable,
9875    #[serde(rename = "Gateway Timeout")]
9876    GatewayTimeout,
9877    /// A value the API introduced after this SDK was generated.
9878    #[serde(untagged)]
9879    Other(String),
9880}
9881
9882impl ErrorTitle {
9883    /// The value as it appears on the wire.
9884    pub fn as_str(&self) -> &str {
9885        match self {
9886            Self::BadRequest => "Bad Request",
9887            Self::Unauthorized => "Unauthorized",
9888            Self::PaymentRequired => "Payment Required",
9889            Self::Forbidden => "Forbidden",
9890            Self::NotFound => "Not Found",
9891            Self::MethodNotAllowed => "Method Not Allowed",
9892            Self::Conflict => "Conflict",
9893            Self::Gone => "Gone",
9894            Self::LengthRequired => "Length Required",
9895            Self::PreconditionFailed => "Precondition Failed",
9896            Self::PayloadTooLarge => "Payload Too Large",
9897            Self::UnsupportedMediaType => "Unsupported Media Type",
9898            Self::ValidationError => "Validation Error",
9899            Self::Locked => "Locked",
9900            Self::PreconditionRequired => "Precondition Required",
9901            Self::TooManyRequests => "Too Many Requests",
9902            Self::InternalServerError => "Internal Server Error",
9903            Self::NotImplemented => "Not Implemented",
9904            Self::BadGateway => "Bad Gateway",
9905            Self::ServiceUnavailable => "Service Unavailable",
9906            Self::GatewayTimeout => "Gateway Timeout",
9907            Self::Other(value) => value.as_str(),
9908        }
9909    }
9910}
9911
9912impl std::fmt::Display for ErrorTitle {
9913    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9914        f.write_str(self.as_str())
9915    }
9916}
9917
9918impl From<&str> for ErrorTitle {
9919    fn from(value: &str) -> Self {
9920        match value {
9921            "Bad Request" => Self::BadRequest,
9922            "Unauthorized" => Self::Unauthorized,
9923            "Payment Required" => Self::PaymentRequired,
9924            "Forbidden" => Self::Forbidden,
9925            "Not Found" => Self::NotFound,
9926            "Method Not Allowed" => Self::MethodNotAllowed,
9927            "Conflict" => Self::Conflict,
9928            "Gone" => Self::Gone,
9929            "Length Required" => Self::LengthRequired,
9930            "Precondition Failed" => Self::PreconditionFailed,
9931            "Payload Too Large" => Self::PayloadTooLarge,
9932            "Unsupported Media Type" => Self::UnsupportedMediaType,
9933            "Validation Error" => Self::ValidationError,
9934            "Locked" => Self::Locked,
9935            "Precondition Required" => Self::PreconditionRequired,
9936            "Too Many Requests" => Self::TooManyRequests,
9937            "Internal Server Error" => Self::InternalServerError,
9938            "Not Implemented" => Self::NotImplemented,
9939            "Bad Gateway" => Self::BadGateway,
9940            "Service Unavailable" => Self::ServiceUnavailable,
9941            "Gateway Timeout" => Self::GatewayTimeout,
9942            other => Self::Other(other.to_string()),
9943        }
9944    }
9945}
9946
9947/// `EstimateRunCostRequest` model.
9948#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9949pub struct EstimateRunCostRequest {
9950    pub agent_id: String,
9951    /// The prompt, used for the input-token estimate.
9952    #[serde(default, skip_serializing_if = "Option::is_none")]
9953    pub input_text: Option<String>,
9954    /// Picks up a per-session model override, when one is set.
9955    #[serde(default, skip_serializing_if = "Option::is_none")]
9956    pub session_id: Option<String>,
9957}
9958
9959/// evaluation/evaluator.ts EvalCase.
9960#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9961pub struct EvalCase {
9962    pub case_id: String,
9963    pub input: serde_json::Map<String, serde_json::Value>,
9964    #[serde(default, skip_serializing_if = "Option::is_none")]
9965    pub expected_output: Option<serde_json::Map<String, serde_json::Value>>,
9966    #[serde(default, skip_serializing_if = "Option::is_none")]
9967    pub expected_tool_calls: Option<Vec<String>>,
9968    pub tags: Vec<String>,
9969    pub metadata: serde_json::Map<String, serde_json::Value>,
9970}
9971
9972/// evaluation/evaluator.ts EvalDataset — the stored record, unsanitized.
9973#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9974pub struct EvalDataset {
9975    pub dataset_id: String,
9976    pub tenant_id: String,
9977    pub agent_id: String,
9978    pub name: String,
9979    pub cases: Vec<EvalCase>,
9980    pub created_at: String,
9981}
9982
9983/// evaluation/evaluator.ts EvalRun — the stored record; `agent_version`, `errored_cases` and
9984/// `summary` are conditional.
9985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9986pub struct EvalRun {
9987    pub eval_run_id: String,
9988    pub tenant_id: String,
9989    pub agent_id: String,
9990    pub dataset_id: String,
9991    #[serde(default, skip_serializing_if = "Option::is_none")]
9992    pub agent_version: Option<String>,
9993    pub results: Vec<EvalRunResult>,
9994    #[serde(default, skip_serializing_if = "Option::is_none")]
9995    pub errored_cases: Option<Vec<EvalRunErroredCas>>,
9996    #[serde(default, skip_serializing_if = "Option::is_none")]
9997    pub summary: Option<EvalRunSummary>,
9998    pub created_at: String,
9999}
10000
10001/// `EvalRunErroredCas` model.
10002#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10003pub struct EvalRunErroredCas {
10004    pub case_id: String,
10005    pub error: String,
10006}
10007
10008/// `EvalRunResult` model.
10009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10010pub struct EvalRunResult {
10011    pub case_id: String,
10012    pub run_id: String,
10013    pub scores: serde_json::Map<String, serde_json::Value>,
10014    pub passed: bool,
10015    pub duration_ms: f64,
10016    pub tokens_used: f64,
10017}
10018
10019/// `EvalRunSummary` model.
10020#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10021pub struct EvalRunSummary {
10022    pub total_cases: i64,
10023    pub passed: i64,
10024    pub failed: i64,
10025    pub errored: i64,
10026    pub avg_scores: serde_json::Map<String, serde_json::Value>,
10027    pub avg_duration_ms: f64,
10028    pub total_tokens: f64,
10029    pub total_cost_usd: f64,
10030    pub regression_detected: bool,
10031}
10032
10033/// `Experiment` model.
10034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10035pub struct Experiment {
10036    #[serde(default, skip_serializing_if = "Option::is_none")]
10037    pub experiment_id: Option<String>,
10038    #[serde(default, skip_serializing_if = "Option::is_none")]
10039    pub tenant_id: Option<String>,
10040    #[serde(default, skip_serializing_if = "Option::is_none")]
10041    pub agent_id: Option<String>,
10042    #[serde(default, skip_serializing_if = "Option::is_none")]
10043    pub name: Option<String>,
10044    #[serde(default, skip_serializing_if = "Option::is_none")]
10045    pub dataset_id: Option<String>,
10046    #[serde(default, skip_serializing_if = "Option::is_none")]
10047    pub variants: Option<Vec<ExperimentVariant>>,
10048    #[serde(default, skip_serializing_if = "Option::is_none")]
10049    pub status: Option<ExperimentStatus>,
10050    #[serde(default, skip_serializing_if = "Option::is_none")]
10051    pub comparison: Option<serde_json::Map<String, serde_json::Value>>,
10052    #[serde(default, skip_serializing_if = "Option::is_none")]
10053    pub created_at: Option<String>,
10054}
10055
10056/// `ExperimentStatus` enumeration.
10057#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10058pub enum ExperimentStatus {
10059    #[default]
10060    #[serde(rename = "pending")]
10061    Pending,
10062    #[serde(rename = "running")]
10063    Running,
10064    #[serde(rename = "completed")]
10065    Completed,
10066    /// A value the API introduced after this SDK was generated.
10067    #[serde(untagged)]
10068    Other(String),
10069}
10070
10071impl ExperimentStatus {
10072    /// The value as it appears on the wire.
10073    pub fn as_str(&self) -> &str {
10074        match self {
10075            Self::Pending => "pending",
10076            Self::Running => "running",
10077            Self::Completed => "completed",
10078            Self::Other(value) => value.as_str(),
10079        }
10080    }
10081}
10082
10083impl std::fmt::Display for ExperimentStatus {
10084    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10085        f.write_str(self.as_str())
10086    }
10087}
10088
10089impl From<&str> for ExperimentStatus {
10090    fn from(value: &str) -> Self {
10091        match value {
10092            "pending" => Self::Pending,
10093            "running" => Self::Running,
10094            "completed" => Self::Completed,
10095            other => Self::Other(other.to_string()),
10096        }
10097    }
10098}
10099
10100/// `ExperimentVariant` model.
10101#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10102pub struct ExperimentVariant {
10103    #[serde(default, skip_serializing_if = "Option::is_none")]
10104    pub version: Option<String>,
10105    #[serde(default, skip_serializing_if = "Option::is_none")]
10106    pub eval_run_id: Option<String>,
10107}
10108
10109/// `ExportAdminConfigResponse` model.
10110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10111pub struct ExportAdminConfigResponse {
10112    pub exported_at: String,
10113    pub section_count: i64,
10114    pub sections: serde_json::Map<String, serde_json::Value>,
10115}
10116
10117/// `ExportDataExplorerIncludeSensitive` enumeration.
10118#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10119pub enum ExportDataExplorerIncludeSensitive {
10120    #[default]
10121    #[serde(rename = "1")]
10122    V1,
10123    /// A value the API introduced after this SDK was generated.
10124    #[serde(untagged)]
10125    Other(String),
10126}
10127
10128impl ExportDataExplorerIncludeSensitive {
10129    /// The value as it appears on the wire.
10130    pub fn as_str(&self) -> &str {
10131        match self {
10132            Self::V1 => "1",
10133            Self::Other(value) => value.as_str(),
10134        }
10135    }
10136}
10137
10138impl std::fmt::Display for ExportDataExplorerIncludeSensitive {
10139    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10140        f.write_str(self.as_str())
10141    }
10142}
10143
10144impl From<&str> for ExportDataExplorerIncludeSensitive {
10145    fn from(value: &str) -> Self {
10146        match value {
10147            "1" => Self::V1,
10148            other => Self::Other(other.to_string()),
10149        }
10150    }
10151}
10152
10153/// `ExportMyAccountFormat` enumeration.
10154#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10155pub enum ExportMyAccountFormat {
10156    #[default]
10157    #[serde(rename = "zip")]
10158    Zip,
10159    #[serde(rename = "json")]
10160    JSON,
10161    /// A value the API introduced after this SDK was generated.
10162    #[serde(untagged)]
10163    Other(String),
10164}
10165
10166impl ExportMyAccountFormat {
10167    /// The value as it appears on the wire.
10168    pub fn as_str(&self) -> &str {
10169        match self {
10170            Self::Zip => "zip",
10171            Self::JSON => "json",
10172            Self::Other(value) => value.as_str(),
10173        }
10174    }
10175}
10176
10177impl std::fmt::Display for ExportMyAccountFormat {
10178    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10179        f.write_str(self.as_str())
10180    }
10181}
10182
10183impl From<&str> for ExportMyAccountFormat {
10184    fn from(value: &str) -> Self {
10185        match value {
10186            "zip" => Self::Zip,
10187            "json" => Self::JSON,
10188            other => Self::Other(other.to_string()),
10189        }
10190    }
10191}
10192
10193/// `ExportSessionFormat` enumeration.
10194#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10195pub enum ExportSessionFormat {
10196    #[default]
10197    #[serde(rename = "md")]
10198    Md,
10199    #[serde(rename = "json")]
10200    JSON,
10201    /// A value the API introduced after this SDK was generated.
10202    #[serde(untagged)]
10203    Other(String),
10204}
10205
10206impl ExportSessionFormat {
10207    /// The value as it appears on the wire.
10208    pub fn as_str(&self) -> &str {
10209        match self {
10210            Self::Md => "md",
10211            Self::JSON => "json",
10212            Self::Other(value) => value.as_str(),
10213        }
10214    }
10215}
10216
10217impl std::fmt::Display for ExportSessionFormat {
10218    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10219        f.write_str(self.as_str())
10220    }
10221}
10222
10223impl From<&str> for ExportSessionFormat {
10224    fn from(value: &str) -> Self {
10225        match value {
10226            "md" => Self::Md,
10227            "json" => Self::JSON,
10228            other => Self::Other(other.to_string()),
10229        }
10230    }
10231}
10232
10233/// admin-config.ts mergeFeatureFlags — a closed set of ids; `rollout_pct` only when an override
10234/// set it.
10235#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10236pub struct FeatureFlag {
10237    pub id: String,
10238    pub label: String,
10239    pub description: String,
10240    pub enabled: bool,
10241    #[serde(default, skip_serializing_if = "Option::is_none")]
10242    pub rollout_pct: Option<i64>,
10243    pub source: GuardrailConfigItemSource,
10244}
10245
10246/// `FeedEntry` model.
10247#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10248pub struct FeedEntry {
10249    pub feed_id: String,
10250    pub tenant_id: String,
10251    pub timestamp: String,
10252    pub event_type: FeedEntryEventType,
10253    pub title: String,
10254    #[serde(default, skip_serializing_if = "Option::is_none")]
10255    pub summary: Option<String>,
10256    #[serde(default, skip_serializing_if = "Option::is_none")]
10257    pub agent_id: Option<String>,
10258    #[serde(default, skip_serializing_if = "Option::is_none")]
10259    pub agent_name: Option<String>,
10260    #[serde(default, skip_serializing_if = "Option::is_none")]
10261    pub company_id: Option<String>,
10262    #[serde(default, skip_serializing_if = "Option::is_none")]
10263    pub company_name: Option<String>,
10264    #[serde(default, skip_serializing_if = "Option::is_none")]
10265    pub team_id: Option<String>,
10266    #[serde(default, skip_serializing_if = "Option::is_none")]
10267    pub team_name: Option<String>,
10268    #[serde(default, skip_serializing_if = "Option::is_none")]
10269    pub session_id: Option<String>,
10270    #[serde(default, skip_serializing_if = "Option::is_none")]
10271    pub run_id: Option<String>,
10272    #[serde(default, skip_serializing_if = "Option::is_none")]
10273    pub status: Option<String>,
10274    #[serde(default, skip_serializing_if = "Option::is_none")]
10275    pub metrics: Option<FeedEntryMetrics>,
10276    #[serde(default, skip_serializing_if = "Option::is_none")]
10277    pub error: Option<String>,
10278}
10279
10280/// `FeedEntryEventType` enumeration.
10281#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10282pub enum FeedEntryEventType {
10283    #[default]
10284    #[serde(rename = "run.started")]
10285    RunStarted,
10286    #[serde(rename = "run.completed")]
10287    RunCompleted,
10288    #[serde(rename = "run.failed")]
10289    RunFailed,
10290    #[serde(rename = "run.timeout")]
10291    RunTimeout,
10292    #[serde(rename = "run.cancelled")]
10293    RunCancelled,
10294    #[serde(rename = "session.created")]
10295    SessionCreated,
10296    #[serde(rename = "company.tick_start")]
10297    CompanyTickStart,
10298    #[serde(rename = "company.tick_end")]
10299    CompanyTickEnd,
10300    #[serde(rename = "company.paused")]
10301    CompanyPaused,
10302    #[serde(rename = "company.resumed")]
10303    CompanyResumed,
10304    #[serde(rename = "company.escalation")]
10305    CompanyEscalation,
10306    #[serde(rename = "team.round_start")]
10307    TeamRoundStart,
10308    #[serde(rename = "team.round_end")]
10309    TeamRoundEnd,
10310    #[serde(rename = "objective.created")]
10311    ObjectiveCreated,
10312    #[serde(rename = "objective.completed")]
10313    ObjectiveCompleted,
10314    #[serde(rename = "agent.created")]
10315    AgentCreated,
10316    /// A value the API introduced after this SDK was generated.
10317    #[serde(untagged)]
10318    Other(String),
10319}
10320
10321impl FeedEntryEventType {
10322    /// The value as it appears on the wire.
10323    pub fn as_str(&self) -> &str {
10324        match self {
10325            Self::RunStarted => "run.started",
10326            Self::RunCompleted => "run.completed",
10327            Self::RunFailed => "run.failed",
10328            Self::RunTimeout => "run.timeout",
10329            Self::RunCancelled => "run.cancelled",
10330            Self::SessionCreated => "session.created",
10331            Self::CompanyTickStart => "company.tick_start",
10332            Self::CompanyTickEnd => "company.tick_end",
10333            Self::CompanyPaused => "company.paused",
10334            Self::CompanyResumed => "company.resumed",
10335            Self::CompanyEscalation => "company.escalation",
10336            Self::TeamRoundStart => "team.round_start",
10337            Self::TeamRoundEnd => "team.round_end",
10338            Self::ObjectiveCreated => "objective.created",
10339            Self::ObjectiveCompleted => "objective.completed",
10340            Self::AgentCreated => "agent.created",
10341            Self::Other(value) => value.as_str(),
10342        }
10343    }
10344}
10345
10346impl std::fmt::Display for FeedEntryEventType {
10347    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10348        f.write_str(self.as_str())
10349    }
10350}
10351
10352impl From<&str> for FeedEntryEventType {
10353    fn from(value: &str) -> Self {
10354        match value {
10355            "run.started" => Self::RunStarted,
10356            "run.completed" => Self::RunCompleted,
10357            "run.failed" => Self::RunFailed,
10358            "run.timeout" => Self::RunTimeout,
10359            "run.cancelled" => Self::RunCancelled,
10360            "session.created" => Self::SessionCreated,
10361            "company.tick_start" => Self::CompanyTickStart,
10362            "company.tick_end" => Self::CompanyTickEnd,
10363            "company.paused" => Self::CompanyPaused,
10364            "company.resumed" => Self::CompanyResumed,
10365            "company.escalation" => Self::CompanyEscalation,
10366            "team.round_start" => Self::TeamRoundStart,
10367            "team.round_end" => Self::TeamRoundEnd,
10368            "objective.created" => Self::ObjectiveCreated,
10369            "objective.completed" => Self::ObjectiveCompleted,
10370            "agent.created" => Self::AgentCreated,
10371            other => Self::Other(other.to_string()),
10372        }
10373    }
10374}
10375
10376/// `FeedEntryMetrics` model.
10377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10378pub struct FeedEntryMetrics {
10379    #[serde(default, skip_serializing_if = "Option::is_none")]
10380    pub duration_ms: Option<i64>,
10381    #[serde(default, skip_serializing_if = "Option::is_none")]
10382    pub tokens_used: Option<i64>,
10383    #[serde(default, skip_serializing_if = "Option::is_none")]
10384    pub cost_usd: Option<f64>,
10385    #[serde(default, skip_serializing_if = "Option::is_none")]
10386    pub steps: Option<i64>,
10387    #[serde(default, skip_serializing_if = "Option::is_none")]
10388    pub tool_calls: Option<i64>,
10389}
10390
10391/// `FileArbiterAppealRequest` model.
10392#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10393pub struct FileArbiterAppealRequest {
10394    #[serde(default, skip_serializing_if = "Option::is_none")]
10395    pub filed_by: Option<String>,
10396    pub reason: String,
10397}
10398
10399/// `FileArbiterAppealResponse` model.
10400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10401pub struct FileArbiterAppealResponse {
10402    pub appeal_id: String,
10403    pub case_id: String,
10404    pub filed_by: String,
10405    pub reason: String,
10406    pub panel_arbiter_ids: Vec<String>,
10407    pub status: FileArbiterAppealResponseStatus,
10408    pub filed_at: String,
10409    #[serde(default, skip_serializing_if = "Option::is_none")]
10410    pub resolved_at: Option<String>,
10411}
10412
10413/// `FileArbiterAppealResponseStatus` enumeration.
10414#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10415pub enum FileArbiterAppealResponseStatus {
10416    #[default]
10417    #[serde(rename = "pending")]
10418    Pending,
10419    #[serde(rename = "upheld")]
10420    Upheld,
10421    #[serde(rename = "overturned")]
10422    Overturned,
10423    /// A value the API introduced after this SDK was generated.
10424    #[serde(untagged)]
10425    Other(String),
10426}
10427
10428impl FileArbiterAppealResponseStatus {
10429    /// The value as it appears on the wire.
10430    pub fn as_str(&self) -> &str {
10431        match self {
10432            Self::Pending => "pending",
10433            Self::Upheld => "upheld",
10434            Self::Overturned => "overturned",
10435            Self::Other(value) => value.as_str(),
10436        }
10437    }
10438}
10439
10440impl std::fmt::Display for FileArbiterAppealResponseStatus {
10441    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10442        f.write_str(self.as_str())
10443    }
10444}
10445
10446impl From<&str> for FileArbiterAppealResponseStatus {
10447    fn from(value: &str) -> Self {
10448        match value {
10449            "pending" => Self::Pending,
10450            "upheld" => Self::Upheld,
10451            "overturned" => Self::Overturned,
10452            other => Self::Other(other.to_string()),
10453        }
10454    }
10455}
10456
10457/// `FileArbiterCaseRequest` model.
10458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10459pub struct FileArbiterCaseRequest {
10460    pub filed_by: String,
10461    pub against_agent_id: String,
10462    /// Which constitution rules the case alleges were broken. At least one — a case against no rule
10463    /// is not arbitrable.
10464    pub rule_ids: Vec<String>,
10465    /// The dispute in the filer's words, and what the reader returns as `description`. There is no
10466    /// `reason` field: the handler validates with `.strip()`, so a body written from the old
10467    /// version of this block had its text discarded and was then refused 422 for the two fields the
10468    /// block never mentioned (measured 2026-09-17).
10469    pub description: String,
10470    /// Free-form supporting material. Optional.
10471    #[serde(default, skip_serializing_if = "Option::is_none")]
10472    pub evidence: Option<serde_json::Map<String, serde_json::Value>>,
10473}
10474
10475/// `FileEntry` model.
10476#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10477pub struct FileEntry {
10478    pub created_at: String,
10479    pub file_id: String,
10480    pub filename: String,
10481    pub mime_type: String,
10482    pub sha256: String,
10483    pub size_bytes: i64,
10484    pub tenant_id: String,
10485}
10486
10487/// A stored file as GET /files/{fileId} serves it (measured 2026-09-10 on e2e-canon). POST
10488/// /files returns the same record plus `url`.
10489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10490pub struct FileRecord {
10491    pub file_id: String,
10492    pub tenant_id: String,
10493    pub filename: String,
10494    pub mime_type: String,
10495    pub size_bytes: i64,
10496    pub sha256: String,
10497    pub created_at: String,
10498}
10499
10500/// The operator's canvas: where each agent sits, how they are wired, and the notes and
10501/// not-yet-real nodes drawn around them. Persisted as one record per tenant.
10502#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10503pub struct FleetLayout {
10504    /// Agent id → its place on the canvas.
10505    pub positions: HashMap<String, Value4>,
10506    pub edges: Vec<FleetLayoutEdge>,
10507    #[serde(default, skip_serializing_if = "Option::is_none")]
10508    pub notes: Option<Vec<FleetLayoutNote>>,
10509    #[serde(default, skip_serializing_if = "Option::is_none")]
10510    pub drafts: Option<Vec<FleetLayoutDraft>>,
10511    #[serde(default, skip_serializing_if = "Option::is_none")]
10512    pub updated_at: Option<String>,
10513    /// Present ONLY when the save discarded something. Counts per collection of the items that did
10514    /// not survive the caps or validation. A 200 without this field saved everything.
10515    #[serde(default, skip_serializing_if = "Option::is_none")]
10516    pub dropped: Option<FleetLayoutDropped>,
10517}
10518
10519/// `FleetLayoutDraft` model.
10520#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10521pub struct FleetLayoutDraft {
10522    pub id: String,
10523    /// memory / knowledge / tool / condition / … — a node the operator drew that is not a backend
10524    /// entity yet.
10525    pub kind: String,
10526    pub x: f64,
10527    pub y: f64,
10528    #[serde(default, skip_serializing_if = "Option::is_none")]
10529    pub label: Option<String>,
10530    #[serde(default, skip_serializing_if = "Option::is_none")]
10531    pub config: Option<serde_json::Map<String, serde_json::Value>>,
10532}
10533
10534/// Present ONLY when the save discarded something. Counts per collection of the items that did
10535/// not survive the caps or validation. A 200 without this field saved everything.
10536#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10537pub struct FleetLayoutDropped {
10538    pub positions: i64,
10539    pub edges: i64,
10540    pub notes: i64,
10541    pub drafts: i64,
10542}
10543
10544/// `FleetLayoutEdge` model.
10545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10546pub struct FleetLayoutEdge {
10547    pub id: String,
10548    /// Agent id.
10549    pub source: String,
10550    /// Agent id.
10551    pub target: String,
10552    /// Edge kind; a workflow edge is what makes the graph runnable.
10553    #[serde(default, skip_serializing_if = "Option::is_none")]
10554    pub r#type: Option<String>,
10555}
10556
10557/// `FleetLayoutNote` model.
10558#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10559pub struct FleetLayoutNote {
10560    pub id: String,
10561    pub x: f64,
10562    pub y: f64,
10563    pub w: f64,
10564    pub h: f64,
10565    pub text: String,
10566    #[serde(default, skip_serializing_if = "Option::is_none")]
10567    pub color: Option<String>,
10568    /// A frame is a large titled rectangle drawn BEHIND the nodes to group a squad.
10569    #[serde(default, skip_serializing_if = "Option::is_none")]
10570    pub frame: Option<bool>,
10571}
10572
10573/// What a client SENDS when saving the canvas. The stored record additionally carries
10574/// `updated_at`, and the response may carry `dropped` — both are produced by the server, so
10575/// neither belongs in a request.
10576#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10577pub struct FleetLayoutUpdate {
10578    /// Agent id → its place on the canvas.
10579    pub positions: HashMap<String, Value3>,
10580    pub edges: Vec<FleetLayoutUpdateEdge>,
10581    #[serde(default, skip_serializing_if = "Option::is_none")]
10582    pub notes: Option<Vec<FleetLayoutUpdateNote>>,
10583    #[serde(default, skip_serializing_if = "Option::is_none")]
10584    pub drafts: Option<Vec<FleetLayoutUpdateDraft>>,
10585}
10586
10587/// `FleetLayoutUpdateDraft` model.
10588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10589pub struct FleetLayoutUpdateDraft {
10590    pub id: String,
10591    pub kind: String,
10592    pub x: f64,
10593    pub y: f64,
10594    #[serde(default, skip_serializing_if = "Option::is_none")]
10595    pub label: Option<String>,
10596    #[serde(default, skip_serializing_if = "Option::is_none")]
10597    pub config: Option<serde_json::Map<String, serde_json::Value>>,
10598}
10599
10600/// `FleetLayoutUpdateEdge` model.
10601#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10602pub struct FleetLayoutUpdateEdge {
10603    pub id: String,
10604    pub source: String,
10605    pub target: String,
10606    #[serde(default, skip_serializing_if = "Option::is_none")]
10607    pub r#type: Option<String>,
10608}
10609
10610/// `FleetLayoutUpdateNote` model.
10611#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10612pub struct FleetLayoutUpdateNote {
10613    pub id: String,
10614    pub x: f64,
10615    pub y: f64,
10616    pub w: f64,
10617    pub h: f64,
10618    pub text: String,
10619    #[serde(default, skip_serializing_if = "Option::is_none")]
10620    pub color: Option<String>,
10621    #[serde(default, skip_serializing_if = "Option::is_none")]
10622    pub frame: Option<bool>,
10623}
10624
10625/// `FounderIdentity` model.
10626#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10627pub struct FounderIdentity {
10628    /// Empty string when unset — this read never omits the key.
10629    pub founder_id: String,
10630    pub founder_name: String,
10631    pub founder_public_key: String,
10632}
10633
10634/// `FriaReport` model.
10635#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10636pub struct FriaReport {
10637    pub agent_id: String,
10638    pub risk_level: String,
10639    pub rights_assessed: Vec<FriaRight>,
10640    pub mitigations: String,
10641    pub assessor: String,
10642    pub assessed_at: String,
10643    pub next_review: String,
10644}
10645
10646/// `FriaRight` model.
10647#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10648pub struct FriaRight {
10649    pub right: String,
10650    pub impact: FriaRightImpact,
10651    pub justification: String,
10652    #[serde(default, skip_serializing_if = "Option::is_none")]
10653    pub mitigation: Option<String>,
10654}
10655
10656/// `FriaRightImpact` enumeration.
10657#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10658pub enum FriaRightImpact {
10659    #[default]
10660    #[serde(rename = "none")]
10661    None,
10662    #[serde(rename = "low")]
10663    Low,
10664    #[serde(rename = "medium")]
10665    Medium,
10666    #[serde(rename = "high")]
10667    High,
10668    /// A value the API introduced after this SDK was generated.
10669    #[serde(untagged)]
10670    Other(String),
10671}
10672
10673impl FriaRightImpact {
10674    /// The value as it appears on the wire.
10675    pub fn as_str(&self) -> &str {
10676        match self {
10677            Self::None => "none",
10678            Self::Low => "low",
10679            Self::Medium => "medium",
10680            Self::High => "high",
10681            Self::Other(value) => value.as_str(),
10682        }
10683    }
10684}
10685
10686impl std::fmt::Display for FriaRightImpact {
10687    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10688        f.write_str(self.as_str())
10689    }
10690}
10691
10692impl From<&str> for FriaRightImpact {
10693    fn from(value: &str) -> Self {
10694        match value {
10695            "none" => Self::None,
10696            "low" => Self::Low,
10697            "medium" => Self::Medium,
10698            "high" => Self::High,
10699            other => Self::Other(other.to_string()),
10700        }
10701    }
10702}
10703
10704/// `GenerateAdminBlogPostResponse` model.
10705#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10706pub struct GenerateAdminBlogPostResponse {
10707    pub post: BlogPost,
10708}
10709
10710/// `GetActivityFeedResponse` model.
10711#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10712pub struct GetActivityFeedResponse {
10713    #[serde(default, skip_serializing_if = "Option::is_none")]
10714    pub entries: Option<Vec<FeedEntry>>,
10715    #[serde(default, skip_serializing_if = "Option::is_none")]
10716    pub cursor: Option<String>,
10717    #[serde(default, skip_serializing_if = "Option::is_none")]
10718    pub total: Option<i64>,
10719}
10720
10721/// `GetAdminBlogConfigResponse` model.
10722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10723pub struct GetAdminBlogConfigResponse {
10724    pub config: BlogConfig,
10725}
10726
10727/// `GetAdminDisabledToolsResponse` model.
10728#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10729pub struct GetAdminDisabledToolsResponse {
10730    pub ok: bool,
10731    pub disabled_tools: Vec<String>,
10732}
10733
10734/// `GetAdminIntegrationOAuthProviderProvider` enumeration.
10735#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
10736pub enum GetAdminIntegrationOAuthProviderProvider {
10737    #[default]
10738    #[serde(rename = "github")]
10739    Github,
10740    #[serde(rename = "google")]
10741    Google,
10742    #[serde(rename = "slack")]
10743    Slack,
10744    #[serde(rename = "notion")]
10745    Notion,
10746    #[serde(rename = "stripe")]
10747    Stripe,
10748    #[serde(rename = "jira")]
10749    Jira,
10750    #[serde(rename = "zendesk")]
10751    Zendesk,
10752    #[serde(rename = "hubspot")]
10753    Hubspot,
10754    #[serde(rename = "linkedin")]
10755    Linkedin,
10756    #[serde(rename = "youtube")]
10757    Youtube,
10758    #[serde(rename = "instagram")]
10759    Instagram,
10760    #[serde(rename = "x_twitter")]
10761    XTwitter,
10762    #[serde(rename = "facebook")]
10763    Facebook,
10764    #[serde(rename = "tiktok")]
10765    Tiktok,
10766    /// A value the API introduced after this SDK was generated.
10767    #[serde(untagged)]
10768    Other(String),
10769}
10770
10771impl GetAdminIntegrationOAuthProviderProvider {
10772    /// The value as it appears on the wire.
10773    pub fn as_str(&self) -> &str {
10774        match self {
10775            Self::Github => "github",
10776            Self::Google => "google",
10777            Self::Slack => "slack",
10778            Self::Notion => "notion",
10779            Self::Stripe => "stripe",
10780            Self::Jira => "jira",
10781            Self::Zendesk => "zendesk",
10782            Self::Hubspot => "hubspot",
10783            Self::Linkedin => "linkedin",
10784            Self::Youtube => "youtube",
10785            Self::Instagram => "instagram",
10786            Self::XTwitter => "x_twitter",
10787            Self::Facebook => "facebook",
10788            Self::Tiktok => "tiktok",
10789            Self::Other(value) => value.as_str(),
10790        }
10791    }
10792}
10793
10794impl std::fmt::Display for GetAdminIntegrationOAuthProviderProvider {
10795    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10796        f.write_str(self.as_str())
10797    }
10798}
10799
10800impl From<&str> for GetAdminIntegrationOAuthProviderProvider {
10801    fn from(value: &str) -> Self {
10802        match value {
10803            "github" => Self::Github,
10804            "google" => Self::Google,
10805            "slack" => Self::Slack,
10806            "notion" => Self::Notion,
10807            "stripe" => Self::Stripe,
10808            "jira" => Self::Jira,
10809            "zendesk" => Self::Zendesk,
10810            "hubspot" => Self::Hubspot,
10811            "linkedin" => Self::Linkedin,
10812            "youtube" => Self::Youtube,
10813            "instagram" => Self::Instagram,
10814            "x_twitter" => Self::XTwitter,
10815            "facebook" => Self::Facebook,
10816            "tiktok" => Self::Tiktok,
10817            other => Self::Other(other.to_string()),
10818        }
10819    }
10820}
10821
10822/// `GetAdminIntegrationOAuthProviderResponse` model.
10823#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10824pub struct GetAdminIntegrationOAuthProviderResponse {
10825    pub provider: String,
10826    pub enabled: bool,
10827    pub configured: bool,
10828    /// Present only when `configured` is true.
10829    #[serde(default, skip_serializing_if = "Option::is_none")]
10830    pub client_id: Option<String>,
10831    /// Last four characters behind dots. Present only when `configured` is true; null when the
10832    /// stored secret is empty.
10833    #[serde(default, skip_serializing_if = "Option::is_none")]
10834    pub client_secret_hint: Option<String>,
10835    /// Override of the default scope list. Present only when `configured` is true; null when no
10836    /// override is stored.
10837    #[serde(default, skip_serializing_if = "Option::is_none")]
10838    pub scopes: Option<Vec<String>>,
10839}
10840
10841/// `GetAdminLLMDefaultsResponse` model.
10842#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10843pub struct GetAdminLLMDefaultsResponse {
10844    pub providers: Vec<GetAdminLLMDefaultsResponseProvider>,
10845    #[serde(default, skip_serializing_if = "Option::is_none")]
10846    pub default_provider: Option<String>,
10847    #[serde(default, skip_serializing_if = "Option::is_none")]
10848    pub default_model: Option<String>,
10849    #[serde(default, skip_serializing_if = "Option::is_none")]
10850    pub default_endpoint: Option<String>,
10851    #[serde(default, skip_serializing_if = "Option::is_none")]
10852    pub fallback_provider: Option<String>,
10853    #[serde(default, skip_serializing_if = "Option::is_none")]
10854    pub fallback_model: Option<String>,
10855    #[serde(default, skip_serializing_if = "Option::is_none")]
10856    pub fallback_endpoint: Option<String>,
10857}
10858
10859/// `GetAdminLLMDefaultsResponseProvider` model.
10860#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10861pub struct GetAdminLLMDefaultsResponseProvider {
10862    pub provider_id: String,
10863    /// Always true — the list holds configured providers only.
10864    pub configured: bool,
10865    /// Masked key: first four and last four, or all dots when the key is 10 characters or fewer.
10866    pub key_hint: String,
10867}
10868
10869/// `GetAdminPlansResponse` model.
10870#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10871pub struct GetAdminPlansResponse {
10872    pub plans: Vec<GetAdminPlansResponsePlan>,
10873}
10874
10875/// `GetAdminPlansResponsePlan` model.
10876#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10877pub struct GetAdminPlansResponsePlan {
10878    pub id: String,
10879    pub name: String,
10880    /// Per-plan limits (`max_agents`, `max_monthly_tokens`, …).
10881    pub quotas: serde_json::Map<String, serde_json::Value>,
10882}
10883
10884/// `GetAdminStatsResponse` model.
10885#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10886pub struct GetAdminStatsResponse {
10887    #[serde(default, skip_serializing_if = "Option::is_none")]
10888    pub total_tenants: Option<i64>,
10889    #[serde(default, skip_serializing_if = "Option::is_none")]
10890    pub total_agents: Option<i64>,
10891    #[serde(default, skip_serializing_if = "Option::is_none")]
10892    pub total_runs: Option<i64>,
10893}
10894
10895/// `GetAdminToolOverridesResponse` model.
10896#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10897pub struct GetAdminToolOverridesResponse {
10898    pub ok: bool,
10899    pub overrides: HashMap<String, ToolOverride>,
10900}
10901
10902/// `GetAdminTraceResponse` model.
10903#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10904pub struct GetAdminTraceResponse {
10905    pub trace_id: String,
10906    pub count: i64,
10907    #[serde(default, skip_serializing_if = "Option::is_none")]
10908    pub truncated: Option<bool>,
10909    pub runs: Vec<GetAdminTraceResponseRun>,
10910}
10911
10912/// `GetAdminTraceResponseRun` model.
10913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10914pub struct GetAdminTraceResponseRun {
10915    #[serde(default, skip_serializing_if = "Option::is_none")]
10916    pub run_id: Option<String>,
10917    #[serde(default, skip_serializing_if = "Option::is_none")]
10918    pub agent_id: Option<String>,
10919    #[serde(default, skip_serializing_if = "Option::is_none")]
10920    pub status: Option<String>,
10921    #[serde(default, skip_serializing_if = "Option::is_none")]
10922    pub parent_run_id: Option<String>,
10923    #[serde(default, skip_serializing_if = "Option::is_none")]
10924    pub dag_trace_id: Option<String>,
10925    #[serde(default, skip_serializing_if = "Option::is_none")]
10926    pub created_at: Option<String>,
10927    #[serde(default, skip_serializing_if = "Option::is_none")]
10928    pub completed_at: Option<String>,
10929    #[serde(default, skip_serializing_if = "Option::is_none")]
10930    pub duration_ms: Option<i64>,
10931    #[serde(default, skip_serializing_if = "Option::is_none")]
10932    pub error: Option<String>,
10933}
10934
10935/// `GetAgentActivityStatsResponse` model.
10936#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10937pub struct GetAgentActivityStatsResponse {
10938    /// Deprecated spelling of `total_runs` — the same value, kept for the compatibility window and
10939    /// removed in the next breaking release (the one that moves `X-API-Version`). Read
10940    /// `total_runs`.
10941    #[serde(rename = "totalRuns", default, skip_serializing_if = "Option::is_none")]
10942    pub total_runs: Option<i64>,
10943    /// Deprecated spelling of `completed_runs` — the same value, kept for the compatibility window
10944    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
10945    /// `completed_runs`.
10946    #[serde(rename = "completedRuns", default, skip_serializing_if = "Option::is_none")]
10947    pub completed_runs: Option<i64>,
10948    /// Deprecated spelling of `failed_runs` — the same value, kept for the compatibility window and
10949    /// removed in the next breaking release (the one that moves `X-API-Version`). Read
10950    /// `failed_runs`.
10951    #[serde(rename = "failedRuns", default, skip_serializing_if = "Option::is_none")]
10952    pub failed_runs: Option<i64>,
10953    /// Deprecated spelling of `cancelled_runs` — the same value, kept for the compatibility window
10954    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
10955    /// `cancelled_runs`.
10956    #[serde(rename = "cancelledRuns", default, skip_serializing_if = "Option::is_none")]
10957    pub cancelled_runs: Option<i64>,
10958    /// Deprecated spelling of `guardrail_blocked_runs` — the same value, kept for the compatibility
10959    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
10960    /// `guardrail_blocked_runs`.
10961    #[serde(rename = "guardrailBlockedRuns", default, skip_serializing_if = "Option::is_none")]
10962    pub guardrail_blocked_runs: Option<i64>,
10963    /// Deprecated spelling of `error_rate_percent` — the same value, kept for the compatibility
10964    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
10965    /// `error_rate_percent`.
10966    #[serde(rename = "errorRatePercent", default, skip_serializing_if = "Option::is_none")]
10967    pub error_rate_percent: Option<f64>,
10968    /// Deprecated spelling of `avg_steps_per_run` — the same value, kept for the compatibility
10969    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
10970    /// `avg_steps_per_run`.
10971    #[serde(rename = "avgStepsPerRun", default, skip_serializing_if = "Option::is_none")]
10972    pub avg_steps_per_run: Option<f64>,
10973    /// Deprecated spelling of `avg_duration_ms` — the same value, kept for the compatibility window
10974    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
10975    /// `avg_duration_ms`.
10976    #[serde(rename = "avgDurationMs", default, skip_serializing_if = "Option::is_none")]
10977    pub avg_duration_ms: Option<f64>,
10978    /// Deprecated spelling of `avg_input_tokens` — the same value, kept for the compatibility
10979    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
10980    /// `avg_input_tokens`.
10981    #[serde(rename = "avgInputTokens", default, skip_serializing_if = "Option::is_none")]
10982    pub avg_input_tokens: Option<f64>,
10983    /// Deprecated spelling of `avg_output_tokens` — the same value, kept for the compatibility
10984    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
10985    /// `avg_output_tokens`.
10986    #[serde(rename = "avgOutputTokens", default, skip_serializing_if = "Option::is_none")]
10987    pub avg_output_tokens: Option<f64>,
10988    /// Deprecated spelling of `avg_thinking_tokens` — the same value, kept for the compatibility
10989    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
10990    /// `avg_thinking_tokens`.
10991    #[serde(rename = "avgThinkingTokens", default, skip_serializing_if = "Option::is_none")]
10992    pub avg_thinking_tokens: Option<f64>,
10993    /// Deprecated spelling of `tool_breakdown` — the same value, kept for the compatibility window
10994    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
10995    /// `tool_breakdown`.
10996    #[serde(rename = "toolBreakdown", default, skip_serializing_if = "Option::is_none")]
10997    pub tool_breakdown: Option<Vec<ToolBreakdownEntry>>,
10998    /// Deprecated spelling of `top_error_messages` — the same value, kept for the compatibility
10999    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
11000    /// `top_error_messages`.
11001    #[serde(rename = "topErrorMessages", default, skip_serializing_if = "Option::is_none")]
11002    pub top_error_messages: Option<Vec<GetAgentActivityStatsResponseTopErrorMessage>>,
11003    /// Deprecated spelling of `runs_by_day` — the same value, kept for the compatibility window and
11004    /// removed in the next breaking release (the one that moves `X-API-Version`). Read
11005    /// `runs_by_day`.
11006    #[serde(rename = "runsByDay", default, skip_serializing_if = "Option::is_none")]
11007    pub runs_by_day: Option<Vec<GetAgentActivityStatsResponseRunsByDayItem>>,
11008    #[serde(rename = "total_runs", default, skip_serializing_if = "Option::is_none")]
11009    pub total_runs_: Option<i64>,
11010    #[serde(rename = "completed_runs", default, skip_serializing_if = "Option::is_none")]
11011    pub completed_runs_: Option<i64>,
11012    #[serde(rename = "failed_runs", default, skip_serializing_if = "Option::is_none")]
11013    pub failed_runs_: Option<i64>,
11014    #[serde(rename = "cancelled_runs", default, skip_serializing_if = "Option::is_none")]
11015    pub cancelled_runs_: Option<i64>,
11016    #[serde(rename = "guardrail_blocked_runs", default, skip_serializing_if = "Option::is_none")]
11017    pub guardrail_blocked_runs_: Option<i64>,
11018    #[serde(rename = "error_rate_percent", default, skip_serializing_if = "Option::is_none")]
11019    pub error_rate_percent_: Option<f64>,
11020    #[serde(rename = "avg_steps_per_run", default, skip_serializing_if = "Option::is_none")]
11021    pub avg_steps_per_run_: Option<f64>,
11022    #[serde(rename = "avg_duration_ms", default, skip_serializing_if = "Option::is_none")]
11023    pub avg_duration_ms_: Option<f64>,
11024    #[serde(rename = "avg_input_tokens", default, skip_serializing_if = "Option::is_none")]
11025    pub avg_input_tokens_: Option<f64>,
11026    #[serde(rename = "avg_output_tokens", default, skip_serializing_if = "Option::is_none")]
11027    pub avg_output_tokens_: Option<f64>,
11028    #[serde(rename = "avg_thinking_tokens", default, skip_serializing_if = "Option::is_none")]
11029    pub avg_thinking_tokens_: Option<f64>,
11030    #[serde(rename = "tool_breakdown", default, skip_serializing_if = "Option::is_none")]
11031    pub tool_breakdown_: Option<Vec<ToolBreakdownEntry>>,
11032    #[serde(rename = "top_error_messages", default, skip_serializing_if = "Option::is_none")]
11033    pub top_error_messages_: Option<Vec<GetAgentActivityStatsResponseTopErrorMessage2>>,
11034    #[serde(rename = "runs_by_day", default, skip_serializing_if = "Option::is_none")]
11035    pub runs_by_day_: Option<Vec<GetAgentActivityStatsResponseRunsByDayItem2>>,
11036}
11037
11038/// `GetAgentActivityStatsResponseRunsByDayItem` model.
11039#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11040pub struct GetAgentActivityStatsResponseRunsByDayItem {
11041    #[serde(default, skip_serializing_if = "Option::is_none")]
11042    pub day: Option<String>,
11043    #[serde(default, skip_serializing_if = "Option::is_none")]
11044    pub total: Option<i64>,
11045    #[serde(default, skip_serializing_if = "Option::is_none")]
11046    pub completed: Option<i64>,
11047    #[serde(default, skip_serializing_if = "Option::is_none")]
11048    pub failed: Option<i64>,
11049}
11050
11051/// `GetAgentActivityStatsResponseRunsByDayItem2` model.
11052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11053pub struct GetAgentActivityStatsResponseRunsByDayItem2 {
11054    #[serde(default, skip_serializing_if = "Option::is_none")]
11055    pub day: Option<String>,
11056    #[serde(default, skip_serializing_if = "Option::is_none")]
11057    pub total: Option<i64>,
11058    #[serde(default, skip_serializing_if = "Option::is_none")]
11059    pub completed: Option<i64>,
11060    #[serde(default, skip_serializing_if = "Option::is_none")]
11061    pub failed: Option<i64>,
11062}
11063
11064/// `GetAgentActivityStatsResponseTopErrorMessage` model.
11065#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11066pub struct GetAgentActivityStatsResponseTopErrorMessage {
11067    #[serde(default, skip_serializing_if = "Option::is_none")]
11068    pub message: Option<String>,
11069    #[serde(default, skip_serializing_if = "Option::is_none")]
11070    pub count: Option<i64>,
11071}
11072
11073/// `GetAgentActivityStatsResponseTopErrorMessage2` model.
11074#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11075pub struct GetAgentActivityStatsResponseTopErrorMessage2 {
11076    #[serde(default, skip_serializing_if = "Option::is_none")]
11077    pub message: Option<String>,
11078    #[serde(default, skip_serializing_if = "Option::is_none")]
11079    pub count: Option<i64>,
11080}
11081
11082/// `GetAgentIdentityResponse` model.
11083#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11084pub struct GetAgentIdentityResponse {
11085    #[serde(default, skip_serializing_if = "Option::is_none")]
11086    pub public_key: Option<String>,
11087    #[serde(default, skip_serializing_if = "Option::is_none")]
11088    pub created_at: Option<String>,
11089}
11090
11091/// `GetAgentObligationsResponse` model.
11092#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11093pub struct GetAgentObligationsResponse {
11094    #[serde(default, skip_serializing_if = "Option::is_none")]
11095    pub agent_id: Option<String>,
11096    #[serde(default, skip_serializing_if = "Option::is_none")]
11097    pub rules: Option<Vec<ConstitutionRule>>,
11098    #[serde(default, skip_serializing_if = "Option::is_none")]
11099    pub count: Option<i64>,
11100}
11101
11102/// `GetAgentSystemCardFormat` enumeration.
11103#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11104pub enum GetAgentSystemCardFormat {
11105    #[default]
11106    #[serde(rename = "json")]
11107    JSON,
11108    #[serde(rename = "markdown")]
11109    Markdown,
11110    /// A value the API introduced after this SDK was generated.
11111    #[serde(untagged)]
11112    Other(String),
11113}
11114
11115impl GetAgentSystemCardFormat {
11116    /// The value as it appears on the wire.
11117    pub fn as_str(&self) -> &str {
11118        match self {
11119            Self::JSON => "json",
11120            Self::Markdown => "markdown",
11121            Self::Other(value) => value.as_str(),
11122        }
11123    }
11124}
11125
11126impl std::fmt::Display for GetAgentSystemCardFormat {
11127    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11128        f.write_str(self.as_str())
11129    }
11130}
11131
11132impl From<&str> for GetAgentSystemCardFormat {
11133    fn from(value: &str) -> Self {
11134        match value {
11135            "json" => Self::JSON,
11136            "markdown" => Self::Markdown,
11137            other => Self::Other(other.to_string()),
11138        }
11139    }
11140}
11141
11142/// `GetAgentTrafficResponse` model.
11143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11144pub struct GetAgentTrafficResponse {
11145    #[serde(default, skip_serializing_if = "Option::is_none")]
11146    pub agent_id: Option<String>,
11147    #[serde(default, skip_serializing_if = "Option::is_none")]
11148    pub entries: Option<Vec<GetAgentTrafficResponseEntry>>,
11149    #[serde(default, skip_serializing_if = "Option::is_none")]
11150    pub updated_at: Option<String>,
11151}
11152
11153/// `GetAgentTrafficResponseEntry` model.
11154#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11155pub struct GetAgentTrafficResponseEntry {
11156    #[serde(default, skip_serializing_if = "Option::is_none")]
11157    pub version: Option<i64>,
11158    #[serde(default, skip_serializing_if = "Option::is_none")]
11159    pub weight: Option<f64>,
11160}
11161
11162/// `GetAgentVersionDiffResponse` model.
11163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11164pub struct GetAgentVersionDiffResponse {
11165    #[serde(default, skip_serializing_if = "Option::is_none")]
11166    pub agent_id: Option<String>,
11167    #[serde(default, skip_serializing_if = "Option::is_none")]
11168    pub version_from: Option<i64>,
11169    #[serde(default, skip_serializing_if = "Option::is_none")]
11170    pub version_to: Option<i64>,
11171    #[serde(default, skip_serializing_if = "Option::is_none")]
11172    pub diff: Option<HashMap<String, Value5>>,
11173    #[serde(default, skip_serializing_if = "Option::is_none")]
11174    pub changed_fields: Option<Vec<String>>,
11175}
11176
11177/// `GetAgentViolationsResponse` model.
11178#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11179pub struct GetAgentViolationsResponse {
11180    #[serde(default, skip_serializing_if = "Option::is_none")]
11181    pub agent_id: Option<String>,
11182    #[serde(default, skip_serializing_if = "Option::is_none")]
11183    pub violations: Option<Vec<ConstitutionViolation>>,
11184    #[serde(default, skip_serializing_if = "Option::is_none")]
11185    pub count: Option<i64>,
11186}
11187
11188/// `GetAndroidTestingStatusResponse` model.
11189#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11190pub struct GetAndroidTestingStatusResponse {
11191    pub registered: bool,
11192    pub emailed: bool,
11193}
11194
11195/// `GetAppleAppSiteAssociationResponse` model.
11196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11197pub struct GetAppleAppSiteAssociationResponse {
11198    pub applinks: GetAppleAppSiteAssociationResponseApplinks,
11199    #[serde(default, skip_serializing_if = "Option::is_none")]
11200    pub webcredentials: Option<GetAppleAppSiteAssociationResponseWebcredentials>,
11201}
11202
11203/// `GetAppleAppSiteAssociationResponseApplinks` model.
11204#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11205pub struct GetAppleAppSiteAssociationResponseApplinks {
11206    #[serde(default, skip_serializing_if = "Option::is_none")]
11207    pub apps: Option<Vec<String>>,
11208    #[serde(default, skip_serializing_if = "Option::is_none")]
11209    pub details: Option<Vec<GetAppleAppSiteAssociationResponseApplinksDetail>>,
11210}
11211
11212/// `GetAppleAppSiteAssociationResponseApplinksDetail` model.
11213#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11214pub struct GetAppleAppSiteAssociationResponseApplinksDetail {
11215    #[serde(rename = "appIDs", default, skip_serializing_if = "Option::is_none")]
11216    pub app_i_ds: Option<Vec<String>>,
11217    #[serde(default, skip_serializing_if = "Option::is_none")]
11218    pub components: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
11219}
11220
11221/// `GetAppleAppSiteAssociationResponseWebcredentials` model.
11222#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11223pub struct GetAppleAppSiteAssociationResponseWebcredentials {
11224    #[serde(default, skip_serializing_if = "Option::is_none")]
11225    pub apps: Option<Vec<String>>,
11226}
11227
11228/// `GetBillingBudgetResponse` model.
11229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11230pub struct GetBillingBudgetResponse {
11231    pub configured: bool,
11232    #[serde(default)]
11233    pub budget: Option<GetBillingBudgetResponseBudget>,
11234    #[serde(default, skip_serializing_if = "Option::is_none")]
11235    pub status: Option<serde_json::Map<String, serde_json::Value>>,
11236}
11237
11238/// `GetBillingBudgetResponseBudget` model.
11239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11240pub struct GetBillingBudgetResponseBudget {
11241    #[serde(default, skip_serializing_if = "Option::is_none")]
11242    pub limit_usd: Option<f64>,
11243    /// Fraction, not percent: 0.8 alerts at 80%.
11244    #[serde(default, skip_serializing_if = "Option::is_none")]
11245    pub soft_threshold: Option<f64>,
11246    #[serde(default, skip_serializing_if = "Option::is_none")]
11247    pub hard_threshold: Option<f64>,
11248    #[serde(default, skip_serializing_if = "Option::is_none")]
11249    pub period: Option<GetBillingBudgetResponseBudgetPeriod>,
11250}
11251
11252/// `GetBillingBudgetResponseBudgetPeriod` enumeration.
11253#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11254pub enum GetBillingBudgetResponseBudgetPeriod {
11255    #[default]
11256    #[serde(rename = "monthly")]
11257    Monthly,
11258    #[serde(rename = "weekly")]
11259    Weekly,
11260    #[serde(rename = "daily")]
11261    Daily,
11262    /// A value the API introduced after this SDK was generated.
11263    #[serde(untagged)]
11264    Other(String),
11265}
11266
11267impl GetBillingBudgetResponseBudgetPeriod {
11268    /// The value as it appears on the wire.
11269    pub fn as_str(&self) -> &str {
11270        match self {
11271            Self::Monthly => "monthly",
11272            Self::Weekly => "weekly",
11273            Self::Daily => "daily",
11274            Self::Other(value) => value.as_str(),
11275        }
11276    }
11277}
11278
11279impl std::fmt::Display for GetBillingBudgetResponseBudgetPeriod {
11280    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11281        f.write_str(self.as_str())
11282    }
11283}
11284
11285impl From<&str> for GetBillingBudgetResponseBudgetPeriod {
11286    fn from(value: &str) -> Self {
11287        match value {
11288            "monthly" => Self::Monthly,
11289            "weekly" => Self::Weekly,
11290            "daily" => Self::Daily,
11291            other => Self::Other(other.to_string()),
11292        }
11293    }
11294}
11295
11296/// `GetBillingOverageResponse` model.
11297#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11298pub struct GetBillingOverageResponse {
11299    pub enabled: bool,
11300    /// Always true: overage cannot be enabled without a spend cap.
11301    pub requires_cap: bool,
11302    pub cap_configured: bool,
11303    pub metered_to_stripe: bool,
11304}
11305
11306/// `GetBillingTrialResponse` model.
11307#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11308pub struct GetBillingTrialResponse {
11309    #[serde(default, skip_serializing_if = "Option::is_none")]
11310    pub active: Option<bool>,
11311    #[serde(default, skip_serializing_if = "Option::is_none")]
11312    pub ends_at: Option<String>,
11313    #[serde(default, skip_serializing_if = "Option::is_none")]
11314    pub days_left: Option<i64>,
11315    #[serde(default, skip_serializing_if = "Option::is_none")]
11316    pub recommended_plan: Option<String>,
11317    #[serde(default, skip_serializing_if = "Option::is_none")]
11318    pub signals: Option<serde_json::Map<String, serde_json::Value>>,
11319}
11320
11321/// `GetBridgeAgentSpecsResponse` model.
11322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11323pub struct GetBridgeAgentSpecsResponse {
11324    pub agent_id: String,
11325    /// SHA-256 over the list
11326    pub revision: String,
11327    pub specs: Vec<GetBridgeAgentSpecsResponseSpec>,
11328}
11329
11330/// `GetBridgeAgentSpecsResponseSpec` model.
11331#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11332pub struct GetBridgeAgentSpecsResponseSpec {
11333    pub spec_id: String,
11334    pub version: String,
11335    pub enabled: bool,
11336    /// null when the registry has no row for the SPEC; the reconciler skips it
11337    #[serde(default)]
11338    pub runtime_scope: Option<String>,
11339    pub permissions_granted: Vec<String>,
11340    #[serde(default, skip_serializing_if = "Option::is_none")]
11341    pub tool_allowlist: Option<Vec<String>>,
11342}
11343
11344/// `GetBridgeTaskApprovalResponse` model.
11345#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11346pub struct GetBridgeTaskApprovalResponse {
11347    #[serde(default, skip_serializing_if = "Option::is_none")]
11348    pub approval_response: Option<serde_json::Map<String, serde_json::Value>>,
11349}
11350
11351/// `GetClientConfigResponse` model.
11352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11353pub struct GetClientConfigResponse {
11354    #[serde(default, skip_serializing_if = "Option::is_none")]
11355    pub features: Option<serde_json::Map<String, serde_json::Value>>,
11356    #[serde(default, skip_serializing_if = "Option::is_none")]
11357    pub providers: Option<serde_json::Map<String, serde_json::Value>>,
11358}
11359
11360/// `GetCompanyActivityResponse` model.
11361#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11362pub struct GetCompanyActivityResponse {
11363    #[serde(default, skip_serializing_if = "Option::is_none")]
11364    pub entries: Option<Vec<CompanyActivityEntry>>,
11365}
11366
11367/// `GetCompanyBudgetResponse` model.
11368#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11369pub struct GetCompanyBudgetResponse {
11370    #[serde(default, skip_serializing_if = "Option::is_none")]
11371    pub total_usd: Option<f64>,
11372    #[serde(default, skip_serializing_if = "Option::is_none")]
11373    pub spent_usd: Option<f64>,
11374    #[serde(default, skip_serializing_if = "Option::is_none")]
11375    pub daily_limit_usd: Option<f64>,
11376    #[serde(default, skip_serializing_if = "Option::is_none")]
11377    pub alert_threshold_pct: Option<f64>,
11378    #[serde(default, skip_serializing_if = "Option::is_none")]
11379    pub remaining_usd: Option<f64>,
11380}
11381
11382/// `GetCompanyObjectivesResponse` model.
11383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11384pub struct GetCompanyObjectivesResponse {
11385    #[serde(default, skip_serializing_if = "Option::is_none")]
11386    pub trees: Option<Vec<ObjectiveTree>>,
11387    #[serde(default, skip_serializing_if = "Option::is_none")]
11388    pub objectives: Option<Vec<Objective>>,
11389}
11390
11391/// `GetDataExplorerValueResponse` model.
11392#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11393pub struct GetDataExplorerValueResponse {
11394    #[serde(default, skip_serializing_if = "Option::is_none")]
11395    pub namespace: Option<String>,
11396    #[serde(default, skip_serializing_if = "Option::is_none")]
11397    pub key: Option<String>,
11398    #[serde(default, skip_serializing_if = "Option::is_none")]
11399    pub value: Option<serde_json::Value>,
11400    #[serde(default, skip_serializing_if = "Option::is_none")]
11401    pub size_bytes: Option<i64>,
11402    #[serde(default, skip_serializing_if = "Option::is_none")]
11403    pub r#type: Option<String>,
11404}
11405
11406/// `GetGovernanceLedgerResponse` model.
11407#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11408pub struct GetGovernanceLedgerResponse {
11409    pub entries: Vec<GovernanceLedgerEntry>,
11410    pub head: GovernanceLedgerHead,
11411    /// Number of entries IN THIS RESPONSE, not the size of the ledger. Measured 2026-08-20: `total`
11412    /// was 16 while `GET /governance/ledger/verify` reported `entries_checked: 6698` against the
11413    /// same ledger a second later. Rendering this as "events recorded" understates the ledger by
11414    /// three orders of magnitude. For the size, read `tenant_total`.
11415    pub total: i64,
11416    /// How many entries in the whole ledger belong to the calling tenant — the number to render as
11417    /// "ledger entries". Independent of `count`/`from`/`to`. Not `entries_checked` from
11418    /// `/governance/ledger/verify` (that walks every tenant) and not `head.seq` (global sequence).
11419    pub tenant_total: i64,
11420}
11421
11422/// `GetHealthResponse` model.
11423#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11424pub struct GetHealthResponse {
11425    #[serde(default, skip_serializing_if = "Option::is_none")]
11426    pub status: Option<GetHealthResponseStatus>,
11427    #[serde(default, skip_serializing_if = "Option::is_none")]
11428    pub timestamp: Option<String>,
11429    #[serde(default, skip_serializing_if = "Option::is_none")]
11430    pub kv_connected: Option<bool>,
11431    #[serde(default, skip_serializing_if = "Option::is_none")]
11432    pub uptime_seconds: Option<f64>,
11433    /// The API contract version, a DATE STAMP — `2026-09-10` — bumped only on a breaking change,
11434    /// and the same value the `X-API-Version` RESPONSE header carries. The server does not read a
11435    /// request header of that name: pinning a date negotiates nothing. Not a release number and not
11436    /// semver: it cannot be ordered against a semver string, so a client that compares it to one is
11437    /// wrong in a way that appears to work for as long as both happen to sort the same. Compare it
11438    /// for equality, or read it as a date. It says nothing about which BUILD is running — for that,
11439    /// read `build_sha`.
11440    #[serde(default, skip_serializing_if = "Option::is_none")]
11441    pub version: Option<String>,
11442    /// The commit this running build was made from, baked in at image build time. This is the only
11443    /// value on the wire that identifies the deployed code: `version` is the contract stamp and is
11444    /// constant across deploys, and a restart proves a restart rather than an identity. `"unknown"`
11445    /// means the image was built without the build argument (a local build, or a deploy predating
11446    /// this field) and must be read as UNKNOWN, never as a match. Documentation that pins a claim
11447    /// about platform behaviour can cite it.
11448    #[serde(default, skip_serializing_if = "Option::is_none")]
11449    pub build_sha: Option<String>,
11450    /// Always 0. Kept for compatibility — there is no resume-parking state: `RunStatus` has no
11451    /// `waiting_for_resume`, and startup reconciliation FAILS an interrupted run rather than
11452    /// holding it for resume. It previously reported the queue depth under this name, which reads
11453    /// as recovery progress on the one endpoint an operator watches during a deploy. Use
11454    /// `runs_queued` for the queue, and run status for recovery.
11455    #[serde(default, skip_serializing_if = "Option::is_none")]
11456    pub pending_resumes: Option<i64>,
11457    /// Runs currently queued. After a restart this includes runs reconciliation re-queued, so it
11458    /// falls as they are picked up — but it is a queue depth, not a count of recoveries.
11459    #[serde(default, skip_serializing_if = "Option::is_none")]
11460    pub runs_queued: Option<i64>,
11461}
11462
11463/// `GetHealthResponseStatus` enumeration.
11464#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11465pub enum GetHealthResponseStatus {
11466    #[default]
11467    #[serde(rename = "healthy")]
11468    Healthy,
11469    #[serde(rename = "degraded")]
11470    Degraded,
11471    #[serde(rename = "unhealthy")]
11472    Unhealthy,
11473    /// A value the API introduced after this SDK was generated.
11474    #[serde(untagged)]
11475    Other(String),
11476}
11477
11478impl GetHealthResponseStatus {
11479    /// The value as it appears on the wire.
11480    pub fn as_str(&self) -> &str {
11481        match self {
11482            Self::Healthy => "healthy",
11483            Self::Degraded => "degraded",
11484            Self::Unhealthy => "unhealthy",
11485            Self::Other(value) => value.as_str(),
11486        }
11487    }
11488}
11489
11490impl std::fmt::Display for GetHealthResponseStatus {
11491    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11492        f.write_str(self.as_str())
11493    }
11494}
11495
11496impl From<&str> for GetHealthResponseStatus {
11497    fn from(value: &str) -> Self {
11498        match value {
11499            "healthy" => Self::Healthy,
11500            "degraded" => Self::Degraded,
11501            "unhealthy" => Self::Unhealthy,
11502            other => Self::Other(other.to_string()),
11503        }
11504    }
11505}
11506
11507/// `GetImmutableAuditResponse` model.
11508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11509pub struct GetImmutableAuditResponse {
11510    pub events: Vec<ImmutableAuditEvent>,
11511    pub total: i64,
11512}
11513
11514/// `GetLinkPreviewResponse` model.
11515#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11516pub struct GetLinkPreviewResponse {
11517    pub preview: LinkPreview,
11518}
11519
11520/// `GetListingReviewsResponse` model.
11521#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11522pub struct GetListingReviewsResponse {
11523    #[serde(default, skip_serializing_if = "Option::is_none")]
11524    pub reviews: Option<Vec<MarketplaceListingRating>>,
11525    #[serde(default, skip_serializing_if = "Option::is_none")]
11526    pub total: Option<i64>,
11527    #[serde(default, skip_serializing_if = "Option::is_none")]
11528    pub cursor: Option<String>,
11529}
11530
11531/// `GetMarketplaceCategoriesResponse` model.
11532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11533pub struct GetMarketplaceCategoriesResponse {
11534    pub categories: Vec<String>,
11535}
11536
11537/// `GetMarkupConfigResponse` model.
11538#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11539pub struct GetMarkupConfigResponse {
11540    #[serde(default, skip_serializing_if = "Option::is_none")]
11541    pub markup: Option<serde_json::Map<String, serde_json::Value>>,
11542}
11543
11544/// `GetMediaUsageResponse` model.
11545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11546pub struct GetMediaUsageResponse {
11547    #[serde(default, skip_serializing_if = "Option::is_none")]
11548    pub plan: Option<String>,
11549    #[serde(default, skip_serializing_if = "Option::is_none")]
11550    pub images: Option<GetMediaUsageResponseImages>,
11551    #[serde(default, skip_serializing_if = "Option::is_none")]
11552    pub videos: Option<GetMediaUsageResponseVideos>,
11553}
11554
11555/// `GetMediaUsageResponseImages` model.
11556#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11557pub struct GetMediaUsageResponseImages {
11558    #[serde(default, skip_serializing_if = "Option::is_none")]
11559    pub monthly_used: Option<i64>,
11560    #[serde(default, skip_serializing_if = "Option::is_none")]
11561    pub daily_used: Option<i64>,
11562    #[serde(default, skip_serializing_if = "Option::is_none")]
11563    pub monthly_limit: Option<i64>,
11564    #[serde(default, skip_serializing_if = "Option::is_none")]
11565    pub daily_limit: Option<i64>,
11566}
11567
11568/// `GetMediaUsageResponseVideos` model.
11569#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11570pub struct GetMediaUsageResponseVideos {
11571    #[serde(default, skip_serializing_if = "Option::is_none")]
11572    pub monthly_used: Option<i64>,
11573    #[serde(default, skip_serializing_if = "Option::is_none")]
11574    pub monthly_limit: Option<i64>,
11575}
11576
11577/// `GetMemoriesByEntityResponse` model.
11578#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11579pub struct GetMemoriesByEntityResponse {
11580    #[serde(default, skip_serializing_if = "Option::is_none")]
11581    pub items: Option<Vec<MemoryEntry>>,
11582}
11583
11584/// `GetMeResponse` model.
11585#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11586pub struct GetMeResponse {
11587    #[serde(default, skip_serializing_if = "Option::is_none")]
11588    pub user: Option<GetMeResponseUser>,
11589    pub tenant: GetMeResponseTenant,
11590    pub role: String,
11591    pub scopes: Vec<String>,
11592    pub auth_method: GetMeResponseAuthMethod,
11593    pub memberships: Vec<GetMeResponseMembership>,
11594}
11595
11596/// `GetMeResponseAuthMethod` enumeration.
11597#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11598pub enum GetMeResponseAuthMethod {
11599    #[default]
11600    #[serde(rename = "api_key")]
11601    APIKey,
11602    #[serde(rename = "cookie")]
11603    Cookie,
11604    #[serde(rename = "jwt")]
11605    JWT,
11606    /// A value the API introduced after this SDK was generated.
11607    #[serde(untagged)]
11608    Other(String),
11609}
11610
11611impl GetMeResponseAuthMethod {
11612    /// The value as it appears on the wire.
11613    pub fn as_str(&self) -> &str {
11614        match self {
11615            Self::APIKey => "api_key",
11616            Self::Cookie => "cookie",
11617            Self::JWT => "jwt",
11618            Self::Other(value) => value.as_str(),
11619        }
11620    }
11621}
11622
11623impl std::fmt::Display for GetMeResponseAuthMethod {
11624    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11625        f.write_str(self.as_str())
11626    }
11627}
11628
11629impl From<&str> for GetMeResponseAuthMethod {
11630    fn from(value: &str) -> Self {
11631        match value {
11632            "api_key" => Self::APIKey,
11633            "cookie" => Self::Cookie,
11634            "jwt" => Self::JWT,
11635            other => Self::Other(other.to_string()),
11636        }
11637    }
11638}
11639
11640/// `GetMeResponseMembership` model.
11641#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11642pub struct GetMeResponseMembership {
11643    #[serde(default, skip_serializing_if = "Option::is_none")]
11644    pub tenant_id: Option<String>,
11645    #[serde(default, skip_serializing_if = "Option::is_none")]
11646    pub user_id: Option<String>,
11647}
11648
11649/// `GetMeResponseTenant` model.
11650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11651pub struct GetMeResponseTenant {
11652    pub tenant_id: String,
11653    pub name: String,
11654    pub slug: String,
11655    pub plan: String,
11656}
11657
11658/// `GetMeResponseUser` model.
11659#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11660pub struct GetMeResponseUser {
11661    #[serde(default, skip_serializing_if = "Option::is_none")]
11662    pub user_id: Option<String>,
11663    #[serde(default, skip_serializing_if = "Option::is_none")]
11664    pub email: Option<String>,
11665    #[serde(default, skip_serializing_if = "Option::is_none")]
11666    pub name: Option<String>,
11667    #[serde(default, skip_serializing_if = "Option::is_none")]
11668    pub role: Option<String>,
11669    #[serde(default, skip_serializing_if = "Option::is_none")]
11670    pub status: Option<String>,
11671    #[serde(default, skip_serializing_if = "Option::is_none")]
11672    pub avatar_url: Option<String>,
11673    #[serde(default, skip_serializing_if = "Option::is_none")]
11674    pub last_login_at: Option<String>,
11675    #[serde(default, skip_serializing_if = "Option::is_none")]
11676    pub created_at: Option<String>,
11677}
11678
11679/// `GetMfaStatusResponse` model.
11680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11681pub struct GetMfaStatusResponse {
11682    pub enrolled: bool,
11683    pub recovery_remaining: i64,
11684}
11685
11686/// `GetMyHeadAgentTemplateResponse` model.
11687#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11688pub struct GetMyHeadAgentTemplateResponse {
11689    pub plan: String,
11690    pub recommended: GetMyHeadAgentTemplateResponseRecommended,
11691    pub tiers: Vec<GetMyHeadAgentTemplateResponseTier>,
11692}
11693
11694/// `GetMyHeadAgentTemplateResponseRecommended` enumeration.
11695#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11696pub enum GetMyHeadAgentTemplateResponseRecommended {
11697    #[default]
11698    #[serde(rename = "basic")]
11699    Basic,
11700    #[serde(rename = "standard")]
11701    Standard,
11702    #[serde(rename = "full")]
11703    Full,
11704    /// A value the API introduced after this SDK was generated.
11705    #[serde(untagged)]
11706    Other(String),
11707}
11708
11709impl GetMyHeadAgentTemplateResponseRecommended {
11710    /// The value as it appears on the wire.
11711    pub fn as_str(&self) -> &str {
11712        match self {
11713            Self::Basic => "basic",
11714            Self::Standard => "standard",
11715            Self::Full => "full",
11716            Self::Other(value) => value.as_str(),
11717        }
11718    }
11719}
11720
11721impl std::fmt::Display for GetMyHeadAgentTemplateResponseRecommended {
11722    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11723        f.write_str(self.as_str())
11724    }
11725}
11726
11727impl From<&str> for GetMyHeadAgentTemplateResponseRecommended {
11728    fn from(value: &str) -> Self {
11729        match value {
11730            "basic" => Self::Basic,
11731            "standard" => Self::Standard,
11732            "full" => Self::Full,
11733            other => Self::Other(other.to_string()),
11734        }
11735    }
11736}
11737
11738/// `GetMyHeadAgentTemplateResponseTier` model.
11739#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11740pub struct GetMyHeadAgentTemplateResponseTier {
11741    #[serde(default, skip_serializing_if = "Option::is_none")]
11742    pub tier: Option<GetMyHeadAgentTemplateResponseTierTier>,
11743    #[serde(default, skip_serializing_if = "Option::is_none")]
11744    pub available: Option<bool>,
11745    #[serde(default, skip_serializing_if = "Option::is_none")]
11746    pub install_specs: Option<Vec<GetMyHeadAgentTemplateResponseTierInstallSpec>>,
11747    #[serde(default, skip_serializing_if = "Option::is_none")]
11748    pub auto_approve_tools: Option<Vec<String>>,
11749    #[serde(default, skip_serializing_if = "Option::is_none")]
11750    pub total_tool_count: Option<i64>,
11751}
11752
11753/// `GetMyHeadAgentTemplateResponseTierInstallSpec` model.
11754#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11755pub struct GetMyHeadAgentTemplateResponseTierInstallSpec {
11756    pub spec_id: String,
11757}
11758
11759/// `GetMyHeadAgentTemplateResponseTierTier` model.
11760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11761pub struct GetMyHeadAgentTemplateResponseTierTier {
11762    #[serde(default, skip_serializing_if = "Option::is_none")]
11763    pub id: Option<GetMyHeadAgentTemplateResponseRecommended>,
11764    #[serde(default, skip_serializing_if = "Option::is_none")]
11765    pub name: Option<String>,
11766    #[serde(default, skip_serializing_if = "Option::is_none")]
11767    pub description: Option<String>,
11768    #[serde(default, skip_serializing_if = "Option::is_none")]
11769    pub required_plan: Option<GetMyHeadAgentTemplateResponseTierTierRequiredPlan>,
11770    #[serde(default, skip_serializing_if = "Option::is_none")]
11771    pub spec_ids: Option<Vec<String>>,
11772}
11773
11774/// `GetMyHeadAgentTemplateResponseTierTierRequiredPlan` enumeration.
11775#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11776pub enum GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
11777    #[default]
11778    #[serde(rename = "free")]
11779    Free,
11780    #[serde(rename = "starter")]
11781    Starter,
11782    #[serde(rename = "pro")]
11783    Pro,
11784    /// A value the API introduced after this SDK was generated.
11785    #[serde(untagged)]
11786    Other(String),
11787}
11788
11789impl GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
11790    /// The value as it appears on the wire.
11791    pub fn as_str(&self) -> &str {
11792        match self {
11793            Self::Free => "free",
11794            Self::Starter => "starter",
11795            Self::Pro => "pro",
11796            Self::Other(value) => value.as_str(),
11797        }
11798    }
11799}
11800
11801impl std::fmt::Display for GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
11802    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11803        f.write_str(self.as_str())
11804    }
11805}
11806
11807impl From<&str> for GetMyHeadAgentTemplateResponseTierTierRequiredPlan {
11808    fn from(value: &str) -> Self {
11809        match value {
11810            "free" => Self::Free,
11811            "starter" => Self::Starter,
11812            "pro" => Self::Pro,
11813            other => Self::Other(other.to_string()),
11814        }
11815    }
11816}
11817
11818/// `GetPromoStateResponse` model.
11819#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11820pub struct GetPromoStateResponse {
11821    #[serde(default)]
11822    pub applied_code: Option<GetPromoStateResponseAppliedCode>,
11823    pub bonus_tokens_balance: i64,
11824    /// Codes this tenant OWNS (it is the referrer), with their reward totals. Empty for everyone
11825    /// else.
11826    pub owned_codes: Vec<GetPromoStateResponseOwnedCode>,
11827}
11828
11829/// `GetPromoStateResponseAppliedCode` model.
11830#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11831pub struct GetPromoStateResponseAppliedCode {
11832    #[serde(default, skip_serializing_if = "Option::is_none")]
11833    pub code: Option<String>,
11834    #[serde(default, skip_serializing_if = "Option::is_none")]
11835    pub redeemed_at: Option<String>,
11836    #[serde(default, skip_serializing_if = "Option::is_none")]
11837    pub discount_percent: Option<f64>,
11838    #[serde(default, skip_serializing_if = "Option::is_none")]
11839    pub rewarded: Option<bool>,
11840}
11841
11842/// `GetPromoStateResponseOwnedCode` model.
11843#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11844pub struct GetPromoStateResponseOwnedCode {
11845    #[serde(default, skip_serializing_if = "Option::is_none")]
11846    pub code: Option<String>,
11847    #[serde(default, skip_serializing_if = "Option::is_none")]
11848    pub program: Option<String>,
11849    #[serde(default, skip_serializing_if = "Option::is_none")]
11850    pub active: Option<bool>,
11851    #[serde(default, skip_serializing_if = "Option::is_none")]
11852    pub uses: Option<i64>,
11853    #[serde(default, skip_serializing_if = "Option::is_none")]
11854    pub max_uses: Option<i64>,
11855    #[serde(default, skip_serializing_if = "Option::is_none")]
11856    pub reward_tokens_per_subscription: Option<i64>,
11857    #[serde(default, skip_serializing_if = "Option::is_none")]
11858    pub subscriber_bonus_tokens: Option<i64>,
11859    #[serde(default, skip_serializing_if = "Option::is_none")]
11860    pub discount_percent: Option<f64>,
11861    #[serde(default, skip_serializing_if = "Option::is_none")]
11862    pub total_rewarded_tokens: Option<i64>,
11863    #[serde(default, skip_serializing_if = "Option::is_none")]
11864    pub rewarded_subscriptions: Option<i64>,
11865}
11866
11867/// `GetPublicBlogPostResponse` model.
11868#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11869pub struct GetPublicBlogPostResponse {
11870    pub post: PublicBlogPost,
11871}
11872
11873/// `GetPublicFeaturedAgentResponse` model.
11874#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11875pub struct GetPublicFeaturedAgentResponse {
11876    #[serde(default, skip_serializing_if = "Option::is_none")]
11877    pub agent: Option<serde_json::Map<String, serde_json::Value>>,
11878}
11879
11880/// `GetPublicStateResponse` model.
11881#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11882pub struct GetPublicStateResponse {
11883    #[serde(default, skip_serializing_if = "Option::is_none")]
11884    pub marketplace: Option<serde_json::Map<String, serde_json::Value>>,
11885    #[serde(default, skip_serializing_if = "Option::is_none")]
11886    pub governance: Option<serde_json::Map<String, serde_json::Value>>,
11887    #[serde(default, skip_serializing_if = "Option::is_none")]
11888    pub plan: Option<String>,
11889    #[serde(default, skip_serializing_if = "Option::is_none")]
11890    pub branding: Option<serde_json::Map<String, serde_json::Value>>,
11891    pub category: String,
11892    #[serde(default, skip_serializing_if = "Option::is_none")]
11893    pub description: Option<String>,
11894    #[serde(default, skip_serializing_if = "Option::is_none")]
11895    pub logo_url: Option<String>,
11896    pub name: String,
11897    #[serde(default, skip_serializing_if = "Option::is_none")]
11898    pub published_at: Option<String>,
11899    pub short_description: String,
11900    pub slug: String,
11901    #[serde(default, skip_serializing_if = "Option::is_none")]
11902    pub social_links: Option<TenantSocialLinks>,
11903    #[serde(default, skip_serializing_if = "Option::is_none")]
11904    pub stats: Option<serde_json::Map<String, serde_json::Value>>,
11905    pub tags: Vec<String>,
11906    pub tenant_id: String,
11907    /// Only this route joins the state's agents (public.ts); the list does not carry them.
11908    pub agents: Vec<PublicStateAgent>,
11909}
11910
11911/// `GetReadyResponse` model.
11912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11913pub struct GetReadyResponse {
11914    #[serde(default, skip_serializing_if = "Option::is_none")]
11915    pub status: Option<GetReadyResponseStatus>,
11916    #[serde(default, skip_serializing_if = "Option::is_none")]
11917    pub timestamp: Option<String>,
11918    #[serde(default, skip_serializing_if = "Option::is_none")]
11919    pub checks: Option<GetReadyResponseChecks>,
11920}
11921
11922/// `GetReadyResponseChecks` model.
11923#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11924pub struct GetReadyResponseChecks {
11925    #[serde(default, skip_serializing_if = "Option::is_none")]
11926    pub kv: Option<String>,
11927}
11928
11929/// `GetReadyResponseStatus` enumeration.
11930#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
11931pub enum GetReadyResponseStatus {
11932    #[default]
11933    #[serde(rename = "ready")]
11934    Ready,
11935    #[serde(rename = "not_ready")]
11936    NotReady,
11937    /// A value the API introduced after this SDK was generated.
11938    #[serde(untagged)]
11939    Other(String),
11940}
11941
11942impl GetReadyResponseStatus {
11943    /// The value as it appears on the wire.
11944    pub fn as_str(&self) -> &str {
11945        match self {
11946            Self::Ready => "ready",
11947            Self::NotReady => "not_ready",
11948            Self::Other(value) => value.as_str(),
11949        }
11950    }
11951}
11952
11953impl std::fmt::Display for GetReadyResponseStatus {
11954    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11955        f.write_str(self.as_str())
11956    }
11957}
11958
11959impl From<&str> for GetReadyResponseStatus {
11960    fn from(value: &str) -> Self {
11961        match value {
11962            "ready" => Self::Ready,
11963            "not_ready" => Self::NotReady,
11964            other => Self::Other(other.to_string()),
11965        }
11966    }
11967}
11968
11969/// `GetReconciliationResponse` model.
11970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11971pub struct GetReconciliationResponse {
11972    #[serde(default)]
11973    pub reconciliation: Option<CostReconciliationResult>,
11974    pub period: String,
11975    /// Only when there is no result for the period.
11976    #[serde(default, skip_serializing_if = "Option::is_none")]
11977    pub message: Option<String>,
11978}
11979
11980/// `GetRegistrationStatusResponse` model.
11981#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11982pub struct GetRegistrationStatusResponse {
11983    pub registration_open: bool,
11984}
11985
11986/// `GetResponseResponse` model.
11987#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11988pub struct GetResponseResponse {
11989    pub id: String,
11990    pub object: GetResponseResponseObject,
11991    pub output: Vec<GetResponseResponseOutputItem>,
11992    pub usage: GetResponseResponseUsage,
11993    /// The agent id.
11994    pub model: String,
11995    /// Unix seconds.
11996    pub created_at: i64,
11997}
11998
11999/// `GetResponseResponseObject` enumeration.
12000#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12001pub enum GetResponseResponseObject {
12002    #[default]
12003    #[serde(rename = "response")]
12004    Response,
12005    /// A value the API introduced after this SDK was generated.
12006    #[serde(untagged)]
12007    Other(String),
12008}
12009
12010impl GetResponseResponseObject {
12011    /// The value as it appears on the wire.
12012    pub fn as_str(&self) -> &str {
12013        match self {
12014            Self::Response => "response",
12015            Self::Other(value) => value.as_str(),
12016        }
12017    }
12018}
12019
12020impl std::fmt::Display for GetResponseResponseObject {
12021    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12022        f.write_str(self.as_str())
12023    }
12024}
12025
12026impl From<&str> for GetResponseResponseObject {
12027    fn from(value: &str) -> Self {
12028        match value {
12029            "response" => Self::Response,
12030            other => Self::Other(other.to_string()),
12031        }
12032    }
12033}
12034
12035/// `GetResponseResponseOutputItem` model.
12036#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12037pub struct GetResponseResponseOutputItem {
12038    pub r#type: ResponsesOutputItemType,
12039    pub role: OpenAiChatCompletionChoiceMessageRole,
12040    pub content: Vec<GetResponseResponseOutputItemContentItem>,
12041}
12042
12043/// `GetResponseResponseOutputItemContentItem` model.
12044#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12045pub struct GetResponseResponseOutputItemContentItem {
12046    pub r#type: ResponsesOutputItemContentItemType,
12047    pub text: String,
12048}
12049
12050/// `GetResponseResponseUsage` model.
12051#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12052pub struct GetResponseResponseUsage {
12053    pub input_tokens: i64,
12054    pub output_tokens: i64,
12055    pub total_tokens: i64,
12056}
12057
12058/// `GetRootAgentResponse` model.
12059#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12060pub struct GetRootAgentResponse {
12061    /// Designated root agent, or null when none is set.
12062    #[serde(default)]
12063    pub root_agent_id: Option<String>,
12064}
12065
12066/// `GetRunAuditLogResponse` model.
12067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12068pub struct GetRunAuditLogResponse {
12069    pub run_id: String,
12070    pub audit_log: Vec<AuditLogEntry>,
12071    pub total: i64,
12072}
12073
12074/// `GetRunChangedFiles` enumeration.
12075#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12076pub enum GetRunChangedFiles {
12077    #[default]
12078    #[serde(rename = "true")]
12079    True,
12080    /// A value the API introduced after this SDK was generated.
12081    #[serde(untagged)]
12082    Other(String),
12083}
12084
12085impl GetRunChangedFiles {
12086    /// The value as it appears on the wire.
12087    pub fn as_str(&self) -> &str {
12088        match self {
12089            Self::True => "true",
12090            Self::Other(value) => value.as_str(),
12091        }
12092    }
12093}
12094
12095impl std::fmt::Display for GetRunChangedFiles {
12096    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12097        f.write_str(self.as_str())
12098    }
12099}
12100
12101impl From<&str> for GetRunChangedFiles {
12102    fn from(value: &str) -> Self {
12103        match value {
12104            "true" => Self::True,
12105            other => Self::Other(other.to_string()),
12106        }
12107    }
12108}
12109
12110/// `GetRunQueuePositionResponse` model.
12111#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12112pub struct GetRunQueuePositionResponse {
12113    #[serde(default, skip_serializing_if = "Option::is_none")]
12114    pub run_id: Option<String>,
12115    /// 0 means not in queue or currently running
12116    #[serde(default, skip_serializing_if = "Option::is_none")]
12117    pub queue_position: Option<i64>,
12118}
12119
12120/// `GetRunResponse` model.
12121#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12122pub struct GetRunResponse {
12123    /// Absent for platform-dispatched cloud runs. `bridge` is written by the platform when a local
12124    /// agent takes the run (run-dispatch.ts, bridge.ts); `async` is only ever an echo of a
12125    /// client-supplied value and has never been stored on production (measured 2026-09-10 over 8605
12126    /// run records: absent 7738, bridge 867, async 0).
12127    #[serde(default, skip_serializing_if = "Option::is_none")]
12128    pub execution_mode: Option<RunExecutionMode>,
12129    pub run_id: String,
12130    pub tenant_id: String,
12131    pub agent_id: String,
12132    #[serde(default, skip_serializing_if = "Option::is_none")]
12133    pub session_id: Option<String>,
12134    pub status: RunStatus,
12135    #[serde(default, skip_serializing_if = "Option::is_none")]
12136    pub input: Option<serde_json::Map<String, serde_json::Value>>,
12137    /// Run output — the same object rides in run events and in a public session's stream
12138    /// (RunOutput). When a run is truncated by its step-budget cutoff (output.truncated === true)
12139    /// AND the platform has UARP_CONTINUATION_TOKEN_KEY configured, output.continuation_token
12140    /// carries an opaque HMAC-signed token that resumes the run via POST /runs/{id}/continue. With
12141    /// no key configured no token is minted and the field is absent; the token is an opaque string
12142    /// to every client.
12143    #[serde(default, skip_serializing_if = "Option::is_none")]
12144    pub output: Option<RunOutput>,
12145    #[serde(default, skip_serializing_if = "Option::is_none")]
12146    pub metrics: Option<RunMetrics>,
12147    /// The sentence a person reads. English on every deployment — nothing here varies by
12148    /// `Accept-Language` — so branch on `error_code`, not on this.
12149    #[serde(default, skip_serializing_if = "Option::is_none")]
12150    pub error: Option<String>,
12151    /// Why the run failed, as a value from the `code` dictionary (see the `Error` schema's enum).
12152    /// Absent when the failure carries nothing a client can branch on — which is deliberate: a code
12153    /// meaning "something went wrong" would be worse than none. Populated since 2026-09-21; before
12154    /// that a client had to regex-test `error`. `approval_rejected` (since 2026-09-22) means a
12155    /// person refused the tool call the run was waiting on — `status` is still `failed`, and
12156    /// `error` is the reviewer's own reason.
12157    #[serde(default, skip_serializing_if = "Option::is_none")]
12158    pub error_code: Option<String>,
12159    /// Numbers the code cannot carry: `retry_after_ms` with `provider_circuit_open`,
12160    /// `quota_exhausted` with `provider_rate_limited`, `stale_seconds` with `run_input_timeout`.
12161    /// Never a provider id — this reaches a screen, and the product does not name the model it
12162    /// picked.
12163    #[serde(default, skip_serializing_if = "Option::is_none")]
12164    pub error_details: Option<serde_json::Map<String, serde_json::Value>>,
12165    /// Every human decision on a tool approval this run waited for, oldest first. Absent when the
12166    /// run never waited for one. Recorded since 2026-09-22; before that an approved call left no
12167    /// trace on the run.
12168    #[serde(default, skip_serializing_if = "Option::is_none")]
12169    pub approvals: Option<Vec<GetRunResponseApproval>>,
12170    pub created_at: String,
12171    #[serde(default, skip_serializing_if = "Option::is_none")]
12172    pub started_at: Option<String>,
12173    #[serde(default, skip_serializing_if = "Option::is_none")]
12174    pub completed_at: Option<String>,
12175    /// Team run ID if part of a team execution
12176    #[serde(default, skip_serializing_if = "Option::is_none")]
12177    pub team_run_id: Option<String>,
12178    /// User-supplied metadata
12179    #[serde(default, skip_serializing_if = "Option::is_none")]
12180    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
12181    /// Current step sequence number
12182    #[serde(default, skip_serializing_if = "Option::is_none")]
12183    pub step_seq: Option<i64>,
12184    /// Run artifacts
12185    #[serde(default, skip_serializing_if = "Option::is_none")]
12186    pub artifacts: Option<Vec<Artifact>>,
12187    /// Resource limits for the run
12188    #[serde(default, skip_serializing_if = "Option::is_none")]
12189    pub resource_limits: Option<GetRunResponseResourceLimits>,
12190    /// Workspace paths this run WROTE, sorted, present only when the request carries
12191    /// `?changed_files=true`. Recorded per (run, path) at write time, so a file rewritten three
12192    /// times appears once and two concurrent tool calls cannot lose one another's entry.
12193    ///
12194    /// It is a record of writes, not a diff: a path the run DELETED or moved is not here, and
12195    /// neither is a change made by something else while the run was going. Recording is best-effort
12196    /// after the write has already succeeded — a failure to record is logged and leaves the list
12197    /// short rather than failing the edit — so treat it as "at least these" rather than proof that
12198    /// nothing else changed. Capped at 500 paths. Rows expire 30 days after the run.
12199    #[serde(default, skip_serializing_if = "Option::is_none")]
12200    pub changed_files: Option<Vec<String>>,
12201    /// Tool calls the run is blocked on, taken from the most recent `run.awaiting_approval` event.
12202    /// ABSENT — not empty — when the run is not awaiting approval, and absent too if the scan
12203    /// fails, which is deliberate: a failed scan must not turn a readable run into an error.
12204    #[serde(default, skip_serializing_if = "Option::is_none")]
12205    pub pending_approvals: Option<Vec<PendingApproval>>,
12206    /// The question the run is blocked on, taken from the most recent `run.awaiting_input` event
12207    /// (runs.ts:673-681). Like `pending_approvals` it is ABSENT rather than empty when the run is
12208    /// not awaiting input. A squad chat reads this to render the prompt; the document never
12209    /// mentioned it, so a client written from the document alone showed a blocked run as merely
12210    /// running.
12211    #[serde(default, skip_serializing_if = "Option::is_none")]
12212    pub pending_input: Option<GetRunResponsePendingInput>,
12213}
12214
12215/// `GetRunResponseApproval` model.
12216#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12217pub struct GetRunResponseApproval {
12218    pub decision: RunApprovalDecision,
12219    /// Tools the run was waiting on when the decision was made.
12220    pub tools: Vec<String>,
12221    pub decided_at: String,
12222    /// User id of the person who decided; the credential id when no person stands behind it.
12223    #[serde(default, skip_serializing_if = "Option::is_none")]
12224    pub decided_by: Option<String>,
12225    /// The reviewer's reason, on a rejection.
12226    #[serde(default, skip_serializing_if = "Option::is_none")]
12227    pub reason: Option<String>,
12228}
12229
12230/// The question the run is blocked on, taken from the most recent `run.awaiting_input` event
12231/// (runs.ts:673-681). Like `pending_approvals` it is ABSENT rather than empty when the run is
12232/// not awaiting input. A squad chat reads this to render the prompt; the document never
12233/// mentioned it, so a client written from the document alone showed a blocked run as merely
12234/// running.
12235#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12236pub struct GetRunResponsePendingInput {
12237    #[serde(default, skip_serializing_if = "Option::is_none")]
12238    pub question: Option<String>,
12239    #[serde(default, skip_serializing_if = "Option::is_none")]
12240    pub context: Option<String>,
12241    #[serde(default, skip_serializing_if = "Option::is_none")]
12242    pub tool_call_id: Option<String>,
12243    #[serde(default, skip_serializing_if = "Option::is_none")]
12244    pub options: Option<Vec<String>>,
12245}
12246
12247/// Resource limits for the run
12248#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12249pub struct GetRunResponseResourceLimits {
12250    #[serde(default, skip_serializing_if = "Option::is_none")]
12251    pub max_duration_ms: Option<i64>,
12252    #[serde(default, skip_serializing_if = "Option::is_none")]
12253    pub max_steps: Option<i64>,
12254    #[serde(default, skip_serializing_if = "Option::is_none")]
12255    pub max_tool_calls: Option<i64>,
12256    #[serde(default, skip_serializing_if = "Option::is_none")]
12257    pub max_tokens_per_run: Option<i64>,
12258}
12259
12260/// `GetRunStepsResponse` model.
12261#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12262pub struct GetRunStepsResponse {
12263    pub steps: Vec<RunStep>,
12264    pub total: i64,
12265}
12266
12267/// `GetRuntimeConfigResponse` model.
12268#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12269pub struct GetRuntimeConfigResponse {
12270    #[serde(default, skip_serializing_if = "Option::is_none")]
12271    pub runtime: Option<serde_json::Map<String, serde_json::Value>>,
12272}
12273
12274/// `GetSessionAuditLogResponse` model.
12275#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12276pub struct GetSessionAuditLogResponse {
12277    pub session_id: String,
12278    pub audit_log: Vec<AuditLogEntry>,
12279    pub total: i64,
12280}
12281
12282/// `GetSessionMessagesResponse` model.
12283#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12284pub struct GetSessionMessagesResponse {
12285    /// The transcript; the key clients read first. `items` is the Wave 7.2 list alias of the same
12286    /// array.
12287    pub messages: Vec<ConversationEntry>,
12288    /// The same list as `messages` — the canonical list key (Wave 7.2); both are served so no
12289    /// client moves.
12290    pub items: Vec<ConversationEntry>,
12291    pub total: i64,
12292    #[serde(default, skip_serializing_if = "Option::is_none")]
12293    pub active_run_id: Option<String>,
12294    #[serde(default, skip_serializing_if = "Option::is_none")]
12295    pub active_run_status: Option<String>,
12296    #[serde(default, skip_serializing_if = "Option::is_none")]
12297    pub active_run_partial_content: Option<String>,
12298}
12299
12300/// `GetSessionShareResponse` model.
12301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12302pub struct GetSessionShareResponse {
12303    #[serde(default, skip_serializing_if = "Option::is_none")]
12304    pub share_url: Option<String>,
12305    #[serde(default, skip_serializing_if = "Option::is_none")]
12306    pub role: Option<String>,
12307    #[serde(default, skip_serializing_if = "Option::is_none")]
12308    pub expires_at: Option<String>,
12309}
12310
12311/// `GetSquadChatHistoryResponse` model.
12312#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12313pub struct GetSquadChatHistoryResponse {
12314    #[serde(default, skip_serializing_if = "Option::is_none")]
12315    pub team_id: Option<String>,
12316    #[serde(default, skip_serializing_if = "Option::is_none")]
12317    pub conversation_history: Option<Vec<TeamChatTurn>>,
12318    #[serde(default, skip_serializing_if = "Option::is_none")]
12319    pub total: Option<i64>,
12320    #[serde(default, skip_serializing_if = "Option::is_none")]
12321    pub chat_state: Option<serde_json::Map<String, serde_json::Value>>,
12322}
12323
12324/// `GetSquadGraphResponse` model.
12325#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12326pub struct GetSquadGraphResponse {
12327    #[serde(default, skip_serializing_if = "Option::is_none")]
12328    pub nodes: Option<Vec<TeamGraphNode>>,
12329    #[serde(default, skip_serializing_if = "Option::is_none")]
12330    pub edges: Option<Vec<TeamGraphEdge>>,
12331}
12332
12333/// `GetSquadRunMessagesResponse` model.
12334#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12335pub struct GetSquadRunMessagesResponse {
12336    pub team_id: String,
12337    pub team_run_id: String,
12338    pub messages: Vec<TeamRunChatTurn>,
12339    pub protocol_messages: Vec<TeamMessage>,
12340    pub total: i64,
12341}
12342
12343/// `GetTeamChatHistoryResponse` model.
12344#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12345pub struct GetTeamChatHistoryResponse {
12346    #[serde(default, skip_serializing_if = "Option::is_none")]
12347    pub team_id: Option<String>,
12348    #[serde(default, skip_serializing_if = "Option::is_none")]
12349    pub conversation_history: Option<Vec<TeamChatTurn>>,
12350    #[serde(default, skip_serializing_if = "Option::is_none")]
12351    pub total: Option<i64>,
12352    #[serde(default, skip_serializing_if = "Option::is_none")]
12353    pub chat_state: Option<serde_json::Map<String, serde_json::Value>>,
12354}
12355
12356/// `GetTeamGraphResponse` model.
12357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12358pub struct GetTeamGraphResponse {
12359    #[serde(default, skip_serializing_if = "Option::is_none")]
12360    pub nodes: Option<Vec<TeamGraphNode>>,
12361    #[serde(default, skip_serializing_if = "Option::is_none")]
12362    pub edges: Option<Vec<TeamGraphEdge>>,
12363}
12364
12365/// `GetTeamRunMessagesResponse` model.
12366#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12367pub struct GetTeamRunMessagesResponse {
12368    pub team_id: String,
12369    pub team_run_id: String,
12370    pub messages: Vec<TeamRunChatTurn>,
12371    pub protocol_messages: Vec<TeamMessage>,
12372    pub total: i64,
12373}
12374
12375/// `GetTenantDomainHealthResponse` model.
12376#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12377pub struct GetTenantDomainHealthResponse {
12378    /// Hostname only — no scheme, no path.
12379    pub domain: String,
12380    pub created_at: String,
12381    #[serde(default, skip_serializing_if = "Option::is_none")]
12382    pub updated_at: Option<String>,
12383    #[serde(default, skip_serializing_if = "Option::is_none")]
12384    pub dns: Option<DomainDnsLifecycle>,
12385    #[serde(default, skip_serializing_if = "Option::is_none")]
12386    pub cert: Option<DomainCertLifecycle>,
12387}
12388
12389/// `GetTenantUsageResponse` model.
12390#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12391pub struct GetTenantUsageResponse {
12392    #[serde(default, skip_serializing_if = "Option::is_none")]
12393    pub tenant_id: Option<String>,
12394    #[serde(default, skip_serializing_if = "Option::is_none")]
12395    pub period: Option<String>,
12396    #[serde(default, skip_serializing_if = "Option::is_none")]
12397    pub usage: Option<serde_json::Map<String, serde_json::Value>>,
12398}
12399
12400/// `GetUnreadCountResponse` model.
12401#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12402pub struct GetUnreadCountResponse {
12403    pub count: i64,
12404    pub unread_count: i64,
12405    /// Deprecated spelling of `unread_count` — the same value, kept for the compatibility window
12406    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
12407    /// `unread_count`.
12408    #[serde(rename = "unreadCount")]
12409    pub unread_count_: i64,
12410}
12411
12412/// `GetUsageTimeseriesMetric` enumeration.
12413#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12414pub enum GetUsageTimeseriesMetric {
12415    #[default]
12416    #[serde(rename = "runs")]
12417    Runs,
12418    #[serde(rename = "tokens")]
12419    Tokens,
12420    #[serde(rename = "cost")]
12421    Cost,
12422    /// A value the API introduced after this SDK was generated.
12423    #[serde(untagged)]
12424    Other(String),
12425}
12426
12427impl GetUsageTimeseriesMetric {
12428    /// The value as it appears on the wire.
12429    pub fn as_str(&self) -> &str {
12430        match self {
12431            Self::Runs => "runs",
12432            Self::Tokens => "tokens",
12433            Self::Cost => "cost",
12434            Self::Other(value) => value.as_str(),
12435        }
12436    }
12437}
12438
12439impl std::fmt::Display for GetUsageTimeseriesMetric {
12440    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12441        f.write_str(self.as_str())
12442    }
12443}
12444
12445impl From<&str> for GetUsageTimeseriesMetric {
12446    fn from(value: &str) -> Self {
12447        match value {
12448            "runs" => Self::Runs,
12449            "tokens" => Self::Tokens,
12450            "cost" => Self::Cost,
12451            other => Self::Other(other.to_string()),
12452        }
12453    }
12454}
12455
12456/// `GetUsageTimeseriesResponse` model.
12457#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12458pub struct GetUsageTimeseriesResponse {
12459    #[serde(default, skip_serializing_if = "Option::is_none")]
12460    pub plan: Option<String>,
12461    #[serde(default, skip_serializing_if = "Option::is_none")]
12462    pub data: Option<Vec<GetUsageTimeseriesResponseDataItem>>,
12463}
12464
12465/// `GetUsageTimeseriesResponseDataItem` model.
12466#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12467pub struct GetUsageTimeseriesResponseDataItem {
12468    /// The bucket's label — `M/D` in UTC without padding (`8/28`), not a date or an instant
12469    /// (usage-tracker.ts getTimeseries; measured 2026-09-10). Do not parse it as a Date.
12470    pub label: String,
12471    pub value: f64,
12472}
12473
12474/// `Goal` model.
12475#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12476pub struct Goal {
12477    pub goal_id: String,
12478    pub tenant_id: String,
12479    pub agent_id: String,
12480    #[serde(default, skip_serializing_if = "Option::is_none")]
12481    pub title: Option<String>,
12482    #[serde(default, skip_serializing_if = "Option::is_none")]
12483    pub description: Option<String>,
12484    #[serde(default, skip_serializing_if = "Option::is_none")]
12485    pub rationale: Option<String>,
12486    /// How the goal squares with the constitution — written by the formulating agent.
12487    #[serde(default, skip_serializing_if = "Option::is_none")]
12488    pub alignment_justification: Option<String>,
12489    #[serde(default, skip_serializing_if = "Option::is_none")]
12490    pub expected_impact: Option<String>,
12491    #[serde(default, skip_serializing_if = "Option::is_none")]
12492    pub resource_estimate_usd: Option<f64>,
12493    pub status: GoalStatus,
12494    /// Set once the goal reaches a vote. Absent before that.
12495    #[serde(default, skip_serializing_if = "Option::is_none")]
12496    pub proposal_id: Option<String>,
12497    #[serde(default, skip_serializing_if = "Option::is_none")]
12498    pub constitution_check_passed: Option<bool>,
12499    pub created_at: String,
12500    #[serde(default, skip_serializing_if = "Option::is_none")]
12501    pub updated_at: Option<String>,
12502}
12503
12504/// `GoalStatus` enumeration.
12505#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12506pub enum GoalStatus {
12507    #[default]
12508    #[serde(rename = "proposed")]
12509    Proposed,
12510    #[serde(rename = "checking")]
12511    Checking,
12512    #[serde(rename = "voting")]
12513    Voting,
12514    #[serde(rename = "approved")]
12515    Approved,
12516    #[serde(rename = "rejected")]
12517    Rejected,
12518    #[serde(rename = "active")]
12519    Active,
12520    #[serde(rename = "completed")]
12521    Completed,
12522    /// A value the API introduced after this SDK was generated.
12523    #[serde(untagged)]
12524    Other(String),
12525}
12526
12527impl GoalStatus {
12528    /// The value as it appears on the wire.
12529    pub fn as_str(&self) -> &str {
12530        match self {
12531            Self::Proposed => "proposed",
12532            Self::Checking => "checking",
12533            Self::Voting => "voting",
12534            Self::Approved => "approved",
12535            Self::Rejected => "rejected",
12536            Self::Active => "active",
12537            Self::Completed => "completed",
12538            Self::Other(value) => value.as_str(),
12539        }
12540    }
12541}
12542
12543impl std::fmt::Display for GoalStatus {
12544    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12545        f.write_str(self.as_str())
12546    }
12547}
12548
12549impl From<&str> for GoalStatus {
12550    fn from(value: &str) -> Self {
12551        match value {
12552            "proposed" => Self::Proposed,
12553            "checking" => Self::Checking,
12554            "voting" => Self::Voting,
12555            "approved" => Self::Approved,
12556            "rejected" => Self::Rejected,
12557            "active" => Self::Active,
12558            "completed" => Self::Completed,
12559            other => Self::Other(other.to_string()),
12560        }
12561    }
12562}
12563
12564/// `GoogleOneTapAuthRequest` model.
12565#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12566pub struct GoogleOneTapAuthRequest {
12567    /// Google-signed JWT delivered by `google.accounts.id` to the GSI callback.
12568    pub credential: String,
12569    /// Optional device name surfaced on the minted api_key for `/me/sessions`.
12570    #[serde(default, skip_serializing_if = "Option::is_none")]
12571    pub device_label: Option<String>,
12572}
12573
12574/// `GoogleOneTapAuthResponse` model.
12575#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12576pub struct GoogleOneTapAuthResponse {
12577    pub api_key: String,
12578    pub email: String,
12579}
12580
12581/// `GovernanceLedgerEntry` model.
12582#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12583pub struct GovernanceLedgerEntry {
12584    /// Position in the ONE global chain shared by all tenants — not a per-tenant sequence.
12585    /// Consecutive rows in a tenant's page usually have gaps here; the missing numbers are other
12586    /// tenants' entries (see the /governance/ledger description). For the tenant's own count use
12587    /// `tenant_total` on the list response.
12588    pub seq: i64,
12589    /// What happened, e.g. `run_complete`, `constitution_amended`.
12590    pub action: String,
12591    /// Coarse grouping, e.g. `execution`, `governance`.
12592    #[serde(default, skip_serializing_if = "Option::is_none")]
12593    pub category: Option<String>,
12594    #[serde(default, skip_serializing_if = "Option::is_none")]
12595    pub agent_id: Option<String>,
12596    #[serde(default, skip_serializing_if = "Option::is_none")]
12597    pub tenant_id: Option<String>,
12598    /// Action-specific detail; shape varies by `action`.
12599    #[serde(default, skip_serializing_if = "Option::is_none")]
12600    pub payload: Option<serde_json::Map<String, serde_json::Value>>,
12601    pub timestamp: String,
12602    /// Hash of the preceding entry. Null only for the genesis entry.
12603    #[serde(default)]
12604    pub prev_hash: Option<String>,
12605    pub hash: String,
12606}
12607
12608/// `GovernanceLedgerHead` model.
12609#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12610pub struct GovernanceLedgerHead {
12611    /// Global sequence of the newest ledger entry across ALL tenants — not the newest entry in the
12612    /// accompanying page. Measured 2026-08-20: `head.seq` was 6698 while the last visible entry was
12613    /// 6697, and the gap is another tenant's row. A client must not use this to decide whether it
12614    /// holds the latest page.
12615    pub seq: i64,
12616    pub hash: String,
12617}
12618
12619/// A webhook called before or after a run to allow, redact or block it.
12620#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12621pub struct Guardrail {
12622    pub guardrail_id: String,
12623    pub tenant_id: String,
12624    pub name: String,
12625    pub webhook_url: String,
12626    pub phase: GuardrailConfigItemPhase,
12627    #[serde(default, skip_serializing_if = "Option::is_none")]
12628    pub action: Option<GuardrailAction>,
12629    #[serde(default, skip_serializing_if = "Option::is_none")]
12630    pub timeout_ms: Option<i64>,
12631    #[serde(default, skip_serializing_if = "Option::is_none")]
12632    pub created_at: Option<String>,
12633}
12634
12635/// `GuardrailAction` enumeration.
12636#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12637pub enum GuardrailAction {
12638    #[default]
12639    #[serde(rename = "block")]
12640    Block,
12641    #[serde(rename = "redact")]
12642    Redact,
12643    #[serde(rename = "warn")]
12644    Warn,
12645    #[serde(rename = "log")]
12646    Log,
12647    /// A value the API introduced after this SDK was generated.
12648    #[serde(untagged)]
12649    Other(String),
12650}
12651
12652impl GuardrailAction {
12653    /// The value as it appears on the wire.
12654    pub fn as_str(&self) -> &str {
12655        match self {
12656            Self::Block => "block",
12657            Self::Redact => "redact",
12658            Self::Warn => "warn",
12659            Self::Log => "log",
12660            Self::Other(value) => value.as_str(),
12661        }
12662    }
12663}
12664
12665impl std::fmt::Display for GuardrailAction {
12666    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12667        f.write_str(self.as_str())
12668    }
12669}
12670
12671impl From<&str> for GuardrailAction {
12672    fn from(value: &str) -> Self {
12673        match value {
12674            "block" => Self::Block,
12675            "redact" => Self::Redact,
12676            "warn" => Self::Warn,
12677            "log" => Self::Log,
12678            other => Self::Other(other.to_string()),
12679        }
12680    }
12681}
12682
12683/// admin-config.ts GuardrailConfigItem.
12684#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12685pub struct GuardrailConfigItem {
12686    pub id: String,
12687    pub name: String,
12688    pub description: String,
12689    pub phase: GuardrailConfigItemPhase,
12690    pub default_action: GuardrailConfigItemDefaultAction,
12691    pub enabled: bool,
12692    pub mandatory: bool,
12693    pub source: GuardrailConfigItemSource,
12694}
12695
12696/// `GuardrailConfigItemDefaultAction` enumeration.
12697#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12698pub enum GuardrailConfigItemDefaultAction {
12699    #[default]
12700    #[serde(rename = "block")]
12701    Block,
12702    #[serde(rename = "warn")]
12703    Warn,
12704    #[serde(rename = "redact")]
12705    Redact,
12706    #[serde(rename = "log")]
12707    Log,
12708    /// A value the API introduced after this SDK was generated.
12709    #[serde(untagged)]
12710    Other(String),
12711}
12712
12713impl GuardrailConfigItemDefaultAction {
12714    /// The value as it appears on the wire.
12715    pub fn as_str(&self) -> &str {
12716        match self {
12717            Self::Block => "block",
12718            Self::Warn => "warn",
12719            Self::Redact => "redact",
12720            Self::Log => "log",
12721            Self::Other(value) => value.as_str(),
12722        }
12723    }
12724}
12725
12726impl std::fmt::Display for GuardrailConfigItemDefaultAction {
12727    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12728        f.write_str(self.as_str())
12729    }
12730}
12731
12732impl From<&str> for GuardrailConfigItemDefaultAction {
12733    fn from(value: &str) -> Self {
12734        match value {
12735            "block" => Self::Block,
12736            "warn" => Self::Warn,
12737            "redact" => Self::Redact,
12738            "log" => Self::Log,
12739            other => Self::Other(other.to_string()),
12740        }
12741    }
12742}
12743
12744/// `GuardrailConfigItemPhase` enumeration.
12745#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12746pub enum GuardrailConfigItemPhase {
12747    #[default]
12748    #[serde(rename = "input")]
12749    Input,
12750    #[serde(rename = "output")]
12751    Output,
12752    #[serde(rename = "both")]
12753    Both,
12754    /// A value the API introduced after this SDK was generated.
12755    #[serde(untagged)]
12756    Other(String),
12757}
12758
12759impl GuardrailConfigItemPhase {
12760    /// The value as it appears on the wire.
12761    pub fn as_str(&self) -> &str {
12762        match self {
12763            Self::Input => "input",
12764            Self::Output => "output",
12765            Self::Both => "both",
12766            Self::Other(value) => value.as_str(),
12767        }
12768    }
12769}
12770
12771impl std::fmt::Display for GuardrailConfigItemPhase {
12772    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12773        f.write_str(self.as_str())
12774    }
12775}
12776
12777impl From<&str> for GuardrailConfigItemPhase {
12778    fn from(value: &str) -> Self {
12779        match value {
12780            "input" => Self::Input,
12781            "output" => Self::Output,
12782            "both" => Self::Both,
12783            other => Self::Other(other.to_string()),
12784        }
12785    }
12786}
12787
12788/// `GuardrailConfigItemSource` enumeration.
12789#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12790pub enum GuardrailConfigItemSource {
12791    #[default]
12792    #[serde(rename = "kv")]
12793    Kv,
12794    #[serde(rename = "default")]
12795    Default,
12796    /// A value the API introduced after this SDK was generated.
12797    #[serde(untagged)]
12798    Other(String),
12799}
12800
12801impl GuardrailConfigItemSource {
12802    /// The value as it appears on the wire.
12803    pub fn as_str(&self) -> &str {
12804        match self {
12805            Self::Kv => "kv",
12806            Self::Default => "default",
12807            Self::Other(value) => value.as_str(),
12808        }
12809    }
12810}
12811
12812impl std::fmt::Display for GuardrailConfigItemSource {
12813    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12814        f.write_str(self.as_str())
12815    }
12816}
12817
12818impl From<&str> for GuardrailConfigItemSource {
12819    fn from(value: &str) -> Self {
12820        match value {
12821            "kv" => Self::Kv,
12822            "default" => Self::Default,
12823            other => Self::Other(other.to_string()),
12824        }
12825    }
12826}
12827
12828/// `HandleStripeWebhookRequest` model.
12829#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12830pub struct HandleStripeWebhookRequest {
12831    pub r#type: String,
12832    pub data: serde_json::Map<String, serde_json::Value>,
12833}
12834
12835/// `HandleStripeWebhookResponse` model.
12836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12837pub struct HandleStripeWebhookResponse {
12838    pub received: bool,
12839    pub handled: bool,
12840    #[serde(default, skip_serializing_if = "Option::is_none")]
12841    pub action: Option<String>,
12842    #[serde(default, skip_serializing_if = "Option::is_none")]
12843    pub duplicate: Option<bool>,
12844}
12845
12846/// `HealthCheckV1aliasResponse` model.
12847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12848pub struct HealthCheckV1aliasResponse {
12849    #[serde(default, skip_serializing_if = "Option::is_none")]
12850    pub status: Option<GetHealthResponseStatus>,
12851    #[serde(default, skip_serializing_if = "Option::is_none")]
12852    pub timestamp: Option<String>,
12853    #[serde(default, skip_serializing_if = "Option::is_none")]
12854    pub kv_connected: Option<bool>,
12855    #[serde(default, skip_serializing_if = "Option::is_none")]
12856    pub uptime_seconds: Option<f64>,
12857    #[serde(default, skip_serializing_if = "Option::is_none")]
12858    pub version: Option<String>,
12859    #[serde(default, skip_serializing_if = "Option::is_none")]
12860    pub build_sha: Option<String>,
12861    #[serde(default, skip_serializing_if = "Option::is_none")]
12862    pub pending_resumes: Option<i64>,
12863    #[serde(default, skip_serializing_if = "Option::is_none")]
12864    pub runs_queued: Option<i64>,
12865}
12866
12867/// `HealthLiveResponse` model.
12868#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12869pub struct HealthLiveResponse {
12870    #[serde(default, skip_serializing_if = "Option::is_none")]
12871    pub status: Option<String>,
12872}
12873
12874/// `HealthzAliasResponse` model.
12875#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12876pub struct HealthzAliasResponse {
12877    #[serde(default, skip_serializing_if = "Option::is_none")]
12878    pub status: Option<String>,
12879}
12880
12881/// `HostDroplet` model.
12882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12883pub struct HostDroplet {
12884    pub id: i64,
12885    pub name: String,
12886    pub status: String,
12887    pub region: String,
12888    pub size_slug: String,
12889    pub price_monthly_usd: f64,
12890    pub price_hourly_usd: f64,
12891    pub memory_mb: i64,
12892    pub vcpus: i64,
12893    pub disk_gb: i64,
12894    pub created_at: String,
12895}
12896
12897/// `ImageProviderList` model.
12898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12899pub struct ImageProviderList {
12900    #[serde(default, skip_serializing_if = "Option::is_none")]
12901    pub providers: Option<Vec<MediaProvider>>,
12902}
12903
12904/// audit/immutable-audit-log.ts AuditEvent — an HMAC-chained record; `hmac` absent when
12905/// UARP_AUDIT_HMAC_KEY is unset.
12906#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12907pub struct ImmutableAuditEvent {
12908    pub event_id: String,
12909    pub timestamp: String,
12910    pub tenant_id: String,
12911    pub actor_agent_id: String,
12912    pub event_type: ImmutableAuditEventEventType,
12913    pub details: serde_json::Map<String, serde_json::Value>,
12914    #[serde(default, skip_serializing_if = "Option::is_none")]
12915    pub target_agent_id: Option<String>,
12916    #[serde(default, skip_serializing_if = "Option::is_none")]
12917    pub target_run_id: Option<String>,
12918    #[serde(default, skip_serializing_if = "Option::is_none")]
12919    pub prev_hmac: Option<String>,
12920    #[serde(default, skip_serializing_if = "Option::is_none")]
12921    pub hmac: Option<String>,
12922}
12923
12924/// `ImmutableAuditEventEventType` enumeration.
12925#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
12926pub enum ImmutableAuditEventEventType {
12927    #[default]
12928    #[serde(rename = "agent.created")]
12929    AgentCreated,
12930    #[serde(rename = "agent.updated")]
12931    AgentUpdated,
12932    #[serde(rename = "agent.terminated")]
12933    AgentTerminated,
12934    #[serde(rename = "agent.deposed")]
12935    AgentDeposed,
12936    #[serde(rename = "run.started")]
12937    RunStarted,
12938    #[serde(rename = "run.completed")]
12939    RunCompleted,
12940    #[serde(rename = "run.failed")]
12941    RunFailed,
12942    #[serde(rename = "tool.denied")]
12943    ToolDenied,
12944    #[serde(rename = "security.self_escalation_blocked")]
12945    SecuritySelfEscalationBlocked,
12946    #[serde(rename = "security.opcon_violation")]
12947    SecurityOpconViolation,
12948    #[serde(rename = "security.immutable_field_blocked")]
12949    SecurityImmutableFieldBlocked,
12950    #[serde(rename = "security.rate_limited")]
12951    SecurityRateLimited,
12952    #[serde(rename = "dag.created")]
12953    DagCreated,
12954    #[serde(rename = "dag.step_completed")]
12955    DagStepCompleted,
12956    #[serde(rename = "dag.cancelled")]
12957    DagCancelled,
12958    #[serde(rename = "budget.transfer")]
12959    BudgetTransfer,
12960    #[serde(rename = "budget.exceeded")]
12961    BudgetExceeded,
12962    #[serde(rename = "cascade.failure")]
12963    CascadeFailure,
12964    /// A value the API introduced after this SDK was generated.
12965    #[serde(untagged)]
12966    Other(String),
12967}
12968
12969impl ImmutableAuditEventEventType {
12970    /// The value as it appears on the wire.
12971    pub fn as_str(&self) -> &str {
12972        match self {
12973            Self::AgentCreated => "agent.created",
12974            Self::AgentUpdated => "agent.updated",
12975            Self::AgentTerminated => "agent.terminated",
12976            Self::AgentDeposed => "agent.deposed",
12977            Self::RunStarted => "run.started",
12978            Self::RunCompleted => "run.completed",
12979            Self::RunFailed => "run.failed",
12980            Self::ToolDenied => "tool.denied",
12981            Self::SecuritySelfEscalationBlocked => "security.self_escalation_blocked",
12982            Self::SecurityOpconViolation => "security.opcon_violation",
12983            Self::SecurityImmutableFieldBlocked => "security.immutable_field_blocked",
12984            Self::SecurityRateLimited => "security.rate_limited",
12985            Self::DagCreated => "dag.created",
12986            Self::DagStepCompleted => "dag.step_completed",
12987            Self::DagCancelled => "dag.cancelled",
12988            Self::BudgetTransfer => "budget.transfer",
12989            Self::BudgetExceeded => "budget.exceeded",
12990            Self::CascadeFailure => "cascade.failure",
12991            Self::Other(value) => value.as_str(),
12992        }
12993    }
12994}
12995
12996impl std::fmt::Display for ImmutableAuditEventEventType {
12997    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12998        f.write_str(self.as_str())
12999    }
13000}
13001
13002impl From<&str> for ImmutableAuditEventEventType {
13003    fn from(value: &str) -> Self {
13004        match value {
13005            "agent.created" => Self::AgentCreated,
13006            "agent.updated" => Self::AgentUpdated,
13007            "agent.terminated" => Self::AgentTerminated,
13008            "agent.deposed" => Self::AgentDeposed,
13009            "run.started" => Self::RunStarted,
13010            "run.completed" => Self::RunCompleted,
13011            "run.failed" => Self::RunFailed,
13012            "tool.denied" => Self::ToolDenied,
13013            "security.self_escalation_blocked" => Self::SecuritySelfEscalationBlocked,
13014            "security.opcon_violation" => Self::SecurityOpconViolation,
13015            "security.immutable_field_blocked" => Self::SecurityImmutableFieldBlocked,
13016            "security.rate_limited" => Self::SecurityRateLimited,
13017            "dag.created" => Self::DagCreated,
13018            "dag.step_completed" => Self::DagStepCompleted,
13019            "dag.cancelled" => Self::DagCancelled,
13020            "budget.transfer" => Self::BudgetTransfer,
13021            "budget.exceeded" => Self::BudgetExceeded,
13022            "cascade.failure" => Self::CascadeFailure,
13023            other => Self::Other(other.to_string()),
13024        }
13025    }
13026}
13027
13028/// `ImportAdminConfigRequest` model.
13029#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13030pub struct ImportAdminConfigRequest {
13031    #[serde(default, skip_serializing_if = "Option::is_none")]
13032    pub source: Option<String>,
13033    pub sections: serde_json::Map<String, serde_json::Value>,
13034}
13035
13036/// `ImportAdminConfigResponse` model.
13037#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13038pub struct ImportAdminConfigResponse {
13039    pub imported: bool,
13040    pub applied: Vec<String>,
13041    pub skipped: Vec<String>,
13042    pub applied_count: i64,
13043    pub skipped_count: i64,
13044}
13045
13046/// `ImportAgentMemoryRequest` model.
13047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13048pub struct ImportAgentMemoryRequest {
13049    #[serde(default, skip_serializing_if = "Option::is_none")]
13050    pub entries: Option<Vec<MemoryImportEntry>>,
13051    #[serde(default, skip_serializing_if = "Option::is_none")]
13052    pub agents: Option<Vec<ImportAgentMemoryRequestAgent>>,
13053}
13054
13055/// `ImportAgentMemoryRequestAgent` model.
13056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13057pub struct ImportAgentMemoryRequestAgent {
13058    #[serde(default, skip_serializing_if = "Option::is_none")]
13059    pub agent_id: Option<String>,
13060    #[serde(default, skip_serializing_if = "Option::is_none")]
13061    pub agent_name: Option<String>,
13062    pub entries: Vec<MemoryImportEntry>,
13063}
13064
13065/// `ImportAgentMemoryResponse` model.
13066#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13067pub struct ImportAgentMemoryResponse {
13068    pub imported: bool,
13069    pub agent_id: String,
13070    /// Entries in the file.
13071    pub offered: i64,
13072    /// New entries stored.
13073    pub added: i64,
13074    /// Entries the store already had.
13075    pub duplicates: i64,
13076}
13077
13078/// `ImportDataExplorerRequest` model.
13079#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13080pub struct ImportDataExplorerRequest {
13081    pub file: FilePart,
13082}
13083
13084/// `ImportDataExplorerResponse` model.
13085#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13086pub struct ImportDataExplorerResponse {
13087    pub success: bool,
13088    pub imported: i64,
13089    pub skipped: i64,
13090    /// Rows refused because the read path would refuse them too — sensitive keys, and anything
13091    /// under the `__keys__` namespace auth authenticates against.
13092    pub refused_sensitive: i64,
13093    pub errors: Vec<String>,
13094    pub total_lines: i64,
13095}
13096
13097/// Self-improvement proposal — multi-stage state machine (proposed → arbiter_review → voting →
13098/// sandbox_testing → approved → applied | rejected at any step).
13099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13100pub struct ImprovementProposal {
13101    pub proposal_id: String,
13102    pub tenant_id: String,
13103    pub agent_id: String,
13104    /// Was declared `string` here while the record has always carried a number.
13105    pub version: i64,
13106    pub r#type: ImprovementProposalType,
13107    /// The proposal's heading. Undeclared until now, so a client built from this document rendered
13108    /// the card without one.
13109    #[serde(default, skip_serializing_if = "Option::is_none")]
13110    pub title: Option<String>,
13111    #[serde(default, skip_serializing_if = "Option::is_none")]
13112    pub description: Option<String>,
13113    #[serde(default, skip_serializing_if = "Option::is_none")]
13114    pub rationale: Option<String>,
13115    /// The failed runs that prompted the proposal.
13116    #[serde(default, skip_serializing_if = "Option::is_none")]
13117    pub failed_run_ids: Option<Vec<String>>,
13118    /// The proposed changes. Declared as `diff` here and stored as `changes`, so a client reading
13119    /// the documented name found nothing and showed "no diff" over a proposal that had one.
13120    #[serde(default, skip_serializing_if = "Option::is_none")]
13121    pub changes: Option<serde_json::Map<String, serde_json::Value>>,
13122    #[serde(default, skip_serializing_if = "Option::is_none")]
13123    pub baseline_success_rate: Option<f64>,
13124    /// Present only after the sandbox stage has run.
13125    #[serde(default, skip_serializing_if = "Option::is_none")]
13126    pub sandbox_success_rate: Option<f64>,
13127    pub status: ImprovementProposalStatus,
13128    /// Set once the proposal reaches a vote.
13129    #[serde(default, skip_serializing_if = "Option::is_none")]
13130    pub vote_proposal_id: Option<String>,
13131    pub created_at: String,
13132    #[serde(default, skip_serializing_if = "Option::is_none")]
13133    pub updated_at: Option<String>,
13134}
13135
13136/// `ImprovementProposalStatus` enumeration.
13137#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13138pub enum ImprovementProposalStatus {
13139    #[default]
13140    #[serde(rename = "proposed")]
13141    Proposed,
13142    #[serde(rename = "arbiter_review")]
13143    ArbiterReview,
13144    #[serde(rename = "voting")]
13145    Voting,
13146    #[serde(rename = "sandbox_testing")]
13147    SandboxTesting,
13148    #[serde(rename = "approved")]
13149    Approved,
13150    #[serde(rename = "applied")]
13151    Applied,
13152    #[serde(rename = "rejected")]
13153    Rejected,
13154    /// A value the API introduced after this SDK was generated.
13155    #[serde(untagged)]
13156    Other(String),
13157}
13158
13159impl ImprovementProposalStatus {
13160    /// The value as it appears on the wire.
13161    pub fn as_str(&self) -> &str {
13162        match self {
13163            Self::Proposed => "proposed",
13164            Self::ArbiterReview => "arbiter_review",
13165            Self::Voting => "voting",
13166            Self::SandboxTesting => "sandbox_testing",
13167            Self::Approved => "approved",
13168            Self::Applied => "applied",
13169            Self::Rejected => "rejected",
13170            Self::Other(value) => value.as_str(),
13171        }
13172    }
13173}
13174
13175impl std::fmt::Display for ImprovementProposalStatus {
13176    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13177        f.write_str(self.as_str())
13178    }
13179}
13180
13181impl From<&str> for ImprovementProposalStatus {
13182    fn from(value: &str) -> Self {
13183        match value {
13184            "proposed" => Self::Proposed,
13185            "arbiter_review" => Self::ArbiterReview,
13186            "voting" => Self::Voting,
13187            "sandbox_testing" => Self::SandboxTesting,
13188            "approved" => Self::Approved,
13189            "applied" => Self::Applied,
13190            "rejected" => Self::Rejected,
13191            other => Self::Other(other.to_string()),
13192        }
13193    }
13194}
13195
13196/// `ImprovementProposalType` enumeration.
13197#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13198pub enum ImprovementProposalType {
13199    #[default]
13200    #[serde(rename = "prompt_change")]
13201    PromptChange,
13202    #[serde(rename = "tool_addition")]
13203    ToolAddition,
13204    #[serde(rename = "tool_removal")]
13205    ToolRemoval,
13206    #[serde(rename = "model_change")]
13207    ModelChange,
13208    #[serde(rename = "parameter_tuning")]
13209    ParameterTuning,
13210    #[serde(rename = "skill_addition")]
13211    SkillAddition,
13212    /// A value the API introduced after this SDK was generated.
13213    #[serde(untagged)]
13214    Other(String),
13215}
13216
13217impl ImprovementProposalType {
13218    /// The value as it appears on the wire.
13219    pub fn as_str(&self) -> &str {
13220        match self {
13221            Self::PromptChange => "prompt_change",
13222            Self::ToolAddition => "tool_addition",
13223            Self::ToolRemoval => "tool_removal",
13224            Self::ModelChange => "model_change",
13225            Self::ParameterTuning => "parameter_tuning",
13226            Self::SkillAddition => "skill_addition",
13227            Self::Other(value) => value.as_str(),
13228        }
13229    }
13230}
13231
13232impl std::fmt::Display for ImprovementProposalType {
13233    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13234        f.write_str(self.as_str())
13235    }
13236}
13237
13238impl From<&str> for ImprovementProposalType {
13239    fn from(value: &str) -> Self {
13240        match value {
13241            "prompt_change" => Self::PromptChange,
13242            "tool_addition" => Self::ToolAddition,
13243            "tool_removal" => Self::ToolRemoval,
13244            "model_change" => Self::ModelChange,
13245            "parameter_tuning" => Self::ParameterTuning,
13246            "skill_addition" => Self::SkillAddition,
13247            other => Self::Other(other.to_string()),
13248        }
13249    }
13250}
13251
13252/// One run waiting on a person, with what it is actually asking rather than just its status.
13253#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13254pub struct InboxItem {
13255    pub id: String,
13256    pub kind: InboxItemKind,
13257    pub run_id: String,
13258    pub agent_id: String,
13259    pub agent_name: String,
13260    #[serde(default)]
13261    pub session_id: Option<String>,
13262    pub status: String,
13263    #[serde(default)]
13264    pub created_at: Option<String>,
13265    /// One line: the tool being requested, the question, or the error.
13266    pub summary: String,
13267    /// Longer body — tool arguments, error detail, question context. Empty string when there is
13268    /// none.
13269    pub detail: String,
13270    /// The agent's own choices, for `input` items. Empty otherwise.
13271    pub options: Vec<String>,
13272    /// `approval` items: each tool the run waits on, once, with how many calls named it — the facts
13273    /// behind `summary` (which is English prose), for a client that says them in its own language.
13274    /// Absent on other kinds. Since 2026-09-23.
13275    #[serde(default, skip_serializing_if = "Option::is_none")]
13276    pub tools: Option<Vec<InboxItemTool>>,
13277}
13278
13279/// `InboxItemKind` enumeration.
13280#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13281pub enum InboxItemKind {
13282    #[default]
13283    #[serde(rename = "approval")]
13284    Approval,
13285    #[serde(rename = "input")]
13286    Input,
13287    #[serde(rename = "paused")]
13288    Paused,
13289    #[serde(rename = "failed")]
13290    Failed,
13291    /// A value the API introduced after this SDK was generated.
13292    #[serde(untagged)]
13293    Other(String),
13294}
13295
13296impl InboxItemKind {
13297    /// The value as it appears on the wire.
13298    pub fn as_str(&self) -> &str {
13299        match self {
13300            Self::Approval => "approval",
13301            Self::Input => "input",
13302            Self::Paused => "paused",
13303            Self::Failed => "failed",
13304            Self::Other(value) => value.as_str(),
13305        }
13306    }
13307}
13308
13309impl std::fmt::Display for InboxItemKind {
13310    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13311        f.write_str(self.as_str())
13312    }
13313}
13314
13315impl From<&str> for InboxItemKind {
13316    fn from(value: &str) -> Self {
13317        match value {
13318            "approval" => Self::Approval,
13319            "input" => Self::Input,
13320            "paused" => Self::Paused,
13321            "failed" => Self::Failed,
13322            other => Self::Other(other.to_string()),
13323        }
13324    }
13325}
13326
13327/// `InboxItemTool` model.
13328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13329pub struct InboxItemTool {
13330    pub name: String,
13331    pub count: i64,
13332}
13333
13334/// `IngestKbDocumentRequest` model.
13335#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13336pub struct IngestKbDocumentRequest {
13337    #[serde(default, skip_serializing_if = "Option::is_none")]
13338    pub file_id: Option<String>,
13339    #[serde(default, skip_serializing_if = "Option::is_none")]
13340    pub content: Option<String>,
13341    #[serde(default, skip_serializing_if = "Option::is_none")]
13342    pub filename: Option<String>,
13343}
13344
13345/// `IngestKbDocumentResponse` model.
13346#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13347pub struct IngestKbDocumentResponse {
13348    #[serde(default, skip_serializing_if = "Option::is_none")]
13349    pub document_id: Option<String>,
13350    #[serde(default, skip_serializing_if = "Option::is_none")]
13351    pub name: Option<String>,
13352    #[serde(default, skip_serializing_if = "Option::is_none")]
13353    pub chunks_created: Option<i64>,
13354    #[serde(default, skip_serializing_if = "Option::is_none")]
13355    pub status: Option<String>,
13356}
13357
13358/// `IngestMemoryRequest` model.
13359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13360pub struct IngestMemoryRequest {
13361    /// Pre-uploaded file id (POST /api/v1/files first).
13362    #[serde(default, skip_serializing_if = "Option::is_none")]
13363    pub file_id: Option<String>,
13364    /// Inline text body when no file_id is provided. Max 2 MB.
13365    #[serde(default, skip_serializing_if = "Option::is_none")]
13366    pub content: Option<String>,
13367    /// Override stored filename; defaults to file metadata or `created-doc.md`.
13368    #[serde(default, skip_serializing_if = "Option::is_none")]
13369    pub filename: Option<String>,
13370    /// Stored on every chunk, before the tags ingest always adds (`document`, the filename,
13371    /// `chunk:i/n`); a tag in both is kept once.
13372    #[serde(default, skip_serializing_if = "Option::is_none")]
13373    pub tags: Option<Vec<String>>,
13374    /// Server default: `600`.
13375    #[serde(default, skip_serializing_if = "Option::is_none")]
13376    pub chunk_size: Option<i64>,
13377}
13378
13379/// `IngestMemoryResponse` model.
13380#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13381pub struct IngestMemoryResponse {
13382    pub ingested: bool,
13383    pub filename: String,
13384    pub text_length: i64,
13385    pub chunks_created: i64,
13386    #[serde(default, skip_serializing_if = "Option::is_none")]
13387    pub file_id: Option<String>,
13388    pub entries: Vec<IngestMemoryResponseEntry>,
13389}
13390
13391/// `IngestMemoryResponseEntry` model.
13392#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13393pub struct IngestMemoryResponseEntry {
13394    pub entry_id: String,
13395    pub r#type: String,
13396    pub content_preview: String,
13397    #[serde(default, skip_serializing_if = "Option::is_none")]
13398    pub tags: Option<Vec<String>>,
13399}
13400
13401/// OAuth/API integration record (Slack, GitHub, Linear, etc.).
13402#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13403pub struct Integration {
13404    pub id: String,
13405    pub tenant_id: String,
13406    /// Which connector this is: `github`, `slack`, `linear`, …
13407    pub connector_id: String,
13408    #[serde(default, skip_serializing_if = "Option::is_none")]
13409    pub name: Option<String>,
13410    /// Connector settings. Secrets are replaced with `\<redacted\>`.
13411    #[serde(default, skip_serializing_if = "Option::is_none")]
13412    pub config: Option<serde_json::Map<String, serde_json::Value>>,
13413    /// `active` is what the server sends for a working integration; the documented `connected` was
13414    /// never emitted.
13415    pub status: IntegrationStatus,
13416    #[serde(default, skip_serializing_if = "Option::is_none")]
13417    pub last_sync_at: Option<String>,
13418    #[serde(default, skip_serializing_if = "Option::is_none")]
13419    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
13420    #[serde(default, skip_serializing_if = "Option::is_none")]
13421    pub created_at: Option<String>,
13422    #[serde(default, skip_serializing_if = "Option::is_none")]
13423    pub updated_at: Option<String>,
13424    #[serde(default, skip_serializing_if = "Option::is_none")]
13425    pub migrated_at: Option<String>,
13426    /// Agents allowed to use this integration. Present on the live record and read by 7 files in
13427    /// the web; the document omitted it, so a generated client could not tell which agents an
13428    /// integration serves.
13429    #[serde(default, skip_serializing_if = "Option::is_none")]
13430    pub assigned_agent_ids: Option<Vec<String>>,
13431}
13432
13433/// Available integration (connector) type in the catalog
13434#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13435pub struct IntegrationCatalogItem {
13436    /// Connector id (e.g. github, stripe, notion, slack)
13437    pub id: String,
13438    pub name: String,
13439    pub description: String,
13440    pub icon: String,
13441    pub auth_type: IntegrationCatalogItemAuthType,
13442    /// Present when the connector authorises through another connector's OAuth provider
13443    /// (google_calendar, gmail, google_drive and google_sheets all say `google`). A client builds
13444    /// the authorize URL from this when set, from `id` otherwise. Absent for every other connector.
13445    #[serde(default, skip_serializing_if = "Option::is_none")]
13446    pub oauth_provider: Option<String>,
13447    /// The OAuth scopes the connector needs, so a client can show them BEFORE the visitor clicks
13448    /// Connect rather than leaving the IdP consent screen to be the first place they are seen.
13449    /// Absent — not empty — for api_key connectors and for OAuth connectors that declare none.
13450    #[serde(default, skip_serializing_if = "Option::is_none")]
13451    pub required_oauth_scopes: Option<Vec<String>>,
13452    pub config_schema: HashMap<String, ConnectorConfigField>,
13453}
13454
13455/// `IntegrationCatalogItemAuthType` enumeration.
13456#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13457pub enum IntegrationCatalogItemAuthType {
13458    #[default]
13459    #[serde(rename = "api_key")]
13460    APIKey,
13461    #[serde(rename = "oauth2")]
13462    Oauth2,
13463    #[serde(rename = "webhook")]
13464    Webhook,
13465    #[serde(rename = "none")]
13466    None,
13467    /// A value the API introduced after this SDK was generated.
13468    #[serde(untagged)]
13469    Other(String),
13470}
13471
13472impl IntegrationCatalogItemAuthType {
13473    /// The value as it appears on the wire.
13474    pub fn as_str(&self) -> &str {
13475        match self {
13476            Self::APIKey => "api_key",
13477            Self::Oauth2 => "oauth2",
13478            Self::Webhook => "webhook",
13479            Self::None => "none",
13480            Self::Other(value) => value.as_str(),
13481        }
13482    }
13483}
13484
13485impl std::fmt::Display for IntegrationCatalogItemAuthType {
13486    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13487        f.write_str(self.as_str())
13488    }
13489}
13490
13491impl From<&str> for IntegrationCatalogItemAuthType {
13492    fn from(value: &str) -> Self {
13493        match value {
13494            "api_key" => Self::APIKey,
13495            "oauth2" => Self::Oauth2,
13496            "webhook" => Self::Webhook,
13497            "none" => Self::None,
13498            other => Self::Other(other.to_string()),
13499        }
13500    }
13501}
13502
13503/// `active` is what the server sends for a working integration; the documented `connected` was
13504/// never emitted.
13505#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13506pub enum IntegrationStatus {
13507    #[default]
13508    #[serde(rename = "active")]
13509    Active,
13510    #[serde(rename = "inactive")]
13511    Inactive,
13512    #[serde(rename = "error")]
13513    Error,
13514    /// A value the API introduced after this SDK was generated.
13515    #[serde(untagged)]
13516    Other(String),
13517}
13518
13519impl IntegrationStatus {
13520    /// The value as it appears on the wire.
13521    pub fn as_str(&self) -> &str {
13522        match self {
13523            Self::Active => "active",
13524            Self::Inactive => "inactive",
13525            Self::Error => "error",
13526            Self::Other(value) => value.as_str(),
13527        }
13528    }
13529}
13530
13531impl std::fmt::Display for IntegrationStatus {
13532    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13533        f.write_str(self.as_str())
13534    }
13535}
13536
13537impl From<&str> for IntegrationStatus {
13538    fn from(value: &str) -> Self {
13539        match value {
13540            "active" => Self::Active,
13541            "inactive" => Self::Inactive,
13542            "error" => Self::Error,
13543            other => Self::Other(other.to_string()),
13544        }
13545    }
13546}
13547
13548/// `InternalVerifyDomainResponse` model.
13549#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13550pub struct InternalVerifyDomainResponse {
13551    pub ok: bool,
13552}
13553
13554/// An invite as an administrator sees it. The accept token (`secret`) is NOT here: it travels
13555/// in the email link and, for the recipient only, in `GET /me/tenants` `pending_invites`. Until
13556/// 2026-09-12 the tenant's list, the 201, resend and revoke echoed it, so `users:read` could
13557/// accept any pending invite of the tenant.
13558#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13559pub struct Invite {
13560    #[serde(default, skip_serializing_if = "Option::is_none")]
13561    pub created_at: Option<String>,
13562    #[serde(default, skip_serializing_if = "Option::is_none")]
13563    pub email: Option<String>,
13564    #[serde(default, skip_serializing_if = "Option::is_none")]
13565    pub expires_at: Option<String>,
13566    #[serde(default, skip_serializing_if = "Option::is_none")]
13567    pub id: Option<String>,
13568    #[serde(default, skip_serializing_if = "Option::is_none")]
13569    pub invited_by: Option<String>,
13570    #[serde(default, skip_serializing_if = "Option::is_none")]
13571    pub role: Option<String>,
13572    #[serde(default, skip_serializing_if = "Option::is_none")]
13573    pub status: Option<String>,
13574    #[serde(default, skip_serializing_if = "Option::is_none")]
13575    pub tenant_id: Option<String>,
13576}
13577
13578/// `InviteUserRequest` model.
13579#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13580pub struct InviteUserRequest {
13581    pub email: String,
13582    pub role: String,
13583}
13584
13585/// `InviteUserResponse` model.
13586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13587pub struct InviteUserResponse {
13588    #[serde(default, skip_serializing_if = "Option::is_none")]
13589    pub created_at: Option<String>,
13590    #[serde(default, skip_serializing_if = "Option::is_none")]
13591    pub email: Option<String>,
13592    #[serde(default, skip_serializing_if = "Option::is_none")]
13593    pub expires_at: Option<String>,
13594    #[serde(default, skip_serializing_if = "Option::is_none")]
13595    pub id: Option<String>,
13596    #[serde(default, skip_serializing_if = "Option::is_none")]
13597    pub invited_by: Option<String>,
13598    #[serde(default, skip_serializing_if = "Option::is_none")]
13599    pub role: Option<String>,
13600    #[serde(default, skip_serializing_if = "Option::is_none")]
13601    pub status: Option<String>,
13602    #[serde(default, skip_serializing_if = "Option::is_none")]
13603    pub tenant_id: Option<String>,
13604    pub email_sent: bool,
13605}
13606
13607/// `InvokeListingAgentRequest` model.
13608#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13609pub struct InvokeListingAgentRequest {
13610    pub input: serde_json::Map<String, serde_json::Value>,
13611}
13612
13613/// `InvokeListingAgentResponse` model.
13614#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13615pub struct InvokeListingAgentResponse {
13616    pub error: InvokeListingAgentResponseError,
13617    pub message: String,
13618    pub retry_after_seconds: i64,
13619}
13620
13621/// `InvokeListingAgentResponseError` enumeration.
13622#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13623pub enum InvokeListingAgentResponseError {
13624    #[default]
13625    #[serde(rename = "Accepted")]
13626    Accepted,
13627    /// A value the API introduced after this SDK was generated.
13628    #[serde(untagged)]
13629    Other(String),
13630}
13631
13632impl InvokeListingAgentResponseError {
13633    /// The value as it appears on the wire.
13634    pub fn as_str(&self) -> &str {
13635        match self {
13636            Self::Accepted => "Accepted",
13637            Self::Other(value) => value.as_str(),
13638        }
13639    }
13640}
13641
13642impl std::fmt::Display for InvokeListingAgentResponseError {
13643    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13644        f.write_str(self.as_str())
13645    }
13646}
13647
13648impl From<&str> for InvokeListingAgentResponseError {
13649    fn from(value: &str) -> Self {
13650        match value {
13651            "Accepted" => Self::Accepted,
13652            other => Self::Other(other.to_string()),
13653        }
13654    }
13655}
13656
13657/// `IssueArbiterRulingRequest` model.
13658#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13659pub struct IssueArbiterRulingRequest {
13660    pub decision: String,
13661    #[serde(default, skip_serializing_if = "Option::is_none")]
13662    pub penalties: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
13663}
13664
13665/// `IssueArbiterRulingResponse` model.
13666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13667pub struct IssueArbiterRulingResponse {
13668    #[serde(default, skip_serializing_if = "Option::is_none")]
13669    pub ok: Option<bool>,
13670}
13671
13672/// A JSON-RPC 2.0 envelope. Exactly one of `result` and `error` is present.
13673#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13674pub struct JSONRpcResponse {
13675    pub jsonrpc: JSONRpcResponseJsonrpc,
13676    #[serde(default)]
13677    pub id: Option<serde_json::Value>,
13678    /// Method-specific.
13679    #[serde(default, skip_serializing_if = "Option::is_none")]
13680    pub result: Option<serde_json::Value>,
13681    #[serde(default, skip_serializing_if = "Option::is_none")]
13682    pub error: Option<JSONRpcResponseError>,
13683}
13684
13685/// `JSONRpcResponseError` model.
13686#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13687pub struct JSONRpcResponseError {
13688    pub code: i64,
13689    pub message: String,
13690    #[serde(default, skip_serializing_if = "Option::is_none")]
13691    pub data: Option<serde_json::Value>,
13692}
13693
13694/// `JSONRpcResponseJsonrpc` enumeration.
13695#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13696pub enum JSONRpcResponseJsonrpc {
13697    #[default]
13698    #[serde(rename = "2.0")]
13699    V20,
13700    /// A value the API introduced after this SDK was generated.
13701    #[serde(untagged)]
13702    Other(String),
13703}
13704
13705impl JSONRpcResponseJsonrpc {
13706    /// The value as it appears on the wire.
13707    pub fn as_str(&self) -> &str {
13708        match self {
13709            Self::V20 => "2.0",
13710            Self::Other(value) => value.as_str(),
13711        }
13712    }
13713}
13714
13715impl std::fmt::Display for JSONRpcResponseJsonrpc {
13716    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13717        f.write_str(self.as_str())
13718    }
13719}
13720
13721impl From<&str> for JSONRpcResponseJsonrpc {
13722    fn from(value: &str) -> Self {
13723        match value {
13724            "2.0" => Self::V20,
13725            other => Self::Other(other.to_string()),
13726        }
13727    }
13728}
13729
13730/// `KnowledgeBase` model.
13731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13732pub struct KnowledgeBase {
13733    pub id: String,
13734    pub tenant_id: String,
13735    pub name: String,
13736    #[serde(default, skip_serializing_if = "Option::is_none")]
13737    pub description: Option<String>,
13738    /// The embedding model recorded on the base: what the caller sent at create, or the
13739    /// deployment's model; rewritten to the model actually used on every reindex
13740    /// (knowledge-bases.ts:688).
13741    #[serde(default, skip_serializing_if = "Option::is_none")]
13742    pub embedding_model: Option<String>,
13743    #[serde(default, skip_serializing_if = "Option::is_none")]
13744    pub chunk_size: Option<i64>,
13745    #[serde(default, skip_serializing_if = "Option::is_none")]
13746    pub chunk_overlap: Option<i64>,
13747    #[serde(default, skip_serializing_if = "Option::is_none")]
13748    pub document_count: Option<i64>,
13749    #[serde(default, skip_serializing_if = "Option::is_none")]
13750    pub total_chunks: Option<i64>,
13751    /// Deliberately not an enum. The routes write several values for different notions of
13752    /// readiness, and publishing a guessed list is how a client comes to reject a state the server
13753    /// legitimately sends. `ready` is the one observed on a healthy base.
13754    #[serde(default, skip_serializing_if = "Option::is_none")]
13755    pub status: Option<String>,
13756    #[serde(default, skip_serializing_if = "Option::is_none")]
13757    pub attached_agents: Option<Vec<KnowledgeBaseAttachedAgent>>,
13758    #[serde(default, skip_serializing_if = "Option::is_none")]
13759    pub attached_agent_count: Option<i64>,
13760    #[serde(default, skip_serializing_if = "Option::is_none")]
13761    pub created_at: Option<String>,
13762    #[serde(default, skip_serializing_if = "Option::is_none")]
13763    pub updated_at: Option<String>,
13764}
13765
13766/// `KnowledgeBaseAttachedAgent` model.
13767#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13768pub struct KnowledgeBaseAttachedAgent {
13769    pub agent_id: String,
13770    #[serde(default, skip_serializing_if = "Option::is_none")]
13771    pub name: Option<String>,
13772}
13773
13774/// Body for `POST /api/v1/knowledge-bases`.
13775#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13776pub struct KnowledgeBaseCreate {
13777    pub name: String,
13778    #[serde(default, skip_serializing_if = "Option::is_none")]
13779    pub description: Option<String>,
13780    /// Informational only — not a choice. The deployment has one embedding model, set by the
13781    /// super-admin in `PUT /admin/config/agent-memory`; ingest and search always use it, and `POST
13782    /// /knowledge-bases/{id}/reindex` overwrites this field with the model actually used. A string
13783    /// sent here is stored and echoed by GET until the first reindex, then replaced. `PUT
13784    /// /knowledge-bases/{id}` ignores it. Clients should send nothing (knowledge-bases.ts:395,
13785    /// :688).
13786    #[serde(default, skip_serializing_if = "Option::is_none")]
13787    pub embedding_model: Option<String>,
13788}
13789
13790/// `KnowledgeBaseDocument` model.
13791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13792pub struct KnowledgeBaseDocument {
13793    pub id: String,
13794    pub kb_id: String,
13795    pub tenant_id: String,
13796    pub name: String,
13797    pub r#type: KnowledgeBaseDocumentType,
13798    pub size_bytes: i64,
13799    pub chunk_count: i64,
13800    pub status: KnowledgeBaseDocumentStatus,
13801    #[serde(default, skip_serializing_if = "Option::is_none")]
13802    pub error_message: Option<String>,
13803    pub created_at: String,
13804    pub updated_at: String,
13805    #[serde(default)]
13806    pub chunk_preview: Option<String>,
13807    /// `embedded` when the document's chunks have vectors; `keyword_only` when no embedding
13808    /// provider answered and the document is searchable by keywords only.
13809    pub embedding_status: KnowledgeBaseDocumentEmbeddingStatus,
13810}
13811
13812/// `embedded` when the document's chunks have vectors; `keyword_only` when no embedding
13813/// provider answered and the document is searchable by keywords only.
13814#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13815pub enum KnowledgeBaseDocumentEmbeddingStatus {
13816    #[default]
13817    #[serde(rename = "embedded")]
13818    Embedded,
13819    #[serde(rename = "keyword_only")]
13820    KeywordOnly,
13821    /// A value the API introduced after this SDK was generated.
13822    #[serde(untagged)]
13823    Other(String),
13824}
13825
13826impl KnowledgeBaseDocumentEmbeddingStatus {
13827    /// The value as it appears on the wire.
13828    pub fn as_str(&self) -> &str {
13829        match self {
13830            Self::Embedded => "embedded",
13831            Self::KeywordOnly => "keyword_only",
13832            Self::Other(value) => value.as_str(),
13833        }
13834    }
13835}
13836
13837impl std::fmt::Display for KnowledgeBaseDocumentEmbeddingStatus {
13838    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13839        f.write_str(self.as_str())
13840    }
13841}
13842
13843impl From<&str> for KnowledgeBaseDocumentEmbeddingStatus {
13844    fn from(value: &str) -> Self {
13845        match value {
13846            "embedded" => Self::Embedded,
13847            "keyword_only" => Self::KeywordOnly,
13848            other => Self::Other(other.to_string()),
13849        }
13850    }
13851}
13852
13853/// `KnowledgeBaseDocumentStatus` enumeration.
13854#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13855pub enum KnowledgeBaseDocumentStatus {
13856    #[default]
13857    #[serde(rename = "uploading")]
13858    Uploading,
13859    #[serde(rename = "processing")]
13860    Processing,
13861    #[serde(rename = "ready")]
13862    Ready,
13863    #[serde(rename = "error")]
13864    Error,
13865    /// A value the API introduced after this SDK was generated.
13866    #[serde(untagged)]
13867    Other(String),
13868}
13869
13870impl KnowledgeBaseDocumentStatus {
13871    /// The value as it appears on the wire.
13872    pub fn as_str(&self) -> &str {
13873        match self {
13874            Self::Uploading => "uploading",
13875            Self::Processing => "processing",
13876            Self::Ready => "ready",
13877            Self::Error => "error",
13878            Self::Other(value) => value.as_str(),
13879        }
13880    }
13881}
13882
13883impl std::fmt::Display for KnowledgeBaseDocumentStatus {
13884    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13885        f.write_str(self.as_str())
13886    }
13887}
13888
13889impl From<&str> for KnowledgeBaseDocumentStatus {
13890    fn from(value: &str) -> Self {
13891        match value {
13892            "uploading" => Self::Uploading,
13893            "processing" => Self::Processing,
13894            "ready" => Self::Ready,
13895            "error" => Self::Error,
13896            other => Self::Other(other.to_string()),
13897        }
13898    }
13899}
13900
13901/// `KnowledgeBaseDocumentType` enumeration.
13902#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13903pub enum KnowledgeBaseDocumentType {
13904    #[default]
13905    #[serde(rename = "pdf")]
13906    PDF,
13907    #[serde(rename = "markdown")]
13908    Markdown,
13909    #[serde(rename = "csv")]
13910    CSV,
13911    #[serde(rename = "html")]
13912    Html,
13913    #[serde(rename = "plain")]
13914    Plain,
13915    #[serde(rename = "docx")]
13916    Docx,
13917    #[serde(rename = "image")]
13918    Image,
13919    /// A value the API introduced after this SDK was generated.
13920    #[serde(untagged)]
13921    Other(String),
13922}
13923
13924impl KnowledgeBaseDocumentType {
13925    /// The value as it appears on the wire.
13926    pub fn as_str(&self) -> &str {
13927        match self {
13928            Self::PDF => "pdf",
13929            Self::Markdown => "markdown",
13930            Self::CSV => "csv",
13931            Self::Html => "html",
13932            Self::Plain => "plain",
13933            Self::Docx => "docx",
13934            Self::Image => "image",
13935            Self::Other(value) => value.as_str(),
13936        }
13937    }
13938}
13939
13940impl std::fmt::Display for KnowledgeBaseDocumentType {
13941    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13942        f.write_str(self.as_str())
13943    }
13944}
13945
13946impl From<&str> for KnowledgeBaseDocumentType {
13947    fn from(value: &str) -> Self {
13948        match value {
13949            "pdf" => Self::PDF,
13950            "markdown" => Self::Markdown,
13951            "csv" => Self::CSV,
13952            "html" => Self::Html,
13953            "plain" => Self::Plain,
13954            "docx" => Self::Docx,
13955            "image" => Self::Image,
13956            other => Self::Other(other.to_string()),
13957        }
13958    }
13959}
13960
13961/// `KnowledgeBaseSearchResult` model.
13962#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13963pub struct KnowledgeBaseSearchResult {
13964    pub status: KnowledgeBaseSearchResultStatus,
13965    pub query: String,
13966    /// Which pass produced the results; null when the knowledge base is empty and neither ran.
13967    #[serde(default)]
13968    pub mode: Option<String>,
13969    pub count: i64,
13970    pub results: Vec<KnowledgeBaseSearchResultResult>,
13971}
13972
13973/// `KnowledgeBaseSearchResultResult` model.
13974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13975pub struct KnowledgeBaseSearchResultResult {
13976    /// 1-based citation number.
13977    pub index: i64,
13978    /// Document label, sanitised before it is rendered into a prompt.
13979    pub source: String,
13980    #[serde(default, skip_serializing_if = "Option::is_none")]
13981    pub page: Option<i64>,
13982    pub text: String,
13983    pub score: f64,
13984}
13985
13986/// `KnowledgeBaseSearchResultStatus` enumeration.
13987#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
13988pub enum KnowledgeBaseSearchResultStatus {
13989    #[default]
13990    #[serde(rename = "KB_EMPTY")]
13991    KbEmpty,
13992    #[serde(rename = "NO_MATCHES")]
13993    NoMatches,
13994    #[serde(rename = "RESULTS_FOUND")]
13995    ResultsFound,
13996    /// A value the API introduced after this SDK was generated.
13997    #[serde(untagged)]
13998    Other(String),
13999}
14000
14001impl KnowledgeBaseSearchResultStatus {
14002    /// The value as it appears on the wire.
14003    pub fn as_str(&self) -> &str {
14004        match self {
14005            Self::KbEmpty => "KB_EMPTY",
14006            Self::NoMatches => "NO_MATCHES",
14007            Self::ResultsFound => "RESULTS_FOUND",
14008            Self::Other(value) => value.as_str(),
14009        }
14010    }
14011}
14012
14013impl std::fmt::Display for KnowledgeBaseSearchResultStatus {
14014    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14015        f.write_str(self.as_str())
14016    }
14017}
14018
14019impl From<&str> for KnowledgeBaseSearchResultStatus {
14020    fn from(value: &str) -> Self {
14021        match value {
14022            "KB_EMPTY" => Self::KbEmpty,
14023            "NO_MATCHES" => Self::NoMatches,
14024            "RESULTS_FOUND" => Self::ResultsFound,
14025            other => Self::Other(other.to_string()),
14026        }
14027    }
14028}
14029
14030/// Body for `PUT /api/v1/knowledge-bases/{knowledgeBaseId}`. Every field optional.
14031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14032pub struct KnowledgeBaseUpdate {
14033    #[serde(default, skip_serializing_if = "Option::is_none")]
14034    pub name: Option<String>,
14035    #[serde(default, skip_serializing_if = "Option::is_none")]
14036    pub description: Option<String>,
14037}
14038
14039/// bytes, Web super-admin, tenant Snaga Or…, 2026-09-10T22:38:17Z; admin-config.ts
14040/// LandingConfig, defaults-projected so every key is present.
14041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14042pub struct LandingConfigSection {
14043    #[serde(default)]
14044    pub public_agent_id: Option<String>,
14045    pub texts: HashMap<String, Value>,
14046    pub multilang_enabled: bool,
14047    pub default_locale: String,
14048    pub partners_enabled: bool,
14049    #[serde(default)]
14050    pub partners: Option<Vec<LandingConfigSectionPartner>>,
14051}
14052
14053/// `LandingConfigSectionPartner` model.
14054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14055pub struct LandingConfigSectionPartner {
14056    pub id: String,
14057    pub name: String,
14058    pub tagline: String,
14059    #[serde(default, skip_serializing_if = "Option::is_none")]
14060    pub tagline_uk: Option<String>,
14061    pub href: String,
14062    pub logo: LandingConfigSectionPartnerLogo,
14063}
14064
14065/// `LandingConfigSectionPartnerLogo` model.
14066#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14067pub struct LandingConfigSectionPartnerLogo {
14068    #[serde(default, skip_serializing_if = "Option::is_none")]
14069    pub slug: Option<String>,
14070    #[serde(default, skip_serializing_if = "Option::is_none")]
14071    pub url: Option<String>,
14072}
14073
14074/// Operator-set text and partner logos for the public landing page.
14075#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14076pub struct LandingOverrides {
14077    /// Override key → text. Empty when nothing is overridden.
14078    pub texts: serde_json::Map<String, serde_json::Value>,
14079    pub multilang_enabled: bool,
14080    pub default_locale: String,
14081    pub partners_enabled: bool,
14082    /// Null means never configured, which a client may render differently from an empty list.
14083    #[serde(default)]
14084    pub partners: Option<Vec<serde_json::Map<String, serde_json::Value>>>,
14085    /// KV versionstamp of the stored record. The admin form sends it back on write so two operators
14086    /// cannot silently overwrite each other.
14087    #[serde(default)]
14088    pub version: Option<String>,
14089}
14090
14091/// `LandingStats` model.
14092#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14093pub struct LandingStats {
14094    #[serde(default, skip_serializing_if = "Option::is_none")]
14095    pub agents_deployed: Option<i64>,
14096    #[serde(default, skip_serializing_if = "Option::is_none")]
14097    pub llm_providers: Option<i64>,
14098    #[serde(default, skip_serializing_if = "Option::is_none")]
14099    pub registered_users: Option<i64>,
14100    #[serde(default, skip_serializing_if = "Option::is_none")]
14101    pub tool_calls_today: Option<i64>,
14102    #[serde(default, skip_serializing_if = "Option::is_none")]
14103    pub total_runs: Option<i64>,
14104    #[serde(default, skip_serializing_if = "Option::is_none")]
14105    pub total_sessions: Option<i64>,
14106    #[serde(default, skip_serializing_if = "Option::is_none")]
14107    pub total_tokens: Option<i64>,
14108}
14109
14110/// `LeaveTenantResponse` model.
14111#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14112pub struct LeaveTenantResponse {
14113    pub left: bool,
14114    pub tenant_id: String,
14115}
14116
14117/// `LedgerIntegrity` model.
14118#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14119pub struct LedgerIntegrity {
14120    pub valid: bool,
14121    pub entries_checked: i64,
14122    /// Sequence of the first entry that failed verification. Absent when `valid` is true.
14123    #[serde(default, skip_serializing_if = "Option::is_none")]
14124    pub first_invalid_seq: Option<i64>,
14125    #[serde(default, skip_serializing_if = "Option::is_none")]
14126    pub error: Option<String>,
14127    pub checked_at: String,
14128}
14129
14130/// `LinkPreview` model.
14131#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14132pub struct LinkPreview {
14133    pub url: String,
14134    pub site: String,
14135    #[serde(default, skip_serializing_if = "Option::is_none")]
14136    pub title: Option<String>,
14137    #[serde(default, skip_serializing_if = "Option::is_none")]
14138    pub description: Option<String>,
14139    #[serde(default, skip_serializing_if = "Option::is_none")]
14140    pub image: Option<String>,
14141    #[serde(default, skip_serializing_if = "Option::is_none")]
14142    pub favicon: Option<String>,
14143}
14144
14145/// `ListA2ATasksResponse` model.
14146#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14147pub struct ListA2ATasksResponse {
14148    pub tasks: Vec<A2ATask>,
14149    /// Offset to pass as `offset` for the next page; absent on the last page.
14150    #[serde(default, skip_serializing_if = "Option::is_none")]
14151    pub cursor: Option<String>,
14152    /// Size of the whole set.
14153    #[serde(default, skip_serializing_if = "Option::is_none")]
14154    pub total: Option<i64>,
14155    #[serde(default, skip_serializing_if = "Option::is_none")]
14156    pub limit: Option<i64>,
14157    #[serde(default, skip_serializing_if = "Option::is_none")]
14158    pub offset: Option<i64>,
14159    #[serde(default, skip_serializing_if = "Option::is_none")]
14160    pub has_more: Option<bool>,
14161}
14162
14163/// `ListAdminBlogPostsResponse` model.
14164#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14165pub struct ListAdminBlogPostsResponse {
14166    pub posts: Vec<BlogPost>,
14167}
14168
14169/// `ListAdminDomainHealthResponse` model.
14170#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14171pub struct ListAdminDomainHealthResponse {
14172    pub count: i64,
14173    pub rows: Vec<ListAdminDomainHealthResponseRow>,
14174}
14175
14176/// `ListAdminDomainHealthResponseRow` model.
14177#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14178pub struct ListAdminDomainHealthResponseRow {
14179    pub tenant_id: String,
14180    #[serde(default, skip_serializing_if = "Option::is_none")]
14181    pub tenant_name: Option<String>,
14182    #[serde(default, skip_serializing_if = "Option::is_none")]
14183    pub tenant_slug: Option<String>,
14184    #[serde(default, skip_serializing_if = "Option::is_none")]
14185    pub plan: Option<String>,
14186    pub domain: String,
14187    pub dns: DomainDnsLifecycle,
14188    pub cert: DomainCertLifecycle,
14189    pub created_at: String,
14190    #[serde(default, skip_serializing_if = "Option::is_none")]
14191    pub updated_at: Option<String>,
14192}
14193
14194/// `ListAdminIntegrationOAuthProvidersResponse` model.
14195#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14196pub struct ListAdminIntegrationOAuthProvidersResponse {
14197    pub providers: Vec<ListAdminIntegrationOAuthProvidersResponseProvider>,
14198}
14199
14200/// `ListAdminIntegrationOAuthProvidersResponseProvider` model.
14201#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14202pub struct ListAdminIntegrationOAuthProvidersResponseProvider {
14203    pub id: String,
14204    /// A record exists for this provider.
14205    pub configured: bool,
14206    /// Enabled AND holding both a client id and a secret — a provider switched on with incomplete
14207    /// credentials reports false here, so this is readiness rather than the stored flag.
14208    pub enabled: bool,
14209}
14210
14211/// `ListAdminProvidersResponse` model.
14212#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14213pub struct ListAdminProvidersResponse {
14214    #[serde(default, skip_serializing_if = "Option::is_none")]
14215    pub providers: Option<Vec<AdminProviderSummary>>,
14216}
14217
14218/// `ListAgentBookmarksResponse` model.
14219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14220pub struct ListAgentBookmarksResponse {
14221    pub items: Vec<AgentBookmark>,
14222}
14223
14224/// `ListAgentIntegrationsResponse` model.
14225#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14226pub struct ListAgentIntegrationsResponse {
14227    #[serde(default, skip_serializing_if = "Option::is_none")]
14228    pub integrations: Option<Vec<AgentIntegration>>,
14229    #[serde(default, skip_serializing_if = "Option::is_none")]
14230    pub total: Option<i64>,
14231}
14232
14233/// `ListAgentMailResponse` model.
14234#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14235pub struct ListAgentMailResponse {
14236    pub messages: Vec<AgentMessage>,
14237    /// Agent id → name, resolved for display. An agent that no longer exists is simply absent.
14238    pub agent_names: serde_json::Map<String, serde_json::Value>,
14239    pub total_scanned: i64,
14240}
14241
14242/// `ListAgentMCPServersResponse` model.
14243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14244pub struct ListAgentMCPServersResponse {
14245    #[serde(default, skip_serializing_if = "Option::is_none")]
14246    pub servers: Option<Vec<MCPServer>>,
14247    #[serde(default, skip_serializing_if = "Option::is_none")]
14248    pub total: Option<i64>,
14249}
14250
14251/// `ListAgentScorersResponse` model.
14252#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14253pub struct ListAgentScorersResponse {
14254    #[serde(default, skip_serializing_if = "Option::is_none")]
14255    pub scorers: Option<Vec<AgentScorer>>,
14256}
14257
14258/// `ListAgentsResponse` model.
14259#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14260pub struct ListAgentsResponse {
14261    pub items: Vec<Agent>,
14262    /// Opaque cursor for the next page; null when no more pages.
14263    #[serde(default)]
14264    pub cursor: Option<String>,
14265    pub has_more: bool,
14266}
14267
14268/// `ListAgentVersionsFields` enumeration.
14269#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
14270pub enum ListAgentVersionsFields {
14271    #[default]
14272    #[serde(rename = "summary")]
14273    Summary,
14274    /// A value the API introduced after this SDK was generated.
14275    #[serde(untagged)]
14276    Other(String),
14277}
14278
14279impl ListAgentVersionsFields {
14280    /// The value as it appears on the wire.
14281    pub fn as_str(&self) -> &str {
14282        match self {
14283            Self::Summary => "summary",
14284            Self::Other(value) => value.as_str(),
14285        }
14286    }
14287}
14288
14289impl std::fmt::Display for ListAgentVersionsFields {
14290    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14291        f.write_str(self.as_str())
14292    }
14293}
14294
14295impl From<&str> for ListAgentVersionsFields {
14296    fn from(value: &str) -> Self {
14297        match value {
14298            "summary" => Self::Summary,
14299            other => Self::Other(other.to_string()),
14300        }
14301    }
14302}
14303
14304/// `ListAgentVersionsResponse` model.
14305#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14306pub struct ListAgentVersionsResponse {
14307    pub items: Vec<AgentVersion>,
14308    /// Legacy alias for `items`. Will be removed in API v1.x.
14309    #[serde(default, skip_serializing_if = "Option::is_none")]
14310    pub versions: Option<Vec<AgentVersion>>,
14311    /// `items.length` — the snapshots this response carries, which retention caps at the newest 50
14312    /// (agents.ts, GET /agents/:id/versions). Not a count of everything the agent was ever saved
14313    /// as, and there is no paging parameter to reach further back.
14314    pub total: i64,
14315    /// Present only with `limit`: whether older versions remain — the document's list convention
14316    /// (/agents, /sessions, /runs, /files answer the same pair).
14317    #[serde(default, skip_serializing_if = "Option::is_none")]
14318    pub has_more: Option<bool>,
14319    /// Present only with `limit` and only while older versions remain: an opaque string to pass
14320    /// back as `cursor` for the next page (every cursor in this document is a string; the generated
14321    /// clients' paging helpers rely on it). Typed integer for one hour in #469 — no client had read
14322    /// it.
14323    #[serde(default, skip_serializing_if = "Option::is_none")]
14324    pub cursor: Option<String>,
14325}
14326
14327/// `ListAgentWorkspaceFilesResponse` model.
14328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14329pub struct ListAgentWorkspaceFilesResponse {
14330    pub workspace_id: String,
14331    pub path: String,
14332    pub directories: Vec<String>,
14333    pub files: Vec<WorkspaceFile>,
14334}
14335
14336/// `ListAllContentReportsResponse` model.
14337#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14338pub struct ListAllContentReportsResponse {
14339    pub items: Vec<ContentReport>,
14340    #[serde(default)]
14341    pub cursor: Option<String>,
14342    pub has_more: bool,
14343}
14344
14345/// `ListAmbassadorRequestsResponse` model.
14346#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14347pub struct ListAmbassadorRequestsResponse {
14348    pub requests: Vec<AmbassadorRequest>,
14349}
14350
14351/// `ListAmbassadorVetoesResponse` model.
14352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14353pub struct ListAmbassadorVetoesResponse {
14354    #[serde(default, skip_serializing_if = "Option::is_none")]
14355    pub vetoes: Option<Vec<VetoRecord>>,
14356}
14357
14358/// `ListAndroidTestersResponse` model.
14359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14360pub struct ListAndroidTestersResponse {
14361    pub testers: Vec<AndroidTester>,
14362    pub count: i64,
14363    pub not_yet_emailed: i64,
14364    pub given_up: i64,
14365    #[serde(default)]
14366    pub cursor: Option<String>,
14367}
14368
14369/// `ListAPIKeysResponse` model.
14370#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14371pub struct ListAPIKeysResponse {
14372    pub keys: Vec<APIKeySummary>,
14373    pub total: i64,
14374}
14375
14376/// `ListArbiterCasesResponse` model.
14377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14378pub struct ListArbiterCasesResponse {
14379    pub cases: Vec<ArbiterCase>,
14380}
14381
14382/// `ListAuthProvidersResponse` model.
14383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14384pub struct ListAuthProvidersResponse {
14385    pub items: Vec<ListAuthProvidersResponseItem>,
14386    /// Legacy alias for `items`.
14387    #[serde(default, skip_serializing_if = "Option::is_none")]
14388    pub providers: Option<Vec<AuthProvider>>,
14389}
14390
14391/// `ListAuthProvidersResponseItem` model.
14392#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14393pub struct ListAuthProvidersResponseItem {
14394    pub id: ListAuthProvidersResponseItemId,
14395    pub linked: bool,
14396    #[serde(default, skip_serializing_if = "Option::is_none")]
14397    pub sub: Option<String>,
14398    #[serde(default, skip_serializing_if = "Option::is_none")]
14399    pub email: Option<String>,
14400    #[serde(default, skip_serializing_if = "Option::is_none")]
14401    pub linked_at: Option<String>,
14402}
14403
14404/// `ListAuthProvidersResponseItemId` enumeration.
14405#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
14406pub enum ListAuthProvidersResponseItemId {
14407    #[default]
14408    #[serde(rename = "otp")]
14409    Otp,
14410    #[serde(rename = "github")]
14411    Github,
14412    #[serde(rename = "google")]
14413    Google,
14414    #[serde(rename = "apple")]
14415    Apple,
14416    /// A value the API introduced after this SDK was generated.
14417    #[serde(untagged)]
14418    Other(String),
14419}
14420
14421impl ListAuthProvidersResponseItemId {
14422    /// The value as it appears on the wire.
14423    pub fn as_str(&self) -> &str {
14424        match self {
14425            Self::Otp => "otp",
14426            Self::Github => "github",
14427            Self::Google => "google",
14428            Self::Apple => "apple",
14429            Self::Other(value) => value.as_str(),
14430        }
14431    }
14432}
14433
14434impl std::fmt::Display for ListAuthProvidersResponseItemId {
14435    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14436        f.write_str(self.as_str())
14437    }
14438}
14439
14440impl From<&str> for ListAuthProvidersResponseItemId {
14441    fn from(value: &str) -> Self {
14442        match value {
14443            "otp" => Self::Otp,
14444            "github" => Self::Github,
14445            "google" => Self::Google,
14446            "apple" => Self::Apple,
14447            other => Self::Other(other.to_string()),
14448        }
14449    }
14450}
14451
14452/// `ListBallotsResponse` model.
14453#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14454pub struct ListBallotsResponse {
14455    #[serde(default, skip_serializing_if = "Option::is_none")]
14456    pub ballots: Option<Vec<Ballot>>,
14457}
14458
14459/// `ListBillingPlansResponse` model.
14460#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14461pub struct ListBillingPlansResponse {
14462    #[serde(default, skip_serializing_if = "Option::is_none")]
14463    pub plans: Option<Vec<ListBillingPlansResponsePlan>>,
14464}
14465
14466/// `ListBillingPlansResponsePlan` model.
14467#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14468pub struct ListBillingPlansResponsePlan {
14469    #[serde(default, skip_serializing_if = "Option::is_none")]
14470    pub id: Option<String>,
14471    #[serde(default, skip_serializing_if = "Option::is_none")]
14472    pub name: Option<String>,
14473    #[serde(default, skip_serializing_if = "Option::is_none")]
14474    pub limits: Option<serde_json::Map<String, serde_json::Value>>,
14475    #[serde(default, skip_serializing_if = "Option::is_none")]
14476    pub current: Option<bool>,
14477    #[serde(default, skip_serializing_if = "Option::is_none")]
14478    pub checkout_available: Option<bool>,
14479    #[serde(default, skip_serializing_if = "Option::is_none")]
14480    pub price_amount_cents: Option<i64>,
14481    #[serde(default, skip_serializing_if = "Option::is_none")]
14482    pub price_currency: Option<String>,
14483}
14484
14485/// `ListBillingSpecPackagesResponse` model.
14486#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14487pub struct ListBillingSpecPackagesResponse {
14488    pub packages: Vec<serde_json::Map<String, serde_json::Value>>,
14489}
14490
14491/// `ListBuilderRequestsResponse` model.
14492#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14493pub struct ListBuilderRequestsResponse {
14494    pub requests: Vec<DesignRequest>,
14495}
14496
14497/// `ListCompaniesResponse` model.
14498#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14499pub struct ListCompaniesResponse {
14500    pub items: Vec<Company>,
14501    /// Opaque cursor for the next page; null on the last page.
14502    #[serde(default)]
14503    pub cursor: Option<String>,
14504    pub has_more: bool,
14505}
14506
14507/// `ListContentReportsResponse` model.
14508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14509pub struct ListContentReportsResponse {
14510    pub items: Vec<ContentReport>,
14511    #[serde(default)]
14512    pub cursor: Option<String>,
14513    pub has_more: bool,
14514}
14515
14516/// `ListCoreMemoryBlocksResponse` model.
14517#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14518pub struct ListCoreMemoryBlocksResponse {
14519    /// Whether the runtime injects these blocks (`core_memory.enabled`).
14520    pub enabled: bool,
14521    pub blocks: Vec<CoreMemoryBlock>,
14522    pub total: i64,
14523}
14524
14525/// `ListCustomPlansResponse` model.
14526#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14527pub struct ListCustomPlansResponse {
14528    pub plans: Vec<CustomPlan>,
14529    pub count: i64,
14530}
14531
14532/// `ListDataExplorerKeysResponse` model.
14533#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14534pub struct ListDataExplorerKeysResponse {
14535    #[serde(default, skip_serializing_if = "Option::is_none")]
14536    pub keys: Option<Vec<DataExplorerKey>>,
14537    /// Opaque cursor for the next page; null on the last page.
14538    #[serde(default, skip_serializing_if = "Option::is_none")]
14539    pub cursor: Option<String>,
14540    #[serde(default, skip_serializing_if = "Option::is_none")]
14541    pub has_more: Option<bool>,
14542}
14543
14544/// `ListDataExplorerNamespacesResponse` model.
14545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14546pub struct ListDataExplorerNamespacesResponse {
14547    #[serde(default, skip_serializing_if = "Option::is_none")]
14548    pub namespaces: Option<Vec<DataExplorerNamespace>>,
14549}
14550
14551/// `ListDatasetsResponse` model.
14552#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14553pub struct ListDatasetsResponse {
14554    pub datasets: Vec<EvalDataset>,
14555    pub total: i64,
14556}
14557
14558/// `ListDrawingOpsResponse` model.
14559#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14560pub struct ListDrawingOpsResponse {
14561    pub items: Vec<DrawingJournalEntry>,
14562    #[serde(default, skip_serializing_if = "Option::is_none")]
14563    pub cursor: Option<String>,
14564    pub has_more: bool,
14565    pub seq: i64,
14566}
14567
14568/// `ListEvalRunsResponse` model.
14569#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14570pub struct ListEvalRunsResponse {
14571    pub eval_runs: Vec<EvalRun>,
14572    pub total: i64,
14573}
14574
14575/// `ListExperimentsResponse` model.
14576#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14577pub struct ListExperimentsResponse {
14578    pub experiments: Vec<Experiment>,
14579    pub total: i64,
14580}
14581
14582/// `ListFeaturedSpecsResponse` model.
14583#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14584pub struct ListFeaturedSpecsResponse {
14585    pub featured: Vec<String>,
14586}
14587
14588/// `ListFeedbackResponse` model.
14589#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14590pub struct ListFeedbackResponse {
14591    pub reports: Vec<ErrorReport>,
14592    pub count: i64,
14593    pub new_count: i64,
14594}
14595
14596/// `ListFilesResponse` model.
14597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14598pub struct ListFilesResponse {
14599    #[serde(default, skip_serializing_if = "Option::is_none")]
14600    pub items: Option<Vec<FileEntry>>,
14601    /// Opaque cursor for the next page; null when no more pages.
14602    #[serde(default, skip_serializing_if = "Option::is_none")]
14603    pub cursor: Option<String>,
14604    #[serde(default, skip_serializing_if = "Option::is_none")]
14605    pub has_more: Option<bool>,
14606}
14607
14608/// `ListGoalsResponse` model.
14609#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14610pub struct ListGoalsResponse {
14611    #[serde(default, skip_serializing_if = "Option::is_none")]
14612    pub goals: Option<Vec<Goal>>,
14613}
14614
14615/// `ListGuardrailsResponse` model.
14616#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14617pub struct ListGuardrailsResponse {
14618    pub guardrails: Vec<Guardrail>,
14619    #[serde(default, skip_serializing_if = "Option::is_none")]
14620    pub total: Option<i64>,
14621}
14622
14623/// `ListIntegrationsCatalogResponse` model.
14624#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14625pub struct ListIntegrationsCatalogResponse {
14626    #[serde(default, skip_serializing_if = "Option::is_none")]
14627    pub connectors: Option<Vec<IntegrationCatalogItem>>,
14628}
14629
14630/// `ListIntegrationsResponse` model.
14631#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14632pub struct ListIntegrationsResponse {
14633    pub integrations: Vec<Integration>,
14634    #[serde(default, skip_serializing_if = "Option::is_none")]
14635    pub total: Option<i64>,
14636}
14637
14638/// `ListInvitesResponse` model.
14639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14640pub struct ListInvitesResponse {
14641    #[serde(default, skip_serializing_if = "Option::is_none")]
14642    pub items: Option<Vec<Invite>>,
14643    /// Legacy alias for `items`. Will be removed in API v1.x.
14644    #[serde(default, skip_serializing_if = "Option::is_none")]
14645    pub invites: Option<Vec<Invite>>,
14646    #[serde(default, skip_serializing_if = "Option::is_none")]
14647    pub total: Option<i64>,
14648}
14649
14650/// `ListKbDocumentsResponse` model.
14651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14652pub struct ListKbDocumentsResponse {
14653    #[serde(default, skip_serializing_if = "Option::is_none")]
14654    pub documents: Option<Vec<KnowledgeBaseDocument>>,
14655    #[serde(default, skip_serializing_if = "Option::is_none")]
14656    pub total: Option<i64>,
14657}
14658
14659/// `ListKnowledgeBasesResponse` model.
14660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14661pub struct ListKnowledgeBasesResponse {
14662    pub items: Vec<KnowledgeBase>,
14663    /// Legacy alias for `items`. Will be removed in API v1.x.
14664    #[serde(default, skip_serializing_if = "Option::is_none")]
14665    pub knowledge_bases: Option<Vec<KnowledgeBase>>,
14666    pub total: i64,
14667}
14668
14669/// `ListLLMCredentialsProvidersResponse` model.
14670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14671pub struct ListLLMCredentialsProvidersResponse {
14672    #[serde(default, skip_serializing_if = "Option::is_none")]
14673    pub providers: Option<Vec<ListLLMCredentialsProvidersResponseProvider>>,
14674}
14675
14676/// `ListLLMCredentialsProvidersResponseProvider` model.
14677#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14678pub struct ListLLMCredentialsProvidersResponseProvider {
14679    #[serde(default, skip_serializing_if = "Option::is_none")]
14680    pub id: Option<String>,
14681    /// Display name for UI (e.g. OpenAI, Stels)
14682    #[serde(default, skip_serializing_if = "Option::is_none")]
14683    pub name: Option<String>,
14684    #[serde(default, skip_serializing_if = "Option::is_none")]
14685    pub configured: Option<bool>,
14686    #[serde(default, skip_serializing_if = "Option::is_none")]
14687    pub local: Option<bool>,
14688    #[serde(default, skip_serializing_if = "Option::is_none")]
14689    pub default_endpoint: Option<String>,
14690}
14691
14692/// `ListLLMModelsResponse` model.
14693#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14694pub struct ListLLMModelsResponse {
14695    #[serde(default, skip_serializing_if = "Option::is_none")]
14696    pub models: Option<Vec<LLMModel>>,
14697}
14698
14699/// `ListMCPServersResponse` model.
14700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14701pub struct ListMCPServersResponse {
14702    pub servers: Vec<MCPServer>,
14703}
14704
14705/// `ListMemoriesResponse` model.
14706#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14707pub struct ListMemoriesResponse {
14708    pub memories: Vec<MemoryEntry>,
14709    pub total: i64,
14710}
14711
14712/// `ListMeSessionsResponse` model.
14713#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14714pub struct ListMeSessionsResponse {
14715    pub items: Vec<ActiveSession>,
14716    /// Legacy alias for `items`, byte-identical to it on the wire. It was described as a formless
14717    /// array while `items` carried the full shape, so a generated client saw one usable list and
14718    /// one bag of JSON for the same data.
14719    #[serde(default, skip_serializing_if = "Option::is_none")]
14720    pub sessions: Option<Vec<ActiveSession>>,
14721    pub total: i64,
14722}
14723
14724/// `ListMissionObjectivesResponse` model.
14725#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14726pub struct ListMissionObjectivesResponse {
14727    pub items: Vec<Objective>,
14728    pub total: i64,
14729}
14730
14731/// `ListMissionsResponse` model.
14732#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14733pub struct ListMissionsResponse {
14734    pub items: Vec<Mission>,
14735    /// Length of `items` in this response, not a tenant-wide count.
14736    pub total: i64,
14737}
14738
14739/// `ListModelsResponse` model.
14740#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14741pub struct ListModelsResponse {
14742    /// Always `list`.
14743    pub object: String,
14744    pub data: Vec<ListModelsResponseDataItem>,
14745}
14746
14747/// `ListModelsResponseDataItem` model.
14748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14749pub struct ListModelsResponseDataItem {
14750    pub id: String,
14751    /// Always `model`.
14752    pub object: String,
14753    #[serde(default, skip_serializing_if = "Option::is_none")]
14754    pub created: Option<i64>,
14755    #[serde(default, skip_serializing_if = "Option::is_none")]
14756    pub owned_by: Option<String>,
14757}
14758
14759/// `ListMyTenantsResponse` model.
14760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14761pub struct ListMyTenantsResponse {
14762    pub user_id: String,
14763    pub email: String,
14764    pub memberships: Vec<ListMyTenantsResponseMembership>,
14765    pub pending_invites: Vec<ListMyTenantsResponsePendingInvite>,
14766}
14767
14768/// `ListMyTenantsResponseMembership` model.
14769#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14770pub struct ListMyTenantsResponseMembership {
14771    pub tenant_id: String,
14772    pub user_id: String,
14773    pub name: String,
14774    #[serde(default, skip_serializing_if = "Option::is_none")]
14775    pub slug: Option<String>,
14776    #[serde(default, skip_serializing_if = "Option::is_none")]
14777    pub plan: Option<String>,
14778    #[serde(default, skip_serializing_if = "Option::is_none")]
14779    pub logo_url: Option<String>,
14780    pub role: String,
14781    pub is_sole_owner: bool,
14782    pub member_count: i64,
14783    #[serde(default, skip_serializing_if = "Option::is_none")]
14784    pub joined_at: Option<String>,
14785    /// Whether THIS credential can act in this tenant — its own tenant, or one an `X-Active-Tenant`
14786    /// override would be accepted for. The list is the PERSON's memberships and a credential may
14787    /// reach fewer of them: an api-key whose user has no record in the key's own tenant is refused
14788    /// everywhere but home. Without this field a client had to guess by matching `/me`.tenant.slug
14789    /// against the list. Describes the header only — `POST /me/tenants/switch` refuses every
14790    /// api-key regardless.
14791    pub accessible: bool,
14792}
14793
14794/// `ListMyTenantsResponsePendingInvite` model.
14795#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14796pub struct ListMyTenantsResponsePendingInvite {
14797    pub invite_id: String,
14798    pub tenant_id: String,
14799    pub tenant_name: String,
14800    pub role: String,
14801    pub expires_at: String,
14802    #[serde(default, skip_serializing_if = "Option::is_none")]
14803    pub invited_by_name: Option<String>,
14804    #[serde(default, skip_serializing_if = "Option::is_none")]
14805    pub secret: Option<String>,
14806}
14807
14808/// `ListNotificationsResponse` model.
14809#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14810pub struct ListNotificationsResponse {
14811    pub notifications: Vec<Notification>,
14812}
14813
14814/// `ListNotificationTargetsResponse` model.
14815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14816pub struct ListNotificationTargetsResponse {
14817    pub targets: Vec<NotificationTarget>,
14818}
14819
14820/// `ListPlaygroundTemplatesResponse` model.
14821#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14822pub struct ListPlaygroundTemplatesResponse {
14823    pub templates: Vec<PlaygroundTemplate>,
14824}
14825
14826/// `ListProgramsResponse` model.
14827#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14828pub struct ListProgramsResponse {
14829    pub programs: Vec<Program>,
14830}
14831
14832/// `ListProjectsResponse` model.
14833#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14834pub struct ListProjectsResponse {
14835    pub items: Vec<Project>,
14836    pub total: i64,
14837    pub archived_count: i64,
14838}
14839
14840/// `ListPromoCodesResponse` model.
14841#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14842pub struct ListPromoCodesResponse {
14843    pub codes: Vec<PromoCode>,
14844    pub count: i64,
14845}
14846
14847/// `ListPromoRewardsResponse` model.
14848#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14849pub struct ListPromoRewardsResponse {
14850    pub rewards: Vec<ListPromoRewardsResponseReward>,
14851    pub count: i64,
14852}
14853
14854/// `ListPromoRewardsResponseReward` model.
14855#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14856pub struct ListPromoRewardsResponseReward {
14857    pub code: String,
14858    pub owner_tenant_id: String,
14859    pub subscriber_tenant_id: String,
14860    pub tokens: i64,
14861    pub plan_id: String,
14862    pub granted_at: String,
14863}
14864
14865/// `ListProviderModelsResponse` model.
14866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14867pub struct ListProviderModelsResponse {
14868    /// Registered provider id (admin → Providers).
14869    pub provider: String,
14870    /// Base URL for this provider's API (e.g. <https://api.openai.com/v1>). Empty for custom.
14871    pub endpoint_url: String,
14872    pub models: Vec<ListProviderModelsResponseModel>,
14873    /// Present when models could not be fetched (e.g. provider not configured).
14874    #[serde(default, skip_serializing_if = "Option::is_none")]
14875    pub error: Option<String>,
14876}
14877
14878/// `ListProviderModelsResponseModel` model.
14879#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14880pub struct ListProviderModelsResponseModel {
14881    #[serde(default, skip_serializing_if = "Option::is_none")]
14882    pub id: Option<String>,
14883    #[serde(default, skip_serializing_if = "Option::is_none")]
14884    pub name: Option<String>,
14885    #[serde(default, skip_serializing_if = "Option::is_none")]
14886    pub created: Option<i64>,
14887    #[serde(default, skip_serializing_if = "Option::is_none")]
14888    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
14889}
14890
14891/// `ListProvidersResponse` model.
14892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14893pub struct ListProvidersResponse {
14894    pub providers: Vec<LLMProvider>,
14895}
14896
14897/// `ListPublicBlogPostsResponse` model.
14898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14899pub struct ListPublicBlogPostsResponse {
14900    pub blog: ListPublicBlogPostsResponseBlog,
14901    pub posts: Vec<PublicBlogPostSummary>,
14902    pub all_tags: Vec<String>,
14903    pub total: i64,
14904    pub page: i64,
14905    pub limit: i64,
14906    pub total_pages: i64,
14907}
14908
14909/// `ListPublicBlogPostsResponseBlog` model.
14910#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14911pub struct ListPublicBlogPostsResponseBlog {
14912    pub title: String,
14913    pub description: String,
14914}
14915
14916/// `ListPublicIntegrationsResponse` model.
14917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14918pub struct ListPublicIntegrationsResponse {
14919    pub connectors: Vec<ListPublicIntegrationsResponseConnector>,
14920    pub total: i64,
14921    /// Counted here rather than by the caller: a total a page derives is a total a page can get
14922    /// wrong, which is the defect this endpoint replaces.
14923    pub oauth_count: i64,
14924    pub api_key_count: i64,
14925}
14926
14927/// `ListPublicIntegrationsResponseConnector` model.
14928#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14929pub struct ListPublicIntegrationsResponseConnector {
14930    pub id: String,
14931    pub name: String,
14932    #[serde(default, skip_serializing_if = "Option::is_none")]
14933    pub description: Option<String>,
14934    #[serde(default, skip_serializing_if = "Option::is_none")]
14935    pub icon: Option<String>,
14936    pub auth_type: ListPublicIntegrationsResponseConnectorAuthType,
14937}
14938
14939/// `ListPublicIntegrationsResponseConnectorAuthType` enumeration.
14940#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
14941pub enum ListPublicIntegrationsResponseConnectorAuthType {
14942    #[default]
14943    #[serde(rename = "oauth2")]
14944    Oauth2,
14945    #[serde(rename = "api_key")]
14946    APIKey,
14947    /// A value the API introduced after this SDK was generated.
14948    #[serde(untagged)]
14949    Other(String),
14950}
14951
14952impl ListPublicIntegrationsResponseConnectorAuthType {
14953    /// The value as it appears on the wire.
14954    pub fn as_str(&self) -> &str {
14955        match self {
14956            Self::Oauth2 => "oauth2",
14957            Self::APIKey => "api_key",
14958            Self::Other(value) => value.as_str(),
14959        }
14960    }
14961}
14962
14963impl std::fmt::Display for ListPublicIntegrationsResponseConnectorAuthType {
14964    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14965        f.write_str(self.as_str())
14966    }
14967}
14968
14969impl From<&str> for ListPublicIntegrationsResponseConnectorAuthType {
14970    fn from(value: &str) -> Self {
14971        match value {
14972            "oauth2" => Self::Oauth2,
14973            "api_key" => Self::APIKey,
14974            other => Self::Other(other.to_string()),
14975        }
14976    }
14977}
14978
14979/// `ListPublicPlansResponse` model.
14980#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14981pub struct ListPublicPlansResponse {
14982    #[serde(default, skip_serializing_if = "Option::is_none")]
14983    pub plans: Option<Vec<PublicPlan>>,
14984}
14985
14986/// `ListPublicStatesResponse` model.
14987#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14988pub struct ListPublicStatesResponse {
14989    #[serde(default, skip_serializing_if = "Option::is_none")]
14990    pub states: Option<Vec<PublicState>>,
14991}
14992
14993/// `ListPublicTenantsResponse` model.
14994#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14995pub struct ListPublicTenantsResponse {
14996    #[serde(default, skip_serializing_if = "Option::is_none")]
14997    pub items: Option<Vec<PublicTenant>>,
14998    /// Opaque cursor for the next page; null when no more pages.
14999    #[serde(default, skip_serializing_if = "Option::is_none")]
15000    pub cursor: Option<String>,
15001    #[serde(default, skip_serializing_if = "Option::is_none")]
15002    pub has_more: Option<bool>,
15003    #[serde(default, skip_serializing_if = "Option::is_none")]
15004    pub total: Option<i64>,
15005}
15006
15007/// `ListRunArtifactsResponse` model.
15008#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15009pub struct ListRunArtifactsResponse {
15010    pub run_id: String,
15011    pub artifacts: Vec<Artifact>,
15012    pub total: i64,
15013}
15014
15015/// `ListRunCheckpointsResponse` model.
15016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15017pub struct ListRunCheckpointsResponse {
15018    #[serde(default, skip_serializing_if = "Option::is_none")]
15019    pub checkpoints: Option<Vec<RunCheckpoint>>,
15020}
15021
15022/// `ListRunsOrder` enumeration.
15023#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15024pub enum ListRunsOrder {
15025    #[default]
15026    #[serde(rename = "asc")]
15027    Asc,
15028    #[serde(rename = "desc")]
15029    Desc,
15030    /// A value the API introduced after this SDK was generated.
15031    #[serde(untagged)]
15032    Other(String),
15033}
15034
15035impl ListRunsOrder {
15036    /// The value as it appears on the wire.
15037    pub fn as_str(&self) -> &str {
15038        match self {
15039            Self::Asc => "asc",
15040            Self::Desc => "desc",
15041            Self::Other(value) => value.as_str(),
15042        }
15043    }
15044}
15045
15046impl std::fmt::Display for ListRunsOrder {
15047    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15048        f.write_str(self.as_str())
15049    }
15050}
15051
15052impl From<&str> for ListRunsOrder {
15053    fn from(value: &str) -> Self {
15054        match value {
15055            "asc" => Self::Asc,
15056            "desc" => Self::Desc,
15057            other => Self::Other(other.to_string()),
15058        }
15059    }
15060}
15061
15062/// `ListRunsResponse` model.
15063#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15064pub struct ListRunsResponse {
15065    pub items: Vec<Run>,
15066    /// Opaque cursor for the next page; null on the last page.
15067    #[serde(default, skip_serializing_if = "Option::is_none")]
15068    pub cursor: Option<String>,
15069    pub has_more: bool,
15070}
15071
15072/// `ListSchedulesResponse` model.
15073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15074pub struct ListSchedulesResponse {
15075    pub schedules: Vec<ScheduleSummary>,
15076}
15077
15078/// `ListSessionAnnotationsResponse` model.
15079#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15080pub struct ListSessionAnnotationsResponse {
15081    #[serde(default, skip_serializing_if = "Option::is_none")]
15082    pub items: Option<Vec<ListSessionAnnotationsResponseItem>>,
15083}
15084
15085/// `ListSessionAnnotationsResponseItem` model.
15086#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15087pub struct ListSessionAnnotationsResponseItem {
15088    #[serde(default, skip_serializing_if = "Option::is_none")]
15089    pub id: Option<String>,
15090    #[serde(default, skip_serializing_if = "Option::is_none")]
15091    pub message_id: Option<String>,
15092    #[serde(default, skip_serializing_if = "Option::is_none")]
15093    pub content: Option<String>,
15094    #[serde(default, skip_serializing_if = "Option::is_none")]
15095    pub author: Option<String>,
15096    #[serde(default, skip_serializing_if = "Option::is_none")]
15097    pub created_at: Option<String>,
15098    #[serde(default, skip_serializing_if = "Option::is_none")]
15099    pub resolved: Option<bool>,
15100}
15101
15102/// `ListSessionArtifactsResponse` model.
15103#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15104pub struct ListSessionArtifactsResponse {
15105    #[serde(default, skip_serializing_if = "Option::is_none")]
15106    pub artifacts: Option<Vec<Artifact>>,
15107}
15108
15109/// `ListSessionBranchesResponse` model.
15110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15111pub struct ListSessionBranchesResponse {
15112    pub session_id: String,
15113    pub branches: Vec<SessionBranch>,
15114    #[serde(default, skip_serializing_if = "Option::is_none")]
15115    pub active_branch: Option<String>,
15116    pub total: i64,
15117}
15118
15119/// `ListSessionDrawingsResponse` model.
15120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15121pub struct ListSessionDrawingsResponse {
15122    pub items: Vec<Drawing>,
15123    #[serde(default, skip_serializing_if = "Option::is_none")]
15124    pub cursor: Option<String>,
15125    pub has_more: bool,
15126}
15127
15128/// `ListSessionsResponse` model.
15129#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15130pub struct ListSessionsResponse {
15131    pub items: Vec<ListSessionsResponseItem>,
15132    #[serde(default)]
15133    pub cursor: Option<String>,
15134    pub has_more: bool,
15135}
15136
15137/// `ListSessionsResponseItem` model.
15138#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15139pub struct ListSessionsResponseItem {
15140    #[serde(default, skip_serializing_if = "Option::is_none")]
15141    pub created_by: Option<String>,
15142    pub session_id: String,
15143    pub tenant_id: String,
15144    pub agent_id: String,
15145    pub status: PublicSessionViewStatus,
15146    #[serde(default, skip_serializing_if = "Option::is_none")]
15147    pub conversation_history: Option<Vec<ConversationEntry>>,
15148    #[serde(default, skip_serializing_if = "Option::is_none")]
15149    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
15150    #[serde(default, skip_serializing_if = "Option::is_none")]
15151    pub runs: Option<Vec<String>>,
15152    #[serde(default, skip_serializing_if = "Option::is_none")]
15153    pub created_at: Option<String>,
15154    #[serde(default, skip_serializing_if = "Option::is_none")]
15155    pub updated_at: Option<String>,
15156    #[serde(default, skip_serializing_if = "Option::is_none")]
15157    pub expires_at: Option<String>,
15158    /// Team ID if session belongs to a team
15159    #[serde(default, skip_serializing_if = "Option::is_none")]
15160    pub team_id: Option<String>,
15161    /// Session branches for conversation forking
15162    #[serde(default, skip_serializing_if = "Option::is_none")]
15163    pub branches: Option<Vec<SessionBranch>>,
15164    /// Currently active branch ID
15165    #[serde(default, skip_serializing_if = "Option::is_none")]
15166    pub active_branch: Option<String>,
15167    /// How to handle concurrent runs in this session
15168    #[serde(default, skip_serializing_if = "Option::is_none")]
15169    pub queue_mode: Option<SessionQueueMode>,
15170    /// Per-conversation model override (in-chat model switcher). When set, runs in this session
15171    /// resolve their LLM from this config instead of the agent's default. Absent → agent default.
15172    #[serde(default, skip_serializing_if = "Option::is_none")]
15173    pub model_override: Option<ListSessionsResponseItemModelOverride>,
15174    #[serde(default, skip_serializing_if = "Option::is_none")]
15175    pub agent_name: Option<String>,
15176    #[serde(default, skip_serializing_if = "Option::is_none")]
15177    pub first_user_message: Option<String>,
15178    #[serde(default, skip_serializing_if = "Option::is_none")]
15179    pub last_message: Option<String>,
15180    #[serde(default, skip_serializing_if = "Option::is_none")]
15181    pub message_count: Option<i64>,
15182}
15183
15184/// Per-conversation model override (in-chat model switcher). When set, runs in this session
15185/// resolve their LLM from this config instead of the agent's default. Absent → agent default.
15186#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15187pub struct ListSessionsResponseItemModelOverride {
15188    pub provider: String,
15189    pub model_ref: String,
15190    #[serde(default, skip_serializing_if = "Option::is_none")]
15191    pub endpoint_url: Option<String>,
15192    #[serde(default, skip_serializing_if = "Option::is_none")]
15193    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
15194}
15195
15196/// `ListSessionTodosResponse` model.
15197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15198pub struct ListSessionTodosResponse {
15199    #[serde(default, skip_serializing_if = "Option::is_none")]
15200    pub items: Option<Vec<Todo>>,
15201    /// Legacy alias for `items`. Will be removed in API v1.x.
15202    #[serde(default, skip_serializing_if = "Option::is_none")]
15203    pub todos: Option<Vec<Todo>>,
15204    #[serde(default, skip_serializing_if = "Option::is_none")]
15205    pub total: Option<i64>,
15206}
15207
15208/// `ListSquadGraphEdgesResponse` model.
15209#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15210pub struct ListSquadGraphEdgesResponse {
15211    #[serde(default, skip_serializing_if = "Option::is_none")]
15212    pub edges: Option<Vec<TeamGraphEdge>>,
15213    #[serde(default, skip_serializing_if = "Option::is_none")]
15214    pub total: Option<i64>,
15215}
15216
15217/// `ListSquadGraphNodesResponse` model.
15218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15219pub struct ListSquadGraphNodesResponse {
15220    #[serde(default, skip_serializing_if = "Option::is_none")]
15221    pub nodes: Option<Vec<TeamGraphNode>>,
15222    #[serde(default, skip_serializing_if = "Option::is_none")]
15223    pub total: Option<i64>,
15224}
15225
15226/// `ListSquadRunsResponse` model.
15227#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15228pub struct ListSquadRunsResponse {
15229    #[serde(default, skip_serializing_if = "Option::is_none")]
15230    pub team_id: Option<String>,
15231    #[serde(default, skip_serializing_if = "Option::is_none")]
15232    pub runs: Option<Vec<TeamRunSummary>>,
15233    #[serde(default, skip_serializing_if = "Option::is_none")]
15234    pub total: Option<i64>,
15235}
15236
15237/// `ListSquadsResponse` model.
15238#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15239pub struct ListSquadsResponse {
15240    pub items: Vec<Team>,
15241    /// Legacy alias for `items`. Will be removed in API v1.x.
15242    #[serde(default, skip_serializing_if = "Option::is_none")]
15243    pub teams: Option<Vec<Team>>,
15244    #[serde(default, skip_serializing_if = "Option::is_none")]
15245    pub total: Option<i64>,
15246}
15247
15248/// `ListSubscriptionsResponse` model.
15249#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15250pub struct ListSubscriptionsResponse {
15251    #[serde(default, skip_serializing_if = "Option::is_none")]
15252    pub subscriptions: Option<Vec<MarketplaceSubscription>>,
15253}
15254
15255/// `ListTeamGraphEdgesResponse` model.
15256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15257pub struct ListTeamGraphEdgesResponse {
15258    #[serde(default, skip_serializing_if = "Option::is_none")]
15259    pub edges: Option<Vec<TeamGraphEdge>>,
15260    #[serde(default, skip_serializing_if = "Option::is_none")]
15261    pub total: Option<i64>,
15262}
15263
15264/// `ListTeamGraphNodesResponse` model.
15265#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15266pub struct ListTeamGraphNodesResponse {
15267    #[serde(default, skip_serializing_if = "Option::is_none")]
15268    pub nodes: Option<Vec<TeamGraphNode>>,
15269    #[serde(default, skip_serializing_if = "Option::is_none")]
15270    pub total: Option<i64>,
15271}
15272
15273/// `ListTeamRunsResponse` model.
15274#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15275pub struct ListTeamRunsResponse {
15276    #[serde(default, skip_serializing_if = "Option::is_none")]
15277    pub team_id: Option<String>,
15278    #[serde(default, skip_serializing_if = "Option::is_none")]
15279    pub runs: Option<Vec<TeamRunSummary>>,
15280    /// Rows in THIS page, not the total across pages.
15281    #[serde(default, skip_serializing_if = "Option::is_none")]
15282    pub total: Option<i64>,
15283    /// Pass back as `cursor` to continue. Absent on the last page.
15284    #[serde(default, skip_serializing_if = "Option::is_none")]
15285    pub cursor: Option<String>,
15286    #[serde(default, skip_serializing_if = "Option::is_none")]
15287    pub has_more: Option<bool>,
15288}
15289
15290/// `ListTeamsResponse` model.
15291#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15292pub struct ListTeamsResponse {
15293    pub items: Vec<Team>,
15294    /// Legacy alias for `items`. Will be removed in API v1.x.
15295    #[serde(default, skip_serializing_if = "Option::is_none")]
15296    pub teams: Option<Vec<Team>>,
15297    #[serde(default, skip_serializing_if = "Option::is_none")]
15298    pub total: Option<i64>,
15299}
15300
15301/// `ListTenantsResponse` model.
15302#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15303pub struct ListTenantsResponse {
15304    #[serde(default, skip_serializing_if = "Option::is_none")]
15305    pub tenants: Option<Vec<Tenant>>,
15306    #[serde(default, skip_serializing_if = "Option::is_none")]
15307    pub total: Option<i64>,
15308}
15309
15310/// `ListTodosResponse` model.
15311#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15312pub struct ListTodosResponse {
15313    #[serde(default, skip_serializing_if = "Option::is_none")]
15314    pub todos: Option<Vec<Todo>>,
15315}
15316
15317/// `ListUsersResponse` model.
15318#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15319pub struct ListUsersResponse {
15320    #[serde(default, skip_serializing_if = "Option::is_none")]
15321    pub items: Option<Vec<TenantUser>>,
15322    /// Legacy alias for `items`. Will be removed in API v1.x.
15323    #[serde(default, skip_serializing_if = "Option::is_none")]
15324    pub users: Option<Vec<TenantUser>>,
15325    #[serde(default, skip_serializing_if = "Option::is_none")]
15326    pub total: Option<i64>,
15327}
15328
15329/// `ListVideoProvidersResponse` model.
15330#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15331pub struct ListVideoProvidersResponse {
15332    #[serde(default, skip_serializing_if = "Option::is_none")]
15333    pub providers: Option<Vec<VideoProvider>>,
15334}
15335
15336/// `ListVotingProposalsResponse` model.
15337#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15338pub struct ListVotingProposalsResponse {
15339    #[serde(default, skip_serializing_if = "Option::is_none")]
15340    pub proposals: Option<Vec<VotingProposal>>,
15341}
15342
15343/// `ListWebhookDeliveriesResponse` model.
15344#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15345pub struct ListWebhookDeliveriesResponse {
15346    pub webhook_id: String,
15347    pub deliveries: Vec<WebhookDeliveryAttempt>,
15348    pub total: i64,
15349}
15350
15351/// `ListWebhooksResponse` model.
15352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15353pub struct ListWebhooksResponse {
15354    pub webhooks: Vec<WebhookSubscription>,
15355    pub total: i64,
15356}
15357
15358/// `ListWorkspaceFileHistoryResponse` model.
15359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15360pub struct ListWorkspaceFileHistoryResponse {
15361    /// The `path` as sent, not normalised.
15362    pub path: String,
15363    pub versions: Vec<WorkspaceFileVersion>,
15364    pub total: i64,
15365}
15366
15367/// The listing was documented as a description and nothing else, so a client could not learn
15368/// from the document that `etag` and `updated_at` are served here — the two fields a caller
15369/// needs to tell whether a file changed without downloading it, and the reason a console had to
15370/// diff whole workspaces. The projection is explicit in the handler: a field added to the
15371/// stored record does NOT appear here on its own.
15372#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15373pub struct ListWorkspaceFilesResponse {
15374    pub workspace_id: String,
15375    /// The directory listed, empty string for the workspace root.
15376    pub path: String,
15377    pub directories: Vec<String>,
15378    pub files: Vec<ListWorkspaceFilesResponseFile>,
15379}
15380
15381/// `ListWorkspaceFilesResponseFile` model.
15382#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15383pub struct ListWorkspaceFilesResponseFile {
15384    pub file_id: String,
15385    pub path: String,
15386    pub filename: String,
15387    pub mime_type: String,
15388    pub size_bytes: i64,
15389    #[serde(default, skip_serializing_if = "Option::is_none")]
15390    pub created_at: Option<String>,
15391    /// When this file was last written. Absent on records written before the field existed.
15392    #[serde(default, skip_serializing_if = "Option::is_none")]
15393    pub updated_at: Option<String>,
15394    /// Opaque version of this file's content. Compare two listings to find what a run changed
15395    /// without reading any bytes, and send it back as `If-Match` on a write to refuse an overwrite
15396    /// of something you have not seen. Absent on records written before the field existed — treat
15397    /// absence as UNKNOWN, not as unchanged.
15398    #[serde(default, skip_serializing_if = "Option::is_none")]
15399    pub etag: Option<String>,
15400}
15401
15402/// `ListWorkspacesResponse` model.
15403#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15404pub struct ListWorkspacesResponse {
15405    pub workspaces: Vec<Workspace>,
15406    #[serde(default, skip_serializing_if = "Option::is_none")]
15407    pub total: Option<i64>,
15408}
15409
15410/// `ListWorkspaceTrashResponse` model.
15411#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15412pub struct ListWorkspaceTrashResponse {
15413    #[serde(default, skip_serializing_if = "Option::is_none")]
15414    pub items: Option<Vec<TrashManifestEntry>>,
15415}
15416
15417/// `LLMModel` model.
15418#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15419pub struct LLMModel {
15420    pub display_name: String,
15421    pub id: String,
15422    pub max_context_tokens: i64,
15423    pub max_output_tokens: i64,
15424    pub pricing: serde_json::Map<String, serde_json::Value>,
15425    pub provider: String,
15426    pub supports_json_mode: bool,
15427    pub supports_streaming: bool,
15428    pub supports_tool_calls: bool,
15429    pub supports_vision: bool,
15430    pub tier: String,
15431}
15432
15433/// An LLM provider the platform knows about, and whether a key is configured.
15434#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15435pub struct LLMProvider {
15436    pub id: String,
15437    pub name: String,
15438    #[serde(default, skip_serializing_if = "Option::is_none")]
15439    pub canonical: Option<String>,
15440    pub configured: bool,
15441    #[serde(default, skip_serializing_if = "Option::is_none")]
15442    pub configured_level: Option<String>,
15443    #[serde(default, skip_serializing_if = "Option::is_none")]
15444    pub default_endpoint: Option<String>,
15445    #[serde(default, skip_serializing_if = "Option::is_none")]
15446    pub api_key_env: Option<String>,
15447    #[serde(default, skip_serializing_if = "Option::is_none")]
15448    pub local: Option<bool>,
15449}
15450
15451/// `LLMSynthesizeSpeechRequest` model.
15452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15453pub struct LLMSynthesizeSpeechRequest {
15454    #[serde(default, skip_serializing_if = "Option::is_none")]
15455    pub model: Option<String>,
15456    pub input: String,
15457    #[serde(default, skip_serializing_if = "Option::is_none")]
15458    pub voice: Option<String>,
15459    /// Passed THROUGH to the configured speech provider unchanged — the platform neither validates
15460    /// nor translates it, so a rejection here is the provider's, not ours, and its message is the
15461    /// provider's too. Deliberately not an enum: the accepted set belongs to whichever provider is
15462    /// configured, and pinning one here would refuse values a future provider accepts. Measured on
15463    /// production 2026-09-01 by the iOS lane against the current provider: `raw`, `wav` and `mp3`
15464    /// work; `pcm_s16le` and `pcm_f32le` answer 400. `raw` streams chunked pcm_f32le/44100/mono
15465    /// with a first byte at roughly 0.4s, which is what progressive playback needs.
15466    #[serde(default, skip_serializing_if = "Option::is_none")]
15467    pub response_format: Option<String>,
15468}
15469
15470/// `LLMTranscribeAudioRequest` model.
15471#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15472pub struct LLMTranscribeAudioRequest {
15473    pub file: FilePart,
15474    #[serde(default, skip_serializing_if = "Option::is_none")]
15475    pub model: Option<String>,
15476    #[serde(default, skip_serializing_if = "Option::is_none")]
15477    pub language: Option<String>,
15478}
15479
15480/// The provider body, byte for byte (llm-proxy.ts handleAudioTranscriptions): `{ text }` for
15481/// the default `response_format: json`; `verbose_json` adds `task`, `language`, `duration`,
15482/// `segments`.
15483#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15484pub struct LLMTranscribeAudioResponse {
15485    #[serde(default, skip_serializing_if = "Option::is_none")]
15486    pub text: Option<String>,
15487    /// Any additional properties the server returned.
15488    #[serde(flatten)]
15489    pub extra: HashMap<String, serde_json::Value>,
15490}
15491
15492/// `LLMUsageSummary` model.
15493#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15494pub struct LLMUsageSummary {
15495    #[serde(default, skip_serializing_if = "Option::is_none")]
15496    pub billing_period: Option<LLMUsageSummaryBillingPeriod>,
15497    #[serde(default, skip_serializing_if = "Option::is_none")]
15498    pub by_model: Option<Vec<String>>,
15499    #[serde(default, skip_serializing_if = "Option::is_none")]
15500    pub limits: Option<LLMUsageSummaryLimits>,
15501    #[serde(default, skip_serializing_if = "Option::is_none")]
15502    pub plan: Option<String>,
15503    #[serde(default, skip_serializing_if = "Option::is_none")]
15504    pub usage: Option<LLMUsageSummaryUsage>,
15505}
15506
15507/// `LLMUsageSummaryBillingPeriod` model.
15508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15509pub struct LLMUsageSummaryBillingPeriod {
15510    #[serde(default, skip_serializing_if = "Option::is_none")]
15511    pub end: Option<String>,
15512    #[serde(default, skip_serializing_if = "Option::is_none")]
15513    pub start: Option<String>,
15514}
15515
15516/// `LLMUsageSummaryLimits` model.
15517#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15518pub struct LLMUsageSummaryLimits {
15519    #[serde(default, skip_serializing_if = "Option::is_none")]
15520    pub requests_per_day: Option<i64>,
15521    #[serde(default, skip_serializing_if = "Option::is_none")]
15522    pub requests_per_hour: Option<i64>,
15523    #[serde(default, skip_serializing_if = "Option::is_none")]
15524    pub requests_per_minute: Option<i64>,
15525    #[serde(default, skip_serializing_if = "Option::is_none")]
15526    pub tokens_per_month: Option<i64>,
15527}
15528
15529/// `LLMUsageSummaryUsage` model.
15530#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15531pub struct LLMUsageSummaryUsage {
15532    #[serde(default, skip_serializing_if = "Option::is_none")]
15533    pub requests_this_hour: Option<i64>,
15534    #[serde(default, skip_serializing_if = "Option::is_none")]
15535    pub requests_this_minute: Option<i64>,
15536    #[serde(default, skip_serializing_if = "Option::is_none")]
15537    pub requests_today: Option<i64>,
15538    #[serde(default, skip_serializing_if = "Option::is_none")]
15539    pub tokens_remaining: Option<i64>,
15540    #[serde(default, skip_serializing_if = "Option::is_none")]
15541    pub tokens_used: Option<i64>,
15542}
15543
15544/// `LocateMyAgentResponse` model.
15545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15546pub struct LocateMyAgentResponse {
15547    pub tenant_id: String,
15548}
15549
15550/// `LogoutResponse` model.
15551#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15552pub struct LogoutResponse {
15553    pub ok: bool,
15554    #[serde(default, skip_serializing_if = "Option::is_none")]
15555    pub key_id: Option<String>,
15556    #[serde(default, skip_serializing_if = "Option::is_none")]
15557    pub already_revoked: Option<bool>,
15558}
15559
15560/// `MaintenanceState` model.
15561#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15562pub struct MaintenanceState {
15563    pub enabled: bool,
15564    /// Plain text rendered on the blocked page; the API does not render HTML. Absent when no
15565    /// message is set — a message that trims to empty is not stored.
15566    #[serde(default, skip_serializing_if = "Option::is_none")]
15567    pub message: Option<String>,
15568    /// When the most recent toggle happened.
15569    #[serde(default, skip_serializing_if = "Option::is_none")]
15570    pub enabled_at: Option<String>,
15571    /// Empty string for the synthetic default-off state — that state has no author.
15572    #[serde(default, skip_serializing_if = "Option::is_none")]
15573    pub enabled_by_email: Option<String>,
15574}
15575
15576/// Whether the platform is closed for maintenance. Unauthenticated: a client that cannot sign
15577/// in still needs to know why. `message` is plain text and is never rendered as HTML by the
15578/// API.
15579#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15580pub struct MaintenanceStatus {
15581    pub enabled: bool,
15582    /// Absent when no message was set.
15583    #[serde(default, skip_serializing_if = "Option::is_none")]
15584    pub message: Option<String>,
15585}
15586
15587/// `MarkAllNotificationsReadResponse` model.
15588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15589pub struct MarkAllNotificationsReadResponse {
15590    #[serde(default, skip_serializing_if = "Option::is_none")]
15591    pub marked: Option<i64>,
15592}
15593
15594/// `MarketplaceInvocation` model.
15595#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15596pub struct MarketplaceInvocation {
15597    pub invocation_id: String,
15598    pub caller_tenant_id: String,
15599    pub publisher_tenant_id: String,
15600    pub listing_id: String,
15601    pub agent_id: String,
15602    pub agent_version: String,
15603    pub input: serde_json::Map<String, serde_json::Value>,
15604    pub status: MarketplaceInvocationStatus,
15605    #[serde(default, skip_serializing_if = "Option::is_none")]
15606    pub output: Option<serde_json::Map<String, serde_json::Value>>,
15607    #[serde(default, skip_serializing_if = "Option::is_none")]
15608    pub metrics: Option<serde_json::Map<String, serde_json::Value>>,
15609    /// Set when the run succeeded but the publisher payout failed — not a failed run.
15610    #[serde(default, skip_serializing_if = "Option::is_none")]
15611    pub revenue_error: Option<String>,
15612    pub created_at: String,
15613    #[serde(default, skip_serializing_if = "Option::is_none")]
15614    pub completed_at: Option<String>,
15615}
15616
15617/// `MarketplaceInvocationStatus` enumeration.
15618#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15619pub enum MarketplaceInvocationStatus {
15620    #[default]
15621    #[serde(rename = "pending")]
15622    Pending,
15623    #[serde(rename = "running")]
15624    Running,
15625    #[serde(rename = "completed")]
15626    Completed,
15627    #[serde(rename = "failed")]
15628    Failed,
15629    /// A value the API introduced after this SDK was generated.
15630    #[serde(untagged)]
15631    Other(String),
15632}
15633
15634impl MarketplaceInvocationStatus {
15635    /// The value as it appears on the wire.
15636    pub fn as_str(&self) -> &str {
15637        match self {
15638            Self::Pending => "pending",
15639            Self::Running => "running",
15640            Self::Completed => "completed",
15641            Self::Failed => "failed",
15642            Self::Other(value) => value.as_str(),
15643        }
15644    }
15645}
15646
15647impl std::fmt::Display for MarketplaceInvocationStatus {
15648    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15649        f.write_str(self.as_str())
15650    }
15651}
15652
15653impl From<&str> for MarketplaceInvocationStatus {
15654    fn from(value: &str) -> Self {
15655        match value {
15656            "pending" => Self::Pending,
15657            "running" => Self::Running,
15658            "completed" => Self::Completed,
15659            "failed" => Self::Failed,
15660            other => Self::Other(other.to_string()),
15661        }
15662    }
15663}
15664
15665/// `MarketplaceListing` model.
15666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15667pub struct MarketplaceListing {
15668    pub listing_id: String,
15669    pub tenant_id: String,
15670    pub agent_id: String,
15671    pub agent_version: String,
15672    pub name: String,
15673    pub description: String,
15674    pub category: MarketplaceListingCategory,
15675    pub tags: Vec<String>,
15676    #[serde(default, skip_serializing_if = "Option::is_none")]
15677    pub icon_url: Option<String>,
15678    pub readme: String,
15679    pub pricing: MarketplaceListingPricing,
15680    pub stats: MarketplaceListingStats,
15681    pub status: MarketplaceListingStatus,
15682    pub a2a_enabled: bool,
15683    #[serde(default, skip_serializing_if = "Option::is_none")]
15684    pub program_id: Option<String>,
15685    pub created_at: String,
15686    pub updated_at: String,
15687}
15688
15689/// `MarketplaceListingCategory` enumeration.
15690#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15691pub enum MarketplaceListingCategory {
15692    #[default]
15693    #[serde(rename = "coding")]
15694    Coding,
15695    #[serde(rename = "writing")]
15696    Writing,
15697    #[serde(rename = "research")]
15698    Research,
15699    #[serde(rename = "data")]
15700    Data,
15701    #[serde(rename = "automation")]
15702    Automation,
15703    #[serde(rename = "creative")]
15704    Creative,
15705    #[serde(rename = "education")]
15706    Education,
15707    #[serde(rename = "business")]
15708    Business,
15709    #[serde(rename = "other")]
15710    Other,
15711    /// A value the API introduced after this SDK was generated.
15712    #[serde(untagged)]
15713    Unknown(String),
15714}
15715
15716impl MarketplaceListingCategory {
15717    /// The value as it appears on the wire.
15718    pub fn as_str(&self) -> &str {
15719        match self {
15720            Self::Coding => "coding",
15721            Self::Writing => "writing",
15722            Self::Research => "research",
15723            Self::Data => "data",
15724            Self::Automation => "automation",
15725            Self::Creative => "creative",
15726            Self::Education => "education",
15727            Self::Business => "business",
15728            Self::Other => "other",
15729            Self::Unknown(value) => value.as_str(),
15730        }
15731    }
15732}
15733
15734impl std::fmt::Display for MarketplaceListingCategory {
15735    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15736        f.write_str(self.as_str())
15737    }
15738}
15739
15740impl From<&str> for MarketplaceListingCategory {
15741    fn from(value: &str) -> Self {
15742        match value {
15743            "coding" => Self::Coding,
15744            "writing" => Self::Writing,
15745            "research" => Self::Research,
15746            "data" => Self::Data,
15747            "automation" => Self::Automation,
15748            "creative" => Self::Creative,
15749            "education" => Self::Education,
15750            "business" => Self::Business,
15751            "other" => Self::Other,
15752            other => Self::Unknown(other.to_string()),
15753        }
15754    }
15755}
15756
15757/// `MarketplaceListingPricing` model.
15758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15759pub struct MarketplaceListingPricing {
15760    pub model: MarketplaceListingPricingModel,
15761    #[serde(default, skip_serializing_if = "Option::is_none")]
15762    pub price_per_run_usd: Option<f64>,
15763    #[serde(default, skip_serializing_if = "Option::is_none")]
15764    pub price_per_1k_tokens_usd: Option<f64>,
15765    #[serde(default, skip_serializing_if = "Option::is_none")]
15766    pub stripe_price_id: Option<String>,
15767}
15768
15769/// `MarketplaceListingPricingModel` enumeration.
15770#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15771pub enum MarketplaceListingPricingModel {
15772    #[default]
15773    #[serde(rename = "free")]
15774    Free,
15775    #[serde(rename = "per_run")]
15776    PerRun,
15777    #[serde(rename = "per_token")]
15778    PerToken,
15779    #[serde(rename = "subscription")]
15780    Subscription,
15781    /// A value the API introduced after this SDK was generated.
15782    #[serde(untagged)]
15783    Other(String),
15784}
15785
15786impl MarketplaceListingPricingModel {
15787    /// The value as it appears on the wire.
15788    pub fn as_str(&self) -> &str {
15789        match self {
15790            Self::Free => "free",
15791            Self::PerRun => "per_run",
15792            Self::PerToken => "per_token",
15793            Self::Subscription => "subscription",
15794            Self::Other(value) => value.as_str(),
15795        }
15796    }
15797}
15798
15799impl std::fmt::Display for MarketplaceListingPricingModel {
15800    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15801        f.write_str(self.as_str())
15802    }
15803}
15804
15805impl From<&str> for MarketplaceListingPricingModel {
15806    fn from(value: &str) -> Self {
15807        match value {
15808            "free" => Self::Free,
15809            "per_run" => Self::PerRun,
15810            "per_token" => Self::PerToken,
15811            "subscription" => Self::Subscription,
15812            other => Self::Other(other.to_string()),
15813        }
15814    }
15815}
15816
15817/// `MarketplaceListingRating` model.
15818#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15819pub struct MarketplaceListingRating {
15820    pub rating_id: String,
15821    pub listing_id: String,
15822    #[serde(default, skip_serializing_if = "Option::is_none")]
15823    pub tenant_id: Option<String>,
15824    pub rating: i64,
15825    #[serde(default, skip_serializing_if = "Option::is_none")]
15826    pub review: Option<String>,
15827    #[serde(default, skip_serializing_if = "Option::is_none")]
15828    pub comment: Option<String>,
15829    pub created_at: String,
15830}
15831
15832/// `MarketplaceListingStats` model.
15833#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15834pub struct MarketplaceListingStats {
15835    pub total_runs: i64,
15836    pub avg_rating: f64,
15837    pub total_ratings: i64,
15838    pub avg_latency_ms: f64,
15839    pub success_rate: f64,
15840}
15841
15842/// `MarketplaceListingStatus` enumeration.
15843#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15844pub enum MarketplaceListingStatus {
15845    #[default]
15846    #[serde(rename = "draft")]
15847    Draft,
15848    #[serde(rename = "published")]
15849    Published,
15850    #[serde(rename = "suspended")]
15851    Suspended,
15852    #[serde(rename = "archived")]
15853    Archived,
15854    /// A value the API introduced after this SDK was generated.
15855    #[serde(untagged)]
15856    Other(String),
15857}
15858
15859impl MarketplaceListingStatus {
15860    /// The value as it appears on the wire.
15861    pub fn as_str(&self) -> &str {
15862        match self {
15863            Self::Draft => "draft",
15864            Self::Published => "published",
15865            Self::Suspended => "suspended",
15866            Self::Archived => "archived",
15867            Self::Other(value) => value.as_str(),
15868        }
15869    }
15870}
15871
15872impl std::fmt::Display for MarketplaceListingStatus {
15873    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15874        f.write_str(self.as_str())
15875    }
15876}
15877
15878impl From<&str> for MarketplaceListingStatus {
15879    fn from(value: &str) -> Self {
15880        match value {
15881            "draft" => Self::Draft,
15882            "published" => Self::Published,
15883            "suspended" => Self::Suspended,
15884            "archived" => Self::Archived,
15885            other => Self::Other(other.to_string()),
15886        }
15887    }
15888}
15889
15890/// marketplace/listing-store.ts MarketplaceSubscription — on subscribe, `status` is `active`,
15891/// `stripe_subscription_id` is always present (the route rejects a body without it) and
15892/// `created_at` equals `updated_at`.
15893#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15894pub struct MarketplaceSubscription {
15895    pub listing_id: String,
15896    pub status: MarketplaceSubscriptionStatus,
15897    /// The Stripe subscription (`sub_…`) the tenant pays through. Written by the bootstrap path and
15898    /// — since 2026-09-11 — by the subscription webhook (created/updated); cleared when the
15899    /// subscription is deleted. Absent while the tenant has none, and on tenants whose subscription
15900    /// arrived before the webhook stored it.
15901    #[serde(default, skip_serializing_if = "Option::is_none")]
15902    pub stripe_subscription_id: Option<String>,
15903    pub created_at: String,
15904    #[serde(default, skip_serializing_if = "Option::is_none")]
15905    pub updated_at: Option<String>,
15906}
15907
15908/// `MarketplaceSubscriptionStatus` enumeration.
15909#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
15910pub enum MarketplaceSubscriptionStatus {
15911    #[default]
15912    #[serde(rename = "active")]
15913    Active,
15914    #[serde(rename = "cancelled")]
15915    Cancelled,
15916    /// A value the API introduced after this SDK was generated.
15917    #[serde(untagged)]
15918    Other(String),
15919}
15920
15921impl MarketplaceSubscriptionStatus {
15922    /// The value as it appears on the wire.
15923    pub fn as_str(&self) -> &str {
15924        match self {
15925            Self::Active => "active",
15926            Self::Cancelled => "cancelled",
15927            Self::Other(value) => value.as_str(),
15928        }
15929    }
15930}
15931
15932impl std::fmt::Display for MarketplaceSubscriptionStatus {
15933    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15934        f.write_str(self.as_str())
15935    }
15936}
15937
15938impl From<&str> for MarketplaceSubscriptionStatus {
15939    fn from(value: &str) -> Self {
15940        match value {
15941            "active" => Self::Active,
15942            "cancelled" => Self::Cancelled,
15943            other => Self::Other(other.to_string()),
15944        }
15945    }
15946}
15947
15948/// `MarkNotificationReadResponse` model.
15949#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15950pub struct MarkNotificationReadResponse {
15951    pub ok: bool,
15952}
15953
15954/// `MaterializeCanvasSquadRequest` model.
15955#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15956pub struct MaterializeCanvasSquadRequest {
15957    pub supervisor_agent_id: String,
15958    /// Defaults to the saved layout's outgoing edges.
15959    #[serde(default, skip_serializing_if = "Option::is_none")]
15960    pub worker_ids: Option<Vec<String>>,
15961}
15962
15963/// `MaterializeCanvasSquadResponse` model.
15964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15965pub struct MaterializeCanvasSquadResponse {
15966    pub team_id: String,
15967    pub created: bool,
15968    pub worker_count: i64,
15969}
15970
15971/// `McpjsonRpcRequest` model.
15972#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15973pub struct McpjsonRpcRequest {
15974    /// Always `2.0`.
15975    pub jsonrpc: String,
15976    pub method: String,
15977    #[serde(default, skip_serializing_if = "Option::is_none")]
15978    pub params: Option<serde_json::Map<String, serde_json::Value>>,
15979    #[serde(default, skip_serializing_if = "Option::is_none")]
15980    pub id: Option<serde_json::Value>,
15981}
15982
15983/// An MCP server as returned. `env` and `env_encrypted` are stripped; only the COUNT is
15984/// disclosed.
15985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15986pub struct MCPServer {
15987    pub id: String,
15988    pub name: String,
15989    pub transport: MCPTransport,
15990    /// stdio only.
15991    #[serde(default, skip_serializing_if = "Option::is_none")]
15992    pub command: Option<String>,
15993    #[serde(default, skip_serializing_if = "Option::is_none")]
15994    pub args: Option<Vec<String>>,
15995    /// http / streamable_http only.
15996    #[serde(default, skip_serializing_if = "Option::is_none")]
15997    pub url: Option<String>,
15998    #[serde(default, skip_serializing_if = "Option::is_none")]
15999    pub api_key_ref: Option<String>,
16000    #[serde(default, skip_serializing_if = "Option::is_none")]
16001    pub auth: Option<MCPServerAuth>,
16002    /// Agents allowed to use this server's tools. Absent or empty means no agent sees them —
16003    /// installing a server does not connect it. Set it with PUT
16004    /// /api/v1/agents/{agentId}/mcp-servers, or pass it when installing.
16005    #[serde(default, skip_serializing_if = "Option::is_none")]
16006    pub assigned_agent_ids: Option<Vec<String>>,
16007    /// How many env vars are set. The values are never returned.
16008    #[serde(default, skip_serializing_if = "Option::is_none")]
16009    pub env_count: Option<i64>,
16010    #[serde(default, skip_serializing_if = "Option::is_none")]
16011    pub egress_allowlist: Option<Vec<EgressRule>>,
16012    pub enabled: bool,
16013    /// Tool names and resource URIs discovered from the server.
16014    #[serde(default, skip_serializing_if = "Option::is_none")]
16015    pub capabilities: Option<Vec<String>>,
16016    #[serde(default, skip_serializing_if = "Option::is_none")]
16017    pub status: Option<MCPServerStatus>,
16018    #[serde(default, skip_serializing_if = "Option::is_none")]
16019    pub last_synced: Option<String>,
16020    #[serde(default, skip_serializing_if = "Option::is_none")]
16021    pub tenant_id: Option<String>,
16022}
16023
16024/// How an http / streamable_http server is authenticated. The secret itself travels in `env`
16025/// under `env_key` and is encrypted at rest; it is never returned. Query-string placement is
16026/// not offered: a key in a URL lands in every proxy log on the way.
16027#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16028pub struct MCPServerAuth {
16029    pub r#type: MCPServerAuthType,
16030    /// Header carrying the secret. Default `Authorization`. Must be an RFC 9110 field name, and may
16031    /// not be one the platform sets itself (`Origin`, `Host`, `Content-Type`, `Accept`).
16032    #[serde(default, skip_serializing_if = "Option::is_none")]
16033    pub header: Option<String>,
16034    /// Value prefix. Defaults to `Bearer ` for `Authorization`, empty for any other header.
16035    #[serde(default, skip_serializing_if = "Option::is_none")]
16036    pub prefix: Option<String>,
16037    /// Key inside `env` holding the secret. Default `MCP_API_KEY`.
16038    #[serde(default, skip_serializing_if = "Option::is_none")]
16039    pub env_key: Option<String>,
16040}
16041
16042/// `MCPServerAuthType` enumeration.
16043#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16044pub enum MCPServerAuthType {
16045    #[default]
16046    #[serde(rename = "none")]
16047    None,
16048    #[serde(rename = "api_key")]
16049    APIKey,
16050    /// A value the API introduced after this SDK was generated.
16051    #[serde(untagged)]
16052    Other(String),
16053}
16054
16055impl MCPServerAuthType {
16056    /// The value as it appears on the wire.
16057    pub fn as_str(&self) -> &str {
16058        match self {
16059            Self::None => "none",
16060            Self::APIKey => "api_key",
16061            Self::Other(value) => value.as_str(),
16062        }
16063    }
16064}
16065
16066impl std::fmt::Display for MCPServerAuthType {
16067    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16068        f.write_str(self.as_str())
16069    }
16070}
16071
16072impl From<&str> for MCPServerAuthType {
16073    fn from(value: &str) -> Self {
16074        match value {
16075            "none" => Self::None,
16076            "api_key" => Self::APIKey,
16077            other => Self::Other(other.to_string()),
16078        }
16079    }
16080}
16081
16082/// `MCPServerStatus` enumeration.
16083#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16084pub enum MCPServerStatus {
16085    #[default]
16086    #[serde(rename = "active")]
16087    Active,
16088    #[serde(rename = "error")]
16089    Error,
16090    #[serde(rename = "disabled")]
16091    Disabled,
16092    /// A value the API introduced after this SDK was generated.
16093    #[serde(untagged)]
16094    Other(String),
16095}
16096
16097impl MCPServerStatus {
16098    /// The value as it appears on the wire.
16099    pub fn as_str(&self) -> &str {
16100        match self {
16101            Self::Active => "active",
16102            Self::Error => "error",
16103            Self::Disabled => "disabled",
16104            Self::Other(value) => value.as_str(),
16105        }
16106    }
16107}
16108
16109impl std::fmt::Display for MCPServerStatus {
16110    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16111        f.write_str(self.as_str())
16112    }
16113}
16114
16115impl From<&str> for MCPServerStatus {
16116    fn from(value: &str) -> Self {
16117        match value {
16118            "active" => Self::Active,
16119            "error" => Self::Error,
16120            "disabled" => Self::Disabled,
16121            other => Self::Other(other.to_string()),
16122        }
16123    }
16124}
16125
16126/// `MCPServerTestResult` model.
16127#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16128pub struct MCPServerTestResult {
16129    pub ok: bool,
16130    /// The MCP session status on success; the literal `error` when the probe failed.
16131    pub status: String,
16132    /// Present only when `ok` is true.
16133    #[serde(default, skip_serializing_if = "Option::is_none")]
16134    pub tool_count: Option<i64>,
16135    /// Present only when `ok` is true.
16136    #[serde(default, skip_serializing_if = "Option::is_none")]
16137    pub tools: Option<Vec<MCPTestTool>>,
16138    /// Present only when `ok` is false.
16139    #[serde(default, skip_serializing_if = "Option::is_none")]
16140    pub error: Option<String>,
16141    pub latency_ms: i64,
16142}
16143
16144/// `MCPServerWithConnectResult` model.
16145#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16146pub struct MCPServerWithConnectResult {
16147    pub id: String,
16148    pub name: String,
16149    pub transport: MCPTransport,
16150    /// stdio only.
16151    #[serde(default, skip_serializing_if = "Option::is_none")]
16152    pub command: Option<String>,
16153    #[serde(default, skip_serializing_if = "Option::is_none")]
16154    pub args: Option<Vec<String>>,
16155    /// http / streamable_http only.
16156    #[serde(default, skip_serializing_if = "Option::is_none")]
16157    pub url: Option<String>,
16158    #[serde(default, skip_serializing_if = "Option::is_none")]
16159    pub api_key_ref: Option<String>,
16160    #[serde(default, skip_serializing_if = "Option::is_none")]
16161    pub auth: Option<MCPServerAuth>,
16162    /// Agents allowed to use this server's tools. Absent or empty means no agent sees them —
16163    /// installing a server does not connect it. Set it with PUT
16164    /// /api/v1/agents/{agentId}/mcp-servers, or pass it when installing.
16165    #[serde(default, skip_serializing_if = "Option::is_none")]
16166    pub assigned_agent_ids: Option<Vec<String>>,
16167    /// How many env vars are set. The values are never returned.
16168    #[serde(default, skip_serializing_if = "Option::is_none")]
16169    pub env_count: Option<i64>,
16170    #[serde(default, skip_serializing_if = "Option::is_none")]
16171    pub egress_allowlist: Option<Vec<EgressRule>>,
16172    pub enabled: bool,
16173    /// Tool names and resource URIs discovered from the server.
16174    #[serde(default, skip_serializing_if = "Option::is_none")]
16175    pub capabilities: Option<Vec<String>>,
16176    #[serde(default, skip_serializing_if = "Option::is_none")]
16177    pub status: Option<MCPServerStatus>,
16178    #[serde(default, skip_serializing_if = "Option::is_none")]
16179    pub last_synced: Option<String>,
16180    #[serde(default, skip_serializing_if = "Option::is_none")]
16181    pub tenant_id: Option<String>,
16182    /// Set when the record saved but the session could not be reconnected. This is the only field
16183    /// distinguishing 'saved' from 'saved and working', and it arrives on a 200.
16184    #[serde(default, skip_serializing_if = "Option::is_none")]
16185    pub connect_error: Option<String>,
16186}
16187
16188/// `MCPTestTool` model.
16189#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16190pub struct MCPTestTool {
16191    pub name: String,
16192    pub description: String,
16193}
16194
16195/// `stdio` is blocked in production unless UARP_ALLOW_MCP_STDIO=true.
16196#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16197pub enum MCPTransport {
16198    #[default]
16199    #[serde(rename = "stdio")]
16200    Stdio,
16201    #[serde(rename = "http")]
16202    HTTP,
16203    #[serde(rename = "streamable_http")]
16204    StreamableHTTP,
16205    /// A value the API introduced after this SDK was generated.
16206    #[serde(untagged)]
16207    Other(String),
16208}
16209
16210impl MCPTransport {
16211    /// The value as it appears on the wire.
16212    pub fn as_str(&self) -> &str {
16213        match self {
16214            Self::Stdio => "stdio",
16215            Self::HTTP => "http",
16216            Self::StreamableHTTP => "streamable_http",
16217            Self::Other(value) => value.as_str(),
16218        }
16219    }
16220}
16221
16222impl std::fmt::Display for MCPTransport {
16223    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16224        f.write_str(self.as_str())
16225    }
16226}
16227
16228impl From<&str> for MCPTransport {
16229    fn from(value: &str) -> Self {
16230        match value {
16231            "stdio" => Self::Stdio,
16232            "http" => Self::HTTP,
16233            "streamable_http" => Self::StreamableHTTP,
16234            other => Self::Other(other.to_string()),
16235        }
16236    }
16237}
16238
16239/// providers.ts listMediaProviders — image and video providers.
16240#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16241pub struct MediaProvider {
16242    pub id: String,
16243    pub name: String,
16244    pub configured: bool,
16245    pub local: bool,
16246    pub models: Vec<ModelInfo>,
16247}
16248
16249/// `MemoryEntry` model.
16250#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16251pub struct MemoryEntry {
16252    #[serde(default, skip_serializing_if = "Option::is_none")]
16253    pub agent_id: Option<String>,
16254    #[serde(default, skip_serializing_if = "Option::is_none")]
16255    pub tenant_id: Option<String>,
16256    #[serde(default, skip_serializing_if = "Option::is_none")]
16257    pub access_count: Option<i64>,
16258    #[serde(default, skip_serializing_if = "Option::is_none")]
16259    pub last_accessed_at: Option<String>,
16260    #[serde(default, skip_serializing_if = "Option::is_none")]
16261    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
16262    /// Present on entries written from a run (seen on some e2e-canon entries, absent on others).
16263    #[serde(default, skip_serializing_if = "Option::is_none")]
16264    pub run_outcome: Option<String>,
16265    /// Present on entity entries only (e2e-canon).
16266    #[serde(default, skip_serializing_if = "Option::is_none")]
16267    pub entity_name: Option<String>,
16268    /// Present on entity entries only (e2e-canon).
16269    #[serde(default, skip_serializing_if = "Option::is_none")]
16270    pub entity_type: Option<String>,
16271    pub entry_id: String,
16272    #[serde(default, skip_serializing_if = "Option::is_none")]
16273    pub r#type: Option<MemoryEntryType>,
16274    pub content: String,
16275    #[serde(default, skip_serializing_if = "Option::is_none")]
16276    pub tags: Option<Vec<String>>,
16277    #[serde(default, skip_serializing_if = "Option::is_none")]
16278    pub relevance_score: Option<f64>,
16279    #[serde(default, skip_serializing_if = "Option::is_none")]
16280    pub created_at: Option<String>,
16281    #[serde(default, skip_serializing_if = "Option::is_none")]
16282    pub source_run_id: Option<String>,
16283}
16284
16285/// `MemoryEntryType` enumeration.
16286#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16287pub enum MemoryEntryType {
16288    #[default]
16289    #[serde(rename = "episodic")]
16290    Episodic,
16291    #[serde(rename = "semantic")]
16292    Semantic,
16293    #[serde(rename = "procedural")]
16294    Procedural,
16295    #[serde(rename = "note")]
16296    Note,
16297    /// A value the API introduced after this SDK was generated.
16298    #[serde(untagged)]
16299    Other(String),
16300}
16301
16302impl MemoryEntryType {
16303    /// The value as it appears on the wire.
16304    pub fn as_str(&self) -> &str {
16305        match self {
16306            Self::Episodic => "episodic",
16307            Self::Semantic => "semantic",
16308            Self::Procedural => "procedural",
16309            Self::Note => "note",
16310            Self::Other(value) => value.as_str(),
16311        }
16312    }
16313}
16314
16315impl std::fmt::Display for MemoryEntryType {
16316    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16317        f.write_str(self.as_str())
16318    }
16319}
16320
16321impl From<&str> for MemoryEntryType {
16322    fn from(value: &str) -> Self {
16323        match value {
16324            "episodic" => Self::Episodic,
16325            "semantic" => Self::Semantic,
16326            "procedural" => Self::Procedural,
16327            "note" => Self::Note,
16328            other => Self::Other(other.to_string()),
16329        }
16330    }
16331}
16332
16333/// `MemoryImportEntry` model.
16334#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16335pub struct MemoryImportEntry {
16336    pub content: String,
16337    #[serde(default, skip_serializing_if = "Option::is_none")]
16338    pub r#type: Option<String>,
16339    #[serde(default, skip_serializing_if = "Option::is_none")]
16340    pub tags: Option<Vec<String>>,
16341    #[serde(default, skip_serializing_if = "Option::is_none")]
16342    pub created_at: Option<String>,
16343}
16344
16345/// POST /auth/mfa/enrol (mfa.ts): the TOTP secret, its otpauth URL and the one-time recovery
16346/// codes — shown once.
16347#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16348pub struct MfaEnrolment {
16349    pub otpauth_url: String,
16350    pub secret: String,
16351    pub recovery_codes: Vec<String>,
16352}
16353
16354/// `MintLoginNonceResponse` model.
16355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16356pub struct MintLoginNonceResponse {
16357    /// Embed verbatim as the OIDC `nonce` of the next sign-in attempt.
16358    pub nonce: String,
16359    /// Seconds the nonce stays valid if unused.
16360    pub expires_in_s: i64,
16361}
16362
16363/// `MintSSETokenResponse` model.
16364#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16365pub struct MintSSETokenResponse {
16366    /// Bearer-shape API key. Pass as `?token=\<token\>` on SSE/WS endpoints.
16367    pub token: String,
16368    pub expires_at: String,
16369}
16370
16371/// A Mission Execution Framework run: a goal decomposed into objectives, executed under an
16372/// authorization gate with checkpoints and an after-action review. Sent by every mission
16373/// endpoint that answers with the record itself.
16374#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16375pub struct Mission {
16376    pub mission_id: String,
16377    pub tenant_id: String,
16378    /// Chat session the mission was started from.
16379    pub session_id: String,
16380    /// User id, or an agent id when a sub-mission was spawned by an agent.
16381    pub created_by: String,
16382    /// The requester's goal, verbatim.
16383    pub goal: String,
16384    /// Why MEF took the request. `quick_reply` never reaches execution.
16385    pub classification: MissionClassification,
16386    /// Lifecycle state. `completed`, `failed` and `aborted` are terminal.
16387    pub status: MissionStatus,
16388    /// Root objective ids in plan order.
16389    pub objective_ids: Vec<String>,
16390    /// Appended chronologically as objectives verify; a resume replays from the last one.
16391    pub checkpoint_ids: Vec<String>,
16392    /// Set once the after-action review is finalized — see GET /missions/{missionId}/aar.
16393    #[serde(default, skip_serializing_if = "Option::is_none")]
16394    pub aar_id: Option<String>,
16395    #[serde(default, skip_serializing_if = "Option::is_none")]
16396    pub metrics: Option<MissionMetrics>,
16397    /// Terminal outcome. `partial` means some objectives verified and some did not.
16398    #[serde(default, skip_serializing_if = "Option::is_none")]
16399    pub outcome: Option<MissionOutcome>,
16400    #[serde(default, skip_serializing_if = "Option::is_none")]
16401    pub result_summary: Option<String>,
16402    /// Subset of objective_ids that failed verification.
16403    #[serde(default, skip_serializing_if = "Option::is_none")]
16404    pub failed_objective_ids: Option<Vec<String>>,
16405    /// ISO 8601 hard deadline the runtime enforces against.
16406    #[serde(default, skip_serializing_if = "Option::is_none")]
16407    pub deadline: Option<String>,
16408    pub created_at: String,
16409    pub updated_at: String,
16410    /// Set when the status first leaves `draft`.
16411    #[serde(default, skip_serializing_if = "Option::is_none")]
16412    pub started_at: Option<String>,
16413    /// Set when the status becomes terminal.
16414    #[serde(default, skip_serializing_if = "Option::is_none")]
16415    pub completed_at: Option<String>,
16416}
16417
16418/// Why MEF took the request. `quick_reply` never reaches execution.
16419#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16420pub enum MissionClassification {
16421    #[default]
16422    #[serde(rename = "quick_reply")]
16423    QuickReply,
16424    #[serde(rename = "mission")]
16425    Mission,
16426    /// A value the API introduced after this SDK was generated.
16427    #[serde(untagged)]
16428    Other(String),
16429}
16430
16431impl MissionClassification {
16432    /// The value as it appears on the wire.
16433    pub fn as_str(&self) -> &str {
16434        match self {
16435            Self::QuickReply => "quick_reply",
16436            Self::Mission => "mission",
16437            Self::Other(value) => value.as_str(),
16438        }
16439    }
16440}
16441
16442impl std::fmt::Display for MissionClassification {
16443    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16444        f.write_str(self.as_str())
16445    }
16446}
16447
16448impl From<&str> for MissionClassification {
16449    fn from(value: &str) -> Self {
16450        match value {
16451            "quick_reply" => Self::QuickReply,
16452            "mission" => Self::Mission,
16453            other => Self::Other(other.to_string()),
16454        }
16455    }
16456}
16457
16458/// Aggregated spend for the whole mission. Written on the terminal transition, so it is absent
16459/// while the mission is still running.
16460#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16461pub struct MissionMetrics {
16462    pub total_cost_usd: f64,
16463    pub total_tokens: i64,
16464    pub total_duration_ms: i64,
16465    pub llm_calls: i64,
16466    /// Objective retries across the mission — a strike counter, not an HTTP retry count.
16467    pub retries: i64,
16468}
16469
16470/// Terminal outcome. `partial` means some objectives verified and some did not.
16471#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16472pub enum MissionOutcome {
16473    #[default]
16474    #[serde(rename = "success")]
16475    Success,
16476    #[serde(rename = "partial")]
16477    Partial,
16478    #[serde(rename = "failed")]
16479    Failed,
16480    #[serde(rename = "aborted")]
16481    Aborted,
16482    /// A value the API introduced after this SDK was generated.
16483    #[serde(untagged)]
16484    Other(String),
16485}
16486
16487impl MissionOutcome {
16488    /// The value as it appears on the wire.
16489    pub fn as_str(&self) -> &str {
16490        match self {
16491            Self::Success => "success",
16492            Self::Partial => "partial",
16493            Self::Failed => "failed",
16494            Self::Aborted => "aborted",
16495            Self::Other(value) => value.as_str(),
16496        }
16497    }
16498}
16499
16500impl std::fmt::Display for MissionOutcome {
16501    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16502        f.write_str(self.as_str())
16503    }
16504}
16505
16506impl From<&str> for MissionOutcome {
16507    fn from(value: &str) -> Self {
16508        match value {
16509            "success" => Self::Success,
16510            "partial" => Self::Partial,
16511            "failed" => Self::Failed,
16512            "aborted" => Self::Aborted,
16513            other => Self::Other(other.to_string()),
16514        }
16515    }
16516}
16517
16518/// What POST /missions answers. `plan` is echoed back only when the server planned the mission
16519/// from a goal.
16520#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16521pub struct MissionStartResponse {
16522    pub mission_id: String,
16523    /// Persisted objective ids, in plan order.
16524    pub objective_ids: Vec<String>,
16525    /// The intake decision. A `quick_reply` mission is recorded but is not mission work.
16526    pub classification: MissionStartResponseClassification,
16527    #[serde(default, skip_serializing_if = "Option::is_none")]
16528    pub plan: Option<PlannedMission>,
16529    /// Whether this request also started executing the mission. `true` when planning put it in
16530    /// `executing` (the plan needed no authorization) and a walk began — progress then arrives on
16531    /// `/missions/{missionId}/events`, and a later `POST /run` answers `already_running` while it
16532    /// is in flight. `false` when the mission is `awaiting_authorization` (authorize, then `POST
16533    /// /run`) or when the tenant is at its concurrent-mission ceiling (the mission stays
16534    /// `executing`; `POST /run` starts it). Added 2026-09-22: before it, a mission reported
16535    /// `executing` and dispatched nothing until a separate `POST /run`.
16536    #[serde(default, skip_serializing_if = "Option::is_none")]
16537    pub run_started: Option<bool>,
16538}
16539
16540/// The intake decision. A `quick_reply` mission is recorded but is not mission work.
16541#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16542pub struct MissionStartResponseClassification {
16543    pub classification: MissionClassification,
16544    pub score: f64,
16545    pub confidence: f64,
16546}
16547
16548/// Lifecycle state. `completed`, `failed` and `aborted` are terminal.
16549#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16550pub enum MissionStatus {
16551    #[default]
16552    #[serde(rename = "draft")]
16553    Draft,
16554    #[serde(rename = "planning")]
16555    Planning,
16556    #[serde(rename = "awaiting_authorization")]
16557    AwaitingAuthorization,
16558    #[serde(rename = "executing")]
16559    Executing,
16560    #[serde(rename = "paused")]
16561    Paused,
16562    #[serde(rename = "verifying")]
16563    Verifying,
16564    #[serde(rename = "completed")]
16565    Completed,
16566    #[serde(rename = "failed")]
16567    Failed,
16568    #[serde(rename = "aborted")]
16569    Aborted,
16570    /// A value the API introduced after this SDK was generated.
16571    #[serde(untagged)]
16572    Other(String),
16573}
16574
16575impl MissionStatus {
16576    /// The value as it appears on the wire.
16577    pub fn as_str(&self) -> &str {
16578        match self {
16579            Self::Draft => "draft",
16580            Self::Planning => "planning",
16581            Self::AwaitingAuthorization => "awaiting_authorization",
16582            Self::Executing => "executing",
16583            Self::Paused => "paused",
16584            Self::Verifying => "verifying",
16585            Self::Completed => "completed",
16586            Self::Failed => "failed",
16587            Self::Aborted => "aborted",
16588            Self::Other(value) => value.as_str(),
16589        }
16590    }
16591}
16592
16593impl std::fmt::Display for MissionStatus {
16594    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16595        f.write_str(self.as_str())
16596    }
16597}
16598
16599impl From<&str> for MissionStatus {
16600    fn from(value: &str) -> Self {
16601        match value {
16602            "draft" => Self::Draft,
16603            "planning" => Self::Planning,
16604            "awaiting_authorization" => Self::AwaitingAuthorization,
16605            "executing" => Self::Executing,
16606            "paused" => Self::Paused,
16607            "verifying" => Self::Verifying,
16608            "completed" => Self::Completed,
16609            "failed" => Self::Failed,
16610            "aborted" => Self::Aborted,
16611            other => Self::Other(other.to_string()),
16612        }
16613    }
16614}
16615
16616/// providers.ts ModelInfo — only id and name are populated for media providers.
16617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16618pub struct ModelInfo {
16619    pub id: String,
16620    pub name: String,
16621    #[serde(default, skip_serializing_if = "Option::is_none")]
16622    pub created: Option<i64>,
16623    #[serde(default, skip_serializing_if = "Option::is_none")]
16624    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
16625    #[serde(default, skip_serializing_if = "Option::is_none")]
16626    pub context_window: Option<i64>,
16627    #[serde(default, skip_serializing_if = "Option::is_none")]
16628    pub supports_tools: Option<bool>,
16629    #[serde(default, skip_serializing_if = "Option::is_none")]
16630    pub supports_vision: Option<bool>,
16631    /// TTS models only, when an admin preset names voices.
16632    #[serde(default, skip_serializing_if = "Option::is_none")]
16633    pub voices: Option<Vec<String>>,
16634}
16635
16636/// `MoveWorkspaceFileRequest` model.
16637#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16638pub struct MoveWorkspaceFileRequest {
16639    pub from_path: String,
16640    pub to_path: String,
16641}
16642
16643/// `Notification` model.
16644#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16645pub struct Notification {
16646    pub id: String,
16647    pub tenant_id: String,
16648    #[serde(default, skip_serializing_if = "Option::is_none")]
16649    pub user_id: Option<String>,
16650    pub r#type: String,
16651    pub title: String,
16652    pub message: String,
16653    #[serde(default, skip_serializing_if = "Option::is_none")]
16654    pub data: Option<serde_json::Map<String, serde_json::Value>>,
16655    pub read: bool,
16656    #[serde(default, skip_serializing_if = "Option::is_none")]
16657    pub action_url: Option<String>,
16658    pub created_at: String,
16659    /// UI surface routing; defaults to `info` when omitted.
16660    #[serde(default, skip_serializing_if = "Option::is_none")]
16661    pub priority: Option<NotificationPriority>,
16662    /// Notifications sharing a dedup_key collapse in the bell with a count badge.
16663    #[serde(default, skip_serializing_if = "Option::is_none")]
16664    pub dedup_key: Option<String>,
16665    #[serde(default, skip_serializing_if = "Option::is_none")]
16666    pub source: Option<NotificationSource>,
16667}
16668
16669/// Delivery channel. `in_app` is always-on (bell drawer + SSE) and cannot be opted out of;
16670/// `telegram`/`whatsapp` are reserved and have no adapter yet.
16671#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16672pub enum NotificationChannel {
16673    #[default]
16674    #[serde(rename = "in_app")]
16675    InApp,
16676    #[serde(rename = "email")]
16677    Email,
16678    #[serde(rename = "webhook")]
16679    Webhook,
16680    #[serde(rename = "push")]
16681    Push,
16682    #[serde(rename = "web_push")]
16683    WebPush,
16684    #[serde(rename = "telegram")]
16685    Telegram,
16686    #[serde(rename = "whatsapp")]
16687    Whatsapp,
16688    /// A value the API introduced after this SDK was generated.
16689    #[serde(untagged)]
16690    Other(String),
16691}
16692
16693impl NotificationChannel {
16694    /// The value as it appears on the wire.
16695    pub fn as_str(&self) -> &str {
16696        match self {
16697            Self::InApp => "in_app",
16698            Self::Email => "email",
16699            Self::Webhook => "webhook",
16700            Self::Push => "push",
16701            Self::WebPush => "web_push",
16702            Self::Telegram => "telegram",
16703            Self::Whatsapp => "whatsapp",
16704            Self::Other(value) => value.as_str(),
16705        }
16706    }
16707}
16708
16709impl std::fmt::Display for NotificationChannel {
16710    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16711        f.write_str(self.as_str())
16712    }
16713}
16714
16715impl From<&str> for NotificationChannel {
16716    fn from(value: &str) -> Self {
16717        match value {
16718            "in_app" => Self::InApp,
16719            "email" => Self::Email,
16720            "webhook" => Self::Webhook,
16721            "push" => Self::Push,
16722            "web_push" => Self::WebPush,
16723            "telegram" => Self::Telegram,
16724            "whatsapp" => Self::Whatsapp,
16725            other => Self::Other(other.to_string()),
16726        }
16727    }
16728}
16729
16730/// `NotificationPreferences` model.
16731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16732pub struct NotificationPreferences {
16733    /// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
16734    /// warning/info/success → \[in_app\].
16735    #[serde(default, skip_serializing_if = "Option::is_none")]
16736    pub priority_channels: Option<NotificationPreferencesPriorityChannels>,
16737    /// Per-event-type channel list. When present for a type it REPLACES the priority-level default
16738    /// for that type. Keys are NotificationType values.
16739    #[serde(default, skip_serializing_if = "Option::is_none")]
16740    pub type_overrides: Option<HashMap<String, Vec<NotificationChannel>>>,
16741    /// Event types muted for OUTBOUND delivery (email/webhook/push). The in-app bell still receives
16742    /// them — muting does not hide an event from the bell drawer, it only stops the outbound
16743    /// channels.
16744    #[serde(default, skip_serializing_if = "Option::is_none")]
16745    pub muted_types: Option<Vec<NotificationType>>,
16746    /// Window during which non-critical messages are suppressed; critical always bypasses. Set both
16747    /// start_local and end_local to enable, empty disables.
16748    #[serde(default, skip_serializing_if = "Option::is_none")]
16749    pub quiet_hours: Option<NotificationPreferencesQuietHours>,
16750    pub tenant_id: String,
16751    pub updated_at: String,
16752}
16753
16754/// Per-TENANT notification routing. Sent to PUT /notifications/prefs, which REPLACES the stored
16755/// value — an omitted field is stored as omitted (that is how a client clears `muted_types` or
16756/// drops `quiet_hours`). `tenant_id` and `updated_at` are ignored if sent: the server derives
16757/// them.
16758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16759pub struct NotificationPreferencesInput {
16760    /// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
16761    /// warning/info/success → \[in_app\].
16762    #[serde(default, skip_serializing_if = "Option::is_none")]
16763    pub priority_channels: Option<NotificationPreferencesInputPriorityChannels>,
16764    /// Per-event-type channel list. When present for a type it REPLACES the priority-level default
16765    /// for that type. Keys are NotificationType values.
16766    #[serde(default, skip_serializing_if = "Option::is_none")]
16767    pub type_overrides: Option<HashMap<String, Vec<NotificationChannel>>>,
16768    /// Event types muted for OUTBOUND delivery (email/webhook/push). The in-app bell still receives
16769    /// them — muting does not hide an event from the bell drawer, it only stops the outbound
16770    /// channels.
16771    #[serde(default, skip_serializing_if = "Option::is_none")]
16772    pub muted_types: Option<Vec<NotificationType>>,
16773    /// Window during which non-critical messages are suppressed; critical always bypasses. Set both
16774    /// start_local and end_local to enable, empty disables.
16775    #[serde(default, skip_serializing_if = "Option::is_none")]
16776    pub quiet_hours: Option<NotificationPreferencesInputQuietHours>,
16777}
16778
16779/// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
16780/// warning/info/success → \[in_app\].
16781#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16782pub struct NotificationPreferencesInputPriorityChannels {
16783    #[serde(default, skip_serializing_if = "Option::is_none")]
16784    pub critical: Option<Vec<NotificationChannel>>,
16785    #[serde(default, skip_serializing_if = "Option::is_none")]
16786    pub warning: Option<Vec<NotificationChannel>>,
16787    #[serde(default, skip_serializing_if = "Option::is_none")]
16788    pub info: Option<Vec<NotificationChannel>>,
16789    #[serde(default, skip_serializing_if = "Option::is_none")]
16790    pub success: Option<Vec<NotificationChannel>>,
16791}
16792
16793/// Window during which non-critical messages are suppressed; critical always bypasses. Set both
16794/// start_local and end_local to enable, empty disables.
16795#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16796pub struct NotificationPreferencesInputQuietHours {
16797    /// Local-time start "HH:mm".
16798    #[serde(default, skip_serializing_if = "Option::is_none")]
16799    pub start_local: Option<String>,
16800    /// Local-time end "HH:mm".
16801    #[serde(default, skip_serializing_if = "Option::is_none")]
16802    pub end_local: Option<String>,
16803    /// IANA timezone (e.g. "Europe/Kyiv"). Defaults to UTC when absent.
16804    #[serde(default, skip_serializing_if = "Option::is_none")]
16805    pub timezone: Option<String>,
16806    /// Legacy — use start_local + timezone.
16807    #[serde(default, skip_serializing_if = "Option::is_none")]
16808    pub start_utc: Option<String>,
16809    /// Legacy — use end_local + timezone.
16810    #[serde(default, skip_serializing_if = "Option::is_none")]
16811    pub end_utc: Option<String>,
16812}
16813
16814/// Default channel routing keyed by severity. Server default: critical → \[in_app, email\];
16815/// warning/info/success → \[in_app\].
16816#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16817pub struct NotificationPreferencesPriorityChannels {
16818    #[serde(default, skip_serializing_if = "Option::is_none")]
16819    pub critical: Option<Vec<NotificationChannel>>,
16820    #[serde(default, skip_serializing_if = "Option::is_none")]
16821    pub warning: Option<Vec<NotificationChannel>>,
16822    #[serde(default, skip_serializing_if = "Option::is_none")]
16823    pub info: Option<Vec<NotificationChannel>>,
16824    #[serde(default, skip_serializing_if = "Option::is_none")]
16825    pub success: Option<Vec<NotificationChannel>>,
16826}
16827
16828/// Window during which non-critical messages are suppressed; critical always bypasses. Set both
16829/// start_local and end_local to enable, empty disables.
16830#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16831pub struct NotificationPreferencesQuietHours {
16832    /// Local-time start "HH:mm".
16833    #[serde(default, skip_serializing_if = "Option::is_none")]
16834    pub start_local: Option<String>,
16835    /// Local-time end "HH:mm".
16836    #[serde(default, skip_serializing_if = "Option::is_none")]
16837    pub end_local: Option<String>,
16838    /// IANA timezone (e.g. "Europe/Kyiv"). Defaults to UTC when absent.
16839    #[serde(default, skip_serializing_if = "Option::is_none")]
16840    pub timezone: Option<String>,
16841    /// Legacy — use start_local + timezone.
16842    #[serde(default, skip_serializing_if = "Option::is_none")]
16843    pub start_utc: Option<String>,
16844    /// Legacy — use end_local + timezone.
16845    #[serde(default, skip_serializing_if = "Option::is_none")]
16846    pub end_utc: Option<String>,
16847}
16848
16849/// UI surface routing; defaults to `info` when omitted.
16850#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16851pub enum NotificationPriority {
16852    #[default]
16853    #[serde(rename = "critical")]
16854    Critical,
16855    #[serde(rename = "warning")]
16856    Warning,
16857    #[serde(rename = "info")]
16858    Info,
16859    #[serde(rename = "success")]
16860    Success,
16861    /// A value the API introduced after this SDK was generated.
16862    #[serde(untagged)]
16863    Other(String),
16864}
16865
16866impl NotificationPriority {
16867    /// The value as it appears on the wire.
16868    pub fn as_str(&self) -> &str {
16869        match self {
16870            Self::Critical => "critical",
16871            Self::Warning => "warning",
16872            Self::Info => "info",
16873            Self::Success => "success",
16874            Self::Other(value) => value.as_str(),
16875        }
16876    }
16877}
16878
16879impl std::fmt::Display for NotificationPriority {
16880    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16881        f.write_str(self.as_str())
16882    }
16883}
16884
16885impl From<&str> for NotificationPriority {
16886    fn from(value: &str) -> Self {
16887        match value {
16888            "critical" => Self::Critical,
16889            "warning" => Self::Warning,
16890            "info" => Self::Info,
16891            "success" => Self::Success,
16892            other => Self::Other(other.to_string()),
16893        }
16894    }
16895}
16896
16897/// `NotificationSource` model.
16898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16899pub struct NotificationSource {
16900    #[serde(default, skip_serializing_if = "Option::is_none")]
16901    pub kind: Option<NotificationSourceKind>,
16902    #[serde(default, skip_serializing_if = "Option::is_none")]
16903    pub id: Option<String>,
16904}
16905
16906/// `NotificationSourceKind` enumeration.
16907#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16908pub enum NotificationSourceKind {
16909    #[default]
16910    #[serde(rename = "run")]
16911    Run,
16912    #[serde(rename = "agent")]
16913    Agent,
16914    #[serde(rename = "bridge")]
16915    Bridge,
16916    #[serde(rename = "budget")]
16917    Budget,
16918    #[serde(rename = "team")]
16919    Team,
16920    #[serde(rename = "task")]
16921    Task,
16922    /// A value the API introduced after this SDK was generated.
16923    #[serde(untagged)]
16924    Other(String),
16925}
16926
16927impl NotificationSourceKind {
16928    /// The value as it appears on the wire.
16929    pub fn as_str(&self) -> &str {
16930        match self {
16931            Self::Run => "run",
16932            Self::Agent => "agent",
16933            Self::Bridge => "bridge",
16934            Self::Budget => "budget",
16935            Self::Team => "team",
16936            Self::Task => "task",
16937            Self::Other(value) => value.as_str(),
16938        }
16939    }
16940}
16941
16942impl std::fmt::Display for NotificationSourceKind {
16943    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16944        f.write_str(self.as_str())
16945    }
16946}
16947
16948impl From<&str> for NotificationSourceKind {
16949    fn from(value: &str) -> Self {
16950        match value {
16951            "run" => Self::Run,
16952            "agent" => Self::Agent,
16953            "bridge" => Self::Bridge,
16954            "budget" => Self::Budget,
16955            "team" => Self::Team,
16956            "task" => Self::Task,
16957            other => Self::Other(other.to_string()),
16958        }
16959    }
16960}
16961
16962/// Where outbound notifications go. **Secrets never leave the server**: a webhook's signing
16963/// secret is reported only as `has_signing_secret`, a device token only by its last four
16964/// characters, and a Web Push endpoint only by host — the path carries a subscription
16965/// identifier.
16966#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16967pub struct NotificationTarget {
16968    pub id: String,
16969    pub tenant_id: String,
16970    pub channel: NotificationTargetChannel,
16971    /// Operator's own label — “Slack #ops”, “iPhone 15”.
16972    pub label: String,
16973    /// A disabled target is kept for audit and skipped at fan-out.
16974    pub enabled: bool,
16975    pub created_at: String,
16976    /// Last success — the field that tells a dead webhook from a quiet one.
16977    #[serde(default, skip_serializing_if = "Option::is_none")]
16978    pub last_delivered_at: Option<String>,
16979    #[serde(default, skip_serializing_if = "Option::is_none")]
16980    pub last_error: Option<String>,
16981    pub config: serde_json::Value,
16982}
16983
16984/// `NotificationTargetChannel` enumeration.
16985#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
16986pub enum NotificationTargetChannel {
16987    #[default]
16988    #[serde(rename = "email")]
16989    Email,
16990    #[serde(rename = "webhook")]
16991    Webhook,
16992    #[serde(rename = "push")]
16993    Push,
16994    #[serde(rename = "web_push")]
16995    WebPush,
16996    /// A value the API introduced after this SDK was generated.
16997    #[serde(untagged)]
16998    Other(String),
16999}
17000
17001impl NotificationTargetChannel {
17002    /// The value as it appears on the wire.
17003    pub fn as_str(&self) -> &str {
17004        match self {
17005            Self::Email => "email",
17006            Self::Webhook => "webhook",
17007            Self::Push => "push",
17008            Self::WebPush => "web_push",
17009            Self::Other(value) => value.as_str(),
17010        }
17011    }
17012}
17013
17014impl std::fmt::Display for NotificationTargetChannel {
17015    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17016        f.write_str(self.as_str())
17017    }
17018}
17019
17020impl From<&str> for NotificationTargetChannel {
17021    fn from(value: &str) -> Self {
17022        match value {
17023            "email" => Self::Email,
17024            "webhook" => Self::Webhook,
17025            "push" => Self::Push,
17026            "web_push" => Self::WebPush,
17027            other => Self::Other(other.to_string()),
17028        }
17029    }
17030}
17031
17032/// `NotificationTargetConfigVariant1` model.
17033#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17034pub struct NotificationTargetConfigVariant1 {
17035    pub kind: NotificationTargetConfigVariant1kind,
17036    pub address: String,
17037}
17038
17039/// `NotificationTargetConfigVariant1kind` enumeration.
17040#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17041pub enum NotificationTargetConfigVariant1kind {
17042    #[default]
17043    #[serde(rename = "email")]
17044    Email,
17045    /// A value the API introduced after this SDK was generated.
17046    #[serde(untagged)]
17047    Other(String),
17048}
17049
17050impl NotificationTargetConfigVariant1kind {
17051    /// The value as it appears on the wire.
17052    pub fn as_str(&self) -> &str {
17053        match self {
17054            Self::Email => "email",
17055            Self::Other(value) => value.as_str(),
17056        }
17057    }
17058}
17059
17060impl std::fmt::Display for NotificationTargetConfigVariant1kind {
17061    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17062        f.write_str(self.as_str())
17063    }
17064}
17065
17066impl From<&str> for NotificationTargetConfigVariant1kind {
17067    fn from(value: &str) -> Self {
17068        match value {
17069            "email" => Self::Email,
17070            other => Self::Other(other.to_string()),
17071        }
17072    }
17073}
17074
17075/// `NotificationTargetConfigVariant2` model.
17076#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17077pub struct NotificationTargetConfigVariant2 {
17078    pub kind: AgentScorerConfigType,
17079    pub url: String,
17080    pub format: NotificationTargetConfigVariant2format,
17081    /// Whether a secret is configured. The secret itself is never returned.
17082    pub has_signing_secret: bool,
17083}
17084
17085/// `NotificationTargetConfigVariant2format` enumeration.
17086#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17087pub enum NotificationTargetConfigVariant2format {
17088    #[default]
17089    #[serde(rename = "generic")]
17090    Generic,
17091    #[serde(rename = "slack")]
17092    Slack,
17093    #[serde(rename = "discord")]
17094    Discord,
17095    /// A value the API introduced after this SDK was generated.
17096    #[serde(untagged)]
17097    Other(String),
17098}
17099
17100impl NotificationTargetConfigVariant2format {
17101    /// The value as it appears on the wire.
17102    pub fn as_str(&self) -> &str {
17103        match self {
17104            Self::Generic => "generic",
17105            Self::Slack => "slack",
17106            Self::Discord => "discord",
17107            Self::Other(value) => value.as_str(),
17108        }
17109    }
17110}
17111
17112impl std::fmt::Display for NotificationTargetConfigVariant2format {
17113    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17114        f.write_str(self.as_str())
17115    }
17116}
17117
17118impl From<&str> for NotificationTargetConfigVariant2format {
17119    fn from(value: &str) -> Self {
17120        match value {
17121            "generic" => Self::Generic,
17122            "slack" => Self::Slack,
17123            "discord" => Self::Discord,
17124            other => Self::Other(other.to_string()),
17125        }
17126    }
17127}
17128
17129/// `NotificationTargetConfigVariant3` model.
17130#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17131pub struct NotificationTargetConfigVariant3 {
17132    pub kind: NotificationTargetConfigVariant3kind,
17133    pub platform: NotificationTargetConfigVariant3platform,
17134    #[serde(default, skip_serializing_if = "Option::is_none")]
17135    pub device_label: Option<String>,
17136    /// Last four characters of the device token, for visual identification only.
17137    pub device_token_suffix: String,
17138}
17139
17140/// `NotificationTargetConfigVariant3kind` enumeration.
17141#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17142pub enum NotificationTargetConfigVariant3kind {
17143    #[default]
17144    #[serde(rename = "push")]
17145    Push,
17146    /// A value the API introduced after this SDK was generated.
17147    #[serde(untagged)]
17148    Other(String),
17149}
17150
17151impl NotificationTargetConfigVariant3kind {
17152    /// The value as it appears on the wire.
17153    pub fn as_str(&self) -> &str {
17154        match self {
17155            Self::Push => "push",
17156            Self::Other(value) => value.as_str(),
17157        }
17158    }
17159}
17160
17161impl std::fmt::Display for NotificationTargetConfigVariant3kind {
17162    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17163        f.write_str(self.as_str())
17164    }
17165}
17166
17167impl From<&str> for NotificationTargetConfigVariant3kind {
17168    fn from(value: &str) -> Self {
17169        match value {
17170            "push" => Self::Push,
17171            other => Self::Other(other.to_string()),
17172        }
17173    }
17174}
17175
17176/// `NotificationTargetConfigVariant3platform` enumeration.
17177#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17178pub enum NotificationTargetConfigVariant3platform {
17179    #[default]
17180    #[serde(rename = "apns")]
17181    Apns,
17182    #[serde(rename = "fcm")]
17183    Fcm,
17184    /// A value the API introduced after this SDK was generated.
17185    #[serde(untagged)]
17186    Other(String),
17187}
17188
17189impl NotificationTargetConfigVariant3platform {
17190    /// The value as it appears on the wire.
17191    pub fn as_str(&self) -> &str {
17192        match self {
17193            Self::Apns => "apns",
17194            Self::Fcm => "fcm",
17195            Self::Other(value) => value.as_str(),
17196        }
17197    }
17198}
17199
17200impl std::fmt::Display for NotificationTargetConfigVariant3platform {
17201    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17202        f.write_str(self.as_str())
17203    }
17204}
17205
17206impl From<&str> for NotificationTargetConfigVariant3platform {
17207    fn from(value: &str) -> Self {
17208        match value {
17209            "apns" => Self::Apns,
17210            "fcm" => Self::Fcm,
17211            other => Self::Other(other.to_string()),
17212        }
17213    }
17214}
17215
17216/// `NotificationTargetConfigVariant4` model.
17217#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17218pub struct NotificationTargetConfigVariant4 {
17219    pub kind: NotificationTargetConfigVariant4kind,
17220    /// Host only — `(invalid endpoint)` when the stored URL will not parse.
17221    pub endpoint_host: String,
17222    #[serde(default, skip_serializing_if = "Option::is_none")]
17223    pub device_label: Option<String>,
17224    /// Browser-supplied expiry, ms since epoch.
17225    #[serde(default)]
17226    pub expiration_time: Option<i64>,
17227}
17228
17229/// `NotificationTargetConfigVariant4kind` enumeration.
17230#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17231pub enum NotificationTargetConfigVariant4kind {
17232    #[default]
17233    #[serde(rename = "web_push")]
17234    WebPush,
17235    /// A value the API introduced after this SDK was generated.
17236    #[serde(untagged)]
17237    Other(String),
17238}
17239
17240impl NotificationTargetConfigVariant4kind {
17241    /// The value as it appears on the wire.
17242    pub fn as_str(&self) -> &str {
17243        match self {
17244            Self::WebPush => "web_push",
17245            Self::Other(value) => value.as_str(),
17246        }
17247    }
17248}
17249
17250impl std::fmt::Display for NotificationTargetConfigVariant4kind {
17251    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17252        f.write_str(self.as_str())
17253    }
17254}
17255
17256impl From<&str> for NotificationTargetConfigVariant4kind {
17257    fn from(value: &str) -> Self {
17258        match value {
17259            "web_push" => Self::WebPush,
17260            other => Self::Other(other.to_string()),
17261        }
17262    }
17263}
17264
17265/// Fine-grained event type. There are no coarse buckets on the server — a UI that groups events
17266/// (e.g. "agents / failures / system") maps its groups onto these types itself.
17267#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17268pub enum NotificationType {
17269    #[default]
17270    #[serde(rename = "run.started")]
17271    RunStarted,
17272    #[serde(rename = "run.failed")]
17273    RunFailed,
17274    #[serde(rename = "run.completed")]
17275    RunCompleted,
17276    #[serde(rename = "run.awaiting_approval")]
17277    RunAwaitingApproval,
17278    #[serde(rename = "run.awaiting_input")]
17279    RunAwaitingInput,
17280    #[serde(rename = "approval.requested")]
17281    ApprovalRequested,
17282    #[serde(rename = "budget.warning")]
17283    BudgetWarning,
17284    #[serde(rename = "budget.exceeded")]
17285    BudgetExceeded,
17286    #[serde(rename = "bridge.online")]
17287    BridgeOnline,
17288    #[serde(rename = "bridge.offline")]
17289    BridgeOffline,
17290    #[serde(rename = "invite.accepted")]
17291    InviteAccepted,
17292    #[serde(rename = "marketplace.review")]
17293    MarketplaceReview,
17294    #[serde(rename = "workflow.triggered")]
17295    WorkflowTriggered,
17296    #[serde(rename = "system.alert")]
17297    SystemAlert,
17298    #[serde(rename = "task.completed")]
17299    TaskCompleted,
17300    #[serde(rename = "task.confirmation_required")]
17301    TaskConfirmationRequired,
17302    #[serde(rename = "agent.suspended")]
17303    AgentSuspended,
17304    #[serde(rename = "agent.terminated")]
17305    AgentTerminated,
17306    #[serde(rename = "billing.payment_failed")]
17307    BillingPaymentFailed,
17308    #[serde(rename = "billing.subscription_paused")]
17309    BillingSubscriptionPaused,
17310    #[serde(rename = "billing.subscription_cancelled")]
17311    BillingSubscriptionCancelled,
17312    #[serde(rename = "billing.dispute_opened")]
17313    BillingDisputeOpened,
17314    #[serde(rename = "domain.dns_drift")]
17315    DomainDnsDrift,
17316    #[serde(rename = "domain.cert_failed")]
17317    DomainCertFailed,
17318    #[serde(rename = "domain.cert_renewal_due")]
17319    DomainCertRenewalDue,
17320    /// A value the API introduced after this SDK was generated.
17321    #[serde(untagged)]
17322    Other(String),
17323}
17324
17325impl NotificationType {
17326    /// The value as it appears on the wire.
17327    pub fn as_str(&self) -> &str {
17328        match self {
17329            Self::RunStarted => "run.started",
17330            Self::RunFailed => "run.failed",
17331            Self::RunCompleted => "run.completed",
17332            Self::RunAwaitingApproval => "run.awaiting_approval",
17333            Self::RunAwaitingInput => "run.awaiting_input",
17334            Self::ApprovalRequested => "approval.requested",
17335            Self::BudgetWarning => "budget.warning",
17336            Self::BudgetExceeded => "budget.exceeded",
17337            Self::BridgeOnline => "bridge.online",
17338            Self::BridgeOffline => "bridge.offline",
17339            Self::InviteAccepted => "invite.accepted",
17340            Self::MarketplaceReview => "marketplace.review",
17341            Self::WorkflowTriggered => "workflow.triggered",
17342            Self::SystemAlert => "system.alert",
17343            Self::TaskCompleted => "task.completed",
17344            Self::TaskConfirmationRequired => "task.confirmation_required",
17345            Self::AgentSuspended => "agent.suspended",
17346            Self::AgentTerminated => "agent.terminated",
17347            Self::BillingPaymentFailed => "billing.payment_failed",
17348            Self::BillingSubscriptionPaused => "billing.subscription_paused",
17349            Self::BillingSubscriptionCancelled => "billing.subscription_cancelled",
17350            Self::BillingDisputeOpened => "billing.dispute_opened",
17351            Self::DomainDnsDrift => "domain.dns_drift",
17352            Self::DomainCertFailed => "domain.cert_failed",
17353            Self::DomainCertRenewalDue => "domain.cert_renewal_due",
17354            Self::Other(value) => value.as_str(),
17355        }
17356    }
17357}
17358
17359impl std::fmt::Display for NotificationType {
17360    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17361        f.write_str(self.as_str())
17362    }
17363}
17364
17365impl From<&str> for NotificationType {
17366    fn from(value: &str) -> Self {
17367        match value {
17368            "run.started" => Self::RunStarted,
17369            "run.failed" => Self::RunFailed,
17370            "run.completed" => Self::RunCompleted,
17371            "run.awaiting_approval" => Self::RunAwaitingApproval,
17372            "run.awaiting_input" => Self::RunAwaitingInput,
17373            "approval.requested" => Self::ApprovalRequested,
17374            "budget.warning" => Self::BudgetWarning,
17375            "budget.exceeded" => Self::BudgetExceeded,
17376            "bridge.online" => Self::BridgeOnline,
17377            "bridge.offline" => Self::BridgeOffline,
17378            "invite.accepted" => Self::InviteAccepted,
17379            "marketplace.review" => Self::MarketplaceReview,
17380            "workflow.triggered" => Self::WorkflowTriggered,
17381            "system.alert" => Self::SystemAlert,
17382            "task.completed" => Self::TaskCompleted,
17383            "task.confirmation_required" => Self::TaskConfirmationRequired,
17384            "agent.suspended" => Self::AgentSuspended,
17385            "agent.terminated" => Self::AgentTerminated,
17386            "billing.payment_failed" => Self::BillingPaymentFailed,
17387            "billing.subscription_paused" => Self::BillingSubscriptionPaused,
17388            "billing.subscription_cancelled" => Self::BillingSubscriptionCancelled,
17389            "billing.dispute_opened" => Self::BillingDisputeOpened,
17390            "domain.dns_drift" => Self::DomainDnsDrift,
17391            "domain.cert_failed" => Self::DomainCertFailed,
17392            "domain.cert_renewal_due" => Self::DomainCertRenewalDue,
17393            other => Self::Other(other.to_string()),
17394        }
17395    }
17396}
17397
17398/// `OAuthAppExchangeRequest` model.
17399#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17400pub struct OAuthAppExchangeRequest {
17401    /// The value delivered in the callback fragment.
17402    pub code: String,
17403    /// The secret whose SHA-256, base64url-encoded, was sent as `app_code_challenge` when the flow
17404    /// started. It never leaves the app, which is what makes an intercepted code worthless.
17405    pub code_verifier: String,
17406}
17407
17408/// `OAuthAppExchangeResponse` model.
17409#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17410pub struct OAuthAppExchangeResponse {
17411    pub api_key: String,
17412    #[serde(default, skip_serializing_if = "Option::is_none")]
17413    pub email: Option<String>,
17414}
17415
17416/// Body to complete OAuth after callback
17417#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17418pub struct OAuthCompleteRequest {
17419    pub state: String,
17420    pub code: String,
17421    pub agent_id: String,
17422    /// Display name for this connection
17423    #[serde(default, skip_serializing_if = "Option::is_none")]
17424    pub name: Option<String>,
17425}
17426
17427/// `OAuthIdentityConfig` model.
17428#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17429pub struct OAuthIdentityConfig {
17430    pub apple_services_id: String,
17431    pub apple_team_id: String,
17432    pub apple_bundle_id: String,
17433    /// Lower-cased hostnames. Empty means nothing is allowlisted.
17434    pub oauth_return_to_hosts: Vec<String>,
17435}
17436
17437/// Result after DELETE — record removed from admin KV
17438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17439pub struct OAuthLoginProviderConfigDeleted {
17440    pub provider: OAuthLoginProviderConfigStatusProvider,
17441    /// Always false after a successful DELETE
17442    pub configured: bool,
17443}
17444
17445/// Admin view of one provider's current config. client_secret is never echoed;
17446/// client_secret_hint shows the last 4 chars so the operator can confirm storage.
17447#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17448pub struct OAuthLoginProviderConfigStatus {
17449    pub provider: OAuthLoginProviderConfigStatusProvider,
17450    pub enabled: bool,
17451    /// false when no record exists yet; remaining fields are absent in that case
17452    pub configured: bool,
17453    #[serde(default, skip_serializing_if = "Option::is_none")]
17454    pub client_id: Option<String>,
17455    /// Masked tail of the stored secret (e.g. "••••a1b2"). null if no secret on file.
17456    #[serde(default, skip_serializing_if = "Option::is_none")]
17457    pub client_secret_hint: Option<String>,
17458    /// null when no override; provider defaults apply
17459    #[serde(default, skip_serializing_if = "Option::is_none")]
17460    pub scopes: Option<Vec<String>>,
17461}
17462
17463/// `OAuthLoginProviderConfigStatusProvider` enumeration.
17464#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17465pub enum OAuthLoginProviderConfigStatusProvider {
17466    #[default]
17467    #[serde(rename = "github")]
17468    Github,
17469    #[serde(rename = "google")]
17470    Google,
17471    /// A value the API introduced after this SDK was generated.
17472    #[serde(untagged)]
17473    Other(String),
17474}
17475
17476impl OAuthLoginProviderConfigStatusProvider {
17477    /// The value as it appears on the wire.
17478    pub fn as_str(&self) -> &str {
17479        match self {
17480            Self::Github => "github",
17481            Self::Google => "google",
17482            Self::Other(value) => value.as_str(),
17483        }
17484    }
17485}
17486
17487impl std::fmt::Display for OAuthLoginProviderConfigStatusProvider {
17488    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17489        f.write_str(self.as_str())
17490    }
17491}
17492
17493impl From<&str> for OAuthLoginProviderConfigStatusProvider {
17494    fn from(value: &str) -> Self {
17495        match value {
17496            "github" => Self::Github,
17497            "google" => Self::Google,
17498            other => Self::Other(other.to_string()),
17499        }
17500    }
17501}
17502
17503/// Body for PUT /api/v1/admin/oauth-login-providers/{provider}. Merges with existing record: an
17504/// operator flipping `enabled` or rotating `scopes` does not need to re-paste the secret. The
17505/// first-time PUT (no existing record) requires both client_id and client_secret.
17506#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17507pub struct OAuthLoginProviderConfigUpdate {
17508    /// OAuth app client ID issued by the provider
17509    #[serde(default, skip_serializing_if = "Option::is_none")]
17510    pub client_id: Option<String>,
17511    /// OAuth app client secret. Stored verbatim in admin KV; never echoed back.
17512    #[serde(default, skip_serializing_if = "Option::is_none")]
17513    pub client_secret: Option<String>,
17514    /// Defaults to existing value, or true on first write if omitted
17515    #[serde(default, skip_serializing_if = "Option::is_none")]
17516    pub enabled: Option<bool>,
17517    /// Optional override of the provider's default scope list. Omit to inherit defaults.
17518    #[serde(default, skip_serializing_if = "Option::is_none")]
17519    pub scopes: Option<Vec<String>>,
17520}
17521
17522/// Result after PUT — confirms the persisted state
17523#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17524pub struct OAuthLoginProviderConfigUpdateResponse {
17525    pub provider: OAuthLoginProviderConfigStatusProvider,
17526    pub enabled: bool,
17527    pub configured: bool,
17528}
17529
17530/// Public-safe descriptor for an OAuth login (identity) provider. Surfaces only what the login
17531/// page needs to decide which buttons to render — never exposes client_secret.
17532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17533pub struct OAuthLoginProviderItem {
17534    /// Provider identifier used in /auth/oauth/{provider}/start path
17535    pub id: OAuthLoginProviderItemId,
17536    /// Human-readable provider name (e.g. "GitHub", "Google")
17537    pub name: String,
17538    /// true when the operator has configured client_id+client_secret AND set enabled=true. False
17539    /// values mean clicking the button would 404.
17540    pub enabled: bool,
17541}
17542
17543/// Provider identifier used in /auth/oauth/{provider}/start path
17544#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17545pub enum OAuthLoginProviderItemId {
17546    #[default]
17547    #[serde(rename = "github")]
17548    Github,
17549    #[serde(rename = "google")]
17550    Google,
17551    #[serde(rename = "apple")]
17552    Apple,
17553    /// A value the API introduced after this SDK was generated.
17554    #[serde(untagged)]
17555    Other(String),
17556}
17557
17558impl OAuthLoginProviderItemId {
17559    /// The value as it appears on the wire.
17560    pub fn as_str(&self) -> &str {
17561        match self {
17562            Self::Github => "github",
17563            Self::Google => "google",
17564            Self::Apple => "apple",
17565            Self::Other(value) => value.as_str(),
17566        }
17567    }
17568}
17569
17570impl std::fmt::Display for OAuthLoginProviderItemId {
17571    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17572        f.write_str(self.as_str())
17573    }
17574}
17575
17576impl From<&str> for OAuthLoginProviderItemId {
17577    fn from(value: &str) -> Self {
17578        match value {
17579            "github" => Self::Github,
17580            "google" => Self::Google,
17581            "apple" => Self::Apple,
17582            other => Self::Other(other.to_string()),
17583        }
17584    }
17585}
17586
17587/// Response from GET /api/v1/auth/oauth/providers
17588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17589pub struct OAuthLoginProvidersList {
17590    pub providers: Vec<OAuthLoginProviderItem>,
17591    #[serde(default, skip_serializing_if = "Option::is_none")]
17592    pub google_one_tap_client_id: Option<String>,
17593}
17594
17595/// Response for starting OAuth flow
17596#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17597pub struct OAuthStartResponse {
17598    pub auth_url: String,
17599    pub state: String,
17600}
17601
17602/// One unit of mission work. Sent in full by GET /missions/{missionId}/objectives and by the
17603/// PATCH that edits one.
17604#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17605pub struct Objective {
17606    pub objective_id: String,
17607    pub tenant_id: String,
17608    #[serde(default, skip_serializing_if = "Option::is_none")]
17609    pub company_id: Option<String>,
17610    /// Parent objective, or null for a root objective of the mission.
17611    #[serde(default)]
17612    pub parent_id: Option<String>,
17613    pub title: String,
17614    pub description: String,
17615    /// What the verifier checks before the objective counts as done.
17616    pub success_criteria: Vec<String>,
17617    /// Lifecycle, owned by the executor — PATCH cannot set it.
17618    pub status: ObjectiveStatus,
17619    pub priority: ObjectivePriority,
17620    /// Agent that executes this objective. Mutually exclusive with assigned_team_id in practice.
17621    #[serde(default, skip_serializing_if = "Option::is_none")]
17622    pub assigned_agent_id: Option<String>,
17623    #[serde(default, skip_serializing_if = "Option::is_none")]
17624    pub assigned_team_id: Option<String>,
17625    /// Objective ids that must verify first. The plan is a DAG.
17626    pub dependencies: Vec<String>,
17627    pub budget: ObjectiveBudget,
17628    #[serde(default, skip_serializing_if = "Option::is_none")]
17629    pub result: Option<String>,
17630    #[serde(default, skip_serializing_if = "Option::is_none")]
17631    pub output_summary: Option<String>,
17632    pub progress_notes: Vec<String>,
17633    pub created_at: String,
17634    pub updated_at: String,
17635    #[serde(default, skip_serializing_if = "Option::is_none")]
17636    pub completed_at: Option<String>,
17637    /// The end state to preserve when the literal instruction stops fitting.
17638    #[serde(default, skip_serializing_if = "Option::is_none")]
17639    pub commanders_intent: Option<String>,
17640    #[serde(default, skip_serializing_if = "Option::is_none")]
17641    pub roe: Option<ObjectiveRoE>,
17642    #[serde(default, skip_serializing_if = "Option::is_none")]
17643    pub decision_points: Option<Vec<ObjectiveDecisionPoint>>,
17644    #[serde(default, skip_serializing_if = "Option::is_none")]
17645    pub deadline: Option<String>,
17646    /// Why the executor stopped on this objective: `exhausted_strikes_\<n\>`, `budget_exhausted`,
17647    /// `dependency_failed`, or `verifier_error` — the verifier could not reach a verdict (its judge
17648    /// errored or kept answering in an unparseable shape), which is the platform failing, not the
17649    /// agent's work; no strike is charged for it and the agent is not re-run.
17650    #[serde(default, skip_serializing_if = "Option::is_none")]
17651    pub abort_reason: Option<String>,
17652    /// Strikes the mission executor spent on this objective, written when it settles. Absent on
17653    /// objectives that never ran under a mission and on those settled before 2026-09-22.
17654    #[serde(default, skip_serializing_if = "Option::is_none")]
17655    pub strikes_used: Option<i64>,
17656}
17657
17658/// Per-objective ceiling and what has been spent against it. The executor stops an objective
17659/// that would cross a max.
17660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17661pub struct ObjectiveBudget {
17662    pub max_runs: i64,
17663    pub max_tokens: i64,
17664    pub max_cost_usd: f64,
17665    pub spent_runs: i64,
17666    pub spent_tokens: i64,
17667    pub spent_cost_usd: f64,
17668}
17669
17670/// A branch in the plan: when `condition` holds, execution continues at the matching branch's
17671/// objective instead of the next one in order.
17672#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17673pub struct ObjectiveDecisionPoint {
17674    pub condition: String,
17675    pub branches: Vec<ObjectiveDecisionPointBranch>,
17676    /// Taken when no branch matches.
17677    #[serde(default, skip_serializing_if = "Option::is_none")]
17678    pub fallback_objective_id: Option<String>,
17679}
17680
17681/// `ObjectiveDecisionPointBranch` model.
17682#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17683pub struct ObjectiveDecisionPointBranch {
17684    pub when: String,
17685    pub objective_id: String,
17686}
17687
17688/// `ObjectivePriority` enumeration.
17689#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17690pub enum ObjectivePriority {
17691    #[default]
17692    #[serde(rename = "low")]
17693    Low,
17694    #[serde(rename = "medium")]
17695    Medium,
17696    #[serde(rename = "high")]
17697    High,
17698    #[serde(rename = "critical")]
17699    Critical,
17700    /// A value the API introduced after this SDK was generated.
17701    #[serde(untagged)]
17702    Other(String),
17703}
17704
17705impl ObjectivePriority {
17706    /// The value as it appears on the wire.
17707    pub fn as_str(&self) -> &str {
17708        match self {
17709            Self::Low => "low",
17710            Self::Medium => "medium",
17711            Self::High => "high",
17712            Self::Critical => "critical",
17713            Self::Other(value) => value.as_str(),
17714        }
17715    }
17716}
17717
17718impl std::fmt::Display for ObjectivePriority {
17719    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17720        f.write_str(self.as_str())
17721    }
17722}
17723
17724impl From<&str> for ObjectivePriority {
17725    fn from(value: &str) -> Self {
17726        match value {
17727            "low" => Self::Low,
17728            "medium" => Self::Medium,
17729            "high" => Self::High,
17730            "critical" => Self::Critical,
17731            other => Self::Other(other.to_string()),
17732        }
17733    }
17734}
17735
17736/// Rules of engagement: what the objective may do alone, what needs a human, and what it must
17737/// never do.
17738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17739pub struct ObjectiveRoE {
17740    pub autonomous_actions: Vec<String>,
17741    pub requires_approval: Vec<String>,
17742    pub prohibited: Vec<String>,
17743}
17744
17745/// Lifecycle, owned by the executor — PATCH cannot set it.
17746#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17747pub enum ObjectiveStatus {
17748    #[default]
17749    #[serde(rename = "pending")]
17750    Pending,
17751    #[serde(rename = "in_progress")]
17752    InProgress,
17753    #[serde(rename = "blocked")]
17754    Blocked,
17755    #[serde(rename = "completed")]
17756    Completed,
17757    #[serde(rename = "failed")]
17758    Failed,
17759    /// A value the API introduced after this SDK was generated.
17760    #[serde(untagged)]
17761    Other(String),
17762}
17763
17764impl ObjectiveStatus {
17765    /// The value as it appears on the wire.
17766    pub fn as_str(&self) -> &str {
17767        match self {
17768            Self::Pending => "pending",
17769            Self::InProgress => "in_progress",
17770            Self::Blocked => "blocked",
17771            Self::Completed => "completed",
17772            Self::Failed => "failed",
17773            Self::Other(value) => value.as_str(),
17774        }
17775    }
17776}
17777
17778impl std::fmt::Display for ObjectiveStatus {
17779    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17780        f.write_str(self.as_str())
17781    }
17782}
17783
17784impl From<&str> for ObjectiveStatus {
17785    fn from(value: &str) -> Self {
17786        match value {
17787            "pending" => Self::Pending,
17788            "in_progress" => Self::InProgress,
17789            "blocked" => Self::Blocked,
17790            "completed" => Self::Completed,
17791            "failed" => Self::Failed,
17792            other => Self::Other(other.to_string()),
17793        }
17794    }
17795}
17796
17797/// agent-teams/objective-tracker.ts ObjectiveTree — recursive.
17798#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17799pub struct ObjectiveTree {
17800    pub objective: Objective,
17801    pub children: Vec<ObjectiveTree>,
17802}
17803
17804/// An OpenAI Chat Completions object. `/v1/chat/completions` builds it (openai-compat.ts:
17805/// exactly one choice, no `logprobs`, no `system_fingerprint`); `/api/v1/llm/chat/completions`
17806/// passes the provider's body through (llm-proxy.ts) — `model` is then the provider's id, and a
17807/// reasoning-only reply has its reasoning copied into `content`.
17808#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17809pub struct OpenAiChatCompletion {
17810    pub id: String,
17811    pub object: OpenAiChatCompletionObject,
17812    /// Unix seconds.
17813    pub created: i64,
17814    pub model: String,
17815    pub choices: Vec<OpenAiChatCompletionChoice>,
17816    #[serde(default, skip_serializing_if = "Option::is_none")]
17817    pub usage: Option<OpenAiChatCompletionUsage>,
17818    /// Any additional properties the server returned.
17819    #[serde(flatten)]
17820    pub extra: HashMap<String, serde_json::Value>,
17821}
17822
17823/// `OpenAiChatCompletionChoice` model.
17824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17825pub struct OpenAiChatCompletionChoice {
17826    pub index: i64,
17827    pub message: OpenAiChatCompletionChoiceMessage,
17828    #[serde(default, skip_serializing_if = "Option::is_none")]
17829    pub finish_reason: Option<String>,
17830    /// Any additional properties the server returned.
17831    #[serde(flatten)]
17832    pub extra: HashMap<String, serde_json::Value>,
17833}
17834
17835/// `OpenAiChatCompletionChoiceMessage` model.
17836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17837pub struct OpenAiChatCompletionChoiceMessage {
17838    pub role: OpenAiChatCompletionChoiceMessageRole,
17839    #[serde(default, skip_serializing_if = "Option::is_none")]
17840    pub content: Option<String>,
17841    #[serde(default, skip_serializing_if = "Option::is_none")]
17842    pub tool_calls: Option<Vec<OpenAiToolCall>>,
17843    /// Any additional properties the server returned.
17844    #[serde(flatten)]
17845    pub extra: HashMap<String, serde_json::Value>,
17846}
17847
17848/// `OpenAiChatCompletionChoiceMessageRole` enumeration.
17849#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17850pub enum OpenAiChatCompletionChoiceMessageRole {
17851    #[default]
17852    #[serde(rename = "assistant")]
17853    Assistant,
17854    /// A value the API introduced after this SDK was generated.
17855    #[serde(untagged)]
17856    Other(String),
17857}
17858
17859impl OpenAiChatCompletionChoiceMessageRole {
17860    /// The value as it appears on the wire.
17861    pub fn as_str(&self) -> &str {
17862        match self {
17863            Self::Assistant => "assistant",
17864            Self::Other(value) => value.as_str(),
17865        }
17866    }
17867}
17868
17869impl std::fmt::Display for OpenAiChatCompletionChoiceMessageRole {
17870    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17871        f.write_str(self.as_str())
17872    }
17873}
17874
17875impl From<&str> for OpenAiChatCompletionChoiceMessageRole {
17876    fn from(value: &str) -> Self {
17877        match value {
17878            "assistant" => Self::Assistant,
17879            other => Self::Other(other.to_string()),
17880        }
17881    }
17882}
17883
17884/// `OpenAiChatCompletionObject` enumeration.
17885#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17886pub enum OpenAiChatCompletionObject {
17887    #[default]
17888    #[serde(rename = "chat.completion")]
17889    ChatCompletion,
17890    /// A value the API introduced after this SDK was generated.
17891    #[serde(untagged)]
17892    Other(String),
17893}
17894
17895impl OpenAiChatCompletionObject {
17896    /// The value as it appears on the wire.
17897    pub fn as_str(&self) -> &str {
17898        match self {
17899            Self::ChatCompletion => "chat.completion",
17900            Self::Other(value) => value.as_str(),
17901        }
17902    }
17903}
17904
17905impl std::fmt::Display for OpenAiChatCompletionObject {
17906    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17907        f.write_str(self.as_str())
17908    }
17909}
17910
17911impl From<&str> for OpenAiChatCompletionObject {
17912    fn from(value: &str) -> Self {
17913        match value {
17914            "chat.completion" => Self::ChatCompletion,
17915            other => Self::Other(other.to_string()),
17916        }
17917    }
17918}
17919
17920/// `OpenAiChatCompletionUsage` model.
17921#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17922pub struct OpenAiChatCompletionUsage {
17923    pub prompt_tokens: i64,
17924    pub completion_tokens: i64,
17925    pub total_tokens: i64,
17926    /// Any additional properties the server returned.
17927    #[serde(flatten)]
17928    pub extra: HashMap<String, serde_json::Value>,
17929}
17930
17931/// Error envelope used by the OpenAI-compatible surface (`/v1/*`). Deliberately NOT RFC 9457:
17932/// callers here are OpenAI SDKs pointed at this base URL, and they decode this shape.
17933#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17934pub struct OpenAiError {
17935    pub error: OpenAiErrorError,
17936}
17937
17938/// `OpenAiErrorError` model.
17939#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17940pub struct OpenAiErrorError {
17941    /// Human-readable cause, including where an operator fixes it.
17942    pub message: String,
17943    pub r#type: String,
17944    /// Machine-readable code. `embedding_unavailable` = no provider configured (501, permanent).
17945    /// `embedding_failed` = the configured provider did not answer (503, retryable).
17946    #[serde(default, skip_serializing_if = "Option::is_none")]
17947    pub code: Option<String>,
17948}
17949
17950/// The OpenAI tool-call object as passed through from the provider (llm-proxy.ts);
17951/// /v1/chat/completions itself emits tool calls only as streaming deltas.
17952#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17953pub struct OpenAiToolCall {
17954    pub id: String,
17955    #[serde(default, skip_serializing_if = "Option::is_none")]
17956    pub r#type: Option<OpenAiToolCallType>,
17957    pub function: OpenAiToolCallFunction,
17958    /// Any additional properties the server returned.
17959    #[serde(flatten)]
17960    pub extra: HashMap<String, serde_json::Value>,
17961}
17962
17963/// `OpenAiToolCallFunction` model.
17964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17965pub struct OpenAiToolCallFunction {
17966    pub name: String,
17967    pub arguments: String,
17968}
17969
17970/// `OpenAiToolCallType` enumeration.
17971#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
17972pub enum OpenAiToolCallType {
17973    #[default]
17974    #[serde(rename = "function")]
17975    Function,
17976    /// A value the API introduced after this SDK was generated.
17977    #[serde(untagged)]
17978    Other(String),
17979}
17980
17981impl OpenAiToolCallType {
17982    /// The value as it appears on the wire.
17983    pub fn as_str(&self) -> &str {
17984        match self {
17985            Self::Function => "function",
17986            Self::Other(value) => value.as_str(),
17987        }
17988    }
17989}
17990
17991impl std::fmt::Display for OpenAiToolCallType {
17992    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17993        f.write_str(self.as_str())
17994    }
17995}
17996
17997impl From<&str> for OpenAiToolCallType {
17998    fn from(value: &str) -> Self {
17999        match value {
18000            "function" => Self::Function,
18001            other => Self::Other(other.to_string()),
18002        }
18003    }
18004}
18005
18006/// `PatchMeRequest` model.
18007#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18008pub struct PatchMeRequest {
18009    /// `/api/v1/files/\<file_id\>/content` of an image uploaded with `POST /files`, or `null` to
18010    /// clear.
18011    #[serde(default)]
18012    pub avatar_url: Option<String>,
18013}
18014
18015/// `PatchMeResponse` model.
18016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18017pub struct PatchMeResponse {
18018    pub user: PatchMeResponseUser,
18019    pub updated_rows: i64,
18020}
18021
18022/// `PatchMeResponseUser` model.
18023#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18024pub struct PatchMeResponseUser {
18025    pub user_id: String,
18026    pub email: String,
18027    #[serde(default, skip_serializing_if = "Option::is_none")]
18028    pub name: Option<String>,
18029    pub role: String,
18030    pub status: String,
18031    #[serde(default)]
18032    pub avatar_url: Option<String>,
18033}
18034
18035/// A partial tenant. Fields not named are left alone — except `social_links`, which is REPLACED
18036/// wholesale rather than merged, so a PATCH carrying one platform leaves the tenant with that
18037/// one platform and nothing else. Send every link you want to keep, `custom` included.
18038///
18039/// `social_links` values are filtered, not rejected: a url that does not match
18040/// `^https?://.{3,500}$` is dropped and the request still answers 200. Length is applied BEFORE
18041/// the pattern, which is the case worth knowing about — a url longer than 500 characters is CUT
18042/// to 500 and the cut value then matches, so it is STORED TRUNCATED rather than refused. A
18043/// working-looking link that goes somewhere else is worse than a missing one, and a client
18044/// checking only whether the key came back cannot see it.
18045///
18046/// Nothing here is hidden: the response is the tenant AS STORED, so compare what you sent
18047/// against what came back — values and lengths, not just which keys are present. No second GET
18048/// is needed. See `Tenant.social_links` for the field-by-field shape.
18049///
18050/// Documented 2026-09-18. The 2026-09-17 pass wrote this onto the Tenant RESPONSE schema and
18051/// left the request body an untyped `object`: right words, wrong end of the call. Caught by the
18052/// SDK lane, whose generator produced a typed `Tenant.social_links` beside a `patch(body:
18053/// JsonObject)` that could not describe what to send.
18054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18055pub struct PatchTenantRequest {
18056    #[serde(default, skip_serializing_if = "Option::is_none")]
18057    pub social_links: Option<TenantSocialLinks>,
18058    /// Any additional properties the server returned.
18059    #[serde(flatten)]
18060    pub extra: HashMap<String, serde_json::Value>,
18061}
18062
18063/// `PauseCompanyResponse` model.
18064#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18065pub struct PauseCompanyResponse {
18066    #[serde(default, skip_serializing_if = "Option::is_none")]
18067    pub status: Option<String>,
18068}
18069
18070/// `PauseMissionResponse` model.
18071#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18072pub struct PauseMissionResponse {
18073    pub pausing: bool,
18074    pub mission: Mission,
18075}
18076
18077/// `PauseRunResponse` model.
18078#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18079pub struct PauseRunResponse {
18080    pub paused: bool,
18081    pub run_id: String,
18082}
18083
18084/// runs.ts — the tool calls of the newest run.awaiting_approval event (agent-runtime.ts /
18085/// bridge.ts); `options`/`kind` only from the bridge.
18086#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18087pub struct PendingApproval {
18088    pub id: String,
18089    pub name: String,
18090    pub args: serde_json::Map<String, serde_json::Value>,
18091    /// Choices the bridge reported for the approval, when any.
18092    #[serde(default, skip_serializing_if = "Option::is_none")]
18093    pub options: Option<Vec<String>>,
18094    #[serde(default, skip_serializing_if = "Option::is_none")]
18095    pub kind: Option<String>,
18096}
18097
18098/// `PermissionCheckResult` model.
18099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18100pub struct PermissionCheckResult {
18101    pub allowed: bool,
18102    #[serde(default, skip_serializing_if = "Option::is_none")]
18103    pub reason: Option<String>,
18104    #[serde(default, skip_serializing_if = "Option::is_none")]
18105    pub denied_permissions: Option<Vec<String>>,
18106}
18107
18108/// Per-agent capability envelope. Invariant: PermissionSet(child) ⊆ PermissionSet(parent).
18109#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18110pub struct PermissionSet {
18111    pub agent_id: String,
18112    pub tenant_id: String,
18113    pub allowed_tools: Vec<String>,
18114    #[serde(default, skip_serializing_if = "Option::is_none")]
18115    pub allowed_roles: Option<Vec<String>>,
18116    #[serde(default, skip_serializing_if = "Option::is_none")]
18117    pub resource_permissions: Option<Vec<ResourcePermission>>,
18118    /// Hard cap (USD) on the cost of each of this agent's own runs, and the ceiling a spawned
18119    /// child's budget may not exceed. The run's effective cost ceiling is the smaller positive of
18120    /// this and resource_limits.max_cost_usd (or the platform ceiling); a run that crosses it fails
18121    /// with error_code BUDGET_EXCEEDED and error_details.cap_source "permission_set" or
18122    /// "resource_limits". 0 means no cap from this field.
18123    #[serde(default, skip_serializing_if = "Option::is_none")]
18124    pub max_budget_per_run_usd: Option<f64>,
18125    pub max_spawn_depth: i64,
18126    pub can_spawn: bool,
18127    #[serde(default, skip_serializing_if = "Option::is_none")]
18128    pub can_self_modify: Option<bool>,
18129    #[serde(default, skip_serializing_if = "Option::is_none")]
18130    pub parent_agent_id: Option<String>,
18131    #[serde(default, skip_serializing_if = "Option::is_none")]
18132    pub created_at: Option<String>,
18133    #[serde(default, skip_serializing_if = "Option::is_none")]
18134    pub updated_at: Option<String>,
18135}
18136
18137/// Body of PUT /governance/permissions/{agentId}. Every field optional: a field the body omits
18138/// keeps its stored value (mergePermissionSet), and only a first write falls back to the
18139/// defaults. `agent_id`, `tenant_id`, `created_at`, `updated_at` are set by the server and
18140/// ignored in the body.
18141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18142pub struct PermissionSetUpdate {
18143    /// Sending this field REPLACES the stored list (the handler stores the array as sent, it does
18144    /// not merge).
18145    #[serde(default, skip_serializing_if = "Option::is_none")]
18146    pub allowed_tools: Option<Vec<String>>,
18147    /// Sending this field REPLACES the stored list (the handler stores the array as sent, it does
18148    /// not merge).
18149    #[serde(default, skip_serializing_if = "Option::is_none")]
18150    pub allowed_roles: Option<Vec<String>>,
18151    /// Sending this field REPLACES the stored list (the handler stores the array as sent, it does
18152    /// not merge).
18153    #[serde(default, skip_serializing_if = "Option::is_none")]
18154    pub resource_permissions: Option<Vec<ResourcePermission>>,
18155    /// Hard cap (USD) on the cost of each of this agent's own runs, and the ceiling a spawned
18156    /// child's budget may not exceed. The run's effective cost ceiling is the smaller positive of
18157    /// this and resource_limits.max_cost_usd (or the platform ceiling); a run that crosses it fails
18158    /// with error_code BUDGET_EXCEEDED and error_details.cap_source "permission_set" or
18159    /// "resource_limits". 0 means no cap from this field.
18160    #[serde(default, skip_serializing_if = "Option::is_none")]
18161    pub max_budget_per_run_usd: Option<f64>,
18162    #[serde(default, skip_serializing_if = "Option::is_none")]
18163    pub max_spawn_depth: Option<i64>,
18164    #[serde(default, skip_serializing_if = "Option::is_none")]
18165    pub can_spawn: Option<bool>,
18166    #[serde(default, skip_serializing_if = "Option::is_none")]
18167    pub can_self_modify: Option<bool>,
18168    #[serde(default, skip_serializing_if = "Option::is_none")]
18169    pub parent_agent_id: Option<String>,
18170}
18171
18172/// `PlanLLMLimits` model.
18173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18174pub struct PlanLLMLimits {
18175    #[serde(default, skip_serializing_if = "Option::is_none")]
18176    pub tier_access: Option<Vec<PlanLLMLimitsTierAccessItem>>,
18177    #[serde(default, skip_serializing_if = "Option::is_none")]
18178    pub tokens_per_month: Option<i64>,
18179    #[serde(default, skip_serializing_if = "Option::is_none")]
18180    pub requests_per_minute: Option<i64>,
18181    #[serde(default, skip_serializing_if = "Option::is_none")]
18182    pub requests_per_hour: Option<i64>,
18183    #[serde(default, skip_serializing_if = "Option::is_none")]
18184    pub requests_per_day: Option<i64>,
18185}
18186
18187/// `PlanLLMLimitsTierAccessItem` enumeration.
18188#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18189pub enum PlanLLMLimitsTierAccessItem {
18190    #[default]
18191    #[serde(rename = "starter")]
18192    Starter,
18193    #[serde(rename = "pro")]
18194    Pro,
18195    #[serde(rename = "enterprise")]
18196    Enterprise,
18197    /// A value the API introduced after this SDK was generated.
18198    #[serde(untagged)]
18199    Other(String),
18200}
18201
18202impl PlanLLMLimitsTierAccessItem {
18203    /// The value as it appears on the wire.
18204    pub fn as_str(&self) -> &str {
18205        match self {
18206            Self::Starter => "starter",
18207            Self::Pro => "pro",
18208            Self::Enterprise => "enterprise",
18209            Self::Other(value) => value.as_str(),
18210        }
18211    }
18212}
18213
18214impl std::fmt::Display for PlanLLMLimitsTierAccessItem {
18215    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18216        f.write_str(self.as_str())
18217    }
18218}
18219
18220impl From<&str> for PlanLLMLimitsTierAccessItem {
18221    fn from(value: &str) -> Self {
18222        match value {
18223            "starter" => Self::Starter,
18224            "pro" => Self::Pro,
18225            "enterprise" => Self::Enterprise,
18226            other => Self::Other(other.to_string()),
18227        }
18228    }
18229}
18230
18231/// A fully decomposed plan. Supplying one skips the LLM planner entirely.
18232#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18233pub struct PlannedMission {
18234    pub goal: String,
18235    pub classification: MissionClassification,
18236    pub objectives: Vec<PlannedObjective>,
18237    /// When true the mission stops at `awaiting_authorization` instead of executing — the gate for
18238    /// destructive or externally visible plans.
18239    pub requires_authorization: bool,
18240    #[serde(default, skip_serializing_if = "Option::is_none")]
18241    pub deadline: Option<String>,
18242}
18243
18244/// An objective as supplied in a caller-written plan. Dependencies are INDICES into
18245/// `objectives`, because ids do not exist until the plan is persisted.
18246#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18247pub struct PlannedObjective {
18248    pub title: String,
18249    pub description: String,
18250    pub success_criteria: Vec<String>,
18251    pub priority: ObjectivePriority,
18252    /// Indices into `objectives`; must form a DAG or the plan is rejected.
18253    pub depends_on_indices: Vec<i64>,
18254    #[serde(default, skip_serializing_if = "Option::is_none")]
18255    pub assigned_agent_id: Option<String>,
18256    #[serde(default, skip_serializing_if = "Option::is_none")]
18257    pub assigned_team_id: Option<String>,
18258    /// Ceilings only — the spent_* counters are created by the server.
18259    pub budget: PlannedObjectiveBudget,
18260    #[serde(default, skip_serializing_if = "Option::is_none")]
18261    pub commanders_intent: Option<String>,
18262    #[serde(default, skip_serializing_if = "Option::is_none")]
18263    pub roe: Option<ObjectiveRoE>,
18264    #[serde(default, skip_serializing_if = "Option::is_none")]
18265    pub deadline: Option<String>,
18266    #[serde(default, skip_serializing_if = "Option::is_none")]
18267    pub decision_points: Option<Vec<ObjectiveDecisionPoint>>,
18268}
18269
18270/// Ceilings only — the spent_* counters are created by the server.
18271#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18272pub struct PlannedObjectiveBudget {
18273    pub max_runs: i64,
18274    pub max_tokens: i64,
18275    pub max_cost_usd: f64,
18276}
18277
18278/// Platform profit and loss: Stripe revenue against real host spend and the LLM provider bill.
18279/// Super-admin only. Served from a short-lived cache — `cache` says which.
18280#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18281pub struct PlatformEconomics {
18282    pub revenue: PlatformEconomicsRevenue,
18283    pub costs: PlatformEconomicsCosts,
18284    /// What the platform paid model providers for tokens, from the usage shards' pre-markup
18285    /// `provider_cost` summed over every tenant. The largest variable cost; absent from this report
18286    /// until 2026-09-02.
18287    pub llm: PlatformEconomicsLLM,
18288    pub economics: PlatformEconomicsEconomics,
18289    pub generated_at: String,
18290    /// `hit` — served from cache; `miss` — computed and cached; `bypass` — recomputed because
18291    /// `refresh=1`.
18292    pub cache: PlatformEconomicsCache,
18293}
18294
18295/// `hit` — served from cache; `miss` — computed and cached; `bypass` — recomputed because
18296/// `refresh=1`.
18297#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18298pub enum PlatformEconomicsCache {
18299    #[default]
18300    #[serde(rename = "hit")]
18301    Hit,
18302    #[serde(rename = "miss")]
18303    Miss,
18304    #[serde(rename = "bypass")]
18305    Bypass,
18306    /// A value the API introduced after this SDK was generated.
18307    #[serde(untagged)]
18308    Other(String),
18309}
18310
18311impl PlatformEconomicsCache {
18312    /// The value as it appears on the wire.
18313    pub fn as_str(&self) -> &str {
18314        match self {
18315            Self::Hit => "hit",
18316            Self::Miss => "miss",
18317            Self::Bypass => "bypass",
18318            Self::Other(value) => value.as_str(),
18319        }
18320    }
18321}
18322
18323impl std::fmt::Display for PlatformEconomicsCache {
18324    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18325        f.write_str(self.as_str())
18326    }
18327}
18328
18329impl From<&str> for PlatformEconomicsCache {
18330    fn from(value: &str) -> Self {
18331        match value {
18332            "hit" => Self::Hit,
18333            "miss" => Self::Miss,
18334            "bypass" => Self::Bypass,
18335            other => Self::Other(other.to_string()),
18336        }
18337    }
18338}
18339
18340/// `PlatformEconomicsCosts` model.
18341#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18342pub struct PlatformEconomicsCosts {
18343    pub provider: PlatformEconomicsCostsProvider,
18344    pub configured: bool,
18345    /// Real accrued spend from the provider's own meter.
18346    #[serde(default)]
18347    pub month_to_date_usd: Option<f64>,
18348    /// Negative means credit.
18349    #[serde(default)]
18350    pub account_balance_usd: Option<f64>,
18351    #[serde(default)]
18352    pub balance_generated_at: Option<String>,
18353    pub droplets: Vec<HostDroplet>,
18354    /// Sum of droplet list prices — steady state, not accrued.
18355    pub monthly_run_rate_usd: f64,
18356    #[serde(default, skip_serializing_if = "Option::is_none")]
18357    pub error: Option<String>,
18358}
18359
18360/// `PlatformEconomicsCostsProvider` enumeration.
18361#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18362pub enum PlatformEconomicsCostsProvider {
18363    #[default]
18364    #[serde(rename = "digitalocean")]
18365    Digitalocean,
18366    /// A value the API introduced after this SDK was generated.
18367    #[serde(untagged)]
18368    Other(String),
18369}
18370
18371impl PlatformEconomicsCostsProvider {
18372    /// The value as it appears on the wire.
18373    pub fn as_str(&self) -> &str {
18374        match self {
18375            Self::Digitalocean => "digitalocean",
18376            Self::Other(value) => value.as_str(),
18377        }
18378    }
18379}
18380
18381impl std::fmt::Display for PlatformEconomicsCostsProvider {
18382    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18383        f.write_str(self.as_str())
18384    }
18385}
18386
18387impl From<&str> for PlatformEconomicsCostsProvider {
18388    fn from(value: &str) -> Self {
18389        match value {
18390            "digitalocean" => Self::Digitalocean,
18391            other => Self::Other(other.to_string()),
18392        }
18393    }
18394}
18395
18396/// `PlatformEconomicsEconomics` model.
18397#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18398pub struct PlatformEconomicsEconomics {
18399    pub monthly_revenue_usd: f64,
18400    pub monthly_infra_usd: f64,
18401    /// `llm.monthly_run_rate_usd` — see `llm.run_rate_basis` for how it was reached.
18402    pub monthly_llm_usd: f64,
18403    /// MRR − infra run rate − LLM run rate.
18404    pub monthly_margin_usd: f64,
18405    /// Null when there is no revenue to divide by — not zero, which would read as a 0% margin.
18406    #[serde(default)]
18407    pub margin_percent: Option<f64>,
18408    #[serde(default)]
18409    pub month_to_date_infra_usd: Option<f64>,
18410    #[serde(default)]
18411    pub markup_percent: Option<f64>,
18412    #[serde(default)]
18413    pub pricing_tiers: Option<serde_json::Map<String, serde_json::Value>>,
18414}
18415
18416/// What the platform paid model providers for tokens, from the usage shards' pre-markup
18417/// `provider_cost` summed over every tenant. The largest variable cost; absent from this report
18418/// until 2026-09-02.
18419#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18420pub struct PlatformEconomicsLLM {
18421    /// YYYY-MM, UTC — the period the usage shards are keyed by.
18422    pub period: String,
18423    pub month_to_date_provider_usd: f64,
18424    /// What tenants were billed for the same usage (provider × markup).
18425    pub month_to_date_billed_usd: f64,
18426    pub previous_period: String,
18427    pub previous_period_provider_usd: f64,
18428    pub previous_period_billed_usd: f64,
18429    /// The figure folded into `economics.monthly_llm_usd`.
18430    pub monthly_run_rate_usd: f64,
18431    /// `previous_period` — last month's full bill; `month_to_date_extrapolated` — this month's
18432    /// spend scaled to a full month, a guess that is loudest on the 1st; `none` — nothing recorded
18433    /// yet.
18434    pub run_rate_basis: PlatformEconomicsLLMRunRateBasis,
18435    pub tenants_with_usage: i64,
18436    pub by_model: Vec<PlatformEconomicsLLMByModelItem>,
18437    /// What the number does not know: own-key proxy traffic is counted although the tenant paid it;
18438    /// shards older than the field count 0.
18439    pub caveats: Vec<String>,
18440    #[serde(default, skip_serializing_if = "Option::is_none")]
18441    pub error: Option<String>,
18442}
18443
18444/// `PlatformEconomicsLLMByModelItem` model.
18445#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18446pub struct PlatformEconomicsLLMByModelItem {
18447    pub model: String,
18448    pub provider_usd: f64,
18449    pub billed_usd: f64,
18450    pub tokens: i64,
18451}
18452
18453/// `previous_period` — last month's full bill; `month_to_date_extrapolated` — this month's
18454/// spend scaled to a full month, a guess that is loudest on the 1st; `none` — nothing recorded
18455/// yet.
18456#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18457pub enum PlatformEconomicsLLMRunRateBasis {
18458    #[default]
18459    #[serde(rename = "previous_period")]
18460    PreviousPeriod,
18461    #[serde(rename = "month_to_date_extrapolated")]
18462    MonthToDateExtrapolated,
18463    #[serde(rename = "none")]
18464    None,
18465    /// A value the API introduced after this SDK was generated.
18466    #[serde(untagged)]
18467    Other(String),
18468}
18469
18470impl PlatformEconomicsLLMRunRateBasis {
18471    /// The value as it appears on the wire.
18472    pub fn as_str(&self) -> &str {
18473        match self {
18474            Self::PreviousPeriod => "previous_period",
18475            Self::MonthToDateExtrapolated => "month_to_date_extrapolated",
18476            Self::None => "none",
18477            Self::Other(value) => value.as_str(),
18478        }
18479    }
18480}
18481
18482impl std::fmt::Display for PlatformEconomicsLLMRunRateBasis {
18483    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18484        f.write_str(self.as_str())
18485    }
18486}
18487
18488impl From<&str> for PlatformEconomicsLLMRunRateBasis {
18489    fn from(value: &str) -> Self {
18490        match value {
18491            "previous_period" => Self::PreviousPeriod,
18492            "month_to_date_extrapolated" => Self::MonthToDateExtrapolated,
18493            "none" => Self::None,
18494            other => Self::Other(other.to_string()),
18495        }
18496    }
18497}
18498
18499/// `PlatformEconomicsRevenue` model.
18500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18501pub struct PlatformEconomicsRevenue {
18502    /// False on a deployment with no Stripe key; the figures are then zeros, not an error.
18503    pub stripe_configured: bool,
18504    pub mrr_usd: f64,
18505    pub arr_usd: f64,
18506    pub subscriptions: Vec<PlatformEconomicsRevenueSubscription>,
18507    pub by_status: serde_json::Map<String, serde_json::Value>,
18508    /// Present when Stripe could not be reached; the rest of the payload is still served.
18509    #[serde(default, skip_serializing_if = "Option::is_none")]
18510    pub error: Option<String>,
18511}
18512
18513/// `PlatformEconomicsRevenueSubscription` model.
18514#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18515pub struct PlatformEconomicsRevenueSubscription {
18516    pub subscription_id: String,
18517    pub customer_id: String,
18518    #[serde(default)]
18519    pub tenant_id: Option<String>,
18520    #[serde(default)]
18521    pub tenant_name: Option<String>,
18522    #[serde(default)]
18523    pub plan: Option<String>,
18524    #[serde(default)]
18525    pub billing_status: Option<String>,
18526    pub status: String,
18527    pub monthly_usd: f64,
18528    pub currency: String,
18529    pub interval: String,
18530    #[serde(default)]
18531    pub current_period_end: Option<String>,
18532    pub cancel_at_period_end: bool,
18533}
18534
18535/// What an unauthenticated page may know about this deployment. Deliberately minimal — no
18536/// secrets and no wizard step names, so a probe cannot enumerate what setup still has pending.
18537#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18538pub struct PlatformInfo {
18539    /// The platform's own base URL, so a client need not bake it into its bundle.
18540    pub public_base_url: String,
18541    /// Role → address. Always an object, possibly empty — a client gates each link on presence
18542    /// rather than handling nulls.
18543    pub contact_emails: serde_json::Map<String, serde_json::Value>,
18544    /// True once the platform is live.
18545    pub setup_complete: bool,
18546    pub registration_open: bool,
18547}
18548
18549/// `PlatformLLMDefaults` model.
18550#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18551pub struct PlatformLLMDefaults {
18552    #[serde(default, skip_serializing_if = "Option::is_none")]
18553    pub default_endpoint: Option<String>,
18554    /// Stored model half. May be bare (`minimax-m3`) or already provider-qualified
18555    /// (`ollama/glm-5.2`) — production holds both shapes. Dial `default_model_ref` instead of
18556    /// joining this yourself.
18557    #[serde(default, skip_serializing_if = "Option::is_none")]
18558    pub default_model: Option<String>,
18559    #[serde(default, skip_serializing_if = "Option::is_none")]
18560    pub default_provider: Option<String>,
18561    /// Stored model half of the fallback. A vendor path (`MiniMaxAI/MiniMax-M3`) carries a slash
18562    /// while naming no provider, so this string is NOT dialable on its own — use
18563    /// `fallback_model_ref`.
18564    #[serde(default, skip_serializing_if = "Option::is_none")]
18565    pub fallback_model: Option<String>,
18566    #[serde(default, skip_serializing_if = "Option::is_none")]
18567    pub fallback_provider: Option<String>,
18568    /// The default as the chat surface accepts it: `provider/model`, already de-duplicated against
18569    /// a model half that carries the provider head. Null when no default model is configured.
18570    #[serde(default, skip_serializing_if = "Option::is_none")]
18571    pub default_model_ref: Option<String>,
18572    /// Same for the fallback. Null when no fallback model is configured.
18573    #[serde(default, skip_serializing_if = "Option::is_none")]
18574    pub fallback_model_ref: Option<String>,
18575}
18576
18577/// The visual-builder canvas of an agent as GET /playground/agents/{agentId} serves it
18578/// (measured 2026-09-10 on e2e-canon); PUT returns the same shape after the write.
18579#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18580pub struct PlaygroundAgentState {
18581    pub agent_id: String,
18582    pub tenant_id: String,
18583    pub nodes: Vec<CanvasNode>,
18584    pub edges: Vec<CanvasEdge>,
18585    pub metadata: serde_json::Map<String, serde_json::Value>,
18586    pub updated_at: String,
18587}
18588
18589/// One starter template from GET /playground/templates (element keys measured 2026-09-10).
18590#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18591pub struct PlaygroundTemplate {
18592    pub id: String,
18593    pub name: String,
18594    pub description: String,
18595    pub category: String,
18596    pub nodes: Vec<CanvasNode>,
18597    pub edges: Vec<CanvasEdge>,
18598}
18599
18600/// An ordered curriculum an agent delivers.
18601#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18602pub struct Program {
18603    pub program_id: String,
18604    pub tenant_id: String,
18605    pub agent_id: String,
18606    pub name: String,
18607    #[serde(default, skip_serializing_if = "Option::is_none")]
18608    pub description: Option<String>,
18609    #[serde(default, skip_serializing_if = "Option::is_none")]
18610    pub listing_id: Option<String>,
18611    pub steps: Vec<ProgramStep>,
18612    #[serde(default, skip_serializing_if = "Option::is_none")]
18613    pub created_at: Option<String>,
18614    #[serde(default, skip_serializing_if = "Option::is_none")]
18615    pub updated_at: Option<String>,
18616}
18617
18618/// `ProgramStep` model.
18619#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18620pub struct ProgramStep {
18621    /// Generated by the server.
18622    pub step_id: String,
18623    pub title: String,
18624    pub order_index: i64,
18625}
18626
18627/// A named body of work that chats belong to: standing instructions, the knowledge bases its
18628/// chats may search, and the files they can read. An agent is *who* answers; a project is *what
18629/// about*.
18630#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18631pub struct Project {
18632    pub project_id: String,
18633    pub tenant_id: String,
18634    pub name: String,
18635    #[serde(default, skip_serializing_if = "Option::is_none")]
18636    pub description: Option<String>,
18637    /// Injected into the system prompt below the agent's own prompt and above personal preferences.
18638    #[serde(default, skip_serializing_if = "Option::is_none")]
18639    pub instructions: Option<String>,
18640    #[serde(default, skip_serializing_if = "Option::is_none")]
18641    pub knowledge_base_ids: Option<Vec<String>>,
18642    /// Ids that no longer resolve to a file in this tenant are dropped on write — an attachment
18643    /// that lies is worse than a rejected one.
18644    #[serde(default, skip_serializing_if = "Option::is_none")]
18645    pub file_ids: Option<Vec<String>>,
18646    /// Owns a private project outright.
18647    #[serde(default, skip_serializing_if = "Option::is_none")]
18648    pub created_by: Option<String>,
18649    /// `tenant` (the default, and what every pre-existing project is) or `private`.
18650    #[serde(default, skip_serializing_if = "Option::is_none")]
18651    pub visibility: Option<ProjectVisibility>,
18652    /// Ignored while `visibility` is `tenant`.
18653    #[serde(default, skip_serializing_if = "Option::is_none")]
18654    pub shared_with: Option<Vec<ProjectGrant>>,
18655    /// Absent or null when the project is live. Archiving hides it from the default list and loses
18656    /// nothing.
18657    #[serde(default, skip_serializing_if = "Option::is_none")]
18658    pub archived_at: Option<String>,
18659    pub created_at: String,
18660    pub updated_at: String,
18661}
18662
18663/// A project with its chats and the caller's own access level.
18664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18665pub struct ProjectDetail {
18666    pub project_id: String,
18667    pub tenant_id: String,
18668    pub name: String,
18669    #[serde(default, skip_serializing_if = "Option::is_none")]
18670    pub description: Option<String>,
18671    /// Injected into the system prompt below the agent's own prompt and above personal preferences.
18672    #[serde(default, skip_serializing_if = "Option::is_none")]
18673    pub instructions: Option<String>,
18674    #[serde(default, skip_serializing_if = "Option::is_none")]
18675    pub knowledge_base_ids: Option<Vec<String>>,
18676    /// Ids that no longer resolve to a file in this tenant are dropped on write — an attachment
18677    /// that lies is worse than a rejected one.
18678    #[serde(default, skip_serializing_if = "Option::is_none")]
18679    pub file_ids: Option<Vec<String>>,
18680    /// Owns a private project outright.
18681    #[serde(default, skip_serializing_if = "Option::is_none")]
18682    pub created_by: Option<String>,
18683    /// `tenant` (the default, and what every pre-existing project is) or `private`.
18684    #[serde(default, skip_serializing_if = "Option::is_none")]
18685    pub visibility: Option<ProjectVisibility>,
18686    /// Ignored while `visibility` is `tenant`.
18687    #[serde(default, skip_serializing_if = "Option::is_none")]
18688    pub shared_with: Option<Vec<ProjectGrant>>,
18689    /// Absent or null when the project is live. Archiving hides it from the default list and loses
18690    /// nothing.
18691    #[serde(default, skip_serializing_if = "Option::is_none")]
18692    pub archived_at: Option<String>,
18693    pub created_at: String,
18694    pub updated_at: String,
18695    /// The chats filed under this project, most recently updated first.
18696    pub sessions: Vec<ProjectDetailSession>,
18697    pub session_count: i64,
18698    /// What THIS caller may do. `none` never reaches a client — it is answered as 404.
18699    pub access: ProjectGrantAccess,
18700}
18701
18702/// `ProjectDetailSession` model.
18703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18704pub struct ProjectDetailSession {
18705    pub session_id: String,
18706    pub agent_id: String,
18707    #[serde(default, skip_serializing_if = "Option::is_none")]
18708    pub updated_at: Option<String>,
18709    #[serde(default, skip_serializing_if = "Option::is_none")]
18710    pub title: Option<String>,
18711}
18712
18713/// One person's access to a private project.
18714#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18715pub struct ProjectGrant {
18716    pub user_id: String,
18717    /// `view` opens the chats and the brief; `edit` also rewrites them.
18718    pub access: ProjectGrantAccess,
18719}
18720
18721/// `view` opens the chats and the brief; `edit` also rewrites them.
18722#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18723pub enum ProjectGrantAccess {
18724    #[default]
18725    #[serde(rename = "view")]
18726    View,
18727    #[serde(rename = "edit")]
18728    Edit,
18729    /// A value the API introduced after this SDK was generated.
18730    #[serde(untagged)]
18731    Other(String),
18732}
18733
18734impl ProjectGrantAccess {
18735    /// The value as it appears on the wire.
18736    pub fn as_str(&self) -> &str {
18737        match self {
18738            Self::View => "view",
18739            Self::Edit => "edit",
18740            Self::Other(value) => value.as_str(),
18741        }
18742    }
18743}
18744
18745impl std::fmt::Display for ProjectGrantAccess {
18746    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18747        f.write_str(self.as_str())
18748    }
18749}
18750
18751impl From<&str> for ProjectGrantAccess {
18752    fn from(value: &str) -> Self {
18753        match value {
18754            "view" => Self::View,
18755            "edit" => Self::Edit,
18756            other => Self::Other(other.to_string()),
18757        }
18758    }
18759}
18760
18761/// `tenant` (the default, and what every pre-existing project is) or `private`.
18762#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
18763pub enum ProjectVisibility {
18764    #[default]
18765    #[serde(rename = "tenant")]
18766    Tenant,
18767    #[serde(rename = "private")]
18768    Private,
18769    /// A value the API introduced after this SDK was generated.
18770    #[serde(untagged)]
18771    Other(String),
18772}
18773
18774impl ProjectVisibility {
18775    /// The value as it appears on the wire.
18776    pub fn as_str(&self) -> &str {
18777        match self {
18778            Self::Tenant => "tenant",
18779            Self::Private => "private",
18780            Self::Other(value) => value.as_str(),
18781        }
18782    }
18783}
18784
18785impl std::fmt::Display for ProjectVisibility {
18786    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18787        f.write_str(self.as_str())
18788    }
18789}
18790
18791impl From<&str> for ProjectVisibility {
18792    fn from(value: &str) -> Self {
18793        match value {
18794            "tenant" => Self::Tenant,
18795            "private" => Self::Private,
18796            other => Self::Other(other.to_string()),
18797        }
18798    }
18799}
18800
18801/// `PromoCode` model.
18802#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18803pub struct PromoCode {
18804    /// Upper-cased.
18805    pub code: String,
18806    /// Absent when unset.
18807    #[serde(default, skip_serializing_if = "Option::is_none")]
18808    pub program: Option<String>,
18809    /// The tenant that earns the reward.
18810    pub owner_tenant_id: String,
18811    pub reward_tokens_per_subscription: i64,
18812    /// Welcome grant to the redeeming tenant. Absent when unset.
18813    #[serde(default, skip_serializing_if = "Option::is_none")]
18814    pub subscriber_bonus_tokens: Option<i64>,
18815    /// Absent when unset.
18816    #[serde(default, skip_serializing_if = "Option::is_none")]
18817    pub discount_percent: Option<f64>,
18818    /// Scopes the code to ONE plan: the reward is skipped when it is set and does not match the
18819    /// plan being paid for. Absent means the code pays out on every plan.
18820    #[serde(default, skip_serializing_if = "Option::is_none")]
18821    pub target_plan_id: Option<String>,
18822    /// Absent means unlimited.
18823    #[serde(default, skip_serializing_if = "Option::is_none")]
18824    pub max_uses: Option<i64>,
18825    /// Server-maintained; carried across a replacing write.
18826    pub uses: i64,
18827    pub active: bool,
18828    /// Carried across a replacing write.
18829    pub created_at: String,
18830    pub updated_at: String,
18831}
18832
18833/// `PromoCodeInput` model.
18834#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18835pub struct PromoCodeInput {
18836    #[serde(default, skip_serializing_if = "Option::is_none")]
18837    pub program: Option<String>,
18838    pub owner_tenant_id: String,
18839    pub reward_tokens_per_subscription: i64,
18840    #[serde(default, skip_serializing_if = "Option::is_none")]
18841    pub subscriber_bonus_tokens: Option<i64>,
18842    #[serde(default, skip_serializing_if = "Option::is_none")]
18843    pub discount_percent: Option<f64>,
18844    /// Resend this on every update — the write replaces, so omitting it unscopes the code.
18845    #[serde(default, skip_serializing_if = "Option::is_none")]
18846    pub target_plan_id: Option<String>,
18847    #[serde(default, skip_serializing_if = "Option::is_none")]
18848    pub max_uses: Option<i64>,
18849    /// Omitting this on an update REACTIVATES a deactivated code.
18850    ///
18851    /// Server default: `true`.
18852    #[serde(default, skip_serializing_if = "Option::is_none")]
18853    pub active: Option<bool>,
18854}
18855
18856/// public.ts GET /public/agents/{agentId} — a hand-built projection, not the Agent record. Keys
18857/// whose value is undefined are dropped from the JSON, so everything but `agent_id`, `name` and
18858/// `icon` is conditional; `specs` is omitted entirely when empty.
18859#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18860pub struct PublicAgentCard {
18861    pub agent_id: String,
18862    pub name: String,
18863    #[serde(default, skip_serializing_if = "Option::is_none")]
18864    pub description: Option<String>,
18865    /// `metadata.icon`, `""` when unset.
18866    pub icon: serde_json::Value,
18867    #[serde(default, skip_serializing_if = "Option::is_none")]
18868    pub greeting: Option<String>,
18869    /// `"N tools available"`, only when `public_config.allowed_tools` is set.
18870    #[serde(default, skip_serializing_if = "Option::is_none")]
18871    pub capabilities: Option<String>,
18872    #[serde(default, skip_serializing_if = "Option::is_none")]
18873    pub specs: Option<Vec<PublicAgentCardSpec>>,
18874    #[serde(default, skip_serializing_if = "Option::is_none")]
18875    pub ui_avatar: Option<serde_json::Map<String, serde_json::Value>>,
18876    #[serde(default, skip_serializing_if = "Option::is_none")]
18877    pub ui_drop_genome: Option<serde_json::Map<String, serde_json::Value>>,
18878    /// The tenant that owns the agent — the same value as `PublicTenant.slug`. The
18879    /// `/c/{slug}/{agentId}` path segment is NOT authoritative (nothing checks it against the
18880    /// agent); compare it with this and build the way back from here. Present when the owner record
18881    /// has a slug.
18882    #[serde(default, skip_serializing_if = "Option::is_none")]
18883    pub tenant_slug: Option<String>,
18884    /// The owning tenant's display name. Present when the owner record has one.
18885    #[serde(default, skip_serializing_if = "Option::is_none")]
18886    pub tenant_name: Option<String>,
18887}
18888
18889/// `PublicAgentCardSpec` model.
18890#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18891pub struct PublicAgentCardSpec {
18892    pub spec_id: String,
18893    pub name: String,
18894    #[serde(default, skip_serializing_if = "Option::is_none")]
18895    pub version: Option<String>,
18896}
18897
18898/// `PublicBlogPost` model.
18899#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18900pub struct PublicBlogPost {
18901    pub slug: String,
18902    pub title: String,
18903    /// Markdown.
18904    pub body: String,
18905    pub tags: Vec<String>,
18906    pub published_at: String,
18907    pub created_at: String,
18908    pub updated_at: String,
18909}
18910
18911/// `PublicBlogPostSummary` model.
18912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18913pub struct PublicBlogPostSummary {
18914    pub slug: String,
18915    pub title: String,
18916    pub tags: Vec<String>,
18917    /// Body with its leading heading and markdown punctuation stripped, first 240 characters.
18918    pub excerpt: String,
18919    pub published_at: String,
18920}
18921
18922/// Funnel for public (unauthenticated) chat surfaces: visits, engagement, messages, with the
18923/// usual breakdowns.
18924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18925pub struct PublicChatAnalytics {
18926    pub range: PublicChatAnalyticsRange,
18927    pub totals: PublicChatAnalyticsTotals,
18928    /// Ratios, not percentages: 0.25 means a quarter.
18929    pub conversion: PublicChatAnalyticsConversion,
18930    pub timeseries: Vec<PublicChatAnalyticsTimesery>,
18931    pub by_country: Vec<PublicChatAnalyticsByCountryItem>,
18932    pub by_device: Vec<PublicChatAnalyticsByDeviceItem>,
18933    pub by_browser: Vec<PublicChatAnalyticsByBrowserItem>,
18934    pub by_os: Vec<PublicChatAnalyticsByO>,
18935    pub by_referrer: Vec<PublicChatAnalyticsByReferrerItem>,
18936    pub by_utm_source: Vec<PublicChatAnalyticsByUtmSourceItem>,
18937    pub by_agent: Vec<PublicChatAnalyticsByAgentItem>,
18938}
18939
18940/// `PublicChatAnalyticsByAgentItem` model.
18941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18942pub struct PublicChatAnalyticsByAgentItem {
18943    pub agent_id: String,
18944    pub visits: i64,
18945    pub engaged: i64,
18946    pub messages: i64,
18947}
18948
18949/// `PublicChatAnalyticsByBrowserItem` model.
18950#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18951pub struct PublicChatAnalyticsByBrowserItem {
18952    pub value: String,
18953    pub count: i64,
18954}
18955
18956/// `PublicChatAnalyticsByCountryItem` model.
18957#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18958pub struct PublicChatAnalyticsByCountryItem {
18959    pub value: String,
18960    pub count: i64,
18961}
18962
18963/// `PublicChatAnalyticsByDeviceItem` model.
18964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18965pub struct PublicChatAnalyticsByDeviceItem {
18966    pub value: String,
18967    pub count: i64,
18968}
18969
18970/// `PublicChatAnalyticsByO` model.
18971#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18972pub struct PublicChatAnalyticsByO {
18973    pub value: String,
18974    pub count: i64,
18975}
18976
18977/// `PublicChatAnalyticsByReferrerItem` model.
18978#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18979pub struct PublicChatAnalyticsByReferrerItem {
18980    pub value: String,
18981    pub count: i64,
18982}
18983
18984/// `PublicChatAnalyticsByUtmSourceItem` model.
18985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18986pub struct PublicChatAnalyticsByUtmSourceItem {
18987    pub value: String,
18988    pub count: i64,
18989}
18990
18991/// Ratios, not percentages: 0.25 means a quarter.
18992#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18993pub struct PublicChatAnalyticsConversion {
18994    /// engaged / visit.
18995    pub engagement_rate: f64,
18996    /// message / visit.
18997    pub message_rate: f64,
18998    /// message / engaged.
18999    pub engaged_to_message_rate: f64,
19000}
19001
19002/// `PublicChatAnalyticsRange` model.
19003#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19004pub struct PublicChatAnalyticsRange {
19005    pub from: String,
19006    pub to: String,
19007    pub days: i64,
19008}
19009
19010/// `PublicChatAnalyticsTimesery` model.
19011#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19012pub struct PublicChatAnalyticsTimesery {
19013    pub date: String,
19014    pub visits: i64,
19015    pub engaged: i64,
19016    pub messages: i64,
19017}
19018
19019/// `PublicChatAnalyticsTotals` model.
19020#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19021pub struct PublicChatAnalyticsTotals {
19022    pub public_chat_visit: i64,
19023    pub public_chat_engaged: i64,
19024    pub public_chat_message: i64,
19025}
19026
19027/// `PublicDomainLookupResponse` model.
19028#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19029pub struct PublicDomainLookupResponse {
19030    #[serde(default, skip_serializing_if = "Option::is_none")]
19031    pub tenant_id: Option<String>,
19032    #[serde(default, skip_serializing_if = "Option::is_none")]
19033    pub found: Option<bool>,
19034}
19035
19036/// `PublicPlan` model.
19037#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19038pub struct PublicPlan {
19039    pub id: String,
19040    pub name: String,
19041    pub price_amount_cents: i64,
19042    pub price_currency: String,
19043    pub quotas: serde_json::Map<String, serde_json::Value>,
19044}
19045
19046/// public.ts GET /public/sessions/{sessionId} — every field always present; compacted entries
19047/// are filtered out and non-string content is JSON-stringified.
19048#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19049pub struct PublicSessionView {
19050    pub session_id: String,
19051    pub agent_name: String,
19052    pub greeting: String,
19053    pub description: String,
19054    pub messages: Vec<PublicSessionViewMessage>,
19055    pub message_count: i64,
19056    pub messages_remaining: i64,
19057    pub status: PublicSessionViewStatus,
19058}
19059
19060/// `PublicSessionViewMessage` model.
19061#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19062pub struct PublicSessionViewMessage {
19063    /// The same derived id the authenticated transcript carries (ConversationEntry.message_id).
19064    pub message_id: String,
19065    pub role: PublicSessionViewMessageRole,
19066    pub content: String,
19067    pub timestamp: String,
19068    pub run_id: String,
19069}
19070
19071/// `PublicSessionViewMessageRole` enumeration.
19072#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19073pub enum PublicSessionViewMessageRole {
19074    #[default]
19075    #[serde(rename = "user")]
19076    User,
19077    #[serde(rename = "assistant")]
19078    Assistant,
19079    #[serde(rename = "system")]
19080    System,
19081    #[serde(rename = "tool_result")]
19082    ToolResult,
19083    /// A value the API introduced after this SDK was generated.
19084    #[serde(untagged)]
19085    Other(String),
19086}
19087
19088impl PublicSessionViewMessageRole {
19089    /// The value as it appears on the wire.
19090    pub fn as_str(&self) -> &str {
19091        match self {
19092            Self::User => "user",
19093            Self::Assistant => "assistant",
19094            Self::System => "system",
19095            Self::ToolResult => "tool_result",
19096            Self::Other(value) => value.as_str(),
19097        }
19098    }
19099}
19100
19101impl std::fmt::Display for PublicSessionViewMessageRole {
19102    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19103        f.write_str(self.as_str())
19104    }
19105}
19106
19107impl From<&str> for PublicSessionViewMessageRole {
19108    fn from(value: &str) -> Self {
19109        match value {
19110            "user" => Self::User,
19111            "assistant" => Self::Assistant,
19112            "system" => Self::System,
19113            "tool_result" => Self::ToolResult,
19114            other => Self::Other(other.to_string()),
19115        }
19116    }
19117}
19118
19119/// `PublicSessionViewStatus` enumeration.
19120#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19121pub enum PublicSessionViewStatus {
19122    #[default]
19123    #[serde(rename = "active")]
19124    Active,
19125    #[serde(rename = "closed")]
19126    Closed,
19127    #[serde(rename = "expired")]
19128    Expired,
19129    /// A value the API introduced after this SDK was generated.
19130    #[serde(untagged)]
19131    Other(String),
19132}
19133
19134impl PublicSessionViewStatus {
19135    /// The value as it appears on the wire.
19136    pub fn as_str(&self) -> &str {
19137        match self {
19138            Self::Active => "active",
19139            Self::Closed => "closed",
19140            Self::Expired => "expired",
19141            Self::Other(value) => value.as_str(),
19142        }
19143    }
19144}
19145
19146impl std::fmt::Display for PublicSessionViewStatus {
19147    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19148        f.write_str(self.as_str())
19149    }
19150}
19151
19152impl From<&str> for PublicSessionViewStatus {
19153    fn from(value: &str) -> Self {
19154        match value {
19155            "active" => Self::Active,
19156            "closed" => Self::Closed,
19157            "expired" => Self::Expired,
19158            other => Self::Other(other.to_string()),
19159        }
19160    }
19161}
19162
19163/// `PublicState` model.
19164#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19165pub struct PublicState {
19166    #[serde(default, skip_serializing_if = "Option::is_none")]
19167    pub marketplace: Option<serde_json::Map<String, serde_json::Value>>,
19168    #[serde(default, skip_serializing_if = "Option::is_none")]
19169    pub governance: Option<serde_json::Map<String, serde_json::Value>>,
19170    #[serde(default, skip_serializing_if = "Option::is_none")]
19171    pub plan: Option<String>,
19172    #[serde(default, skip_serializing_if = "Option::is_none")]
19173    pub branding: Option<serde_json::Map<String, serde_json::Value>>,
19174    pub category: String,
19175    #[serde(default, skip_serializing_if = "Option::is_none")]
19176    pub description: Option<String>,
19177    #[serde(default, skip_serializing_if = "Option::is_none")]
19178    pub logo_url: Option<String>,
19179    pub name: String,
19180    #[serde(default, skip_serializing_if = "Option::is_none")]
19181    pub published_at: Option<String>,
19182    pub short_description: String,
19183    pub slug: String,
19184    #[serde(default, skip_serializing_if = "Option::is_none")]
19185    pub social_links: Option<TenantSocialLinks>,
19186    #[serde(default, skip_serializing_if = "Option::is_none")]
19187    pub stats: Option<serde_json::Map<String, serde_json::Value>>,
19188    pub tags: Vec<String>,
19189    pub tenant_id: String,
19190}
19191
19192/// public.ts — keys always present, values may be absent when the index row lacks them.
19193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19194pub struct PublicStateAgent {
19195    #[serde(default, skip_serializing_if = "Option::is_none")]
19196    pub agent_id: Option<String>,
19197    #[serde(default, skip_serializing_if = "Option::is_none")]
19198    pub name: Option<String>,
19199    #[serde(default, skip_serializing_if = "Option::is_none")]
19200    pub description: Option<String>,
19201    #[serde(default, skip_serializing_if = "Option::is_none")]
19202    pub icon: Option<String>,
19203    #[serde(default, skip_serializing_if = "Option::is_none")]
19204    pub greeting: Option<String>,
19205}
19206
19207/// `PublicTenant` model.
19208#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19209pub struct PublicTenant {
19210    /// Served 2026-09-10; contents not asserted.
19211    #[serde(default, skip_serializing_if = "Option::is_none")]
19212    pub marketplace: Option<serde_json::Map<String, serde_json::Value>>,
19213    pub tenant_id: String,
19214    pub slug: String,
19215    pub name: String,
19216    #[serde(default, skip_serializing_if = "Option::is_none")]
19217    pub description: Option<String>,
19218    #[serde(default, skip_serializing_if = "Option::is_none")]
19219    pub logo_url: Option<String>,
19220    #[serde(default, skip_serializing_if = "Option::is_none")]
19221    pub category: Option<String>,
19222    pub tags: Vec<String>,
19223    pub agents_count: i64,
19224    pub agents: Vec<PublicTenantAgent>,
19225    pub stats: PublicTenantStats,
19226    #[serde(default, skip_serializing_if = "Option::is_none")]
19227    pub social_links: Option<TenantSocialLinks>,
19228    #[serde(default, skip_serializing_if = "Option::is_none")]
19229    pub branding: Option<serde_json::Map<String, serde_json::Value>>,
19230    #[serde(default, skip_serializing_if = "Option::is_none")]
19231    pub published_at: Option<String>,
19232}
19233
19234/// `PublicTenantAgent` model.
19235#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19236pub struct PublicTenantAgent {
19237    pub agent_id: String,
19238    pub name: String,
19239    #[serde(default, skip_serializing_if = "Option::is_none")]
19240    pub description: Option<String>,
19241    #[serde(default, skip_serializing_if = "Option::is_none")]
19242    pub icon: Option<String>,
19243    #[serde(default, skip_serializing_if = "Option::is_none")]
19244    pub greeting: Option<String>,
19245}
19246
19247/// `PublicTenantStats` model.
19248#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19249pub struct PublicTenantStats {
19250    pub total_runs: i64,
19251    pub total_agents: i64,
19252    pub avg_rating: f64,
19253}
19254
19255/// `PublicTrackEventRequest` model.
19256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19257pub struct PublicTrackEventRequest {
19258    pub event: String,
19259    #[serde(default, skip_serializing_if = "Option::is_none")]
19260    pub properties: Option<serde_json::Map<String, serde_json::Value>>,
19261}
19262
19263/// `PublishListingRequest` model.
19264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19265pub struct PublishListingRequest {
19266    pub agent_id: String,
19267    #[serde(default, skip_serializing_if = "Option::is_none")]
19268    pub agent_version: Option<String>,
19269    pub name: String,
19270    #[serde(default, skip_serializing_if = "Option::is_none")]
19271    pub description: Option<String>,
19272    pub category: String,
19273    #[serde(default, skip_serializing_if = "Option::is_none")]
19274    pub tags: Option<Vec<String>>,
19275    #[serde(default, skip_serializing_if = "Option::is_none")]
19276    pub readme: Option<String>,
19277    #[serde(default, skip_serializing_if = "Option::is_none")]
19278    pub pricing: Option<serde_json::Map<String, serde_json::Value>>,
19279    #[serde(default, skip_serializing_if = "Option::is_none")]
19280    pub a2a_enabled: Option<bool>,
19281}
19282
19283/// `PublishWorkspaceSnapshotRequest` model.
19284#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19285pub struct PublishWorkspaceSnapshotRequest {
19286    /// Self-contained HTML, ≤3 MB.
19287    pub html: String,
19288    /// Defaults to `Shared page`.
19289    #[serde(default, skip_serializing_if = "Option::is_none")]
19290    pub title: Option<String>,
19291}
19292
19293/// `PublishWorkspaceSnapshotResponse` model.
19294#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19295pub struct PublishWorkspaceSnapshotResponse {
19296    pub token: String,
19297    pub expires_at: String,
19298}
19299
19300/// `PurgeAdminTenantResponse` model.
19301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19302pub struct PurgeAdminTenantResponse {
19303    #[serde(default, skip_serializing_if = "Option::is_none")]
19304    pub purged: Option<bool>,
19305    #[serde(default, skip_serializing_if = "Option::is_none")]
19306    pub tenant_id: Option<String>,
19307}
19308
19309/// `PushBridgeTaskEventsResponse` model.
19310#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19311pub struct PushBridgeTaskEventsResponse {
19312    #[serde(default, skip_serializing_if = "Option::is_none")]
19313    pub success: Option<bool>,
19314    #[serde(default, skip_serializing_if = "Option::is_none")]
19315    pub events_stored: Option<i64>,
19316}
19317
19318/// `RateListingRequest` model.
19319#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19320pub struct RateListingRequest {
19321    pub rating: i64,
19322    #[serde(default, skip_serializing_if = "Option::is_none")]
19323    pub comment: Option<String>,
19324}
19325
19326/// `ReactivateTenantResponse` model.
19327#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19328pub struct ReactivateTenantResponse {
19329    pub reactivated: bool,
19330    pub tenant_id: String,
19331}
19332
19333/// GET /health/ready and GET /readyz (measured 2026-09-10): overall status, the check's
19334/// timestamp, and one entry per component — cron, events, kv, mcp, workers.
19335#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19336pub struct ReadinessReport {
19337    pub status: String,
19338    pub timestamp: String,
19339    pub components: serde_json::Map<String, serde_json::Value>,
19340}
19341
19342/// `RedeemPromoCodeRequest` model.
19343#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19344pub struct RedeemPromoCodeRequest {
19345    pub code: String,
19346}
19347
19348/// `RedeemPromoCodeResponse` model.
19349#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19350pub struct RedeemPromoCodeResponse {
19351    pub redeemed: bool,
19352    pub code: String,
19353    #[serde(default, skip_serializing_if = "Option::is_none")]
19354    pub discount_percent: Option<f64>,
19355    pub subscriber_bonus_tokens: i64,
19356}
19357
19358/// `RegisterAmbassadorRequest` model.
19359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19360pub struct RegisterAmbassadorRequest {
19361    pub ambassador_id: String,
19362    #[serde(default, skip_serializing_if = "Option::is_none")]
19363    pub name: Option<String>,
19364    #[serde(default, skip_serializing_if = "Option::is_none")]
19365    pub role: Option<String>,
19366    #[serde(default, skip_serializing_if = "Option::is_none")]
19367    pub permissions: Option<serde_json::Map<String, serde_json::Value>>,
19368}
19369
19370/// `RegisterAmbassadorResponse` model.
19371#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19372pub struct RegisterAmbassadorResponse {
19373    pub ok: bool,
19374}
19375
19376/// `RegisterResponse` model.
19377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19378pub struct RegisterResponse {
19379    pub message: String,
19380}
19381
19382/// `RegistryAdminListSpecsResponse` model.
19383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19384pub struct RegistryAdminListSpecsResponse {
19385    pub specs: Vec<RegistryAdminListSpecsResponseSpec>,
19386    #[serde(default, skip_serializing_if = "Option::is_none")]
19387    pub next_cursor: Option<String>,
19388}
19389
19390/// `RegistryAdminListSpecsResponseSpec` model.
19391#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19392pub struct RegistryAdminListSpecsResponseSpec {
19393    #[serde(default, skip_serializing_if = "Option::is_none")]
19394    pub scope: Option<String>,
19395    #[serde(default, skip_serializing_if = "Option::is_none")]
19396    pub name: Option<String>,
19397    #[serde(default, skip_serializing_if = "Option::is_none")]
19398    pub owner_tenant_id: Option<String>,
19399    #[serde(default, skip_serializing_if = "Option::is_none")]
19400    pub visibility: Option<SetRegistrySpecVisibilityRequestVisibility>,
19401    #[serde(default, skip_serializing_if = "Option::is_none")]
19402    pub latest_version: Option<String>,
19403    #[serde(default, skip_serializing_if = "Option::is_none")]
19404    pub published_at: Option<String>,
19405    #[serde(default, skip_serializing_if = "Option::is_none")]
19406    pub size_bytes: Option<i64>,
19407    #[serde(default, skip_serializing_if = "Option::is_none")]
19408    pub yanked: Option<bool>,
19409    #[serde(default, skip_serializing_if = "Option::is_none")]
19410    pub shared_with_count: Option<i64>,
19411    #[serde(default, skip_serializing_if = "Option::is_none")]
19412    pub categories: Option<Vec<String>>,
19413    #[serde(default, skip_serializing_if = "Option::is_none")]
19414    pub keywords: Option<Vec<String>>,
19415    #[serde(default, skip_serializing_if = "Option::is_none")]
19416    pub description: Option<String>,
19417}
19418
19419/// `RegistryGetFileResponse` model.
19420#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19421pub struct RegistryGetFileResponse {
19422    pub path: String,
19423    pub size: i64,
19424    pub binary: bool,
19425    pub truncated: bool,
19426    /// UTF-8 text body. `null` when `binary: true`.
19427    #[serde(default, skip_serializing_if = "Option::is_none")]
19428    pub content: Option<String>,
19429}
19430
19431/// `RegistryGetReadmeResponse` model.
19432#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19433pub struct RegistryGetReadmeResponse {
19434    pub readme: String,
19435}
19436
19437/// `RegistryGetShareResponse` model.
19438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19439pub struct RegistryGetShareResponse {
19440    pub scope: String,
19441    pub name: String,
19442    pub shared_with: Vec<String>,
19443    pub owner_tenant_id: String,
19444    pub updated_at: String,
19445}
19446
19447/// `RegistryGetSparseIndexResponse` model.
19448#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19449pub struct RegistryGetSparseIndexResponse {
19450    pub scope: String,
19451    pub name: String,
19452    pub versions: Vec<RegistryGetSparseIndexResponseVersion>,
19453}
19454
19455/// `RegistryGetSparseIndexResponseVersion` model.
19456#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19457pub struct RegistryGetSparseIndexResponseVersion {
19458    pub version: String,
19459    pub sha256: String,
19460    pub dependencies: Vec<ResolvedDep>,
19461    pub yanked: bool,
19462    #[serde(default, skip_serializing_if = "Option::is_none")]
19463    pub yank_reason: Option<String>,
19464    #[serde(default, skip_serializing_if = "Option::is_none")]
19465    pub size: Option<i64>,
19466    pub published_at: String,
19467}
19468
19469/// `RegistryGetSpecMetadataResponse` model.
19470#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19471pub struct RegistryGetSpecMetadataResponse {
19472    pub scope: String,
19473    pub name: String,
19474    pub description: String,
19475    pub license: String,
19476    #[serde(default, skip_serializing_if = "Option::is_none")]
19477    pub repository: Option<String>,
19478    #[serde(default, skip_serializing_if = "Option::is_none")]
19479    pub homepage: Option<String>,
19480    pub categories: Vec<String>,
19481    pub keywords: Vec<String>,
19482    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
19483    #[serde(default, skip_serializing_if = "Option::is_none")]
19484    pub shared_with: Option<Vec<String>>,
19485    pub owner_tenant_id: String,
19486    pub latest_version: String,
19487    pub versions: Vec<RegistryVersionEntry>,
19488    pub created_at: String,
19489    pub updated_at: String,
19490    pub tool_count: i64,
19491    pub skill_count: i64,
19492    pub capabilities: Vec<String>,
19493    /// The canvas this SPEC's output belongs on. Absent when it names none; a client treats absent
19494    /// and unknown the same way — chat.
19495    #[serde(default, skip_serializing_if = "Option::is_none")]
19496    pub canvas: Option<RegistryGetSpecMetadataResponseCanvas>,
19497    #[serde(default, skip_serializing_if = "Option::is_none")]
19498    pub schema_version: Option<String>,
19499}
19500
19501/// The canvas this SPEC's output belongs on. Absent when it names none; a client treats absent
19502/// and unknown the same way — chat.
19503#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19504pub enum RegistryGetSpecMetadataResponseCanvas {
19505    #[default]
19506    #[serde(rename = "document")]
19507    Document,
19508    #[serde(rename = "code")]
19509    Code,
19510    #[serde(rename = "image")]
19511    Image,
19512    #[serde(rename = "drawing")]
19513    Drawing,
19514    /// A value the API introduced after this SDK was generated.
19515    #[serde(untagged)]
19516    Other(String),
19517}
19518
19519impl RegistryGetSpecMetadataResponseCanvas {
19520    /// The value as it appears on the wire.
19521    pub fn as_str(&self) -> &str {
19522        match self {
19523            Self::Document => "document",
19524            Self::Code => "code",
19525            Self::Image => "image",
19526            Self::Drawing => "drawing",
19527            Self::Other(value) => value.as_str(),
19528        }
19529    }
19530}
19531
19532impl std::fmt::Display for RegistryGetSpecMetadataResponseCanvas {
19533    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19534        f.write_str(self.as_str())
19535    }
19536}
19537
19538impl From<&str> for RegistryGetSpecMetadataResponseCanvas {
19539    fn from(value: &str) -> Self {
19540        match value {
19541            "document" => Self::Document,
19542            "code" => Self::Code,
19543            "image" => Self::Image,
19544            "drawing" => Self::Drawing,
19545            other => Self::Other(other.to_string()),
19546        }
19547    }
19548}
19549
19550/// `RegistryGetSpecVersionResponse` model.
19551#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19552pub struct RegistryGetSpecVersionResponse {
19553    #[serde(default, skip_serializing_if = "Option::is_none")]
19554    pub scope: Option<String>,
19555    #[serde(default, skip_serializing_if = "Option::is_none")]
19556    pub name: Option<String>,
19557    #[serde(default, skip_serializing_if = "Option::is_none")]
19558    pub version: Option<String>,
19559    #[serde(default, skip_serializing_if = "Option::is_none")]
19560    pub manifest: Option<serde_json::Map<String, serde_json::Value>>,
19561    #[serde(default, skip_serializing_if = "Option::is_none")]
19562    pub sha256: Option<String>,
19563    #[serde(default, skip_serializing_if = "Option::is_none")]
19564    pub size_bytes: Option<i64>,
19565    #[serde(default, skip_serializing_if = "Option::is_none")]
19566    pub dependencies: Option<Vec<ResolvedDep>>,
19567    #[serde(default, skip_serializing_if = "Option::is_none")]
19568    pub yanked: Option<bool>,
19569    #[serde(default, skip_serializing_if = "Option::is_none")]
19570    pub visibility: Option<SetRegistrySpecVisibilityRequestVisibility>,
19571    #[serde(default, skip_serializing_if = "Option::is_none")]
19572    pub shared_with: Option<Vec<String>>,
19573    #[serde(default, skip_serializing_if = "Option::is_none")]
19574    pub published_at: Option<String>,
19575    #[serde(default, skip_serializing_if = "Option::is_none")]
19576    pub download_url: Option<String>,
19577}
19578
19579/// `RegistryListFilesResponse` model.
19580#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19581pub struct RegistryListFilesResponse {
19582    pub files: Vec<RegistryListFilesResponseFile>,
19583}
19584
19585/// `RegistryListFilesResponseFile` model.
19586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19587pub struct RegistryListFilesResponseFile {
19588    #[serde(default, skip_serializing_if = "Option::is_none")]
19589    pub path: Option<String>,
19590    #[serde(default, skip_serializing_if = "Option::is_none")]
19591    pub size: Option<i64>,
19592    #[serde(default, skip_serializing_if = "Option::is_none")]
19593    pub binary: Option<bool>,
19594}
19595
19596/// `RegistryPublishRequest` model.
19597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19598pub struct RegistryPublishRequest {
19599    /// JSON-stringified SpecManifest, validated server-side.
19600    pub manifest: String,
19601    /// Spec bundle (.tar.zst). Size capped per platform config.
19602    pub artifact: FilePart,
19603    /// Lowercase hex sha256; verified if provided.
19604    #[serde(default, skip_serializing_if = "Option::is_none")]
19605    pub sha256: Option<String>,
19606    /// Optional JSON-stringified SLSA provenance envelope. Shape-checked on publish (object with
19607    /// non-empty `predicate_type`, `signature`, `public_key` and an object `predicate`) and NOT
19608    /// verified: artifact signing is off by default (`spec_registry.signing_mode`), `GET
19609    /// /registry/keys` answers 501, and the loader's signature gate is skipped. Reads that carry an
19610    /// attestation also carry `attestation_verified: false` — see the version response.
19611    #[serde(default, skip_serializing_if = "Option::is_none")]
19612    pub attestation: Option<String>,
19613}
19614
19615/// `RegistryPublishResponse` model.
19616#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19617pub struct RegistryPublishResponse {
19618    pub scope: String,
19619    pub name: String,
19620    pub version: String,
19621    pub publisher_tenant_id: String,
19622    pub manifest: serde_json::Map<String, serde_json::Value>,
19623    pub sha256: String,
19624    pub size_bytes: i64,
19625    #[serde(default, skip_serializing_if = "Option::is_none")]
19626    pub artifact_key: Option<String>,
19627    #[serde(default, skip_serializing_if = "Option::is_none")]
19628    pub dependencies: Option<Vec<ResolvedDep>>,
19629    #[serde(default, skip_serializing_if = "Option::is_none")]
19630    pub yanked: Option<bool>,
19631    #[serde(default, skip_serializing_if = "Option::is_none")]
19632    pub yanked_reason: Option<String>,
19633    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
19634    #[serde(default, skip_serializing_if = "Option::is_none")]
19635    pub shared_with: Option<Vec<String>>,
19636    #[serde(default, skip_serializing_if = "Option::is_none")]
19637    pub attestation: Option<serde_json::Map<String, serde_json::Value>>,
19638    pub published_at: String,
19639}
19640
19641/// `RegistrySearchResponse` model.
19642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19643pub struct RegistrySearchResponse {
19644    pub hits: Vec<RegistrySearchResponseHit>,
19645    pub total: i64,
19646    #[serde(default, skip_serializing_if = "Option::is_none")]
19647    pub next_cursor: Option<String>,
19648}
19649
19650/// `RegistrySearchResponseHit` model.
19651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19652pub struct RegistrySearchResponseHit {
19653    #[serde(default, skip_serializing_if = "Option::is_none")]
19654    pub scope: Option<String>,
19655    #[serde(default, skip_serializing_if = "Option::is_none")]
19656    pub name: Option<String>,
19657    #[serde(default, skip_serializing_if = "Option::is_none")]
19658    pub version: Option<String>,
19659    #[serde(default, skip_serializing_if = "Option::is_none")]
19660    pub description: Option<String>,
19661    #[serde(default, skip_serializing_if = "Option::is_none")]
19662    pub categories: Option<Vec<String>>,
19663    #[serde(default, skip_serializing_if = "Option::is_none")]
19664    pub keywords: Option<Vec<String>>,
19665    #[serde(default, skip_serializing_if = "Option::is_none")]
19666    pub publisher_tenant_id: Option<String>,
19667    #[serde(default, skip_serializing_if = "Option::is_none")]
19668    pub published_at: Option<String>,
19669}
19670
19671/// `RegistrySetShareRequest` model.
19672#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19673pub struct RegistrySetShareRequest {
19674    /// Tenant IDs allowed to read this private spec.
19675    pub shared_with: Vec<String>,
19676}
19677
19678/// `RegistrySetShareResponse` model.
19679#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19680pub struct RegistrySetShareResponse {
19681    #[serde(default, skip_serializing_if = "Option::is_none")]
19682    pub scope: Option<String>,
19683    #[serde(default, skip_serializing_if = "Option::is_none")]
19684    pub name: Option<String>,
19685    #[serde(default, skip_serializing_if = "Option::is_none")]
19686    pub shared_with: Option<Vec<String>>,
19687    #[serde(default, skip_serializing_if = "Option::is_none")]
19688    pub owner_tenant_id: Option<String>,
19689    #[serde(default, skip_serializing_if = "Option::is_none")]
19690    pub updated_at: Option<String>,
19691}
19692
19693/// `RegistrySpecFeatureState` model.
19694#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19695pub struct RegistrySpecFeatureState {
19696    pub scope: String,
19697    pub name: String,
19698    /// True after a POST, false after a DELETE.
19699    pub featured: bool,
19700}
19701
19702/// `RegistryVersionEntry` model.
19703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19704pub struct RegistryVersionEntry {
19705    pub version: String,
19706    pub sha256: String,
19707    pub dependencies: Vec<ResolvedDep>,
19708    pub yanked: bool,
19709    #[serde(default, skip_serializing_if = "Option::is_none")]
19710    pub yank_reason: Option<String>,
19711    #[serde(default, skip_serializing_if = "Option::is_none")]
19712    pub size: Option<i64>,
19713    pub published_at: String,
19714}
19715
19716/// `RegistryYankVersionRequest` model.
19717#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19718pub struct RegistryYankVersionRequest {
19719    #[serde(default, skip_serializing_if = "Option::is_none")]
19720    pub reason: Option<String>,
19721}
19722
19723/// `ReindexKnowledgeBaseResponse` model.
19724#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19725pub struct ReindexKnowledgeBaseResponse {
19726    pub reindexed: bool,
19727    pub total_chunks: i64,
19728    /// Chunks that came back with a vector. Lower than `total_chunks` means some failed.
19729    pub embedded: i64,
19730    pub documents: i64,
19731    pub embedding_model: String,
19732    pub embedding_dimensions: i64,
19733}
19734
19735/// `RejectRunRequest` model.
19736#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19737pub struct RejectRunRequest {
19738    /// Why the tool was refused; recorded on the run and shown to the agent.
19739    #[serde(default, skip_serializing_if = "Option::is_none")]
19740    pub reason: Option<String>,
19741}
19742
19743/// `RejectRunResponse` model.
19744#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19745pub struct RejectRunResponse {
19746    pub rejected: bool,
19747    pub run_id: String,
19748    #[serde(default, skip_serializing_if = "Option::is_none")]
19749    pub reason: Option<String>,
19750}
19751
19752/// `RemoveScheduleResponse` model.
19753#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19754pub struct RemoveScheduleResponse {
19755    pub removed: bool,
19756    pub agent_id: String,
19757}
19758
19759/// `ReplaceConstitutionRequest` model.
19760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19761pub struct ReplaceConstitutionRequest {
19762    pub rules: Vec<ConstitutionRule>,
19763    /// Why the constitution is being replaced. Recorded in the immutable ledger and on the
19764    /// amendment record; defaults to a generic string when omitted.
19765    #[serde(default, skip_serializing_if = "Option::is_none")]
19766    pub rationale: Option<String>,
19767}
19768
19769/// runtime/execution/replay-executor.ts ReplayResult. camelCase on the wire, unlike the rest of
19770/// the API; `divergencePoint`, `divergenceReason` and `stepComparisons` (execute mode only) are
19771/// conditional.
19772#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19773pub struct ReplayResult {
19774    pub deterministic: bool,
19775    pub verified: ReplayResultVerified,
19776    /// Deprecated spelling of `events_replayed` — the same value, kept for the compatibility window
19777    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
19778    /// `events_replayed`.
19779    #[serde(rename = "eventsReplayed")]
19780    pub events_replayed: i64,
19781    /// Deprecated spelling of `run_id` — the same value, kept for the compatibility window and
19782    /// removed in the next breaking release (the one that moves `X-API-Version`). Read `run_id`.
19783    #[serde(rename = "runId")]
19784    pub run_id: String,
19785    pub mode: ReplayResultMode,
19786    /// Deprecated spelling of `divergence_point` — the same value, kept for the compatibility
19787    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
19788    /// `divergence_point`.
19789    #[serde(rename = "divergencePoint", default, skip_serializing_if = "Option::is_none")]
19790    pub divergence_point: Option<i64>,
19791    /// Deprecated spelling of `divergence_reason` — the same value, kept for the compatibility
19792    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
19793    /// `divergence_reason`.
19794    #[serde(rename = "divergenceReason", default, skip_serializing_if = "Option::is_none")]
19795    pub divergence_reason: Option<String>,
19796    /// Deprecated spelling of `step_comparisons` — the same value, kept for the compatibility
19797    /// window and removed in the next breaking release (the one that moves `X-API-Version`). Read
19798    /// `step_comparisons`.
19799    #[serde(rename = "stepComparisons", default, skip_serializing_if = "Option::is_none")]
19800    pub step_comparisons: Option<Vec<ReplayResultStepComparison>>,
19801    #[serde(rename = "events_replayed")]
19802    pub events_replayed_: i64,
19803    #[serde(rename = "run_id")]
19804    pub run_id_: String,
19805    #[serde(rename = "divergence_point", default, skip_serializing_if = "Option::is_none")]
19806    pub divergence_point_: Option<i64>,
19807    #[serde(rename = "divergence_reason", default, skip_serializing_if = "Option::is_none")]
19808    pub divergence_reason_: Option<String>,
19809    #[serde(rename = "step_comparisons", default, skip_serializing_if = "Option::is_none")]
19810    pub step_comparisons_: Option<Vec<ReplayResultStepComparison2>>,
19811}
19812
19813/// `ReplayResultMode` enumeration.
19814#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19815pub enum ReplayResultMode {
19816    #[default]
19817    #[serde(rename = "verify")]
19818    Verify,
19819    #[serde(rename = "execute")]
19820    Execute,
19821    /// A value the API introduced after this SDK was generated.
19822    #[serde(untagged)]
19823    Other(String),
19824}
19825
19826impl ReplayResultMode {
19827    /// The value as it appears on the wire.
19828    pub fn as_str(&self) -> &str {
19829        match self {
19830            Self::Verify => "verify",
19831            Self::Execute => "execute",
19832            Self::Other(value) => value.as_str(),
19833        }
19834    }
19835}
19836
19837impl std::fmt::Display for ReplayResultMode {
19838    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19839        f.write_str(self.as_str())
19840    }
19841}
19842
19843impl From<&str> for ReplayResultMode {
19844    fn from(value: &str) -> Self {
19845        match value {
19846            "verify" => Self::Verify,
19847            "execute" => Self::Execute,
19848            other => Self::Other(other.to_string()),
19849        }
19850    }
19851}
19852
19853/// `ReplayResultStepComparison` model.
19854#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19855pub struct ReplayResultStepComparison {
19856    pub seq: i64,
19857    pub r#type: String,
19858    pub matches: bool,
19859    /// Deprecated spelling of `mismatch_detail` — the same value, kept for the compatibility window
19860    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
19861    /// `mismatch_detail`.
19862    #[serde(rename = "mismatchDetail", default, skip_serializing_if = "Option::is_none")]
19863    pub mismatch_detail: Option<String>,
19864    #[serde(rename = "mismatch_detail", default, skip_serializing_if = "Option::is_none")]
19865    pub mismatch_detail_: Option<String>,
19866}
19867
19868/// `ReplayResultStepComparison2` model.
19869#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19870pub struct ReplayResultStepComparison2 {
19871    pub seq: i64,
19872    pub r#type: String,
19873    pub matches: bool,
19874    /// Deprecated spelling of `mismatch_detail` — the same value, kept for the compatibility window
19875    /// and removed in the next breaking release (the one that moves `X-API-Version`). Read
19876    /// `mismatch_detail`.
19877    #[serde(rename = "mismatchDetail", default, skip_serializing_if = "Option::is_none")]
19878    pub mismatch_detail: Option<String>,
19879    #[serde(rename = "mismatch_detail", default, skip_serializing_if = "Option::is_none")]
19880    pub mismatch_detail_: Option<String>,
19881}
19882
19883/// `ReplayResultVerified` enumeration.
19884#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19885pub enum ReplayResultVerified {
19886    #[default]
19887    #[serde(rename = "recorded_log")]
19888    RecordedLog,
19889    /// A value the API introduced after this SDK was generated.
19890    #[serde(untagged)]
19891    Other(String),
19892}
19893
19894impl ReplayResultVerified {
19895    /// The value as it appears on the wire.
19896    pub fn as_str(&self) -> &str {
19897        match self {
19898            Self::RecordedLog => "recorded_log",
19899            Self::Other(value) => value.as_str(),
19900        }
19901    }
19902}
19903
19904impl std::fmt::Display for ReplayResultVerified {
19905    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19906        f.write_str(self.as_str())
19907    }
19908}
19909
19910impl From<&str> for ReplayResultVerified {
19911    fn from(value: &str) -> Self {
19912        match value {
19913            "recorded_log" => Self::RecordedLog,
19914            other => Self::Other(other.to_string()),
19915        }
19916    }
19917}
19918
19919/// `RequestOtpCodeResponse` model.
19920#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19921pub struct RequestOtpCodeResponse {
19922    pub ok: bool,
19923    pub message: String,
19924}
19925
19926/// `ResendInviteResponse` model.
19927#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19928pub struct ResendInviteResponse {
19929    pub resent: bool,
19930    pub email_sent: bool,
19931    pub invite: serde_json::Map<String, serde_json::Value>,
19932}
19933
19934/// `ResetAgentResponse` model.
19935#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19936pub struct ResetAgentResponse {
19937    pub ok: bool,
19938    /// Sessions deleted
19939    pub sessions: i64,
19940    /// Runs deleted
19941    pub runs: i64,
19942}
19943
19944/// `ResolveAmbassadorRequestRequest` model.
19945#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19946pub struct ResolveAmbassadorRequestRequest {
19947    pub response: String,
19948}
19949
19950/// `ResolvedDep` model.
19951#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19952pub struct ResolvedDep {
19953    pub scope: String,
19954    pub name: String,
19955    pub version_req: String,
19956}
19957
19958/// `ResolveSharedSessionResponse` model.
19959#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19960pub struct ResolveSharedSessionResponse {
19961    #[serde(default, skip_serializing_if = "Option::is_none")]
19962    pub session_id: Option<String>,
19963    #[serde(default, skip_serializing_if = "Option::is_none")]
19964    pub agent_name: Option<String>,
19965    #[serde(default, skip_serializing_if = "Option::is_none")]
19966    pub role: Option<CreateSessionShareRequestRole>,
19967}
19968
19969/// Accepted, stored, and enforced by nothing (GOV-D01). The subset check that governs
19970/// agent-to-agent spawn examines tools, roles, budget, spawn depth and self-modify, and never
19971/// this field; no reader anywhere consults it to gate access to a resource. Granting or
19972/// revoking it changes what an operator sees stored and nothing about what an agent may do.
19973/// Documented rather than removed or enforced: removing it would break a field tenants may
19974/// already have populated, and enforcing it would invent an authorisation rule the platform has
19975/// never applied.
19976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19977pub struct ResourcePermission {
19978    pub resource: String,
19979    pub actions: Vec<ResourcePermissionAction>,
19980}
19981
19982/// `ResourcePermissionAction` enumeration.
19983#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
19984pub enum ResourcePermissionAction {
19985    #[default]
19986    #[serde(rename = "read")]
19987    Read,
19988    #[serde(rename = "write")]
19989    Write,
19990    #[serde(rename = "delete")]
19991    Delete,
19992    #[serde(rename = "execute")]
19993    Execute,
19994    /// A value the API introduced after this SDK was generated.
19995    #[serde(untagged)]
19996    Other(String),
19997}
19998
19999impl ResourcePermissionAction {
20000    /// The value as it appears on the wire.
20001    pub fn as_str(&self) -> &str {
20002        match self {
20003            Self::Read => "read",
20004            Self::Write => "write",
20005            Self::Delete => "delete",
20006            Self::Execute => "execute",
20007            Self::Other(value) => value.as_str(),
20008        }
20009    }
20010}
20011
20012impl std::fmt::Display for ResourcePermissionAction {
20013    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20014        f.write_str(self.as_str())
20015    }
20016}
20017
20018impl From<&str> for ResourcePermissionAction {
20019    fn from(value: &str) -> Self {
20020        match value {
20021            "read" => Self::Read,
20022            "write" => Self::Write,
20023            "delete" => Self::Delete,
20024            "execute" => Self::Execute,
20025            other => Self::Other(other.to_string()),
20026        }
20027    }
20028}
20029
20030/// `ResourceUsageEntry` model.
20031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20032pub struct ResourceUsageEntry {
20033    pub count: f64,
20034    pub limit: f64,
20035    pub over_by: f64,
20036}
20037
20038/// `RespondToPublicHitlRequest` model.
20039#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20040pub struct RespondToPublicHitlRequest {
20041    pub response: String,
20042}
20043
20044/// `RespondToPublicHitlResponse` model.
20045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20046pub struct RespondToPublicHitlResponse {
20047    pub status: RespondToPublicHitlResponseStatus,
20048    /// The resumed run, not a new one (public.ts handlePublicRespond).
20049    pub run_id: String,
20050}
20051
20052/// `RespondToPublicHitlResponseStatus` enumeration.
20053#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20054pub enum RespondToPublicHitlResponseStatus {
20055    #[default]
20056    #[serde(rename = "ok")]
20057    Ok,
20058    /// A value the API introduced after this SDK was generated.
20059    #[serde(untagged)]
20060    Other(String),
20061}
20062
20063impl RespondToPublicHitlResponseStatus {
20064    /// The value as it appears on the wire.
20065    pub fn as_str(&self) -> &str {
20066        match self {
20067            Self::Ok => "ok",
20068            Self::Other(value) => value.as_str(),
20069        }
20070    }
20071}
20072
20073impl std::fmt::Display for RespondToPublicHitlResponseStatus {
20074    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20075        f.write_str(self.as_str())
20076    }
20077}
20078
20079impl From<&str> for RespondToPublicHitlResponseStatus {
20080    fn from(value: &str) -> Self {
20081        match value {
20082            "ok" => Self::Ok,
20083            other => Self::Other(other.to_string()),
20084        }
20085    }
20086}
20087
20088/// `RespondToRunRequest` model.
20089#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20090pub struct RespondToRunRequest {
20091    pub response: String,
20092}
20093
20094/// `RespondToRunResponse` model.
20095#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20096pub struct RespondToRunResponse {
20097    #[serde(default, skip_serializing_if = "Option::is_none")]
20098    pub accepted: Option<bool>,
20099}
20100
20101/// openai-responses.ts — always exactly one message with one output_text part.
20102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20103pub struct ResponsesOutputItem {
20104    pub r#type: ResponsesOutputItemType,
20105    pub role: OpenAiChatCompletionChoiceMessageRole,
20106    pub content: Vec<ResponsesOutputItemContentItem>,
20107}
20108
20109/// `ResponsesOutputItemContentItem` model.
20110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20111pub struct ResponsesOutputItemContentItem {
20112    pub r#type: ResponsesOutputItemContentItemType,
20113    pub text: String,
20114}
20115
20116/// `ResponsesOutputItemContentItemType` enumeration.
20117#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20118pub enum ResponsesOutputItemContentItemType {
20119    #[default]
20120    #[serde(rename = "output_text")]
20121    OutputText,
20122    /// A value the API introduced after this SDK was generated.
20123    #[serde(untagged)]
20124    Other(String),
20125}
20126
20127impl ResponsesOutputItemContentItemType {
20128    /// The value as it appears on the wire.
20129    pub fn as_str(&self) -> &str {
20130        match self {
20131            Self::OutputText => "output_text",
20132            Self::Other(value) => value.as_str(),
20133        }
20134    }
20135}
20136
20137impl std::fmt::Display for ResponsesOutputItemContentItemType {
20138    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20139        f.write_str(self.as_str())
20140    }
20141}
20142
20143impl From<&str> for ResponsesOutputItemContentItemType {
20144    fn from(value: &str) -> Self {
20145        match value {
20146            "output_text" => Self::OutputText,
20147            other => Self::Other(other.to_string()),
20148        }
20149    }
20150}
20151
20152/// `ResponsesOutputItemType` enumeration.
20153#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20154pub enum ResponsesOutputItemType {
20155    #[default]
20156    #[serde(rename = "message")]
20157    Message,
20158    /// A value the API introduced after this SDK was generated.
20159    #[serde(untagged)]
20160    Other(String),
20161}
20162
20163impl ResponsesOutputItemType {
20164    /// The value as it appears on the wire.
20165    pub fn as_str(&self) -> &str {
20166        match self {
20167            Self::Message => "message",
20168            Self::Other(value) => value.as_str(),
20169        }
20170    }
20171}
20172
20173impl std::fmt::Display for ResponsesOutputItemType {
20174    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20175        f.write_str(self.as_str())
20176    }
20177}
20178
20179impl From<&str> for ResponsesOutputItemType {
20180    fn from(value: &str) -> Self {
20181        match value {
20182            "message" => Self::Message,
20183            other => Self::Other(other.to_string()),
20184        }
20185    }
20186}
20187
20188/// `RestoreWorkspaceTrashRequest` model.
20189#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20190pub struct RestoreWorkspaceTrashRequest {
20191    /// The `.trash/…` path from a trash listing or a soft-delete response.
20192    pub trash_path: String,
20193}
20194
20195/// `RestoreWorkspaceTrashResponse` model.
20196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20197pub struct RestoreWorkspaceTrashResponse {
20198    pub restored: bool,
20199    pub original_path: String,
20200    pub original_workspace_id: String,
20201}
20202
20203/// `ResumeCompanyResponse` model.
20204#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20205pub struct ResumeCompanyResponse {
20206    #[serde(default, skip_serializing_if = "Option::is_none")]
20207    pub status: Option<String>,
20208}
20209
20210/// `ResumeMissionResponse` model.
20211#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20212pub struct ResumeMissionResponse {
20213    pub accepted: bool,
20214    pub mission: Mission,
20215}
20216
20217/// `ResumeRunRequest` model.
20218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20219pub struct ResumeRunRequest {
20220    /// Stored on the run as `_resume_input`. A string `note` (or `message`) is handed to the model
20221    /// as a user turn when the run continues.
20222    #[serde(default, skip_serializing_if = "Option::is_none")]
20223    pub input: Option<ResumeRunRequestInput>,
20224    /// Accepted and ignored; kept so existing callers are not refused.
20225    #[serde(default, skip_serializing_if = "Option::is_none")]
20226    pub response: Option<serde_json::Value>,
20227}
20228
20229/// Stored on the run as `_resume_input`. A string `note` (or `message`) is handed to the model
20230/// as a user turn when the run continues.
20231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20232pub struct ResumeRunRequestInput {
20233    #[serde(default, skip_serializing_if = "Option::is_none")]
20234    pub note: Option<String>,
20235    #[serde(default, skip_serializing_if = "Option::is_none")]
20236    pub message: Option<String>,
20237}
20238
20239/// `ResumeRunResponse` model.
20240#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20241pub struct ResumeRunResponse {
20242    pub resumed: bool,
20243    pub run_id: String,
20244}
20245
20246/// `RevokeAPIKeyResponse` model.
20247#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20248pub struct RevokeAPIKeyResponse {
20249    pub revoked: bool,
20250    pub key_id: String,
20251}
20252
20253/// `RevokeMeSessionResponse` model.
20254#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20255pub struct RevokeMeSessionResponse {
20256    pub ok: bool,
20257    pub key_id: String,
20258    #[serde(default, skip_serializing_if = "Option::is_none")]
20259    pub already_revoked: Option<bool>,
20260}
20261
20262/// EU AI Act (Article 9) classification for an agent.
20263#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20264pub struct RiskClassification {
20265    pub level: RiskClassificationUpdateLevel,
20266    /// Set when level is `high`.
20267    #[serde(default, skip_serializing_if = "Option::is_none")]
20268    pub annex_iii_category: Option<RiskClassificationUpdateAnnexIiiCategory>,
20269    pub justification: String,
20270    /// Key ID or user ID of whoever classified.
20271    pub assessor: String,
20272    pub assessed_at: String,
20273    pub review_due_at: String,
20274}
20275
20276/// Body for `PATCH /api/v1/agents/{agentId}/risk-classification`.
20277#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20278pub struct RiskClassificationUpdate {
20279    pub level: RiskClassificationUpdateLevel,
20280    /// Set when level is `high`.
20281    #[serde(default, skip_serializing_if = "Option::is_none")]
20282    pub annex_iii_category: Option<RiskClassificationUpdateAnnexIiiCategory>,
20283    pub justification: String,
20284    pub assessor: String,
20285    /// Defaults to now when omitted.
20286    #[serde(default, skip_serializing_if = "Option::is_none")]
20287    pub assessed_at: Option<String>,
20288    pub review_due_at: String,
20289}
20290
20291/// Set when level is `high`.
20292#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20293pub enum RiskClassificationUpdateAnnexIiiCategory {
20294    #[default]
20295    #[serde(rename = "biometric")]
20296    Biometric,
20297    #[serde(rename = "critical-infrastructure")]
20298    CriticalInfrastructure,
20299    #[serde(rename = "education")]
20300    Education,
20301    #[serde(rename = "employment")]
20302    Employment,
20303    #[serde(rename = "essential-services")]
20304    EssentialServices,
20305    #[serde(rename = "law-enforcement")]
20306    LawEnforcement,
20307    #[serde(rename = "migration")]
20308    Migration,
20309    #[serde(rename = "democratic-processes")]
20310    DemocraticProcesses,
20311    /// A value the API introduced after this SDK was generated.
20312    #[serde(untagged)]
20313    Other(String),
20314}
20315
20316impl RiskClassificationUpdateAnnexIiiCategory {
20317    /// The value as it appears on the wire.
20318    pub fn as_str(&self) -> &str {
20319        match self {
20320            Self::Biometric => "biometric",
20321            Self::CriticalInfrastructure => "critical-infrastructure",
20322            Self::Education => "education",
20323            Self::Employment => "employment",
20324            Self::EssentialServices => "essential-services",
20325            Self::LawEnforcement => "law-enforcement",
20326            Self::Migration => "migration",
20327            Self::DemocraticProcesses => "democratic-processes",
20328            Self::Other(value) => value.as_str(),
20329        }
20330    }
20331}
20332
20333impl std::fmt::Display for RiskClassificationUpdateAnnexIiiCategory {
20334    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20335        f.write_str(self.as_str())
20336    }
20337}
20338
20339impl From<&str> for RiskClassificationUpdateAnnexIiiCategory {
20340    fn from(value: &str) -> Self {
20341        match value {
20342            "biometric" => Self::Biometric,
20343            "critical-infrastructure" => Self::CriticalInfrastructure,
20344            "education" => Self::Education,
20345            "employment" => Self::Employment,
20346            "essential-services" => Self::EssentialServices,
20347            "law-enforcement" => Self::LawEnforcement,
20348            "migration" => Self::Migration,
20349            "democratic-processes" => Self::DemocraticProcesses,
20350            other => Self::Other(other.to_string()),
20351        }
20352    }
20353}
20354
20355/// `RiskClassificationUpdateLevel` enumeration.
20356#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20357pub enum RiskClassificationUpdateLevel {
20358    #[default]
20359    #[serde(rename = "minimal")]
20360    Minimal,
20361    #[serde(rename = "limited")]
20362    Limited,
20363    #[serde(rename = "high")]
20364    High,
20365    #[serde(rename = "unacceptable")]
20366    Unacceptable,
20367    /// A value the API introduced after this SDK was generated.
20368    #[serde(untagged)]
20369    Other(String),
20370}
20371
20372impl RiskClassificationUpdateLevel {
20373    /// The value as it appears on the wire.
20374    pub fn as_str(&self) -> &str {
20375        match self {
20376            Self::Minimal => "minimal",
20377            Self::Limited => "limited",
20378            Self::High => "high",
20379            Self::Unacceptable => "unacceptable",
20380            Self::Other(value) => value.as_str(),
20381        }
20382    }
20383}
20384
20385impl std::fmt::Display for RiskClassificationUpdateLevel {
20386    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20387        f.write_str(self.as_str())
20388    }
20389}
20390
20391impl From<&str> for RiskClassificationUpdateLevel {
20392    fn from(value: &str) -> Self {
20393        match value {
20394            "minimal" => Self::Minimal,
20395            "limited" => Self::Limited,
20396            "high" => Self::High,
20397            "unacceptable" => Self::Unacceptable,
20398            other => Self::Other(other.to_string()),
20399        }
20400    }
20401}
20402
20403/// `RollbackAgentRequest` model.
20404#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20405pub struct RollbackAgentRequest {
20406    /// Version number to rollback to
20407    pub version: i64,
20408}
20409
20410/// governance/emergency.ts RootAttestation — the KV record, unsanitized.
20411#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20412pub struct RootAttestation {
20413    pub root_agent_id: String,
20414    pub founder_id: String,
20415    pub founder_signature: String,
20416    pub constitution_hash: String,
20417    pub created_at: String,
20418}
20419
20420/// `RotateAgentIdentityResponse` model.
20421#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20422pub struct RotateAgentIdentityResponse {
20423    #[serde(default, skip_serializing_if = "Option::is_none")]
20424    pub public_key: Option<String>,
20425    #[serde(default, skip_serializing_if = "Option::is_none")]
20426    pub rotated_at: Option<String>,
20427}
20428
20429/// `Run` model.
20430#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20431pub struct Run {
20432    /// Absent for platform-dispatched cloud runs. `bridge` is written by the platform when a local
20433    /// agent takes the run (run-dispatch.ts, bridge.ts); `async` is only ever an echo of a
20434    /// client-supplied value and has never been stored on production (measured 2026-09-10 over 8605
20435    /// run records: absent 7738, bridge 867, async 0).
20436    #[serde(default, skip_serializing_if = "Option::is_none")]
20437    pub execution_mode: Option<RunExecutionMode>,
20438    pub run_id: String,
20439    pub tenant_id: String,
20440    pub agent_id: String,
20441    #[serde(default, skip_serializing_if = "Option::is_none")]
20442    pub session_id: Option<String>,
20443    pub status: RunStatus,
20444    #[serde(default, skip_serializing_if = "Option::is_none")]
20445    pub input: Option<serde_json::Map<String, serde_json::Value>>,
20446    /// Run output — the same object rides in run events and in a public session's stream
20447    /// (RunOutput). When a run is truncated by its step-budget cutoff (output.truncated === true)
20448    /// AND the platform has UARP_CONTINUATION_TOKEN_KEY configured, output.continuation_token
20449    /// carries an opaque HMAC-signed token that resumes the run via POST /runs/{id}/continue. With
20450    /// no key configured no token is minted and the field is absent; the token is an opaque string
20451    /// to every client.
20452    #[serde(default, skip_serializing_if = "Option::is_none")]
20453    pub output: Option<RunOutput>,
20454    #[serde(default, skip_serializing_if = "Option::is_none")]
20455    pub metrics: Option<RunMetrics>,
20456    /// The sentence a person reads. English on every deployment — nothing here varies by
20457    /// `Accept-Language` — so branch on `error_code`, not on this.
20458    #[serde(default, skip_serializing_if = "Option::is_none")]
20459    pub error: Option<String>,
20460    /// Why the run failed, as a value from the `code` dictionary (see the `Error` schema's enum).
20461    /// Absent when the failure carries nothing a client can branch on — which is deliberate: a code
20462    /// meaning "something went wrong" would be worse than none. Populated since 2026-09-21; before
20463    /// that a client had to regex-test `error`. `approval_rejected` (since 2026-09-22) means a
20464    /// person refused the tool call the run was waiting on — `status` is still `failed`, and
20465    /// `error` is the reviewer's own reason.
20466    #[serde(default, skip_serializing_if = "Option::is_none")]
20467    pub error_code: Option<String>,
20468    /// Numbers the code cannot carry: `retry_after_ms` with `provider_circuit_open`,
20469    /// `quota_exhausted` with `provider_rate_limited`, `stale_seconds` with `run_input_timeout`.
20470    /// Never a provider id — this reaches a screen, and the product does not name the model it
20471    /// picked.
20472    #[serde(default, skip_serializing_if = "Option::is_none")]
20473    pub error_details: Option<serde_json::Map<String, serde_json::Value>>,
20474    /// Every human decision on a tool approval this run waited for, oldest first. Absent when the
20475    /// run never waited for one. Recorded since 2026-09-22; before that an approved call left no
20476    /// trace on the run.
20477    #[serde(default, skip_serializing_if = "Option::is_none")]
20478    pub approvals: Option<Vec<RunApproval>>,
20479    pub created_at: String,
20480    #[serde(default, skip_serializing_if = "Option::is_none")]
20481    pub started_at: Option<String>,
20482    #[serde(default, skip_serializing_if = "Option::is_none")]
20483    pub completed_at: Option<String>,
20484    /// Team run ID if part of a team execution
20485    #[serde(default, skip_serializing_if = "Option::is_none")]
20486    pub team_run_id: Option<String>,
20487    /// User-supplied metadata
20488    #[serde(default, skip_serializing_if = "Option::is_none")]
20489    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
20490    /// Current step sequence number
20491    #[serde(default, skip_serializing_if = "Option::is_none")]
20492    pub step_seq: Option<i64>,
20493    /// Run artifacts
20494    #[serde(default, skip_serializing_if = "Option::is_none")]
20495    pub artifacts: Option<Vec<Artifact>>,
20496    /// Resource limits for the run
20497    #[serde(default, skip_serializing_if = "Option::is_none")]
20498    pub resource_limits: Option<RunResourceLimits>,
20499}
20500
20501/// `RunApproval` model.
20502#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20503pub struct RunApproval {
20504    pub decision: RunApprovalDecision,
20505    /// Tools the run was waiting on when the decision was made.
20506    pub tools: Vec<String>,
20507    pub decided_at: String,
20508    /// User id of the person who decided; the credential id when no person stands behind it.
20509    #[serde(default, skip_serializing_if = "Option::is_none")]
20510    pub decided_by: Option<String>,
20511    /// The reviewer's reason, on a rejection.
20512    #[serde(default, skip_serializing_if = "Option::is_none")]
20513    pub reason: Option<String>,
20514}
20515
20516/// `RunApprovalDecision` enumeration.
20517#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20518pub enum RunApprovalDecision {
20519    #[default]
20520    #[serde(rename = "approved")]
20521    Approved,
20522    #[serde(rename = "rejected")]
20523    Rejected,
20524    /// A value the API introduced after this SDK was generated.
20525    #[serde(untagged)]
20526    Other(String),
20527}
20528
20529impl RunApprovalDecision {
20530    /// The value as it appears on the wire.
20531    pub fn as_str(&self) -> &str {
20532        match self {
20533            Self::Approved => "approved",
20534            Self::Rejected => "rejected",
20535            Self::Other(value) => value.as_str(),
20536        }
20537    }
20538}
20539
20540impl std::fmt::Display for RunApprovalDecision {
20541    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20542        f.write_str(self.as_str())
20543    }
20544}
20545
20546impl From<&str> for RunApprovalDecision {
20547    fn from(value: &str) -> Self {
20548        match value {
20549            "approved" => Self::Approved,
20550            "rejected" => Self::Rejected,
20551            other => Self::Other(other.to_string()),
20552        }
20553    }
20554}
20555
20556/// The body is optional and carries at most a `response` for the agent. An unknown field is
20557/// REFUSED, not ignored: `{"approved": false}` sent here used to be stripped in silence while
20558/// the endpoint approved anyway and answered `{"approved": true}`. To refuse a tool call, POST
20559/// /runs/{runId}/reject.
20560#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20561pub struct RunApproveRequest {
20562    /// Optional message passed back to the agent alongside the approval.
20563    #[serde(default, skip_serializing_if = "Option::is_none")]
20564    pub response: Option<String>,
20565}
20566
20567/// `RunCanvasLoopRequest` model.
20568#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20569pub struct RunCanvasLoopRequest {
20570    pub supervisor_agent_id: String,
20571    /// The agents drawn inside the loop. An empty array is 400 ("this loop has no worker agents
20572    /// inside it"), so it is required in practice and declared so here.
20573    pub worker_ids: Vec<String>,
20574    /// Which drawn loop to run. Required — the handler 400s without it, and it is the key the
20575    /// persisted layout is looked up by.
20576    pub loop_id: String,
20577    /// Overrides the exit condition stored on the drawn loop for this run only. Read at
20578    /// canvas.ts:234; was undocumented, so a client generated from this document could not send it.
20579    #[serde(default, skip_serializing_if = "Option::is_none")]
20580    pub condition: Option<String>,
20581    /// Overrides the loop's stored instruction for this run only. Read at canvas.ts:238.
20582    #[serde(default, skip_serializing_if = "Option::is_none")]
20583    pub prompt: Option<String>,
20584}
20585
20586/// `RunCanvasLoopResponse` model.
20587#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20588pub struct RunCanvasLoopResponse {
20589    pub mission_id: String,
20590    pub team_id: String,
20591    pub worker_count: i64,
20592    pub max_passes: i64,
20593    pub budget_usd: f64,
20594    pub time_minutes: f64,
20595}
20596
20597/// `RunCanvasWorkflowRequest` model.
20598#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20599pub struct RunCanvasWorkflowRequest {
20600    /// The agent steps, in graph order. Fewer than two is 400 — a canvas of unconnected agents has
20601    /// no order to execute in. This was the whole body and the document did not carry it:
20602    /// `entry_agent_id` and `max_passes_per_step` were declared instead, and neither is read by any
20603    /// handler in the platform.
20604    pub steps: Vec<CanvasWorkflowStep>,
20605    /// Mission goal. Defaults to the literal "Workflow" when omitted (canvas.ts:313).
20606    #[serde(default, skip_serializing_if = "Option::is_none")]
20607    pub goal: Option<String>,
20608    #[serde(default, skip_serializing_if = "Option::is_none")]
20609    pub budget_usd_per_step: Option<f64>,
20610    #[serde(default, skip_serializing_if = "Option::is_none")]
20611    pub time_minutes: Option<f64>,
20612    /// Free text passed into the run.
20613    #[serde(default, skip_serializing_if = "Option::is_none")]
20614    pub feedback: Option<String>,
20615}
20616
20617/// `RunCanvasWorkflowResponse` model.
20618#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20619pub struct RunCanvasWorkflowResponse {
20620    pub mission_id: String,
20621    /// Objectives created — one per agent step.
20622    pub step_count: i64,
20623    /// Workflow edges the plan was built from.
20624    pub edge_count: i64,
20625}
20626
20627/// `RunCheckpoint` model.
20628#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20629pub struct RunCheckpoint {
20630    #[serde(default, skip_serializing_if = "Option::is_none")]
20631    pub step: Option<i64>,
20632    /// The conversation as it stood at this checkpoint — the model-facing ChatMessage list the
20633    /// runtime stores (checkpoint-manager.ts CheckpointData / continuation.ts); a manual checkpoint
20634    /// row carries none.
20635    #[serde(default, skip_serializing_if = "Option::is_none")]
20636    pub messages: Option<Vec<ChatMessage>>,
20637    /// Accumulated run metrics — `RunMetricsAccumulator` (`runtime/core/step-executor.ts:156`):
20638    /// step and token counters, optionally provider cache hits.
20639    #[serde(default, skip_serializing_if = "Option::is_none")]
20640    pub metrics: Option<serde_json::Map<String, serde_json::Value>>,
20641}
20642
20643/// What a run is likely to cost before it is started. Nothing is dispatched and nothing is
20644/// stored — this is a read.
20645///
20646/// The numbers are an estimate built from the agent's own recent runs, and the `basis` block
20647/// says what they rest on so a client can present them honestly instead of showing every figure
20648/// with the same confidence.
20649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20650pub struct RunCostEstimate {
20651    /// The model the estimate was priced against, after any per-session override.
20652    pub model: String,
20653    pub estimate: RunCostEstimateEstimate,
20654    /// What the estimate was computed from. A zero sample is not an error — it means the agent has
20655    /// no history yet and the defaults were used.
20656    pub basis: RunCostEstimateBasis,
20657}
20658
20659/// What the estimate was computed from. A zero sample is not an error — it means the agent has
20660/// no history yet and the defaults were used.
20661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20662pub struct RunCostEstimateBasis {
20663    /// Every cost in this response is at this rate. `user` — what the run will be billed (provider
20664    /// × markup); never the provider's own rate.
20665    pub rate: RunCostEstimateBasisRate,
20666    pub runs_sampled: i64,
20667    #[serde(default)]
20668    pub avg_steps: Option<i64>,
20669    #[serde(default)]
20670    pub avg_output_tokens_per_step: Option<i64>,
20671    /// Median of the sampled runs' actual cost.
20672    #[serde(default)]
20673    pub median_cost_usd: Option<f64>,
20674    /// What a bad run looked like — the number worth showing next to the estimate.
20675    #[serde(default)]
20676    pub p90_cost_usd: Option<f64>,
20677    /// `model` — a real per-model rate; `fallback` — the configured tier rate, i.e. a number with a
20678    /// shrug behind it; `unknown` — no rate at all, and the estimate is zero.
20679    pub pricing: RunCostEstimateBasisPricing,
20680}
20681
20682/// `model` — a real per-model rate; `fallback` — the configured tier rate, i.e. a number with a
20683/// shrug behind it; `unknown` — no rate at all, and the estimate is zero.
20684#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20685pub enum RunCostEstimateBasisPricing {
20686    #[default]
20687    #[serde(rename = "model")]
20688    Model,
20689    #[serde(rename = "fallback")]
20690    Fallback,
20691    #[serde(rename = "unknown")]
20692    Unknown,
20693    /// A value the API introduced after this SDK was generated.
20694    #[serde(untagged)]
20695    Other(String),
20696}
20697
20698impl RunCostEstimateBasisPricing {
20699    /// The value as it appears on the wire.
20700    pub fn as_str(&self) -> &str {
20701        match self {
20702            Self::Model => "model",
20703            Self::Fallback => "fallback",
20704            Self::Unknown => "unknown",
20705            Self::Other(value) => value.as_str(),
20706        }
20707    }
20708}
20709
20710impl std::fmt::Display for RunCostEstimateBasisPricing {
20711    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20712        f.write_str(self.as_str())
20713    }
20714}
20715
20716impl From<&str> for RunCostEstimateBasisPricing {
20717    fn from(value: &str) -> Self {
20718        match value {
20719            "model" => Self::Model,
20720            "fallback" => Self::Fallback,
20721            "unknown" => Self::Unknown,
20722            other => Self::Other(other.to_string()),
20723        }
20724    }
20725}
20726
20727/// Every cost in this response is at this rate. `user` — what the run will be billed (provider
20728/// × markup); never the provider's own rate.
20729#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20730pub enum RunCostEstimateBasisRate {
20731    #[default]
20732    #[serde(rename = "user")]
20733    User,
20734    /// A value the API introduced after this SDK was generated.
20735    #[serde(untagged)]
20736    Other(String),
20737}
20738
20739impl RunCostEstimateBasisRate {
20740    /// The value as it appears on the wire.
20741    pub fn as_str(&self) -> &str {
20742        match self {
20743            Self::User => "user",
20744            Self::Other(value) => value.as_str(),
20745        }
20746    }
20747}
20748
20749impl std::fmt::Display for RunCostEstimateBasisRate {
20750    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20751        f.write_str(self.as_str())
20752    }
20753}
20754
20755impl From<&str> for RunCostEstimateBasisRate {
20756    fn from(value: &str) -> Self {
20757        match value {
20758            "user" => Self::User,
20759            other => Self::Other(other.to_string()),
20760        }
20761    }
20762}
20763
20764/// `RunCostEstimateEstimate` model.
20765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20766pub struct RunCostEstimateEstimate {
20767    /// At the user rate — the provider rate times the platform markup, the same rate
20768    /// `metrics.total_cost_usd` is written at — so it is comparable with `basis.median_cost_usd`
20769    /// and `basis.p90_cost_usd`.
20770    pub estimated_cost_usd: f64,
20771    /// `medium` only when past runs supplied a step count; `low` otherwise, including when no rate
20772    /// is known at all.
20773    pub confidence: RunCostEstimateEstimateConfidence,
20774    pub breakdown: RunCostEstimateEstimateBreakdown,
20775}
20776
20777/// `RunCostEstimateEstimateBreakdown` model.
20778#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20779pub struct RunCostEstimateEstimateBreakdown {
20780    pub input_tokens_est: i64,
20781    pub output_tokens_est: i64,
20782    pub input_cost_est: f64,
20783    pub output_cost_est: f64,
20784}
20785
20786/// `medium` only when past runs supplied a step count; `low` otherwise, including when no rate
20787/// is known at all.
20788#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20789pub enum RunCostEstimateEstimateConfidence {
20790    #[default]
20791    #[serde(rename = "low")]
20792    Low,
20793    #[serde(rename = "medium")]
20794    Medium,
20795    #[serde(rename = "high")]
20796    High,
20797    /// A value the API introduced after this SDK was generated.
20798    #[serde(untagged)]
20799    Other(String),
20800}
20801
20802impl RunCostEstimateEstimateConfidence {
20803    /// The value as it appears on the wire.
20804    pub fn as_str(&self) -> &str {
20805        match self {
20806            Self::Low => "low",
20807            Self::Medium => "medium",
20808            Self::High => "high",
20809            Self::Other(value) => value.as_str(),
20810        }
20811    }
20812}
20813
20814impl std::fmt::Display for RunCostEstimateEstimateConfidence {
20815    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20816        f.write_str(self.as_str())
20817    }
20818}
20819
20820impl From<&str> for RunCostEstimateEstimateConfidence {
20821    fn from(value: &str) -> Self {
20822        match value {
20823            "low" => Self::Low,
20824            "medium" => Self::Medium,
20825            "high" => Self::High,
20826            other => Self::Other(other.to_string()),
20827        }
20828    }
20829}
20830
20831/// `RunEvaluationRequest` model.
20832#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20833pub struct RunEvaluationRequest {
20834    pub dataset_id: String,
20835    #[serde(default, skip_serializing_if = "Option::is_none")]
20836    pub agent_version: Option<String>,
20837}
20838
20839/// Absent for platform-dispatched cloud runs. `bridge` is written by the platform when a local
20840/// agent takes the run (run-dispatch.ts, bridge.ts); `async` is only ever an echo of a
20841/// client-supplied value and has never been stored on production (measured 2026-09-10 over 8605
20842/// run records: absent 7738, bridge 867, async 0).
20843#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20844pub enum RunExecutionMode {
20845    #[default]
20846    #[serde(rename = "async")]
20847    Async,
20848    #[serde(rename = "bridge")]
20849    Bridge,
20850    /// A value the API introduced after this SDK was generated.
20851    #[serde(untagged)]
20852    Other(String),
20853}
20854
20855impl RunExecutionMode {
20856    /// The value as it appears on the wire.
20857    pub fn as_str(&self) -> &str {
20858        match self {
20859            Self::Async => "async",
20860            Self::Bridge => "bridge",
20861            Self::Other(value) => value.as_str(),
20862        }
20863    }
20864}
20865
20866impl std::fmt::Display for RunExecutionMode {
20867    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20868        f.write_str(self.as_str())
20869    }
20870}
20871
20872impl From<&str> for RunExecutionMode {
20873    fn from(value: &str) -> Self {
20874        match value {
20875            "async" => Self::Async,
20876            "bridge" => Self::Bridge,
20877            other => Self::Other(other.to_string()),
20878        }
20879    }
20880}
20881
20882/// GET …/feedback without `message_id`: every reaction the caller stored on the run (measured
20883/// 2026-09-10: `{"feedbacks":\[\]}` on a run with none).
20884#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20885pub struct RunFeedbackList {
20886    pub feedbacks: Vec<RunFeedbackListFeedback>,
20887}
20888
20889/// `RunFeedbackListFeedback` model.
20890#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20891pub struct RunFeedbackListFeedback {
20892    /// The entry's `message_id` from GET /sessions/{sessionId}/messages
20893    /// (ConversationEntry.message_id) — the canonical key; any string is stored as sent.
20894    pub message_id: String,
20895    pub reaction: RunFeedbackListFeedbackReaction,
20896    /// Present only when the reader gave one with the reaction.
20897    #[serde(default, skip_serializing_if = "Option::is_none")]
20898    pub reason: Option<String>,
20899}
20900
20901/// `RunFeedbackListFeedbackReaction` enumeration.
20902#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
20903pub enum RunFeedbackListFeedbackReaction {
20904    #[default]
20905    #[serde(rename = "up")]
20906    Up,
20907    #[serde(rename = "down")]
20908    Down,
20909    /// A value the API introduced after this SDK was generated.
20910    #[serde(untagged)]
20911    Other(String),
20912}
20913
20914impl RunFeedbackListFeedbackReaction {
20915    /// The value as it appears on the wire.
20916    pub fn as_str(&self) -> &str {
20917        match self {
20918            Self::Up => "up",
20919            Self::Down => "down",
20920            Self::Other(value) => value.as_str(),
20921        }
20922    }
20923}
20924
20925impl std::fmt::Display for RunFeedbackListFeedbackReaction {
20926    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20927        f.write_str(self.as_str())
20928    }
20929}
20930
20931impl From<&str> for RunFeedbackListFeedbackReaction {
20932    fn from(value: &str) -> Self {
20933        match value {
20934            "up" => Self::Up,
20935            "down" => Self::Down,
20936            other => Self::Other(other.to_string()),
20937        }
20938    }
20939}
20940
20941/// GET …/feedback with `message_id`: that one reaction, `null` when the caller has not reacted.
20942#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20943pub struct RunFeedbackOne {
20944    #[serde(default)]
20945    pub reaction: Option<String>,
20946    /// Present only when the reader gave one with the reaction.
20947    #[serde(default, skip_serializing_if = "Option::is_none")]
20948    pub reason: Option<String>,
20949}
20950
20951/// PUT …/feedback: the stored reaction, echoed (runs.ts putRunFeedback, sessions.ts
20952/// putSessionFeedback — the same literal).
20953#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20954pub struct RunFeedbackSet {
20955    pub reaction: RunFeedbackListFeedbackReaction,
20956    pub message_id: String,
20957    /// Echoed only when the caller sent one.
20958    #[serde(default, skip_serializing_if = "Option::is_none")]
20959    pub reason: Option<String>,
20960}
20961
20962/// `RunMetrics` model.
20963#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20964pub struct RunMetrics {
20965    /// How the cost was priced (measured 2026-09-10 on e2e-canon; billing/cost-estimator.ts).
20966    #[serde(default, skip_serializing_if = "Option::is_none")]
20967    pub pricing_confidence: Option<String>,
20968    #[serde(default, skip_serializing_if = "Option::is_none")]
20969    pub duration_ms: Option<f64>,
20970    #[serde(default, skip_serializing_if = "Option::is_none")]
20971    pub steps_count: Option<i64>,
20972    #[serde(default, skip_serializing_if = "Option::is_none")]
20973    pub input_tokens: Option<i64>,
20974    #[serde(default, skip_serializing_if = "Option::is_none")]
20975    pub output_tokens: Option<i64>,
20976    #[serde(default, skip_serializing_if = "Option::is_none")]
20977    pub thinking_tokens: Option<i64>,
20978    #[serde(default, skip_serializing_if = "Option::is_none")]
20979    pub tool_calls_count: Option<i64>,
20980    #[serde(default, skip_serializing_if = "Option::is_none")]
20981    pub llm_calls_count: Option<i64>,
20982    #[serde(default, skip_serializing_if = "Option::is_none")]
20983    pub guardrail_checks: Option<i64>,
20984    #[serde(default, skip_serializing_if = "Option::is_none")]
20985    pub guardrail_violations: Option<i64>,
20986    #[serde(default, skip_serializing_if = "Option::is_none")]
20987    pub memory_retrievals: Option<i64>,
20988    #[serde(default, skip_serializing_if = "Option::is_none")]
20989    pub memory_extractions: Option<i64>,
20990    /// Estimated total cost in USD
20991    #[serde(default, skip_serializing_if = "Option::is_none")]
20992    pub total_cost_usd: Option<f64>,
20993}
20994
20995/// `RunMissionResponse` model.
20996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20997pub struct RunMissionResponse {
20998    pub accepted: bool,
20999    pub already_running: bool,
21000    pub mission: Mission,
21001}
21002
21003/// What the runtime writes as a run's `output` (agent-runtime.ts, the normal completion and the
21004/// max-steps cutoff). Measured 2026-09-10 on production, 8 640 stored runs: `{ response }` 6
21005/// 722; `{ response, search_sources }` 334; `{ response, output_truncated }` 23; `{ response,
21006/// search_sources, output_truncated }` 3; `{ response, truncated, continuation_token }` 3; `{
21007/// response, truncated }` 2; `{}` 3. A bridge agent (execution_mode bridge) reports its own
21008/// output — `{ response: "" }` is what it has been sending. Additional keys are possible from
21009/// that path; the five below are the platform's own.
21010#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21011pub struct RunOutput {
21012    /// The final assistant text.
21013    #[serde(default, skip_serializing_if = "Option::is_none")]
21014    pub response: Option<String>,
21015    /// URLs a real `web_search` tool call returned during this run — read back out of the tool
21016    /// results (`URL:` lines, response-postprocessing.ts extractSearchSources, deduplicated, at
21017    /// most 8), NOT out of the model's text. Present only when non-empty. Provenance is the point:
21018    /// a chat surface unfurls only these into preview cards, so a URL the model wrote from memory
21019    /// is never dressed up as a verified source. Witness: run 019faf2c… on tenant 019d9364…
21020    /// (2026-07-29) carries 8, the first on en.wikipedia.org.
21021    #[serde(default, skip_serializing_if = "Option::is_none")]
21022    pub search_sources: Option<Vec<String>>,
21023    /// The model stopped because it ran out of OUTPUT tokens (`finish_reason: length`), not because
21024    /// it was finished — the answer ends mid-sentence. Present only when true; the chat offers
21025    /// "Continue generating" on this flag alone. Distinct from `truncated` (step budget). 26 stored
21026    /// runs carry it.
21027    #[serde(default, skip_serializing_if = "Option::is_none")]
21028    pub output_truncated: Option<bool>,
21029    /// The run hit its step budget (max_steps) before finishing. Present only when true.
21030    #[serde(default, skip_serializing_if = "Option::is_none")]
21031    pub truncated: Option<bool>,
21032    /// Opaque HMAC-signed token minted with `truncated` when UARP_CONTINUATION_TOKEN_KEY is
21033    /// configured; resumes the run via POST /runs/{id}/continue.
21034    #[serde(default, skip_serializing_if = "Option::is_none")]
21035    pub continuation_token: Option<String>,
21036    /// Any additional properties the server returned.
21037    #[serde(flatten)]
21038    pub extra: HashMap<String, serde_json::Value>,
21039}
21040
21041/// `RunReconciliationResponse` model.
21042#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21043pub struct RunReconciliationResponse {
21044    pub reconciliation: CostReconciliationResult,
21045}
21046
21047/// Resource limits for the run
21048#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21049pub struct RunResourceLimits {
21050    #[serde(default, skip_serializing_if = "Option::is_none")]
21051    pub max_duration_ms: Option<i64>,
21052    #[serde(default, skip_serializing_if = "Option::is_none")]
21053    pub max_steps: Option<i64>,
21054    #[serde(default, skip_serializing_if = "Option::is_none")]
21055    pub max_tool_calls: Option<i64>,
21056    #[serde(default, skip_serializing_if = "Option::is_none")]
21057    pub max_tokens_per_run: Option<i64>,
21058}
21059
21060/// `RunStatus` enumeration.
21061#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21062pub enum RunStatus {
21063    #[default]
21064    #[serde(rename = "queued")]
21065    Queued,
21066    #[serde(rename = "running")]
21067    Running,
21068    #[serde(rename = "completed")]
21069    Completed,
21070    #[serde(rename = "failed")]
21071    Failed,
21072    #[serde(rename = "cancelled")]
21073    Cancelled,
21074    #[serde(rename = "timeout")]
21075    Timeout,
21076    #[serde(rename = "guardrail_blocked")]
21077    GuardrailBlocked,
21078    #[serde(rename = "paused")]
21079    Paused,
21080    #[serde(rename = "awaiting_approval")]
21081    AwaitingApproval,
21082    #[serde(rename = "awaiting_input")]
21083    AwaitingInput,
21084    #[serde(rename = "auth_required")]
21085    AuthRequired,
21086    #[serde(rename = "rejected")]
21087    Rejected,
21088    /// A value the API introduced after this SDK was generated.
21089    #[serde(untagged)]
21090    Other(String),
21091}
21092
21093impl RunStatus {
21094    /// The value as it appears on the wire.
21095    pub fn as_str(&self) -> &str {
21096        match self {
21097            Self::Queued => "queued",
21098            Self::Running => "running",
21099            Self::Completed => "completed",
21100            Self::Failed => "failed",
21101            Self::Cancelled => "cancelled",
21102            Self::Timeout => "timeout",
21103            Self::GuardrailBlocked => "guardrail_blocked",
21104            Self::Paused => "paused",
21105            Self::AwaitingApproval => "awaiting_approval",
21106            Self::AwaitingInput => "awaiting_input",
21107            Self::AuthRequired => "auth_required",
21108            Self::Rejected => "rejected",
21109            Self::Other(value) => value.as_str(),
21110        }
21111    }
21112}
21113
21114impl std::fmt::Display for RunStatus {
21115    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21116        f.write_str(self.as_str())
21117    }
21118}
21119
21120impl From<&str> for RunStatus {
21121    fn from(value: &str) -> Self {
21122        match value {
21123            "queued" => Self::Queued,
21124            "running" => Self::Running,
21125            "completed" => Self::Completed,
21126            "failed" => Self::Failed,
21127            "cancelled" => Self::Cancelled,
21128            "timeout" => Self::Timeout,
21129            "guardrail_blocked" => Self::GuardrailBlocked,
21130            "paused" => Self::Paused,
21131            "awaiting_approval" => Self::AwaitingApproval,
21132            "awaiting_input" => Self::AwaitingInput,
21133            "auth_required" => Self::AuthRequired,
21134            "rejected" => Self::Rejected,
21135            other => Self::Other(other.to_string()),
21136        }
21137    }
21138}
21139
21140/// `RunStep` model.
21141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21142pub struct RunStep {
21143    #[serde(default, skip_serializing_if = "Option::is_none")]
21144    pub step_id: Option<String>,
21145    #[serde(default, skip_serializing_if = "Option::is_none")]
21146    pub run_id: Option<String>,
21147    #[serde(default, skip_serializing_if = "Option::is_none")]
21148    pub tenant_id: Option<String>,
21149    #[serde(default, skip_serializing_if = "Option::is_none")]
21150    pub step_index: Option<i64>,
21151    #[serde(default, skip_serializing_if = "Option::is_none")]
21152    pub status: Option<RunStepStatus>,
21153    #[serde(default, skip_serializing_if = "Option::is_none")]
21154    pub metrics: Option<RunStepMetrics>,
21155    #[serde(default, skip_serializing_if = "Option::is_none")]
21156    pub tool_calls: Option<Vec<String>>,
21157    #[serde(default, skip_serializing_if = "Option::is_none")]
21158    pub error: Option<String>,
21159    #[serde(default, skip_serializing_if = "Option::is_none")]
21160    pub started_at: Option<String>,
21161    #[serde(default, skip_serializing_if = "Option::is_none")]
21162    pub completed_at: Option<String>,
21163}
21164
21165/// `RunStepMetrics` model.
21166#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21167pub struct RunStepMetrics {
21168    #[serde(default, skip_serializing_if = "Option::is_none")]
21169    pub duration_ms: Option<f64>,
21170    #[serde(default, skip_serializing_if = "Option::is_none")]
21171    pub input_tokens: Option<i64>,
21172    #[serde(default, skip_serializing_if = "Option::is_none")]
21173    pub output_tokens: Option<i64>,
21174    #[serde(default, skip_serializing_if = "Option::is_none")]
21175    pub thinking_tokens: Option<i64>,
21176    #[serde(default, skip_serializing_if = "Option::is_none")]
21177    pub llm_calls: Option<i64>,
21178    #[serde(default, skip_serializing_if = "Option::is_none")]
21179    pub tool_calls_count: Option<i64>,
21180    #[serde(default, skip_serializing_if = "Option::is_none")]
21181    pub cost_usd: Option<f64>,
21182}
21183
21184/// `RunStepStatus` enumeration.
21185#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21186pub enum RunStepStatus {
21187    #[default]
21188    #[serde(rename = "running")]
21189    Running,
21190    #[serde(rename = "completed")]
21191    Completed,
21192    #[serde(rename = "failed")]
21193    Failed,
21194    /// A value the API introduced after this SDK was generated.
21195    #[serde(untagged)]
21196    Other(String),
21197}
21198
21199impl RunStepStatus {
21200    /// The value as it appears on the wire.
21201    pub fn as_str(&self) -> &str {
21202        match self {
21203            Self::Running => "running",
21204            Self::Completed => "completed",
21205            Self::Failed => "failed",
21206            Self::Other(value) => value.as_str(),
21207        }
21208    }
21209}
21210
21211impl std::fmt::Display for RunStepStatus {
21212    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21213        f.write_str(self.as_str())
21214    }
21215}
21216
21217impl From<&str> for RunStepStatus {
21218    fn from(value: &str) -> Self {
21219        match value {
21220            "running" => Self::Running,
21221            "completed" => Self::Completed,
21222            "failed" => Self::Failed,
21223            other => Self::Other(other.to_string()),
21224        }
21225    }
21226}
21227
21228/// `RunWorkspaceCommandRequest` model.
21229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21230pub struct RunWorkspaceCommandRequest {
21231    pub command: String,
21232    #[serde(default, skip_serializing_if = "Option::is_none")]
21233    pub workdir: Option<String>,
21234    #[serde(default, skip_serializing_if = "Option::is_none")]
21235    pub timeout_sec: Option<i64>,
21236}
21237
21238/// `RunWorkspaceCommandResponse` model.
21239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21240pub struct RunWorkspaceCommandResponse {
21241    #[serde(default, skip_serializing_if = "Option::is_none")]
21242    pub output: Option<String>,
21243}
21244
21245/// What `GET /agents/{agentId}/schedule` returns: `agent_id`, the config fields flattened, and
21246/// the runtime state. Keys as served 2026-09-10; `last_fired_at`, `autonomous_mode` and
21247/// `reflection_prompt` appear only when set.
21248#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21249pub struct Schedule {
21250    pub agent_id: String,
21251    pub cron: String,
21252    pub enabled: bool,
21253    pub timezone: String,
21254    pub input: serde_json::Map<String, serde_json::Value>,
21255    pub max_concurrent_scheduled: i64,
21256    pub on_failure: AgentScheduleConfigOnFailure,
21257    #[serde(default, skip_serializing_if = "Option::is_none")]
21258    pub autonomous_mode: Option<bool>,
21259    #[serde(default, skip_serializing_if = "Option::is_none")]
21260    pub reflection_prompt: Option<String>,
21261    /// State of the scheduler ENTRY (ScheduleEntry.status in @uarp/scheduler), not whether the
21262    /// schedule is switched on: measured 2026-09-10, `active` on every live entry, including two
21263    /// with `enabled: false`. The human-facing on/off is `enabled`.
21264    pub status: ScheduleEntryStatus,
21265    /// The next fire when `enabled` is true. On a disabled schedule the server keeps the last
21266    /// computed instant, so it can lie in the past (measured 2026-09-10 on two disabled entries).
21267    #[serde(default, skip_serializing_if = "Option::is_none")]
21268    pub next_fire_at: Option<String>,
21269    #[serde(default, skip_serializing_if = "Option::is_none")]
21270    pub last_fired_at: Option<String>,
21271    pub consecutive_failures: i64,
21272}
21273
21274/// `ScheduleCanvasWorkflowRequest` model.
21275#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21276pub struct ScheduleCanvasWorkflowRequest {
21277    /// The trigger node's id on the canvas.
21278    pub trigger_id: String,
21279    pub cron: String,
21280    /// The agent steps the schedule fires, in graph order. Fewer than two is 400. Undeclared until
21281    /// now, alongside `goal` — while `entry_agent_id`, which WAS declared, is read by nothing: a
21282    /// client built from this document sent the one field the handler ignores and omitted the two
21283    /// it requires.
21284    pub steps: Vec<CanvasWorkflowStep>,
21285    /// Goal recorded on the schedule. Defaults to the literal "Workflow" (canvas.ts:415).
21286    #[serde(default, skip_serializing_if = "Option::is_none")]
21287    pub goal: Option<String>,
21288    /// Persisted on the schedule. Omitted, every scheduled fire silently reverts to the default
21289    /// per-step budget rather than the one the operator set for the run.
21290    #[serde(default, skip_serializing_if = "Option::is_none")]
21291    pub budget_usd_per_step: Option<f64>,
21292    #[serde(default, skip_serializing_if = "Option::is_none")]
21293    pub time_minutes: Option<f64>,
21294}
21295
21296/// `ScheduleCanvasWorkflowResponse` model.
21297#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21298pub struct ScheduleCanvasWorkflowResponse {
21299    pub trigger_id: String,
21300    pub cron: String,
21301    pub next_fire_at: String,
21302    pub status: ScheduleCanvasWorkflowResponseStatus,
21303}
21304
21305/// `ScheduleCanvasWorkflowResponseStatus` enumeration.
21306#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21307pub enum ScheduleCanvasWorkflowResponseStatus {
21308    #[default]
21309    #[serde(rename = "active")]
21310    Active,
21311    /// A value the API introduced after this SDK was generated.
21312    #[serde(untagged)]
21313    Other(String),
21314}
21315
21316impl ScheduleCanvasWorkflowResponseStatus {
21317    /// The value as it appears on the wire.
21318    pub fn as_str(&self) -> &str {
21319        match self {
21320            Self::Active => "active",
21321            Self::Other(value) => value.as_str(),
21322        }
21323    }
21324}
21325
21326impl std::fmt::Display for ScheduleCanvasWorkflowResponseStatus {
21327    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21328        f.write_str(self.as_str())
21329    }
21330}
21331
21332impl From<&str> for ScheduleCanvasWorkflowResponseStatus {
21333    fn from(value: &str) -> Self {
21334        match value {
21335            "active" => Self::Active,
21336            other => Self::Other(other.to_string()),
21337        }
21338    }
21339}
21340
21341/// What `PUT /agents/{agentId}/schedule` returns: the stored entry with its `config` nested
21342/// (ScheduleEntry in @uarp/scheduler). `GET` returns the flattened `Schedule` instead.
21343#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21344pub struct ScheduleEntry {
21345    pub tenant_id: String,
21346    pub agent_id: String,
21347    pub config: AgentScheduleConfig,
21348    #[serde(default, skip_serializing_if = "Option::is_none")]
21349    pub last_fired_at: Option<String>,
21350    /// The next fire when `enabled` is true. On a disabled schedule the server keeps the last
21351    /// computed instant, so it can lie in the past (measured 2026-09-10 on two disabled entries).
21352    #[serde(default, skip_serializing_if = "Option::is_none")]
21353    pub next_fire_at: Option<String>,
21354    pub consecutive_failures: i64,
21355    /// State of the scheduler ENTRY (ScheduleEntry.status in @uarp/scheduler), not whether the
21356    /// schedule is switched on: measured 2026-09-10, `active` on every live entry, including two
21357    /// with `enabled: false`. The human-facing on/off is `enabled`.
21358    pub status: ScheduleEntryStatus,
21359}
21360
21361/// State of the scheduler ENTRY (ScheduleEntry.status in @uarp/scheduler), not whether the
21362/// schedule is switched on: measured 2026-09-10, `active` on every live entry, including two
21363/// with `enabled: false`. The human-facing on/off is `enabled`.
21364#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21365pub enum ScheduleEntryStatus {
21366    #[default]
21367    #[serde(rename = "active")]
21368    Active,
21369    #[serde(rename = "paused")]
21370    Paused,
21371    #[serde(rename = "error")]
21372    Error,
21373    /// A value the API introduced after this SDK was generated.
21374    #[serde(untagged)]
21375    Other(String),
21376}
21377
21378impl ScheduleEntryStatus {
21379    /// The value as it appears on the wire.
21380    pub fn as_str(&self) -> &str {
21381        match self {
21382            Self::Active => "active",
21383            Self::Paused => "paused",
21384            Self::Error => "error",
21385            Self::Other(value) => value.as_str(),
21386        }
21387    }
21388}
21389
21390impl std::fmt::Display for ScheduleEntryStatus {
21391    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21392        f.write_str(self.as_str())
21393    }
21394}
21395
21396impl From<&str> for ScheduleEntryStatus {
21397    fn from(value: &str) -> Self {
21398        match value {
21399            "active" => Self::Active,
21400            "paused" => Self::Paused,
21401            "error" => Self::Error,
21402            other => Self::Other(other.to_string()),
21403        }
21404    }
21405}
21406
21407/// `ScheduleSummary` model.
21408#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21409pub struct ScheduleSummary {
21410    pub agent_id: String,
21411    /// Resolved for display; absent if the agent record is gone.
21412    #[serde(default, skip_serializing_if = "Option::is_none")]
21413    pub agent_name: Option<String>,
21414    pub cron: String,
21415    pub enabled: bool,
21416    /// `paused` or `error`, or accumulated failures, is what a “silently dead cron” looks like.
21417    pub status: String,
21418    #[serde(default, skip_serializing_if = "Option::is_none")]
21419    pub next_fire_at: Option<String>,
21420}
21421
21422/// `SearchKnowledgeBaseRequest` model.
21423#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21424pub struct SearchKnowledgeBaseRequest {
21425    pub query: String,
21426    /// Maximum chunks to return.
21427    #[serde(default, skip_serializing_if = "Option::is_none")]
21428    pub limit: Option<i64>,
21429}
21430
21431/// `SearchMarketplaceResponse` model.
21432#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21433pub struct SearchMarketplaceResponse {
21434    pub items: Vec<MarketplaceListing>,
21435    /// Legacy alias for `items`. Will be removed in API v1.x.
21436    #[serde(default, skip_serializing_if = "Option::is_none")]
21437    pub listings: Option<Vec<MarketplaceListing>>,
21438    #[serde(default, skip_serializing_if = "Option::is_none")]
21439    pub total: Option<i64>,
21440}
21441
21442/// `SearchMarketplaceSort` enumeration.
21443#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21444pub enum SearchMarketplaceSort {
21445    #[default]
21446    #[serde(rename = "rating")]
21447    Rating,
21448    #[serde(rename = "popularity")]
21449    Popularity,
21450    #[serde(rename = "recency")]
21451    Recency,
21452    /// A value the API introduced after this SDK was generated.
21453    #[serde(untagged)]
21454    Other(String),
21455}
21456
21457impl SearchMarketplaceSort {
21458    /// The value as it appears on the wire.
21459    pub fn as_str(&self) -> &str {
21460        match self {
21461            Self::Rating => "rating",
21462            Self::Popularity => "popularity",
21463            Self::Recency => "recency",
21464            Self::Other(value) => value.as_str(),
21465        }
21466    }
21467}
21468
21469impl std::fmt::Display for SearchMarketplaceSort {
21470    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21471        f.write_str(self.as_str())
21472    }
21473}
21474
21475impl From<&str> for SearchMarketplaceSort {
21476    fn from(value: &str) -> Self {
21477        match value {
21478            "rating" => Self::Rating,
21479            "popularity" => Self::Popularity,
21480            "recency" => Self::Recency,
21481            other => Self::Other(other.to_string()),
21482        }
21483    }
21484}
21485
21486/// `SearchMemoryResponse` model.
21487#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21488pub struct SearchMemoryResponse {
21489    pub memories: Vec<MemoryEntry>,
21490    pub total: i64,
21491}
21492
21493/// `SearchResponse` model.
21494#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21495pub struct SearchResponse {
21496    pub results: Vec<SearchResult>,
21497}
21498
21499/// search.ts SearchResult — `subtitle` is omitted for some result kinds.
21500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21501pub struct SearchResult {
21502    pub r#type: SearchResultType,
21503    pub id: String,
21504    pub title: String,
21505    #[serde(default, skip_serializing_if = "Option::is_none")]
21506    pub subtitle: Option<String>,
21507    pub href: String,
21508    pub icon: String,
21509}
21510
21511/// `SearchResultType` enumeration.
21512#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21513pub enum SearchResultType {
21514    #[default]
21515    #[serde(rename = "agent")]
21516    Agent,
21517    #[serde(rename = "run")]
21518    Run,
21519    #[serde(rename = "session")]
21520    Session,
21521    #[serde(rename = "file")]
21522    File,
21523    #[serde(rename = "image")]
21524    Image,
21525    #[serde(rename = "project")]
21526    Project,
21527    #[serde(rename = "memory")]
21528    Memory,
21529    /// A value the API introduced after this SDK was generated.
21530    #[serde(untagged)]
21531    Other(String),
21532}
21533
21534impl SearchResultType {
21535    /// The value as it appears on the wire.
21536    pub fn as_str(&self) -> &str {
21537        match self {
21538            Self::Agent => "agent",
21539            Self::Run => "run",
21540            Self::Session => "session",
21541            Self::File => "file",
21542            Self::Image => "image",
21543            Self::Project => "project",
21544            Self::Memory => "memory",
21545            Self::Other(value) => value.as_str(),
21546        }
21547    }
21548}
21549
21550impl std::fmt::Display for SearchResultType {
21551    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21552        f.write_str(self.as_str())
21553    }
21554}
21555
21556impl From<&str> for SearchResultType {
21557    fn from(value: &str) -> Self {
21558        match value {
21559            "agent" => Self::Agent,
21560            "run" => Self::Run,
21561            "session" => Self::Session,
21562            "file" => Self::File,
21563            "image" => Self::Image,
21564            "project" => Self::Project,
21565            "memory" => Self::Memory,
21566            other => Self::Other(other.to_string()),
21567        }
21568    }
21569}
21570
21571/// `SearchType` enumeration.
21572#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21573pub enum SearchType {
21574    #[default]
21575    #[serde(rename = "agent")]
21576    Agent,
21577    #[serde(rename = "session")]
21578    Session,
21579    #[serde(rename = "run")]
21580    Run,
21581    /// A value the API introduced after this SDK was generated.
21582    #[serde(untagged)]
21583    Other(String),
21584}
21585
21586impl SearchType {
21587    /// The value as it appears on the wire.
21588    pub fn as_str(&self) -> &str {
21589        match self {
21590            Self::Agent => "agent",
21591            Self::Session => "session",
21592            Self::Run => "run",
21593            Self::Other(value) => value.as_str(),
21594        }
21595    }
21596}
21597
21598impl std::fmt::Display for SearchType {
21599    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21600        f.write_str(self.as_str())
21601    }
21602}
21603
21604impl From<&str> for SearchType {
21605    fn from(value: &str) -> Self {
21606        match value {
21607            "agent" => Self::Agent,
21608            "session" => Self::Session,
21609            "run" => Self::Run,
21610            other => Self::Other(other.to_string()),
21611        }
21612    }
21613}
21614
21615/// `SearchWorkspaceFilesRegex` enumeration.
21616#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21617pub enum SearchWorkspaceFilesRegex {
21618    #[default]
21619    #[serde(rename = "true")]
21620    True,
21621    #[serde(rename = "1")]
21622    V1,
21623    /// A value the API introduced after this SDK was generated.
21624    #[serde(untagged)]
21625    Other(String),
21626}
21627
21628impl SearchWorkspaceFilesRegex {
21629    /// The value as it appears on the wire.
21630    pub fn as_str(&self) -> &str {
21631        match self {
21632            Self::True => "true",
21633            Self::V1 => "1",
21634            Self::Other(value) => value.as_str(),
21635        }
21636    }
21637}
21638
21639impl std::fmt::Display for SearchWorkspaceFilesRegex {
21640    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21641        f.write_str(self.as_str())
21642    }
21643}
21644
21645impl From<&str> for SearchWorkspaceFilesRegex {
21646    fn from(value: &str) -> Self {
21647        match value {
21648            "true" => Self::True,
21649            "1" => Self::V1,
21650            other => Self::Other(other.to_string()),
21651        }
21652    }
21653}
21654
21655/// `SearchWorkspaceFilesResponse` model.
21656#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21657pub struct SearchWorkspaceFilesResponse {
21658    #[serde(default, skip_serializing_if = "Option::is_none")]
21659    pub results: Option<Vec<SearchWorkspaceFilesResponseResult>>,
21660    #[serde(default, skip_serializing_if = "Option::is_none")]
21661    pub total: Option<i64>,
21662}
21663
21664/// `SearchWorkspaceFilesResponseResult` model.
21665#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21666pub struct SearchWorkspaceFilesResponseResult {
21667    #[serde(default, skip_serializing_if = "Option::is_none")]
21668    pub path: Option<String>,
21669    /// Deprecated spelling of `line_number` — the same value, kept for the compatibility window and
21670    /// removed in the next breaking release (the one that moves `X-API-Version`). Read
21671    /// `line_number`.
21672    #[serde(rename = "lineNumber", default, skip_serializing_if = "Option::is_none")]
21673    pub line_number: Option<i64>,
21674    #[serde(default, skip_serializing_if = "Option::is_none")]
21675    pub line: Option<String>,
21676    #[serde(default, skip_serializing_if = "Option::is_none")]
21677    pub r#match: Option<String>,
21678    #[serde(rename = "line_number", default, skip_serializing_if = "Option::is_none")]
21679    pub line_number_: Option<i64>,
21680}
21681
21682/// `SeedStarterSpecsResponse` model.
21683#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21684pub struct SeedStarterSpecsResponse {
21685    /// Newly published.
21686    pub added: i64,
21687    /// Already present at the bundled version.
21688    pub skipped: i64,
21689    /// How many starter SPECs the build ships. `added + skipped` reaching this is the completion
21690    /// signal.
21691    pub total_starter: i64,
21692    /// Absent when nothing failed.
21693    #[serde(default, skip_serializing_if = "Option::is_none")]
21694    pub errors: Option<Vec<SeedStarterSpecsResponseError>>,
21695}
21696
21697/// `SeedStarterSpecsResponseError` model.
21698#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21699pub struct SeedStarterSpecsResponseError {
21700    pub name: String,
21701    pub error: String,
21702}
21703
21704/// `SendPublicMessageRequest` model.
21705#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21706pub struct SendPublicMessageRequest {
21707    pub content: String,
21708}
21709
21710/// `SendPublicMessageResponse` model.
21711#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21712pub struct SendPublicMessageResponse {
21713    #[serde(default, skip_serializing_if = "Option::is_none")]
21714    pub run_id: Option<String>,
21715    #[serde(default, skip_serializing_if = "Option::is_none")]
21716    pub messages_remaining: Option<i64>,
21717}
21718
21719/// `content` is always present in the body; it may be the empty string when `file_ids` carries
21720/// at least one id.
21721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21722pub struct SendSessionMessageRequest {
21723    /// Message body. May be empty when `file_ids` is non-empty — a photo with no caption is an
21724    /// ordinary message. A message with neither text nor files is refused.
21725    pub content: String,
21726    /// Optional slash-command string when the message is a builtin command.
21727    #[serde(default, skip_serializing_if = "Option::is_none")]
21728    pub command: Option<String>,
21729    /// Optional attached file ids previously uploaded via /api/v1/files.
21730    #[serde(default, skip_serializing_if = "Option::is_none")]
21731    pub file_ids: Option<Vec<String>>,
21732    /// Workspace override for this message; defaults to the agent's workspace.
21733    #[serde(default, skip_serializing_if = "Option::is_none")]
21734    pub workspace_id: Option<String>,
21735}
21736
21737/// `SendSessionMessageResponse` model.
21738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21739pub struct SendSessionMessageResponse {
21740    pub run_id: String,
21741}
21742
21743/// `SensorWebhookResponse` model.
21744#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21745pub struct SensorWebhookResponse {
21746    #[serde(default, skip_serializing_if = "Option::is_none")]
21747    pub accepted: Option<bool>,
21748}
21749
21750/// `Session` model.
21751#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21752pub struct Session {
21753    #[serde(default, skip_serializing_if = "Option::is_none")]
21754    pub created_by: Option<String>,
21755    pub session_id: String,
21756    pub tenant_id: String,
21757    pub agent_id: String,
21758    pub status: PublicSessionViewStatus,
21759    #[serde(default, skip_serializing_if = "Option::is_none")]
21760    pub conversation_history: Option<Vec<ConversationEntry>>,
21761    #[serde(default, skip_serializing_if = "Option::is_none")]
21762    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
21763    #[serde(default, skip_serializing_if = "Option::is_none")]
21764    pub runs: Option<Vec<String>>,
21765    #[serde(default, skip_serializing_if = "Option::is_none")]
21766    pub created_at: Option<String>,
21767    #[serde(default, skip_serializing_if = "Option::is_none")]
21768    pub updated_at: Option<String>,
21769    #[serde(default, skip_serializing_if = "Option::is_none")]
21770    pub expires_at: Option<String>,
21771    /// Team ID if session belongs to a team
21772    #[serde(default, skip_serializing_if = "Option::is_none")]
21773    pub team_id: Option<String>,
21774    /// Session branches for conversation forking
21775    #[serde(default, skip_serializing_if = "Option::is_none")]
21776    pub branches: Option<Vec<SessionBranch>>,
21777    /// Currently active branch ID
21778    #[serde(default, skip_serializing_if = "Option::is_none")]
21779    pub active_branch: Option<String>,
21780    /// How to handle concurrent runs in this session
21781    #[serde(default, skip_serializing_if = "Option::is_none")]
21782    pub queue_mode: Option<SessionQueueMode>,
21783    /// Per-conversation model override (in-chat model switcher). When set, runs in this session
21784    /// resolve their LLM from this config instead of the agent's default. Absent → agent default.
21785    #[serde(default, skip_serializing_if = "Option::is_none")]
21786    pub model_override: Option<SessionModelOverride>,
21787}
21788
21789/// sessions.ts AnnotationRecord — the six-field projection create, list and PATCH all answer
21790/// with.
21791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21792pub struct SessionAnnotation {
21793    pub id: String,
21794    pub message_id: String,
21795    pub content: String,
21796    pub author: String,
21797    pub created_at: String,
21798    pub resolved: bool,
21799}
21800
21801/// `SessionBranch` model.
21802#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21803pub struct SessionBranch {
21804    pub branch_id: String,
21805    /// Absent on the main branch.
21806    #[serde(default, skip_serializing_if = "Option::is_none")]
21807    pub parent_branch_id: Option<String>,
21808    pub name: String,
21809    /// The run this branch forked after. Empty when the session had no runs yet.
21810    pub fork_point_run_id: String,
21811    pub fork_point_step_seq: i64,
21812    pub runs: Vec<String>,
21813    pub status: SessionBranchStatus,
21814    pub created_at: String,
21815}
21816
21817/// `SessionBranchStatus` enumeration.
21818#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21819pub enum SessionBranchStatus {
21820    #[default]
21821    #[serde(rename = "active")]
21822    Active,
21823    #[serde(rename = "abandoned")]
21824    Abandoned,
21825    #[serde(rename = "merged")]
21826    Merged,
21827    /// A value the API introduced after this SDK was generated.
21828    #[serde(untagged)]
21829    Other(String),
21830}
21831
21832impl SessionBranchStatus {
21833    /// The value as it appears on the wire.
21834    pub fn as_str(&self) -> &str {
21835        match self {
21836            Self::Active => "active",
21837            Self::Abandoned => "abandoned",
21838            Self::Merged => "merged",
21839            Self::Other(value) => value.as_str(),
21840        }
21841    }
21842}
21843
21844impl std::fmt::Display for SessionBranchStatus {
21845    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21846        f.write_str(self.as_str())
21847    }
21848}
21849
21850impl From<&str> for SessionBranchStatus {
21851    fn from(value: &str) -> Self {
21852        match value {
21853            "active" => Self::Active,
21854            "abandoned" => Self::Abandoned,
21855            "merged" => Self::Merged,
21856            other => Self::Other(other.to_string()),
21857        }
21858    }
21859}
21860
21861/// `SessionExport` model.
21862#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21863pub struct SessionExport {
21864    pub exported_at: String,
21865    /// Always `snaga.chat.v1`.
21866    pub format: String,
21867    pub session_id: String,
21868    pub agent_id: String,
21869    #[serde(default, skip_serializing_if = "Option::is_none")]
21870    pub agent_name: Option<String>,
21871    pub title: String,
21872    #[serde(default, skip_serializing_if = "Option::is_none")]
21873    pub created_at: Option<String>,
21874    #[serde(default, skip_serializing_if = "Option::is_none")]
21875    pub updated_at: Option<String>,
21876    pub messages: Vec<SessionExportMessage>,
21877}
21878
21879/// `SessionExportMessage` model.
21880#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21881pub struct SessionExportMessage {
21882    pub role: String,
21883    pub content: String,
21884    #[serde(default, skip_serializing_if = "Option::is_none")]
21885    pub timestamp: Option<String>,
21886    #[serde(default, skip_serializing_if = "Option::is_none")]
21887    pub run_id: Option<String>,
21888    #[serde(default, skip_serializing_if = "Option::is_none")]
21889    pub tool_calls: Option<Vec<SessionExportMessageToolCall>>,
21890}
21891
21892/// `SessionExportMessageToolCall` model.
21893#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21894pub struct SessionExportMessageToolCall {
21895    #[serde(default, skip_serializing_if = "Option::is_none")]
21896    pub name: Option<String>,
21897    #[serde(default, skip_serializing_if = "Option::is_none")]
21898    pub status: Option<String>,
21899    #[serde(default, skip_serializing_if = "Option::is_none")]
21900    pub input: Option<serde_json::Map<String, serde_json::Value>>,
21901}
21902
21903/// Per-conversation model override (in-chat model switcher). When set, runs in this session
21904/// resolve their LLM from this config instead of the agent's default. Absent → agent default.
21905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21906pub struct SessionModelOverride {
21907    pub provider: String,
21908    pub model_ref: String,
21909    #[serde(default, skip_serializing_if = "Option::is_none")]
21910    pub endpoint_url: Option<String>,
21911    #[serde(default, skip_serializing_if = "Option::is_none")]
21912    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
21913}
21914
21915/// How to handle concurrent runs in this session
21916#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
21917pub enum SessionQueueMode {
21918    #[default]
21919    #[serde(rename = "allow")]
21920    Allow,
21921    #[serde(rename = "reject")]
21922    Reject,
21923    /// A value the API introduced after this SDK was generated.
21924    #[serde(untagged)]
21925    Other(String),
21926}
21927
21928impl SessionQueueMode {
21929    /// The value as it appears on the wire.
21930    pub fn as_str(&self) -> &str {
21931        match self {
21932            Self::Allow => "allow",
21933            Self::Reject => "reject",
21934            Self::Other(value) => value.as_str(),
21935        }
21936    }
21937}
21938
21939impl std::fmt::Display for SessionQueueMode {
21940    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21941        f.write_str(self.as_str())
21942    }
21943}
21944
21945impl From<&str> for SessionQueueMode {
21946    fn from(value: &str) -> Self {
21947        match value {
21948            "allow" => Self::Allow,
21949            "reject" => Self::Reject,
21950            other => Self::Other(other.to_string()),
21951        }
21952    }
21953}
21954
21955/// `SetAdminIntegrationOAuthProviderRequest` model.
21956#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21957pub struct SetAdminIntegrationOAuthProviderRequest {
21958    #[serde(default, skip_serializing_if = "Option::is_none")]
21959    pub enabled: Option<bool>,
21960    #[serde(default, skip_serializing_if = "Option::is_none")]
21961    pub client_id: Option<String>,
21962    /// Never returned by any read. Omit to keep the stored one.
21963    #[serde(default, skip_serializing_if = "Option::is_none")]
21964    pub client_secret: Option<String>,
21965    #[serde(default, skip_serializing_if = "Option::is_none")]
21966    pub scopes: Option<Vec<String>>,
21967}
21968
21969/// `SetAdminIntegrationOAuthProviderResponse` model.
21970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21971pub struct SetAdminIntegrationOAuthProviderResponse {
21972    pub provider: String,
21973    pub enabled: bool,
21974    pub configured: bool,
21975}
21976
21977/// `SetAdminLLMDefaultRequest` model.
21978#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21979pub struct SetAdminLLMDefaultRequest {
21980    pub api_key: String,
21981}
21982
21983/// `SetAdminLLMDefaultResponse` model.
21984#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21985pub struct SetAdminLLMDefaultResponse {
21986    #[serde(default, skip_serializing_if = "Option::is_none")]
21987    pub updated: Option<bool>,
21988}
21989
21990/// `SetAdminModelConfigResponse` model.
21991#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21992pub struct SetAdminModelConfigResponse {
21993    #[serde(default)]
21994    pub default_provider: Option<String>,
21995    #[serde(default)]
21996    pub default_model: Option<String>,
21997    #[serde(default)]
21998    pub default_endpoint: Option<String>,
21999    #[serde(default)]
22000    pub fallback_provider: Option<String>,
22001    #[serde(default)]
22002    pub fallback_model: Option<String>,
22003    #[serde(default)]
22004    pub fallback_endpoint: Option<String>,
22005}
22006
22007/// `SetAgentCapabilitiesResponse` model.
22008#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22009pub struct SetAgentCapabilitiesResponse {
22010    #[serde(default, skip_serializing_if = "Option::is_none")]
22011    pub status: Option<String>,
22012    #[serde(default, skip_serializing_if = "Option::is_none")]
22013    pub agent_id: Option<String>,
22014}
22015
22016/// `SetAgentIntegrationsRequest` model.
22017#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22018pub struct SetAgentIntegrationsRequest {
22019    /// The COMPLETE set after the call. Non-string members are ignored; ids the tenant does not own
22020    /// come back under `diff.unknown` rather than failing the call.
22021    pub integration_ids: Vec<String>,
22022}
22023
22024/// `SetAgentIntegrationsResponse` model.
22025#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22026pub struct SetAgentIntegrationsResponse {
22027    pub integrations: Vec<AgentIntegration>,
22028    pub total: i64,
22029    pub diff: SetAgentIntegrationsResponseDiff,
22030}
22031
22032/// `SetAgentIntegrationsResponseDiff` model.
22033#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22034pub struct SetAgentIntegrationsResponseDiff {
22035    pub assigned: Vec<String>,
22036    pub unassigned: Vec<String>,
22037    pub unknown: Vec<String>,
22038}
22039
22040/// `SetAgentMCPServersRequest` model.
22041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22042pub struct SetAgentMCPServersRequest {
22043    /// The complete set after the call. An empty array disconnects every server from this agent.
22044    pub server_ids: Vec<String>,
22045}
22046
22047/// `SetAgentMCPServersResponse` model.
22048#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22049pub struct SetAgentMCPServersResponse {
22050    #[serde(default, skip_serializing_if = "Option::is_none")]
22051    pub agent_id: Option<String>,
22052    /// Server ids that gained this agent.
22053    #[serde(default, skip_serializing_if = "Option::is_none")]
22054    pub connected: Option<Vec<String>>,
22055    /// Server ids that lost it.
22056    #[serde(default, skip_serializing_if = "Option::is_none")]
22057    pub disconnected: Option<Vec<String>>,
22058}
22059
22060/// `SetAgentPermissionsResponse` model.
22061#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22062pub struct SetAgentPermissionsResponse {
22063    #[serde(default, skip_serializing_if = "Option::is_none")]
22064    pub ok: Option<bool>,
22065}
22066
22067/// `SetAgentTrafficRequest` model.
22068#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22069pub struct SetAgentTrafficRequest {
22070    pub entries: Vec<SetAgentTrafficRequestEntry>,
22071}
22072
22073/// `SetAgentTrafficRequestEntry` model.
22074#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22075pub struct SetAgentTrafficRequestEntry {
22076    pub version: i64,
22077    pub weight: f64,
22078}
22079
22080/// `SetAgentTrafficResponse` model.
22081#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22082pub struct SetAgentTrafficResponse {
22083    pub agent_id: String,
22084    pub entries: Vec<TrafficSplitEntry>,
22085    #[serde(default)]
22086    pub updated_at: Option<String>,
22087}
22088
22089/// `SetArbiterRegistryResponse` model.
22090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22091pub struct SetArbiterRegistryResponse {
22092    #[serde(default, skip_serializing_if = "Option::is_none")]
22093    pub ok: Option<bool>,
22094}
22095
22096/// `SetBillingBudgetRequest` model.
22097#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22098pub struct SetBillingBudgetRequest {
22099    pub limit_usd: f64,
22100    /// Server default: `0.8`.
22101    #[serde(default, skip_serializing_if = "Option::is_none")]
22102    pub soft_threshold: Option<f64>,
22103    /// Server default: `1`.
22104    #[serde(default, skip_serializing_if = "Option::is_none")]
22105    pub hard_threshold: Option<f64>,
22106    /// Server default: `"monthly"`.
22107    #[serde(default, skip_serializing_if = "Option::is_none")]
22108    pub period: Option<GetBillingBudgetResponseBudgetPeriod>,
22109}
22110
22111/// `SetBillingBudgetResponse` model.
22112#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22113pub struct SetBillingBudgetResponse {
22114    #[serde(default, skip_serializing_if = "Option::is_none")]
22115    pub configured: Option<bool>,
22116    #[serde(default, skip_serializing_if = "Option::is_none")]
22117    pub budget: Option<serde_json::Map<String, serde_json::Value>>,
22118}
22119
22120/// `SetBillingOverageRequest` model.
22121#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22122pub struct SetBillingOverageRequest {
22123    pub enabled: bool,
22124}
22125
22126/// `SetBillingOverageResponse` model.
22127#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22128pub struct SetBillingOverageResponse {
22129    #[serde(default, skip_serializing_if = "Option::is_none")]
22130    pub enabled: Option<bool>,
22131    #[serde(default, skip_serializing_if = "Option::is_none")]
22132    pub requires_cap: Option<bool>,
22133}
22134
22135/// `SetDataExplorerValueRequest` model.
22136#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22137pub struct SetDataExplorerValueRequest {
22138    pub namespace: String,
22139    pub key: Vec<serde_json::Value>,
22140    pub value: serde_json::Value,
22141}
22142
22143/// `SetDataExplorerValueResponse` model.
22144#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22145pub struct SetDataExplorerValueResponse {
22146    pub success: bool,
22147    pub size_bytes: i64,
22148}
22149
22150/// `SetFeatureFlagsResponse` model.
22151#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22152pub struct SetFeatureFlagsResponse {
22153    #[serde(default, skip_serializing_if = "Option::is_none")]
22154    pub flags: Option<Vec<FeatureFlag>>,
22155    pub updated: bool,
22156}
22157
22158/// `SetLLMProviderKeyProvider` enumeration.
22159#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
22160pub enum SetLLMProviderKeyProvider {
22161    #[default]
22162    #[serde(rename = "openai_compat")]
22163    OpenaiCompat,
22164    #[serde(rename = "custom")]
22165    Custom,
22166    /// A value the API introduced after this SDK was generated.
22167    #[serde(untagged)]
22168    Other(String),
22169}
22170
22171impl SetLLMProviderKeyProvider {
22172    /// The value as it appears on the wire.
22173    pub fn as_str(&self) -> &str {
22174        match self {
22175            Self::OpenaiCompat => "openai_compat",
22176            Self::Custom => "custom",
22177            Self::Other(value) => value.as_str(),
22178        }
22179    }
22180}
22181
22182impl std::fmt::Display for SetLLMProviderKeyProvider {
22183    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22184        f.write_str(self.as_str())
22185    }
22186}
22187
22188impl From<&str> for SetLLMProviderKeyProvider {
22189    fn from(value: &str) -> Self {
22190        match value {
22191            "openai_compat" => Self::OpenaiCompat,
22192            "custom" => Self::Custom,
22193            other => Self::Other(other.to_string()),
22194        }
22195    }
22196}
22197
22198/// WRITE SEMANTICS: mixed. `api_key` REPLACES on every call. `shared` MERGES — omit it and the
22199/// stored consent flag is kept. Verified against the handler and the store (ITG-05): omission
22200/// used to drop the flag, and since absent means shareable, a rotation silently returned an
22201/// opted-out personal key to the tenant-wide pool. Sending `shared: true` is the only way to
22202/// clear an opt-out.
22203#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22204pub struct SetLLMProviderKeyRequest {
22205    /// Provider API key (stored encrypted)
22206    pub api_key: String,
22207    /// Consent for the tenant-wide fallback tier. `false` keeps this personal key out of other
22208    /// users' runs. Absent on a first write means shareable; absent on a later write means
22209    /// unchanged.
22210    #[serde(default, skip_serializing_if = "Option::is_none")]
22211    pub shared: Option<bool>,
22212}
22213
22214/// `SetLLMProviderKeyResponse` model.
22215#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22216pub struct SetLLMProviderKeyResponse {
22217    #[serde(default, skip_serializing_if = "Option::is_none")]
22218    pub provider_id: Option<String>,
22219    #[serde(default, skip_serializing_if = "Option::is_none")]
22220    pub configured: Option<bool>,
22221    /// Effective consent flag after the write. Absent when never set. Returned so a client can send
22222    /// back what it read — before ITG-05 no read path exposed it, which is why every rotation
22223    /// cleared it.
22224    #[serde(default, skip_serializing_if = "Option::is_none")]
22225    pub shared: Option<bool>,
22226    #[serde(default, skip_serializing_if = "Option::is_none")]
22227    pub updated_at: Option<String>,
22228}
22229
22230/// `SetMaintenanceStateRequest` model.
22231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22232pub struct SetMaintenanceStateRequest {
22233    /// Strictly a boolean — the string "true" is 400, not coerced.
22234    pub enabled: bool,
22235    /// Plain text shown on the blocked page; the API does not render HTML. Trimmed, and one that
22236    /// trims to empty is stored as no message at all. Over 500 characters is 400 — the cap exists
22237    /// so a misconfigured value cannot become an unbounded payload served at the edge.
22238    #[serde(default, skip_serializing_if = "Option::is_none")]
22239    pub message: Option<String>,
22240}
22241
22242/// `SetModelPricingOverrideRequest` model.
22243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22244pub struct SetModelPricingOverrideRequest {
22245    pub input_per_million: f64,
22246    pub output_per_million: f64,
22247    /// Discounted rate for provider prefix-cache hits. Absent means cached tokens bill at the full
22248    /// input rate.
22249    #[serde(default, skip_serializing_if = "Option::is_none")]
22250    pub cached_input_per_million: Option<f64>,
22251}
22252
22253/// `SetModelPricingOverrideResponse` model.
22254#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22255pub struct SetModelPricingOverrideResponse {
22256    /// Deprecated spelling of `model_ref` — the same value, kept for the compatibility window and
22257    /// removed in the next breaking release (the one that moves `X-API-Version`). Read `model_ref`.
22258    #[serde(rename = "modelRef")]
22259    pub model_ref: String,
22260    pub input_per_million: f64,
22261    pub output_per_million: f64,
22262    /// Absent when not set.
22263    #[serde(default, skip_serializing_if = "Option::is_none")]
22264    pub cached_input_per_million: Option<f64>,
22265    #[serde(rename = "model_ref")]
22266    pub model_ref_: String,
22267}
22268
22269/// `SetRateLimitsResponse` model.
22270#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22271pub struct SetRateLimitsResponse {
22272    #[serde(default, skip_serializing_if = "Option::is_none")]
22273    pub endpoints: Option<Vec<EndpointRateLimit>>,
22274    pub updated: bool,
22275}
22276
22277/// `SetRegistrySpecVisibilityRequest` model.
22278#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22279pub struct SetRegistrySpecVisibilityRequest {
22280    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
22281}
22282
22283/// `SetRegistrySpecVisibilityRequestVisibility` enumeration.
22284#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
22285pub enum SetRegistrySpecVisibilityRequestVisibility {
22286    #[default]
22287    #[serde(rename = "public")]
22288    Public,
22289    #[serde(rename = "private")]
22290    Private,
22291    /// A value the API introduced after this SDK was generated.
22292    #[serde(untagged)]
22293    Other(String),
22294}
22295
22296impl SetRegistrySpecVisibilityRequestVisibility {
22297    /// The value as it appears on the wire.
22298    pub fn as_str(&self) -> &str {
22299        match self {
22300            Self::Public => "public",
22301            Self::Private => "private",
22302            Self::Other(value) => value.as_str(),
22303        }
22304    }
22305}
22306
22307impl std::fmt::Display for SetRegistrySpecVisibilityRequestVisibility {
22308    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22309        f.write_str(self.as_str())
22310    }
22311}
22312
22313impl From<&str> for SetRegistrySpecVisibilityRequestVisibility {
22314    fn from(value: &str) -> Self {
22315        match value {
22316            "public" => Self::Public,
22317            "private" => Self::Private,
22318            other => Self::Other(other.to_string()),
22319        }
22320    }
22321}
22322
22323/// `SetRegistrySpecVisibilityResponse` model.
22324#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22325pub struct SetRegistrySpecVisibilityResponse {
22326    pub scope: String,
22327    pub name: String,
22328    pub visibility: SetRegistrySpecVisibilityRequestVisibility,
22329}
22330
22331/// `SetRootAgentRequest` model.
22332#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22333pub struct SetRootAgentRequest {
22334    pub agent_id: String,
22335}
22336
22337/// `SetRootAgentResponse` model.
22338#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22339pub struct SetRootAgentResponse {
22340    #[serde(default, skip_serializing_if = "Option::is_none")]
22341    pub ok: Option<bool>,
22342    #[serde(default, skip_serializing_if = "Option::is_none")]
22343    pub root_agent_id: Option<String>,
22344}
22345
22346/// `SetRootAttestationResponse` model.
22347#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22348pub struct SetRootAttestationResponse {
22349    #[serde(default, skip_serializing_if = "Option::is_none")]
22350    pub ok: Option<bool>,
22351}
22352
22353/// `SetRunFeedbackRequest` model.
22354#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22355pub struct SetRunFeedbackRequest {
22356    pub message_id: String,
22357    pub reaction: RunFeedbackListFeedbackReaction,
22358    /// Why the answer was bad, in the reader's own words or one of the chat's chips. Optional and
22359    /// only meaningful with `reaction: "down"`. Sent by the web chat since the chips shipped and
22360    /// dropped by the server until 2026-09-13; it is stored and echoed now.
22361    #[serde(default, skip_serializing_if = "Option::is_none")]
22362    pub reason: Option<String>,
22363}
22364
22365/// `SetScheduleRequest` model.
22366#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22367pub struct SetScheduleRequest {
22368    pub cron: String,
22369    /// Server default: `true`.
22370    #[serde(default, skip_serializing_if = "Option::is_none")]
22371    pub enabled: Option<bool>,
22372    /// Server default: `{}`.
22373    #[serde(default, skip_serializing_if = "Option::is_none")]
22374    pub input: Option<serde_json::Map<String, serde_json::Value>>,
22375    /// Server default: `"UTC"`.
22376    #[serde(default, skip_serializing_if = "Option::is_none")]
22377    pub timezone: Option<String>,
22378    /// Server default: `"retry_next"`.
22379    #[serde(default, skip_serializing_if = "Option::is_none")]
22380    pub on_failure: Option<AgentScheduleConfigOnFailure>,
22381    /// Server default: `1`.
22382    #[serde(default, skip_serializing_if = "Option::is_none")]
22383    pub max_concurrent_scheduled: Option<f64>,
22384    /// When true, schedule is fired by autonomous tick with reflection prompt instead of cron run
22385    /// with input.
22386    #[serde(default, skip_serializing_if = "Option::is_none")]
22387    pub autonomous_mode: Option<bool>,
22388    /// Prompt injected into run input when autonomous_mode is true (e.g. review pending work, plan
22389    /// next steps).
22390    #[serde(default, skip_serializing_if = "Option::is_none")]
22391    pub reflection_prompt: Option<String>,
22392}
22393
22394/// `SetSessionRunFeedbackRequest` model.
22395#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22396pub struct SetSessionRunFeedbackRequest {
22397    pub message_id: String,
22398    pub reaction: RunFeedbackListFeedbackReaction,
22399    /// Why the answer was bad, in the reader's own words or one of the chat's chips. Optional and
22400    /// only meaningful with `reaction: "down"`. Sent by the web chat since the chips shipped and
22401    /// dropped by the server until 2026-09-13; it is stored and echoed now.
22402    #[serde(default, skip_serializing_if = "Option::is_none")]
22403    pub reason: Option<String>,
22404}
22405
22406/// `SetSpawnPolicyResponse` model.
22407#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22408pub struct SetSpawnPolicyResponse {
22409    #[serde(default, skip_serializing_if = "Option::is_none")]
22410    pub ok: Option<bool>,
22411}
22412
22413/// `SetupStateResponse` model.
22414#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22415pub struct SetupStateResponse {
22416    pub state: SetupStateResponseState,
22417    /// The subset that gates going live. Read it rather than hard-coding it.
22418    pub required_steps: Vec<String>,
22419    /// Every known step id, required and optional.
22420    pub all_steps: Vec<String>,
22421    /// Required steps still outstanding. Non-empty means an attempt to open registration is refused
22422    /// and will name this list.
22423    pub missing_required: Vec<String>,
22424}
22425
22426/// `SetupStateResponseState` model.
22427#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22428pub struct SetupStateResponseState {
22429    /// `live` is a one-way latch; closing registration afterwards does not undo it.
22430    pub status: AdminRegistrationConfigSetupStatus,
22431    pub completed_steps: Vec<String>,
22432    pub registration_open: bool,
22433    pub started_at: String,
22434    /// Set once setup first completed. Its presence is what makes the latch one-way.
22435    #[serde(default, skip_serializing_if = "Option::is_none")]
22436    pub completed_at: Option<String>,
22437    pub version: i64,
22438}
22439
22440/// `SetUserRoleRequest` model.
22441#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22442pub struct SetUserRoleRequest {
22443    pub role: String,
22444}
22445
22446/// `SetUserRoleResponse` model.
22447#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22448pub struct SetUserRoleResponse {
22449    pub updated: bool,
22450    pub user_id: String,
22451    pub role: String,
22452}
22453
22454/// `SharePublicSessionResponse` model.
22455#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22456pub struct SharePublicSessionResponse {
22457    pub token: String,
22458}
22459
22460/// `ShareWorkspaceRequest` model.
22461#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22462pub struct ShareWorkspaceRequest {
22463    pub agent_id: String,
22464}
22465
22466/// `SignUpForAndroidTestingRequest` model.
22467#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22468pub struct SignUpForAndroidTestingRequest {
22469    pub email: String,
22470    /// Where the sign-up came from, e.g. `landing`. Truncated to 40 chars.
22471    #[serde(default, skip_serializing_if = "Option::is_none")]
22472    pub source: Option<String>,
22473}
22474
22475/// `SpawnPolicy` model.
22476#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22477pub struct SpawnPolicy {
22478    pub tenant_id: String,
22479    /// Child agent gets at most this fraction of parent's budget.
22480    pub child_budget_ratio: f64,
22481    pub max_depth: i64,
22482    pub allowed_roles: Vec<String>,
22483    pub require_approval_above_depth: i64,
22484    pub max_children_per_agent: i64,
22485}
22486
22487/// Body of PUT /governance/permissions/spawn-policy. The handler requires the whole record
22488/// (requireWholeRecord): all five fields, every time; `tenant_id` is the caller's and is not
22489/// accepted in the body.
22490#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22491pub struct SpawnPolicyUpdate {
22492    /// Child agent gets at most this fraction of parent's budget.
22493    pub child_budget_ratio: f64,
22494    pub max_depth: i64,
22495    /// Whole-record write: the array is stored as sent, REPLACING the stored list.
22496    pub allowed_roles: Vec<String>,
22497    pub require_approval_above_depth: i64,
22498    pub max_children_per_agent: i64,
22499}
22500
22501/// Which SPEC output view renders each tool's result, for the builder UI. Keyed by tool name;
22502/// the first view claiming a tool wins, and a view whose JSON will not parse is skipped rather
22503/// than failing the call.
22504#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22505pub struct SpecToolCatalog {
22506    pub agent_id: String,
22507    /// Which of the agent's installed SPECs are waiting on a connection. `status` is
22508    /// `needs_connection` when the SPEC declares tools routed through a connector (manifest
22509    /// `delivered_by = { mode = "integration", connector = … }`) that this agent cannot currently
22510    /// see an ACTIVE connection of — visibility, not ownership: the assignment rule is
22511    /// `canAgentUseIntegration`. `action` is the runtime's own sentence, the same one a run injects
22512    /// when the SPEC's tools resolve to nothing, so a badge and a run cannot teach two vocabularies
22513    /// for one fact.
22514    ///
22515    /// `ready` means NO UNMET CONNECTOR REQUIREMENT — not that every tool dispatches. A full
22516    /// verdict needs the bundle's SDK export names, which only the runtime's loader has. A SPEC
22517    /// that cannot be resolved is reported `ready` rather than badged, because a badge is worse
22518    /// wrong than absent.
22519    #[serde(default, skip_serializing_if = "Option::is_none")]
22520    pub specs: Option<Vec<SpecToolCatalogSpec>>,
22521    /// The canvases this agent's SPECs put their output on (docs/DESIGNER-CANVAS.md §5.1) — today
22522    /// only `drawing`. Always present: empty means no drawing canvas, absence means an older
22523    /// server, and a client must not confuse the two.
22524    pub drawings: Vec<SpecToolCatalogDrawing>,
22525    /// Tool name → the SPEC that owns it and the view to render its output with. Integration
22526    /// aliases map onto their base tool's view.
22527    pub tools: HashMap<String, Value2>,
22528}
22529
22530/// `SpecToolCatalogDrawing` model.
22531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22532pub struct SpecToolCatalogDrawing {
22533    pub spec_id: String,
22534    pub canvas: SpecToolCatalogDrawingCanvas,
22535}
22536
22537/// `SpecToolCatalogDrawingCanvas` enumeration.
22538#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
22539pub enum SpecToolCatalogDrawingCanvas {
22540    #[default]
22541    #[serde(rename = "drawing")]
22542    Drawing,
22543    /// A value the API introduced after this SDK was generated.
22544    #[serde(untagged)]
22545    Other(String),
22546}
22547
22548impl SpecToolCatalogDrawingCanvas {
22549    /// The value as it appears on the wire.
22550    pub fn as_str(&self) -> &str {
22551        match self {
22552            Self::Drawing => "drawing",
22553            Self::Other(value) => value.as_str(),
22554        }
22555    }
22556}
22557
22558impl std::fmt::Display for SpecToolCatalogDrawingCanvas {
22559    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22560        f.write_str(self.as_str())
22561    }
22562}
22563
22564impl From<&str> for SpecToolCatalogDrawingCanvas {
22565    fn from(value: &str) -> Self {
22566        match value {
22567            "drawing" => Self::Drawing,
22568            other => Self::Other(other.to_string()),
22569        }
22570    }
22571}
22572
22573/// `SpecToolCatalogSpec` model.
22574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22575pub struct SpecToolCatalogSpec {
22576    pub spec_id: String,
22577    pub status: SpecToolCatalogSpecStatus,
22578    #[serde(default, skip_serializing_if = "Option::is_none")]
22579    pub requires: Option<SpecToolCatalogSpecRequires>,
22580    #[serde(default, skip_serializing_if = "Option::is_none")]
22581    pub action: Option<String>,
22582    pub tools_total: f64,
22583    pub tools_waiting: f64,
22584}
22585
22586/// `SpecToolCatalogSpecRequires` model.
22587#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22588pub struct SpecToolCatalogSpecRequires {
22589    #[serde(default, skip_serializing_if = "Option::is_none")]
22590    pub mode: Option<SpecToolCatalogSpecRequiresMode>,
22591    #[serde(default, skip_serializing_if = "Option::is_none")]
22592    pub connector: Option<String>,
22593}
22594
22595/// `SpecToolCatalogSpecRequiresMode` enumeration.
22596#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
22597pub enum SpecToolCatalogSpecRequiresMode {
22598    #[default]
22599    #[serde(rename = "integration")]
22600    Integration,
22601    /// A value the API introduced after this SDK was generated.
22602    #[serde(untagged)]
22603    Other(String),
22604}
22605
22606impl SpecToolCatalogSpecRequiresMode {
22607    /// The value as it appears on the wire.
22608    pub fn as_str(&self) -> &str {
22609        match self {
22610            Self::Integration => "integration",
22611            Self::Other(value) => value.as_str(),
22612        }
22613    }
22614}
22615
22616impl std::fmt::Display for SpecToolCatalogSpecRequiresMode {
22617    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22618        f.write_str(self.as_str())
22619    }
22620}
22621
22622impl From<&str> for SpecToolCatalogSpecRequiresMode {
22623    fn from(value: &str) -> Self {
22624        match value {
22625            "integration" => Self::Integration,
22626            other => Self::Other(other.to_string()),
22627        }
22628    }
22629}
22630
22631/// `SpecToolCatalogSpecStatus` enumeration.
22632#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
22633pub enum SpecToolCatalogSpecStatus {
22634    #[default]
22635    #[serde(rename = "ready")]
22636    Ready,
22637    #[serde(rename = "needs_connection")]
22638    NeedsConnection,
22639    /// A value the API introduced after this SDK was generated.
22640    #[serde(untagged)]
22641    Other(String),
22642}
22643
22644impl SpecToolCatalogSpecStatus {
22645    /// The value as it appears on the wire.
22646    pub fn as_str(&self) -> &str {
22647        match self {
22648            Self::Ready => "ready",
22649            Self::NeedsConnection => "needs_connection",
22650            Self::Other(value) => value.as_str(),
22651        }
22652    }
22653}
22654
22655impl std::fmt::Display for SpecToolCatalogSpecStatus {
22656    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22657        f.write_str(self.as_str())
22658    }
22659}
22660
22661impl From<&str> for SpecToolCatalogSpecStatus {
22662    fn from(value: &str) -> Self {
22663        match value {
22664            "ready" => Self::Ready,
22665            "needs_connection" => Self::NeedsConnection,
22666            other => Self::Other(other.to_string()),
22667        }
22668    }
22669}
22670
22671/// `StartMissionRequest` model.
22672#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22673pub struct StartMissionRequest {
22674    /// Chat session the mission belongs to.
22675    pub session_id: String,
22676    /// What the mission is for, in the requester's words.
22677    pub goal: String,
22678    #[serde(default, skip_serializing_if = "Option::is_none")]
22679    pub plan: Option<PlannedMission>,
22680    /// Required when `plan` is omitted: the agents the planner may assign objectives to.
22681    #[serde(default, skip_serializing_if = "Option::is_none")]
22682    pub available_agents: Option<Vec<StartMissionRequestAvailableAgent>>,
22683    /// Skip the intake classifier and treat the request as mission work.
22684    #[serde(default, skip_serializing_if = "Option::is_none")]
22685    pub skip_classification: Option<bool>,
22686    /// ISO 8601. Honoured on the goal-only path.
22687    #[serde(default, skip_serializing_if = "Option::is_none")]
22688    pub deadline: Option<String>,
22689}
22690
22691/// `StartMissionRequestAvailableAgent` model.
22692#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22693pub struct StartMissionRequestAvailableAgent {
22694    pub agent_id: String,
22695    pub name: String,
22696    #[serde(default, skip_serializing_if = "Option::is_none")]
22697    pub description: Option<String>,
22698}
22699
22700/// `StartOAuthProvider` enumeration.
22701#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
22702pub enum StartOAuthProvider {
22703    #[default]
22704    #[serde(rename = "github")]
22705    Github,
22706    #[serde(rename = "stripe")]
22707    Stripe,
22708    #[serde(rename = "notion")]
22709    Notion,
22710    #[serde(rename = "slack")]
22711    Slack,
22712    #[serde(rename = "x_twitter")]
22713    XTwitter,
22714    #[serde(rename = "linkedin")]
22715    Linkedin,
22716    #[serde(rename = "youtube")]
22717    Youtube,
22718    #[serde(rename = "instagram")]
22719    Instagram,
22720    /// A value the API introduced after this SDK was generated.
22721    #[serde(untagged)]
22722    Other(String),
22723}
22724
22725impl StartOAuthProvider {
22726    /// The value as it appears on the wire.
22727    pub fn as_str(&self) -> &str {
22728        match self {
22729            Self::Github => "github",
22730            Self::Stripe => "stripe",
22731            Self::Notion => "notion",
22732            Self::Slack => "slack",
22733            Self::XTwitter => "x_twitter",
22734            Self::Linkedin => "linkedin",
22735            Self::Youtube => "youtube",
22736            Self::Instagram => "instagram",
22737            Self::Other(value) => value.as_str(),
22738        }
22739    }
22740}
22741
22742impl std::fmt::Display for StartOAuthProvider {
22743    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22744        f.write_str(self.as_str())
22745    }
22746}
22747
22748impl From<&str> for StartOAuthProvider {
22749    fn from(value: &str) -> Self {
22750        match value {
22751            "github" => Self::Github,
22752            "stripe" => Self::Stripe,
22753            "notion" => Self::Notion,
22754            "slack" => Self::Slack,
22755            "x_twitter" => Self::XTwitter,
22756            "linkedin" => Self::Linkedin,
22757            "youtube" => Self::Youtube,
22758            "instagram" => Self::Instagram,
22759            other => Self::Other(other.to_string()),
22760        }
22761    }
22762}
22763
22764/// `StartOAuthRequest` model.
22765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22766pub struct StartOAuthRequest {
22767    /// Optional. Was declared REQUIRED here while the route has treated it as optional
22768    /// (`routes/integrations.ts`: "agent_id is now optional — if provided, validate it exists"), so
22769    /// a generated client had to invent one to connect an integration that belongs to no agent.
22770    #[serde(default, skip_serializing_if = "Option::is_none")]
22771    pub agent_id: Option<String>,
22772    #[serde(default, skip_serializing_if = "Option::is_none")]
22773    pub name: Option<String>,
22774    #[serde(default, skip_serializing_if = "Option::is_none")]
22775    pub scopes: Option<Vec<String>>,
22776    /// The destination connector when it differs from the OAuth provider in the path —
22777    /// `google_calendar` through `google`, for example. The route reads it and resolves scopes from
22778    /// it; the document did not declare it, so a client generated from this document could not send
22779    /// it and multi-connector OAuth silently asked for the provider's scopes instead of the
22780    /// connector's. Wrong scopes, no error.
22781    #[serde(default, skip_serializing_if = "Option::is_none")]
22782    pub connector_id: Option<String>,
22783    /// Provider-specific parameters the authorize URL needs, e.g. `{ "subdomain": "acme" }` for
22784    /// Zendesk. Read by the route, previously undeclared.
22785    #[serde(default, skip_serializing_if = "Option::is_none")]
22786    pub extra: Option<serde_json::Map<String, serde_json::Value>>,
22787}
22788
22789/// `StartSquadRunRequest` model.
22790#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22791pub struct StartSquadRunRequest {
22792    #[serde(default, skip_serializing_if = "Option::is_none")]
22793    pub input: Option<serde_json::Map<String, serde_json::Value>>,
22794    #[serde(default, skip_serializing_if = "Option::is_none")]
22795    pub addressed_to: Option<Vec<String>>,
22796    #[serde(default, skip_serializing_if = "Option::is_none")]
22797    pub message: Option<String>,
22798    #[serde(default, skip_serializing_if = "Option::is_none")]
22799    pub chat_mode: Option<StartTeamRunRequestInputVariant2chatMode>,
22800}
22801
22802/// `StartSquadRunResponse` model.
22803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22804pub struct StartSquadRunResponse {
22805    pub team_run_id: String,
22806}
22807
22808/// `addressed_to`, `message` and `chat_mode` were declared at the TOP level here and the
22809/// handler's schema accepts only `input` and `metadata`, with `.strip()`. So a client written
22810/// from this document had its addressing and its chat mode dropped with no error at all: the
22811/// run started, it just was not the run that was asked for. They belong inside `input`, which
22812/// is where the handler reads them.
22813#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22814pub struct StartTeamRunRequest {
22815    /// The turn. A bare string is expanded to `{ message }`. `addressed_to` selects who answers;
22816    /// absent, @mentions in `message` are parsed for the same purpose.
22817    pub input: serde_json::Value,
22818    /// Accepted by the handler and undeclared here until now — the drift ran both ways.
22819    #[serde(default, skip_serializing_if = "Option::is_none")]
22820    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
22821}
22822
22823/// `StartTeamRunRequestInputVariant2` model.
22824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22825pub struct StartTeamRunRequestInputVariant2 {
22826    #[serde(default, skip_serializing_if = "Option::is_none")]
22827    pub message: Option<String>,
22828    #[serde(default, skip_serializing_if = "Option::is_none")]
22829    pub addressed_to: Option<Vec<String>>,
22830    #[serde(default, skip_serializing_if = "Option::is_none")]
22831    pub chat_mode: Option<StartTeamRunRequestInputVariant2chatMode>,
22832}
22833
22834/// `StartTeamRunRequestInputVariant2chatMode` enumeration.
22835#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
22836pub enum StartTeamRunRequestInputVariant2chatMode {
22837    #[default]
22838    #[serde(rename = "plan")]
22839    Plan,
22840    #[serde(rename = "chat")]
22841    Chat,
22842    /// A value the API introduced after this SDK was generated.
22843    #[serde(untagged)]
22844    Other(String),
22845}
22846
22847impl StartTeamRunRequestInputVariant2chatMode {
22848    /// The value as it appears on the wire.
22849    pub fn as_str(&self) -> &str {
22850        match self {
22851            Self::Plan => "plan",
22852            Self::Chat => "chat",
22853            Self::Other(value) => value.as_str(),
22854        }
22855    }
22856}
22857
22858impl std::fmt::Display for StartTeamRunRequestInputVariant2chatMode {
22859    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22860        f.write_str(self.as_str())
22861    }
22862}
22863
22864impl From<&str> for StartTeamRunRequestInputVariant2chatMode {
22865    fn from(value: &str) -> Self {
22866        match value {
22867            "plan" => Self::Plan,
22868            "chat" => Self::Chat,
22869            other => Self::Other(other.to_string()),
22870        }
22871    }
22872}
22873
22874/// `StartTeamRunResponse` model.
22875#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22876pub struct StartTeamRunResponse {
22877    pub team_run_id: String,
22878}
22879
22880/// types/company.ts StrategicGoal — as stored; the create/update body is looser (goal_id
22881/// assigned by the server).
22882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22883pub struct StrategicGoal {
22884    pub goal_id: String,
22885    pub title: String,
22886    pub description: String,
22887    pub kpis: Vec<StrategicGoalKpisItem>,
22888    #[serde(default, skip_serializing_if = "Option::is_none")]
22889    pub root_objective_id: Option<String>,
22890    #[serde(default, skip_serializing_if = "Option::is_none")]
22891    pub deadline: Option<String>,
22892}
22893
22894/// `StrategicGoalKpisItem` model.
22895#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22896pub struct StrategicGoalKpisItem {
22897    pub name: String,
22898    pub target: String,
22899    #[serde(default, skip_serializing_if = "Option::is_none")]
22900    pub current: Option<String>,
22901}
22902
22903/// What the scan actually looked at, on every access and erasure answer. A count of zero is
22904/// otherwise unreadable: until 2026-09-16 every one of these counts was zero on every request
22905/// ever made, and the reason was the matcher rather than the data.
22906#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22907pub struct SubjectSweep {
22908    /// How many identifiers the subject was matched on — the subject id plus the id of every
22909    /// api-key credential that acted for them. Never the identifiers themselves: a key id is a
22910    /// credential reference and this payload goes to the requester.
22911    pub identifiers_matched: i64,
22912    /// KV prefixes walked to exhaustion in this tenant.
22913    pub prefixes_scanned: Vec<String>,
22914    /// Record fields compared against the identifier set.
22915    pub fields_matched: Vec<String>,
22916    /// True when nothing matched, so a zero can be read as a zero.
22917    pub no_records_matched: bool,
22918}
22919
22920/// `SubmitFeedbackRequest` model.
22921#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22922pub struct SubmitFeedbackRequest {
22923    /// Clipped at 8000 characters.
22924    pub message: String,
22925    /// Clipped at 300.
22926    #[serde(default, skip_serializing_if = "Option::is_none")]
22927    pub title: Option<String>,
22928    /// Clipped at 2000.
22929    #[serde(default, skip_serializing_if = "Option::is_none")]
22930    pub context: Option<String>,
22931    /// Clipped at 1000.
22932    #[serde(default, skip_serializing_if = "Option::is_none")]
22933    pub url: Option<String>,
22934    #[serde(default, skip_serializing_if = "Option::is_none")]
22935    pub run_id: Option<String>,
22936    /// Anything other than `feedback` is filed as an error.
22937    #[serde(default, skip_serializing_if = "Option::is_none")]
22938    pub kind: Option<ErrorReportKind>,
22939}
22940
22941/// `SubmitFeedbackResponse` model.
22942#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22943pub struct SubmitFeedbackResponse {
22944    pub ok: bool,
22945    pub id: String,
22946}
22947
22948/// `SubscribeToListingRequest` model.
22949#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22950pub struct SubscribeToListingRequest {
22951    /// Required: the handler answers 403 without one. The block carried no `required` until
22952    /// 2026-09-18.
22953    pub stripe_subscription_id: String,
22954}
22955
22956/// `SuspendAgentRequest` model.
22957#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22958pub struct SuspendAgentRequest {
22959    #[serde(default, skip_serializing_if = "Option::is_none")]
22960    pub reason: Option<String>,
22961}
22962
22963/// `SuspendTenantRequest` model.
22964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22965pub struct SuspendTenantRequest {
22966    #[serde(default, skip_serializing_if = "Option::is_none")]
22967    pub reason: Option<String>,
22968}
22969
22970/// `SuspendTenantResponse` model.
22971#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22972pub struct SuspendTenantResponse {
22973    pub suspended: bool,
22974    pub tenant_id: String,
22975    pub reason: String,
22976}
22977
22978/// `SuspendUserResponse` model.
22979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22980pub struct SuspendUserResponse {
22981    pub suspended: bool,
22982    pub user_id: String,
22983}
22984
22985/// `SwitchTenantRequest` model.
22986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22987pub struct SwitchTenantRequest {
22988    pub tenant_id: String,
22989}
22990
22991/// `SwitchTenantResponse` model.
22992#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22993pub struct SwitchTenantResponse {
22994    pub switched: bool,
22995    pub tenant_id: String,
22996    pub user_id: String,
22997    pub role: String,
22998}
22999
23000/// `SyncProviderModelsResponse` model.
23001#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23002pub struct SyncProviderModelsResponse {
23003    /// New catalogue entries.
23004    pub added: i64,
23005    /// Ids of the added entries; capped. Deprecated spelling of `added_ids` — the same value, kept
23006    /// for the compatibility window and removed in the next breaking release (the one that moves
23007    /// `X-API-Version`). Read `added_ids`.
23008    #[serde(rename = "addedIds")]
23009    pub added_ids: Vec<String>,
23010    /// Catalogue size after the merge.
23011    pub total: i64,
23012    /// Models the provider reported.
23013    pub scanned: i64,
23014    /// Present when the run was scoped to one provider, as it is here.
23015    #[serde(default, skip_serializing_if = "Option::is_none")]
23016    pub provider: Option<String>,
23017    /// Ids of the added entries; capped.
23018    #[serde(rename = "added_ids")]
23019    pub added_ids_: Vec<String>,
23020}
23021
23022/// Multi-agent collaboration unit (tenant-scoped).
23023#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23024pub struct Team {
23025    pub team_id: String,
23026    pub tenant_id: String,
23027    pub name: String,
23028    #[serde(default, skip_serializing_if = "Option::is_none")]
23029    pub description: Option<String>,
23030    pub topology: TeamTopology,
23031    #[serde(default, skip_serializing_if = "Option::is_none")]
23032    pub delegation_strategy: Option<TeamDelegationStrategy>,
23033    #[serde(default, skip_serializing_if = "Option::is_none")]
23034    pub merge_strategy: Option<TeamMergeStrategy>,
23035    #[serde(default, skip_serializing_if = "Option::is_none")]
23036    pub message_protocol: Option<TeamMessageProtocol>,
23037    #[serde(default, skip_serializing_if = "Option::is_none")]
23038    pub orchestration_mode: Option<TeamOrchestrationMode>,
23039    #[serde(default, skip_serializing_if = "Option::is_none")]
23040    pub supervisor_mode: Option<TeamSupervisorMode>,
23041    pub supervisor_agent_id: String,
23042    pub workers: Vec<TeamWorker>,
23043    pub policies: TeamPolicies,
23044    #[serde(default, skip_serializing_if = "Option::is_none")]
23045    pub goal_config: Option<TeamGoalConfig>,
23046    #[serde(default, skip_serializing_if = "Option::is_none")]
23047    pub swarm_config: Option<TeamSwarmConfig>,
23048    #[serde(default, skip_serializing_if = "Option::is_none")]
23049    pub workspace_id: Option<String>,
23050    #[serde(default, skip_serializing_if = "Option::is_none")]
23051    pub created_at: Option<String>,
23052    #[serde(default, skip_serializing_if = "Option::is_none")]
23053    pub updated_at: Option<String>,
23054}
23055
23056/// `TeamChatTurn` model.
23057#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23058pub struct TeamChatTurn {
23059    #[serde(default, skip_serializing_if = "Option::is_none")]
23060    pub addressed_to: Option<Vec<String>>,
23061    pub content: String,
23062    pub from_task: bool,
23063    pub role: String,
23064    pub run_meta: serde_json::Map<String, serde_json::Value>,
23065    pub run_pending: bool,
23066    pub team_run_id: String,
23067    #[serde(default, skip_serializing_if = "Option::is_none")]
23068    pub thread_id: Option<String>,
23069    pub timestamp: String,
23070}
23071
23072/// Body for `POST /api/v1/teams` (`CreateTeamSchema`).
23073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23074pub struct TeamCreate {
23075    pub name: String,
23076    #[serde(default, skip_serializing_if = "Option::is_none")]
23077    pub description: Option<String>,
23078    #[serde(default, skip_serializing_if = "Option::is_none")]
23079    pub topology: Option<String>,
23080    #[serde(default, skip_serializing_if = "Option::is_none")]
23081    pub supervisor_agent_id: Option<String>,
23082    /// Each entry REQUIRES `agent_id` — omitting it answers `422 workers.0.agent_id: Required`.
23083    #[serde(default, skip_serializing_if = "Option::is_none")]
23084    pub workers: Option<Vec<TeamCreateWorker>>,
23085    #[serde(default, skip_serializing_if = "Option::is_none")]
23086    pub agent_ids: Option<Vec<String>>,
23087    #[serde(default, skip_serializing_if = "Option::is_none")]
23088    pub delegation_strategy: Option<String>,
23089    #[serde(default, skip_serializing_if = "Option::is_none")]
23090    pub merge_strategy: Option<String>,
23091    #[serde(default, skip_serializing_if = "Option::is_none")]
23092    pub orchestration_mode: Option<String>,
23093    #[serde(default, skip_serializing_if = "Option::is_none")]
23094    pub workspace_id: Option<String>,
23095}
23096
23097/// `TeamCreateWorker` model.
23098#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23099pub struct TeamCreateWorker {
23100    pub agent_id: String,
23101    #[serde(default, skip_serializing_if = "Option::is_none")]
23102    pub role: Option<String>,
23103}
23104
23105/// `TeamDelegationStrategy` enumeration.
23106#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23107pub enum TeamDelegationStrategy {
23108    #[default]
23109    #[serde(rename = "supervisor_decides")]
23110    SupervisorDecides,
23111    #[serde(rename = "round_robin")]
23112    RoundRobin,
23113    #[serde(rename = "capability_match")]
23114    CapabilityMatch,
23115    /// A value the API introduced after this SDK was generated.
23116    #[serde(untagged)]
23117    Other(String),
23118}
23119
23120impl TeamDelegationStrategy {
23121    /// The value as it appears on the wire.
23122    pub fn as_str(&self) -> &str {
23123        match self {
23124            Self::SupervisorDecides => "supervisor_decides",
23125            Self::RoundRobin => "round_robin",
23126            Self::CapabilityMatch => "capability_match",
23127            Self::Other(value) => value.as_str(),
23128        }
23129    }
23130}
23131
23132impl std::fmt::Display for TeamDelegationStrategy {
23133    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23134        f.write_str(self.as_str())
23135    }
23136}
23137
23138impl From<&str> for TeamDelegationStrategy {
23139    fn from(value: &str) -> Self {
23140        match value {
23141            "supervisor_decides" => Self::SupervisorDecides,
23142            "round_robin" => Self::RoundRobin,
23143            "capability_match" => Self::CapabilityMatch,
23144            other => Self::Other(other.to_string()),
23145        }
23146    }
23147}
23148
23149/// Goal-driven topology: the objective, the review cadence, the budget.
23150#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23151pub struct TeamGoalConfig {
23152    pub root_objective_id: String,
23153    #[serde(default, skip_serializing_if = "Option::is_none")]
23154    pub review_interval_ms: Option<i64>,
23155    #[serde(default, skip_serializing_if = "Option::is_none")]
23156    pub max_iterations: Option<i64>,
23157    #[serde(default, skip_serializing_if = "Option::is_none")]
23158    pub budget: Option<TeamObjectiveBudget>,
23159}
23160
23161/// `TeamGraphEdge` model.
23162#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23163pub struct TeamGraphEdge {
23164    pub edge_id: String,
23165    pub from: String,
23166    pub to: String,
23167    pub r#type: TeamGraphEdgeType,
23168    #[serde(default, skip_serializing_if = "Option::is_none")]
23169    pub task_id: Option<String>,
23170    pub created_at: String,
23171}
23172
23173/// `TeamGraphEdgeType` enumeration.
23174#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23175pub enum TeamGraphEdgeType {
23176    #[default]
23177    #[serde(rename = "delegation")]
23178    Delegation,
23179    #[serde(rename = "supervision")]
23180    Supervision,
23181    #[serde(rename = "peer")]
23182    Peer,
23183    /// A value the API introduced after this SDK was generated.
23184    #[serde(untagged)]
23185    Other(String),
23186}
23187
23188impl TeamGraphEdgeType {
23189    /// The value as it appears on the wire.
23190    pub fn as_str(&self) -> &str {
23191        match self {
23192            Self::Delegation => "delegation",
23193            Self::Supervision => "supervision",
23194            Self::Peer => "peer",
23195            Self::Other(value) => value.as_str(),
23196        }
23197    }
23198}
23199
23200impl std::fmt::Display for TeamGraphEdgeType {
23201    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23202        f.write_str(self.as_str())
23203    }
23204}
23205
23206impl From<&str> for TeamGraphEdgeType {
23207    fn from(value: &str) -> Self {
23208        match value {
23209            "delegation" => Self::Delegation,
23210            "supervision" => Self::Supervision,
23211            "peer" => Self::Peer,
23212            other => Self::Other(other.to_string()),
23213        }
23214    }
23215}
23216
23217/// `TeamGraphNode` model.
23218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23219pub struct TeamGraphNode {
23220    pub agent_id: String,
23221    pub role: TeamGraphNodeRole,
23222    pub status: TeamGraphNodeStatus,
23223    pub spawned_by: String,
23224    pub spawned_at: String,
23225    pub goal_summary: String,
23226}
23227
23228/// `TeamGraphNodeRole` enumeration.
23229#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23230pub enum TeamGraphNodeRole {
23231    #[default]
23232    #[serde(rename = "orchestrator")]
23233    Orchestrator,
23234    #[serde(rename = "worker")]
23235    Worker,
23236    #[serde(rename = "arbiter")]
23237    Arbiter,
23238    /// A value the API introduced after this SDK was generated.
23239    #[serde(untagged)]
23240    Other(String),
23241}
23242
23243impl TeamGraphNodeRole {
23244    /// The value as it appears on the wire.
23245    pub fn as_str(&self) -> &str {
23246        match self {
23247            Self::Orchestrator => "orchestrator",
23248            Self::Worker => "worker",
23249            Self::Arbiter => "arbiter",
23250            Self::Other(value) => value.as_str(),
23251        }
23252    }
23253}
23254
23255impl std::fmt::Display for TeamGraphNodeRole {
23256    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23257        f.write_str(self.as_str())
23258    }
23259}
23260
23261impl From<&str> for TeamGraphNodeRole {
23262    fn from(value: &str) -> Self {
23263        match value {
23264            "orchestrator" => Self::Orchestrator,
23265            "worker" => Self::Worker,
23266            "arbiter" => Self::Arbiter,
23267            other => Self::Other(other.to_string()),
23268        }
23269    }
23270}
23271
23272/// `TeamGraphNodeStatus` enumeration.
23273#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23274pub enum TeamGraphNodeStatus {
23275    #[default]
23276    #[serde(rename = "active")]
23277    Active,
23278    #[serde(rename = "idle")]
23279    Idle,
23280    #[serde(rename = "terminated")]
23281    Terminated,
23282    /// A value the API introduced after this SDK was generated.
23283    #[serde(untagged)]
23284    Other(String),
23285}
23286
23287impl TeamGraphNodeStatus {
23288    /// The value as it appears on the wire.
23289    pub fn as_str(&self) -> &str {
23290        match self {
23291            Self::Active => "active",
23292            Self::Idle => "idle",
23293            Self::Terminated => "terminated",
23294            Self::Other(value) => value.as_str(),
23295        }
23296    }
23297}
23298
23299impl std::fmt::Display for TeamGraphNodeStatus {
23300    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23301        f.write_str(self.as_str())
23302    }
23303}
23304
23305impl From<&str> for TeamGraphNodeStatus {
23306    fn from(value: &str) -> Self {
23307        match value {
23308            "active" => Self::Active,
23309            "idle" => Self::Idle,
23310            "terminated" => Self::Terminated,
23311            other => Self::Other(other.to_string()),
23312        }
23313    }
23314}
23315
23316/// `TeamMergeStrategy` enumeration.
23317#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23318pub enum TeamMergeStrategy {
23319    #[default]
23320    #[serde(rename = "supervisor_merges")]
23321    SupervisorMerges,
23322    #[serde(rename = "concatenate")]
23323    Concatenate,
23324    #[serde(rename = "vote")]
23325    Vote,
23326    /// A value the API introduced after this SDK was generated.
23327    #[serde(untagged)]
23328    Other(String),
23329}
23330
23331impl TeamMergeStrategy {
23332    /// The value as it appears on the wire.
23333    pub fn as_str(&self) -> &str {
23334        match self {
23335            Self::SupervisorMerges => "supervisor_merges",
23336            Self::Concatenate => "concatenate",
23337            Self::Vote => "vote",
23338            Self::Other(value) => value.as_str(),
23339        }
23340    }
23341}
23342
23343impl std::fmt::Display for TeamMergeStrategy {
23344    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23345        f.write_str(self.as_str())
23346    }
23347}
23348
23349impl From<&str> for TeamMergeStrategy {
23350    fn from(value: &str) -> Self {
23351        match value {
23352            "supervisor_merges" => Self::SupervisorMerges,
23353            "concatenate" => Self::Concatenate,
23354            "vote" => Self::Vote,
23355            other => Self::Other(other.to_string()),
23356        }
23357    }
23358}
23359
23360/// types/team.ts TeamMessage — one protocol message between team agents.
23361#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23362pub struct TeamMessage {
23363    pub message_id: String,
23364    pub team_run_id: String,
23365    pub from_agent_id: String,
23366    pub to_agent_id: String,
23367    pub r#type: TeamMessageType,
23368    pub content: String,
23369    pub round: i64,
23370    pub timestamp: String,
23371    #[serde(default, skip_serializing_if = "Option::is_none")]
23372    pub parent_message_id: Option<String>,
23373}
23374
23375/// `TeamMessageProtocol` enumeration.
23376#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23377pub enum TeamMessageProtocol {
23378    #[default]
23379    #[serde(rename = "shared_context")]
23380    SharedContext,
23381    #[serde(rename = "message_passing")]
23382    MessagePassing,
23383    /// A value the API introduced after this SDK was generated.
23384    #[serde(untagged)]
23385    Other(String),
23386}
23387
23388impl TeamMessageProtocol {
23389    /// The value as it appears on the wire.
23390    pub fn as_str(&self) -> &str {
23391        match self {
23392            Self::SharedContext => "shared_context",
23393            Self::MessagePassing => "message_passing",
23394            Self::Other(value) => value.as_str(),
23395        }
23396    }
23397}
23398
23399impl std::fmt::Display for TeamMessageProtocol {
23400    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23401        f.write_str(self.as_str())
23402    }
23403}
23404
23405impl From<&str> for TeamMessageProtocol {
23406    fn from(value: &str) -> Self {
23407        match value {
23408            "shared_context" => Self::SharedContext,
23409            "message_passing" => Self::MessagePassing,
23410            other => Self::Other(other.to_string()),
23411        }
23412    }
23413}
23414
23415/// `TeamMessageType` enumeration.
23416#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23417pub enum TeamMessageType {
23418    #[default]
23419    #[serde(rename = "delegation")]
23420    Delegation,
23421    #[serde(rename = "result")]
23422    Result,
23423    #[serde(rename = "question")]
23424    Question,
23425    #[serde(rename = "status_update")]
23426    StatusUpdate,
23427    #[serde(rename = "merge_request")]
23428    MergeRequest,
23429    #[serde(rename = "validation")]
23430    Validation,
23431    /// A value the API introduced after this SDK was generated.
23432    #[serde(untagged)]
23433    Other(String),
23434}
23435
23436impl TeamMessageType {
23437    /// The value as it appears on the wire.
23438    pub fn as_str(&self) -> &str {
23439        match self {
23440            Self::Delegation => "delegation",
23441            Self::Result => "result",
23442            Self::Question => "question",
23443            Self::StatusUpdate => "status_update",
23444            Self::MergeRequest => "merge_request",
23445            Self::Validation => "validation",
23446            Self::Other(value) => value.as_str(),
23447        }
23448    }
23449}
23450
23451impl std::fmt::Display for TeamMessageType {
23452    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23453        f.write_str(self.as_str())
23454    }
23455}
23456
23457impl From<&str> for TeamMessageType {
23458    fn from(value: &str) -> Self {
23459        match value {
23460            "delegation" => Self::Delegation,
23461            "result" => Self::Result,
23462            "question" => Self::Question,
23463            "status_update" => Self::StatusUpdate,
23464            "merge_request" => Self::MergeRequest,
23465            "validation" => Self::Validation,
23466            other => Self::Other(other.to_string()),
23467        }
23468    }
23469}
23470
23471/// Ceiling for a goal-driven team's pursuit of its objective.
23472#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23473pub struct TeamObjectiveBudget {
23474    #[serde(default, skip_serializing_if = "Option::is_none")]
23475    pub max_runs: Option<i64>,
23476    #[serde(default, skip_serializing_if = "Option::is_none")]
23477    pub max_tokens: Option<i64>,
23478    #[serde(default, skip_serializing_if = "Option::is_none")]
23479    pub max_cost_usd: Option<f64>,
23480}
23481
23482/// `TeamOrchestrationMode` enumeration.
23483#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23484pub enum TeamOrchestrationMode {
23485    #[default]
23486    #[serde(rename = "strict_addressed")]
23487    StrictAddressed,
23488    #[serde(rename = "peer_collab")]
23489    PeerCollab,
23490    #[serde(rename = "vote_based")]
23491    VoteBased,
23492    /// A value the API introduced after this SDK was generated.
23493    #[serde(untagged)]
23494    Other(String),
23495}
23496
23497impl TeamOrchestrationMode {
23498    /// The value as it appears on the wire.
23499    pub fn as_str(&self) -> &str {
23500        match self {
23501            Self::StrictAddressed => "strict_addressed",
23502            Self::PeerCollab => "peer_collab",
23503            Self::VoteBased => "vote_based",
23504            Self::Other(value) => value.as_str(),
23505        }
23506    }
23507}
23508
23509impl std::fmt::Display for TeamOrchestrationMode {
23510    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23511        f.write_str(self.as_str())
23512    }
23513}
23514
23515impl From<&str> for TeamOrchestrationMode {
23516    fn from(value: &str) -> Self {
23517        match value {
23518            "strict_addressed" => Self::StrictAddressed,
23519            "peer_collab" => Self::PeerCollab,
23520            "vote_based" => Self::VoteBased,
23521            other => Self::Other(other.to_string()),
23522        }
23523    }
23524}
23525
23526/// Limits and failure handling for a team run.
23527#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23528pub struct TeamPolicies {
23529    pub max_rounds: i64,
23530    /// Total team run timeout. Accepted at any value but only ever RAISED: anything below 3600000
23531    /// (1 hour) is enforced as 3600000, so that slow local models are not killed mid-run. 0 or
23532    /// absent means uncapped.
23533    pub timeout_ms: i64,
23534    pub early_termination: bool,
23535    #[serde(default, skip_serializing_if = "Option::is_none")]
23536    pub consensus_threshold: Option<f64>,
23537    pub effort: TeamPoliciesEffort,
23538    /// supervisor -\> worker -\> sub-worker.
23539    pub max_delegation_depth: i64,
23540    pub subtask_timeout_ms: i64,
23541    /// Applied by the auto_dispatch supervisor. Under tool_driven the failure is returned to the
23542    /// supervisor as a tool result instead, and this policy does not run.
23543    pub on_worker_failure: TeamPoliciesOnWorkerFailure,
23544    pub max_worker_retries: i64,
23545    pub require_all_workers: bool,
23546    #[serde(default, skip_serializing_if = "Option::is_none")]
23547    pub validation: Option<ValidationPolicy>,
23548    /// Default 50.
23549    #[serde(default, skip_serializing_if = "Option::is_none")]
23550    pub max_graph_nodes: Option<i64>,
23551    /// Concurrent worker runs in a fan-out (default 8).
23552    #[serde(default, skip_serializing_if = "Option::is_none")]
23553    pub max_concurrency: Option<i64>,
23554}
23555
23556/// `TeamPoliciesEffort` enumeration.
23557#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23558pub enum TeamPoliciesEffort {
23559    #[default]
23560    #[serde(rename = "low")]
23561    Low,
23562    #[serde(rename = "medium")]
23563    Medium,
23564    #[serde(rename = "high")]
23565    High,
23566    #[serde(rename = "max")]
23567    Max,
23568    /// A value the API introduced after this SDK was generated.
23569    #[serde(untagged)]
23570    Other(String),
23571}
23572
23573impl TeamPoliciesEffort {
23574    /// The value as it appears on the wire.
23575    pub fn as_str(&self) -> &str {
23576        match self {
23577            Self::Low => "low",
23578            Self::Medium => "medium",
23579            Self::High => "high",
23580            Self::Max => "max",
23581            Self::Other(value) => value.as_str(),
23582        }
23583    }
23584}
23585
23586impl std::fmt::Display for TeamPoliciesEffort {
23587    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23588        f.write_str(self.as_str())
23589    }
23590}
23591
23592impl From<&str> for TeamPoliciesEffort {
23593    fn from(value: &str) -> Self {
23594        match value {
23595            "low" => Self::Low,
23596            "medium" => Self::Medium,
23597            "high" => Self::High,
23598            "max" => Self::Max,
23599            other => Self::Other(other.to_string()),
23600        }
23601    }
23602}
23603
23604/// Applied by the auto_dispatch supervisor. Under tool_driven the failure is returned to the
23605/// supervisor as a tool result instead, and this policy does not run.
23606#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23607pub enum TeamPoliciesOnWorkerFailure {
23608    #[default]
23609    #[serde(rename = "retry")]
23610    Retry,
23611    #[serde(rename = "skip")]
23612    Skip,
23613    #[serde(rename = "abort_team")]
23614    AbortTeam,
23615    /// A value the API introduced after this SDK was generated.
23616    #[serde(untagged)]
23617    Other(String),
23618}
23619
23620impl TeamPoliciesOnWorkerFailure {
23621    /// The value as it appears on the wire.
23622    pub fn as_str(&self) -> &str {
23623        match self {
23624            Self::Retry => "retry",
23625            Self::Skip => "skip",
23626            Self::AbortTeam => "abort_team",
23627            Self::Other(value) => value.as_str(),
23628        }
23629    }
23630}
23631
23632impl std::fmt::Display for TeamPoliciesOnWorkerFailure {
23633    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23634        f.write_str(self.as_str())
23635    }
23636}
23637
23638impl From<&str> for TeamPoliciesOnWorkerFailure {
23639    fn from(value: &str) -> Self {
23640        match value {
23641            "retry" => Self::Retry,
23642            "skip" => Self::Skip,
23643            "abort_team" => Self::AbortTeam,
23644            other => Self::Other(other.to_string()),
23645        }
23646    }
23647}
23648
23649/// teams.ts — the chat turn of a team run; at most one element.
23650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23651pub struct TeamRunChatTurn {
23652    pub user_message: String,
23653    pub assistant_message: String,
23654}
23655
23656/// GET /teams/{teamId}/runs/{teamRunId} and GET /squads/{squadId}/runs/{teamRunId} (measured
23657/// 2026-09-10 on e2e-canon, identical on both routes): the team run and the member runs it
23658/// spawned.
23659#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23660pub struct TeamRunDetail {
23661    pub team_run_id: String,
23662    pub team_id: String,
23663    pub status: String,
23664    pub runs: Vec<Run>,
23665    pub total_runs: i64,
23666}
23667
23668/// `TeamRunSummary` model.
23669#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23670pub struct TeamRunSummary {
23671    pub team_run_id: String,
23672    pub run_id: String,
23673    pub agent_id: String,
23674    pub status: String,
23675    pub created_at: String,
23676}
23677
23678/// `TeamSupervisorMode` enumeration.
23679#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23680pub enum TeamSupervisorMode {
23681    #[default]
23682    #[serde(rename = "auto_dispatch")]
23683    AutoDispatch,
23684    #[serde(rename = "tool_driven")]
23685    ToolDriven,
23686    /// A value the API introduced after this SDK was generated.
23687    #[serde(untagged)]
23688    Other(String),
23689}
23690
23691impl TeamSupervisorMode {
23692    /// The value as it appears on the wire.
23693    pub fn as_str(&self) -> &str {
23694        match self {
23695            Self::AutoDispatch => "auto_dispatch",
23696            Self::ToolDriven => "tool_driven",
23697            Self::Other(value) => value.as_str(),
23698        }
23699    }
23700}
23701
23702impl std::fmt::Display for TeamSupervisorMode {
23703    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23704        f.write_str(self.as_str())
23705    }
23706}
23707
23708impl From<&str> for TeamSupervisorMode {
23709    fn from(value: &str) -> Self {
23710        match value {
23711            "auto_dispatch" => Self::AutoDispatch,
23712            "tool_driven" => Self::ToolDriven,
23713            other => Self::Other(other.to_string()),
23714        }
23715    }
23716}
23717
23718/// Swarm topology: who starts, and how context travels on handoff.
23719#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23720pub struct TeamSwarmConfig {
23721    pub initial_agent_id: String,
23722    #[serde(default, skip_serializing_if = "Option::is_none")]
23723    pub max_handoffs: Option<i64>,
23724    #[serde(default, skip_serializing_if = "Option::is_none")]
23725    pub handoff_context_strategy: Option<TeamSwarmConfigHandoffContextStrategy>,
23726}
23727
23728/// `TeamSwarmConfigHandoffContextStrategy` enumeration.
23729#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23730pub enum TeamSwarmConfigHandoffContextStrategy {
23731    #[default]
23732    #[serde(rename = "full")]
23733    Full,
23734    #[serde(rename = "summary")]
23735    Summary,
23736    /// A value the API introduced after this SDK was generated.
23737    #[serde(untagged)]
23738    Other(String),
23739}
23740
23741impl TeamSwarmConfigHandoffContextStrategy {
23742    /// The value as it appears on the wire.
23743    pub fn as_str(&self) -> &str {
23744        match self {
23745            Self::Full => "full",
23746            Self::Summary => "summary",
23747            Self::Other(value) => value.as_str(),
23748        }
23749    }
23750}
23751
23752impl std::fmt::Display for TeamSwarmConfigHandoffContextStrategy {
23753    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23754        f.write_str(self.as_str())
23755    }
23756}
23757
23758impl From<&str> for TeamSwarmConfigHandoffContextStrategy {
23759    fn from(value: &str) -> Self {
23760        match value {
23761            "full" => Self::Full,
23762            "summary" => Self::Summary,
23763            other => Self::Other(other.to_string()),
23764        }
23765    }
23766}
23767
23768/// `TeamTopology` enumeration.
23769#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23770pub enum TeamTopology {
23771    #[default]
23772    #[serde(rename = "supervisor")]
23773    Supervisor,
23774    #[serde(rename = "round_robin")]
23775    RoundRobin,
23776    #[serde(rename = "pipeline")]
23777    Pipeline,
23778    #[serde(rename = "goal_driven")]
23779    GoalDriven,
23780    #[serde(rename = "swarm")]
23781    Swarm,
23782    /// A value the API introduced after this SDK was generated.
23783    #[serde(untagged)]
23784    Other(String),
23785}
23786
23787impl TeamTopology {
23788    /// The value as it appears on the wire.
23789    pub fn as_str(&self) -> &str {
23790        match self {
23791            Self::Supervisor => "supervisor",
23792            Self::RoundRobin => "round_robin",
23793            Self::Pipeline => "pipeline",
23794            Self::GoalDriven => "goal_driven",
23795            Self::Swarm => "swarm",
23796            Self::Other(value) => value.as_str(),
23797        }
23798    }
23799}
23800
23801impl std::fmt::Display for TeamTopology {
23802    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23803        f.write_str(self.as_str())
23804    }
23805}
23806
23807impl From<&str> for TeamTopology {
23808    fn from(value: &str) -> Self {
23809        match value {
23810            "supervisor" => Self::Supervisor,
23811            "round_robin" => Self::RoundRobin,
23812            "pipeline" => Self::Pipeline,
23813            "goal_driven" => Self::GoalDriven,
23814            "swarm" => Self::Swarm,
23815            other => Self::Other(other.to_string()),
23816        }
23817    }
23818}
23819
23820/// Body for `PUT /api/v1/teams/{teamId}`. Every field optional — send only what changes.
23821#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23822pub struct TeamUpdate {
23823    #[serde(default, skip_serializing_if = "Option::is_none")]
23824    pub name: Option<String>,
23825    #[serde(default, skip_serializing_if = "Option::is_none")]
23826    pub description: Option<String>,
23827    #[serde(default, skip_serializing_if = "Option::is_none")]
23828    pub topology: Option<String>,
23829    #[serde(default, skip_serializing_if = "Option::is_none")]
23830    pub supervisor_agent_id: Option<String>,
23831    #[serde(default, skip_serializing_if = "Option::is_none")]
23832    pub workers: Option<Vec<TeamUpdateWorker>>,
23833}
23834
23835/// `TeamUpdateWorker` model.
23836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23837pub struct TeamUpdateWorker {
23838    pub agent_id: String,
23839    #[serde(default, skip_serializing_if = "Option::is_none")]
23840    pub role: Option<String>,
23841}
23842
23843/// An agent acting in a team, with a role and permissions.
23844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23845pub struct TeamWorker {
23846    pub agent_id: String,
23847    pub role: String,
23848    pub permissions: TeamWorkerPermissions,
23849    #[serde(default, skip_serializing_if = "Option::is_none")]
23850    pub external_a2a: Option<TeamWorkerExternalA2A>,
23851}
23852
23853/// Delegate this worker to another platform over the A2A protocol.
23854#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23855pub struct TeamWorkerExternalA2A {
23856    pub endpoint: String,
23857    pub agent_card_url: String,
23858    #[serde(default, skip_serializing_if = "Option::is_none")]
23859    pub auth: Option<TeamWorkerExternalA2AAuth>,
23860}
23861
23862/// `TeamWorkerExternalA2AAuth` model.
23863#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23864pub struct TeamWorkerExternalA2AAuth {
23865    pub r#type: String,
23866    #[serde(default, skip_serializing_if = "Option::is_none")]
23867    pub token_ref: Option<String>,
23868}
23869
23870/// What a worker may do inside a team run.
23871#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23872pub struct TeamWorkerPermissions {
23873    /// Tool names this worker may invoke. Defaults to the agent's own allowed_tools.
23874    pub tools: Vec<String>,
23875    pub can_read_other_results: bool,
23876    pub can_delegate: bool,
23877    pub can_abort: bool,
23878    #[serde(default, skip_serializing_if = "Option::is_none")]
23879    pub max_tokens: Option<i64>,
23880    #[serde(default, skip_serializing_if = "Option::is_none")]
23881    pub max_steps_per_subtask: Option<i64>,
23882}
23883
23884/// `Tenant` model.
23885#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23886pub struct Tenant {
23887    pub tenant_id: String,
23888    pub name: String,
23889    pub slug: String,
23890    pub status: TenantStatus,
23891    #[serde(default, skip_serializing_if = "Option::is_none")]
23892    pub plan: Option<String>,
23893    /// Resolved plan id — present on the normal answer, absent on the bootstrap branch.
23894    #[serde(default, skip_serializing_if = "Option::is_none")]
23895    pub plan_id: Option<String>,
23896    #[serde(default, skip_serializing_if = "Option::is_none")]
23897    pub quotas: Option<TenantQuotas>,
23898    #[serde(default, skip_serializing_if = "Option::is_none")]
23899    pub quota_overrides: Option<TenantQuotaOverrides>,
23900    #[serde(default, skip_serializing_if = "Option::is_none")]
23901    pub settings: Option<serde_json::Map<String, serde_json::Value>>,
23902    #[serde(default, skip_serializing_if = "Option::is_none")]
23903    pub billing: Option<TenantBilling>,
23904    #[serde(default, skip_serializing_if = "Option::is_none")]
23905    pub billing_status: Option<TenantBillingStatus>,
23906    #[serde(default, skip_serializing_if = "Option::is_none")]
23907    pub trial: Option<TenantTrial>,
23908    #[serde(default, skip_serializing_if = "Option::is_none")]
23909    pub trial_ends_at: Option<String>,
23910    #[serde(default, skip_serializing_if = "Option::is_none")]
23911    pub trial_recommended_plan: Option<String>,
23912    #[serde(default, skip_serializing_if = "Option::is_none")]
23913    pub trial_resolved: Option<bool>,
23914    #[serde(default, skip_serializing_if = "Option::is_none")]
23915    pub onboarding_completed: Option<bool>,
23916    #[serde(default, skip_serializing_if = "Option::is_none")]
23917    pub is_super_admin: Option<bool>,
23918    #[serde(default, skip_serializing_if = "Option::is_none")]
23919    pub is_platform_admin: Option<bool>,
23920    #[serde(default, skip_serializing_if = "Option::is_none")]
23921    pub head_agent_id: Option<String>,
23922    #[serde(default, skip_serializing_if = "Option::is_none")]
23923    pub shared_workspace_id: Option<String>,
23924    #[serde(default, skip_serializing_if = "Option::is_none")]
23925    pub public: Option<bool>,
23926    #[serde(default, skip_serializing_if = "Option::is_none")]
23927    pub description: Option<String>,
23928    #[serde(default, skip_serializing_if = "Option::is_none")]
23929    pub logo_url: Option<String>,
23930    #[serde(default, skip_serializing_if = "Option::is_none")]
23931    pub custom_domain: Option<TenantCustomDomain>,
23932    #[serde(default, skip_serializing_if = "Option::is_none")]
23933    pub branding: Option<TenantBranding>,
23934    #[serde(default, skip_serializing_if = "Option::is_none")]
23935    pub social_links: Option<TenantSocialLinks>,
23936    #[serde(default, skip_serializing_if = "Option::is_none")]
23937    pub marketplace_listing: Option<serde_json::Map<String, serde_json::Value>>,
23938    #[serde(default, skip_serializing_if = "Option::is_none")]
23939    pub public_agent_id: Option<String>,
23940    #[serde(default, skip_serializing_if = "Option::is_none")]
23941    pub published_agent_ids: Option<Vec<String>>,
23942    #[serde(default, skip_serializing_if = "Option::is_none")]
23943    pub public_settings: Option<TenantPublicSettings>,
23944    #[serde(default, skip_serializing_if = "Option::is_none")]
23945    pub entitled_spec_packages: Option<Vec<String>>,
23946    #[serde(default, skip_serializing_if = "Option::is_none")]
23947    pub legal_hold: Option<bool>,
23948    #[serde(default, skip_serializing_if = "Option::is_none")]
23949    pub suspension_reason: Option<String>,
23950    #[serde(default, skip_serializing_if = "Option::is_none")]
23951    pub suspended_at: Option<String>,
23952    pub created_at: String,
23953    pub updated_at: String,
23954}
23955
23956/// `TenantBilling` model.
23957#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23958pub struct TenantBilling {
23959    #[serde(default, skip_serializing_if = "Option::is_none")]
23960    pub stripe_customer_id: Option<String>,
23961    #[serde(default, skip_serializing_if = "Option::is_none")]
23962    pub stripe_subscription_id: Option<String>,
23963    #[serde(default, skip_serializing_if = "Option::is_none")]
23964    pub cancel_at_period_end: Option<bool>,
23965    #[serde(default, skip_serializing_if = "Option::is_none")]
23966    pub current_period_end_ms: Option<i64>,
23967}
23968
23969/// `TenantBillingStatus` enumeration.
23970#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
23971pub enum TenantBillingStatus {
23972    #[default]
23973    #[serde(rename = "active")]
23974    Active,
23975    #[serde(rename = "past_due")]
23976    PastDue,
23977    #[serde(rename = "disputed")]
23978    Disputed,
23979    #[serde(rename = "cancelled")]
23980    Cancelled,
23981    /// A value the API introduced after this SDK was generated.
23982    #[serde(untagged)]
23983    Other(String),
23984}
23985
23986impl TenantBillingStatus {
23987    /// The value as it appears on the wire.
23988    pub fn as_str(&self) -> &str {
23989        match self {
23990            Self::Active => "active",
23991            Self::PastDue => "past_due",
23992            Self::Disputed => "disputed",
23993            Self::Cancelled => "cancelled",
23994            Self::Other(value) => value.as_str(),
23995        }
23996    }
23997}
23998
23999impl std::fmt::Display for TenantBillingStatus {
24000    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24001        f.write_str(self.as_str())
24002    }
24003}
24004
24005impl From<&str> for TenantBillingStatus {
24006    fn from(value: &str) -> Self {
24007        match value {
24008            "active" => Self::Active,
24009            "past_due" => Self::PastDue,
24010            "disputed" => Self::Disputed,
24011            "cancelled" => Self::Cancelled,
24012            other => Self::Other(other.to_string()),
24013        }
24014    }
24015}
24016
24017/// `TenantBranding` model.
24018#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24019pub struct TenantBranding {
24020    #[serde(default, skip_serializing_if = "Option::is_none")]
24021    pub primary_color: Option<String>,
24022    #[serde(default, skip_serializing_if = "Option::is_none")]
24023    pub accent_color: Option<String>,
24024    #[serde(default, skip_serializing_if = "Option::is_none")]
24025    pub background_color: Option<String>,
24026    #[serde(default, skip_serializing_if = "Option::is_none")]
24027    pub foreground_color: Option<String>,
24028    #[serde(default, skip_serializing_if = "Option::is_none")]
24029    pub card_color: Option<String>,
24030    #[serde(default, skip_serializing_if = "Option::is_none")]
24031    pub border_color: Option<String>,
24032    #[serde(default, skip_serializing_if = "Option::is_none")]
24033    pub favicon_url: Option<String>,
24034    #[serde(default, skip_serializing_if = "Option::is_none")]
24035    pub custom_css: Option<String>,
24036    #[serde(default, skip_serializing_if = "Option::is_none")]
24037    pub font_family: Option<String>,
24038    #[serde(default, skip_serializing_if = "Option::is_none")]
24039    pub site_title: Option<String>,
24040    #[serde(default, skip_serializing_if = "Option::is_none")]
24041    pub seo_description: Option<String>,
24042    #[serde(default, skip_serializing_if = "Option::is_none")]
24043    pub og_image_url: Option<String>,
24044    #[serde(default, skip_serializing_if = "Option::is_none")]
24045    pub dark_mode: Option<bool>,
24046}
24047
24048/// `TenantCustomDomain` model.
24049#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24050pub struct TenantCustomDomain {
24051    pub domain: String,
24052    pub created_at: String,
24053    #[serde(default, skip_serializing_if = "Option::is_none")]
24054    pub updated_at: Option<String>,
24055    #[serde(default, skip_serializing_if = "Option::is_none")]
24056    pub status: Option<TenantCustomDomainStatus>,
24057    #[serde(default, skip_serializing_if = "Option::is_none")]
24058    pub verification_method: Option<TenantCustomDomainVerificationMethod>,
24059    #[serde(default, skip_serializing_if = "Option::is_none")]
24060    pub verification_value: Option<String>,
24061    #[serde(default, skip_serializing_if = "Option::is_none")]
24062    pub last_checked_at: Option<String>,
24063    #[serde(default, skip_serializing_if = "Option::is_none")]
24064    pub verified_at: Option<String>,
24065    #[serde(default, skip_serializing_if = "Option::is_none")]
24066    pub dns: Option<serde_json::Map<String, serde_json::Value>>,
24067    #[serde(default, skip_serializing_if = "Option::is_none")]
24068    pub cert: Option<serde_json::Map<String, serde_json::Value>>,
24069}
24070
24071/// `TenantCustomDomainStatus` enumeration.
24072#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
24073pub enum TenantCustomDomainStatus {
24074    #[default]
24075    #[serde(rename = "pending")]
24076    Pending,
24077    #[serde(rename = "verified")]
24078    Verified,
24079    #[serde(rename = "failed")]
24080    Failed,
24081    #[serde(rename = "deactivated")]
24082    Deactivated,
24083    /// A value the API introduced after this SDK was generated.
24084    #[serde(untagged)]
24085    Other(String),
24086}
24087
24088impl TenantCustomDomainStatus {
24089    /// The value as it appears on the wire.
24090    pub fn as_str(&self) -> &str {
24091        match self {
24092            Self::Pending => "pending",
24093            Self::Verified => "verified",
24094            Self::Failed => "failed",
24095            Self::Deactivated => "deactivated",
24096            Self::Other(value) => value.as_str(),
24097        }
24098    }
24099}
24100
24101impl std::fmt::Display for TenantCustomDomainStatus {
24102    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24103        f.write_str(self.as_str())
24104    }
24105}
24106
24107impl From<&str> for TenantCustomDomainStatus {
24108    fn from(value: &str) -> Self {
24109        match value {
24110            "pending" => Self::Pending,
24111            "verified" => Self::Verified,
24112            "failed" => Self::Failed,
24113            "deactivated" => Self::Deactivated,
24114            other => Self::Other(other.to_string()),
24115        }
24116    }
24117}
24118
24119/// `TenantCustomDomainVerificationMethod` enumeration.
24120#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
24121pub enum TenantCustomDomainVerificationMethod {
24122    #[default]
24123    #[serde(rename = "cname")]
24124    Cname,
24125    /// A value the API introduced after this SDK was generated.
24126    #[serde(untagged)]
24127    Other(String),
24128}
24129
24130impl TenantCustomDomainVerificationMethod {
24131    /// The value as it appears on the wire.
24132    pub fn as_str(&self) -> &str {
24133        match self {
24134            Self::Cname => "cname",
24135            Self::Other(value) => value.as_str(),
24136        }
24137    }
24138}
24139
24140impl std::fmt::Display for TenantCustomDomainVerificationMethod {
24141    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24142        f.write_str(self.as_str())
24143    }
24144}
24145
24146impl From<&str> for TenantCustomDomainVerificationMethod {
24147    fn from(value: &str) -> Self {
24148        match value {
24149            "cname" => Self::Cname,
24150            other => Self::Other(other.to_string()),
24151        }
24152    }
24153}
24154
24155/// The “what needs a human” queue. The overview answers how many; this answers which, and what
24156/// they are asking.
24157#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24158pub struct TenantInbox {
24159    pub generated_at: String,
24160    /// Counted over the whole scan, NOT over `items` — so `limit` truncating the list does not move
24161    /// them. The SCAN is capped too, though, and that cap they cannot see past: when `truncated` is
24162    /// true these are a floor, not a total.
24163    pub counts: TenantInboxCounts,
24164    pub items: Vec<InboxItem>,
24165    /// Run records inspected; the scan is capped.
24166    pub scanned: i64,
24167    /// The scan hit its cap, so `counts` is a floor rather than a total. `scanned` alone cannot
24168    /// tell you this — the number only means something to a caller who already knows what the cap
24169    /// is.
24170    #[serde(default, skip_serializing_if = "Option::is_none")]
24171    pub truncated: Option<bool>,
24172}
24173
24174/// Counted over the whole scan, NOT over `items` — so `limit` truncating the list does not move
24175/// them. The SCAN is capped too, though, and that cap they cannot see past: when `truncated` is
24176/// true these are a floor, not a total.
24177#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24178pub struct TenantInboxCounts {
24179    pub total: i64,
24180    pub approval: i64,
24181    pub input: i64,
24182    pub paused: i64,
24183    pub failed: i64,
24184}
24185
24186/// `TenantMefConfigResponse` model.
24187#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24188pub struct TenantMefConfigResponse {
24189    pub tenant_id: String,
24190    /// What an operator stored. Null when nothing is overridden — never an empty object.
24191    #[serde(default)]
24192    pub mef_config: Option<TenantMefConfigResponseMefConfig>,
24193    /// What the runtime will do. All false when the mission service is absent platform-wide,
24194    /// whatever the overrides say.
24195    pub effective: TenantMefConfigResponseEffective,
24196}
24197
24198/// What the runtime will do. All false when the mission service is absent platform-wide,
24199/// whatever the overrides say.
24200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24201pub struct TenantMefConfigResponseEffective {
24202    pub enabled: bool,
24203    pub planner_enabled: bool,
24204    pub judge_enabled: bool,
24205    pub auto_classify: bool,
24206}
24207
24208/// What an operator stored. Null when nothing is overridden — never an empty object.
24209#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24210pub struct TenantMefConfigResponseMefConfig {
24211    #[serde(default, skip_serializing_if = "Option::is_none")]
24212    pub enabled: Option<bool>,
24213    #[serde(default, skip_serializing_if = "Option::is_none")]
24214    pub planner_enabled: Option<bool>,
24215    #[serde(default, skip_serializing_if = "Option::is_none")]
24216    pub judge_enabled: Option<bool>,
24217    #[serde(default, skip_serializing_if = "Option::is_none")]
24218    pub auto_classify: Option<bool>,
24219}
24220
24221/// The single aggregate behind Mission Control: fleet, run buckets, approvals, quota, worker
24222/// health and schedule risk in one call instead of N.
24223#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24224pub struct TenantOverview {
24225    pub generated_at: String,
24226    pub fleet: TenantOverviewFleet,
24227    pub runs: TenantOverviewRuns,
24228    pub approvals: TenantOverviewApprovals,
24229    /// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24230    /// health); clients must tolerate absence. v1 serves it.
24231    #[serde(default, skip_serializing_if = "Option::is_none")]
24232    pub usage: Option<TenantOverviewUsage>,
24233    /// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24234    /// health); clients must tolerate absence. v1 serves it.
24235    #[serde(default, skip_serializing_if = "Option::is_none")]
24236    pub cost: Option<TenantOverviewCost>,
24237    /// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24238    /// health); clients must tolerate absence. v1 serves it.
24239    #[serde(default, skip_serializing_if = "Option::is_none")]
24240    pub system: Option<TenantOverviewSystem>,
24241    pub schedules: TenantOverviewSchedules,
24242}
24243
24244/// `TenantOverviewApprovals` model.
24245#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24246pub struct TenantOverviewApprovals {
24247    pub pending_count: i64,
24248}
24249
24250/// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24251/// health); clients must tolerate absence. v1 serves it.
24252#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24253pub struct TenantOverviewCost {
24254    pub total_usd: f64,
24255    pub range_days: i64,
24256}
24257
24258/// `TenantOverviewFleet` model.
24259#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24260pub struct TenantOverviewFleet {
24261    pub total: i64,
24262    pub active_agents: i64,
24263    pub suspended: i64,
24264    pub terminated: i64,
24265    /// Optional: absent when the server does not track it (no such field on v2's record); clients
24266    /// must tolerate absence. v1 serves it.
24267    #[serde(default, skip_serializing_if = "Option::is_none")]
24268    pub by_execution_mode: Option<TenantOverviewFleetByExecutionMode>,
24269    /// Optional: absent on a server without the bridge concept (v2 has none); clients must tolerate
24270    /// absence. v1 serves it.
24271    #[serde(default, skip_serializing_if = "Option::is_none")]
24272    pub bridge: Option<TenantOverviewFleetBridge>,
24273    /// Optional: absent when the server does not track it (no such field on v2's record); clients
24274    /// must tolerate absence. v1 serves it.
24275    #[serde(default, skip_serializing_if = "Option::is_none")]
24276    pub head_agent_id: Option<String>,
24277    pub top_by_runs: Vec<AgentAnalyticsRow>,
24278    /// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24279    /// health); clients must tolerate absence. v1 serves it.
24280    #[serde(default, skip_serializing_if = "Option::is_none")]
24281    pub top_by_cost: Option<Vec<AgentAnalyticsRow>>,
24282    /// Agent id → the timestamp of its most recent run in the scanned window.
24283    pub last_run_at: serde_json::Map<String, serde_json::Value>,
24284}
24285
24286/// Optional: absent on a server without the bridge concept (v2 has none); clients must tolerate
24287/// absence. v1 serves it.
24288#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24289pub struct TenantOverviewFleetBridge {
24290    pub online: i64,
24291    pub stale: i64,
24292    pub offline: i64,
24293    pub machines_total: i64,
24294}
24295
24296/// Optional: absent when the server does not track it (no such field on v2's record); clients
24297/// must tolerate absence. v1 serves it.
24298#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24299pub struct TenantOverviewFleetByExecutionMode {
24300    pub cloud: i64,
24301    pub bridge: i64,
24302}
24303
24304/// `TenantOverviewRuns` model.
24305#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24306pub struct TenantOverviewRuns {
24307    pub by_status: serde_json::Map<String, serde_json::Value>,
24308    /// Queued, running, paused, awaiting approval or awaiting input.
24309    pub active_count: i64,
24310    pub failed_24h: i64,
24311    /// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24312    /// health); clients must tolerate absence. v1 serves it.
24313    #[serde(default, skip_serializing_if = "Option::is_none")]
24314    pub cost_24h_usd: Option<f64>,
24315    pub recent: Vec<TenantOverviewRunsRecentItem>,
24316    /// How many run records the aggregate actually looked at. The scan is capped, so a busy
24317    /// tenant's numbers describe the scanned window, not all history.
24318    pub scanned: i64,
24319}
24320
24321/// `TenantOverviewRunsRecentItem` model.
24322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24323pub struct TenantOverviewRunsRecentItem {
24324    pub run_id: String,
24325    pub agent_id: String,
24326    pub status: String,
24327    #[serde(default, skip_serializing_if = "Option::is_none")]
24328    pub created_at: Option<String>,
24329    #[serde(default, skip_serializing_if = "Option::is_none")]
24330    pub cost_usd: Option<f64>,
24331    #[serde(default, skip_serializing_if = "Option::is_none")]
24332    pub duration_ms: Option<i64>,
24333    /// The sentence a person reads, English on every deployment. Branch on `error_code`.
24334    #[serde(default, skip_serializing_if = "Option::is_none")]
24335    pub error: Option<String>,
24336    /// The failed run's code, passed through from the run record — a value from the `Error`
24337    /// schema's `code` enum. Absent when the failure carries nothing to branch on. This board is
24338    /// the only surface that renders a failed run's cause, and until 2026-09-21 it chose what to
24339    /// say by matching English in `error`.
24340    #[serde(default, skip_serializing_if = "Option::is_none")]
24341    pub error_code: Option<String>,
24342    /// Numbers the code cannot carry — `retry_after_ms`, `quota_exhausted`, `stale_seconds`. See
24343    /// `Run.error_details`.
24344    #[serde(default, skip_serializing_if = "Option::is_none")]
24345    pub error_details: Option<serde_json::Map<String, serde_json::Value>>,
24346    /// Passed through from the run record. Absent for platform-dispatched cloud runs; `bridge` is
24347    /// the only value the platform writes (run-dispatch.ts, bridge.ts); `async` only echoes what a
24348    /// client supplied at run creation and has never been stored on production (measured 2026-09-10
24349    /// over 8605 run records: absent 7738, bridge 867, async 0).
24350    #[serde(default, skip_serializing_if = "Option::is_none")]
24351    pub execution_mode: Option<RunExecutionMode>,
24352}
24353
24354/// `TenantOverviewSchedules` model.
24355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24356pub struct TenantOverviewSchedules {
24357    pub total: i64,
24358    /// Paused, errored, or carrying consecutive failures — a silently dead cron. Optional: absent
24359    /// when the server does not track it (no such field on v2's record); clients must tolerate
24360    /// absence. v1 serves it.
24361    #[serde(default, skip_serializing_if = "Option::is_none")]
24362    pub at_risk: Option<i64>,
24363    pub paused: i64,
24364}
24365
24366/// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24367/// health); clients must tolerate absence. v1 serves it.
24368#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24369pub struct TenantOverviewSystem {
24370    /// False when no cron job is registered — the signal that scheduled work has stopped.
24371    pub healthy: bool,
24372    pub kv: bool,
24373    pub workers_active: i64,
24374    pub workers_queued: i64,
24375    pub cron_registered: i64,
24376}
24377
24378/// Optional: absent when the server does not track it (v2 measures no cost, tokens or system
24379/// health); clients must tolerate absence. v1 serves it.
24380#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24381pub struct TenantOverviewUsage {
24382    pub tokens_used: i64,
24383    pub runs_used: i64,
24384    pub cost_mtd_usd: f64,
24385}
24386
24387/// `TenantPublicSettings` model.
24388#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24389pub struct TenantPublicSettings {
24390    #[serde(default, skip_serializing_if = "Option::is_none")]
24391    pub max_messages_per_session: Option<i64>,
24392    #[serde(default, skip_serializing_if = "Option::is_none")]
24393    pub max_tokens_per_session: Option<i64>,
24394    #[serde(default, skip_serializing_if = "Option::is_none")]
24395    pub allow_tool_calls: Option<bool>,
24396    #[serde(default, skip_serializing_if = "Option::is_none")]
24397    pub allow_file_uploads: Option<bool>,
24398    #[serde(default, skip_serializing_if = "Option::is_none")]
24399    pub rate_limit_per_ip_per_hour: Option<i64>,
24400    #[serde(default, skip_serializing_if = "Option::is_none")]
24401    pub require_auth: Option<bool>,
24402}
24403
24404/// Per-tenant overrides applied on top of the plan's quotas. Partial by nature: only the keys
24405/// actually overridden are present.
24406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24407pub struct TenantQuotaOverrides {
24408    #[serde(default, skip_serializing_if = "Option::is_none")]
24409    pub max_agents: Option<i64>,
24410    #[serde(default, skip_serializing_if = "Option::is_none")]
24411    pub max_teams: Option<i64>,
24412    #[serde(default, skip_serializing_if = "Option::is_none")]
24413    pub max_workers_per_team: Option<i64>,
24414    #[serde(default, skip_serializing_if = "Option::is_none")]
24415    pub max_concurrent_runs: Option<i64>,
24416    #[serde(default, skip_serializing_if = "Option::is_none")]
24417    pub max_concurrent_team_runs: Option<i64>,
24418    #[serde(default, skip_serializing_if = "Option::is_none")]
24419    pub max_active_sessions: Option<i64>,
24420    #[serde(default, skip_serializing_if = "Option::is_none")]
24421    pub max_monthly_tokens: Option<i64>,
24422    #[serde(default, skip_serializing_if = "Option::is_none")]
24423    pub max_monthly_tool_calls: Option<i64>,
24424    #[serde(default, skip_serializing_if = "Option::is_none")]
24425    pub max_monthly_runs: Option<i64>,
24426    #[serde(default, skip_serializing_if = "Option::is_none")]
24427    pub max_mcp_servers: Option<i64>,
24428    #[serde(default, skip_serializing_if = "Option::is_none")]
24429    pub max_storage_bytes: Option<i64>,
24430    #[serde(default, skip_serializing_if = "Option::is_none")]
24431    pub max_memory_entries_per_agent: Option<i64>,
24432    #[serde(default, skip_serializing_if = "Option::is_none")]
24433    pub max_memory_storage_bytes: Option<i64>,
24434    #[serde(default, skip_serializing_if = "Option::is_none")]
24435    pub max_agent_versions: Option<i64>,
24436    #[serde(default, skip_serializing_if = "Option::is_none")]
24437    pub max_knowledge_bases: Option<i64>,
24438    #[serde(default, skip_serializing_if = "Option::is_none")]
24439    pub max_workspaces: Option<i64>,
24440    #[serde(default, skip_serializing_if = "Option::is_none")]
24441    pub max_daily_tool_calls: Option<i64>,
24442    #[serde(default, skip_serializing_if = "Option::is_none")]
24443    pub max_monthly_images: Option<i64>,
24444    #[serde(default, skip_serializing_if = "Option::is_none")]
24445    pub max_daily_images: Option<i64>,
24446    #[serde(default, skip_serializing_if = "Option::is_none")]
24447    pub max_monthly_videos: Option<i64>,
24448}
24449
24450/// `TenantQuotas` model.
24451#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24452pub struct TenantQuotas {
24453    pub max_agents: i64,
24454    pub max_teams: i64,
24455    pub max_workers_per_team: i64,
24456    pub max_concurrent_runs: i64,
24457    pub max_concurrent_team_runs: i64,
24458    pub max_active_sessions: i64,
24459    pub max_monthly_tokens: i64,
24460    pub max_monthly_tool_calls: i64,
24461    pub max_monthly_runs: i64,
24462    pub max_mcp_servers: i64,
24463    pub max_storage_bytes: i64,
24464    pub max_memory_entries_per_agent: i64,
24465    pub max_memory_storage_bytes: i64,
24466    pub max_agent_versions: i64,
24467    pub max_knowledge_bases: i64,
24468    pub max_workspaces: i64,
24469    #[serde(default, skip_serializing_if = "Option::is_none")]
24470    pub max_daily_tool_calls: Option<i64>,
24471    #[serde(default, skip_serializing_if = "Option::is_none")]
24472    pub max_monthly_images: Option<i64>,
24473    #[serde(default, skip_serializing_if = "Option::is_none")]
24474    pub max_daily_images: Option<i64>,
24475    #[serde(default, skip_serializing_if = "Option::is_none")]
24476    pub max_monthly_videos: Option<i64>,
24477}
24478
24479/// REPLACES the stored object; it is not merged. A PATCH carrying one platform leaves the
24480/// tenant with that one platform and nothing else, so read-modify-write is the only safe shape
24481/// — send every link you want to keep, `custom` included.
24482///
24483/// Values are filtered, not rejected: a URL that does not match `^https?://.{3,500}$` is
24484/// dropped and the request still answers 200. Nothing is hidden by this — the response body
24485/// carries the tenant as STORED, so the saved `social_links` is in the answer and a second GET
24486/// is not needed to see what survived. Compare what you sent against what came back; a key
24487/// missing from the answer was refused.
24488///
24489/// Length is applied BEFORE the pattern, which matters: a url longer than 500 characters is CUT
24490/// to 500 and then matches, so it is stored TRUNCATED rather than refused — a different link
24491/// that still looks like one. Compare lengths too, not just presence. `custom` takes at most 5
24492/// entries, each with a label and a url; labels are stripped of angle brackets and cut to 50,
24493/// urls to 500, on the same before-validation order. Documented 2026-09-17 after the web lane
24494/// measured the filtering and could not find it described anywhere.
24495#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24496pub struct TenantSocialLinks {
24497    #[serde(default, skip_serializing_if = "Option::is_none")]
24498    pub website: Option<String>,
24499    #[serde(default, skip_serializing_if = "Option::is_none")]
24500    pub twitter: Option<String>,
24501    #[serde(default, skip_serializing_if = "Option::is_none")]
24502    pub github: Option<String>,
24503    #[serde(default, skip_serializing_if = "Option::is_none")]
24504    pub linkedin: Option<String>,
24505    #[serde(default, skip_serializing_if = "Option::is_none")]
24506    pub discord: Option<String>,
24507    #[serde(default, skip_serializing_if = "Option::is_none")]
24508    pub telegram: Option<String>,
24509    #[serde(default, skip_serializing_if = "Option::is_none")]
24510    pub youtube: Option<String>,
24511    #[serde(default, skip_serializing_if = "Option::is_none")]
24512    pub instagram: Option<String>,
24513    #[serde(default, skip_serializing_if = "Option::is_none")]
24514    pub facebook: Option<String>,
24515    #[serde(default, skip_serializing_if = "Option::is_none")]
24516    pub tiktok: Option<String>,
24517    #[serde(default, skip_serializing_if = "Option::is_none")]
24518    pub custom: Option<Vec<TenantSocialLinksCustomItem>>,
24519}
24520
24521/// `TenantSocialLinksCustomItem` model.
24522#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24523pub struct TenantSocialLinksCustomItem {
24524    pub label: String,
24525    pub url: String,
24526}
24527
24528/// `TenantStatus` enumeration.
24529#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
24530pub enum TenantStatus {
24531    #[default]
24532    #[serde(rename = "active")]
24533    Active,
24534    #[serde(rename = "suspended")]
24535    Suspended,
24536    #[serde(rename = "trial")]
24537    Trial,
24538    #[serde(rename = "deleted")]
24539    Deleted,
24540    #[serde(rename = "waitlisted")]
24541    Waitlisted,
24542    /// A value the API introduced after this SDK was generated.
24543    #[serde(untagged)]
24544    Other(String),
24545}
24546
24547impl TenantStatus {
24548    /// The value as it appears on the wire.
24549    pub fn as_str(&self) -> &str {
24550        match self {
24551            Self::Active => "active",
24552            Self::Suspended => "suspended",
24553            Self::Trial => "trial",
24554            Self::Deleted => "deleted",
24555            Self::Waitlisted => "waitlisted",
24556            Self::Other(value) => value.as_str(),
24557        }
24558    }
24559}
24560
24561impl std::fmt::Display for TenantStatus {
24562    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24563        f.write_str(self.as_str())
24564    }
24565}
24566
24567impl From<&str> for TenantStatus {
24568    fn from(value: &str) -> Self {
24569        match value {
24570            "active" => Self::Active,
24571            "suspended" => Self::Suspended,
24572            "trial" => Self::Trial,
24573            "deleted" => Self::Deleted,
24574            "waitlisted" => Self::Waitlisted,
24575            other => Self::Other(other.to_string()),
24576        }
24577    }
24578}
24579
24580/// `TenantTrial` model.
24581#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24582pub struct TenantTrial {
24583    pub active: bool,
24584    #[serde(default)]
24585    pub ends_at: Option<String>,
24586    pub days_left: i64,
24587    #[serde(default)]
24588    pub recommended_plan: Option<String>,
24589}
24590
24591/// `TenantUser` model.
24592#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24593pub struct TenantUser {
24594    #[serde(default, skip_serializing_if = "Option::is_none")]
24595    pub avatar_url: Option<String>,
24596    #[serde(default, skip_serializing_if = "Option::is_none")]
24597    pub last_login_at: Option<String>,
24598    #[serde(default, skip_serializing_if = "Option::is_none")]
24599    pub created_at: Option<String>,
24600    #[serde(default, skip_serializing_if = "Option::is_none")]
24601    pub email: Option<String>,
24602    #[serde(default, skip_serializing_if = "Option::is_none")]
24603    pub id: Option<String>,
24604    #[serde(default, skip_serializing_if = "Option::is_none")]
24605    pub name: Option<String>,
24606    #[serde(default, skip_serializing_if = "Option::is_none")]
24607    pub role: Option<String>,
24608    #[serde(default, skip_serializing_if = "Option::is_none")]
24609    pub status: Option<String>,
24610    #[serde(default, skip_serializing_if = "Option::is_none")]
24611    pub tenant_id: Option<String>,
24612    #[serde(default, skip_serializing_if = "Option::is_none")]
24613    pub updated_at: Option<String>,
24614}
24615
24616/// `TerminateAgentResponse` model.
24617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24618pub struct TerminateAgentResponse {
24619    #[serde(default, skip_serializing_if = "Option::is_none")]
24620    pub deleted: Option<bool>,
24621    #[serde(default, skip_serializing_if = "Option::is_none")]
24622    pub agent_id: Option<String>,
24623}
24624
24625/// `TestAdminSmtpConfigRequest` model.
24626#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24627pub struct TestAdminSmtpConfigRequest {
24628    pub to: String,
24629}
24630
24631/// `TestAdminSmtpConfigResponse` model.
24632#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24633pub struct TestAdminSmtpConfigResponse {
24634    pub ok: bool,
24635    pub sent_to: String,
24636}
24637
24638/// `TestAdminStripeConfigResponseVariant1` model.
24639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24640pub struct TestAdminStripeConfigResponseVariant1 {
24641    pub ok: bool,
24642    /// The Stripe account (`acct_…`) the key belongs to — the one fact that says which company
24643    /// receives the money.
24644    pub account_id: String,
24645    /// Whether the key is a live one — derived from the key prefix (`sk_live_`/`rk_live_`), because
24646    /// Stripe's Account object carries no `livemode`; until 2026-09-11 the field was absent and the
24647    /// panel showed TEST for a live key.
24648    pub livemode: bool,
24649    #[serde(default, skip_serializing_if = "Option::is_none")]
24650    pub business_name: Option<String>,
24651    pub country: String,
24652    pub default_currency: String,
24653    /// Whether the billing manager that serves checkout and the portal holds the same key as the
24654    /// one stored here. Until 2026-09-11 this check read the stored key on its own and could say
24655    /// LIVE while the running manager still held the environment's key of the previous company —
24656    /// green in the panel, "No such price" at checkout.
24657    pub active_key_matches: bool,
24658    /// Only when `active_key_matches` is false: what to do (save the panel, which rebuilds the
24659    /// manager from the stored key; boot does the same since 2026-09-11).
24660    #[serde(default, skip_serializing_if = "Option::is_none")]
24661    pub warning: Option<String>,
24662}
24663
24664/// `TestAdminStripeConfigResponseVariant2` model.
24665#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24666pub struct TestAdminStripeConfigResponseVariant2 {
24667    pub ok: bool,
24668    pub error: String,
24669    /// Stripe's HTTP status, when it answered.
24670    #[serde(default, skip_serializing_if = "Option::is_none")]
24671    pub status: Option<i64>,
24672}
24673
24674/// `TestAgentIntegrationResponse` model.
24675#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24676pub struct TestAgentIntegrationResponse {
24677    /// False when the connector could not reach the remote or the credentials were refused. This is
24678    /// the only field that says so; the status will be 200 either way.
24679    pub success: bool,
24680    /// Why it failed. Absent on success.
24681    #[serde(default, skip_serializing_if = "Option::is_none")]
24682    pub message: Option<String>,
24683}
24684
24685/// `TestIntegrationResponse` model.
24686#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24687pub struct TestIntegrationResponse {
24688    #[serde(default, skip_serializing_if = "Option::is_none")]
24689    pub success: Option<bool>,
24690    #[serde(default, skip_serializing_if = "Option::is_none")]
24691    pub message: Option<String>,
24692}
24693
24694/// `TestLLMProviderKeyResponse` model.
24695#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24696pub struct TestLLMProviderKeyResponse {
24697    /// False when the connector could not reach the remote or the credentials were refused. This is
24698    /// the only field that says so; the status will be 200 either way.
24699    pub success: bool,
24700    /// Why it failed. Absent on success.
24701    #[serde(default, skip_serializing_if = "Option::is_none")]
24702    pub message: Option<String>,
24703}
24704
24705/// `TestNotificationTargetResponse` model.
24706#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24707pub struct TestNotificationTargetResponse {
24708    pub ok: bool,
24709    pub message: String,
24710}
24711
24712/// `TestWebhookResponse` model.
24713#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24714pub struct TestWebhookResponse {
24715    pub test_sent: bool,
24716    pub webhook_id: String,
24717    /// The subscription's first configured event, or `run.completed` when it has none.
24718    pub event_type: String,
24719}
24720
24721/// `Todo` model.
24722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24723pub struct Todo {
24724    pub todo_id: String,
24725    pub session_id: String,
24726    pub tenant_id: String,
24727    pub title: String,
24728    #[serde(default, skip_serializing_if = "Option::is_none")]
24729    pub instructions: Option<String>,
24730    #[serde(default, skip_serializing_if = "Option::is_none")]
24731    pub due_at: Option<String>,
24732    #[serde(default, skip_serializing_if = "Option::is_none")]
24733    pub assign_agent_id: Option<String>,
24734    #[serde(default, skip_serializing_if = "Option::is_none")]
24735    pub assign_team_id: Option<String>,
24736    pub status: TodoStatus,
24737    pub created_at: String,
24738    pub updated_at: String,
24739    #[serde(default, skip_serializing_if = "Option::is_none")]
24740    pub run_id: Option<String>,
24741    #[serde(default, skip_serializing_if = "Option::is_none")]
24742    pub team_run_id: Option<String>,
24743    #[serde(default, skip_serializing_if = "Option::is_none")]
24744    pub recurrence: Option<TodoRecurrence>,
24745    #[serde(default, skip_serializing_if = "Option::is_none")]
24746    pub next_fire_at: Option<String>,
24747    #[serde(default, skip_serializing_if = "Option::is_none")]
24748    pub last_fired_at: Option<String>,
24749    #[serde(default, skip_serializing_if = "Option::is_none")]
24750    pub last_run_status: Option<String>,
24751    #[serde(default, skip_serializing_if = "Option::is_none")]
24752    pub require_confirmation: Option<bool>,
24753    #[serde(default, skip_serializing_if = "Option::is_none")]
24754    pub delivery: Option<TodoDelivery>,
24755    #[serde(default, skip_serializing_if = "Option::is_none")]
24756    pub order_index: Option<i64>,
24757    #[serde(default, skip_serializing_if = "Option::is_none")]
24758    pub parent_task_id: Option<String>,
24759    /// Present only on the session-scoped list; absent from GET /todos.
24760    #[serde(default, skip_serializing_if = "Option::is_none")]
24761    pub agent_name: Option<String>,
24762}
24763
24764/// `TodoDelivery` model.
24765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24766pub struct TodoDelivery {
24767    pub channels: Vec<TodoDeliveryChannel>,
24768    #[serde(default, skip_serializing_if = "Option::is_none")]
24769    pub target: Option<String>,
24770}
24771
24772/// `TodoDeliveryChannel` enumeration.
24773#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
24774pub enum TodoDeliveryChannel {
24775    #[default]
24776    #[serde(rename = "email")]
24777    Email,
24778    #[serde(rename = "telegram")]
24779    Telegram,
24780    #[serde(rename = "whatsapp")]
24781    Whatsapp,
24782    /// A value the API introduced after this SDK was generated.
24783    #[serde(untagged)]
24784    Other(String),
24785}
24786
24787impl TodoDeliveryChannel {
24788    /// The value as it appears on the wire.
24789    pub fn as_str(&self) -> &str {
24790        match self {
24791            Self::Email => "email",
24792            Self::Telegram => "telegram",
24793            Self::Whatsapp => "whatsapp",
24794            Self::Other(value) => value.as_str(),
24795        }
24796    }
24797}
24798
24799impl std::fmt::Display for TodoDeliveryChannel {
24800    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24801        f.write_str(self.as_str())
24802    }
24803}
24804
24805impl From<&str> for TodoDeliveryChannel {
24806    fn from(value: &str) -> Self {
24807        match value {
24808            "email" => Self::Email,
24809            "telegram" => Self::Telegram,
24810            "whatsapp" => Self::Whatsapp,
24811            other => Self::Other(other.to_string()),
24812        }
24813    }
24814}
24815
24816/// `TodoRecurrence` model.
24817#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24818pub struct TodoRecurrence {
24819    pub cron: String,
24820    #[serde(default, skip_serializing_if = "Option::is_none")]
24821    pub timezone: Option<String>,
24822}
24823
24824/// `TodoStatus` enumeration.
24825#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
24826pub enum TodoStatus {
24827    #[default]
24828    #[serde(rename = "pending")]
24829    Pending,
24830    #[serde(rename = "pending_confirmation")]
24831    PendingConfirmation,
24832    #[serde(rename = "in_progress")]
24833    InProgress,
24834    #[serde(rename = "done")]
24835    Done,
24836    #[serde(rename = "cancelled")]
24837    Cancelled,
24838    /// A value the API introduced after this SDK was generated.
24839    #[serde(untagged)]
24840    Other(String),
24841}
24842
24843impl TodoStatus {
24844    /// The value as it appears on the wire.
24845    pub fn as_str(&self) -> &str {
24846        match self {
24847            Self::Pending => "pending",
24848            Self::PendingConfirmation => "pending_confirmation",
24849            Self::InProgress => "in_progress",
24850            Self::Done => "done",
24851            Self::Cancelled => "cancelled",
24852            Self::Other(value) => value.as_str(),
24853        }
24854    }
24855}
24856
24857impl std::fmt::Display for TodoStatus {
24858    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24859        f.write_str(self.as_str())
24860    }
24861}
24862
24863impl From<&str> for TodoStatus {
24864    fn from(value: &str) -> Self {
24865        match value {
24866            "pending" => Self::Pending,
24867            "pending_confirmation" => Self::PendingConfirmation,
24868            "in_progress" => Self::InProgress,
24869            "done" => Self::Done,
24870            "cancelled" => Self::Cancelled,
24871            other => Self::Other(other.to_string()),
24872        }
24873    }
24874}
24875
24876/// `ToolBreakdownEntry` model.
24877#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24878pub struct ToolBreakdownEntry {
24879    pub name: String,
24880    pub count: i64,
24881}
24882
24883/// `ToolOverride` model.
24884#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24885pub struct ToolOverride {
24886    #[serde(default, skip_serializing_if = "Option::is_none")]
24887    pub category: Option<String>,
24888    #[serde(default, skip_serializing_if = "Option::is_none")]
24889    pub description: Option<String>,
24890    /// Hides the catalogue row. Presentation only — the runtime still serves the tool. Stored only
24891    /// when true.
24892    #[serde(default, skip_serializing_if = "Option::is_none")]
24893    pub hidden: Option<bool>,
24894}
24895
24896/// agent-versioning.ts TrafficSplitEntry; weights sum to 100.
24897#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24898pub struct TrafficSplitEntry {
24899    pub version: i64,
24900    pub weight: f64,
24901}
24902
24903/// `TransferTenantOwnershipResponse` model.
24904#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24905pub struct TransferTenantOwnershipResponse {
24906    pub transferred: bool,
24907    pub new_owner: String,
24908    pub previous_owner: String,
24909}
24910
24911/// persistence/workspace-store.ts TrashManifestEntry — read back from .trash/_manifest.json as
24912/// written.
24913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24914pub struct TrashManifestEntry {
24915    pub trash_path: String,
24916    pub original_path: String,
24917    pub original_workspace_id: String,
24918    pub original_agent_id: String,
24919    pub trashed_by: String,
24920    pub trashed_at: String,
24921    #[serde(default, skip_serializing_if = "Option::is_none")]
24922    pub reason: Option<String>,
24923}
24924
24925/// Exactly one of the three. The handler trims each and acts on the first non-empty one.
24926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24927pub struct UnassignWorkspaceRequest {
24928    #[serde(default, skip_serializing_if = "Option::is_none")]
24929    pub agent_id: Option<String>,
24930    #[serde(default, skip_serializing_if = "Option::is_none")]
24931    pub team_id: Option<String>,
24932    #[serde(default, skip_serializing_if = "Option::is_none")]
24933    pub company_id: Option<String>,
24934}
24935
24936/// `UnlinkAuthProviderResponse` model.
24937#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24938pub struct UnlinkAuthProviderResponse {
24939    pub ok: bool,
24940    pub provider: String,
24941    #[serde(default, skip_serializing_if = "Option::is_none")]
24942    pub remaining_factors: Option<i64>,
24943    #[serde(default, skip_serializing_if = "Option::is_none")]
24944    pub already_unlinked: Option<bool>,
24945}
24946
24947/// `UnscheduleCanvasWorkflowResponse` model.
24948#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24949pub struct UnscheduleCanvasWorkflowResponse {
24950    pub trigger_id: String,
24951    pub status: UnscheduleCanvasWorkflowResponseStatus,
24952}
24953
24954/// `UnscheduleCanvasWorkflowResponseStatus` enumeration.
24955#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
24956pub enum UnscheduleCanvasWorkflowResponseStatus {
24957    #[default]
24958    #[serde(rename = "removed")]
24959    Removed,
24960    /// A value the API introduced after this SDK was generated.
24961    #[serde(untagged)]
24962    Other(String),
24963}
24964
24965impl UnscheduleCanvasWorkflowResponseStatus {
24966    /// The value as it appears on the wire.
24967    pub fn as_str(&self) -> &str {
24968        match self {
24969            Self::Removed => "removed",
24970            Self::Other(value) => value.as_str(),
24971        }
24972    }
24973}
24974
24975impl std::fmt::Display for UnscheduleCanvasWorkflowResponseStatus {
24976    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24977        f.write_str(self.as_str())
24978    }
24979}
24980
24981impl From<&str> for UnscheduleCanvasWorkflowResponseStatus {
24982    fn from(value: &str) -> Self {
24983        match value {
24984            "removed" => Self::Removed,
24985            other => Self::Other(other.to_string()),
24986        }
24987    }
24988}
24989
24990/// `UnsubscribeFromListingResponse` model.
24991#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24992pub struct UnsubscribeFromListingResponse {
24993    #[serde(default, skip_serializing_if = "Option::is_none")]
24994    pub unsubscribed: Option<bool>,
24995    #[serde(default, skip_serializing_if = "Option::is_none")]
24996    pub listing_id: Option<String>,
24997}
24998
24999/// `UnsuspendUserResponse` model.
25000#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25001pub struct UnsuspendUserResponse {
25002    pub unsuspended: bool,
25003    pub user_id: String,
25004}
25005
25006/// `UpdateACPSessionResponse` model.
25007#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25008pub struct UpdateACPSessionResponse {
25009    pub saved: bool,
25010    /// Deprecated spelling of `session_id` — the same value, kept for the compatibility window and
25011    /// removed in the next breaking release (the one that moves `X-API-Version`). Read
25012    /// `session_id`.
25013    #[serde(rename = "sessionId")]
25014    pub session_id: String,
25015    #[serde(rename = "session_id")]
25016    pub session_id_: String,
25017}
25018
25019/// `UpdateAdminAgentMemoryConfigResponse` model.
25020#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25021pub struct UpdateAdminAgentMemoryConfigResponse {
25022    pub agent_memory: UpdateAdminAgentMemoryConfigResponseAgentMemory,
25023    pub updated: bool,
25024}
25025
25026/// `UpdateAdminAgentMemoryConfigResponseAgentMemory` model.
25027#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25028pub struct UpdateAdminAgentMemoryConfigResponseAgentMemory {
25029    pub enabled: bool,
25030    pub use_shared_store: bool,
25031    pub default_max_entries: i64,
25032    pub default_retrieval_limit: i64,
25033    pub default_retrieval_strategy: String,
25034    pub decay_enabled: bool,
25035    pub decay_half_life_days: i64,
25036    pub decay_job_interval_ms: i64,
25037    pub extraction_max_tokens: i64,
25038    pub extraction_model: String,
25039    pub eviction_threshold: i64,
25040    pub embedding_dimensions: i64,
25041    pub embedding_provider: String,
25042    pub embedding_model: String,
25043    pub compression_model: String,
25044}
25045
25046/// `UpdateAdminAuthConfigResponse` model.
25047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25048pub struct UpdateAdminAuthConfigResponse {
25049    pub auth: UpdateAdminAuthConfigResponseAuth,
25050    pub updated: bool,
25051}
25052
25053/// `UpdateAdminAuthConfigResponseAuth` model.
25054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25055pub struct UpdateAdminAuthConfigResponseAuth {
25056    pub super_admin_email: String,
25057    pub otp_ttl_ms: i64,
25058    pub verification_ttl_ms: i64,
25059    pub jwks_cache_ttl_ms: i64,
25060    pub jwks_grace_ttl_ms: i64,
25061    pub api_key_cache_ttl_s: i64,
25062    pub api_key_rotation_grace_period_h: i64,
25063}
25064
25065/// `UpdateAdminBackpressureConfigResponse` model.
25066#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25067pub struct UpdateAdminBackpressureConfigResponse {
25068    pub backpressure: UpdateAdminBackpressureConfigResponseBackpressure,
25069    pub updated: bool,
25070}
25071
25072/// `UpdateAdminBackpressureConfigResponseBackpressure` model.
25073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25074pub struct UpdateAdminBackpressureConfigResponseBackpressure {
25075    pub sse_buffer_max: i64,
25076    pub sse_high_watermark: i64,
25077    pub sse_low_watermark: i64,
25078    pub tool_queue_max_depth: i64,
25079    pub tool_queue_high_watermark: i64,
25080}
25081
25082/// `UpdateAdminBlogConfigRequest` model.
25083#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25084pub struct UpdateAdminBlogConfigRequest {
25085    #[serde(default, skip_serializing_if = "Option::is_none")]
25086    pub enabled: Option<bool>,
25087    #[serde(default, skip_serializing_if = "Option::is_none")]
25088    pub title: Option<String>,
25089    #[serde(default, skip_serializing_if = "Option::is_none")]
25090    pub description: Option<String>,
25091    /// Null detaches the author and clears the pinned tenant.
25092    #[serde(default, skip_serializing_if = "Option::is_none")]
25093    pub agent_id: Option<String>,
25094    /// `manual` never auto-generates.
25095    #[serde(default, skip_serializing_if = "Option::is_none")]
25096    pub frequency: Option<BlogConfigFrequency>,
25097    #[serde(default, skip_serializing_if = "Option::is_none")]
25098    pub schedule_hour: Option<i64>,
25099    /// 0 = Sunday, UTC.
25100    #[serde(default, skip_serializing_if = "Option::is_none")]
25101    pub schedule_weekday: Option<i64>,
25102    #[serde(default, skip_serializing_if = "Option::is_none")]
25103    pub topic_prompt: Option<String>,
25104    #[serde(default, skip_serializing_if = "Option::is_none")]
25105    pub conditions: Option<String>,
25106    #[serde(default, skip_serializing_if = "Option::is_none")]
25107    pub auto_publish: Option<bool>,
25108}
25109
25110/// `UpdateAdminBlogConfigResponse` model.
25111#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25112pub struct UpdateAdminBlogConfigResponse {
25113    pub config: BlogConfig,
25114}
25115
25116/// `UpdateAdminBlogPostRequest` model.
25117#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25118pub struct UpdateAdminBlogPostRequest {
25119    #[serde(default, skip_serializing_if = "Option::is_none")]
25120    pub title: Option<String>,
25121    #[serde(default, skip_serializing_if = "Option::is_none")]
25122    pub body: Option<String>,
25123    #[serde(default, skip_serializing_if = "Option::is_none")]
25124    pub tags: Option<Vec<String>>,
25125    #[serde(default, skip_serializing_if = "Option::is_none")]
25126    pub status: Option<BlogPostStatus>,
25127}
25128
25129/// `UpdateAdminBlogPostResponse` model.
25130#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25131pub struct UpdateAdminBlogPostResponse {
25132    pub post: BlogPost,
25133}
25134
25135/// `UpdateAdminCodeInterpreterConfigResponse` model.
25136#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25137pub struct UpdateAdminCodeInterpreterConfigResponse {
25138    pub code_interpreter: UpdateAdminCodeInterpreterConfigResponseCodeInterpreter,
25139    pub updated: bool,
25140}
25141
25142/// `UpdateAdminCodeInterpreterConfigResponseCodeInterpreter` model.
25143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25144pub struct UpdateAdminCodeInterpreterConfigResponseCodeInterpreter {
25145    pub isolation: String,
25146    #[serde(default, skip_serializing_if = "Option::is_none")]
25147    pub timeout_ms: Option<i64>,
25148    #[serde(default, skip_serializing_if = "Option::is_none")]
25149    pub max_memory_mb: Option<i64>,
25150    #[serde(default, skip_serializing_if = "Option::is_none")]
25151    pub container_image: Option<String>,
25152    #[serde(default, skip_serializing_if = "Option::is_none")]
25153    pub python_container_image: Option<String>,
25154    #[serde(default, skip_serializing_if = "Option::is_none")]
25155    pub python_sandbox_host_dir: Option<String>,
25156}
25157
25158/// `UpdateAdminDisabledToolsResponse` model.
25159#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25160pub struct UpdateAdminDisabledToolsResponse {
25161    pub ok: bool,
25162    pub disabled_tools: Vec<String>,
25163}
25164
25165/// `UpdateAdminEvaluationConfigResponse` model.
25166#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25167pub struct UpdateAdminEvaluationConfigResponse {
25168    pub evaluation: UpdateAdminEvaluationConfigResponseEvaluation,
25169    pub updated: bool,
25170}
25171
25172/// `UpdateAdminEvaluationConfigResponseEvaluation` model.
25173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25174pub struct UpdateAdminEvaluationConfigResponseEvaluation {
25175    pub enabled: bool,
25176    pub max_concurrent_eval_cases: i64,
25177    pub regression_threshold: f64,
25178    pub default_scorers: Vec<String>,
25179    pub max_cases_per_dataset: i64,
25180    pub eval_run_timeout_ms: i64,
25181    pub auto_rollback_enabled: bool,
25182}
25183
25184/// `UpdateAdminFounderConfigRequest` model.
25185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25186pub struct UpdateAdminFounderConfigRequest {
25187    #[serde(default, skip_serializing_if = "Option::is_none")]
25188    pub founder_id: Option<String>,
25189    #[serde(default, skip_serializing_if = "Option::is_none")]
25190    pub founder_name: Option<String>,
25191    #[serde(default, skip_serializing_if = "Option::is_none")]
25192    pub founder_public_key: Option<String>,
25193}
25194
25195/// `UpdateAdminGuardrailsResponse` model.
25196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25197pub struct UpdateAdminGuardrailsResponse {
25198    #[serde(default, skip_serializing_if = "Option::is_none")]
25199    pub guardrails: Option<Vec<GuardrailConfigItem>>,
25200    pub updated: bool,
25201}
25202
25203/// `UpdateAdminIdempotencyConfigResponse` model.
25204#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25205pub struct UpdateAdminIdempotencyConfigResponse {
25206    pub idempotency: UpdateAdminIdempotencyConfigResponseIdempotency,
25207    pub updated: bool,
25208}
25209
25210/// `UpdateAdminIdempotencyConfigResponseIdempotency` model.
25211#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25212pub struct UpdateAdminIdempotencyConfigResponseIdempotency {
25213    pub enabled: bool,
25214    pub ttl_hours: i64,
25215    pub max_response_cache_bytes: i64,
25216}
25217
25218/// `UpdateAdminIntegrationsResponse` model.
25219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25220pub struct UpdateAdminIntegrationsResponse {
25221    pub integrations: Vec<UpdateAdminIntegrationsResponseIntegration>,
25222    pub updated: bool,
25223}
25224
25225/// `UpdateAdminIntegrationsResponseIntegration` model.
25226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25227pub struct UpdateAdminIntegrationsResponseIntegration {
25228    pub id: String,
25229    pub name: String,
25230    #[serde(default, skip_serializing_if = "Option::is_none")]
25231    pub icon: Option<String>,
25232    #[serde(default, skip_serializing_if = "Option::is_none")]
25233    pub auth_type: Option<AdminIntegrationsConfigIntegrationAuthType>,
25234    #[serde(default, skip_serializing_if = "Option::is_none")]
25235    pub category: Option<String>,
25236    pub enabled: bool,
25237    #[serde(default, skip_serializing_if = "Option::is_none")]
25238    pub beta: Option<bool>,
25239    /// `kv` when an operator overrode the shipped default, `default` otherwise.
25240    #[serde(default, skip_serializing_if = "Option::is_none")]
25241    pub source: Option<String>,
25242}
25243
25244/// `UpdateAdminLLMAdaptersConfigResponse` model.
25245#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25246pub struct UpdateAdminLLMAdaptersConfigResponse {
25247    pub llm_adapters: UpdateAdminLLMAdaptersConfigResponseLLMAdapters,
25248    pub updated: bool,
25249}
25250
25251/// `UpdateAdminLLMAdaptersConfigResponseLLMAdapters` model.
25252#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25253pub struct UpdateAdminLLMAdaptersConfigResponseLLMAdapters {
25254    #[serde(default, skip_serializing_if = "Option::is_none")]
25255    pub max_retries: Option<i64>,
25256    #[serde(default, skip_serializing_if = "Option::is_none")]
25257    pub retry_base_delay_ms: Option<i64>,
25258    #[serde(default, skip_serializing_if = "Option::is_none")]
25259    pub retry_max_delay_ms: Option<i64>,
25260    #[serde(default, skip_serializing_if = "Option::is_none")]
25261    pub stream_empty_timeout_ms: Option<i64>,
25262    #[serde(default, skip_serializing_if = "Option::is_none")]
25263    pub circuit_breaker: Option<UpdateAdminLLMAdaptersConfigResponseLLMAdaptersCircuitBreaker>,
25264    #[serde(default, skip_serializing_if = "Option::is_none")]
25265    pub provider_rate_limits: Option<serde_json::Map<String, serde_json::Value>>,
25266}
25267
25268/// `UpdateAdminLLMAdaptersConfigResponseLLMAdaptersCircuitBreaker` model.
25269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25270pub struct UpdateAdminLLMAdaptersConfigResponseLLMAdaptersCircuitBreaker {
25271    #[serde(default, skip_serializing_if = "Option::is_none")]
25272    pub failure_threshold: Option<i64>,
25273    #[serde(default, skip_serializing_if = "Option::is_none")]
25274    pub reset_timeout_ms: Option<i64>,
25275    #[serde(default, skip_serializing_if = "Option::is_none")]
25276    pub half_open_max_requests: Option<i64>,
25277}
25278
25279/// `UpdateAdminLoggingConfigResponse` model.
25280#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25281pub struct UpdateAdminLoggingConfigResponse {
25282    pub logging: UpdateAdminLoggingConfigResponseLogging,
25283    pub updated: bool,
25284}
25285
25286/// `UpdateAdminLoggingConfigResponseLogging` model.
25287#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25288pub struct UpdateAdminLoggingConfigResponseLogging {
25289    pub pii_mode: String,
25290    pub log_agent_responses: bool,
25291    pub file_enabled: bool,
25292    pub file_max_size_mb: i64,
25293    pub file_retention_days: i64,
25294    pub file_level: String,
25295    pub file_separate_error: bool,
25296    pub activity_log_verbosity: String,
25297}
25298
25299/// `UpdateAdminLongRunningConfigResponse` model.
25300#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25301pub struct UpdateAdminLongRunningConfigResponse {
25302    pub long_running: UpdateAdminLongRunningConfigResponseLongRunning,
25303    pub updated: bool,
25304}
25305
25306/// `UpdateAdminLongRunningConfigResponseLongRunning` model.
25307#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25308pub struct UpdateAdminLongRunningConfigResponseLongRunning {
25309    pub enabled: bool,
25310    pub max_duration_ms: i64,
25311    pub checkpoint_interval_ms: i64,
25312    pub idle_timeout_ms: i64,
25313    pub continuation_token_ttl_days: i64,
25314    pub max_background_runs_per_tenant: i64,
25315}
25316
25317/// `UpdateAdminMCPConfigResponse` model.
25318#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25319pub struct UpdateAdminMCPConfigResponse {
25320    pub mcp: UpdateAdminMCPConfigResponseMCP,
25321    pub updated: bool,
25322}
25323
25324/// `UpdateAdminMCPConfigResponseMCP` model.
25325#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25326pub struct UpdateAdminMCPConfigResponseMCP {
25327    pub max_sessions_per_server: i64,
25328    pub max_total_stdio_sessions: i64,
25329    pub session_idle_timeout_ms: i64,
25330}
25331
25332/// `UpdateAdminMultimodalConfigResponse` model.
25333#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25334pub struct UpdateAdminMultimodalConfigResponse {
25335    pub multimodal: UpdateAdminMultimodalConfigResponseMultimodal,
25336    pub updated: bool,
25337}
25338
25339/// `UpdateAdminMultimodalConfigResponseMultimodal` model.
25340#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25341pub struct UpdateAdminMultimodalConfigResponseMultimodal {
25342    pub enabled: bool,
25343    pub max_image_size_bytes: i64,
25344    pub max_audio_duration_s: i64,
25345    pub max_video_duration_s: i64,
25346    pub auto_resize_images: bool,
25347    pub supported_image_formats: Vec<String>,
25348    pub supported_audio_formats: Vec<String>,
25349}
25350
25351/// `UpdateAdminOAuthIdentityConfigRequest` model.
25352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25353pub struct UpdateAdminOAuthIdentityConfigRequest {
25354    #[serde(default, skip_serializing_if = "Option::is_none")]
25355    pub apple_services_id: Option<String>,
25356    #[serde(default, skip_serializing_if = "Option::is_none")]
25357    pub apple_team_id: Option<String>,
25358    #[serde(default, skip_serializing_if = "Option::is_none")]
25359    pub apple_bundle_id: Option<String>,
25360    #[serde(default, skip_serializing_if = "Option::is_none")]
25361    pub oauth_return_to_hosts: Option<Vec<String>>,
25362}
25363
25364/// `UpdateAdminPersistenceConfigResponse` model.
25365#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25366pub struct UpdateAdminPersistenceConfigResponse {
25367    pub persistence: UpdateAdminPersistenceConfigResponsePersistence,
25368    pub updated: bool,
25369}
25370
25371/// `UpdateAdminPersistenceConfigResponsePersistence` model.
25372#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25373pub struct UpdateAdminPersistenceConfigResponsePersistence {
25374    pub snapshot_every_n_events: i64,
25375    pub checkpoint_after_tool_calls: bool,
25376    pub usage_shards: i64,
25377    pub auto_cap_kv_values: bool,
25378}
25379
25380/// `UpdateAdminPlansRequest` model.
25381#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25382pub struct UpdateAdminPlansRequest {
25383    #[serde(default, skip_serializing_if = "Option::is_none")]
25384    pub plans: Option<serde_json::Map<String, serde_json::Value>>,
25385}
25386
25387/// `UpdateAdminPlansResponse` model.
25388#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25389pub struct UpdateAdminPlansResponse {
25390    #[serde(default, skip_serializing_if = "Option::is_none")]
25391    pub plans: Option<serde_json::Map<String, serde_json::Value>>,
25392    #[serde(default, skip_serializing_if = "Option::is_none")]
25393    pub updated: Option<bool>,
25394}
25395
25396/// `UpdateAdminPricingResponse` model.
25397#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25398pub struct UpdateAdminPricingResponse {
25399    pub pricing: UpdateAdminPricingResponsePricing,
25400    pub updated: bool,
25401}
25402
25403/// `UpdateAdminPricingResponsePricing` model.
25404#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25405pub struct UpdateAdminPricingResponsePricing {
25406    pub openai_compat_input: f64,
25407    pub openai_compat_output: f64,
25408    pub anthropic_input: i64,
25409    pub anthropic_output: f64,
25410    pub anthropic_thinking: f64,
25411}
25412
25413/// `UpdateAdminProviderResponse` model.
25414#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25415pub struct UpdateAdminProviderResponse {
25416    pub id: String,
25417    pub enabled: bool,
25418    pub model_allowlist: Vec<String>,
25419}
25420
25421/// `UpdateAdminRegistrationConfigRequest` model.
25422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25423pub struct UpdateAdminRegistrationConfigRequest {
25424    #[serde(default, skip_serializing_if = "Option::is_none")]
25425    pub registration_open: Option<bool>,
25426    /// Required alongside `registration_open: true` when registration is currently closed. Ignored
25427    /// otherwise.
25428    #[serde(default, skip_serializing_if = "Option::is_none")]
25429    pub confirm_open: Option<bool>,
25430    #[serde(default, skip_serializing_if = "Option::is_none")]
25431    pub default_signup_plan: Option<String>,
25432    #[serde(default, skip_serializing_if = "Option::is_none")]
25433    pub allowed_email_domains: Option<Vec<String>>,
25434}
25435
25436/// `UpdateAdminRetentionConfigResponse` model.
25437#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25438pub struct UpdateAdminRetentionConfigResponse {
25439    pub retention: UpdateAdminRetentionConfigResponseRetention,
25440    pub updated: bool,
25441}
25442
25443/// `UpdateAdminRetentionConfigResponseRetention` model.
25444#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25445pub struct UpdateAdminRetentionConfigResponseRetention {
25446    pub completed_run_ttl_days: i64,
25447    pub event_ttl_days: i64,
25448    pub archive_to_sqlite: bool,
25449    pub audit_log_ttl_days: i64,
25450    pub archive_job_interval_ms: i64,
25451    pub archive_batch_size: i64,
25452    pub feed_ttl_days: i64,
25453    pub artifact_ttl_days: i64,
25454    /// Notification retention in days. 0 (the default) means no expiry. Applies to rows written
25455    /// after the setting changes.
25456    #[serde(default, skip_serializing_if = "Option::is_none")]
25457    pub notification_ttl_days: Option<i64>,
25458    pub checkpoint_ttl_hours: i64,
25459}
25460
25461/// `UpdateAdminRunCommandConfigResponse` model.
25462#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25463pub struct UpdateAdminRunCommandConfigResponse {
25464    pub run_command: UpdateAdminRunCommandConfigResponseRunCommand,
25465    pub updated: bool,
25466}
25467
25468/// `UpdateAdminRunCommandConfigResponseRunCommand` model.
25469#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25470pub struct UpdateAdminRunCommandConfigResponseRunCommand {
25471    pub enabled: bool,
25472    pub isolation: String,
25473    pub timeout_ms: i64,
25474    pub max_output_bytes: i64,
25475    pub allowed_commands: Vec<String>,
25476    pub deno_allow: Vec<String>,
25477}
25478
25479/// `UpdateAdminServerConfigResponse` model.
25480#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25481pub struct UpdateAdminServerConfigResponse {
25482    pub server: UpdateAdminServerConfigResponseServer,
25483    pub updated: bool,
25484}
25485
25486/// `UpdateAdminServerConfigResponseServer` model.
25487#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25488pub struct UpdateAdminServerConfigResponseServer {
25489    pub trust_proxy: bool,
25490    pub max_body_bytes: i64,
25491    #[serde(default, skip_serializing_if = "Option::is_none")]
25492    pub graceful_shutdown_timeout_ms: Option<i64>,
25493}
25494
25495/// `UpdateAdminSetupStateRequest` model.
25496#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25497pub struct UpdateAdminSetupStateRequest {
25498    /// Unioned with what is stored. Unknown ids are rejected.
25499    #[serde(default, skip_serializing_if = "Option::is_none")]
25500    pub completed_steps: Option<Vec<UpdateAdminSetupStateRequestCompletedStep>>,
25501    #[serde(default, skip_serializing_if = "Option::is_none")]
25502    pub registration_open: Option<bool>,
25503    /// Required alongside `registration_open: true` when registration is currently closed.
25504    #[serde(default, skip_serializing_if = "Option::is_none")]
25505    pub confirm_open: Option<bool>,
25506}
25507
25508/// `UpdateAdminSetupStateRequestCompletedStep` enumeration.
25509#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
25510pub enum UpdateAdminSetupStateRequestCompletedStep {
25511    #[default]
25512    #[serde(rename = "super_admin_login")]
25513    SuperAdminLogin,
25514    #[serde(rename = "platform_identity")]
25515    PlatformIdentity,
25516    #[serde(rename = "public_url")]
25517    PublicURL,
25518    #[serde(rename = "llm_provider")]
25519    LLMProvider,
25520    #[serde(rename = "registration_open")]
25521    RegistrationOpen,
25522    #[serde(rename = "smtp")]
25523    Smtp,
25524    #[serde(rename = "oauth_login")]
25525    OauthLogin,
25526    #[serde(rename = "stripe")]
25527    Stripe,
25528    #[serde(rename = "spec_seed")]
25529    SpecSeed,
25530    #[serde(rename = "custom_domain")]
25531    CustomDomain,
25532    #[serde(rename = "integrations")]
25533    Integrations,
25534    /// A value the API introduced after this SDK was generated.
25535    #[serde(untagged)]
25536    Other(String),
25537}
25538
25539impl UpdateAdminSetupStateRequestCompletedStep {
25540    /// The value as it appears on the wire.
25541    pub fn as_str(&self) -> &str {
25542        match self {
25543            Self::SuperAdminLogin => "super_admin_login",
25544            Self::PlatformIdentity => "platform_identity",
25545            Self::PublicURL => "public_url",
25546            Self::LLMProvider => "llm_provider",
25547            Self::RegistrationOpen => "registration_open",
25548            Self::Smtp => "smtp",
25549            Self::OauthLogin => "oauth_login",
25550            Self::Stripe => "stripe",
25551            Self::SpecSeed => "spec_seed",
25552            Self::CustomDomain => "custom_domain",
25553            Self::Integrations => "integrations",
25554            Self::Other(value) => value.as_str(),
25555        }
25556    }
25557}
25558
25559impl std::fmt::Display for UpdateAdminSetupStateRequestCompletedStep {
25560    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25561        f.write_str(self.as_str())
25562    }
25563}
25564
25565impl From<&str> for UpdateAdminSetupStateRequestCompletedStep {
25566    fn from(value: &str) -> Self {
25567        match value {
25568            "super_admin_login" => Self::SuperAdminLogin,
25569            "platform_identity" => Self::PlatformIdentity,
25570            "public_url" => Self::PublicURL,
25571            "llm_provider" => Self::LLMProvider,
25572            "registration_open" => Self::RegistrationOpen,
25573            "smtp" => Self::Smtp,
25574            "oauth_login" => Self::OauthLogin,
25575            "stripe" => Self::Stripe,
25576            "spec_seed" => Self::SpecSeed,
25577            "custom_domain" => Self::CustomDomain,
25578            "integrations" => Self::Integrations,
25579            other => Self::Other(other.to_string()),
25580        }
25581    }
25582}
25583
25584/// `UpdateAdminSmtpConfigRequest` model.
25585#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25586pub struct UpdateAdminSmtpConfigRequest {
25587    #[serde(default, skip_serializing_if = "Option::is_none")]
25588    pub host: Option<String>,
25589    #[serde(default, skip_serializing_if = "Option::is_none")]
25590    pub port: Option<i64>,
25591    #[serde(default, skip_serializing_if = "Option::is_none")]
25592    pub user: Option<String>,
25593    /// Empty string clears the stored credential.
25594    #[serde(default, skip_serializing_if = "Option::is_none")]
25595    pub password: Option<String>,
25596    #[serde(default, skip_serializing_if = "Option::is_none")]
25597    pub from: Option<String>,
25598    #[serde(default, skip_serializing_if = "Option::is_none")]
25599    pub from_name: Option<String>,
25600}
25601
25602/// `UpdateAdminSSEConfigResponse` model.
25603#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25604pub struct UpdateAdminSSEConfigResponse {
25605    pub sse: UpdateAdminSSEConfigResponseSSE,
25606    pub updated: bool,
25607}
25608
25609/// `UpdateAdminSSEConfigResponseSSE` model.
25610#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25611pub struct UpdateAdminSSEConfigResponseSSE {
25612    pub heartbeat_interval_ms: i64,
25613    pub watch_timeout_ms: i64,
25614    pub poll_interval_ms: i64,
25615    pub max_poll_interval_ms: i64,
25616    pub reconnect_hint_ms: i64,
25617    pub run_wait_timeout_sec: i64,
25618}
25619
25620/// `UpdateAdminStripeConfigRequest` model.
25621#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25622pub struct UpdateAdminStripeConfigRequest {
25623    #[serde(default, skip_serializing_if = "Option::is_none")]
25624    pub enabled: Option<bool>,
25625    #[serde(default, skip_serializing_if = "Option::is_none")]
25626    pub mode: Option<UpdateAdminStripeConfigRequestMode>,
25627    #[serde(default, skip_serializing_if = "Option::is_none")]
25628    pub secret_key: Option<String>,
25629    #[serde(default, skip_serializing_if = "Option::is_none")]
25630    pub webhook_secret: Option<String>,
25631    #[serde(default, skip_serializing_if = "Option::is_none")]
25632    pub publishable_key: Option<String>,
25633    #[serde(default, skip_serializing_if = "Option::is_none")]
25634    pub price_id_starter: Option<String>,
25635    #[serde(default, skip_serializing_if = "Option::is_none")]
25636    pub price_id_pro: Option<String>,
25637    #[serde(default, skip_serializing_if = "Option::is_none")]
25638    pub price_id_enterprise: Option<String>,
25639}
25640
25641/// `UpdateAdminStripeConfigRequestMode` enumeration.
25642#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
25643pub enum UpdateAdminStripeConfigRequestMode {
25644    #[default]
25645    #[serde(rename = "test")]
25646    Test,
25647    #[serde(rename = "live")]
25648    Live,
25649    /// A value the API introduced after this SDK was generated.
25650    #[serde(untagged)]
25651    Other(String),
25652}
25653
25654impl UpdateAdminStripeConfigRequestMode {
25655    /// The value as it appears on the wire.
25656    pub fn as_str(&self) -> &str {
25657        match self {
25658            Self::Test => "test",
25659            Self::Live => "live",
25660            Self::Other(value) => value.as_str(),
25661        }
25662    }
25663}
25664
25665impl std::fmt::Display for UpdateAdminStripeConfigRequestMode {
25666    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25667        f.write_str(self.as_str())
25668    }
25669}
25670
25671impl From<&str> for UpdateAdminStripeConfigRequestMode {
25672    fn from(value: &str) -> Self {
25673        match value {
25674            "test" => Self::Test,
25675            "live" => Self::Live,
25676            other => Self::Other(other.to_string()),
25677        }
25678    }
25679}
25680
25681/// `UpdateAdminStripeConfigResponse` model.
25682#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25683pub struct UpdateAdminStripeConfigResponse {
25684    pub stripe: UpdateAdminStripeConfigResponseStripe,
25685    pub updated: bool,
25686}
25687
25688/// `UpdateAdminStripeConfigResponseStripe` model.
25689#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25690pub struct UpdateAdminStripeConfigResponseStripe {
25691    pub enabled: bool,
25692    pub mode: String,
25693    pub secret_key: String,
25694    pub webhook_secret: String,
25695    pub publishable_key: String,
25696    pub price_id_starter: String,
25697    pub price_id_pro: String,
25698    pub price_id_enterprise: String,
25699}
25700
25701/// `UpdateAdminTenantSettingsResponse` model.
25702#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25703pub struct UpdateAdminTenantSettingsResponse {
25704    pub tenant_id: String,
25705    /// types/tenant.ts TenantSettings as stored — legacy records may lack fields.
25706    pub settings: serde_json::Map<String, serde_json::Value>,
25707    /// Only when ever set.
25708    #[serde(default, skip_serializing_if = "Option::is_none")]
25709    pub legal_hold: Option<bool>,
25710}
25711
25712/// `UpdateAdminToolOverridesRequest` model.
25713#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25714pub struct UpdateAdminToolOverridesRequest {
25715    pub overrides: HashMap<String, ToolOverride>,
25716}
25717
25718/// `UpdateAdminToolOverridesResponse` model.
25719#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25720pub struct UpdateAdminToolOverridesResponse {
25721    pub ok: bool,
25722    pub overrides: HashMap<String, ToolOverride>,
25723}
25724
25725/// `UpdateAdminToolSecurityConfigResponse` model.
25726#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25727pub struct UpdateAdminToolSecurityConfigResponse {
25728    pub tool_security: UpdateAdminToolSecurityConfigResponseToolSecurity,
25729    pub updated: bool,
25730}
25731
25732/// `UpdateAdminToolSecurityConfigResponseToolSecurity` model.
25733#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25734pub struct UpdateAdminToolSecurityConfigResponseToolSecurity {
25735    #[serde(default, skip_serializing_if = "Option::is_none")]
25736    pub egress_allowlist_per_tenant: Option<Vec<String>>,
25737    pub default_tool_timeout_ms: i64,
25738    pub default_tool_max_payload_bytes: i64,
25739    pub default_tool_max_concurrency: i64,
25740    pub stdio_inherit_env: bool,
25741}
25742
25743/// `UpdateAdminWebhooksConfigResponse` model.
25744#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25745pub struct UpdateAdminWebhooksConfigResponse {
25746    pub webhooks: UpdateAdminWebhooksConfigResponseWebhooks,
25747    pub updated: bool,
25748}
25749
25750/// `UpdateAdminWebhooksConfigResponseWebhooks` model.
25751#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25752pub struct UpdateAdminWebhooksConfigResponseWebhooks {
25753    pub enabled: bool,
25754    pub max_subscriptions_per_tenant: i64,
25755    pub delivery_timeout_ms: i64,
25756    pub max_retry_attempts: i64,
25757    pub require_https: bool,
25758    pub max_payload_bytes: i64,
25759}
25760
25761/// `UpdateAdminWorkerPoolConfigResponse` model.
25762#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25763pub struct UpdateAdminWorkerPoolConfigResponse {
25764    pub worker_pool: UpdateAdminWorkerPoolConfigResponseWorkerPool,
25765    pub updated: bool,
25766}
25767
25768/// `UpdateAdminWorkerPoolConfigResponseWorkerPool` model.
25769#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25770pub struct UpdateAdminWorkerPoolConfigResponseWorkerPool {
25771    pub max_workers: i64,
25772    pub default_mode: String,
25773    pub max_run_duration_ms: i64,
25774    pub reconciliation_interval_ms: i64,
25775    pub schedule_max_retries: i64,
25776    pub schedule_base_delay_ms: i64,
25777    #[serde(default, skip_serializing_if = "Option::is_none")]
25778    pub max_queue_size: Option<i64>,
25779}
25780
25781/// `UpdateAgentIntegrationRequest` model.
25782#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25783pub struct UpdateAgentIntegrationRequest {
25784    #[serde(default, skip_serializing_if = "Option::is_none")]
25785    pub name: Option<String>,
25786    #[serde(default, skip_serializing_if = "Option::is_none")]
25787    pub config: Option<serde_json::Map<String, serde_json::Value>>,
25788}
25789
25790/// `UpdateBridgeAgentCapabilityRequest` model.
25791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25792pub struct UpdateBridgeAgentCapabilityRequest {
25793    pub capabilities: Vec<String>,
25794    /// Where the bridge process is running. Stored on the connection record and shown to the
25795    /// operator; read at bridge.ts:3479.
25796    #[serde(default, skip_serializing_if = "Option::is_none")]
25797    pub working_directory: Option<String>,
25798    /// The reporting machine's hostname; read at bridge.ts:3480.
25799    #[serde(default, skip_serializing_if = "Option::is_none")]
25800    pub hostname: Option<String>,
25801    /// Outcome of the local spec sync, feeding the web drawer's "Installed locally" badges. Bounded
25802    /// server-side: at most 100 entries, 200 tool names each, errors truncated to 500 characters.
25803    /// Entries without a string `spec_id` are dropped, and `reported_at` is ignored on input — the
25804    /// server stamps its own.
25805    #[serde(default, skip_serializing_if = "Option::is_none")]
25806    pub installed_specs: Option<Vec<BridgeInstalledSpec>>,
25807}
25808
25809/// `UpdateBridgeAgentCapabilityResponse` model.
25810#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25811pub struct UpdateBridgeAgentCapabilityResponse {
25812    pub status: RespondToPublicHitlResponseStatus,
25813}
25814
25815/// `UpdateBuilderRequestStatusRequest` model.
25816#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25817pub struct UpdateBuilderRequestStatusRequest {
25818    pub status: DesignRequestStatus,
25819}
25820
25821/// `UpdateCoreMemoryBlockRequest` model.
25822#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25823pub struct UpdateCoreMemoryBlockRequest {
25824    pub content: String,
25825    /// Values outside 1..32000 are clamped to the range, not refused.
25826    #[serde(default, skip_serializing_if = "Option::is_none")]
25827    pub max_tokens: Option<i64>,
25828}
25829
25830/// `UpdateFeedbackReportStatusRequest` model.
25831#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25832pub struct UpdateFeedbackReportStatusRequest {
25833    /// Anything other than the exact string `resolved` — including an absent body — results in
25834    /// `new`.
25835    #[serde(default, skip_serializing_if = "Option::is_none")]
25836    pub status: Option<UpdateFeedbackReportStatusRequestStatus>,
25837}
25838
25839/// Anything other than the exact string `resolved` — including an absent body — results in
25840/// `new`.
25841#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
25842pub enum UpdateFeedbackReportStatusRequestStatus {
25843    #[default]
25844    #[serde(rename = "resolved")]
25845    Resolved,
25846    #[serde(rename = "new")]
25847    New,
25848    /// A value the API introduced after this SDK was generated.
25849    #[serde(untagged)]
25850    Other(String),
25851}
25852
25853impl UpdateFeedbackReportStatusRequestStatus {
25854    /// The value as it appears on the wire.
25855    pub fn as_str(&self) -> &str {
25856        match self {
25857            Self::Resolved => "resolved",
25858            Self::New => "new",
25859            Self::Other(value) => value.as_str(),
25860        }
25861    }
25862}
25863
25864impl std::fmt::Display for UpdateFeedbackReportStatusRequestStatus {
25865    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25866        f.write_str(self.as_str())
25867    }
25868}
25869
25870impl From<&str> for UpdateFeedbackReportStatusRequestStatus {
25871    fn from(value: &str) -> Self {
25872        match value {
25873            "resolved" => Self::Resolved,
25874            "new" => Self::New,
25875            other => Self::Other(other.to_string()),
25876        }
25877    }
25878}
25879
25880/// `UpdateFeedbackReportStatusResponse` model.
25881#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25882pub struct UpdateFeedbackReportStatusResponse {
25883    pub ok: bool,
25884    /// Read this back — it is how a caller learns its value was not understood.
25885    pub status: UpdateFeedbackReportStatusRequestStatus,
25886}
25887
25888/// `UpdateGoalStatusRequest` model.
25889#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25890pub struct UpdateGoalStatusRequest {
25891    pub status: String,
25892}
25893
25894/// `UpdateImprovementStatusRequest` model.
25895#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25896pub struct UpdateImprovementStatusRequest {
25897    pub status: ImprovementProposalStatus,
25898}
25899
25900/// `UpdateIntegrationRequest` model.
25901#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25902pub struct UpdateIntegrationRequest {
25903    #[serde(default, skip_serializing_if = "Option::is_none")]
25904    pub name: Option<String>,
25905    #[serde(default, skip_serializing_if = "Option::is_none")]
25906    pub config: Option<serde_json::Map<String, serde_json::Value>>,
25907}
25908
25909/// `UpdateMarkupConfigResponse` model.
25910#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25911pub struct UpdateMarkupConfigResponse {
25912    pub markup: UpdateMarkupConfigResponseMarkup,
25913    pub updated: bool,
25914}
25915
25916/// `UpdateMarkupConfigResponseMarkup` model.
25917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25918pub struct UpdateMarkupConfigResponseMarkup {
25919    pub platform_markup_percent: f64,
25920    pub model_markup_overrides: serde_json::Map<String, serde_json::Value>,
25921}
25922
25923/// `UpdateMCPServerRequest` model.
25924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25925pub struct UpdateMCPServerRequest {
25926    #[serde(default, skip_serializing_if = "Option::is_none")]
25927    pub name: Option<String>,
25928    #[serde(default, skip_serializing_if = "Option::is_none")]
25929    pub url: Option<String>,
25930    #[serde(default, skip_serializing_if = "Option::is_none")]
25931    pub command: Option<String>,
25932    #[serde(default, skip_serializing_if = "Option::is_none")]
25933    pub args: Option<Vec<String>>,
25934    /// Re-encrypted on write. `{}` clears it.
25935    #[serde(default, skip_serializing_if = "Option::is_none")]
25936    pub env: Option<serde_json::Map<String, serde_json::Value>>,
25937    #[serde(default, skip_serializing_if = "Option::is_none")]
25938    pub enabled: Option<bool>,
25939    #[serde(default, skip_serializing_if = "Option::is_none")]
25940    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
25941    #[serde(default, skip_serializing_if = "Option::is_none")]
25942    pub status: Option<MCPServerStatus>,
25943    /// Names an environment variable of the API process whose value is sent to this server as a
25944    /// bearer token. It MUST begin `MCP_` — 422 otherwise. The namespace is the whole security
25945    /// boundary: before it existed, the HTTP transport read ANY variable of the API process, so a
25946    /// tenant admin registering `{url: \<their server\>, api_key_ref: "UARP_ENCRYPTION_KEY"}` was
25947    /// mailed the platform's at-rest key on the first connect (found 2026-09-15). The variable is
25948    /// never echoed back; only the ref is stored.
25949    #[serde(default, skip_serializing_if = "Option::is_none")]
25950    pub api_key_ref: Option<String>,
25951    #[serde(default, skip_serializing_if = "Option::is_none")]
25952    pub egress_allowlist: Option<Vec<String>>,
25953}
25954
25955/// At least one editable field.
25956#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25957pub struct UpdateMissionObjectiveRequest {
25958    #[serde(default, skip_serializing_if = "Option::is_none")]
25959    pub title: Option<String>,
25960    #[serde(default, skip_serializing_if = "Option::is_none")]
25961    pub description: Option<String>,
25962    #[serde(default, skip_serializing_if = "Option::is_none")]
25963    pub success_criteria: Option<Vec<String>>,
25964    #[serde(default, skip_serializing_if = "Option::is_none")]
25965    pub priority: Option<ObjectivePriority>,
25966    /// Empty string clears the assignment.
25967    #[serde(default, skip_serializing_if = "Option::is_none")]
25968    pub assigned_agent_id: Option<String>,
25969    /// Empty string clears the assignment.
25970    #[serde(default, skip_serializing_if = "Option::is_none")]
25971    pub assigned_team_id: Option<String>,
25972    /// Ceilings only; the spent counters are not writable.
25973    #[serde(default, skip_serializing_if = "Option::is_none")]
25974    pub budget: Option<UpdateMissionObjectiveRequestBudget>,
25975    #[serde(default, skip_serializing_if = "Option::is_none")]
25976    pub deadline: Option<String>,
25977    #[serde(default, skip_serializing_if = "Option::is_none")]
25978    pub commanders_intent: Option<String>,
25979    #[serde(default, skip_serializing_if = "Option::is_none")]
25980    pub roe: Option<ObjectiveRoE>,
25981    #[serde(default, skip_serializing_if = "Option::is_none")]
25982    pub decision_points: Option<Vec<ObjectiveDecisionPoint>>,
25983}
25984
25985/// Ceilings only; the spent counters are not writable.
25986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25987pub struct UpdateMissionObjectiveRequestBudget {
25988    #[serde(default, skip_serializing_if = "Option::is_none")]
25989    pub max_runs: Option<i64>,
25990    #[serde(default, skip_serializing_if = "Option::is_none")]
25991    pub max_tokens: Option<i64>,
25992    #[serde(default, skip_serializing_if = "Option::is_none")]
25993    pub max_cost_usd: Option<f64>,
25994}
25995
25996/// `UpdateMyPreferencesRequest` model.
25997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25998pub struct UpdateMyPreferencesRequest {
25999    #[serde(default, skip_serializing_if = "Option::is_none")]
26000    pub custom_instructions: Option<String>,
26001    #[serde(default, skip_serializing_if = "Option::is_none")]
26002    pub enabled: Option<bool>,
26003}
26004
26005/// `UpdatePlatformURLSRequest` model.
26006#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26007pub struct UpdatePlatformURLSRequest {
26008    #[serde(default, skip_serializing_if = "Option::is_none")]
26009    pub public_base_url: Option<String>,
26010    #[serde(default, skip_serializing_if = "Option::is_none")]
26011    pub webhook_base_url: Option<String>,
26012}
26013
26014/// `UpdatePlatformURLSResponse` model.
26015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26016pub struct UpdatePlatformURLSResponse {
26017    #[serde(default, skip_serializing_if = "Option::is_none")]
26018    pub urls: Option<UpdatePlatformURLSResponseURLS>,
26019    pub updated: bool,
26020}
26021
26022/// `UpdatePlatformURLSResponseURLS` model.
26023#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26024pub struct UpdatePlatformURLSResponseURLS {
26025    #[serde(default, skip_serializing_if = "Option::is_none")]
26026    pub public_base_url: Option<String>,
26027    #[serde(default, skip_serializing_if = "Option::is_none")]
26028    pub webhook_base_url: Option<String>,
26029}
26030
26031/// `UpdateProjectRequest` model.
26032#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26033pub struct UpdateProjectRequest {
26034    #[serde(default, skip_serializing_if = "Option::is_none")]
26035    pub name: Option<String>,
26036    #[serde(default, skip_serializing_if = "Option::is_none")]
26037    pub description: Option<String>,
26038    #[serde(default, skip_serializing_if = "Option::is_none")]
26039    pub instructions: Option<String>,
26040    #[serde(default, skip_serializing_if = "Option::is_none")]
26041    pub knowledge_base_ids: Option<Vec<String>>,
26042    #[serde(default, skip_serializing_if = "Option::is_none")]
26043    pub file_ids: Option<Vec<String>>,
26044    #[serde(default, skip_serializing_if = "Option::is_none")]
26045    pub visibility: Option<ProjectVisibility>,
26046    #[serde(default, skip_serializing_if = "Option::is_none")]
26047    pub shared_with: Option<Vec<ProjectGrant>>,
26048    /// Timestamp to archive, null to restore.
26049    #[serde(default, skip_serializing_if = "Option::is_none")]
26050    pub archived_at: Option<String>,
26051}
26052
26053/// `UpdateRuntimeConfigResponse` model.
26054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26055pub struct UpdateRuntimeConfigResponse {
26056    /// The effective runtime config — sparse: only keys present in the platform config or the
26057    /// stored override (RuntimeConfig, every field optional).
26058    pub runtime: serde_json::Map<String, serde_json::Value>,
26059    pub updated: bool,
26060    /// Only when the body carried keys the schema does not declare.
26061    #[serde(default, skip_serializing_if = "Option::is_none")]
26062    pub ignored_keys: Option<Vec<String>>,
26063}
26064
26065/// `UpdateSecurityPoliciesRequest` model.
26066#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26067pub struct UpdateSecurityPoliciesRequest {
26068    #[serde(default, skip_serializing_if = "Option::is_none")]
26069    pub cors_allowed_origins: Option<Vec<String>>,
26070    #[serde(default, skip_serializing_if = "Option::is_none")]
26071    pub webhook_url_denylist: Option<Vec<String>>,
26072    #[serde(default, skip_serializing_if = "Option::is_none")]
26073    pub file_upload_max_size_bytes: Option<i64>,
26074    #[serde(default, skip_serializing_if = "Option::is_none")]
26075    pub file_upload_allowed_mime_types: Option<Vec<String>>,
26076    #[serde(default, skip_serializing_if = "Option::is_none")]
26077    pub admin_provider_settings_require_super_admin: Option<bool>,
26078}
26079
26080/// `UpdateSecurityPoliciesResponse` model.
26081#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26082pub struct UpdateSecurityPoliciesResponse {
26083    pub policies: UpdateSecurityPoliciesResponsePolicies,
26084    pub updated: bool,
26085}
26086
26087/// `UpdateSecurityPoliciesResponsePolicies` model.
26088#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26089pub struct UpdateSecurityPoliciesResponsePolicies {
26090    pub cors_allowed_origins: Vec<String>,
26091    pub webhook_url_denylist: Vec<String>,
26092    pub file_upload_max_size_bytes: i64,
26093    pub file_upload_allowed_mime_types: Vec<String>,
26094    pub admin_provider_settings_require_super_admin: bool,
26095}
26096
26097/// `UpdateSessionAnnotationRequest` model.
26098#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26099pub struct UpdateSessionAnnotationRequest {
26100    #[serde(default, skip_serializing_if = "Option::is_none")]
26101    pub resolved: Option<bool>,
26102}
26103
26104/// `UpdateSessionRequest` model.
26105#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26106pub struct UpdateSessionRequest {
26107    /// MERGED into the stored bag, not replaced — a key this body omits keeps its value, and a key
26108    /// it names is overwritten. The platform writes its own keys here (`project_id`, `_public`,
26109    /// `temporary`, `_todo_id`, the preview fields), which is why replace semantics would be wrong.
26110    /// Because it merges, the limits are measured on the RESULT and so accumulate across calls: at
26111    /// most 100 keys, at most 64 KiB of JSON, and at most 8 levels of nesting. Past any of them the
26112    /// request is refused with 422 and a `detail` naming the number reached. Remove keys you no
26113    /// longer need; this is a label bag, not content.
26114    #[serde(default, skip_serializing_if = "Option::is_none")]
26115    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
26116    /// Per-conversation model override. Send null to clear (revert to agent default), or {
26117    /// provider, model_ref, endpoint_url?, capabilities? } to set. The runtime governance allowlist
26118    /// is still enforced at run time.
26119    #[serde(default, skip_serializing_if = "Option::is_none")]
26120    pub model_override: Option<UpdateSessionRequestModelOverride>,
26121}
26122
26123/// Per-conversation model override. Send null to clear (revert to agent default), or {
26124/// provider, model_ref, endpoint_url?, capabilities? } to set. The runtime governance allowlist
26125/// is still enforced at run time.
26126#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26127pub struct UpdateSessionRequestModelOverride {
26128    pub provider: String,
26129    pub model_ref: String,
26130    #[serde(default, skip_serializing_if = "Option::is_none")]
26131    pub endpoint_url: Option<String>,
26132    #[serde(default, skip_serializing_if = "Option::is_none")]
26133    pub capabilities: Option<serde_json::Map<String, serde_json::Value>>,
26134}
26135
26136/// `UpdateSquadGraphNodeRequest` model.
26137#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26138pub struct UpdateSquadGraphNodeRequest {
26139    #[serde(default, skip_serializing_if = "Option::is_none")]
26140    pub status: Option<TeamGraphNodeStatus>,
26141    #[serde(default, skip_serializing_if = "Option::is_none")]
26142    pub goal_summary: Option<String>,
26143}
26144
26145/// `UpdateTeamGraphNodeRequest` model.
26146#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26147pub struct UpdateTeamGraphNodeRequest {
26148    #[serde(default, skip_serializing_if = "Option::is_none")]
26149    pub status: Option<TeamGraphNodeStatus>,
26150    #[serde(default, skip_serializing_if = "Option::is_none")]
26151    pub goal_summary: Option<String>,
26152}
26153
26154/// Null clears an override. Any other non-boolean is 422.
26155#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26156pub struct UpdateTenantMefConfigRequest {
26157    #[serde(default, skip_serializing_if = "Option::is_none")]
26158    pub enabled: Option<bool>,
26159    #[serde(default, skip_serializing_if = "Option::is_none")]
26160    pub planner_enabled: Option<bool>,
26161    #[serde(default, skip_serializing_if = "Option::is_none")]
26162    pub judge_enabled: Option<bool>,
26163    #[serde(default, skip_serializing_if = "Option::is_none")]
26164    pub auto_classify: Option<bool>,
26165}
26166
26167/// `UpdateTenantPlanRequest` model.
26168#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26169pub struct UpdateTenantPlanRequest {
26170    /// A built-in plan (`free`, `starter`, `pro`, `enterprise`) or the id of an ACTIVE custom plan
26171    /// from `/admin/config/custom-plans`. Matched case-insensitively and trimmed. Anything else is
26172    /// 400 rather than a silently stored value.
26173    pub plan: String,
26174    #[serde(default, skip_serializing_if = "Option::is_none")]
26175    pub quotas: Option<TenantQuotas>,
26176    /// Partial quota grant that outlives subscription changes — only the dimensions being raised
26177    /// need be present.
26178    #[serde(default, skip_serializing_if = "Option::is_none")]
26179    pub quota_overrides: Option<serde_json::Map<String, serde_json::Value>>,
26180    #[serde(default, skip_serializing_if = "Option::is_none")]
26181    pub name: Option<String>,
26182    /// Lowercase letters, numbers and hyphens. Changing it re-points the public tenant index.
26183    #[serde(default, skip_serializing_if = "Option::is_none")]
26184    pub slug: Option<String>,
26185}
26186
26187/// `UpdateTenantPlanResponse` model.
26188#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26189pub struct UpdateTenantPlanResponse {
26190    pub tenant_id: String,
26191    /// The RESOLVED plan id, which may differ in case from what was sent.
26192    pub plan: String,
26193    pub quotas: TenantQuotas,
26194}
26195
26196/// `UpdateTenantRequest` model.
26197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26198pub struct UpdateTenantRequest {
26199    #[serde(default, skip_serializing_if = "Option::is_none")]
26200    pub name: Option<String>,
26201    #[serde(default, skip_serializing_if = "Option::is_none")]
26202    pub settings: Option<serde_json::Map<String, serde_json::Value>>,
26203    #[serde(default, skip_serializing_if = "Option::is_none")]
26204    pub description: Option<String>,
26205    #[serde(default, skip_serializing_if = "Option::is_none")]
26206    pub head_agent_id: Option<String>,
26207    #[serde(default, skip_serializing_if = "Option::is_none")]
26208    pub shared_workspace_id: Option<String>,
26209}
26210
26211/// `UpdateWebhooksPolicyRequest` model.
26212#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26213pub struct UpdateWebhooksPolicyRequest {
26214    #[serde(default, skip_serializing_if = "Option::is_none")]
26215    pub ssrf_check_at_subscription: Option<bool>,
26216    #[serde(default, skip_serializing_if = "Option::is_none")]
26217    pub stripe_signature_tolerance_sec: Option<i64>,
26218    #[serde(default, skip_serializing_if = "Option::is_none")]
26219    pub delivery_max_retries: Option<i64>,
26220    #[serde(default, skip_serializing_if = "Option::is_none")]
26221    pub delivery_backoff_base_ms: Option<i64>,
26222    #[serde(default, skip_serializing_if = "Option::is_none")]
26223    pub delivery_max_window_hours: Option<i64>,
26224}
26225
26226/// `UpdateWebhooksPolicyResponse` model.
26227#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26228pub struct UpdateWebhooksPolicyResponse {
26229    pub policy: UpdateWebhooksPolicyResponsePolicy,
26230    pub updated: bool,
26231}
26232
26233/// `UpdateWebhooksPolicyResponsePolicy` model.
26234#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26235pub struct UpdateWebhooksPolicyResponsePolicy {
26236    pub ssrf_check_at_subscription: bool,
26237    pub stripe_signature_tolerance_sec: i64,
26238    pub delivery_max_retries: i64,
26239    pub delivery_backoff_base_ms: i64,
26240    pub delivery_max_window_hours: i64,
26241}
26242
26243/// `UpdateWorkspaceRequest` model.
26244#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26245pub struct UpdateWorkspaceRequest {
26246    pub name: String,
26247}
26248
26249/// `UploadFileRequest` model.
26250#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26251pub struct UploadFileRequest {
26252    /// Base64-encoded file content
26253    pub data: FilePart,
26254    pub mime_type: String,
26255    #[serde(default, skip_serializing_if = "Option::is_none")]
26256    pub filename: Option<String>,
26257}
26258
26259/// `UploadFileResponse` model.
26260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26261pub struct UploadFileResponse {
26262    pub file_id: String,
26263    pub tenant_id: String,
26264    pub filename: String,
26265    pub mime_type: String,
26266    pub size_bytes: i64,
26267    pub sha256: String,
26268    pub created_at: String,
26269    pub url: String,
26270}
26271
26272/// `UploadPublicSessionImageResponse` model.
26273#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26274pub struct UploadPublicSessionImageResponse {
26275    pub file_id: String,
26276    pub mime_type: String,
26277    /// Bytes stored.
26278    pub size: i64,
26279}
26280
26281/// `UploadWorkspaceFileIfNoneMatch` enumeration.
26282#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
26283pub enum UploadWorkspaceFileIfNoneMatch {
26284    #[default]
26285    #[serde(rename = "*")]
26286    Empty,
26287    /// A value the API introduced after this SDK was generated.
26288    #[serde(untagged)]
26289    Other(String),
26290}
26291
26292impl UploadWorkspaceFileIfNoneMatch {
26293    /// The value as it appears on the wire.
26294    pub fn as_str(&self) -> &str {
26295        match self {
26296            Self::Empty => "*",
26297            Self::Other(value) => value.as_str(),
26298        }
26299    }
26300}
26301
26302impl std::fmt::Display for UploadWorkspaceFileIfNoneMatch {
26303    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26304        f.write_str(self.as_str())
26305    }
26306}
26307
26308impl From<&str> for UploadWorkspaceFileIfNoneMatch {
26309    fn from(value: &str) -> Self {
26310        match value {
26311            "*" => Self::Empty,
26312            other => Self::Other(other.to_string()),
26313        }
26314    }
26315}
26316
26317/// `UploadWorkspaceFileRequest` model.
26318#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26319pub struct UploadWorkspaceFileRequest {
26320    pub file: FilePart,
26321}
26322
26323/// `UpsertAgentToolOverrideResponse` model.
26324#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26325pub struct UpsertAgentToolOverrideResponse {
26326    pub tool_overrides: Vec<AgentToolOverride>,
26327}
26328
26329/// `UpsertCustomPlanResponse` model.
26330#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26331pub struct UpsertCustomPlanResponse {
26332    pub plan: CustomPlan,
26333}
26334
26335/// `UpsertNotificationTargetRequest` model.
26336#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26337pub struct UpsertNotificationTargetRequest {
26338    /// Rewrites this target when it exists.
26339    #[serde(default, skip_serializing_if = "Option::is_none")]
26340    pub id: Option<String>,
26341    /// Defaults to something channel-specific when omitted.
26342    #[serde(default, skip_serializing_if = "Option::is_none")]
26343    pub label: Option<String>,
26344    /// Defaults to true; only an explicit `false` disables.
26345    #[serde(default, skip_serializing_if = "Option::is_none")]
26346    pub enabled: Option<bool>,
26347    pub config: serde_json::Value,
26348}
26349
26350/// `UpsertNotificationTargetRequestConfigVariant1` model.
26351#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26352pub struct UpsertNotificationTargetRequestConfigVariant1 {
26353    pub kind: NotificationTargetConfigVariant1kind,
26354    pub address: String,
26355}
26356
26357/// `UpsertNotificationTargetRequestConfigVariant2` model.
26358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26359pub struct UpsertNotificationTargetRequestConfigVariant2 {
26360    pub kind: AgentScorerConfigType,
26361    /// Must be https.
26362    pub url: String,
26363    #[serde(default, skip_serializing_if = "Option::is_none")]
26364    pub signing_secret: Option<String>,
26365    #[serde(default, skip_serializing_if = "Option::is_none")]
26366    pub format: Option<NotificationTargetConfigVariant2format>,
26367}
26368
26369/// `UpsertNotificationTargetRequestConfigVariant3` model.
26370#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26371pub struct UpsertNotificationTargetRequestConfigVariant3 {
26372    pub kind: NotificationTargetConfigVariant3kind,
26373    pub platform: NotificationTargetConfigVariant3platform,
26374    pub device_token: String,
26375    #[serde(default, skip_serializing_if = "Option::is_none")]
26376    pub device_label: Option<String>,
26377}
26378
26379/// `UpsertNotificationTargetRequestConfigVariant4` model.
26380#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26381pub struct UpsertNotificationTargetRequestConfigVariant4 {
26382    pub kind: NotificationTargetConfigVariant4kind,
26383    pub endpoint: String,
26384    pub keys: UpsertNotificationTargetRequestConfigVariant4keys,
26385    #[serde(default, skip_serializing_if = "Option::is_none")]
26386    pub device_label: Option<String>,
26387    #[serde(default, skip_serializing_if = "Option::is_none")]
26388    pub expiration_time: Option<i64>,
26389}
26390
26391/// `UpsertNotificationTargetRequestConfigVariant4keys` model.
26392#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26393pub struct UpsertNotificationTargetRequestConfigVariant4keys {
26394    pub p256dh: String,
26395    pub auth: String,
26396}
26397
26398/// `UpsertPromoCodeResponse` model.
26399#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26400pub struct UpsertPromoCodeResponse {
26401    pub promo_code: PromoCode,
26402}
26403
26404/// `UsageMarginSummary` model.
26405#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26406pub struct UsageMarginSummary {
26407    pub platform_markup_percent: f64,
26408    pub provider_cost_usd: f64,
26409    pub user_cost_usd: f64,
26410    pub margin_usd: f64,
26411    pub effective_margin_percent: f64,
26412}
26413
26414/// billing.ts GET /usage/quota. `reason` only when `allowed` is false (billing/usage-tracker.ts
26415/// checkQuota).
26416#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26417pub struct UsageQuota {
26418    pub plan: String,
26419    pub allowed: bool,
26420    #[serde(default, skip_serializing_if = "Option::is_none")]
26421    pub reason: Option<String>,
26422    /// billing/usage-tracker.ts AggregatedUsage for the current month.
26423    pub usage: UsageQuotaUsage,
26424    pub daily: UsageQuotaDaily,
26425    pub resets_at: UsageQuotaResetsAt,
26426    pub limits: UsageQuotaLimits,
26427    /// Every plan-capped counter in one list, joined server-side: `{kind, used, limit, period,
26428    /// resets_at}`. The same facts as `usage`, `limits`, `daily` and `resource_usage`, which stay
26429    /// exactly as they were — this is the shape a meter renders without doing the join itself (four
26430    /// client surfaces were doing it). `limit: null` means unlimited; a sentinel would render as "0
26431    /// of 0". `period`/`resets_at` are null for standing counts like agents, which do not reset at
26432    /// midnight.
26433    #[serde(default, skip_serializing_if = "Option::is_none")]
26434    pub counters: Option<Vec<UsageQuotaCounter>>,
26435    /// api/lib/resource-usage.ts TenantResourceUsage.
26436    pub resource_usage: UsageQuotaResourceUsage,
26437}
26438
26439/// `UsageQuotaCounter` model.
26440#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26441pub struct UsageQuotaCounter {
26442    pub kind: UsageQuotaCounterKind,
26443    pub used: f64,
26444    #[serde(default)]
26445    pub limit: Option<f64>,
26446    #[serde(default)]
26447    pub period: Option<String>,
26448    #[serde(default)]
26449    pub resets_at: Option<String>,
26450}
26451
26452/// `UsageQuotaCounterKind` enumeration.
26453#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
26454pub enum UsageQuotaCounterKind {
26455    #[default]
26456    #[serde(rename = "runs")]
26457    Runs,
26458    #[serde(rename = "tokens")]
26459    Tokens,
26460    #[serde(rename = "tokens_daily")]
26461    TokensDaily,
26462    #[serde(rename = "tool_calls")]
26463    ToolCalls,
26464    #[serde(rename = "agents")]
26465    Agents,
26466    #[serde(rename = "teams")]
26467    Teams,
26468    #[serde(rename = "knowledge_bases")]
26469    KnowledgeBases,
26470    #[serde(rename = "workspaces")]
26471    Workspaces,
26472    /// A value the API introduced after this SDK was generated.
26473    #[serde(untagged)]
26474    Other(String),
26475}
26476
26477impl UsageQuotaCounterKind {
26478    /// The value as it appears on the wire.
26479    pub fn as_str(&self) -> &str {
26480        match self {
26481            Self::Runs => "runs",
26482            Self::Tokens => "tokens",
26483            Self::TokensDaily => "tokens_daily",
26484            Self::ToolCalls => "tool_calls",
26485            Self::Agents => "agents",
26486            Self::Teams => "teams",
26487            Self::KnowledgeBases => "knowledge_bases",
26488            Self::Workspaces => "workspaces",
26489            Self::Other(value) => value.as_str(),
26490        }
26491    }
26492}
26493
26494impl std::fmt::Display for UsageQuotaCounterKind {
26495    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26496        f.write_str(self.as_str())
26497    }
26498}
26499
26500impl From<&str> for UsageQuotaCounterKind {
26501    fn from(value: &str) -> Self {
26502        match value {
26503            "runs" => Self::Runs,
26504            "tokens" => Self::Tokens,
26505            "tokens_daily" => Self::TokensDaily,
26506            "tool_calls" => Self::ToolCalls,
26507            "agents" => Self::Agents,
26508            "teams" => Self::Teams,
26509            "knowledge_bases" => Self::KnowledgeBases,
26510            "workspaces" => Self::Workspaces,
26511            other => Self::Other(other.to_string()),
26512        }
26513    }
26514}
26515
26516/// `UsageQuotaDaily` model.
26517#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26518pub struct UsageQuotaDaily {
26519    pub used: f64,
26520    pub limit: f64,
26521    #[serde(default)]
26522    pub remaining: Option<f64>,
26523    pub resets_at: String,
26524}
26525
26526/// `UsageQuotaLimits` model.
26527#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26528pub struct UsageQuotaLimits {
26529    pub max_monthly_tokens: f64,
26530    pub max_monthly_runs: f64,
26531    pub max_daily_tokens: f64,
26532    pub max_agents: f64,
26533    pub max_teams: f64,
26534    pub max_knowledge_bases: f64,
26535    pub max_workspaces: f64,
26536}
26537
26538/// `UsageQuotaResetsAt` model.
26539#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26540pub struct UsageQuotaResetsAt {
26541    pub day: String,
26542    pub month: String,
26543}
26544
26545/// api/lib/resource-usage.ts TenantResourceUsage.
26546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26547pub struct UsageQuotaResourceUsage {
26548    pub agents: ResourceUsageEntry,
26549    pub workspaces: ResourceUsageEntry,
26550    pub knowledge_bases: ResourceUsageEntry,
26551    pub teams: ResourceUsageEntry,
26552    pub any_over_tier: bool,
26553}
26554
26555/// billing/usage-tracker.ts AggregatedUsage for the current month.
26556#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26557pub struct UsageQuotaUsage {
26558    pub input_tokens: f64,
26559    pub output_tokens: f64,
26560    pub thinking_tokens: f64,
26561    pub total_tokens: f64,
26562    pub runs_count: f64,
26563    pub tool_calls_count: f64,
26564    pub storage_bytes: f64,
26565    pub total_cost: f64,
26566    pub provider_cost: f64,
26567    pub non_run_cost: f64,
26568    pub period: String,
26569}
26570
26571/// Tenant usage for one billing period. Flat — the counters are top-level, not nested under a
26572/// `usage` object.
26573#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26574pub struct UsageSummary {
26575    pub plan: String,
26576    /// `YYYY-MM`.
26577    pub period: String,
26578    pub period_days: i64,
26579    pub input_tokens: i64,
26580    pub output_tokens: i64,
26581    pub thinking_tokens: i64,
26582    pub total_tokens: i64,
26583    pub runs_count: i64,
26584    pub tool_calls_count: i64,
26585    #[serde(default, skip_serializing_if = "Option::is_none")]
26586    pub bridge_tasks: Option<i64>,
26587    pub storage_bytes: i64,
26588    /// What the tenant is billed, in USD.
26589    pub total_cost: f64,
26590    /// What the upstream providers charged, in USD.
26591    pub provider_cost: f64,
26592    pub non_run_cost: f64,
26593    #[serde(default, skip_serializing_if = "Option::is_none")]
26594    pub margin_summary: Option<UsageMarginSummary>,
26595}
26596
26597/// Personal instructions that apply to every conversation this person has, whichever agent
26598/// answers.
26599#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26600pub struct UserPreferences {
26601    pub custom_instructions: String,
26602    /// Off keeps the text but stops it reaching any run — the switch people actually want when an
26603    /// instruction misfires.
26604    pub enabled: bool,
26605    #[serde(default, skip_serializing_if = "Option::is_none")]
26606    pub updated_at: Option<String>,
26607    /// Server-enforced ceiling for `custom_instructions`. Sent on every response so a client does
26608    /// not hard-code it.
26609    pub max_chars: i64,
26610}
26611
26612/// One rubric line for LLM-as-judge validation.
26613#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26614pub struct ValidationCriterion {
26615    pub name: String,
26616    pub description: String,
26617    /// 0.0-1.0; weights should sum to ~1.0.
26618    pub weight: f64,
26619}
26620
26621/// Optional gate scoring worker outputs before synthesis.
26622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26623pub struct ValidationPolicy {
26624    pub enabled: bool,
26625    pub criteria: Vec<ValidationCriterion>,
26626    /// Pass threshold 0.0-1.0 (default 0.7).
26627    pub min_score: f64,
26628    pub max_revision_rounds: i64,
26629    /// Dedicated validator; omitted means the supervisor judges its own workers.
26630    #[serde(default, skip_serializing_if = "Option::is_none")]
26631    pub validator_agent_id: Option<String>,
26632    /// Re-run the workers with the validator's feedback when a round fails, up to
26633    /// `max_revision_rounds`. Defaults to true — the server treats only an explicit `false` as off.
26634    pub auto_revise: bool,
26635    /// Re-run only the workers whose output failed, rather than the whole round. Defaults to false.
26636    pub selective: bool,
26637}
26638
26639/// `Value` model.
26640#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26641pub struct Value {
26642    #[serde(default, skip_serializing_if = "Option::is_none")]
26643    pub en: Option<String>,
26644    #[serde(default, skip_serializing_if = "Option::is_none")]
26645    pub uk: Option<String>,
26646}
26647
26648/// `Value2` model.
26649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26650pub struct Value2 {
26651    pub spec_id: String,
26652    /// The parsed view document, or null when the stored view was unparseable.
26653    pub output_view: serde_json::Value,
26654}
26655
26656/// `Value3` model.
26657#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26658pub struct Value3 {
26659    pub x: f64,
26660    pub y: f64,
26661}
26662
26663/// `Value4` model.
26664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26665pub struct Value4 {
26666    pub x: f64,
26667    pub y: f64,
26668}
26669
26670/// `Value5` model.
26671#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26672pub struct Value5 {
26673    #[serde(default, skip_serializing_if = "Option::is_none")]
26674    pub from: Option<serde_json::Value>,
26675    #[serde(default, skip_serializing_if = "Option::is_none")]
26676    pub to: Option<serde_json::Value>,
26677}
26678
26679/// The API key is e-mailed, never returned here (register.ts handleVerifyEmail).
26680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26681pub struct VerifyEmailResponse {
26682    pub tenant_id: String,
26683    pub message: String,
26684}
26685
26686/// `VerifyMfaRecoveryRequest` model.
26687#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26688pub struct VerifyMfaRecoveryRequest {
26689    pub code: String,
26690}
26691
26692/// `VerifyMfaRecoveryResponse` model.
26693#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26694pub struct VerifyMfaRecoveryResponse {
26695    pub verified: bool,
26696    pub recovery_remaining: i64,
26697}
26698
26699/// `VerifyMfaRequest` model.
26700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26701pub struct VerifyMfaRequest {
26702    /// 6-digit TOTP code.
26703    pub code: String,
26704}
26705
26706/// `VerifyMfaResponse` model.
26707#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26708pub struct VerifyMfaResponse {
26709    pub verified: bool,
26710    #[serde(default, skip_serializing_if = "Option::is_none")]
26711    pub recovery_remaining: Option<i64>,
26712}
26713
26714/// `VerifyTenantDomainResponse` model.
26715#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26716pub struct VerifyTenantDomainResponse {
26717    #[serde(default, skip_serializing_if = "Option::is_none")]
26718    pub verified: Option<bool>,
26719}
26720
26721/// `VetoProposalRequest` model.
26722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26723pub struct VetoProposalRequest {
26724    #[serde(default, skip_serializing_if = "Option::is_none")]
26725    pub founder_id: Option<String>,
26726}
26727
26728/// `VetoProposalResponse` model.
26729#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26730pub struct VetoProposalResponse {
26731    #[serde(default, skip_serializing_if = "Option::is_none")]
26732    pub ok: Option<bool>,
26733}
26734
26735/// A veto as issued and listed (VetoRecord in @uarp/governance). Shape from the store's record;
26736/// no tenant in reach had a veto to measure on 2026-09-10.
26737#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26738pub struct VetoRecord {
26739    pub veto_id: String,
26740    pub issued_by: String,
26741    pub target_type: VetoRecordTargetType,
26742    pub target_id: String,
26743    pub reason: String,
26744    pub issued_at: String,
26745}
26746
26747/// `VetoRecordTargetType` enumeration.
26748#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
26749pub enum VetoRecordTargetType {
26750    #[default]
26751    #[serde(rename = "proposal")]
26752    Proposal,
26753    #[serde(rename = "action")]
26754    Action,
26755    #[serde(rename = "agent")]
26756    Agent,
26757    #[serde(rename = "case")]
26758    Case,
26759    /// A value the API introduced after this SDK was generated.
26760    #[serde(untagged)]
26761    Other(String),
26762}
26763
26764impl VetoRecordTargetType {
26765    /// The value as it appears on the wire.
26766    pub fn as_str(&self) -> &str {
26767        match self {
26768            Self::Proposal => "proposal",
26769            Self::Action => "action",
26770            Self::Agent => "agent",
26771            Self::Case => "case",
26772            Self::Other(value) => value.as_str(),
26773        }
26774    }
26775}
26776
26777impl std::fmt::Display for VetoRecordTargetType {
26778    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26779        f.write_str(self.as_str())
26780    }
26781}
26782
26783impl From<&str> for VetoRecordTargetType {
26784    fn from(value: &str) -> Self {
26785        match value {
26786            "proposal" => Self::Proposal,
26787            "action" => Self::Action,
26788            "agent" => Self::Agent,
26789            "case" => Self::Case,
26790            other => Self::Other(other.to_string()),
26791        }
26792    }
26793}
26794
26795/// `VideoProvider` model.
26796#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26797pub struct VideoProvider {
26798    #[serde(default, skip_serializing_if = "Option::is_none")]
26799    pub configured: Option<bool>,
26800    #[serde(default, skip_serializing_if = "Option::is_none")]
26801    pub id: Option<String>,
26802    #[serde(default, skip_serializing_if = "Option::is_none")]
26803    pub local: Option<bool>,
26804    #[serde(default, skip_serializing_if = "Option::is_none")]
26805    pub models: Option<Vec<ModelInfo>>,
26806    #[serde(default, skip_serializing_if = "Option::is_none")]
26807    pub name: Option<String>,
26808}
26809
26810/// `VoiceConfig` model.
26811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26812pub struct VoiceConfig {
26813    #[serde(default, skip_serializing_if = "Option::is_none")]
26814    pub stt: Option<VoiceConfigStt>,
26815    #[serde(default, skip_serializing_if = "Option::is_none")]
26816    pub tts: Option<VoiceConfigTts>,
26817}
26818
26819/// `VoiceConfigStt` model.
26820#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26821pub struct VoiceConfigStt {
26822    #[serde(default, skip_serializing_if = "Option::is_none")]
26823    pub configured: Option<bool>,
26824    #[serde(default, skip_serializing_if = "Option::is_none")]
26825    pub endpoint: Option<String>,
26826    #[serde(default, skip_serializing_if = "Option::is_none")]
26827    pub model: Option<String>,
26828    #[serde(default, skip_serializing_if = "Option::is_none")]
26829    pub provider: Option<String>,
26830}
26831
26832/// `VoiceConfigTts` model.
26833#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26834pub struct VoiceConfigTts {
26835    #[serde(default, skip_serializing_if = "Option::is_none")]
26836    pub configured: Option<bool>,
26837    #[serde(default, skip_serializing_if = "Option::is_none")]
26838    pub endpoint: Option<String>,
26839    #[serde(default, skip_serializing_if = "Option::is_none")]
26840    pub model: Option<String>,
26841    #[serde(default, skip_serializing_if = "Option::is_none")]
26842    pub provider: Option<String>,
26843    #[serde(default, skip_serializing_if = "Option::is_none")]
26844    pub voice: Option<String>,
26845}
26846
26847/// providers.ts voice-providers — STT and TTS models split.
26848#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26849pub struct VoiceProvider {
26850    pub id: String,
26851    pub name: String,
26852    pub configured: bool,
26853    pub stt_models: Vec<ModelInfo>,
26854    pub tts_models: Vec<ModelInfo>,
26855}
26856
26857/// `VoiceProviderList` model.
26858#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26859pub struct VoiceProviderList {
26860    #[serde(default, skip_serializing_if = "Option::is_none")]
26861    pub providers: Option<Vec<VoiceProvider>>,
26862}
26863
26864/// `VoteResult` model.
26865#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26866pub struct VoteResult {
26867    pub proposal_id: String,
26868    pub status: VoteResultStatus,
26869    pub total_votes: i64,
26870    pub approve_weight: f64,
26871    pub reject_weight: f64,
26872    pub abstain_weight: f64,
26873    pub quorum_met: bool,
26874    pub tallied_at: String,
26875}
26876
26877/// `VoteResultStatus` enumeration.
26878#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
26879pub enum VoteResultStatus {
26880    #[default]
26881    #[serde(rename = "passed")]
26882    Passed,
26883    #[serde(rename = "rejected")]
26884    Rejected,
26885    #[serde(rename = "expired")]
26886    Expired,
26887    #[serde(rename = "vetoed")]
26888    Vetoed,
26889    /// A value the API introduced after this SDK was generated.
26890    #[serde(untagged)]
26891    Other(String),
26892}
26893
26894impl VoteResultStatus {
26895    /// The value as it appears on the wire.
26896    pub fn as_str(&self) -> &str {
26897        match self {
26898            Self::Passed => "passed",
26899            Self::Rejected => "rejected",
26900            Self::Expired => "expired",
26901            Self::Vetoed => "vetoed",
26902            Self::Other(value) => value.as_str(),
26903        }
26904    }
26905}
26906
26907impl std::fmt::Display for VoteResultStatus {
26908    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26909        f.write_str(self.as_str())
26910    }
26911}
26912
26913impl From<&str> for VoteResultStatus {
26914    fn from(value: &str) -> Self {
26915        match value {
26916            "passed" => Self::Passed,
26917            "rejected" => Self::Rejected,
26918            "expired" => Self::Expired,
26919            "vetoed" => Self::Vetoed,
26920            other => Self::Other(other.to_string()),
26921        }
26922    }
26923}
26924
26925/// `VotingProposal` model.
26926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26927pub struct VotingProposal {
26928    pub proposal_id: String,
26929    pub tenant_id: String,
26930    pub r#type: String,
26931    pub title: String,
26932    pub description: String,
26933    pub proposed_by: String,
26934    pub payload: serde_json::Map<String, serde_json::Value>,
26935    pub quorum: f64,
26936    pub status: VotingProposalStatus,
26937    pub deadline: String,
26938    pub created_at: String,
26939    pub updated_at: String,
26940}
26941
26942/// `VotingProposalStatus` enumeration.
26943#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
26944pub enum VotingProposalStatus {
26945    #[default]
26946    #[serde(rename = "open")]
26947    Open,
26948    #[serde(rename = "passed")]
26949    Passed,
26950    #[serde(rename = "rejected")]
26951    Rejected,
26952    #[serde(rename = "expired")]
26953    Expired,
26954    #[serde(rename = "vetoed")]
26955    Vetoed,
26956    /// A value the API introduced after this SDK was generated.
26957    #[serde(untagged)]
26958    Other(String),
26959}
26960
26961impl VotingProposalStatus {
26962    /// The value as it appears on the wire.
26963    pub fn as_str(&self) -> &str {
26964        match self {
26965            Self::Open => "open",
26966            Self::Passed => "passed",
26967            Self::Rejected => "rejected",
26968            Self::Expired => "expired",
26969            Self::Vetoed => "vetoed",
26970            Self::Other(value) => value.as_str(),
26971        }
26972    }
26973}
26974
26975impl std::fmt::Display for VotingProposalStatus {
26976    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26977        f.write_str(self.as_str())
26978    }
26979}
26980
26981impl From<&str> for VotingProposalStatus {
26982    fn from(value: &str) -> Self {
26983        match value {
26984            "open" => Self::Open,
26985            "passed" => Self::Passed,
26986            "rejected" => Self::Rejected,
26987            "expired" => Self::Expired,
26988            "vetoed" => Self::Vetoed,
26989            other => Self::Other(other.to_string()),
26990        }
26991    }
26992}
26993
26994/// webhooks/webhook-manager.ts DeliveryAttempt (7-day TTL).
26995#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26996pub struct WebhookDeliveryAttempt {
26997    pub delivery_id: String,
26998    pub webhook_id: String,
26999    pub tenant_id: String,
27000    pub event_type: WebhookDeliveryAttemptEventType,
27001    pub attempt_number: i64,
27002    pub status: WebhookDeliveryAttemptStatus,
27003    pub request_body: String,
27004    #[serde(default, skip_serializing_if = "Option::is_none")]
27005    pub response_status: Option<i64>,
27006    #[serde(default, skip_serializing_if = "Option::is_none")]
27007    pub error_message: Option<String>,
27008    #[serde(default, skip_serializing_if = "Option::is_none")]
27009    pub latency_ms: Option<f64>,
27010    #[serde(default, skip_serializing_if = "Option::is_none")]
27011    pub next_retry_at: Option<String>,
27012    pub created_at: String,
27013}
27014
27015/// `WebhookDeliveryAttemptEventType` enumeration.
27016#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
27017pub enum WebhookDeliveryAttemptEventType {
27018    #[default]
27019    #[serde(rename = "run.completed")]
27020    RunCompleted,
27021    #[serde(rename = "run.failed")]
27022    RunFailed,
27023    #[serde(rename = "run.cancelled")]
27024    RunCancelled,
27025    #[serde(rename = "agent.created")]
27026    AgentCreated,
27027    #[serde(rename = "agent.updated")]
27028    AgentUpdated,
27029    #[serde(rename = "agent.deleted")]
27030    AgentDeleted,
27031    #[serde(rename = "quota.threshold")]
27032    QuotaThreshold,
27033    #[serde(rename = "quota.exceeded")]
27034    QuotaExceeded,
27035    #[serde(rename = "guardrail.violated")]
27036    GuardrailViolated,
27037    #[serde(rename = "billing.invoice.created")]
27038    BillingInvoiceCreated,
27039    #[serde(rename = "billing.payment.failed")]
27040    BillingPaymentFailed,
27041    #[serde(rename = "eval.auto_rollback")]
27042    EvalAutoRollback,
27043    #[serde(rename = "company.budget_alert")]
27044    CompanyBudgetAlert,
27045    #[serde(rename = "company.budget_exceeded")]
27046    CompanyBudgetExceeded,
27047    #[serde(rename = "company.objective_failed")]
27048    CompanyObjectiveFailed,
27049    #[serde(rename = "company.goal_completed")]
27050    CompanyGoalCompleted,
27051    #[serde(rename = "company.paused")]
27052    CompanyPaused,
27053    /// A value the API introduced after this SDK was generated.
27054    #[serde(untagged)]
27055    Other(String),
27056}
27057
27058impl WebhookDeliveryAttemptEventType {
27059    /// The value as it appears on the wire.
27060    pub fn as_str(&self) -> &str {
27061        match self {
27062            Self::RunCompleted => "run.completed",
27063            Self::RunFailed => "run.failed",
27064            Self::RunCancelled => "run.cancelled",
27065            Self::AgentCreated => "agent.created",
27066            Self::AgentUpdated => "agent.updated",
27067            Self::AgentDeleted => "agent.deleted",
27068            Self::QuotaThreshold => "quota.threshold",
27069            Self::QuotaExceeded => "quota.exceeded",
27070            Self::GuardrailViolated => "guardrail.violated",
27071            Self::BillingInvoiceCreated => "billing.invoice.created",
27072            Self::BillingPaymentFailed => "billing.payment.failed",
27073            Self::EvalAutoRollback => "eval.auto_rollback",
27074            Self::CompanyBudgetAlert => "company.budget_alert",
27075            Self::CompanyBudgetExceeded => "company.budget_exceeded",
27076            Self::CompanyObjectiveFailed => "company.objective_failed",
27077            Self::CompanyGoalCompleted => "company.goal_completed",
27078            Self::CompanyPaused => "company.paused",
27079            Self::Other(value) => value.as_str(),
27080        }
27081    }
27082}
27083
27084impl std::fmt::Display for WebhookDeliveryAttemptEventType {
27085    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27086        f.write_str(self.as_str())
27087    }
27088}
27089
27090impl From<&str> for WebhookDeliveryAttemptEventType {
27091    fn from(value: &str) -> Self {
27092        match value {
27093            "run.completed" => Self::RunCompleted,
27094            "run.failed" => Self::RunFailed,
27095            "run.cancelled" => Self::RunCancelled,
27096            "agent.created" => Self::AgentCreated,
27097            "agent.updated" => Self::AgentUpdated,
27098            "agent.deleted" => Self::AgentDeleted,
27099            "quota.threshold" => Self::QuotaThreshold,
27100            "quota.exceeded" => Self::QuotaExceeded,
27101            "guardrail.violated" => Self::GuardrailViolated,
27102            "billing.invoice.created" => Self::BillingInvoiceCreated,
27103            "billing.payment.failed" => Self::BillingPaymentFailed,
27104            "eval.auto_rollback" => Self::EvalAutoRollback,
27105            "company.budget_alert" => Self::CompanyBudgetAlert,
27106            "company.budget_exceeded" => Self::CompanyBudgetExceeded,
27107            "company.objective_failed" => Self::CompanyObjectiveFailed,
27108            "company.goal_completed" => Self::CompanyGoalCompleted,
27109            "company.paused" => Self::CompanyPaused,
27110            other => Self::Other(other.to_string()),
27111        }
27112    }
27113}
27114
27115/// `WebhookDeliveryAttemptStatus` enumeration.
27116#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
27117pub enum WebhookDeliveryAttemptStatus {
27118    #[default]
27119    #[serde(rename = "pending")]
27120    Pending,
27121    #[serde(rename = "success")]
27122    Success,
27123    #[serde(rename = "failed")]
27124    Failed,
27125    /// A value the API introduced after this SDK was generated.
27126    #[serde(untagged)]
27127    Other(String),
27128}
27129
27130impl WebhookDeliveryAttemptStatus {
27131    /// The value as it appears on the wire.
27132    pub fn as_str(&self) -> &str {
27133        match self {
27134            Self::Pending => "pending",
27135            Self::Success => "success",
27136            Self::Failed => "failed",
27137            Self::Other(value) => value.as_str(),
27138        }
27139    }
27140}
27141
27142impl std::fmt::Display for WebhookDeliveryAttemptStatus {
27143    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27144        f.write_str(self.as_str())
27145    }
27146}
27147
27148impl From<&str> for WebhookDeliveryAttemptStatus {
27149    fn from(value: &str) -> Self {
27150        match value {
27151            "pending" => Self::Pending,
27152            "success" => Self::Success,
27153            "failed" => Self::Failed,
27154            other => Self::Other(other.to_string()),
27155        }
27156    }
27157}
27158
27159/// `WebhookSubscription` model.
27160#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27161pub struct WebhookSubscription {
27162    pub webhook_id: String,
27163    #[serde(default, skip_serializing_if = "Option::is_none")]
27164    pub tenant_id: Option<String>,
27165    pub url: String,
27166    pub events: Vec<String>,
27167    pub status: WebhookSubscriptionStatus,
27168    #[serde(default, skip_serializing_if = "Option::is_none")]
27169    pub created_at: Option<String>,
27170}
27171
27172/// `WebhookSubscriptionStatus` enumeration.
27173#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
27174pub enum WebhookSubscriptionStatus {
27175    #[default]
27176    #[serde(rename = "active")]
27177    Active,
27178    #[serde(rename = "disabled")]
27179    Disabled,
27180    #[serde(rename = "failing")]
27181    Failing,
27182    /// A value the API introduced after this SDK was generated.
27183    #[serde(untagged)]
27184    Other(String),
27185}
27186
27187impl WebhookSubscriptionStatus {
27188    /// The value as it appears on the wire.
27189    pub fn as_str(&self) -> &str {
27190        match self {
27191            Self::Active => "active",
27192            Self::Disabled => "disabled",
27193            Self::Failing => "failing",
27194            Self::Other(value) => value.as_str(),
27195        }
27196    }
27197}
27198
27199impl std::fmt::Display for WebhookSubscriptionStatus {
27200    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27201        f.write_str(self.as_str())
27202    }
27203}
27204
27205impl From<&str> for WebhookSubscriptionStatus {
27206    fn from(value: &str) -> Self {
27207        match value {
27208            "active" => Self::Active,
27209            "disabled" => Self::Disabled,
27210            "failing" => Self::Failing,
27211            other => Self::Other(other.to_string()),
27212        }
27213    }
27214}
27215
27216/// `Workspace` model.
27217#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27218pub struct Workspace {
27219    #[serde(default, skip_serializing_if = "Option::is_none")]
27220    pub file_count: Option<i64>,
27221    #[serde(default, skip_serializing_if = "Option::is_none")]
27222    pub total_size_bytes: Option<i64>,
27223    pub workspace_id: String,
27224    pub tenant_id: String,
27225    #[serde(default, skip_serializing_if = "Option::is_none")]
27226    pub owner_type: Option<WorkspaceOwnerType>,
27227    #[serde(default, skip_serializing_if = "Option::is_none")]
27228    pub owner_id: Option<String>,
27229    pub name: String,
27230    #[serde(default, skip_serializing_if = "Option::is_none")]
27231    pub shared_with: Option<Vec<String>>,
27232    pub assigned_agents: Vec<String>,
27233    #[serde(default, skip_serializing_if = "Option::is_none")]
27234    pub assigned_teams: Option<Vec<String>>,
27235    #[serde(default, skip_serializing_if = "Option::is_none")]
27236    pub assigned_companies: Option<Vec<String>>,
27237    pub created_at: String,
27238    #[serde(default, skip_serializing_if = "Option::is_none")]
27239    pub updated_at: Option<String>,
27240}
27241
27242/// `WorkspaceFile` model.
27243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27244pub struct WorkspaceFile {
27245    /// Lowercase hex sha256 of the content; absent on records written before 2026-09-03
27246    /// (workspace-store.ts).
27247    #[serde(default, skip_serializing_if = "Option::is_none")]
27248    pub etag: Option<String>,
27249    pub file_id: String,
27250    #[serde(default, skip_serializing_if = "Option::is_none")]
27251    pub tenant_id: Option<String>,
27252    pub workspace_id: String,
27253    pub path: String,
27254    #[serde(default, skip_serializing_if = "Option::is_none")]
27255    pub parent_path: Option<String>,
27256    pub filename: String,
27257    #[serde(default, skip_serializing_if = "Option::is_none")]
27258    pub mime_type: Option<String>,
27259    pub size_bytes: i64,
27260    #[serde(default, skip_serializing_if = "Option::is_none")]
27261    pub created_at: Option<String>,
27262    #[serde(default, skip_serializing_if = "Option::is_none")]
27263    pub updated_at: Option<String>,
27264}
27265
27266/// One kept version of a workspace file. Keys as served 2026-09-10.
27267#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27268pub struct WorkspaceFileVersion {
27269    pub file_id: String,
27270    pub tenant_id: String,
27271    pub workspace_id: String,
27272    pub path: String,
27273    pub parent_path: String,
27274    pub filename: String,
27275    pub mime_type: String,
27276    pub size_bytes: i64,
27277    pub created_at: String,
27278}
27279
27280/// `WorkspaceOwnerType` enumeration.
27281#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
27282pub enum WorkspaceOwnerType {
27283    #[default]
27284    #[serde(rename = "agent")]
27285    Agent,
27286    #[serde(rename = "team")]
27287    Team,
27288    #[serde(rename = "standalone")]
27289    Standalone,
27290    /// A value the API introduced after this SDK was generated.
27291    #[serde(untagged)]
27292    Other(String),
27293}
27294
27295impl WorkspaceOwnerType {
27296    /// The value as it appears on the wire.
27297    pub fn as_str(&self) -> &str {
27298        match self {
27299            Self::Agent => "agent",
27300            Self::Team => "team",
27301            Self::Standalone => "standalone",
27302            Self::Other(value) => value.as_str(),
27303        }
27304    }
27305}
27306
27307impl std::fmt::Display for WorkspaceOwnerType {
27308    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27309        f.write_str(self.as_str())
27310    }
27311}
27312
27313impl From<&str> for WorkspaceOwnerType {
27314    fn from(value: &str) -> Self {
27315        match value {
27316            "agent" => Self::Agent,
27317            "team" => Self::Team,
27318            "standalone" => Self::Standalone,
27319            other => Self::Other(other.to_string()),
27320        }
27321    }
27322}