Skip to main content

dagger_sdk/
gen.rs

1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::loadable::Loadable;
8use crate::querybuilder::Selection;
9use derive_builder::Builder;
10use serde::{Deserialize, Serialize};
11use std::sync::Arc;
12
13#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
14pub struct Bytes(pub String);
15impl From<&str> for Bytes {
16    fn from(value: &str) -> Self {
17        Self(value.to_string())
18    }
19}
20impl From<String> for Bytes {
21    fn from(value: String) -> Self {
22        Self(value)
23    }
24}
25impl Bytes {
26    fn quote(&self) -> String {
27        format!("\"{}\"", self.0.clone())
28    }
29}
30#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
31pub struct Id(pub String);
32impl From<&str> for Id {
33    fn from(value: &str) -> Self {
34        Self(value.to_string())
35    }
36}
37impl From<String> for Id {
38    fn from(value: String) -> Self {
39        Self(value)
40    }
41}
42impl IntoID<Id> for Id {
43    fn into_id(
44        self,
45    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
46        Box::pin(async move { Ok::<Id, DaggerError>(self) })
47    }
48}
49impl Id {
50    fn quote(&self) -> String {
51        format!("\"{}\"", self.0.clone())
52    }
53}
54#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
55pub struct Json(pub String);
56impl From<&str> for Json {
57    fn from(value: &str) -> Self {
58        Self(value.to_string())
59    }
60}
61impl From<String> for Json {
62    fn from(value: String) -> Self {
63        Self(value)
64    }
65}
66impl Json {
67    fn quote(&self) -> String {
68        format!("\"{}\"", self.0.clone())
69    }
70}
71#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
72pub struct Platform(pub String);
73impl From<&str> for Platform {
74    fn from(value: &str) -> Self {
75        Self(value.to_string())
76    }
77}
78impl From<String> for Platform {
79    fn from(value: String) -> Self {
80        Self(value)
81    }
82}
83impl Platform {
84    fn quote(&self) -> String {
85        format!("\"{}\"", self.0.clone())
86    }
87}
88#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
89pub struct Void(pub String);
90impl From<&str> for Void {
91    fn from(value: &str) -> Self {
92        Self(value.to_string())
93    }
94}
95impl From<String> for Void {
96    fn from(value: String) -> Self {
97        Self(value)
98    }
99}
100impl Void {
101    fn quote(&self) -> String {
102        format!("\"{}\"", self.0.clone())
103    }
104}
105#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
106pub struct BuildArg {
107    pub name: String,
108    pub value: String,
109}
110#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
111pub struct LlmContentBlockInput {
112    pub arguments: Json,
113    pub call_id: String,
114    pub errored: bool,
115    pub kind: LlmContentBlockKind,
116    pub signature: String,
117    pub text: String,
118    pub tool_name: String,
119}
120#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
121pub struct LlmMessageOriginInput {
122    pub agent_name: String,
123    pub kind: LlmMessageOriginKind,
124    pub r#ref: String,
125    pub reply_to: String,
126}
127#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
128pub struct PipelineLabel {
129    pub name: String,
130    pub value: String,
131}
132#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
133pub struct PortForward {
134    pub backend: isize,
135    pub frontend: isize,
136    pub protocol: NetworkProtocol,
137}
138/// An object that can be exported to the host.
139/// Calling export writes the object to a path on the host filesystem and returns the path that was written.
140pub trait Exportable {
141    fn export(
142        &self,
143        path: impl Into<String>,
144    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
145    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
146}
147#[derive(Clone)]
148pub struct ExportableClient {
149    pub proc: Option<Arc<DaggerSessionProc>>,
150    pub selection: Selection,
151    pub graphql_client: DynGraphQLClient,
152}
153impl IntoID<Id> for ExportableClient {
154    fn into_id(
155        self,
156    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
157        Box::pin(async move { self.id().await })
158    }
159}
160impl ExportableClient {
161    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
162        let mut query = self.selection.select("export");
163        query = query.arg("path", path.into());
164        query.execute(self.graphql_client.clone()).await
165    }
166    pub async fn id(&self) -> Result<Id, DaggerError> {
167        let query = self.selection.select("id");
168        query.execute(self.graphql_client.clone()).await
169    }
170}
171impl Loadable for ExportableClient {
172    fn graphql_type() -> &'static str {
173        "Exportable"
174    }
175    fn from_query(
176        proc: Option<Arc<DaggerSessionProc>>,
177        selection: Selection,
178        graphql_client: DynGraphQLClient,
179    ) -> Self {
180        Self {
181            proc,
182            selection,
183            graphql_client,
184        }
185    }
186}
187impl Exportable for ExportableClient {
188    fn export(
189        &self,
190        path: impl Into<String>,
191    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
192        let mut query = self.selection.select("export");
193        query = query.arg("path", path.into());
194        let graphql_client = self.graphql_client.clone();
195        async move { query.execute(graphql_client).await }
196    }
197    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
198        let query = self.selection.select("id");
199        let graphql_client = self.graphql_client.clone();
200        async move { query.execute(graphql_client).await }
201    }
202}
203/// An object with a globally unique ID.
204pub trait Node {
205    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
206}
207#[derive(Clone)]
208pub struct NodeClient {
209    pub proc: Option<Arc<DaggerSessionProc>>,
210    pub selection: Selection,
211    pub graphql_client: DynGraphQLClient,
212}
213impl IntoID<Id> for NodeClient {
214    fn into_id(
215        self,
216    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
217        Box::pin(async move { self.id().await })
218    }
219}
220impl NodeClient {
221    pub async fn id(&self) -> Result<Id, DaggerError> {
222        let query = self.selection.select("id");
223        query.execute(self.graphql_client.clone()).await
224    }
225}
226impl Loadable for NodeClient {
227    fn graphql_type() -> &'static str {
228        "Node"
229    }
230    fn from_query(
231        proc: Option<Arc<DaggerSessionProc>>,
232        selection: Selection,
233        graphql_client: DynGraphQLClient,
234    ) -> Self {
235        Self {
236            proc,
237            selection,
238            graphql_client,
239        }
240    }
241}
242impl Node for NodeClient {
243    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
244        let query = self.selection.select("id");
245        let graphql_client = self.graphql_client.clone();
246        async move { query.execute(graphql_client).await }
247    }
248}
249/// An object that can be force-evaluated.
250/// Calling sync ensures that the object's entire dependency DAG has been evaluated, returning the object's ID once complete.
251pub trait Syncer {
252    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
253    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send
254    where
255        Self: Sized;
256}
257#[derive(Clone)]
258pub struct SyncerClient {
259    pub proc: Option<Arc<DaggerSessionProc>>,
260    pub selection: Selection,
261    pub graphql_client: DynGraphQLClient,
262}
263impl IntoID<Id> for SyncerClient {
264    fn into_id(
265        self,
266    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
267        Box::pin(async move { self.id().await })
268    }
269}
270impl SyncerClient {
271    pub async fn id(&self) -> Result<Id, DaggerError> {
272        let query = self.selection.select("id");
273        query.execute(self.graphql_client.clone()).await
274    }
275    pub async fn sync(&self) -> Result<SyncerClient, DaggerError> {
276        let query = self.selection.select("sync");
277        let id: Id = query.execute(self.graphql_client.clone()).await?;
278        Ok(SyncerClient {
279            proc: self.proc.clone(),
280            selection: query
281                .root()
282                .select("node")
283                .arg("id", &id.0)
284                .inline_fragment("Syncer"),
285            graphql_client: self.graphql_client.clone(),
286        })
287    }
288}
289impl Loadable for SyncerClient {
290    fn graphql_type() -> &'static str {
291        "Syncer"
292    }
293    fn from_query(
294        proc: Option<Arc<DaggerSessionProc>>,
295        selection: Selection,
296        graphql_client: DynGraphQLClient,
297    ) -> Self {
298        Self {
299            proc,
300            selection,
301            graphql_client,
302        }
303    }
304}
305impl Syncer for SyncerClient {
306    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
307        let query = self.selection.select("id");
308        let graphql_client = self.graphql_client.clone();
309        async move { query.execute(graphql_client).await }
310    }
311    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
312        let query = self.selection.select("sync");
313        let proc = self.proc.clone();
314        let graphql_client = self.graphql_client.clone();
315        async move {
316            let id: Id = query.execute(graphql_client.clone()).await?;
317            Ok(Self {
318                proc,
319                selection: query
320                    .root()
321                    .select("node")
322                    .arg("id", &id.0)
323                    .inline_fragment("Syncer"),
324                graphql_client,
325            })
326        }
327    }
328}
329#[derive(Clone)]
330pub struct Address {
331    pub proc: Option<Arc<DaggerSessionProc>>,
332    pub selection: Selection,
333    pub graphql_client: DynGraphQLClient,
334}
335#[derive(Builder, Debug, PartialEq)]
336pub struct AddressDirectoryOpts<'a> {
337    #[builder(setter(into, strip_option), default)]
338    pub exclude: Option<Vec<&'a str>>,
339    #[builder(setter(into, strip_option), default)]
340    pub gitignore: Option<bool>,
341    #[builder(setter(into, strip_option), default)]
342    pub include: Option<Vec<&'a str>>,
343    #[builder(setter(into, strip_option), default)]
344    pub no_cache: Option<bool>,
345}
346#[derive(Builder, Debug, PartialEq)]
347pub struct AddressFileOpts<'a> {
348    #[builder(setter(into, strip_option), default)]
349    pub exclude: Option<Vec<&'a str>>,
350    #[builder(setter(into, strip_option), default)]
351    pub gitignore: Option<bool>,
352    #[builder(setter(into, strip_option), default)]
353    pub include: Option<Vec<&'a str>>,
354    #[builder(setter(into, strip_option), default)]
355    pub no_cache: Option<bool>,
356}
357impl IntoID<Id> for Address {
358    fn into_id(
359        self,
360    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
361        Box::pin(async move { self.id().await })
362    }
363}
364impl Loadable for Address {
365    fn graphql_type() -> &'static str {
366        "Address"
367    }
368    fn from_query(
369        proc: Option<Arc<DaggerSessionProc>>,
370        selection: Selection,
371        graphql_client: DynGraphQLClient,
372    ) -> Self {
373        Self {
374            proc,
375            selection,
376            graphql_client,
377        }
378    }
379}
380impl Address {
381    /// Load a container from the address.
382    pub fn container(&self) -> Container {
383        let query = self.selection.select("container");
384        Container {
385            proc: self.proc.clone(),
386            selection: query,
387            graphql_client: self.graphql_client.clone(),
388        }
389    }
390    /// Load a directory from the address.
391    ///
392    /// # Arguments
393    ///
394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
395    pub fn directory(&self) -> Directory {
396        let query = self.selection.select("directory");
397        Directory {
398            proc: self.proc.clone(),
399            selection: query,
400            graphql_client: self.graphql_client.clone(),
401        }
402    }
403    /// Load a directory from the address.
404    ///
405    /// # Arguments
406    ///
407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
408    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
409        let mut query = self.selection.select("directory");
410        if let Some(exclude) = opts.exclude {
411            query = query.arg("exclude", exclude);
412        }
413        if let Some(include) = opts.include {
414            query = query.arg("include", include);
415        }
416        if let Some(gitignore) = opts.gitignore {
417            query = query.arg("gitignore", gitignore);
418        }
419        if let Some(no_cache) = opts.no_cache {
420            query = query.arg("noCache", no_cache);
421        }
422        Directory {
423            proc: self.proc.clone(),
424            selection: query,
425            graphql_client: self.graphql_client.clone(),
426        }
427    }
428    /// Load a file from the address.
429    ///
430    /// # Arguments
431    ///
432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
433    pub fn file(&self) -> File {
434        let query = self.selection.select("file");
435        File {
436            proc: self.proc.clone(),
437            selection: query,
438            graphql_client: self.graphql_client.clone(),
439        }
440    }
441    /// Load a file from the address.
442    ///
443    /// # Arguments
444    ///
445    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
446    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
447        let mut query = self.selection.select("file");
448        if let Some(exclude) = opts.exclude {
449            query = query.arg("exclude", exclude);
450        }
451        if let Some(include) = opts.include {
452            query = query.arg("include", include);
453        }
454        if let Some(gitignore) = opts.gitignore {
455            query = query.arg("gitignore", gitignore);
456        }
457        if let Some(no_cache) = opts.no_cache {
458            query = query.arg("noCache", no_cache);
459        }
460        File {
461            proc: self.proc.clone(),
462            selection: query,
463            graphql_client: self.graphql_client.clone(),
464        }
465    }
466    /// Load a git ref (branch, tag or commit) from the address.
467    pub fn git_ref(&self) -> GitRef {
468        let query = self.selection.select("gitRef");
469        GitRef {
470            proc: self.proc.clone(),
471            selection: query,
472            graphql_client: self.graphql_client.clone(),
473        }
474    }
475    /// Load a git repository from the address.
476    pub fn git_repository(&self) -> GitRepository {
477        let query = self.selection.select("gitRepository");
478        GitRepository {
479            proc: self.proc.clone(),
480            selection: query,
481            graphql_client: self.graphql_client.clone(),
482        }
483    }
484    /// A unique identifier for this Address.
485    pub async fn id(&self) -> Result<Id, DaggerError> {
486        let query = self.selection.select("id");
487        query.execute(self.graphql_client.clone()).await
488    }
489    /// Load a secret from the address.
490    pub fn secret(&self) -> Secret {
491        let query = self.selection.select("secret");
492        Secret {
493            proc: self.proc.clone(),
494            selection: query,
495            graphql_client: self.graphql_client.clone(),
496        }
497    }
498    /// Load a service from the address.
499    pub fn service(&self) -> Service {
500        let query = self.selection.select("service");
501        Service {
502            proc: self.proc.clone(),
503            selection: query,
504            graphql_client: self.graphql_client.clone(),
505        }
506    }
507    /// Load a local socket from the address.
508    pub fn socket(&self) -> Socket {
509        let query = self.selection.select("socket");
510        Socket {
511            proc: self.proc.clone(),
512            selection: query,
513            graphql_client: self.graphql_client.clone(),
514        }
515    }
516    /// The address value
517    pub async fn value(&self) -> Result<String, DaggerError> {
518        let query = self.selection.select("value");
519        query.execute(self.graphql_client.clone()).await
520    }
521    /// Load a volume from the address.
522    pub fn volume(&self) -> Volume {
523        let query = self.selection.select("volume");
524        Volume {
525            proc: self.proc.clone(),
526            selection: query,
527            graphql_client: self.graphql_client.clone(),
528        }
529    }
530    /// Load a workspace from a module reference.
531    pub fn workspace(&self) -> Workspace {
532        let query = self.selection.select("workspace");
533        Workspace {
534            proc: self.proc.clone(),
535            selection: query,
536            graphql_client: self.graphql_client.clone(),
537        }
538    }
539}
540impl Node for Address {
541    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
542        let query = self.selection.select("id");
543        let graphql_client = self.graphql_client.clone();
544        async move { query.execute(graphql_client).await }
545    }
546}
547#[derive(Clone)]
548pub struct Agent {
549    pub proc: Option<Arc<DaggerSessionProc>>,
550    pub selection: Selection,
551    pub graphql_client: DynGraphQLClient,
552}
553#[derive(Builder, Debug, PartialEq)]
554pub struct AgentNotifyOpts {
555    /// The lifecycle states that fire an event. IDLE events carry the turn's final reply; FAILED events carry the loop error.
556    #[builder(setter(into, strip_option), default)]
557    pub on: Option<Vec<AgentState>>,
558}
559#[derive(Builder, Debug, PartialEq)]
560pub struct AgentPauseOpts {
561    /// Preempt the in-flight step instead of letting it finish. All completed steps are kept and the interrupted turn stays open: messages it consumed remain pending, while unconsumed mailbox messages are discarded. Resume continues the turn from the last committed step. On an idle, never-started, or failed agent there is nothing to preempt, so this is a plain pause.
562    #[builder(setter(into, strip_option), default)]
563    pub interrupt: Option<bool>,
564}
565#[derive(Builder, Debug, PartialEq)]
566pub struct AgentSendOpts<'a> {
567    /// The ref of a message in the SENDER's own mailbox this send answers (e.g. "#3", from its attribution header). The recipient sees the two paired, and awaiters of the replied-to message resolve with this reply immediately instead of at the sender's turn end.
568    #[builder(setter(into, strip_option), default)]
569    pub reply_to: Option<&'a str>,
570}
571#[derive(Builder, Debug, PartialEq)]
572pub struct AgentStopOpts {
573    /// Cancel the loop immediately instead of letting an in-flight step finish. Either way the completed steps are preserved in the snapshot.
574    #[builder(setter(into, strip_option), default)]
575    pub kill: Option<bool>,
576}
577impl IntoID<Id> for Agent {
578    fn into_id(
579        self,
580    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
581        Box::pin(async move { self.id().await })
582    }
583}
584impl Loadable for Agent {
585    fn graphql_type() -> &'static str {
586        "Agent"
587    }
588    fn from_query(
589        proc: Option<Arc<DaggerSessionProc>>,
590        selection: Selection,
591        graphql_client: DynGraphQLClient,
592    ) -> Self {
593        Self {
594            proc,
595            selection,
596            graphql_client,
597        }
598    }
599}
600impl Agent {
601    /// Why the loop failed, for a FAILED agent; empty otherwise.
602    /// The snapshot holds the completed prefix — send or resume retries from it.
603    pub async fn error(&self) -> Result<String, DaggerError> {
604        let query = self.selection.select("error");
605        query.execute(self.graphql_client.clone()).await
606    }
607    /// The opaque runtime handle minted by the spawn that created this agent.
608    /// It is the same value the agent's loop span publishes as dagger.io/agent.id, so a client can correlate the agent with what it discovers in the trace. Two spawns of an identical composition have different handles; a display name is shared freely.
609    pub async fn handle(&self) -> Result<String, DaggerError> {
610        let query = self.selection.select("handle");
611        query.execute(self.graphql_client.clone()).await
612    }
613    /// A unique identifier for this Agent.
614    pub async fn id(&self) -> Result<Id, DaggerError> {
615        let query = self.selection.select("id");
616        query.execute(self.graphql_client.clone()).await
617    }
618    /// Look up a previously sent message by its ref.
619    /// This is the lookup send pins its result's identity through: the returned handle's ID is an honest, replayable chain, addressable from any request in the session (the cancel-and-request-again contract).
620    /// Fails if the agent has no runtime entry in this session, or no record of the given ref.
621    ///
622    /// # Arguments
623    ///
624    /// * `r#ref` - The message's short ref within this agent's runtime, e.g. "#3": the token its attribution header shows and a reply's replyTo names. A bare ordinal ("3") is accepted too.
625    pub fn message(&self, r#ref: impl Into<String>) -> AgentMessage {
626        let mut query = self.selection.select("message");
627        query = query.arg("ref", r#ref.into());
628        AgentMessage {
629            proc: self.proc.clone(),
630            selection: query,
631            graphql_client: self.graphql_client.clone(),
632        }
633    }
634    /// Display label for the agent; carries no identity.
635    pub async fn name(&self) -> Result<String, DaggerError> {
636        let query = self.selection.select("name");
637        query.execute(self.graphql_client.clone()).await
638    }
639    /// Subscribe another agent to this agent's lifecycle: each transition into one of the given states enqueues an event message to the subscriber — steering its open turn, or waking it if idle, like any other message.
640    /// This is how a supervisor hears every completion and failure without polling or blocking: subscribe at spawn time, keep working, and events arrive as attributed messages.
641    /// Events never relaunch a stopped subscriber, and an already-reached state fires immediately at subscribe time, so a fast agent settling before the subscription lands is not missed.
642    /// Idempotent per subscriber; re-subscribing replaces the state set.
643    ///
644    /// # Arguments
645    ///
646    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
647    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
648    pub async fn notify(&self, subscriber: impl IntoID<Id>) -> Result<Agent, DaggerError> {
649        let mut query = self.selection.select("notify");
650        query = query.arg_lazy(
651            "subscriber",
652            Box::new(move || {
653                let subscriber = subscriber.clone();
654                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
655            }),
656        );
657        let id: Id = query.execute(self.graphql_client.clone()).await?;
658        Ok(Agent {
659            proc: self.proc.clone(),
660            selection: query
661                .root()
662                .select("node")
663                .arg("id", &id.0)
664                .inline_fragment("Agent"),
665            graphql_client: self.graphql_client.clone(),
666        })
667    }
668    /// Subscribe another agent to this agent's lifecycle: each transition into one of the given states enqueues an event message to the subscriber — steering its open turn, or waking it if idle, like any other message.
669    /// This is how a supervisor hears every completion and failure without polling or blocking: subscribe at spawn time, keep working, and events arrive as attributed messages.
670    /// Events never relaunch a stopped subscriber, and an already-reached state fires immediately at subscribe time, so a fast agent settling before the subscription lands is not missed.
671    /// Idempotent per subscriber; re-subscribing replaces the state set.
672    ///
673    /// # Arguments
674    ///
675    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
676    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
677    pub async fn notify_opts(
678        &self,
679        subscriber: impl IntoID<Id>,
680        opts: AgentNotifyOpts,
681    ) -> Result<Agent, DaggerError> {
682        let mut query = self.selection.select("notify");
683        query = query.arg_lazy(
684            "subscriber",
685            Box::new(move || {
686                let subscriber = subscriber.clone();
687                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
688            }),
689        );
690        if let Some(on) = opts.on {
691            query = query.arg("on", on);
692        }
693        let id: Id = query.execute(self.graphql_client.clone()).await?;
694        Ok(Agent {
695            proc: self.proc.clone(),
696            selection: query
697                .root()
698                .select("node")
699                .arg("id", &id.0)
700                .inline_fragment("Agent"),
701            graphql_client: self.graphql_client.clone(),
702        })
703    }
704    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
705    /// Pause takes priority over pending work: a mid-turn pause suspends the turn, which resume continues. Messages sent while paused enqueue with QUEUED delivery until a resume.
706    /// Pausing a never-started agent leaves it paused for its eventual resume; pausing a failed agent is allowed (resume decides the retry); pausing a stopped agent fails.
707    ///
708    /// # Arguments
709    ///
710    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
711    pub async fn pause(&self) -> Result<Agent, DaggerError> {
712        let query = self.selection.select("pause");
713        let id: Id = query.execute(self.graphql_client.clone()).await?;
714        Ok(Agent {
715            proc: self.proc.clone(),
716            selection: query
717                .root()
718                .select("node")
719                .arg("id", &id.0)
720                .inline_fragment("Agent"),
721            graphql_client: self.graphql_client.clone(),
722        })
723    }
724    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
725    /// Pause takes priority over pending work: a mid-turn pause suspends the turn, which resume continues. Messages sent while paused enqueue with QUEUED delivery until a resume.
726    /// Pausing a never-started agent leaves it paused for its eventual resume; pausing a failed agent is allowed (resume decides the retry); pausing a stopped agent fails.
727    ///
728    /// # Arguments
729    ///
730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
731    pub async fn pause_opts(&self, opts: AgentPauseOpts) -> Result<Agent, DaggerError> {
732        let mut query = self.selection.select("pause");
733        if let Some(interrupt) = opts.interrupt {
734            query = query.arg("interrupt", interrupt);
735        }
736        let id: Id = query.execute(self.graphql_client.clone()).await?;
737        Ok(Agent {
738            proc: self.proc.clone(),
739            selection: query
740                .root()
741                .select("node")
742                .arg("id", &id.0)
743                .inline_fragment("Agent"),
744            graphql_client: self.graphql_client.clone(),
745        })
746    }
747    /// Replace this instance's committed conversation with the given one, keeping the entry: identity, mailbox, and lifecycle state are untouched. A paused suspended turn is abandoned and its consumed messages are resolved before replacement.
748    /// This is the continuity verb. Compaction, a workspace rebind, a model change, or rewinding an interrupted prompt produce a new conversation value for the SAME agent; reseed swaps it in place, where a stop-and-respawn would mint a successor instance and split the agent across two roster entries. It is the client-facing form of what a continuation tool already does mid-turn: the agent adopts a new conversation without changing who it is.
749    /// The next turn continues from the reseeded conversation, and queued messages drain onto it. A FAILED agent keeps its error — resume retries from the new conversation.
750    /// Fails if the instance has no runtime entry in this session (only a spawned or re-hydrated instance holds a conversation to replace), if a step is in flight, or if the agent is stopped.
751    ///
752    /// # Arguments
753    ///
754    /// * `conversation` - The conversation that becomes the agent's committed history, replacing the current one.
755    pub async fn reseed(&self, conversation: impl IntoID<Id>) -> Result<Agent, DaggerError> {
756        let mut query = self.selection.select("reseed");
757        query = query.arg_lazy(
758            "conversation",
759            Box::new(move || {
760                let conversation = conversation.clone();
761                Box::pin(async move { conversation.into_id().await.unwrap().quote() })
762            }),
763        );
764        let id: Id = query.execute(self.graphql_client.clone()).await?;
765        Ok(Agent {
766            proc: self.proc.clone(),
767            selection: query
768                .root()
769                .select("node")
770                .arg("id", &id.0)
771                .inline_fragment("Agent"),
772            graphql_client: self.graphql_client.clone(),
773        })
774    }
775    /// Resume draining the mailbox: a suspended turn continues from the last committed step, and queued messages drain.
776    /// Resuming a never-started agent starts its evaluation loop, detached from the calling request: it steps the conversation while input is pending, then idles awaiting further lifecycle operations. Resuming a FAILED agent retries its pending step. Resuming a STOPPED agent relaunches the same instance from its last committed snapshot.
777    /// No-op on a running or idle agent.
778    pub async fn resume(&self) -> Result<Agent, DaggerError> {
779        let query = self.selection.select("resume");
780        let id: Id = query.execute(self.graphql_client.clone()).await?;
781        Ok(Agent {
782            proc: self.proc.clone(),
783            selection: query
784                .root()
785                .select("node")
786                .arg("id", &id.0)
787                .inline_fragment("Agent"),
788            graphql_client: self.graphql_client.clone(),
789        })
790    }
791    /// Enqueue a message, on the record: it is consumed at a step boundary, appends to the agent's history, and steers the running turn or opens a new one.
792    /// Never blocks, never drops; concurrent sends queue in order.
793    /// The returned message is pinned through the message lookup field, so its handle is re-addressable from any request in the session: cancel a response request and request it again freely.
794    /// Sending to a never-started agent starts it (signal-with-start). Sending to a stopped agent restarts the same instance from its last committed snapshot. Sending to a paused or failed agent enqueues with QUEUED delivery, to be drained by a resume.
795    ///
796    /// # Arguments
797    ///
798    /// * `message` - The message text, appended to the agent's history as a prompt when a turn consumes it.
799    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
800    pub async fn send(&self, message: impl Into<String>) -> Result<AgentMessage, DaggerError> {
801        let mut query = self.selection.select("send");
802        query = query.arg("message", message.into());
803        let id: Id = query.execute(self.graphql_client.clone()).await?;
804        Ok(AgentMessage {
805            proc: self.proc.clone(),
806            selection: query
807                .root()
808                .select("node")
809                .arg("id", &id.0)
810                .inline_fragment("AgentMessage"),
811            graphql_client: self.graphql_client.clone(),
812        })
813    }
814    /// Enqueue a message, on the record: it is consumed at a step boundary, appends to the agent's history, and steers the running turn or opens a new one.
815    /// Never blocks, never drops; concurrent sends queue in order.
816    /// The returned message is pinned through the message lookup field, so its handle is re-addressable from any request in the session: cancel a response request and request it again freely.
817    /// Sending to a never-started agent starts it (signal-with-start). Sending to a stopped agent restarts the same instance from its last committed snapshot. Sending to a paused or failed agent enqueues with QUEUED delivery, to be drained by a resume.
818    ///
819    /// # Arguments
820    ///
821    /// * `message` - The message text, appended to the agent's history as a prompt when a turn consumes it.
822    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
823    pub async fn send_opts<'a>(
824        &self,
825        message: impl Into<String>,
826        opts: AgentSendOpts<'a>,
827    ) -> Result<AgentMessage, DaggerError> {
828        let mut query = self.selection.select("send");
829        query = query.arg("message", message.into());
830        if let Some(reply_to) = opts.reply_to {
831            query = query.arg("replyTo", reply_to);
832        }
833        let id: Id = query.execute(self.graphql_client.clone()).await?;
834        Ok(AgentMessage {
835            proc: self.proc.clone(),
836            selection: query
837                .root()
838                .select("node")
839                .arg("id", &id.0)
840                .inline_fragment("AgentMessage"),
841            graphql_client: self.graphql_client.clone(),
842        })
843    }
844    /// The conversation as of the last committed step: immutable, branchable, persistable.
845    /// The seed conversation if the agent never stepped.
846    /// Branching from it does not affect the agent.
847    pub fn snapshot(&self) -> Llm {
848        let query = self.selection.select("snapshot");
849        Llm {
850            proc: self.proc.clone(),
851            selection: query,
852            graphql_client: self.graphql_client.clone(),
853        }
854    }
855    /// Computed lifecycle state; never stored.
856    /// An agent that was never started reports IDLE: its mailbox is empty and no turn is open.
857    pub async fn state(&self) -> Result<AgentState, DaggerError> {
858        let query = self.selection.select("state");
859        query.execute(self.graphql_client.clone()).await
860    }
861    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
862    ///
863    /// # Arguments
864    ///
865    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
866    pub async fn stop(&self) -> Result<Agent, DaggerError> {
867        let query = self.selection.select("stop");
868        let id: Id = query.execute(self.graphql_client.clone()).await?;
869        Ok(Agent {
870            proc: self.proc.clone(),
871            selection: query
872                .root()
873                .select("node")
874                .arg("id", &id.0)
875                .inline_fragment("Agent"),
876            graphql_client: self.graphql_client.clone(),
877        })
878    }
879    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
880    ///
881    /// # Arguments
882    ///
883    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
884    pub async fn stop_opts(&self, opts: AgentStopOpts) -> Result<Agent, DaggerError> {
885        let mut query = self.selection.select("stop");
886        if let Some(kill) = opts.kill {
887            query = query.arg("kill", kill);
888        }
889        let id: Id = query.execute(self.graphql_client.clone()).await?;
890        Ok(Agent {
891            proc: self.proc.clone(),
892            selection: query
893                .root()
894                .select("node")
895                .arg("id", &id.0)
896                .inline_fragment("Agent"),
897            graphql_client: self.graphql_client.clone(),
898        })
899    }
900    /// Block until the agent settles: IDLE, FAILED, or STOPPED. Read which from state afterwards.
901    /// Unlike waiting for one exact state, this cannot hang merely because the agent settled in a different outcome.
902    pub async fn wait(&self) -> Result<Agent, DaggerError> {
903        let query = self.selection.select("wait");
904        let id: Id = query.execute(self.graphql_client.clone()).await?;
905        Ok(Agent {
906            proc: self.proc.clone(),
907            selection: query
908                .root()
909                .select("node")
910                .arg("id", &id.0)
911                .inline_fragment("Agent"),
912            graphql_client: self.graphql_client.clone(),
913        })
914    }
915}
916impl Node for Agent {
917    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
918        let query = self.selection.select("id");
919        let graphql_client = self.graphql_client.clone();
920        async move { query.execute(graphql_client).await }
921    }
922}
923#[derive(Clone)]
924pub struct AgentMessage {
925    pub proc: Option<Arc<DaggerSessionProc>>,
926    pub selection: Selection,
927    pub graphql_client: DynGraphQLClient,
928}
929impl IntoID<Id> for AgentMessage {
930    fn into_id(
931        self,
932    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
933        Box::pin(async move { self.id().await })
934    }
935}
936impl Loadable for AgentMessage {
937    fn graphql_type() -> &'static str {
938        "AgentMessage"
939    }
940    fn from_query(
941        proc: Option<Arc<DaggerSessionProc>>,
942        selection: Selection,
943        graphql_client: DynGraphQLClient,
944    ) -> Self {
945        Self {
946            proc,
947            selection,
948            graphql_client,
949        }
950    }
951}
952impl AgentMessage {
953    /// How the message conclusively landed: opened a new turn (STARTED), was absorbed into the running turn at a step boundary (STEERED), or queued behind it (QUEUED).
954    /// Blocks until provider or native lifecycle evidence is conclusive. Once recorded, the result or cancellation error is immutable.
955    pub async fn delivery(&self) -> Result<AgentMessageDelivery, DaggerError> {
956        let query = self.selection.select("delivery");
957        query.execute(self.graphql_client.clone()).await
958    }
959    /// A unique identifier for this AgentMessage.
960    pub async fn id(&self) -> Result<Id, DaggerError> {
961        let query = self.selection.select("id");
962        query.execute(self.graphql_client.clone()).await
963    }
964    /// The message's short ref within the receiving agent's runtime, e.g. "#3".
965    /// This is the deterministic token the recipient's attribution header shows and a reply's replyTo names — quote it when telling the recipient what to answer.
966    pub async fn r#ref(&self) -> Result<String, DaggerError> {
967        let query = self.selection.select("ref");
968        query.execute(self.graphql_client.clone()).await
969    }
970    /// Block until this message is answered, and return the answer: an explicit reply (a send whose replyTo names this message), or the final reply of the turn that consumed it, whichever comes first.
971    /// Idempotent: cancel and request the response again freely; concurrent waiters share the result.
972    /// Fails if the agent stops before the message resolves. On a failed agent it projects the failure — but the message stays pending, so after a resume consumes it, requesting the response again returns the real reply.
973    /// Refused when called from inside an agent turn whose wait would deadlock: turns should not block on other agents — send without awaiting, and the reply arrives as a message.
974    pub async fn response(&self) -> Result<String, DaggerError> {
975        let query = self.selection.select("response");
976        query.execute(self.graphql_client.clone()).await
977    }
978}
979impl Node for AgentMessage {
980    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
981        let query = self.selection.select("id");
982        let graphql_client = self.graphql_client.clone();
983        async move { query.execute(graphql_client).await }
984    }
985}
986#[derive(Clone)]
987pub struct AgentMiddleware {
988    pub proc: Option<Arc<DaggerSessionProc>>,
989    pub selection: Selection,
990    pub graphql_client: DynGraphQLClient,
991}
992impl IntoID<Id> for AgentMiddleware {
993    fn into_id(
994        self,
995    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
996        Box::pin(async move { self.id().await })
997    }
998}
999impl Loadable for AgentMiddleware {
1000    fn graphql_type() -> &'static str {
1001        "AgentMiddleware"
1002    }
1003    fn from_query(
1004        proc: Option<Arc<DaggerSessionProc>>,
1005        selection: Selection,
1006        graphql_client: DynGraphQLClient,
1007    ) -> Self {
1008        Self {
1009            proc,
1010            selection,
1011            graphql_client,
1012        }
1013    }
1014}
1015impl AgentMiddleware {
1016    /// The description of the agent
1017    pub async fn description(&self) -> Result<String, DaggerError> {
1018        let query = self.selection.select("description");
1019        query.execute(self.graphql_client.clone()).await
1020    }
1021    /// A unique identifier for this AgentMiddleware.
1022    pub async fn id(&self) -> Result<Id, DaggerError> {
1023        let query = self.selection.select("id");
1024        query.execute(self.graphql_client.clone()).await
1025    }
1026    /// Return the command name of the agent. Entrypoint targets omit the module prefix.
1027    pub async fn name(&self) -> Result<String, DaggerError> {
1028        let query = self.selection.select("name");
1029        query.execute(self.graphql_client.clone()).await
1030    }
1031    /// The original module in which the agent has been defined
1032    pub fn original_module(&self) -> Module {
1033        let query = self.selection.select("originalModule");
1034        Module {
1035            proc: self.proc.clone(),
1036            selection: query,
1037            graphql_client: self.graphql_client.clone(),
1038        }
1039    }
1040    /// The path of the agent within its module
1041    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1042        let query = self.selection.select("path");
1043        query.execute(self.graphql_client.clone()).await
1044    }
1045}
1046impl Node for AgentMiddleware {
1047    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1048        let query = self.selection.select("id");
1049        let graphql_client = self.graphql_client.clone();
1050        async move { query.execute(graphql_client).await }
1051    }
1052}
1053#[derive(Clone)]
1054pub struct AgentMiddlewareGroup {
1055    pub proc: Option<Arc<DaggerSessionProc>>,
1056    pub selection: Selection,
1057    pub graphql_client: DynGraphQLClient,
1058}
1059#[derive(Builder, Debug, PartialEq)]
1060pub struct AgentMiddlewareGroupComposeOpts {
1061    /// The base LLM to compose onto. Defaults to a fresh workspace-bound LLM.
1062    #[builder(setter(into, strip_option), default)]
1063    pub base: Option<Id>,
1064}
1065impl IntoID<Id> for AgentMiddlewareGroup {
1066    fn into_id(
1067        self,
1068    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1069        Box::pin(async move { self.id().await })
1070    }
1071}
1072impl Loadable for AgentMiddlewareGroup {
1073    fn graphql_type() -> &'static str {
1074        "AgentMiddlewareGroup"
1075    }
1076    fn from_query(
1077        proc: Option<Arc<DaggerSessionProc>>,
1078        selection: Selection,
1079        graphql_client: DynGraphQLClient,
1080    ) -> Self {
1081        Self {
1082            proc,
1083            selection,
1084            graphql_client,
1085        }
1086    }
1087}
1088impl AgentMiddlewareGroup {
1089    /// Compose all selected agent middlewares onto a base LLM, in alphabetical module:fn order, and return the composed LLM.
1090    ///
1091    /// # Arguments
1092    ///
1093    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1094    pub fn compose(&self) -> Llm {
1095        let query = self.selection.select("compose");
1096        Llm {
1097            proc: self.proc.clone(),
1098            selection: query,
1099            graphql_client: self.graphql_client.clone(),
1100        }
1101    }
1102    /// Compose all selected agent middlewares onto a base LLM, in alphabetical module:fn order, and return the composed LLM.
1103    ///
1104    /// # Arguments
1105    ///
1106    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1107    pub fn compose_opts(&self, opts: AgentMiddlewareGroupComposeOpts) -> Llm {
1108        let mut query = self.selection.select("compose");
1109        if let Some(base) = opts.base {
1110            query = query.arg("base", base);
1111        }
1112        Llm {
1113            proc: self.proc.clone(),
1114            selection: query,
1115            graphql_client: self.graphql_client.clone(),
1116        }
1117    }
1118    /// A unique identifier for this AgentMiddlewareGroup.
1119    pub async fn id(&self) -> Result<Id, DaggerError> {
1120        let query = self.selection.select("id");
1121        query.execute(self.graphql_client.clone()).await
1122    }
1123    /// Return a list of individual agents and their details
1124    pub async fn list(&self) -> Result<Vec<AgentMiddleware>, DaggerError> {
1125        let query = self.selection.select("list");
1126        let query = query.select("id");
1127        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1128        Ok(ids
1129            .into_iter()
1130            .map(|id| AgentMiddleware {
1131                proc: self.proc.clone(),
1132                selection: crate::querybuilder::query()
1133                    .select("node")
1134                    .arg("id", &id.0)
1135                    .inline_fragment("AgentMiddleware"),
1136                graphql_client: self.graphql_client.clone(),
1137            })
1138            .collect())
1139    }
1140}
1141impl Node for AgentMiddlewareGroup {
1142    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1143        let query = self.selection.select("id");
1144        let graphql_client = self.graphql_client.clone();
1145        async move { query.execute(graphql_client).await }
1146    }
1147}
1148#[derive(Clone)]
1149pub struct CacheVolume {
1150    pub proc: Option<Arc<DaggerSessionProc>>,
1151    pub selection: Selection,
1152    pub graphql_client: DynGraphQLClient,
1153}
1154impl IntoID<Id> for CacheVolume {
1155    fn into_id(
1156        self,
1157    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1158        Box::pin(async move { self.id().await })
1159    }
1160}
1161impl Loadable for CacheVolume {
1162    fn graphql_type() -> &'static str {
1163        "CacheVolume"
1164    }
1165    fn from_query(
1166        proc: Option<Arc<DaggerSessionProc>>,
1167        selection: Selection,
1168        graphql_client: DynGraphQLClient,
1169    ) -> Self {
1170        Self {
1171            proc,
1172            selection,
1173            graphql_client,
1174        }
1175    }
1176}
1177impl CacheVolume {
1178    /// A unique identifier for this CacheVolume.
1179    pub async fn id(&self) -> Result<Id, DaggerError> {
1180        let query = self.selection.select("id");
1181        query.execute(self.graphql_client.clone()).await
1182    }
1183}
1184impl Node for CacheVolume {
1185    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1186        let query = self.selection.select("id");
1187        let graphql_client = self.graphql_client.clone();
1188        async move { query.execute(graphql_client).await }
1189    }
1190}
1191#[derive(Clone)]
1192pub struct Changeset {
1193    pub proc: Option<Arc<DaggerSessionProc>>,
1194    pub selection: Selection,
1195    pub graphql_client: DynGraphQLClient,
1196}
1197#[derive(Builder, Debug, PartialEq)]
1198pub struct ChangesetFilterOpts<'a> {
1199    /// Exclude changes at paths matching these patterns.
1200    #[builder(setter(into, strip_option), default)]
1201    pub exclude: Option<Vec<&'a str>>,
1202    /// Only include changes at paths matching these patterns. Empty includes all paths.
1203    #[builder(setter(into, strip_option), default)]
1204    pub include: Option<Vec<&'a str>>,
1205}
1206#[derive(Builder, Debug, PartialEq)]
1207pub struct ChangesetWithChangesetOpts {
1208    /// What to do on a merge conflict
1209    #[builder(setter(into, strip_option), default)]
1210    pub on_conflict: Option<ChangesetMergeConflict>,
1211}
1212#[derive(Builder, Debug, PartialEq)]
1213pub struct ChangesetWithChangesetsOpts {
1214    /// What to do on a merge conflict
1215    #[builder(setter(into, strip_option), default)]
1216    pub on_conflict: Option<ChangesetsMergeConflict>,
1217}
1218impl IntoID<Id> for Changeset {
1219    fn into_id(
1220        self,
1221    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1222        Box::pin(async move { self.id().await })
1223    }
1224}
1225impl Loadable for Changeset {
1226    fn graphql_type() -> &'static str {
1227        "Changeset"
1228    }
1229    fn from_query(
1230        proc: Option<Arc<DaggerSessionProc>>,
1231        selection: Selection,
1232        graphql_client: DynGraphQLClient,
1233    ) -> Self {
1234        Self {
1235            proc,
1236            selection,
1237            graphql_client,
1238        }
1239    }
1240}
1241impl Changeset {
1242    /// Files and directories that were added in the newer directory.
1243    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
1244        let query = self.selection.select("addedPaths");
1245        query.execute(self.graphql_client.clone()).await
1246    }
1247    /// The newer/upper snapshot.
1248    pub fn after(&self) -> Directory {
1249        let query = self.selection.select("after");
1250        Directory {
1251            proc: self.proc.clone(),
1252            selection: query,
1253            graphql_client: self.graphql_client.clone(),
1254        }
1255    }
1256    /// Return a Git-compatible patch of the changes
1257    pub fn as_patch(&self) -> File {
1258        let query = self.selection.select("asPatch");
1259        File {
1260            proc: self.proc.clone(),
1261            selection: query,
1262            graphql_client: self.graphql_client.clone(),
1263        }
1264    }
1265    /// The older/lower snapshot to compare against.
1266    pub fn before(&self) -> Directory {
1267        let query = self.selection.select("before");
1268        Directory {
1269            proc: self.proc.clone(),
1270            selection: query,
1271            graphql_client: self.graphql_client.clone(),
1272        }
1273    }
1274    /// Structured per-path diff statistics (kind and line counts) for this changeset.
1275    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
1276        let query = self.selection.select("diffStats");
1277        let query = query.select("id");
1278        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1279        Ok(ids
1280            .into_iter()
1281            .map(|id| DiffStat {
1282                proc: self.proc.clone(),
1283                selection: crate::querybuilder::query()
1284                    .select("node")
1285                    .arg("id", &id.0)
1286                    .inline_fragment("DiffStat"),
1287                graphql_client: self.graphql_client.clone(),
1288            })
1289            .collect())
1290    }
1291    /// Applies the diff represented by this changeset to a path on the host.
1292    ///
1293    /// # Arguments
1294    ///
1295    /// * `path` - Location of the copied directory (e.g., "logs/").
1296    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
1297        let mut query = self.selection.select("export");
1298        query = query.arg("path", path.into());
1299        query.execute(self.graphql_client.clone()).await
1300    }
1301    /// Select changes matching the supplied glob patterns, preserving their original baseline.
1302    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
1303    ///
1304    /// # Arguments
1305    ///
1306    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1307    pub fn filter(&self) -> Changeset {
1308        let query = self.selection.select("filter");
1309        Changeset {
1310            proc: self.proc.clone(),
1311            selection: query,
1312            graphql_client: self.graphql_client.clone(),
1313        }
1314    }
1315    /// Select changes matching the supplied glob patterns, preserving their original baseline.
1316    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
1317    ///
1318    /// # Arguments
1319    ///
1320    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1321    pub fn filter_opts<'a>(&self, opts: ChangesetFilterOpts<'a>) -> Changeset {
1322        let mut query = self.selection.select("filter");
1323        if let Some(include) = opts.include {
1324            query = query.arg("include", include);
1325        }
1326        if let Some(exclude) = opts.exclude {
1327            query = query.arg("exclude", exclude);
1328        }
1329        Changeset {
1330            proc: self.proc.clone(),
1331            selection: query,
1332            graphql_client: self.graphql_client.clone(),
1333        }
1334    }
1335    /// A unique identifier for this Changeset.
1336    pub async fn id(&self) -> Result<Id, DaggerError> {
1337        let query = self.selection.select("id");
1338        query.execute(self.graphql_client.clone()).await
1339    }
1340    /// Returns true if the changeset is empty (i.e. there are no changes).
1341    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
1342        let query = self.selection.select("isEmpty");
1343        query.execute(self.graphql_client.clone()).await
1344    }
1345    /// Return a snapshot containing only the created and modified files
1346    pub fn layer(&self) -> Directory {
1347        let query = self.selection.select("layer");
1348        Directory {
1349            proc: self.proc.clone(),
1350            selection: query,
1351            graphql_client: self.graphql_client.clone(),
1352        }
1353    }
1354    /// Files and directories that existed before and were updated in the newer directory.
1355    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
1356        let query = self.selection.select("modifiedPaths");
1357        query.execute(self.graphql_client.clone()).await
1358    }
1359    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
1360    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
1361        let query = self.selection.select("removedPaths");
1362        query.execute(self.graphql_client.clone()).await
1363    }
1364    /// Force evaluation in the engine.
1365    pub async fn sync(&self) -> Result<Changeset, DaggerError> {
1366        let query = self.selection.select("sync");
1367        let id: Id = query.execute(self.graphql_client.clone()).await?;
1368        Ok(Changeset {
1369            proc: self.proc.clone(),
1370            selection: query
1371                .root()
1372                .select("node")
1373                .arg("id", &id.0)
1374                .inline_fragment("Changeset"),
1375            graphql_client: self.graphql_client.clone(),
1376        })
1377    }
1378    /// Add changes to an existing changeset
1379    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
1380    ///
1381    /// # Arguments
1382    ///
1383    /// * `changes` - Changes to merge into the actual changeset
1384    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1385    pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
1386        let mut query = self.selection.select("withChangeset");
1387        query = query.arg_lazy(
1388            "changes",
1389            Box::new(move || {
1390                let changes = changes.clone();
1391                Box::pin(async move { changes.into_id().await.unwrap().quote() })
1392            }),
1393        );
1394        Changeset {
1395            proc: self.proc.clone(),
1396            selection: query,
1397            graphql_client: self.graphql_client.clone(),
1398        }
1399    }
1400    /// Add changes to an existing changeset
1401    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
1402    ///
1403    /// # Arguments
1404    ///
1405    /// * `changes` - Changes to merge into the actual changeset
1406    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1407    pub fn with_changeset_opts(
1408        &self,
1409        changes: impl IntoID<Id>,
1410        opts: ChangesetWithChangesetOpts,
1411    ) -> Changeset {
1412        let mut query = self.selection.select("withChangeset");
1413        query = query.arg_lazy(
1414            "changes",
1415            Box::new(move || {
1416                let changes = changes.clone();
1417                Box::pin(async move { changes.into_id().await.unwrap().quote() })
1418            }),
1419        );
1420        if let Some(on_conflict) = opts.on_conflict {
1421            query = query.arg("onConflict", on_conflict);
1422        }
1423        Changeset {
1424            proc: self.proc.clone(),
1425            selection: query,
1426            graphql_client: self.graphql_client.clone(),
1427        }
1428    }
1429    /// Add changes from multiple changesets using git octopus merge strategy
1430    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
1431    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
1432    ///
1433    /// # Arguments
1434    ///
1435    /// * `changes` - List of changesets to merge into the actual changeset
1436    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1437    pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
1438        let mut query = self.selection.select("withChangesets");
1439        query = query.arg("changes", changes);
1440        Changeset {
1441            proc: self.proc.clone(),
1442            selection: query,
1443            graphql_client: self.graphql_client.clone(),
1444        }
1445    }
1446    /// Add changes from multiple changesets using git octopus merge strategy
1447    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
1448    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
1449    ///
1450    /// # Arguments
1451    ///
1452    /// * `changes` - List of changesets to merge into the actual changeset
1453    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1454    pub fn with_changesets_opts(
1455        &self,
1456        changes: Vec<Id>,
1457        opts: ChangesetWithChangesetsOpts,
1458    ) -> Changeset {
1459        let mut query = self.selection.select("withChangesets");
1460        query = query.arg("changes", changes);
1461        if let Some(on_conflict) = opts.on_conflict {
1462            query = query.arg("onConflict", on_conflict);
1463        }
1464        Changeset {
1465            proc: self.proc.clone(),
1466            selection: query,
1467            graphql_client: self.graphql_client.clone(),
1468        }
1469    }
1470}
1471impl Exportable for Changeset {
1472    fn export(
1473        &self,
1474        path: impl Into<String>,
1475    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
1476        let mut query = self.selection.select("export");
1477        query = query.arg("path", path.into());
1478        let graphql_client = self.graphql_client.clone();
1479        async move { query.execute(graphql_client).await }
1480    }
1481    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1482        let query = self.selection.select("id");
1483        let graphql_client = self.graphql_client.clone();
1484        async move { query.execute(graphql_client).await }
1485    }
1486}
1487impl Node for Changeset {
1488    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1489        let query = self.selection.select("id");
1490        let graphql_client = self.graphql_client.clone();
1491        async move { query.execute(graphql_client).await }
1492    }
1493}
1494impl Syncer for Changeset {
1495    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1496        let query = self.selection.select("id");
1497        let graphql_client = self.graphql_client.clone();
1498        async move { query.execute(graphql_client).await }
1499    }
1500    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
1501        let query = self.selection.select("sync");
1502        let proc = self.proc.clone();
1503        let graphql_client = self.graphql_client.clone();
1504        async move {
1505            let id: Id = query.execute(graphql_client.clone()).await?;
1506            Ok(Self {
1507                proc,
1508                selection: query
1509                    .root()
1510                    .select("node")
1511                    .arg("id", &id.0)
1512                    .inline_fragment("Changeset"),
1513                graphql_client,
1514            })
1515        }
1516    }
1517}
1518#[derive(Clone)]
1519pub struct Check {
1520    pub proc: Option<Arc<DaggerSessionProc>>,
1521    pub selection: Selection,
1522    pub graphql_client: DynGraphQLClient,
1523}
1524impl IntoID<Id> for Check {
1525    fn into_id(
1526        self,
1527    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1528        Box::pin(async move { self.id().await })
1529    }
1530}
1531impl Loadable for Check {
1532    fn graphql_type() -> &'static str {
1533        "Check"
1534    }
1535    fn from_query(
1536        proc: Option<Arc<DaggerSessionProc>>,
1537        selection: Selection,
1538        graphql_client: DynGraphQLClient,
1539    ) -> Self {
1540        Self {
1541            proc,
1542            selection,
1543            graphql_client,
1544        }
1545    }
1546}
1547impl Check {
1548    /// The type of check: 'check' for annotated checks, 'generate' for generate-as-checks, 'load' for a workspace module that could not be loaded
1549    pub async fn check_type(&self) -> Result<String, DaggerError> {
1550        let query = self.selection.select("checkType");
1551        query.execute(self.graphql_client.clone()).await
1552    }
1553    /// Whether the check completed
1554    pub async fn completed(&self) -> Result<bool, DaggerError> {
1555        let query = self.selection.select("completed");
1556        query.execute(self.graphql_client.clone()).await
1557    }
1558    /// The description of the check
1559    pub async fn description(&self) -> Result<String, DaggerError> {
1560        let query = self.selection.select("description");
1561        query.execute(self.graphql_client.clone()).await
1562    }
1563    /// If the check failed, this is the error
1564    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1565        let query = self.selection.select("error");
1566        let query = query.select("id");
1567        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1568        Ok(id.map(|id| Error {
1569            proc: self.proc.clone(),
1570            selection: query
1571                .root()
1572                .select("node")
1573                .arg("id", &id.0)
1574                .inline_fragment("Error"),
1575            graphql_client: self.graphql_client.clone(),
1576        }))
1577    }
1578    /// A unique identifier for this Check.
1579    pub async fn id(&self) -> Result<Id, DaggerError> {
1580        let query = self.selection.select("id");
1581        query.execute(self.graphql_client.clone()).await
1582    }
1583    /// Return the command name of the check. Entrypoint targets omit the module prefix.
1584    pub async fn name(&self) -> Result<String, DaggerError> {
1585        let query = self.selection.select("name");
1586        query.execute(self.graphql_client.clone()).await
1587    }
1588    /// The original module in which the check has been defined
1589    pub fn original_module(&self) -> Module {
1590        let query = self.selection.select("originalModule");
1591        Module {
1592            proc: self.proc.clone(),
1593            selection: query,
1594            graphql_client: self.graphql_client.clone(),
1595        }
1596    }
1597    /// Whether the check passed
1598    pub async fn passed(&self) -> Result<bool, DaggerError> {
1599        let query = self.selection.select("passed");
1600        query.execute(self.graphql_client.clone()).await
1601    }
1602    /// The path of the check within its module
1603    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1604        let query = self.selection.select("path");
1605        query.execute(self.graphql_client.clone()).await
1606    }
1607    /// An emoji representing the result of the check
1608    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1609        let query = self.selection.select("resultEmoji");
1610        query.execute(self.graphql_client.clone()).await
1611    }
1612    /// Execute the check
1613    pub fn run(&self) -> Check {
1614        let query = self.selection.select("run");
1615        Check {
1616            proc: self.proc.clone(),
1617            selection: query,
1618            graphql_client: self.graphql_client.clone(),
1619        }
1620    }
1621}
1622impl Node for Check {
1623    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1624        let query = self.selection.select("id");
1625        let graphql_client = self.graphql_client.clone();
1626        async move { query.execute(graphql_client).await }
1627    }
1628}
1629#[derive(Clone)]
1630pub struct CheckGroup {
1631    pub proc: Option<Arc<DaggerSessionProc>>,
1632    pub selection: Selection,
1633    pub graphql_client: DynGraphQLClient,
1634}
1635#[derive(Builder, Debug, PartialEq)]
1636pub struct CheckGroupRunOpts {
1637    /// If true, stop running checks as soon as any check fails.
1638    #[builder(setter(into, strip_option), default)]
1639    pub fail_fast: Option<bool>,
1640}
1641impl IntoID<Id> for CheckGroup {
1642    fn into_id(
1643        self,
1644    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1645        Box::pin(async move { self.id().await })
1646    }
1647}
1648impl Loadable for CheckGroup {
1649    fn graphql_type() -> &'static str {
1650        "CheckGroup"
1651    }
1652    fn from_query(
1653        proc: Option<Arc<DaggerSessionProc>>,
1654        selection: Selection,
1655        graphql_client: DynGraphQLClient,
1656    ) -> Self {
1657        Self {
1658            proc,
1659            selection,
1660            graphql_client,
1661        }
1662    }
1663}
1664impl CheckGroup {
1665    /// A unique identifier for this CheckGroup.
1666    pub async fn id(&self) -> Result<Id, DaggerError> {
1667        let query = self.selection.select("id");
1668        query.execute(self.graphql_client.clone()).await
1669    }
1670    /// Return a list of individual checks and their details
1671    pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1672        let query = self.selection.select("list");
1673        let query = query.select("id");
1674        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1675        Ok(ids
1676            .into_iter()
1677            .map(|id| Check {
1678                proc: self.proc.clone(),
1679                selection: crate::querybuilder::query()
1680                    .select("node")
1681                    .arg("id", &id.0)
1682                    .inline_fragment("Check"),
1683                graphql_client: self.graphql_client.clone(),
1684            })
1685            .collect())
1686    }
1687    /// Generate a markdown report
1688    pub fn report(&self) -> File {
1689        let query = self.selection.select("report");
1690        File {
1691            proc: self.proc.clone(),
1692            selection: query,
1693            graphql_client: self.graphql_client.clone(),
1694        }
1695    }
1696    /// Execute all selected checks
1697    ///
1698    /// # Arguments
1699    ///
1700    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1701    pub fn run(&self) -> CheckGroup {
1702        let query = self.selection.select("run");
1703        CheckGroup {
1704            proc: self.proc.clone(),
1705            selection: query,
1706            graphql_client: self.graphql_client.clone(),
1707        }
1708    }
1709    /// Execute all selected checks
1710    ///
1711    /// # Arguments
1712    ///
1713    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1714    pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1715        let mut query = self.selection.select("run");
1716        if let Some(fail_fast) = opts.fail_fast {
1717            query = query.arg("failFast", fail_fast);
1718        }
1719        CheckGroup {
1720            proc: self.proc.clone(),
1721            selection: query,
1722            graphql_client: self.graphql_client.clone(),
1723        }
1724    }
1725}
1726impl Node for CheckGroup {
1727    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1728        let query = self.selection.select("id");
1729        let graphql_client = self.graphql_client.clone();
1730        async move { query.execute(graphql_client).await }
1731    }
1732}
1733#[derive(Clone)]
1734pub struct ClientFilesyncMirror {
1735    pub proc: Option<Arc<DaggerSessionProc>>,
1736    pub selection: Selection,
1737    pub graphql_client: DynGraphQLClient,
1738}
1739impl IntoID<Id> for ClientFilesyncMirror {
1740    fn into_id(
1741        self,
1742    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1743        Box::pin(async move { self.id().await })
1744    }
1745}
1746impl Loadable for ClientFilesyncMirror {
1747    fn graphql_type() -> &'static str {
1748        "ClientFilesyncMirror"
1749    }
1750    fn from_query(
1751        proc: Option<Arc<DaggerSessionProc>>,
1752        selection: Selection,
1753        graphql_client: DynGraphQLClient,
1754    ) -> Self {
1755        Self {
1756            proc,
1757            selection,
1758            graphql_client,
1759        }
1760    }
1761}
1762impl ClientFilesyncMirror {
1763    /// A unique identifier for this ClientFilesyncMirror.
1764    pub async fn id(&self) -> Result<Id, DaggerError> {
1765        let query = self.selection.select("id");
1766        query.execute(self.graphql_client.clone()).await
1767    }
1768}
1769impl Node for ClientFilesyncMirror {
1770    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1771        let query = self.selection.select("id");
1772        let graphql_client = self.graphql_client.clone();
1773        async move { query.execute(graphql_client).await }
1774    }
1775}
1776#[derive(Clone)]
1777pub struct Cloud {
1778    pub proc: Option<Arc<DaggerSessionProc>>,
1779    pub selection: Selection,
1780    pub graphql_client: DynGraphQLClient,
1781}
1782impl IntoID<Id> for Cloud {
1783    fn into_id(
1784        self,
1785    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1786        Box::pin(async move { self.id().await })
1787    }
1788}
1789impl Loadable for Cloud {
1790    fn graphql_type() -> &'static str {
1791        "Cloud"
1792    }
1793    fn from_query(
1794        proc: Option<Arc<DaggerSessionProc>>,
1795        selection: Selection,
1796        graphql_client: DynGraphQLClient,
1797    ) -> Self {
1798        Self {
1799            proc,
1800            selection,
1801            graphql_client,
1802        }
1803    }
1804}
1805impl Cloud {
1806    /// A unique identifier for this Cloud.
1807    pub async fn id(&self) -> Result<Id, DaggerError> {
1808        let query = self.selection.select("id");
1809        query.execute(self.graphql_client.clone()).await
1810    }
1811    /// The trace URL for the current session
1812    pub async fn trace_url(&self) -> Result<String, DaggerError> {
1813        let query = self.selection.select("traceURL");
1814        query.execute(self.graphql_client.clone()).await
1815    }
1816}
1817impl Node for Cloud {
1818    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1819        let query = self.selection.select("id");
1820        let graphql_client = self.graphql_client.clone();
1821        async move { query.execute(graphql_client).await }
1822    }
1823}
1824#[derive(Clone)]
1825pub struct Container {
1826    pub proc: Option<Arc<DaggerSessionProc>>,
1827    pub selection: Selection,
1828    pub graphql_client: DynGraphQLClient,
1829}
1830#[derive(Builder, Debug, PartialEq)]
1831pub struct ContainerAsServiceOpts<'a> {
1832    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1833    /// If empty, the container's default command is used.
1834    #[builder(setter(into, strip_option), default)]
1835    pub args: Option<Vec<&'a str>>,
1836    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1837    #[builder(setter(into, strip_option), default)]
1838    pub expand: Option<bool>,
1839    /// Provides Dagger access to the executed command.
1840    #[builder(setter(into, strip_option), default)]
1841    pub experimental_privileged_nesting: Option<bool>,
1842    /// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
1843    #[builder(setter(into, strip_option), default)]
1844    pub insecure_root_capabilities: Option<bool>,
1845    /// If set, skip the automatic init process injected into containers by default.
1846    /// This should only be used if the user requires that their exec process be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
1847    #[builder(setter(into, strip_option), default)]
1848    pub no_init: Option<bool>,
1849    /// If the container has an entrypoint, prepend it to the args.
1850    #[builder(setter(into, strip_option), default)]
1851    pub use_entrypoint: Option<bool>,
1852}
1853#[derive(Builder, Debug, PartialEq)]
1854pub struct ContainerAsTarballOpts {
1855    /// Force each layer of the image to use the specified compression algorithm.
1856    /// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
1857    #[builder(setter(into, strip_option), default)]
1858    pub forced_compression: Option<ImageLayerCompression>,
1859    /// Use the specified media types for the image's layers.
1860    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1861    #[builder(setter(into, strip_option), default)]
1862    pub media_types: Option<ImageMediaTypes>,
1863    /// Identifiers for other platform specific containers.
1864    /// Used for multi-platform images.
1865    #[builder(setter(into, strip_option), default)]
1866    pub platform_variants: Option<Vec<Id>>,
1867}
1868#[derive(Builder, Debug, PartialEq)]
1869pub struct ContainerDirectoryOpts {
1870    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1871    #[builder(setter(into, strip_option), default)]
1872    pub expand: Option<bool>,
1873}
1874#[derive(Builder, Debug, PartialEq)]
1875pub struct ContainerExistsOpts {
1876    /// If specified, do not follow symlinks.
1877    #[builder(setter(into, strip_option), default)]
1878    pub do_not_follow_symlinks: Option<bool>,
1879    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1880    #[builder(setter(into, strip_option), default)]
1881    pub expand: Option<bool>,
1882    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
1883    #[builder(setter(into, strip_option), default)]
1884    pub expected_type: Option<ExistsType>,
1885}
1886#[derive(Builder, Debug, PartialEq)]
1887pub struct ContainerExportOpts {
1888    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1889    #[builder(setter(into, strip_option), default)]
1890    pub expand: Option<bool>,
1891    /// Force each layer of the exported image to use the specified compression algorithm.
1892    /// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
1893    #[builder(setter(into, strip_option), default)]
1894    pub forced_compression: Option<ImageLayerCompression>,
1895    /// Use the specified media types for the exported image's layers.
1896    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1897    #[builder(setter(into, strip_option), default)]
1898    pub media_types: Option<ImageMediaTypes>,
1899    /// Identifiers for other platform specific containers.
1900    /// Used for multi-platform image.
1901    #[builder(setter(into, strip_option), default)]
1902    pub platform_variants: Option<Vec<Id>>,
1903}
1904#[derive(Builder, Debug, PartialEq)]
1905pub struct ContainerExportImageOpts {
1906    /// Force each layer of the exported image to use the specified compression algorithm.
1907    /// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
1908    #[builder(setter(into, strip_option), default)]
1909    pub forced_compression: Option<ImageLayerCompression>,
1910    /// Use the specified media types for the exported image's layers.
1911    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1912    #[builder(setter(into, strip_option), default)]
1913    pub media_types: Option<ImageMediaTypes>,
1914    /// Identifiers for other platform specific containers.
1915    /// Used for multi-platform image.
1916    #[builder(setter(into, strip_option), default)]
1917    pub platform_variants: Option<Vec<Id>>,
1918}
1919#[derive(Builder, Debug, PartialEq)]
1920pub struct ContainerFileOpts {
1921    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1922    #[builder(setter(into, strip_option), default)]
1923    pub expand: Option<bool>,
1924}
1925#[derive(Builder, Debug, PartialEq)]
1926pub struct ContainerFromOpts<'a> {
1927    /// Allow HTTPS registry communication without verifying the server certificate.
1928    #[builder(setter(into, strip_option), default)]
1929    pub insecure_skip_tls_verify: Option<bool>,
1930    /// Protocol to use for registry communication.
1931    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
1932    #[builder(setter(into, strip_option), default)]
1933    pub protocol: Option<RegistryProtocol>,
1934    /// Service to use as the registry endpoint for the image address.
1935    /// The service will be started only for this pull.
1936    #[builder(setter(into, strip_option), default)]
1937    pub registry_service: Option<Id>,
1938    /// Version query used to select an image tag. The address must not contain a tag or digest.
1939    #[builder(setter(into, strip_option), default)]
1940    pub version: Option<&'a str>,
1941}
1942#[derive(Builder, Debug, PartialEq)]
1943pub struct ContainerImportOpts<'a> {
1944    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1945    #[builder(setter(into, strip_option), default)]
1946    pub tag: Option<&'a str>,
1947}
1948#[derive(Builder, Debug, PartialEq)]
1949pub struct ContainerLayerOpts {
1950    /// Force each layer of the image to use the specified compression algorithm.
1951    /// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
1952    #[builder(setter(into, strip_option), default)]
1953    pub forced_compression: Option<ImageLayerCompression>,
1954    /// Media types to use for image layers. Defaults to OCI.
1955    #[builder(setter(into, strip_option), default)]
1956    pub media_types: Option<ImageMediaTypes>,
1957}
1958#[derive(Builder, Debug, PartialEq)]
1959pub struct ContainerManifestOpts {
1960    /// Force each layer of the image to use the specified compression algorithm.
1961    /// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
1962    #[builder(setter(into, strip_option), default)]
1963    pub forced_compression: Option<ImageLayerCompression>,
1964    /// Media types to use for image layers. Defaults to OCI.
1965    #[builder(setter(into, strip_option), default)]
1966    pub media_types: Option<ImageMediaTypes>,
1967}
1968#[derive(Builder, Debug, PartialEq)]
1969pub struct ContainerPublishOpts {
1970    /// Force each layer of the published image to use the specified compression algorithm.
1971    /// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
1972    #[builder(setter(into, strip_option), default)]
1973    pub forced_compression: Option<ImageLayerCompression>,
1974    /// Allow HTTPS registry communication without verifying the server certificate.
1975    #[builder(setter(into, strip_option), default)]
1976    pub insecure_skip_tls_verify: Option<bool>,
1977    /// Use the specified media types for the published image's layers.
1978    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1979    #[builder(setter(into, strip_option), default)]
1980    pub media_types: Option<ImageMediaTypes>,
1981    /// Identifiers for other platform specific containers.
1982    /// Used for multi-platform image.
1983    #[builder(setter(into, strip_option), default)]
1984    pub platform_variants: Option<Vec<Id>>,
1985    /// Protocol to use for registry communication.
1986    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
1987    #[builder(setter(into, strip_option), default)]
1988    pub protocol: Option<RegistryProtocol>,
1989    /// Service to use as the registry endpoint for the image address.
1990    /// The service will be started only for this push.
1991    #[builder(setter(into, strip_option), default)]
1992    pub registry_service: Option<Id>,
1993}
1994#[derive(Builder, Debug, PartialEq)]
1995pub struct ContainerStatOpts {
1996    /// If specified, do not follow symlinks.
1997    #[builder(setter(into, strip_option), default)]
1998    pub do_not_follow_symlinks: Option<bool>,
1999}
2000#[derive(Builder, Debug, PartialEq)]
2001pub struct ContainerTerminalOpts<'a> {
2002    /// If set, override the container's default terminal command and invoke these command arguments instead.
2003    #[builder(setter(into, strip_option), default)]
2004    pub cmd: Option<Vec<&'a str>>,
2005    /// Provides Dagger access to the executed command.
2006    #[builder(setter(into, strip_option), default)]
2007    pub experimental_privileged_nesting: Option<bool>,
2008    /// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
2009    #[builder(setter(into, strip_option), default)]
2010    pub insecure_root_capabilities: Option<bool>,
2011}
2012#[derive(Builder, Debug, PartialEq)]
2013pub struct ContainerUpOpts<'a> {
2014    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2015    /// If empty, the container's default command is used.
2016    #[builder(setter(into, strip_option), default)]
2017    pub args: Option<Vec<&'a str>>,
2018    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2019    #[builder(setter(into, strip_option), default)]
2020    pub expand: Option<bool>,
2021    /// Provides Dagger access to the executed command.
2022    #[builder(setter(into, strip_option), default)]
2023    pub experimental_privileged_nesting: Option<bool>,
2024    /// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
2025    #[builder(setter(into, strip_option), default)]
2026    pub insecure_root_capabilities: Option<bool>,
2027    /// If set, skip the automatic init process injected into containers by default.
2028    /// This should only be used if the user requires that their exec process be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
2029    #[builder(setter(into, strip_option), default)]
2030    pub no_init: Option<bool>,
2031    /// List of frontend/backend port mappings to forward.
2032    /// Frontend is the port accepting traffic on the host, backend is the service port.
2033    #[builder(setter(into, strip_option), default)]
2034    pub ports: Option<Vec<PortForward>>,
2035    /// Bind each tunnel port to a random port on the host.
2036    #[builder(setter(into, strip_option), default)]
2037    pub random: Option<bool>,
2038    /// If the container has an entrypoint, prepend it to the args.
2039    #[builder(setter(into, strip_option), default)]
2040    pub use_entrypoint: Option<bool>,
2041}
2042#[derive(Builder, Debug, PartialEq)]
2043pub struct ContainerWithDefaultTerminalCmdOpts {
2044    /// Provides Dagger access to the executed command.
2045    #[builder(setter(into, strip_option), default)]
2046    pub experimental_privileged_nesting: Option<bool>,
2047    /// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
2048    #[builder(setter(into, strip_option), default)]
2049    pub insecure_root_capabilities: Option<bool>,
2050}
2051#[derive(Builder, Debug, PartialEq)]
2052pub struct ContainerWithDirectoryOpts<'a> {
2053    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2054    #[builder(setter(into, strip_option), default)]
2055    pub exclude: Option<Vec<&'a str>>,
2056    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2057    #[builder(setter(into, strip_option), default)]
2058    pub expand: Option<bool>,
2059    /// Apply .gitignore rules when writing the directory.
2060    #[builder(setter(into, strip_option), default)]
2061    pub gitignore: Option<bool>,
2062    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2063    #[builder(setter(into, strip_option), default)]
2064    pub include: Option<Vec<&'a str>>,
2065    /// Set the owner to the container's current user.
2066    #[builder(setter(into, strip_option), default)]
2067    pub inherit_owner: Option<bool>,
2068    /// A user:group to set for the directory and its contents.
2069    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2070    /// If the group is omitted, it defaults to the same as the user.
2071    #[builder(setter(into, strip_option), default)]
2072    pub owner: Option<&'a str>,
2073    #[builder(setter(into, strip_option), default)]
2074    pub permissions: Option<isize>,
2075}
2076#[derive(Builder, Debug, PartialEq)]
2077pub struct ContainerWithDockerHealthcheckOpts<'a> {
2078    /// Interval between running healthcheck. Example: "30s"
2079    #[builder(setter(into, strip_option), default)]
2080    pub interval: Option<&'a str>,
2081    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
2082    #[builder(setter(into, strip_option), default)]
2083    pub retries: Option<isize>,
2084    /// When true, command must be a single element, which is run using the container's shell
2085    #[builder(setter(into, strip_option), default)]
2086    pub shell: Option<bool>,
2087    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
2088    #[builder(setter(into, strip_option), default)]
2089    pub start_interval: Option<&'a str>,
2090    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
2091    #[builder(setter(into, strip_option), default)]
2092    pub start_period: Option<&'a str>,
2093    /// Healthcheck timeout. Example: "3s"
2094    #[builder(setter(into, strip_option), default)]
2095    pub timeout: Option<&'a str>,
2096}
2097#[derive(Builder, Debug, PartialEq)]
2098pub struct ContainerWithEntrypointOpts {
2099    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
2100    #[builder(setter(into, strip_option), default)]
2101    pub keep_default_args: Option<bool>,
2102}
2103#[derive(Builder, Debug, PartialEq)]
2104pub struct ContainerWithEnvVariableOpts {
2105    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2106    #[builder(setter(into, strip_option), default)]
2107    pub expand: Option<bool>,
2108}
2109#[derive(Builder, Debug, PartialEq)]
2110pub struct ContainerWithExecOpts<'a> {
2111    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2112    #[builder(setter(into, strip_option), default)]
2113    pub expand: Option<bool>,
2114    /// Exit codes this command is allowed to exit with without error
2115    #[builder(setter(into, strip_option), default)]
2116    pub expect: Option<ReturnType>,
2117    /// Provides Dagger access to the executed command.
2118    #[builder(setter(into, strip_option), default)]
2119    pub experimental_privileged_nesting: Option<bool>,
2120    /// Execute the command with all root capabilities. Like --privileged in Docker
2121    /// DANGER: this grants the command full access to the host system. Only use when 1) you trust the command being executed and 2) you specifically need this level of access.
2122    #[builder(setter(into, strip_option), default)]
2123    pub insecure_root_capabilities: Option<bool>,
2124    /// Skip the automatic init process injected into containers by default.
2125    /// Only use this if you specifically need the command to be pid 1 in the container. Otherwise it may result in unexpected behavior. If you're not sure, you don't need this.
2126    #[builder(setter(into, strip_option), default)]
2127    pub no_init: Option<bool>,
2128    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
2129    #[builder(setter(into, strip_option), default)]
2130    pub redirect_stderr: Option<&'a str>,
2131    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
2132    #[builder(setter(into, strip_option), default)]
2133    pub redirect_stdin: Option<&'a str>,
2134    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
2135    #[builder(setter(into, strip_option), default)]
2136    pub redirect_stdout: Option<&'a str>,
2137    /// Content to write to the command's standard input. Example: "Hello world")
2138    #[builder(setter(into, strip_option), default)]
2139    pub stdin: Option<&'a str>,
2140    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
2141    #[builder(setter(into, strip_option), default)]
2142    pub use_entrypoint: Option<bool>,
2143}
2144#[derive(Builder, Debug, PartialEq)]
2145pub struct ContainerWithExposedPortOpts<'a> {
2146    /// Port description. Example: "payment API endpoint"
2147    #[builder(setter(into, strip_option), default)]
2148    pub description: Option<&'a str>,
2149    /// Skip the health check when run as a service.
2150    #[builder(setter(into, strip_option), default)]
2151    pub experimental_skip_healthcheck: Option<bool>,
2152    /// Network protocol. Example: "tcp"
2153    #[builder(setter(into, strip_option), default)]
2154    pub protocol: Option<NetworkProtocol>,
2155}
2156#[derive(Builder, Debug, PartialEq)]
2157pub struct ContainerWithFileOpts<'a> {
2158    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2159    #[builder(setter(into, strip_option), default)]
2160    pub expand: Option<bool>,
2161    /// Set the owner to the container's current user.
2162    #[builder(setter(into, strip_option), default)]
2163    pub inherit_owner: Option<bool>,
2164    /// A user:group to set for the file.
2165    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2166    /// If the group is omitted, it defaults to the same as the user.
2167    #[builder(setter(into, strip_option), default)]
2168    pub owner: Option<&'a str>,
2169    /// Permissions of the new file. Example: 0600
2170    #[builder(setter(into, strip_option), default)]
2171    pub permissions: Option<isize>,
2172}
2173#[derive(Builder, Debug, PartialEq)]
2174pub struct ContainerWithFilesOpts<'a> {
2175    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2176    #[builder(setter(into, strip_option), default)]
2177    pub expand: Option<bool>,
2178    /// Set the owner to the container's current user.
2179    #[builder(setter(into, strip_option), default)]
2180    pub inherit_owner: Option<bool>,
2181    /// A user:group to set for the files.
2182    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2183    /// If the group is omitted, it defaults to the same as the user.
2184    #[builder(setter(into, strip_option), default)]
2185    pub owner: Option<&'a str>,
2186    /// Permission given to the copied files (e.g., 0600).
2187    #[builder(setter(into, strip_option), default)]
2188    pub permissions: Option<isize>,
2189}
2190#[derive(Builder, Debug, PartialEq)]
2191pub struct ContainerWithMountedCacheOpts<'a> {
2192    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2193    #[builder(setter(into, strip_option), default)]
2194    pub expand: Option<bool>,
2195    /// Set the owner to the container's current user.
2196    #[builder(setter(into, strip_option), default)]
2197    pub inherit_owner: Option<bool>,
2198    /// A user:group to set for the mounted cache directory.
2199    /// Note that this changes the ownership of the specified mount along with the initial filesystem provided by source (if any). It does not have any effect if/when the cache has already been created.
2200    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2201    /// If the group is omitted, it defaults to the same as the user.
2202    #[builder(setter(into, strip_option), default)]
2203    pub owner: Option<&'a str>,
2204    /// Sharing mode of the cache volume.
2205    #[builder(setter(into, strip_option), default)]
2206    pub sharing: Option<CacheSharingMode>,
2207    /// Identifier of the directory to use as the cache volume's root.
2208    #[builder(setter(into, strip_option), default)]
2209    pub source: Option<Id>,
2210}
2211#[derive(Builder, Debug, PartialEq)]
2212pub struct ContainerWithMountedDirectoryOpts<'a> {
2213    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2214    #[builder(setter(into, strip_option), default)]
2215    pub expand: Option<bool>,
2216    /// Set the owner to the container's current user.
2217    #[builder(setter(into, strip_option), default)]
2218    pub inherit_owner: Option<bool>,
2219    /// A user:group to set for the mounted directory and its contents.
2220    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2221    /// If the group is omitted, it defaults to the same as the user.
2222    #[builder(setter(into, strip_option), default)]
2223    pub owner: Option<&'a str>,
2224    /// Mount the directory read-only.
2225    #[builder(setter(into, strip_option), default)]
2226    pub read_only: Option<bool>,
2227}
2228#[derive(Builder, Debug, PartialEq)]
2229pub struct ContainerWithMountedFileOpts<'a> {
2230    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2231    #[builder(setter(into, strip_option), default)]
2232    pub expand: Option<bool>,
2233    /// Set the owner to the container's current user.
2234    #[builder(setter(into, strip_option), default)]
2235    pub inherit_owner: Option<bool>,
2236    /// A user or user:group to set for the mounted file.
2237    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2238    /// If the group is omitted, it defaults to the same as the user.
2239    #[builder(setter(into, strip_option), default)]
2240    pub owner: Option<&'a str>,
2241}
2242#[derive(Builder, Debug, PartialEq)]
2243pub struct ContainerWithMountedSecretOpts<'a> {
2244    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2245    #[builder(setter(into, strip_option), default)]
2246    pub expand: Option<bool>,
2247    /// Set the owner to the container's current user.
2248    #[builder(setter(into, strip_option), default)]
2249    pub inherit_owner: Option<bool>,
2250    /// Permission given to the mounted secret (e.g., 0600).
2251    /// This option requires an owner to be set to be active.
2252    #[builder(setter(into, strip_option), default)]
2253    pub mode: Option<isize>,
2254    /// A user:group to set for the mounted secret.
2255    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2256    /// If the group is omitted, it defaults to the same as the user.
2257    #[builder(setter(into, strip_option), default)]
2258    pub owner: Option<&'a str>,
2259}
2260#[derive(Builder, Debug, PartialEq)]
2261pub struct ContainerWithMountedTempOpts {
2262    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2263    #[builder(setter(into, strip_option), default)]
2264    pub expand: Option<bool>,
2265    /// Size of the temporary directory in bytes.
2266    #[builder(setter(into, strip_option), default)]
2267    pub size: Option<isize>,
2268}
2269#[derive(Builder, Debug, PartialEq)]
2270pub struct ContainerWithMountedVolumeOpts {
2271    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2272    #[builder(setter(into, strip_option), default)]
2273    pub expand: Option<bool>,
2274    /// Mount the volume read-only.
2275    #[builder(setter(into, strip_option), default)]
2276    pub read_only: Option<bool>,
2277}
2278#[derive(Builder, Debug, PartialEq)]
2279pub struct ContainerWithNewFileOpts<'a> {
2280    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2281    #[builder(setter(into, strip_option), default)]
2282    pub expand: Option<bool>,
2283    /// Set the owner to the container's current user.
2284    #[builder(setter(into, strip_option), default)]
2285    pub inherit_owner: Option<bool>,
2286    /// A user:group to set for the file.
2287    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2288    /// If the group is omitted, it defaults to the same as the user.
2289    #[builder(setter(into, strip_option), default)]
2290    pub owner: Option<&'a str>,
2291    /// Permissions of the new file. Example: 0600
2292    #[builder(setter(into, strip_option), default)]
2293    pub permissions: Option<isize>,
2294}
2295#[derive(Builder, Debug, PartialEq)]
2296pub struct ContainerWithSymlinkOpts {
2297    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2298    #[builder(setter(into, strip_option), default)]
2299    pub expand: Option<bool>,
2300}
2301#[derive(Builder, Debug, PartialEq)]
2302pub struct ContainerWithUnixSocketOpts<'a> {
2303    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2304    #[builder(setter(into, strip_option), default)]
2305    pub expand: Option<bool>,
2306    /// Set the owner to the container's current user.
2307    #[builder(setter(into, strip_option), default)]
2308    pub inherit_owner: Option<bool>,
2309    /// A user:group to set for the mounted socket.
2310    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2311    /// If the group is omitted, it defaults to the same as the user.
2312    #[builder(setter(into, strip_option), default)]
2313    pub owner: Option<&'a str>,
2314}
2315#[derive(Builder, Debug, PartialEq)]
2316pub struct ContainerWithWorkdirOpts {
2317    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2318    #[builder(setter(into, strip_option), default)]
2319    pub expand: Option<bool>,
2320}
2321#[derive(Builder, Debug, PartialEq)]
2322pub struct ContainerWithoutDirectoryOpts {
2323    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2324    #[builder(setter(into, strip_option), default)]
2325    pub expand: Option<bool>,
2326}
2327#[derive(Builder, Debug, PartialEq)]
2328pub struct ContainerWithoutEntrypointOpts {
2329    /// Don't remove the default arguments when unsetting the entrypoint.
2330    #[builder(setter(into, strip_option), default)]
2331    pub keep_default_args: Option<bool>,
2332}
2333#[derive(Builder, Debug, PartialEq)]
2334pub struct ContainerWithoutExposedPortOpts {
2335    /// Port protocol to unexpose
2336    #[builder(setter(into, strip_option), default)]
2337    pub protocol: Option<NetworkProtocol>,
2338}
2339#[derive(Builder, Debug, PartialEq)]
2340pub struct ContainerWithoutFileOpts {
2341    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2342    #[builder(setter(into, strip_option), default)]
2343    pub expand: Option<bool>,
2344}
2345#[derive(Builder, Debug, PartialEq)]
2346pub struct ContainerWithoutFilesOpts {
2347    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2348    #[builder(setter(into, strip_option), default)]
2349    pub expand: Option<bool>,
2350}
2351#[derive(Builder, Debug, PartialEq)]
2352pub struct ContainerWithoutMountOpts {
2353    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2354    #[builder(setter(into, strip_option), default)]
2355    pub expand: Option<bool>,
2356}
2357#[derive(Builder, Debug, PartialEq)]
2358pub struct ContainerWithoutUnixSocketOpts {
2359    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2360    #[builder(setter(into, strip_option), default)]
2361    pub expand: Option<bool>,
2362}
2363impl IntoID<Id> for Container {
2364    fn into_id(
2365        self,
2366    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2367        Box::pin(async move { self.id().await })
2368    }
2369}
2370impl Loadable for Container {
2371    fn graphql_type() -> &'static str {
2372        "Container"
2373    }
2374    fn from_query(
2375        proc: Option<Arc<DaggerSessionProc>>,
2376        selection: Selection,
2377        graphql_client: DynGraphQLClient,
2378    ) -> Self {
2379        Self {
2380            proc,
2381            selection,
2382            graphql_client,
2383        }
2384    }
2385}
2386impl Container {
2387    /// Turn the container into a Service.
2388    /// Be sure to set any exposed ports before this conversion.
2389    ///
2390    /// # Arguments
2391    ///
2392    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2393    pub fn as_service(&self) -> Service {
2394        let query = self.selection.select("asService");
2395        Service {
2396            proc: self.proc.clone(),
2397            selection: query,
2398            graphql_client: self.graphql_client.clone(),
2399        }
2400    }
2401    /// Turn the container into a Service.
2402    /// Be sure to set any exposed ports before this conversion.
2403    ///
2404    /// # Arguments
2405    ///
2406    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2407    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2408        let mut query = self.selection.select("asService");
2409        if let Some(args) = opts.args {
2410            query = query.arg("args", args);
2411        }
2412        if let Some(use_entrypoint) = opts.use_entrypoint {
2413            query = query.arg("useEntrypoint", use_entrypoint);
2414        }
2415        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2416            query = query.arg(
2417                "experimentalPrivilegedNesting",
2418                experimental_privileged_nesting,
2419            );
2420        }
2421        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2422            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2423        }
2424        if let Some(expand) = opts.expand {
2425            query = query.arg("expand", expand);
2426        }
2427        if let Some(no_init) = opts.no_init {
2428            query = query.arg("noInit", no_init);
2429        }
2430        Service {
2431            proc: self.proc.clone(),
2432            selection: query,
2433            graphql_client: self.graphql_client.clone(),
2434        }
2435    }
2436    /// Package the container state as an OCI image, and return it as a tar archive
2437    ///
2438    /// # Arguments
2439    ///
2440    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2441    pub fn as_tarball(&self) -> File {
2442        let query = self.selection.select("asTarball");
2443        File {
2444            proc: self.proc.clone(),
2445            selection: query,
2446            graphql_client: self.graphql_client.clone(),
2447        }
2448    }
2449    /// Package the container state as an OCI image, and return it as a tar archive
2450    ///
2451    /// # Arguments
2452    ///
2453    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2454    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2455        let mut query = self.selection.select("asTarball");
2456        if let Some(platform_variants) = opts.platform_variants {
2457            query = query.arg("platformVariants", platform_variants);
2458        }
2459        if let Some(forced_compression) = opts.forced_compression {
2460            query = query.arg("forcedCompression", forced_compression);
2461        }
2462        if let Some(media_types) = opts.media_types {
2463            query = query.arg("mediaTypes", media_types);
2464        }
2465        File {
2466            proc: self.proc.clone(),
2467            selection: query,
2468            graphql_client: self.graphql_client.clone(),
2469        }
2470    }
2471    /// The combined buffered standard output and standard error stream of the last executed command
2472    /// Returns an error if no command was executed
2473    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2474        let query = self.selection.select("combinedOutput");
2475        query.execute(self.graphql_client.clone()).await
2476    }
2477    /// Return the container's default arguments.
2478    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2479        let query = self.selection.select("defaultArgs");
2480        query.execute(self.graphql_client.clone()).await
2481    }
2482    /// Retrieve a directory from the container's root filesystem
2483    /// Mounts are included.
2484    ///
2485    /// # Arguments
2486    ///
2487    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2488    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2489    pub fn directory(&self, path: impl Into<String>) -> Directory {
2490        let mut query = self.selection.select("directory");
2491        query = query.arg("path", path.into());
2492        Directory {
2493            proc: self.proc.clone(),
2494            selection: query,
2495            graphql_client: self.graphql_client.clone(),
2496        }
2497    }
2498    /// Retrieve a directory from the container's root filesystem
2499    /// Mounts are included.
2500    ///
2501    /// # Arguments
2502    ///
2503    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2504    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2505    pub fn directory_opts(
2506        &self,
2507        path: impl Into<String>,
2508        opts: ContainerDirectoryOpts,
2509    ) -> Directory {
2510        let mut query = self.selection.select("directory");
2511        query = query.arg("path", path.into());
2512        if let Some(expand) = opts.expand {
2513            query = query.arg("expand", expand);
2514        }
2515        Directory {
2516            proc: self.proc.clone(),
2517            selection: query,
2518            graphql_client: self.graphql_client.clone(),
2519        }
2520    }
2521    /// Retrieves this container's configured docker healthcheck.
2522    pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
2523        let query = self.selection.select("dockerHealthcheck");
2524        let query = query.select("id");
2525        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2526        Ok(id.map(|id| HealthcheckConfig {
2527            proc: self.proc.clone(),
2528            selection: query
2529                .root()
2530                .select("node")
2531                .arg("id", &id.0)
2532                .inline_fragment("HealthcheckConfig"),
2533            graphql_client: self.graphql_client.clone(),
2534        }))
2535    }
2536    /// Return the container's OCI entrypoint.
2537    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2538        let query = self.selection.select("entrypoint");
2539        query.execute(self.graphql_client.clone()).await
2540    }
2541    /// Retrieves the value of the specified persistent environment variable.
2542    ///
2543    /// # Arguments
2544    ///
2545    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2546    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2547        let mut query = self.selection.select("envVariable");
2548        query = query.arg("name", name.into());
2549        query.execute(self.graphql_client.clone()).await
2550    }
2551    /// Retrieves the list of persistent environment variables configured on the container.
2552    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2553        let query = self.selection.select("envVariables");
2554        let query = query.select("id");
2555        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2556        Ok(ids
2557            .into_iter()
2558            .map(|id| EnvVariable {
2559                proc: self.proc.clone(),
2560                selection: crate::querybuilder::query()
2561                    .select("node")
2562                    .arg("id", &id.0)
2563                    .inline_fragment("EnvVariable"),
2564                graphql_client: self.graphql_client.clone(),
2565            })
2566            .collect())
2567    }
2568    /// check if a file or directory exists
2569    ///
2570    /// # Arguments
2571    ///
2572    /// * `path` - Path to check (e.g., "/file.txt").
2573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2574    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2575        let mut query = self.selection.select("exists");
2576        query = query.arg("path", path.into());
2577        query.execute(self.graphql_client.clone()).await
2578    }
2579    /// check if a file or directory exists
2580    ///
2581    /// # Arguments
2582    ///
2583    /// * `path` - Path to check (e.g., "/file.txt").
2584    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2585    pub async fn exists_opts(
2586        &self,
2587        path: impl Into<String>,
2588        opts: ContainerExistsOpts,
2589    ) -> Result<bool, DaggerError> {
2590        let mut query = self.selection.select("exists");
2591        query = query.arg("path", path.into());
2592        if let Some(expected_type) = opts.expected_type {
2593            query = query.arg("expectedType", expected_type);
2594        }
2595        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2596            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2597        }
2598        if let Some(expand) = opts.expand {
2599            query = query.arg("expand", expand);
2600        }
2601        query.execute(self.graphql_client.clone()).await
2602    }
2603    /// The exit code of the last executed command
2604    /// Returns an error if no command was executed
2605    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2606        let query = self.selection.select("exitCode");
2607        query.execute(self.graphql_client.clone()).await
2608    }
2609    /// EXPERIMENTAL API! Subject to change/removal at any time.
2610    /// Configures all available GPUs on the host to be accessible to this container.
2611    /// This currently works for Nvidia devices only.
2612    pub fn experimental_with_all_gp_us(&self) -> Container {
2613        let query = self.selection.select("experimentalWithAllGPUs");
2614        Container {
2615            proc: self.proc.clone(),
2616            selection: query,
2617            graphql_client: self.graphql_client.clone(),
2618        }
2619    }
2620    /// EXPERIMENTAL API! Subject to change/removal at any time.
2621    /// Configures the provided list of devices to be accessible to this container.
2622    /// This currently works for Nvidia devices only.
2623    ///
2624    /// # Arguments
2625    ///
2626    /// * `devices` - List of devices to be accessible to this container.
2627    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2628        let mut query = self.selection.select("experimentalWithGPU");
2629        query = query.arg(
2630            "devices",
2631            devices
2632                .into_iter()
2633                .map(|i| i.into())
2634                .collect::<Vec<String>>(),
2635        );
2636        Container {
2637            proc: self.proc.clone(),
2638            selection: query,
2639            graphql_client: self.graphql_client.clone(),
2640        }
2641    }
2642    /// Writes the container as an OCI tarball to the destination file path on the host.
2643    /// It can also export platform variants.
2644    ///
2645    /// # Arguments
2646    ///
2647    /// * `path` - Host's destination path (e.g., "./tarball").
2648    ///
2649    /// Path can be relative to the engine's workdir or absolute.
2650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2651    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2652        let mut query = self.selection.select("export");
2653        query = query.arg("path", path.into());
2654        query.execute(self.graphql_client.clone()).await
2655    }
2656    /// Writes the container as an OCI tarball to the destination file path on the host.
2657    /// It can also export platform variants.
2658    ///
2659    /// # Arguments
2660    ///
2661    /// * `path` - Host's destination path (e.g., "./tarball").
2662    ///
2663    /// Path can be relative to the engine's workdir or absolute.
2664    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2665    pub async fn export_opts(
2666        &self,
2667        path: impl Into<String>,
2668        opts: ContainerExportOpts,
2669    ) -> Result<String, DaggerError> {
2670        let mut query = self.selection.select("export");
2671        query = query.arg("path", path.into());
2672        if let Some(platform_variants) = opts.platform_variants {
2673            query = query.arg("platformVariants", platform_variants);
2674        }
2675        if let Some(forced_compression) = opts.forced_compression {
2676            query = query.arg("forcedCompression", forced_compression);
2677        }
2678        if let Some(media_types) = opts.media_types {
2679            query = query.arg("mediaTypes", media_types);
2680        }
2681        if let Some(expand) = opts.expand {
2682            query = query.arg("expand", expand);
2683        }
2684        query.execute(self.graphql_client.clone()).await
2685    }
2686    /// Exports the container as an image to the host's container image store.
2687    ///
2688    /// # Arguments
2689    ///
2690    /// * `name` - Name of image to export to in the host's store
2691    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2692    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2693        let mut query = self.selection.select("exportImage");
2694        query = query.arg("name", name.into());
2695        query.execute(self.graphql_client.clone()).await
2696    }
2697    /// Exports the container as an image to the host's container image store.
2698    ///
2699    /// # Arguments
2700    ///
2701    /// * `name` - Name of image to export to in the host's store
2702    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2703    pub async fn export_image_opts(
2704        &self,
2705        name: impl Into<String>,
2706        opts: ContainerExportImageOpts,
2707    ) -> Result<Void, DaggerError> {
2708        let mut query = self.selection.select("exportImage");
2709        query = query.arg("name", name.into());
2710        if let Some(platform_variants) = opts.platform_variants {
2711            query = query.arg("platformVariants", platform_variants);
2712        }
2713        if let Some(forced_compression) = opts.forced_compression {
2714            query = query.arg("forcedCompression", forced_compression);
2715        }
2716        if let Some(media_types) = opts.media_types {
2717            query = query.arg("mediaTypes", media_types);
2718        }
2719        query.execute(self.graphql_client.clone()).await
2720    }
2721    /// Retrieves the list of exposed ports.
2722    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2723    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2724        let query = self.selection.select("exposedPorts");
2725        let query = query.select("id");
2726        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2727        Ok(ids
2728            .into_iter()
2729            .map(|id| Port {
2730                proc: self.proc.clone(),
2731                selection: crate::querybuilder::query()
2732                    .select("node")
2733                    .arg("id", &id.0)
2734                    .inline_fragment("Port"),
2735                graphql_client: self.graphql_client.clone(),
2736            })
2737            .collect())
2738    }
2739    /// Retrieves a file at the given path.
2740    /// Mounts are included.
2741    ///
2742    /// # Arguments
2743    ///
2744    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2746    pub fn file(&self, path: impl Into<String>) -> File {
2747        let mut query = self.selection.select("file");
2748        query = query.arg("path", path.into());
2749        File {
2750            proc: self.proc.clone(),
2751            selection: query,
2752            graphql_client: self.graphql_client.clone(),
2753        }
2754    }
2755    /// Retrieves a file at the given path.
2756    /// Mounts are included.
2757    ///
2758    /// # Arguments
2759    ///
2760    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2762    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2763        let mut query = self.selection.select("file");
2764        query = query.arg("path", path.into());
2765        if let Some(expand) = opts.expand {
2766            query = query.arg("expand", expand);
2767        }
2768        File {
2769            proc: self.proc.clone(),
2770            selection: query,
2771            graphql_client: self.graphql_client.clone(),
2772        }
2773    }
2774    /// Download a container image, and apply it to the container state. All previous state will be lost.
2775    ///
2776    /// # Arguments
2777    ///
2778    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
2779    ///
2780    /// An address without a tag or digest selects the greatest stable release tag, falling back to the literal "latest" tag when no eligible release exists.
2781    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2782    pub fn from(&self, address: impl Into<String>) -> Container {
2783        let mut query = self.selection.select("from");
2784        query = query.arg("address", address.into());
2785        Container {
2786            proc: self.proc.clone(),
2787            selection: query,
2788            graphql_client: self.graphql_client.clone(),
2789        }
2790    }
2791    /// Download a container image, and apply it to the container state. All previous state will be lost.
2792    ///
2793    /// # Arguments
2794    ///
2795    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
2796    ///
2797    /// An address without a tag or digest selects the greatest stable release tag, falling back to the literal "latest" tag when no eligible release exists.
2798    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2799    pub fn from_opts<'a>(
2800        &self,
2801        address: impl Into<String>,
2802        opts: ContainerFromOpts<'a>,
2803    ) -> Container {
2804        let mut query = self.selection.select("from");
2805        query = query.arg("address", address.into());
2806        if let Some(version) = opts.version {
2807            query = query.arg("version", version);
2808        }
2809        if let Some(registry_service) = opts.registry_service {
2810            query = query.arg("registryService", registry_service);
2811        }
2812        if let Some(protocol) = opts.protocol {
2813            query = query.arg("protocol", protocol);
2814        }
2815        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
2816            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
2817        }
2818        Container {
2819            proc: self.proc.clone(),
2820            selection: query,
2821            graphql_client: self.graphql_client.clone(),
2822        }
2823    }
2824    /// A unique identifier for this Container.
2825    pub async fn id(&self) -> Result<Id, DaggerError> {
2826        let query = self.selection.select("id");
2827        query.execute(self.graphql_client.clone()).await
2828    }
2829    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2830    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2831        let query = self.selection.select("imageRef");
2832        query.execute(self.graphql_client.clone()).await
2833    }
2834    /// Reads the container from an OCI tarball.
2835    ///
2836    /// # Arguments
2837    ///
2838    /// * `source` - File to read the container from.
2839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2840    pub fn import(&self, source: impl IntoID<Id>) -> Container {
2841        let mut query = self.selection.select("import");
2842        query = query.arg_lazy(
2843            "source",
2844            Box::new(move || {
2845                let source = source.clone();
2846                Box::pin(async move { source.into_id().await.unwrap().quote() })
2847            }),
2848        );
2849        Container {
2850            proc: self.proc.clone(),
2851            selection: query,
2852            graphql_client: self.graphql_client.clone(),
2853        }
2854    }
2855    /// Reads the container from an OCI tarball.
2856    ///
2857    /// # Arguments
2858    ///
2859    /// * `source` - File to read the container from.
2860    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2861    pub fn import_opts<'a>(
2862        &self,
2863        source: impl IntoID<Id>,
2864        opts: ContainerImportOpts<'a>,
2865    ) -> Container {
2866        let mut query = self.selection.select("import");
2867        query = query.arg_lazy(
2868            "source",
2869            Box::new(move || {
2870                let source = source.clone();
2871                Box::pin(async move { source.into_id().await.unwrap().quote() })
2872            }),
2873        );
2874        if let Some(tag) = opts.tag {
2875            query = query.arg("tag", tag);
2876        }
2877        Container {
2878            proc: self.proc.clone(),
2879            selection: query,
2880            graphql_client: self.graphql_client.clone(),
2881        }
2882    }
2883    /// Retrieves the value of the specified label.
2884    ///
2885    /// # Arguments
2886    ///
2887    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2888    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2889        let mut query = self.selection.select("label");
2890        query = query.arg("name", name.into());
2891        query.execute(self.graphql_client.clone()).await
2892    }
2893    /// Retrieves the list of labels passed to container.
2894    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2895        let query = self.selection.select("labels");
2896        let query = query.select("id");
2897        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2898        Ok(ids
2899            .into_iter()
2900            .map(|id| Label {
2901                proc: self.proc.clone(),
2902                selection: crate::querybuilder::query()
2903                    .select("node")
2904                    .arg("id", &id.0)
2905                    .inline_fragment("Label"),
2906                graphql_client: self.graphql_client.clone(),
2907            })
2908            .collect())
2909    }
2910    /// Returns the image layer or configuration blob with the given digest as a File.
2911    ///
2912    /// # Arguments
2913    ///
2914    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
2915    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2916    pub fn layer(&self, id: impl Into<String>) -> File {
2917        let mut query = self.selection.select("layer");
2918        query = query.arg("id", id.into());
2919        File {
2920            proc: self.proc.clone(),
2921            selection: query,
2922            graphql_client: self.graphql_client.clone(),
2923        }
2924    }
2925    /// Returns the image layer or configuration blob with the given digest as a File.
2926    ///
2927    /// # Arguments
2928    ///
2929    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
2930    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2931    pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
2932        let mut query = self.selection.select("layer");
2933        query = query.arg("id", id.into());
2934        if let Some(forced_compression) = opts.forced_compression {
2935            query = query.arg("forcedCompression", forced_compression);
2936        }
2937        if let Some(media_types) = opts.media_types {
2938            query = query.arg("mediaTypes", media_types);
2939        }
2940        File {
2941            proc: self.proc.clone(),
2942            selection: query,
2943            graphql_client: self.graphql_client.clone(),
2944        }
2945    }
2946    /// Computes and returns the manifest for this container as a File.
2947    ///
2948    /// # Arguments
2949    ///
2950    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2951    pub fn manifest(&self) -> File {
2952        let query = self.selection.select("manifest");
2953        File {
2954            proc: self.proc.clone(),
2955            selection: query,
2956            graphql_client: self.graphql_client.clone(),
2957        }
2958    }
2959    /// Computes and returns the manifest for this container as a File.
2960    ///
2961    /// # Arguments
2962    ///
2963    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2964    pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
2965        let mut query = self.selection.select("manifest");
2966        if let Some(forced_compression) = opts.forced_compression {
2967            query = query.arg("forcedCompression", forced_compression);
2968        }
2969        if let Some(media_types) = opts.media_types {
2970            query = query.arg("mediaTypes", media_types);
2971        }
2972        File {
2973            proc: self.proc.clone(),
2974            selection: query,
2975            graphql_client: self.graphql_client.clone(),
2976        }
2977    }
2978    /// Retrieves the list of paths where a directory is mounted.
2979    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2980        let query = self.selection.select("mounts");
2981        query.execute(self.graphql_client.clone()).await
2982    }
2983    /// The platform this container executes and publishes as.
2984    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2985        let query = self.selection.select("platform");
2986        query.execute(self.graphql_client.clone()).await
2987    }
2988    /// Package the container state as an OCI image, and publish it to a registry
2989    /// Returns the fully qualified address of the published image, with digest
2990    ///
2991    /// # Arguments
2992    ///
2993    /// * `address` - The OCI address to publish to
2994    ///
2995    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2996    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2997    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2998        let mut query = self.selection.select("publish");
2999        query = query.arg("address", address.into());
3000        query.execute(self.graphql_client.clone()).await
3001    }
3002    /// Package the container state as an OCI image, and publish it to a registry
3003    /// Returns the fully qualified address of the published image, with digest
3004    ///
3005    /// # Arguments
3006    ///
3007    /// * `address` - The OCI address to publish to
3008    ///
3009    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3011    pub async fn publish_opts(
3012        &self,
3013        address: impl Into<String>,
3014        opts: ContainerPublishOpts,
3015    ) -> Result<String, DaggerError> {
3016        let mut query = self.selection.select("publish");
3017        query = query.arg("address", address.into());
3018        if let Some(platform_variants) = opts.platform_variants {
3019            query = query.arg("platformVariants", platform_variants);
3020        }
3021        if let Some(forced_compression) = opts.forced_compression {
3022            query = query.arg("forcedCompression", forced_compression);
3023        }
3024        if let Some(media_types) = opts.media_types {
3025            query = query.arg("mediaTypes", media_types);
3026        }
3027        if let Some(registry_service) = opts.registry_service {
3028            query = query.arg("registryService", registry_service);
3029        }
3030        if let Some(protocol) = opts.protocol {
3031            query = query.arg("protocol", protocol);
3032        }
3033        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
3034            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
3035        }
3036        query.execute(self.graphql_client.clone()).await
3037    }
3038    /// Return a snapshot of the container's root filesystem. The snapshot can be modified then written back using withRootfs. Use that method for filesystem modifications.
3039    pub fn rootfs(&self) -> Directory {
3040        let query = self.selection.select("rootfs");
3041        Directory {
3042            proc: self.proc.clone(),
3043            selection: query,
3044            graphql_client: self.graphql_client.clone(),
3045        }
3046    }
3047    /// Return file status
3048    ///
3049    /// # Arguments
3050    ///
3051    /// * `path` - Path to check (e.g., "/file.txt").
3052    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3053    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
3054        let mut query = self.selection.select("stat");
3055        query = query.arg("path", path.into());
3056        let query = query.select("id");
3057        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
3058        Ok(id.map(|id| Stat {
3059            proc: self.proc.clone(),
3060            selection: query
3061                .root()
3062                .select("node")
3063                .arg("id", &id.0)
3064                .inline_fragment("Stat"),
3065            graphql_client: self.graphql_client.clone(),
3066        }))
3067    }
3068    /// Return file status
3069    ///
3070    /// # Arguments
3071    ///
3072    /// * `path` - Path to check (e.g., "/file.txt").
3073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3074    pub async fn stat_opts(
3075        &self,
3076        path: impl Into<String>,
3077        opts: ContainerStatOpts,
3078    ) -> Result<Option<Stat>, DaggerError> {
3079        let mut query = self.selection.select("stat");
3080        query = query.arg("path", path.into());
3081        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3082            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3083        }
3084        let query = query.select("id");
3085        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
3086        Ok(id.map(|id| Stat {
3087            proc: self.proc.clone(),
3088            selection: query
3089                .root()
3090                .select("node")
3091                .arg("id", &id.0)
3092                .inline_fragment("Stat"),
3093            graphql_client: self.graphql_client.clone(),
3094        }))
3095    }
3096    /// The buffered standard error stream of the last executed command
3097    /// Returns an error if no command was executed
3098    pub async fn stderr(&self) -> Result<String, DaggerError> {
3099        let query = self.selection.select("stderr");
3100        query.execute(self.graphql_client.clone()).await
3101    }
3102    /// The buffered standard output stream of the last executed command
3103    /// Returns an error if no command was executed
3104    pub async fn stdout(&self) -> Result<String, DaggerError> {
3105        let query = self.selection.select("stdout");
3106        query.execute(self.graphql_client.clone()).await
3107    }
3108    /// Forces evaluation of the pipeline in the engine.
3109    /// It doesn't run the default command if no exec has been set.
3110    pub async fn sync(&self) -> Result<Container, DaggerError> {
3111        let query = self.selection.select("sync");
3112        let id: Id = query.execute(self.graphql_client.clone()).await?;
3113        Ok(Container {
3114            proc: self.proc.clone(),
3115            selection: query
3116                .root()
3117                .select("node")
3118                .arg("id", &id.0)
3119                .inline_fragment("Container"),
3120            graphql_client: self.graphql_client.clone(),
3121        })
3122    }
3123    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3124    ///
3125    /// # Arguments
3126    ///
3127    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3128    pub fn terminal(&self) -> Container {
3129        let query = self.selection.select("terminal");
3130        Container {
3131            proc: self.proc.clone(),
3132            selection: query,
3133            graphql_client: self.graphql_client.clone(),
3134        }
3135    }
3136    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3137    ///
3138    /// # Arguments
3139    ///
3140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3141    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3142        let mut query = self.selection.select("terminal");
3143        if let Some(cmd) = opts.cmd {
3144            query = query.arg("cmd", cmd);
3145        }
3146        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3147            query = query.arg(
3148                "experimentalPrivilegedNesting",
3149                experimental_privileged_nesting,
3150            );
3151        }
3152        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3153            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3154        }
3155        Container {
3156            proc: self.proc.clone(),
3157            selection: query,
3158            graphql_client: self.graphql_client.clone(),
3159        }
3160    }
3161    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3162    /// Be sure to set any exposed ports before calling this api.
3163    ///
3164    /// # Arguments
3165    ///
3166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3167    pub async fn up(&self) -> Result<Void, DaggerError> {
3168        let query = self.selection.select("up");
3169        query.execute(self.graphql_client.clone()).await
3170    }
3171    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3172    /// Be sure to set any exposed ports before calling this api.
3173    ///
3174    /// # Arguments
3175    ///
3176    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3177    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3178        let mut query = self.selection.select("up");
3179        if let Some(random) = opts.random {
3180            query = query.arg("random", random);
3181        }
3182        if let Some(ports) = opts.ports {
3183            query = query.arg("ports", ports);
3184        }
3185        if let Some(args) = opts.args {
3186            query = query.arg("args", args);
3187        }
3188        if let Some(use_entrypoint) = opts.use_entrypoint {
3189            query = query.arg("useEntrypoint", use_entrypoint);
3190        }
3191        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3192            query = query.arg(
3193                "experimentalPrivilegedNesting",
3194                experimental_privileged_nesting,
3195            );
3196        }
3197        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3198            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3199        }
3200        if let Some(expand) = opts.expand {
3201            query = query.arg("expand", expand);
3202        }
3203        if let Some(no_init) = opts.no_init {
3204            query = query.arg("noInit", no_init);
3205        }
3206        query.execute(self.graphql_client.clone()).await
3207    }
3208    /// Retrieves the user to be set for all commands.
3209    pub async fn user(&self) -> Result<String, DaggerError> {
3210        let query = self.selection.select("user");
3211        query.execute(self.graphql_client.clone()).await
3212    }
3213    /// Retrieves this container plus the given OCI annotation.
3214    ///
3215    /// # Arguments
3216    ///
3217    /// * `name` - The name of the annotation.
3218    /// * `value` - The value of the annotation.
3219    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3220        let mut query = self.selection.select("withAnnotation");
3221        query = query.arg("name", name.into());
3222        query = query.arg("value", value.into());
3223        Container {
3224            proc: self.proc.clone(),
3225            selection: query,
3226            graphql_client: self.graphql_client.clone(),
3227        }
3228    }
3229    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3230    ///
3231    /// # Arguments
3232    ///
3233    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3234    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3235        let mut query = self.selection.select("withDefaultArgs");
3236        query = query.arg(
3237            "args",
3238            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3239        );
3240        Container {
3241            proc: self.proc.clone(),
3242            selection: query,
3243            graphql_client: self.graphql_client.clone(),
3244        }
3245    }
3246    /// Set the default command to invoke for the container's terminal API.
3247    ///
3248    /// # Arguments
3249    ///
3250    /// * `args` - The args of the command.
3251    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3252    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3253        let mut query = self.selection.select("withDefaultTerminalCmd");
3254        query = query.arg(
3255            "args",
3256            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3257        );
3258        Container {
3259            proc: self.proc.clone(),
3260            selection: query,
3261            graphql_client: self.graphql_client.clone(),
3262        }
3263    }
3264    /// Set the default command to invoke for the container's terminal API.
3265    ///
3266    /// # Arguments
3267    ///
3268    /// * `args` - The args of the command.
3269    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3270    pub fn with_default_terminal_cmd_opts(
3271        &self,
3272        args: Vec<impl Into<String>>,
3273        opts: ContainerWithDefaultTerminalCmdOpts,
3274    ) -> Container {
3275        let mut query = self.selection.select("withDefaultTerminalCmd");
3276        query = query.arg(
3277            "args",
3278            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3279        );
3280        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3281            query = query.arg(
3282                "experimentalPrivilegedNesting",
3283                experimental_privileged_nesting,
3284            );
3285        }
3286        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3287            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3288        }
3289        Container {
3290            proc: self.proc.clone(),
3291            selection: query,
3292            graphql_client: self.graphql_client.clone(),
3293        }
3294    }
3295    /// Return a new container snapshot, with a directory added to its filesystem
3296    ///
3297    /// # Arguments
3298    ///
3299    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3300    /// * `source` - Identifier of the directory to write
3301    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3302    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3303        let mut query = self.selection.select("withDirectory");
3304        query = query.arg("path", path.into());
3305        query = query.arg_lazy(
3306            "source",
3307            Box::new(move || {
3308                let source = source.clone();
3309                Box::pin(async move { source.into_id().await.unwrap().quote() })
3310            }),
3311        );
3312        Container {
3313            proc: self.proc.clone(),
3314            selection: query,
3315            graphql_client: self.graphql_client.clone(),
3316        }
3317    }
3318    /// Return a new container snapshot, with a directory added to its filesystem
3319    ///
3320    /// # Arguments
3321    ///
3322    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3323    /// * `source` - Identifier of the directory to write
3324    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3325    pub fn with_directory_opts<'a>(
3326        &self,
3327        path: impl Into<String>,
3328        source: impl IntoID<Id>,
3329        opts: ContainerWithDirectoryOpts<'a>,
3330    ) -> Container {
3331        let mut query = self.selection.select("withDirectory");
3332        query = query.arg("path", path.into());
3333        query = query.arg_lazy(
3334            "source",
3335            Box::new(move || {
3336                let source = source.clone();
3337                Box::pin(async move { source.into_id().await.unwrap().quote() })
3338            }),
3339        );
3340        if let Some(exclude) = opts.exclude {
3341            query = query.arg("exclude", exclude);
3342        }
3343        if let Some(include) = opts.include {
3344            query = query.arg("include", include);
3345        }
3346        if let Some(gitignore) = opts.gitignore {
3347            query = query.arg("gitignore", gitignore);
3348        }
3349        if let Some(owner) = opts.owner {
3350            query = query.arg("owner", owner);
3351        }
3352        if let Some(inherit_owner) = opts.inherit_owner {
3353            query = query.arg("inheritOwner", inherit_owner);
3354        }
3355        if let Some(expand) = opts.expand {
3356            query = query.arg("expand", expand);
3357        }
3358        if let Some(permissions) = opts.permissions {
3359            query = query.arg("permissions", permissions);
3360        }
3361        Container {
3362            proc: self.proc.clone(),
3363            selection: query,
3364            graphql_client: self.graphql_client.clone(),
3365        }
3366    }
3367    /// Retrieves this container with the specificed docker healtcheck command set.
3368    ///
3369    /// # Arguments
3370    ///
3371    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
3372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3373    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
3374        let mut query = self.selection.select("withDockerHealthcheck");
3375        query = query.arg(
3376            "args",
3377            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3378        );
3379        Container {
3380            proc: self.proc.clone(),
3381            selection: query,
3382            graphql_client: self.graphql_client.clone(),
3383        }
3384    }
3385    /// Retrieves this container with the specificed docker healtcheck command set.
3386    ///
3387    /// # Arguments
3388    ///
3389    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
3390    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3391    pub fn with_docker_healthcheck_opts<'a>(
3392        &self,
3393        args: Vec<impl Into<String>>,
3394        opts: ContainerWithDockerHealthcheckOpts<'a>,
3395    ) -> Container {
3396        let mut query = self.selection.select("withDockerHealthcheck");
3397        query = query.arg(
3398            "args",
3399            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3400        );
3401        if let Some(shell) = opts.shell {
3402            query = query.arg("shell", shell);
3403        }
3404        if let Some(interval) = opts.interval {
3405            query = query.arg("interval", interval);
3406        }
3407        if let Some(timeout) = opts.timeout {
3408            query = query.arg("timeout", timeout);
3409        }
3410        if let Some(start_period) = opts.start_period {
3411            query = query.arg("startPeriod", start_period);
3412        }
3413        if let Some(start_interval) = opts.start_interval {
3414            query = query.arg("startInterval", start_interval);
3415        }
3416        if let Some(retries) = opts.retries {
3417            query = query.arg("retries", retries);
3418        }
3419        Container {
3420            proc: self.proc.clone(),
3421            selection: query,
3422            graphql_client: self.graphql_client.clone(),
3423        }
3424    }
3425    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3426    ///
3427    /// # Arguments
3428    ///
3429    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3430    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3431    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3432        let mut query = self.selection.select("withEntrypoint");
3433        query = query.arg(
3434            "args",
3435            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3436        );
3437        Container {
3438            proc: self.proc.clone(),
3439            selection: query,
3440            graphql_client: self.graphql_client.clone(),
3441        }
3442    }
3443    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3444    ///
3445    /// # Arguments
3446    ///
3447    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3448    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3449    pub fn with_entrypoint_opts(
3450        &self,
3451        args: Vec<impl Into<String>>,
3452        opts: ContainerWithEntrypointOpts,
3453    ) -> Container {
3454        let mut query = self.selection.select("withEntrypoint");
3455        query = query.arg(
3456            "args",
3457            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3458        );
3459        if let Some(keep_default_args) = opts.keep_default_args {
3460            query = query.arg("keepDefaultArgs", keep_default_args);
3461        }
3462        Container {
3463            proc: self.proc.clone(),
3464            selection: query,
3465            graphql_client: self.graphql_client.clone(),
3466        }
3467    }
3468    /// Export environment variables from an env-file to the container.
3469    ///
3470    /// # Arguments
3471    ///
3472    /// * `source` - Identifier of the envfile
3473    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
3474        let mut query = self.selection.select("withEnvFileVariables");
3475        query = query.arg_lazy(
3476            "source",
3477            Box::new(move || {
3478                let source = source.clone();
3479                Box::pin(async move { source.into_id().await.unwrap().quote() })
3480            }),
3481        );
3482        Container {
3483            proc: self.proc.clone(),
3484            selection: query,
3485            graphql_client: self.graphql_client.clone(),
3486        }
3487    }
3488    /// Set a new environment variable in the container.
3489    ///
3490    /// # Arguments
3491    ///
3492    /// * `name` - Name of the environment variable (e.g., "HOST").
3493    /// * `value` - Value of the environment variable. (e.g., "localhost").
3494    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3495    pub fn with_env_variable(
3496        &self,
3497        name: impl Into<String>,
3498        value: impl Into<String>,
3499    ) -> Container {
3500        let mut query = self.selection.select("withEnvVariable");
3501        query = query.arg("name", name.into());
3502        query = query.arg("value", value.into());
3503        Container {
3504            proc: self.proc.clone(),
3505            selection: query,
3506            graphql_client: self.graphql_client.clone(),
3507        }
3508    }
3509    /// Set a new environment variable in the container.
3510    ///
3511    /// # Arguments
3512    ///
3513    /// * `name` - Name of the environment variable (e.g., "HOST").
3514    /// * `value` - Value of the environment variable. (e.g., "localhost").
3515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3516    pub fn with_env_variable_opts(
3517        &self,
3518        name: impl Into<String>,
3519        value: impl Into<String>,
3520        opts: ContainerWithEnvVariableOpts,
3521    ) -> Container {
3522        let mut query = self.selection.select("withEnvVariable");
3523        query = query.arg("name", name.into());
3524        query = query.arg("value", value.into());
3525        if let Some(expand) = opts.expand {
3526            query = query.arg("expand", expand);
3527        }
3528        Container {
3529            proc: self.proc.clone(),
3530            selection: query,
3531            graphql_client: self.graphql_client.clone(),
3532        }
3533    }
3534    /// Raise an error.
3535    ///
3536    /// # Arguments
3537    ///
3538    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
3539    pub fn with_error(&self, err: impl Into<String>) -> Container {
3540        let mut query = self.selection.select("withError");
3541        query = query.arg("err", err.into());
3542        Container {
3543            proc: self.proc.clone(),
3544            selection: query,
3545            graphql_client: self.graphql_client.clone(),
3546        }
3547    }
3548    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3549    ///
3550    /// # Arguments
3551    ///
3552    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3553    ///
3554    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3555    ///
3556    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3558    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3559        let mut query = self.selection.select("withExec");
3560        query = query.arg(
3561            "args",
3562            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3563        );
3564        Container {
3565            proc: self.proc.clone(),
3566            selection: query,
3567            graphql_client: self.graphql_client.clone(),
3568        }
3569    }
3570    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3571    ///
3572    /// # Arguments
3573    ///
3574    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3575    ///
3576    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3577    ///
3578    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3579    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3580    pub fn with_exec_opts<'a>(
3581        &self,
3582        args: Vec<impl Into<String>>,
3583        opts: ContainerWithExecOpts<'a>,
3584    ) -> Container {
3585        let mut query = self.selection.select("withExec");
3586        query = query.arg(
3587            "args",
3588            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3589        );
3590        if let Some(use_entrypoint) = opts.use_entrypoint {
3591            query = query.arg("useEntrypoint", use_entrypoint);
3592        }
3593        if let Some(stdin) = opts.stdin {
3594            query = query.arg("stdin", stdin);
3595        }
3596        if let Some(redirect_stdin) = opts.redirect_stdin {
3597            query = query.arg("redirectStdin", redirect_stdin);
3598        }
3599        if let Some(redirect_stdout) = opts.redirect_stdout {
3600            query = query.arg("redirectStdout", redirect_stdout);
3601        }
3602        if let Some(redirect_stderr) = opts.redirect_stderr {
3603            query = query.arg("redirectStderr", redirect_stderr);
3604        }
3605        if let Some(expect) = opts.expect {
3606            query = query.arg("expect", expect);
3607        }
3608        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3609            query = query.arg(
3610                "experimentalPrivilegedNesting",
3611                experimental_privileged_nesting,
3612            );
3613        }
3614        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3615            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3616        }
3617        if let Some(expand) = opts.expand {
3618            query = query.arg("expand", expand);
3619        }
3620        if let Some(no_init) = opts.no_init {
3621            query = query.arg("noInit", no_init);
3622        }
3623        Container {
3624            proc: self.proc.clone(),
3625            selection: query,
3626            graphql_client: self.graphql_client.clone(),
3627        }
3628    }
3629    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3630    /// Exposed ports serve two purposes:
3631    /// - For health checks and introspection, when running services
3632    /// - For setting the EXPOSE OCI field when publishing the container
3633    ///
3634    /// # Arguments
3635    ///
3636    /// * `port` - Port number to expose. Example: 8080
3637    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3638    pub fn with_exposed_port(&self, port: isize) -> Container {
3639        let mut query = self.selection.select("withExposedPort");
3640        query = query.arg("port", port);
3641        Container {
3642            proc: self.proc.clone(),
3643            selection: query,
3644            graphql_client: self.graphql_client.clone(),
3645        }
3646    }
3647    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3648    /// Exposed ports serve two purposes:
3649    /// - For health checks and introspection, when running services
3650    /// - For setting the EXPOSE OCI field when publishing the container
3651    ///
3652    /// # Arguments
3653    ///
3654    /// * `port` - Port number to expose. Example: 8080
3655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3656    pub fn with_exposed_port_opts<'a>(
3657        &self,
3658        port: isize,
3659        opts: ContainerWithExposedPortOpts<'a>,
3660    ) -> Container {
3661        let mut query = self.selection.select("withExposedPort");
3662        query = query.arg("port", port);
3663        if let Some(protocol) = opts.protocol {
3664            query = query.arg("protocol", protocol);
3665        }
3666        if let Some(description) = opts.description {
3667            query = query.arg("description", description);
3668        }
3669        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3670            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3671        }
3672        Container {
3673            proc: self.proc.clone(),
3674            selection: query,
3675            graphql_client: self.graphql_client.clone(),
3676        }
3677    }
3678    /// Return a container snapshot with a file added
3679    ///
3680    /// # Arguments
3681    ///
3682    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3683    /// * `source` - File to add
3684    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3685    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3686        let mut query = self.selection.select("withFile");
3687        query = query.arg("path", path.into());
3688        query = query.arg_lazy(
3689            "source",
3690            Box::new(move || {
3691                let source = source.clone();
3692                Box::pin(async move { source.into_id().await.unwrap().quote() })
3693            }),
3694        );
3695        Container {
3696            proc: self.proc.clone(),
3697            selection: query,
3698            graphql_client: self.graphql_client.clone(),
3699        }
3700    }
3701    /// Return a container snapshot with a file added
3702    ///
3703    /// # Arguments
3704    ///
3705    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3706    /// * `source` - File to add
3707    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3708    pub fn with_file_opts<'a>(
3709        &self,
3710        path: impl Into<String>,
3711        source: impl IntoID<Id>,
3712        opts: ContainerWithFileOpts<'a>,
3713    ) -> Container {
3714        let mut query = self.selection.select("withFile");
3715        query = query.arg("path", path.into());
3716        query = query.arg_lazy(
3717            "source",
3718            Box::new(move || {
3719                let source = source.clone();
3720                Box::pin(async move { source.into_id().await.unwrap().quote() })
3721            }),
3722        );
3723        if let Some(permissions) = opts.permissions {
3724            query = query.arg("permissions", permissions);
3725        }
3726        if let Some(owner) = opts.owner {
3727            query = query.arg("owner", owner);
3728        }
3729        if let Some(inherit_owner) = opts.inherit_owner {
3730            query = query.arg("inheritOwner", inherit_owner);
3731        }
3732        if let Some(expand) = opts.expand {
3733            query = query.arg("expand", expand);
3734        }
3735        Container {
3736            proc: self.proc.clone(),
3737            selection: query,
3738            graphql_client: self.graphql_client.clone(),
3739        }
3740    }
3741    /// Retrieves this container plus the contents of the given files copied to the given path.
3742    ///
3743    /// # Arguments
3744    ///
3745    /// * `path` - Location where copied files should be placed (e.g., "/src").
3746    /// * `sources` - Identifiers of the files to copy.
3747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3748    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3749        let mut query = self.selection.select("withFiles");
3750        query = query.arg("path", path.into());
3751        query = query.arg("sources", sources);
3752        Container {
3753            proc: self.proc.clone(),
3754            selection: query,
3755            graphql_client: self.graphql_client.clone(),
3756        }
3757    }
3758    /// Retrieves this container plus the contents of the given files copied to the given path.
3759    ///
3760    /// # Arguments
3761    ///
3762    /// * `path` - Location where copied files should be placed (e.g., "/src").
3763    /// * `sources` - Identifiers of the files to copy.
3764    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3765    pub fn with_files_opts<'a>(
3766        &self,
3767        path: impl Into<String>,
3768        sources: Vec<Id>,
3769        opts: ContainerWithFilesOpts<'a>,
3770    ) -> Container {
3771        let mut query = self.selection.select("withFiles");
3772        query = query.arg("path", path.into());
3773        query = query.arg("sources", sources);
3774        if let Some(permissions) = opts.permissions {
3775            query = query.arg("permissions", permissions);
3776        }
3777        if let Some(owner) = opts.owner {
3778            query = query.arg("owner", owner);
3779        }
3780        if let Some(inherit_owner) = opts.inherit_owner {
3781            query = query.arg("inheritOwner", inherit_owner);
3782        }
3783        if let Some(expand) = opts.expand {
3784            query = query.arg("expand", expand);
3785        }
3786        Container {
3787            proc: self.proc.clone(),
3788            selection: query,
3789            graphql_client: self.graphql_client.clone(),
3790        }
3791    }
3792    /// Retrieves this container plus the given label.
3793    ///
3794    /// # Arguments
3795    ///
3796    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3797    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3798    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3799        let mut query = self.selection.select("withLabel");
3800        query = query.arg("name", name.into());
3801        query = query.arg("value", value.into());
3802        Container {
3803            proc: self.proc.clone(),
3804            selection: query,
3805            graphql_client: self.graphql_client.clone(),
3806        }
3807    }
3808    /// Retrieves this container plus a cache volume mounted at the given path.
3809    ///
3810    /// # Arguments
3811    ///
3812    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3813    /// * `cache` - Identifier of the cache volume to mount.
3814    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3815    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3816        let mut query = self.selection.select("withMountedCache");
3817        query = query.arg("path", path.into());
3818        query = query.arg_lazy(
3819            "cache",
3820            Box::new(move || {
3821                let cache = cache.clone();
3822                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3823            }),
3824        );
3825        Container {
3826            proc: self.proc.clone(),
3827            selection: query,
3828            graphql_client: self.graphql_client.clone(),
3829        }
3830    }
3831    /// Retrieves this container plus a cache volume mounted at the given path.
3832    ///
3833    /// # Arguments
3834    ///
3835    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3836    /// * `cache` - Identifier of the cache volume to mount.
3837    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3838    pub fn with_mounted_cache_opts<'a>(
3839        &self,
3840        path: impl Into<String>,
3841        cache: impl IntoID<Id>,
3842        opts: ContainerWithMountedCacheOpts<'a>,
3843    ) -> Container {
3844        let mut query = self.selection.select("withMountedCache");
3845        query = query.arg("path", path.into());
3846        query = query.arg_lazy(
3847            "cache",
3848            Box::new(move || {
3849                let cache = cache.clone();
3850                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3851            }),
3852        );
3853        if let Some(source) = opts.source {
3854            query = query.arg("source", source);
3855        }
3856        if let Some(sharing) = opts.sharing {
3857            query = query.arg("sharing", sharing);
3858        }
3859        if let Some(owner) = opts.owner {
3860            query = query.arg("owner", owner);
3861        }
3862        if let Some(inherit_owner) = opts.inherit_owner {
3863            query = query.arg("inheritOwner", inherit_owner);
3864        }
3865        if let Some(expand) = opts.expand {
3866            query = query.arg("expand", expand);
3867        }
3868        Container {
3869            proc: self.proc.clone(),
3870            selection: query,
3871            graphql_client: self.graphql_client.clone(),
3872        }
3873    }
3874    /// Retrieves this container plus a directory mounted at the given path.
3875    ///
3876    /// # Arguments
3877    ///
3878    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3879    /// * `source` - Identifier of the mounted directory.
3880    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3881    pub fn with_mounted_directory(
3882        &self,
3883        path: impl Into<String>,
3884        source: impl IntoID<Id>,
3885    ) -> Container {
3886        let mut query = self.selection.select("withMountedDirectory");
3887        query = query.arg("path", path.into());
3888        query = query.arg_lazy(
3889            "source",
3890            Box::new(move || {
3891                let source = source.clone();
3892                Box::pin(async move { source.into_id().await.unwrap().quote() })
3893            }),
3894        );
3895        Container {
3896            proc: self.proc.clone(),
3897            selection: query,
3898            graphql_client: self.graphql_client.clone(),
3899        }
3900    }
3901    /// Retrieves this container plus a directory mounted at the given path.
3902    ///
3903    /// # Arguments
3904    ///
3905    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3906    /// * `source` - Identifier of the mounted directory.
3907    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3908    pub fn with_mounted_directory_opts<'a>(
3909        &self,
3910        path: impl Into<String>,
3911        source: impl IntoID<Id>,
3912        opts: ContainerWithMountedDirectoryOpts<'a>,
3913    ) -> Container {
3914        let mut query = self.selection.select("withMountedDirectory");
3915        query = query.arg("path", path.into());
3916        query = query.arg_lazy(
3917            "source",
3918            Box::new(move || {
3919                let source = source.clone();
3920                Box::pin(async move { source.into_id().await.unwrap().quote() })
3921            }),
3922        );
3923        if let Some(owner) = opts.owner {
3924            query = query.arg("owner", owner);
3925        }
3926        if let Some(inherit_owner) = opts.inherit_owner {
3927            query = query.arg("inheritOwner", inherit_owner);
3928        }
3929        if let Some(read_only) = opts.read_only {
3930            query = query.arg("readOnly", read_only);
3931        }
3932        if let Some(expand) = opts.expand {
3933            query = query.arg("expand", expand);
3934        }
3935        Container {
3936            proc: self.proc.clone(),
3937            selection: query,
3938            graphql_client: self.graphql_client.clone(),
3939        }
3940    }
3941    /// Retrieves this container plus a file mounted at the given path.
3942    ///
3943    /// # Arguments
3944    ///
3945    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3946    /// * `source` - Identifier of the mounted file.
3947    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3948    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3949        let mut query = self.selection.select("withMountedFile");
3950        query = query.arg("path", path.into());
3951        query = query.arg_lazy(
3952            "source",
3953            Box::new(move || {
3954                let source = source.clone();
3955                Box::pin(async move { source.into_id().await.unwrap().quote() })
3956            }),
3957        );
3958        Container {
3959            proc: self.proc.clone(),
3960            selection: query,
3961            graphql_client: self.graphql_client.clone(),
3962        }
3963    }
3964    /// Retrieves this container plus a file mounted at the given path.
3965    ///
3966    /// # Arguments
3967    ///
3968    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3969    /// * `source` - Identifier of the mounted file.
3970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3971    pub fn with_mounted_file_opts<'a>(
3972        &self,
3973        path: impl Into<String>,
3974        source: impl IntoID<Id>,
3975        opts: ContainerWithMountedFileOpts<'a>,
3976    ) -> Container {
3977        let mut query = self.selection.select("withMountedFile");
3978        query = query.arg("path", path.into());
3979        query = query.arg_lazy(
3980            "source",
3981            Box::new(move || {
3982                let source = source.clone();
3983                Box::pin(async move { source.into_id().await.unwrap().quote() })
3984            }),
3985        );
3986        if let Some(owner) = opts.owner {
3987            query = query.arg("owner", owner);
3988        }
3989        if let Some(inherit_owner) = opts.inherit_owner {
3990            query = query.arg("inheritOwner", inherit_owner);
3991        }
3992        if let Some(expand) = opts.expand {
3993            query = query.arg("expand", expand);
3994        }
3995        Container {
3996            proc: self.proc.clone(),
3997            selection: query,
3998            graphql_client: self.graphql_client.clone(),
3999        }
4000    }
4001    /// Retrieves this container plus a secret mounted into a file at the given path.
4002    ///
4003    /// # Arguments
4004    ///
4005    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4006    /// * `source` - Identifier of the secret to mount.
4007    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4008    pub fn with_mounted_secret(
4009        &self,
4010        path: impl Into<String>,
4011        source: impl IntoID<Id>,
4012    ) -> Container {
4013        let mut query = self.selection.select("withMountedSecret");
4014        query = query.arg("path", path.into());
4015        query = query.arg_lazy(
4016            "source",
4017            Box::new(move || {
4018                let source = source.clone();
4019                Box::pin(async move { source.into_id().await.unwrap().quote() })
4020            }),
4021        );
4022        Container {
4023            proc: self.proc.clone(),
4024            selection: query,
4025            graphql_client: self.graphql_client.clone(),
4026        }
4027    }
4028    /// Retrieves this container plus a secret mounted into a file at the given path.
4029    ///
4030    /// # Arguments
4031    ///
4032    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4033    /// * `source` - Identifier of the secret to mount.
4034    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4035    pub fn with_mounted_secret_opts<'a>(
4036        &self,
4037        path: impl Into<String>,
4038        source: impl IntoID<Id>,
4039        opts: ContainerWithMountedSecretOpts<'a>,
4040    ) -> Container {
4041        let mut query = self.selection.select("withMountedSecret");
4042        query = query.arg("path", path.into());
4043        query = query.arg_lazy(
4044            "source",
4045            Box::new(move || {
4046                let source = source.clone();
4047                Box::pin(async move { source.into_id().await.unwrap().quote() })
4048            }),
4049        );
4050        if let Some(owner) = opts.owner {
4051            query = query.arg("owner", owner);
4052        }
4053        if let Some(inherit_owner) = opts.inherit_owner {
4054            query = query.arg("inheritOwner", inherit_owner);
4055        }
4056        if let Some(mode) = opts.mode {
4057            query = query.arg("mode", mode);
4058        }
4059        if let Some(expand) = opts.expand {
4060            query = query.arg("expand", expand);
4061        }
4062        Container {
4063            proc: self.proc.clone(),
4064            selection: query,
4065            graphql_client: self.graphql_client.clone(),
4066        }
4067    }
4068    /// Retrieves this container plus a temporary directory mounted at the given path. Any writes will be ephemeral to a single withExec call; they will not be persisted to subsequent withExecs.
4069    ///
4070    /// # Arguments
4071    ///
4072    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4074    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4075        let mut query = self.selection.select("withMountedTemp");
4076        query = query.arg("path", path.into());
4077        Container {
4078            proc: self.proc.clone(),
4079            selection: query,
4080            graphql_client: self.graphql_client.clone(),
4081        }
4082    }
4083    /// Retrieves this container plus a temporary directory mounted at the given path. Any writes will be ephemeral to a single withExec call; they will not be persisted to subsequent withExecs.
4084    ///
4085    /// # Arguments
4086    ///
4087    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4089    pub fn with_mounted_temp_opts(
4090        &self,
4091        path: impl Into<String>,
4092        opts: ContainerWithMountedTempOpts,
4093    ) -> Container {
4094        let mut query = self.selection.select("withMountedTemp");
4095        query = query.arg("path", path.into());
4096        if let Some(size) = opts.size {
4097            query = query.arg("size", size);
4098        }
4099        if let Some(expand) = opts.expand {
4100            query = query.arg("expand", expand);
4101        }
4102        Container {
4103            proc: self.proc.clone(),
4104            selection: query,
4105            graphql_client: self.graphql_client.clone(),
4106        }
4107    }
4108    /// Retrieves this container plus a volume mounted at the given path.
4109    ///
4110    /// # Arguments
4111    ///
4112    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4113    /// * `volume` - Identifier of the volume to mount.
4114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4115    pub fn with_mounted_volume(
4116        &self,
4117        path: impl Into<String>,
4118        volume: impl IntoID<Id>,
4119    ) -> Container {
4120        let mut query = self.selection.select("withMountedVolume");
4121        query = query.arg("path", path.into());
4122        query = query.arg_lazy(
4123            "volume",
4124            Box::new(move || {
4125                let volume = volume.clone();
4126                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4127            }),
4128        );
4129        Container {
4130            proc: self.proc.clone(),
4131            selection: query,
4132            graphql_client: self.graphql_client.clone(),
4133        }
4134    }
4135    /// Retrieves this container plus a volume mounted at the given path.
4136    ///
4137    /// # Arguments
4138    ///
4139    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4140    /// * `volume` - Identifier of the volume to mount.
4141    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4142    pub fn with_mounted_volume_opts(
4143        &self,
4144        path: impl Into<String>,
4145        volume: impl IntoID<Id>,
4146        opts: ContainerWithMountedVolumeOpts,
4147    ) -> Container {
4148        let mut query = self.selection.select("withMountedVolume");
4149        query = query.arg("path", path.into());
4150        query = query.arg_lazy(
4151            "volume",
4152            Box::new(move || {
4153                let volume = volume.clone();
4154                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4155            }),
4156        );
4157        if let Some(read_only) = opts.read_only {
4158            query = query.arg("readOnly", read_only);
4159        }
4160        if let Some(expand) = opts.expand {
4161            query = query.arg("expand", expand);
4162        }
4163        Container {
4164            proc: self.proc.clone(),
4165            selection: query,
4166            graphql_client: self.graphql_client.clone(),
4167        }
4168    }
4169    /// Return a new container snapshot, with a file added to its filesystem with text content
4170    ///
4171    /// # Arguments
4172    ///
4173    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4174    /// * `contents` - Contents of the new file. Example: "Hello world!"
4175    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4176    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4177        let mut query = self.selection.select("withNewFile");
4178        query = query.arg("path", path.into());
4179        query = query.arg("contents", contents.into());
4180        Container {
4181            proc: self.proc.clone(),
4182            selection: query,
4183            graphql_client: self.graphql_client.clone(),
4184        }
4185    }
4186    /// Return a new container snapshot, with a file added to its filesystem with text content
4187    ///
4188    /// # Arguments
4189    ///
4190    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4191    /// * `contents` - Contents of the new file. Example: "Hello world!"
4192    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4193    pub fn with_new_file_opts<'a>(
4194        &self,
4195        path: impl Into<String>,
4196        contents: impl Into<String>,
4197        opts: ContainerWithNewFileOpts<'a>,
4198    ) -> Container {
4199        let mut query = self.selection.select("withNewFile");
4200        query = query.arg("path", path.into());
4201        query = query.arg("contents", contents.into());
4202        if let Some(permissions) = opts.permissions {
4203            query = query.arg("permissions", permissions);
4204        }
4205        if let Some(owner) = opts.owner {
4206            query = query.arg("owner", owner);
4207        }
4208        if let Some(inherit_owner) = opts.inherit_owner {
4209            query = query.arg("inheritOwner", inherit_owner);
4210        }
4211        if let Some(expand) = opts.expand {
4212            query = query.arg("expand", expand);
4213        }
4214        Container {
4215            proc: self.proc.clone(),
4216            selection: query,
4217            graphql_client: self.graphql_client.clone(),
4218        }
4219    }
4220    /// Attach credentials for future publishing to a registry. Use in combination with publish
4221    ///
4222    /// # Arguments
4223    ///
4224    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
4225    /// * `username` - The username to authenticate with. Example: "alice"
4226    /// * `secret` - The API key, password or token to authenticate to this registry
4227    pub fn with_registry_auth(
4228        &self,
4229        address: impl Into<String>,
4230        username: impl Into<String>,
4231        secret: impl IntoID<Id>,
4232    ) -> Container {
4233        let mut query = self.selection.select("withRegistryAuth");
4234        query = query.arg("address", address.into());
4235        query = query.arg("username", username.into());
4236        query = query.arg_lazy(
4237            "secret",
4238            Box::new(move || {
4239                let secret = secret.clone();
4240                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4241            }),
4242        );
4243        Container {
4244            proc: self.proc.clone(),
4245            selection: query,
4246            graphql_client: self.graphql_client.clone(),
4247        }
4248    }
4249    /// Change the container's root filesystem. The previous root filesystem will be lost.
4250    ///
4251    /// # Arguments
4252    ///
4253    /// * `directory` - The new root filesystem.
4254    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
4255        let mut query = self.selection.select("withRootfs");
4256        query = query.arg_lazy(
4257            "directory",
4258            Box::new(move || {
4259                let directory = directory.clone();
4260                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4261            }),
4262        );
4263        Container {
4264            proc: self.proc.clone(),
4265            selection: query,
4266            graphql_client: self.graphql_client.clone(),
4267        }
4268    }
4269    /// Set a new environment variable, using a secret value
4270    ///
4271    /// # Arguments
4272    ///
4273    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
4274    /// * `secret` - Identifier of the secret value.
4275    pub fn with_secret_variable(
4276        &self,
4277        name: impl Into<String>,
4278        secret: impl IntoID<Id>,
4279    ) -> Container {
4280        let mut query = self.selection.select("withSecretVariable");
4281        query = query.arg("name", name.into());
4282        query = query.arg_lazy(
4283            "secret",
4284            Box::new(move || {
4285                let secret = secret.clone();
4286                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4287            }),
4288        );
4289        Container {
4290            proc: self.proc.clone(),
4291            selection: query,
4292            graphql_client: self.graphql_client.clone(),
4293        }
4294    }
4295    /// Establish a runtime dependency from a container to a network service.
4296    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
4297    /// The service will be reachable from the container via the provided hostname alias.
4298    /// The service dependency will also convey to any files or directories produced by the container.
4299    ///
4300    /// # Arguments
4301    ///
4302    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
4303    /// * `service` - The target service
4304    pub fn with_service_binding(
4305        &self,
4306        alias: impl Into<String>,
4307        service: impl IntoID<Id>,
4308    ) -> Container {
4309        let mut query = self.selection.select("withServiceBinding");
4310        query = query.arg("alias", alias.into());
4311        query = query.arg_lazy(
4312            "service",
4313            Box::new(move || {
4314                let service = service.clone();
4315                Box::pin(async move { service.into_id().await.unwrap().quote() })
4316            }),
4317        );
4318        Container {
4319            proc: self.proc.clone(),
4320            selection: query,
4321            graphql_client: self.graphql_client.clone(),
4322        }
4323    }
4324    /// Return a snapshot with a symlink
4325    ///
4326    /// # Arguments
4327    ///
4328    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4329    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4330    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4331    pub fn with_symlink(
4332        &self,
4333        target: impl Into<String>,
4334        link_name: impl Into<String>,
4335    ) -> Container {
4336        let mut query = self.selection.select("withSymlink");
4337        query = query.arg("target", target.into());
4338        query = query.arg("linkName", link_name.into());
4339        Container {
4340            proc: self.proc.clone(),
4341            selection: query,
4342            graphql_client: self.graphql_client.clone(),
4343        }
4344    }
4345    /// Return a snapshot with a symlink
4346    ///
4347    /// # Arguments
4348    ///
4349    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4350    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4352    pub fn with_symlink_opts(
4353        &self,
4354        target: impl Into<String>,
4355        link_name: impl Into<String>,
4356        opts: ContainerWithSymlinkOpts,
4357    ) -> Container {
4358        let mut query = self.selection.select("withSymlink");
4359        query = query.arg("target", target.into());
4360        query = query.arg("linkName", link_name.into());
4361        if let Some(expand) = opts.expand {
4362            query = query.arg("expand", expand);
4363        }
4364        Container {
4365            proc: self.proc.clone(),
4366            selection: query,
4367            graphql_client: self.graphql_client.clone(),
4368        }
4369    }
4370    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4371    ///
4372    /// # Arguments
4373    ///
4374    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4375    /// * `source` - Identifier of the socket to forward.
4376    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4377    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4378        let mut query = self.selection.select("withUnixSocket");
4379        query = query.arg("path", path.into());
4380        query = query.arg_lazy(
4381            "source",
4382            Box::new(move || {
4383                let source = source.clone();
4384                Box::pin(async move { source.into_id().await.unwrap().quote() })
4385            }),
4386        );
4387        Container {
4388            proc: self.proc.clone(),
4389            selection: query,
4390            graphql_client: self.graphql_client.clone(),
4391        }
4392    }
4393    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4394    ///
4395    /// # Arguments
4396    ///
4397    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4398    /// * `source` - Identifier of the socket to forward.
4399    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4400    pub fn with_unix_socket_opts<'a>(
4401        &self,
4402        path: impl Into<String>,
4403        source: impl IntoID<Id>,
4404        opts: ContainerWithUnixSocketOpts<'a>,
4405    ) -> Container {
4406        let mut query = self.selection.select("withUnixSocket");
4407        query = query.arg("path", path.into());
4408        query = query.arg_lazy(
4409            "source",
4410            Box::new(move || {
4411                let source = source.clone();
4412                Box::pin(async move { source.into_id().await.unwrap().quote() })
4413            }),
4414        );
4415        if let Some(owner) = opts.owner {
4416            query = query.arg("owner", owner);
4417        }
4418        if let Some(inherit_owner) = opts.inherit_owner {
4419            query = query.arg("inheritOwner", inherit_owner);
4420        }
4421        if let Some(expand) = opts.expand {
4422            query = query.arg("expand", expand);
4423        }
4424        Container {
4425            proc: self.proc.clone(),
4426            selection: query,
4427            graphql_client: self.graphql_client.clone(),
4428        }
4429    }
4430    /// Retrieves this container with a different command user.
4431    ///
4432    /// # Arguments
4433    ///
4434    /// * `name` - The user to set (e.g., "root").
4435    pub fn with_user(&self, name: impl Into<String>) -> Container {
4436        let mut query = self.selection.select("withUser");
4437        query = query.arg("name", name.into());
4438        Container {
4439            proc: self.proc.clone(),
4440            selection: query,
4441            graphql_client: self.graphql_client.clone(),
4442        }
4443    }
4444    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
4445    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
4446    ///
4447    /// # Arguments
4448    ///
4449    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
4450    /// * `value` - Value of the volatile variable.
4451    pub fn with_volatile_variable(
4452        &self,
4453        name: impl Into<String>,
4454        value: impl Into<String>,
4455    ) -> Container {
4456        let mut query = self.selection.select("withVolatileVariable");
4457        query = query.arg("name", name.into());
4458        query = query.arg("value", value.into());
4459        Container {
4460            proc: self.proc.clone(),
4461            selection: query,
4462            graphql_client: self.graphql_client.clone(),
4463        }
4464    }
4465    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4466    ///
4467    /// # Arguments
4468    ///
4469    /// * `path` - The path to set as the working directory (e.g., "/app").
4470    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4471    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4472        let mut query = self.selection.select("withWorkdir");
4473        query = query.arg("path", path.into());
4474        Container {
4475            proc: self.proc.clone(),
4476            selection: query,
4477            graphql_client: self.graphql_client.clone(),
4478        }
4479    }
4480    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4481    ///
4482    /// # Arguments
4483    ///
4484    /// * `path` - The path to set as the working directory (e.g., "/app").
4485    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4486    pub fn with_workdir_opts(
4487        &self,
4488        path: impl Into<String>,
4489        opts: ContainerWithWorkdirOpts,
4490    ) -> Container {
4491        let mut query = self.selection.select("withWorkdir");
4492        query = query.arg("path", path.into());
4493        if let Some(expand) = opts.expand {
4494            query = query.arg("expand", expand);
4495        }
4496        Container {
4497            proc: self.proc.clone(),
4498            selection: query,
4499            graphql_client: self.graphql_client.clone(),
4500        }
4501    }
4502    /// Retrieves this container minus the given OCI annotation.
4503    ///
4504    /// # Arguments
4505    ///
4506    /// * `name` - The name of the annotation.
4507    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4508        let mut query = self.selection.select("withoutAnnotation");
4509        query = query.arg("name", name.into());
4510        Container {
4511            proc: self.proc.clone(),
4512            selection: query,
4513            graphql_client: self.graphql_client.clone(),
4514        }
4515    }
4516    /// Remove the container's default arguments.
4517    pub fn without_default_args(&self) -> Container {
4518        let query = self.selection.select("withoutDefaultArgs");
4519        Container {
4520            proc: self.proc.clone(),
4521            selection: query,
4522            graphql_client: self.graphql_client.clone(),
4523        }
4524    }
4525    /// Return a new container snapshot, with a directory removed from its filesystem
4526    ///
4527    /// # Arguments
4528    ///
4529    /// * `path` - Location of the directory to remove (e.g., ".github/").
4530    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4531    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4532        let mut query = self.selection.select("withoutDirectory");
4533        query = query.arg("path", path.into());
4534        Container {
4535            proc: self.proc.clone(),
4536            selection: query,
4537            graphql_client: self.graphql_client.clone(),
4538        }
4539    }
4540    /// Return a new container snapshot, with a directory removed from its filesystem
4541    ///
4542    /// # Arguments
4543    ///
4544    /// * `path` - Location of the directory to remove (e.g., ".github/").
4545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4546    pub fn without_directory_opts(
4547        &self,
4548        path: impl Into<String>,
4549        opts: ContainerWithoutDirectoryOpts,
4550    ) -> Container {
4551        let mut query = self.selection.select("withoutDirectory");
4552        query = query.arg("path", path.into());
4553        if let Some(expand) = opts.expand {
4554            query = query.arg("expand", expand);
4555        }
4556        Container {
4557            proc: self.proc.clone(),
4558            selection: query,
4559            graphql_client: self.graphql_client.clone(),
4560        }
4561    }
4562    /// Retrieves this container without a configured docker healtcheck command.
4563    pub fn without_docker_healthcheck(&self) -> Container {
4564        let query = self.selection.select("withoutDockerHealthcheck");
4565        Container {
4566            proc: self.proc.clone(),
4567            selection: query,
4568            graphql_client: self.graphql_client.clone(),
4569        }
4570    }
4571    /// Reset the container's OCI entrypoint.
4572    ///
4573    /// # Arguments
4574    ///
4575    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4576    pub fn without_entrypoint(&self) -> Container {
4577        let query = self.selection.select("withoutEntrypoint");
4578        Container {
4579            proc: self.proc.clone(),
4580            selection: query,
4581            graphql_client: self.graphql_client.clone(),
4582        }
4583    }
4584    /// Reset the container's OCI entrypoint.
4585    ///
4586    /// # Arguments
4587    ///
4588    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4589    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4590        let mut query = self.selection.select("withoutEntrypoint");
4591        if let Some(keep_default_args) = opts.keep_default_args {
4592            query = query.arg("keepDefaultArgs", keep_default_args);
4593        }
4594        Container {
4595            proc: self.proc.clone(),
4596            selection: query,
4597            graphql_client: self.graphql_client.clone(),
4598        }
4599    }
4600    /// Retrieves this container minus the given environment variable.
4601    ///
4602    /// # Arguments
4603    ///
4604    /// * `name` - The name of the environment variable (e.g., "HOST").
4605    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4606        let mut query = self.selection.select("withoutEnvVariable");
4607        query = query.arg("name", name.into());
4608        Container {
4609            proc: self.proc.clone(),
4610            selection: query,
4611            graphql_client: self.graphql_client.clone(),
4612        }
4613    }
4614    /// Unexpose a previously exposed port.
4615    ///
4616    /// # Arguments
4617    ///
4618    /// * `port` - Port number to unexpose
4619    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4620    pub fn without_exposed_port(&self, port: isize) -> Container {
4621        let mut query = self.selection.select("withoutExposedPort");
4622        query = query.arg("port", port);
4623        Container {
4624            proc: self.proc.clone(),
4625            selection: query,
4626            graphql_client: self.graphql_client.clone(),
4627        }
4628    }
4629    /// Unexpose a previously exposed port.
4630    ///
4631    /// # Arguments
4632    ///
4633    /// * `port` - Port number to unexpose
4634    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4635    pub fn without_exposed_port_opts(
4636        &self,
4637        port: isize,
4638        opts: ContainerWithoutExposedPortOpts,
4639    ) -> Container {
4640        let mut query = self.selection.select("withoutExposedPort");
4641        query = query.arg("port", port);
4642        if let Some(protocol) = opts.protocol {
4643            query = query.arg("protocol", protocol);
4644        }
4645        Container {
4646            proc: self.proc.clone(),
4647            selection: query,
4648            graphql_client: self.graphql_client.clone(),
4649        }
4650    }
4651    /// Retrieves this container with the file at the given path removed.
4652    ///
4653    /// # Arguments
4654    ///
4655    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4657    pub fn without_file(&self, path: impl Into<String>) -> Container {
4658        let mut query = self.selection.select("withoutFile");
4659        query = query.arg("path", path.into());
4660        Container {
4661            proc: self.proc.clone(),
4662            selection: query,
4663            graphql_client: self.graphql_client.clone(),
4664        }
4665    }
4666    /// Retrieves this container with the file at the given path removed.
4667    ///
4668    /// # Arguments
4669    ///
4670    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4671    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4672    pub fn without_file_opts(
4673        &self,
4674        path: impl Into<String>,
4675        opts: ContainerWithoutFileOpts,
4676    ) -> Container {
4677        let mut query = self.selection.select("withoutFile");
4678        query = query.arg("path", path.into());
4679        if let Some(expand) = opts.expand {
4680            query = query.arg("expand", expand);
4681        }
4682        Container {
4683            proc: self.proc.clone(),
4684            selection: query,
4685            graphql_client: self.graphql_client.clone(),
4686        }
4687    }
4688    /// Return a new container spanshot with specified files removed
4689    ///
4690    /// # Arguments
4691    ///
4692    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4694    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4695        let mut query = self.selection.select("withoutFiles");
4696        query = query.arg(
4697            "paths",
4698            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4699        );
4700        Container {
4701            proc: self.proc.clone(),
4702            selection: query,
4703            graphql_client: self.graphql_client.clone(),
4704        }
4705    }
4706    /// Return a new container spanshot with specified files removed
4707    ///
4708    /// # Arguments
4709    ///
4710    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4711    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4712    pub fn without_files_opts(
4713        &self,
4714        paths: Vec<impl Into<String>>,
4715        opts: ContainerWithoutFilesOpts,
4716    ) -> Container {
4717        let mut query = self.selection.select("withoutFiles");
4718        query = query.arg(
4719            "paths",
4720            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4721        );
4722        if let Some(expand) = opts.expand {
4723            query = query.arg("expand", expand);
4724        }
4725        Container {
4726            proc: self.proc.clone(),
4727            selection: query,
4728            graphql_client: self.graphql_client.clone(),
4729        }
4730    }
4731    /// Retrieves this container minus the given environment label.
4732    ///
4733    /// # Arguments
4734    ///
4735    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4736    pub fn without_label(&self, name: impl Into<String>) -> Container {
4737        let mut query = self.selection.select("withoutLabel");
4738        query = query.arg("name", name.into());
4739        Container {
4740            proc: self.proc.clone(),
4741            selection: query,
4742            graphql_client: self.graphql_client.clone(),
4743        }
4744    }
4745    /// Retrieves this container after unmounting everything at the given path.
4746    ///
4747    /// # Arguments
4748    ///
4749    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4750    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4751    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4752        let mut query = self.selection.select("withoutMount");
4753        query = query.arg("path", path.into());
4754        Container {
4755            proc: self.proc.clone(),
4756            selection: query,
4757            graphql_client: self.graphql_client.clone(),
4758        }
4759    }
4760    /// Retrieves this container after unmounting everything at the given path.
4761    ///
4762    /// # Arguments
4763    ///
4764    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4766    pub fn without_mount_opts(
4767        &self,
4768        path: impl Into<String>,
4769        opts: ContainerWithoutMountOpts,
4770    ) -> Container {
4771        let mut query = self.selection.select("withoutMount");
4772        query = query.arg("path", path.into());
4773        if let Some(expand) = opts.expand {
4774            query = query.arg("expand", expand);
4775        }
4776        Container {
4777            proc: self.proc.clone(),
4778            selection: query,
4779            graphql_client: self.graphql_client.clone(),
4780        }
4781    }
4782    /// Retrieves this container without the registry authentication of a given address.
4783    ///
4784    /// # Arguments
4785    ///
4786    /// * `address` - Registry's address to remove the authentication from.
4787    ///
4788    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4789    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4790        let mut query = self.selection.select("withoutRegistryAuth");
4791        query = query.arg("address", address.into());
4792        Container {
4793            proc: self.proc.clone(),
4794            selection: query,
4795            graphql_client: self.graphql_client.clone(),
4796        }
4797    }
4798    /// Retrieves this container minus the given environment variable containing the secret.
4799    ///
4800    /// # Arguments
4801    ///
4802    /// * `name` - The name of the environment variable (e.g., "HOST").
4803    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4804        let mut query = self.selection.select("withoutSecretVariable");
4805        query = query.arg("name", name.into());
4806        Container {
4807            proc: self.proc.clone(),
4808            selection: query,
4809            graphql_client: self.graphql_client.clone(),
4810        }
4811    }
4812    /// Retrieves this container with a previously added Unix socket removed.
4813    ///
4814    /// # Arguments
4815    ///
4816    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4817    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4818    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4819        let mut query = self.selection.select("withoutUnixSocket");
4820        query = query.arg("path", path.into());
4821        Container {
4822            proc: self.proc.clone(),
4823            selection: query,
4824            graphql_client: self.graphql_client.clone(),
4825        }
4826    }
4827    /// Retrieves this container with a previously added Unix socket removed.
4828    ///
4829    /// # Arguments
4830    ///
4831    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4833    pub fn without_unix_socket_opts(
4834        &self,
4835        path: impl Into<String>,
4836        opts: ContainerWithoutUnixSocketOpts,
4837    ) -> Container {
4838        let mut query = self.selection.select("withoutUnixSocket");
4839        query = query.arg("path", path.into());
4840        if let Some(expand) = opts.expand {
4841            query = query.arg("expand", expand);
4842        }
4843        Container {
4844            proc: self.proc.clone(),
4845            selection: query,
4846            graphql_client: self.graphql_client.clone(),
4847        }
4848    }
4849    /// Retrieves this container with an unset command user.
4850    /// Should default to root.
4851    pub fn without_user(&self) -> Container {
4852        let query = self.selection.select("withoutUser");
4853        Container {
4854            proc: self.proc.clone(),
4855            selection: query,
4856            graphql_client: self.graphql_client.clone(),
4857        }
4858    }
4859    /// Retrieves this container minus the given volatile environment variable.
4860    ///
4861    /// # Arguments
4862    ///
4863    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4864    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4865        let mut query = self.selection.select("withoutVolatileVariable");
4866        query = query.arg("name", name.into());
4867        Container {
4868            proc: self.proc.clone(),
4869            selection: query,
4870            graphql_client: self.graphql_client.clone(),
4871        }
4872    }
4873    /// Unset the container's working directory.
4874    /// Should default to "/".
4875    pub fn without_workdir(&self) -> Container {
4876        let query = self.selection.select("withoutWorkdir");
4877        Container {
4878            proc: self.proc.clone(),
4879            selection: query,
4880            graphql_client: self.graphql_client.clone(),
4881        }
4882    }
4883    /// Retrieves the working directory for all commands.
4884    pub async fn workdir(&self) -> Result<String, DaggerError> {
4885        let query = self.selection.select("workdir");
4886        query.execute(self.graphql_client.clone()).await
4887    }
4888}
4889impl Exportable for Container {
4890    fn export(
4891        &self,
4892        path: impl Into<String>,
4893    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4894        let mut query = self.selection.select("export");
4895        query = query.arg("path", path.into());
4896        let graphql_client = self.graphql_client.clone();
4897        async move { query.execute(graphql_client).await }
4898    }
4899    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4900        let query = self.selection.select("id");
4901        let graphql_client = self.graphql_client.clone();
4902        async move { query.execute(graphql_client).await }
4903    }
4904}
4905impl Node for Container {
4906    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4907        let query = self.selection.select("id");
4908        let graphql_client = self.graphql_client.clone();
4909        async move { query.execute(graphql_client).await }
4910    }
4911}
4912impl Syncer for Container {
4913    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4914        let query = self.selection.select("id");
4915        let graphql_client = self.graphql_client.clone();
4916        async move { query.execute(graphql_client).await }
4917    }
4918    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
4919        let query = self.selection.select("sync");
4920        let proc = self.proc.clone();
4921        let graphql_client = self.graphql_client.clone();
4922        async move {
4923            let id: Id = query.execute(graphql_client.clone()).await?;
4924            Ok(Self {
4925                proc,
4926                selection: query
4927                    .root()
4928                    .select("node")
4929                    .arg("id", &id.0)
4930                    .inline_fragment("Container"),
4931                graphql_client,
4932            })
4933        }
4934    }
4935}
4936#[derive(Clone)]
4937pub struct CurrentModule {
4938    pub proc: Option<Arc<DaggerSessionProc>>,
4939    pub selection: Selection,
4940    pub graphql_client: DynGraphQLClient,
4941}
4942#[derive(Builder, Debug, PartialEq)]
4943pub struct CurrentModuleGeneratorsOpts<'a> {
4944    /// Only include generators matching the specified patterns
4945    #[builder(setter(into, strip_option), default)]
4946    pub include: Option<Vec<&'a str>>,
4947}
4948#[derive(Builder, Debug, PartialEq)]
4949pub struct CurrentModuleWorkdirOpts<'a> {
4950    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4951    #[builder(setter(into, strip_option), default)]
4952    pub exclude: Option<Vec<&'a str>>,
4953    /// Apply .gitignore filter rules inside the directory
4954    #[builder(setter(into, strip_option), default)]
4955    pub gitignore: Option<bool>,
4956    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4957    #[builder(setter(into, strip_option), default)]
4958    pub include: Option<Vec<&'a str>>,
4959}
4960impl IntoID<Id> for CurrentModule {
4961    fn into_id(
4962        self,
4963    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4964        Box::pin(async move { self.id().await })
4965    }
4966}
4967impl Loadable for CurrentModule {
4968    fn graphql_type() -> &'static str {
4969        "CurrentModule"
4970    }
4971    fn from_query(
4972        proc: Option<Arc<DaggerSessionProc>>,
4973        selection: Selection,
4974        graphql_client: DynGraphQLClient,
4975    ) -> Self {
4976        Self {
4977            proc,
4978            selection,
4979            graphql_client,
4980        }
4981    }
4982}
4983impl CurrentModule {
4984    /// The dependencies of the module.
4985    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4986        let query = self.selection.select("dependencies");
4987        let query = query.select("id");
4988        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4989        Ok(ids
4990            .into_iter()
4991            .map(|id| Module {
4992                proc: self.proc.clone(),
4993                selection: crate::querybuilder::query()
4994                    .select("node")
4995                    .arg("id", &id.0)
4996                    .inline_fragment("Module"),
4997                graphql_client: self.graphql_client.clone(),
4998            })
4999            .collect())
5000    }
5001    /// The generated files and directories made on top of the module source's context directory.
5002    pub fn generated_context_directory(&self) -> Directory {
5003        let query = self.selection.select("generatedContextDirectory");
5004        Directory {
5005            proc: self.proc.clone(),
5006            selection: query,
5007            graphql_client: self.graphql_client.clone(),
5008        }
5009    }
5010    /// Return all generators defined by the module
5011    ///
5012    /// # Arguments
5013    ///
5014    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5015    pub fn generators(&self) -> GeneratorGroup {
5016        let query = self.selection.select("generators");
5017        GeneratorGroup {
5018            proc: self.proc.clone(),
5019            selection: query,
5020            graphql_client: self.graphql_client.clone(),
5021        }
5022    }
5023    /// Return all generators defined by the module
5024    ///
5025    /// # Arguments
5026    ///
5027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5028    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
5029        let mut query = self.selection.select("generators");
5030        if let Some(include) = opts.include {
5031            query = query.arg("include", include);
5032        }
5033        GeneratorGroup {
5034            proc: self.proc.clone(),
5035            selection: query,
5036            graphql_client: self.graphql_client.clone(),
5037        }
5038    }
5039    /// A unique identifier for this CurrentModule.
5040    pub async fn id(&self) -> Result<Id, DaggerError> {
5041        let query = self.selection.select("id");
5042        query.execute(self.graphql_client.clone()).await
5043    }
5044    /// The name of the module being executed in
5045    pub async fn name(&self) -> Result<String, DaggerError> {
5046        let query = self.selection.select("name");
5047        query.execute(self.graphql_client.clone()).await
5048    }
5049    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
5050    pub fn source(&self) -> Directory {
5051        let query = self.selection.select("source");
5052        Directory {
5053            proc: self.proc.clone(),
5054            selection: query,
5055            graphql_client: self.graphql_client.clone(),
5056        }
5057    }
5058    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5059    ///
5060    /// # Arguments
5061    ///
5062    /// * `path` - Location of the directory to access (e.g., ".").
5063    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5064    pub fn workdir(&self, path: impl Into<String>) -> Directory {
5065        let mut query = self.selection.select("workdir");
5066        query = query.arg("path", path.into());
5067        Directory {
5068            proc: self.proc.clone(),
5069            selection: query,
5070            graphql_client: self.graphql_client.clone(),
5071        }
5072    }
5073    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5074    ///
5075    /// # Arguments
5076    ///
5077    /// * `path` - Location of the directory to access (e.g., ".").
5078    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5079    pub fn workdir_opts<'a>(
5080        &self,
5081        path: impl Into<String>,
5082        opts: CurrentModuleWorkdirOpts<'a>,
5083    ) -> Directory {
5084        let mut query = self.selection.select("workdir");
5085        query = query.arg("path", path.into());
5086        if let Some(exclude) = opts.exclude {
5087            query = query.arg("exclude", exclude);
5088        }
5089        if let Some(include) = opts.include {
5090            query = query.arg("include", include);
5091        }
5092        if let Some(gitignore) = opts.gitignore {
5093            query = query.arg("gitignore", gitignore);
5094        }
5095        Directory {
5096            proc: self.proc.clone(),
5097            selection: query,
5098            graphql_client: self.graphql_client.clone(),
5099        }
5100    }
5101    /// Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5102    ///
5103    /// # Arguments
5104    ///
5105    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5106    pub fn workdir_file(&self, path: impl Into<String>) -> File {
5107        let mut query = self.selection.select("workdirFile");
5108        query = query.arg("path", path.into());
5109        File {
5110            proc: self.proc.clone(),
5111            selection: query,
5112            graphql_client: self.graphql_client.clone(),
5113        }
5114    }
5115}
5116impl Node for CurrentModule {
5117    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5118        let query = self.selection.select("id");
5119        let graphql_client = self.graphql_client.clone();
5120        async move { query.execute(graphql_client).await }
5121    }
5122}
5123#[derive(Clone)]
5124pub struct DiffStat {
5125    pub proc: Option<Arc<DaggerSessionProc>>,
5126    pub selection: Selection,
5127    pub graphql_client: DynGraphQLClient,
5128}
5129impl IntoID<Id> for DiffStat {
5130    fn into_id(
5131        self,
5132    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5133        Box::pin(async move { self.id().await })
5134    }
5135}
5136impl Loadable for DiffStat {
5137    fn graphql_type() -> &'static str {
5138        "DiffStat"
5139    }
5140    fn from_query(
5141        proc: Option<Arc<DaggerSessionProc>>,
5142        selection: Selection,
5143        graphql_client: DynGraphQLClient,
5144    ) -> Self {
5145        Self {
5146            proc,
5147            selection,
5148            graphql_client,
5149        }
5150    }
5151}
5152impl DiffStat {
5153    /// Number of added lines for this path.
5154    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
5155        let query = self.selection.select("addedLines");
5156        query.execute(self.graphql_client.clone()).await
5157    }
5158    /// A unique identifier for this DiffStat.
5159    pub async fn id(&self) -> Result<Id, DaggerError> {
5160        let query = self.selection.select("id");
5161        query.execute(self.graphql_client.clone()).await
5162    }
5163    /// Type of change.
5164    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
5165        let query = self.selection.select("kind");
5166        query.execute(self.graphql_client.clone()).await
5167    }
5168    /// Previous path of the file, set only for renames.
5169    pub async fn old_path(&self) -> Result<String, DaggerError> {
5170        let query = self.selection.select("oldPath");
5171        query.execute(self.graphql_client.clone()).await
5172    }
5173    /// Path of the changed file or directory.
5174    pub async fn path(&self) -> Result<String, DaggerError> {
5175        let query = self.selection.select("path");
5176        query.execute(self.graphql_client.clone()).await
5177    }
5178    /// Number of removed lines for this path.
5179    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
5180        let query = self.selection.select("removedLines");
5181        query.execute(self.graphql_client.clone()).await
5182    }
5183}
5184impl Node for DiffStat {
5185    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5186        let query = self.selection.select("id");
5187        let graphql_client = self.graphql_client.clone();
5188        async move { query.execute(graphql_client).await }
5189    }
5190}
5191#[derive(Clone)]
5192pub struct Directory {
5193    pub proc: Option<Arc<DaggerSessionProc>>,
5194    pub selection: Selection,
5195    pub graphql_client: DynGraphQLClient,
5196}
5197#[derive(Builder, Debug, PartialEq)]
5198pub struct DirectoryAsModuleOpts<'a> {
5199    /// An optional subpath of the directory which contains the module's configuration file.
5200    /// If not set, the module source code is loaded from the root of the directory.
5201    #[builder(setter(into, strip_option), default)]
5202    pub source_root_path: Option<&'a str>,
5203}
5204#[derive(Builder, Debug, PartialEq)]
5205pub struct DirectoryAsModuleSourceOpts<'a> {
5206    /// An optional subpath of the directory which contains the module's configuration file.
5207    /// If not set, the module source code is loaded from the root of the directory.
5208    #[builder(setter(into, strip_option), default)]
5209    pub source_root_path: Option<&'a str>,
5210}
5211#[derive(Builder, Debug, PartialEq)]
5212pub struct DirectoryAsWorkspaceOpts<'a> {
5213    /// Current working directory inside the workspace root. Defaults to the workspace root.
5214    #[builder(setter(into, strip_option), default)]
5215    pub cwd: Option<&'a str>,
5216}
5217#[derive(Builder, Debug, PartialEq)]
5218pub struct DirectoryDockerBuildOpts<'a> {
5219    /// Build arguments to use in the build.
5220    #[builder(setter(into, strip_option), default)]
5221    pub build_args: Option<Vec<BuildArg>>,
5222    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
5223    #[builder(setter(into, strip_option), default)]
5224    pub dockerfile: Option<&'a str>,
5225    /// If set, skip the automatic init process injected into containers created by RUN statements.
5226    /// This should only be used if the user requires that their exec processes be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
5227    #[builder(setter(into, strip_option), default)]
5228    pub no_init: Option<bool>,
5229    /// The platform to build.
5230    #[builder(setter(into, strip_option), default)]
5231    pub platform: Option<Platform>,
5232    /// Secrets to pass to the build.
5233    /// They will be mounted at /run/secrets/[secret-name].
5234    #[builder(setter(into, strip_option), default)]
5235    pub secrets: Option<Vec<Id>>,
5236    /// A socket to use for SSH authentication during the build
5237    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
5238    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
5239    #[builder(setter(into, strip_option), default)]
5240    pub ssh: Option<Id>,
5241    /// Target build stage to build.
5242    #[builder(setter(into, strip_option), default)]
5243    pub target: Option<&'a str>,
5244}
5245#[derive(Builder, Debug, PartialEq)]
5246pub struct DirectoryEntriesOpts<'a> {
5247    /// Location of the directory to look at (e.g., "/src").
5248    #[builder(setter(into, strip_option), default)]
5249    pub path: Option<&'a str>,
5250}
5251#[derive(Builder, Debug, PartialEq)]
5252pub struct DirectoryExistsOpts {
5253    /// If specified, do not follow symlinks.
5254    #[builder(setter(into, strip_option), default)]
5255    pub do_not_follow_symlinks: Option<bool>,
5256    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
5257    #[builder(setter(into, strip_option), default)]
5258    pub expected_type: Option<ExistsType>,
5259}
5260#[derive(Builder, Debug, PartialEq)]
5261pub struct DirectoryExportOpts {
5262    /// If true, then the host directory will be wiped clean before exporting so that it exactly matches the directory being exported; this means it will delete any files on the host that aren't in the exported dir. If false (the default), the contents of the directory will be merged with any existing contents of the host directory, leaving any existing files on the host that aren't in the exported directory alone.
5263    #[builder(setter(into, strip_option), default)]
5264    pub wipe: Option<bool>,
5265}
5266#[derive(Builder, Debug, PartialEq)]
5267pub struct DirectoryFilterOpts<'a> {
5268    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
5269    #[builder(setter(into, strip_option), default)]
5270    pub exclude: Option<Vec<&'a str>>,
5271    /// If set, apply .gitignore rules when filtering the directory.
5272    #[builder(setter(into, strip_option), default)]
5273    pub gitignore: Option<bool>,
5274    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
5275    #[builder(setter(into, strip_option), default)]
5276    pub include: Option<Vec<&'a str>>,
5277}
5278#[derive(Builder, Debug, PartialEq)]
5279pub struct DirectorySearchOpts<'a> {
5280    /// Allow the . pattern to match newlines in multiline mode.
5281    #[builder(setter(into, strip_option), default)]
5282    pub dotall: Option<bool>,
5283    /// Only return matching files, not lines and content
5284    #[builder(setter(into, strip_option), default)]
5285    pub files_only: Option<bool>,
5286    /// Glob patterns to match (e.g., "*.md")
5287    #[builder(setter(into, strip_option), default)]
5288    pub globs: Option<Vec<&'a str>>,
5289    /// Enable case-insensitive matching.
5290    #[builder(setter(into, strip_option), default)]
5291    pub insensitive: Option<bool>,
5292    /// Limit the number of results to return
5293    #[builder(setter(into, strip_option), default)]
5294    pub limit: Option<isize>,
5295    /// Interpret the pattern as a literal string instead of a regular expression.
5296    #[builder(setter(into, strip_option), default)]
5297    pub literal: Option<bool>,
5298    /// Enable searching across multiple lines.
5299    #[builder(setter(into, strip_option), default)]
5300    pub multiline: Option<bool>,
5301    /// Directory or file paths to search
5302    #[builder(setter(into, strip_option), default)]
5303    pub paths: Option<Vec<&'a str>>,
5304    /// Skip hidden files (files starting with .).
5305    #[builder(setter(into, strip_option), default)]
5306    pub skip_hidden: Option<bool>,
5307    /// Honor .gitignore, .ignore, and .rgignore files.
5308    #[builder(setter(into, strip_option), default)]
5309    pub skip_ignored: Option<bool>,
5310}
5311#[derive(Builder, Debug, PartialEq)]
5312pub struct DirectoryStatOpts {
5313    /// If specified, do not follow symlinks.
5314    #[builder(setter(into, strip_option), default)]
5315    pub do_not_follow_symlinks: Option<bool>,
5316}
5317#[derive(Builder, Debug, PartialEq)]
5318pub struct DirectoryTerminalOpts<'a> {
5319    /// If set, override the container's default terminal command and invoke these command arguments instead.
5320    #[builder(setter(into, strip_option), default)]
5321    pub cmd: Option<Vec<&'a str>>,
5322    /// If set, override the default container used for the terminal.
5323    #[builder(setter(into, strip_option), default)]
5324    pub container: Option<Id>,
5325    /// Provides Dagger access to the executed command.
5326    #[builder(setter(into, strip_option), default)]
5327    pub experimental_privileged_nesting: Option<bool>,
5328    /// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
5329    #[builder(setter(into, strip_option), default)]
5330    pub insecure_root_capabilities: Option<bool>,
5331}
5332#[derive(Builder, Debug, PartialEq)]
5333pub struct DirectoryWithDirectoryOpts<'a> {
5334    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5335    #[builder(setter(into, strip_option), default)]
5336    pub exclude: Option<Vec<&'a str>>,
5337    /// Apply .gitignore filter rules inside the directory
5338    #[builder(setter(into, strip_option), default)]
5339    pub gitignore: Option<bool>,
5340    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5341    #[builder(setter(into, strip_option), default)]
5342    pub include: Option<Vec<&'a str>>,
5343    /// A user:group to set for the copied directory and its contents.
5344    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
5345    /// If the group is omitted, it defaults to the same as the user.
5346    #[builder(setter(into, strip_option), default)]
5347    pub owner: Option<&'a str>,
5348    /// Permission given to the copied directory and contents (e.g., 0755).
5349    #[builder(setter(into, strip_option), default)]
5350    pub permissions: Option<isize>,
5351}
5352#[derive(Builder, Debug, PartialEq)]
5353pub struct DirectoryWithFileOpts<'a> {
5354    /// A user:group to set for the copied directory and its contents.
5355    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
5356    /// If the group is omitted, it defaults to the same as the user.
5357    #[builder(setter(into, strip_option), default)]
5358    pub owner: Option<&'a str>,
5359    /// Permission given to the copied file (e.g., 0600).
5360    #[builder(setter(into, strip_option), default)]
5361    pub permissions: Option<isize>,
5362}
5363#[derive(Builder, Debug, PartialEq)]
5364pub struct DirectoryWithFilesOpts {
5365    /// Permission given to the copied files (e.g., 0600).
5366    #[builder(setter(into, strip_option), default)]
5367    pub permissions: Option<isize>,
5368}
5369#[derive(Builder, Debug, PartialEq)]
5370pub struct DirectoryWithNewDirectoryOpts {
5371    /// Permission granted to the created directory (e.g., 0777).
5372    #[builder(setter(into, strip_option), default)]
5373    pub permissions: Option<isize>,
5374}
5375#[derive(Builder, Debug, PartialEq)]
5376pub struct DirectoryWithNewFileOpts {
5377    /// Permissions of the new file. Example: 0600
5378    #[builder(setter(into, strip_option), default)]
5379    pub permissions: Option<isize>,
5380}
5381#[derive(Builder, Debug, PartialEq)]
5382pub struct DirectoryWithPatchOpts {
5383    /// How to handle hunks that no longer apply to the target content: fail (default), or apply what fits and leave git-style conflict markers where it doesn't.
5384    #[builder(setter(into, strip_option), default)]
5385    pub on_conflict: Option<PatchConflict>,
5386}
5387#[derive(Builder, Debug, PartialEq)]
5388pub struct DirectoryWithPatchFileOpts {
5389    /// How to handle hunks that no longer apply to the target content: fail (default), or apply what fits and leave git-style conflict markers where it doesn't.
5390    #[builder(setter(into, strip_option), default)]
5391    pub on_conflict: Option<PatchConflict>,
5392}
5393impl IntoID<Id> for Directory {
5394    fn into_id(
5395        self,
5396    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5397        Box::pin(async move { self.id().await })
5398    }
5399}
5400impl Loadable for Directory {
5401    fn graphql_type() -> &'static str {
5402        "Directory"
5403    }
5404    fn from_query(
5405        proc: Option<Arc<DaggerSessionProc>>,
5406        selection: Selection,
5407        graphql_client: DynGraphQLClient,
5408    ) -> Self {
5409        Self {
5410            proc,
5411            selection,
5412            graphql_client,
5413        }
5414    }
5415}
5416impl Directory {
5417    /// Converts this directory to a local git repository
5418    pub fn as_git(&self) -> GitRepository {
5419        let query = self.selection.select("asGit");
5420        GitRepository {
5421            proc: self.proc.clone(),
5422            selection: query,
5423            graphql_client: self.graphql_client.clone(),
5424        }
5425    }
5426    /// Load the directory as a Dagger module source
5427    ///
5428    /// # Arguments
5429    ///
5430    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5431    pub fn as_module(&self) -> Module {
5432        let query = self.selection.select("asModule");
5433        Module {
5434            proc: self.proc.clone(),
5435            selection: query,
5436            graphql_client: self.graphql_client.clone(),
5437        }
5438    }
5439    /// Load the directory as a Dagger module source
5440    ///
5441    /// # Arguments
5442    ///
5443    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5444    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5445        let mut query = self.selection.select("asModule");
5446        if let Some(source_root_path) = opts.source_root_path {
5447            query = query.arg("sourceRootPath", source_root_path);
5448        }
5449        Module {
5450            proc: self.proc.clone(),
5451            selection: query,
5452            graphql_client: self.graphql_client.clone(),
5453        }
5454    }
5455    /// Load the directory as a Dagger module source
5456    ///
5457    /// # Arguments
5458    ///
5459    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5460    pub fn as_module_source(&self) -> ModuleSource {
5461        let query = self.selection.select("asModuleSource");
5462        ModuleSource {
5463            proc: self.proc.clone(),
5464            selection: query,
5465            graphql_client: self.graphql_client.clone(),
5466        }
5467    }
5468    /// Load the directory as a Dagger module source
5469    ///
5470    /// # Arguments
5471    ///
5472    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5473    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5474        let mut query = self.selection.select("asModuleSource");
5475        if let Some(source_root_path) = opts.source_root_path {
5476            query = query.arg("sourceRootPath", source_root_path);
5477        }
5478        ModuleSource {
5479            proc: self.proc.clone(),
5480            selection: query,
5481            graphql_client: self.graphql_client.clone(),
5482        }
5483    }
5484    /// Creates a synthetic workspace from this directory.
5485    ///
5486    /// # Arguments
5487    ///
5488    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5489    pub fn as_workspace(&self) -> Workspace {
5490        let query = self.selection.select("asWorkspace");
5491        Workspace {
5492            proc: self.proc.clone(),
5493            selection: query,
5494            graphql_client: self.graphql_client.clone(),
5495        }
5496    }
5497    /// Creates a synthetic workspace from this directory.
5498    ///
5499    /// # Arguments
5500    ///
5501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5502    pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
5503        let mut query = self.selection.select("asWorkspace");
5504        if let Some(cwd) = opts.cwd {
5505            query = query.arg("cwd", cwd);
5506        }
5507        Workspace {
5508            proc: self.proc.clone(),
5509            selection: query,
5510            graphql_client: self.graphql_client.clone(),
5511        }
5512    }
5513    /// Return the difference between this directory and another directory, typically an older snapshot.
5514    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
5515    ///
5516    /// # Arguments
5517    ///
5518    /// * `from` - The base directory snapshot to compare against
5519    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
5520        let mut query = self.selection.select("changes");
5521        query = query.arg_lazy(
5522            "from",
5523            Box::new(move || {
5524                let from = from.clone();
5525                Box::pin(async move { from.into_id().await.unwrap().quote() })
5526            }),
5527        );
5528        Changeset {
5529            proc: self.proc.clone(),
5530            selection: query,
5531            graphql_client: self.graphql_client.clone(),
5532        }
5533    }
5534    /// Change the owner of the directory contents recursively.
5535    ///
5536    /// # Arguments
5537    ///
5538    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5539    /// * `owner` - A user:group to set for the mounted directory and its contents.
5540    ///
5541    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
5542    ///
5543    /// If the group is omitted, it defaults to the same as the user.
5544    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5545        let mut query = self.selection.select("chown");
5546        query = query.arg("path", path.into());
5547        query = query.arg("owner", owner.into());
5548        Directory {
5549            proc: self.proc.clone(),
5550            selection: query,
5551            graphql_client: self.graphql_client.clone(),
5552        }
5553    }
5554    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5555    ///
5556    /// # Arguments
5557    ///
5558    /// * `other` - The directory to compare against
5559    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
5560        let mut query = self.selection.select("diff");
5561        query = query.arg_lazy(
5562            "other",
5563            Box::new(move || {
5564                let other = other.clone();
5565                Box::pin(async move { other.into_id().await.unwrap().quote() })
5566            }),
5567        );
5568        Directory {
5569            proc: self.proc.clone(),
5570            selection: query,
5571            graphql_client: self.graphql_client.clone(),
5572        }
5573    }
5574    /// Return the directory's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
5575    pub async fn digest(&self) -> Result<String, DaggerError> {
5576        let query = self.selection.select("digest");
5577        query.execute(self.graphql_client.clone()).await
5578    }
5579    /// Retrieves a directory at the given path.
5580    ///
5581    /// # Arguments
5582    ///
5583    /// * `path` - Location of the directory to retrieve. Example: "/src"
5584    pub fn directory(&self, path: impl Into<String>) -> Directory {
5585        let mut query = self.selection.select("directory");
5586        query = query.arg("path", path.into());
5587        Directory {
5588            proc: self.proc.clone(),
5589            selection: query,
5590            graphql_client: self.graphql_client.clone(),
5591        }
5592    }
5593    /// Use Dockerfile compatibility to build a container from this directory. Only use this function for Dockerfile compatibility. Otherwise use the native Container type directly, it is feature-complete and supports all Dockerfile features.
5594    ///
5595    /// # Arguments
5596    ///
5597    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5598    pub fn docker_build(&self) -> Container {
5599        let query = self.selection.select("dockerBuild");
5600        Container {
5601            proc: self.proc.clone(),
5602            selection: query,
5603            graphql_client: self.graphql_client.clone(),
5604        }
5605    }
5606    /// Use Dockerfile compatibility to build a container from this directory. Only use this function for Dockerfile compatibility. Otherwise use the native Container type directly, it is feature-complete and supports all Dockerfile features.
5607    ///
5608    /// # Arguments
5609    ///
5610    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5611    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5612        let mut query = self.selection.select("dockerBuild");
5613        if let Some(dockerfile) = opts.dockerfile {
5614            query = query.arg("dockerfile", dockerfile);
5615        }
5616        if let Some(platform) = opts.platform {
5617            query = query.arg("platform", platform);
5618        }
5619        if let Some(build_args) = opts.build_args {
5620            query = query.arg("buildArgs", build_args);
5621        }
5622        if let Some(target) = opts.target {
5623            query = query.arg("target", target);
5624        }
5625        if let Some(secrets) = opts.secrets {
5626            query = query.arg("secrets", secrets);
5627        }
5628        if let Some(no_init) = opts.no_init {
5629            query = query.arg("noInit", no_init);
5630        }
5631        if let Some(ssh) = opts.ssh {
5632            query = query.arg("ssh", ssh);
5633        }
5634        Container {
5635            proc: self.proc.clone(),
5636            selection: query,
5637            graphql_client: self.graphql_client.clone(),
5638        }
5639    }
5640    /// Returns a list of files and directories at the given path.
5641    ///
5642    /// # Arguments
5643    ///
5644    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5645    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5646        let query = self.selection.select("entries");
5647        query.execute(self.graphql_client.clone()).await
5648    }
5649    /// Returns a list of files and directories at the given path.
5650    ///
5651    /// # Arguments
5652    ///
5653    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5654    pub async fn entries_opts<'a>(
5655        &self,
5656        opts: DirectoryEntriesOpts<'a>,
5657    ) -> Result<Vec<String>, DaggerError> {
5658        let mut query = self.selection.select("entries");
5659        if let Some(path) = opts.path {
5660            query = query.arg("path", path);
5661        }
5662        query.execute(self.graphql_client.clone()).await
5663    }
5664    /// check if a file or directory exists
5665    ///
5666    /// # Arguments
5667    ///
5668    /// * `path` - Path to check (e.g., "/file.txt").
5669    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5670    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5671        let mut query = self.selection.select("exists");
5672        query = query.arg("path", path.into());
5673        query.execute(self.graphql_client.clone()).await
5674    }
5675    /// check if a file or directory exists
5676    ///
5677    /// # Arguments
5678    ///
5679    /// * `path` - Path to check (e.g., "/file.txt").
5680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5681    pub async fn exists_opts(
5682        &self,
5683        path: impl Into<String>,
5684        opts: DirectoryExistsOpts,
5685    ) -> Result<bool, DaggerError> {
5686        let mut query = self.selection.select("exists");
5687        query = query.arg("path", path.into());
5688        if let Some(expected_type) = opts.expected_type {
5689            query = query.arg("expectedType", expected_type);
5690        }
5691        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5692            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5693        }
5694        query.execute(self.graphql_client.clone()).await
5695    }
5696    /// Writes the contents of the directory to a path on the host.
5697    ///
5698    /// # Arguments
5699    ///
5700    /// * `path` - Location of the copied directory (e.g., "logs/").
5701    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5702    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5703        let mut query = self.selection.select("export");
5704        query = query.arg("path", path.into());
5705        query.execute(self.graphql_client.clone()).await
5706    }
5707    /// Writes the contents of the directory to a path on the host.
5708    ///
5709    /// # Arguments
5710    ///
5711    /// * `path` - Location of the copied directory (e.g., "logs/").
5712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5713    pub async fn export_opts(
5714        &self,
5715        path: impl Into<String>,
5716        opts: DirectoryExportOpts,
5717    ) -> Result<String, DaggerError> {
5718        let mut query = self.selection.select("export");
5719        query = query.arg("path", path.into());
5720        if let Some(wipe) = opts.wipe {
5721            query = query.arg("wipe", wipe);
5722        }
5723        query.execute(self.graphql_client.clone()).await
5724    }
5725    /// Retrieve a file at the given path.
5726    ///
5727    /// # Arguments
5728    ///
5729    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5730    pub fn file(&self, path: impl Into<String>) -> File {
5731        let mut query = self.selection.select("file");
5732        query = query.arg("path", path.into());
5733        File {
5734            proc: self.proc.clone(),
5735            selection: query,
5736            graphql_client: self.graphql_client.clone(),
5737        }
5738    }
5739    /// Return a snapshot with some paths included or excluded
5740    ///
5741    /// # Arguments
5742    ///
5743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5744    pub fn filter(&self) -> Directory {
5745        let query = self.selection.select("filter");
5746        Directory {
5747            proc: self.proc.clone(),
5748            selection: query,
5749            graphql_client: self.graphql_client.clone(),
5750        }
5751    }
5752    /// Return a snapshot with some paths included or excluded
5753    ///
5754    /// # Arguments
5755    ///
5756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5757    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5758        let mut query = self.selection.select("filter");
5759        if let Some(exclude) = opts.exclude {
5760            query = query.arg("exclude", exclude);
5761        }
5762        if let Some(include) = opts.include {
5763            query = query.arg("include", include);
5764        }
5765        if let Some(gitignore) = opts.gitignore {
5766            query = query.arg("gitignore", gitignore);
5767        }
5768        Directory {
5769            proc: self.proc.clone(),
5770            selection: query,
5771            graphql_client: self.graphql_client.clone(),
5772        }
5773    }
5774    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5775    ///
5776    /// # Arguments
5777    ///
5778    /// * `name` - The name of the file or directory to search for
5779    /// * `start` - The path to start the search from
5780    pub async fn find_up(
5781        &self,
5782        name: impl Into<String>,
5783        start: impl Into<String>,
5784    ) -> Result<String, DaggerError> {
5785        let mut query = self.selection.select("findUp");
5786        query = query.arg("name", name.into());
5787        query = query.arg("start", start.into());
5788        query.execute(self.graphql_client.clone()).await
5789    }
5790    /// Returns a list of files and directories that matche the given pattern.
5791    ///
5792    /// # Arguments
5793    ///
5794    /// * `pattern` - Pattern to match (e.g., "*.md").
5795    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5796        let mut query = self.selection.select("glob");
5797        query = query.arg("pattern", pattern.into());
5798        query.execute(self.graphql_client.clone()).await
5799    }
5800    /// A unique identifier for this Directory.
5801    pub async fn id(&self) -> Result<Id, DaggerError> {
5802        let query = self.selection.select("id");
5803        query.execute(self.graphql_client.clone()).await
5804    }
5805    /// Returns the name of the directory.
5806    pub async fn name(&self) -> Result<String, DaggerError> {
5807        let query = self.selection.select("name");
5808        query.execute(self.graphql_client.clone()).await
5809    }
5810    /// Searches for content matching the given regular expression or literal string.
5811    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5812    ///
5813    /// # Arguments
5814    ///
5815    /// * `pattern` - The text to match.
5816    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5817    pub async fn search(
5818        &self,
5819        pattern: impl Into<String>,
5820    ) -> Result<Vec<SearchResult>, DaggerError> {
5821        let mut query = self.selection.select("search");
5822        query = query.arg("pattern", pattern.into());
5823        let query = query.select("id");
5824        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5825        Ok(ids
5826            .into_iter()
5827            .map(|id| SearchResult {
5828                proc: self.proc.clone(),
5829                selection: crate::querybuilder::query()
5830                    .select("node")
5831                    .arg("id", &id.0)
5832                    .inline_fragment("SearchResult"),
5833                graphql_client: self.graphql_client.clone(),
5834            })
5835            .collect())
5836    }
5837    /// Searches for content matching the given regular expression or literal string.
5838    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5839    ///
5840    /// # Arguments
5841    ///
5842    /// * `pattern` - The text to match.
5843    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5844    pub async fn search_opts<'a>(
5845        &self,
5846        pattern: impl Into<String>,
5847        opts: DirectorySearchOpts<'a>,
5848    ) -> Result<Vec<SearchResult>, DaggerError> {
5849        let mut query = self.selection.select("search");
5850        query = query.arg("pattern", pattern.into());
5851        if let Some(paths) = opts.paths {
5852            query = query.arg("paths", paths);
5853        }
5854        if let Some(globs) = opts.globs {
5855            query = query.arg("globs", globs);
5856        }
5857        if let Some(literal) = opts.literal {
5858            query = query.arg("literal", literal);
5859        }
5860        if let Some(multiline) = opts.multiline {
5861            query = query.arg("multiline", multiline);
5862        }
5863        if let Some(dotall) = opts.dotall {
5864            query = query.arg("dotall", dotall);
5865        }
5866        if let Some(insensitive) = opts.insensitive {
5867            query = query.arg("insensitive", insensitive);
5868        }
5869        if let Some(skip_ignored) = opts.skip_ignored {
5870            query = query.arg("skipIgnored", skip_ignored);
5871        }
5872        if let Some(skip_hidden) = opts.skip_hidden {
5873            query = query.arg("skipHidden", skip_hidden);
5874        }
5875        if let Some(files_only) = opts.files_only {
5876            query = query.arg("filesOnly", files_only);
5877        }
5878        if let Some(limit) = opts.limit {
5879            query = query.arg("limit", limit);
5880        }
5881        let query = query.select("id");
5882        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5883        Ok(ids
5884            .into_iter()
5885            .map(|id| SearchResult {
5886                proc: self.proc.clone(),
5887                selection: crate::querybuilder::query()
5888                    .select("node")
5889                    .arg("id", &id.0)
5890                    .inline_fragment("SearchResult"),
5891                graphql_client: self.graphql_client.clone(),
5892            })
5893            .collect())
5894    }
5895    /// Return file status
5896    ///
5897    /// # Arguments
5898    ///
5899    /// * `path` - Path to stat (e.g., "/file.txt").
5900    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5901    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5902        let mut query = self.selection.select("stat");
5903        query = query.arg("path", path.into());
5904        let query = query.select("id");
5905        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5906        Ok(id.map(|id| Stat {
5907            proc: self.proc.clone(),
5908            selection: query
5909                .root()
5910                .select("node")
5911                .arg("id", &id.0)
5912                .inline_fragment("Stat"),
5913            graphql_client: self.graphql_client.clone(),
5914        }))
5915    }
5916    /// Return file status
5917    ///
5918    /// # Arguments
5919    ///
5920    /// * `path` - Path to stat (e.g., "/file.txt").
5921    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5922    pub async fn stat_opts(
5923        &self,
5924        path: impl Into<String>,
5925        opts: DirectoryStatOpts,
5926    ) -> Result<Option<Stat>, DaggerError> {
5927        let mut query = self.selection.select("stat");
5928        query = query.arg("path", path.into());
5929        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5930            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5931        }
5932        let query = query.select("id");
5933        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5934        Ok(id.map(|id| Stat {
5935            proc: self.proc.clone(),
5936            selection: query
5937                .root()
5938                .select("node")
5939                .arg("id", &id.0)
5940                .inline_fragment("Stat"),
5941            graphql_client: self.graphql_client.clone(),
5942        }))
5943    }
5944    /// Force evaluation in the engine.
5945    pub async fn sync(&self) -> Result<Directory, DaggerError> {
5946        let query = self.selection.select("sync");
5947        let id: Id = query.execute(self.graphql_client.clone()).await?;
5948        Ok(Directory {
5949            proc: self.proc.clone(),
5950            selection: query
5951                .root()
5952                .select("node")
5953                .arg("id", &id.0)
5954                .inline_fragment("Directory"),
5955            graphql_client: self.graphql_client.clone(),
5956        })
5957    }
5958    /// Opens an interactive terminal in new container with this directory mounted inside.
5959    ///
5960    /// # Arguments
5961    ///
5962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5963    pub fn terminal(&self) -> Directory {
5964        let query = self.selection.select("terminal");
5965        Directory {
5966            proc: self.proc.clone(),
5967            selection: query,
5968            graphql_client: self.graphql_client.clone(),
5969        }
5970    }
5971    /// Opens an interactive terminal in new container with this directory mounted inside.
5972    ///
5973    /// # Arguments
5974    ///
5975    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5976    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5977        let mut query = self.selection.select("terminal");
5978        if let Some(container) = opts.container {
5979            query = query.arg("container", container);
5980        }
5981        if let Some(cmd) = opts.cmd {
5982            query = query.arg("cmd", cmd);
5983        }
5984        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5985            query = query.arg(
5986                "experimentalPrivilegedNesting",
5987                experimental_privileged_nesting,
5988            );
5989        }
5990        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5991            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5992        }
5993        Directory {
5994            proc: self.proc.clone(),
5995            selection: query,
5996            graphql_client: self.graphql_client.clone(),
5997        }
5998    }
5999    /// Return a directory with changes from another directory applied to it.
6000    ///
6001    /// # Arguments
6002    ///
6003    /// * `changes` - Changes to apply to the directory
6004    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
6005        let mut query = self.selection.select("withChanges");
6006        query = query.arg_lazy(
6007            "changes",
6008            Box::new(move || {
6009                let changes = changes.clone();
6010                Box::pin(async move { changes.into_id().await.unwrap().quote() })
6011            }),
6012        );
6013        Directory {
6014            proc: self.proc.clone(),
6015            selection: query,
6016            graphql_client: self.graphql_client.clone(),
6017        }
6018    }
6019    /// Return a snapshot with a directory added
6020    ///
6021    /// # Arguments
6022    ///
6023    /// * `path` - Location of the written directory (e.g., "/src/").
6024    /// * `source` - Identifier of the directory to copy.
6025    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6026    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6027        let mut query = self.selection.select("withDirectory");
6028        query = query.arg("path", path.into());
6029        query = query.arg_lazy(
6030            "source",
6031            Box::new(move || {
6032                let source = source.clone();
6033                Box::pin(async move { source.into_id().await.unwrap().quote() })
6034            }),
6035        );
6036        Directory {
6037            proc: self.proc.clone(),
6038            selection: query,
6039            graphql_client: self.graphql_client.clone(),
6040        }
6041    }
6042    /// Return a snapshot with a directory added
6043    ///
6044    /// # Arguments
6045    ///
6046    /// * `path` - Location of the written directory (e.g., "/src/").
6047    /// * `source` - Identifier of the directory to copy.
6048    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6049    pub fn with_directory_opts<'a>(
6050        &self,
6051        path: impl Into<String>,
6052        source: impl IntoID<Id>,
6053        opts: DirectoryWithDirectoryOpts<'a>,
6054    ) -> Directory {
6055        let mut query = self.selection.select("withDirectory");
6056        query = query.arg("path", path.into());
6057        query = query.arg_lazy(
6058            "source",
6059            Box::new(move || {
6060                let source = source.clone();
6061                Box::pin(async move { source.into_id().await.unwrap().quote() })
6062            }),
6063        );
6064        if let Some(exclude) = opts.exclude {
6065            query = query.arg("exclude", exclude);
6066        }
6067        if let Some(include) = opts.include {
6068            query = query.arg("include", include);
6069        }
6070        if let Some(gitignore) = opts.gitignore {
6071            query = query.arg("gitignore", gitignore);
6072        }
6073        if let Some(owner) = opts.owner {
6074            query = query.arg("owner", owner);
6075        }
6076        if let Some(permissions) = opts.permissions {
6077            query = query.arg("permissions", permissions);
6078        }
6079        Directory {
6080            proc: self.proc.clone(),
6081            selection: query,
6082            graphql_client: self.graphql_client.clone(),
6083        }
6084    }
6085    /// Raise an error.
6086    ///
6087    /// # Arguments
6088    ///
6089    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
6090    pub fn with_error(&self, err: impl Into<String>) -> Directory {
6091        let mut query = self.selection.select("withError");
6092        query = query.arg("err", err.into());
6093        Directory {
6094            proc: self.proc.clone(),
6095            selection: query,
6096            graphql_client: self.graphql_client.clone(),
6097        }
6098    }
6099    /// Retrieves this directory plus the contents of the given file copied to the given path.
6100    ///
6101    /// # Arguments
6102    ///
6103    /// * `path` - Location of the copied file (e.g., "/file.txt").
6104    /// * `source` - Identifier of the file to copy.
6105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6106    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6107        let mut query = self.selection.select("withFile");
6108        query = query.arg("path", path.into());
6109        query = query.arg_lazy(
6110            "source",
6111            Box::new(move || {
6112                let source = source.clone();
6113                Box::pin(async move { source.into_id().await.unwrap().quote() })
6114            }),
6115        );
6116        Directory {
6117            proc: self.proc.clone(),
6118            selection: query,
6119            graphql_client: self.graphql_client.clone(),
6120        }
6121    }
6122    /// Retrieves this directory plus the contents of the given file copied to the given path.
6123    ///
6124    /// # Arguments
6125    ///
6126    /// * `path` - Location of the copied file (e.g., "/file.txt").
6127    /// * `source` - Identifier of the file to copy.
6128    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6129    pub fn with_file_opts<'a>(
6130        &self,
6131        path: impl Into<String>,
6132        source: impl IntoID<Id>,
6133        opts: DirectoryWithFileOpts<'a>,
6134    ) -> Directory {
6135        let mut query = self.selection.select("withFile");
6136        query = query.arg("path", path.into());
6137        query = query.arg_lazy(
6138            "source",
6139            Box::new(move || {
6140                let source = source.clone();
6141                Box::pin(async move { source.into_id().await.unwrap().quote() })
6142            }),
6143        );
6144        if let Some(permissions) = opts.permissions {
6145            query = query.arg("permissions", permissions);
6146        }
6147        if let Some(owner) = opts.owner {
6148            query = query.arg("owner", owner);
6149        }
6150        Directory {
6151            proc: self.proc.clone(),
6152            selection: query,
6153            graphql_client: self.graphql_client.clone(),
6154        }
6155    }
6156    /// Retrieves this directory plus the contents of the given files copied to the given path.
6157    ///
6158    /// # Arguments
6159    ///
6160    /// * `path` - Location where copied files should be placed (e.g., "/src").
6161    /// * `sources` - Identifiers of the files to copy.
6162    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6163    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
6164        let mut query = self.selection.select("withFiles");
6165        query = query.arg("path", path.into());
6166        query = query.arg("sources", sources);
6167        Directory {
6168            proc: self.proc.clone(),
6169            selection: query,
6170            graphql_client: self.graphql_client.clone(),
6171        }
6172    }
6173    /// Retrieves this directory plus the contents of the given files copied to the given path.
6174    ///
6175    /// # Arguments
6176    ///
6177    /// * `path` - Location where copied files should be placed (e.g., "/src").
6178    /// * `sources` - Identifiers of the files to copy.
6179    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6180    pub fn with_files_opts(
6181        &self,
6182        path: impl Into<String>,
6183        sources: Vec<Id>,
6184        opts: DirectoryWithFilesOpts,
6185    ) -> Directory {
6186        let mut query = self.selection.select("withFiles");
6187        query = query.arg("path", path.into());
6188        query = query.arg("sources", sources);
6189        if let Some(permissions) = opts.permissions {
6190            query = query.arg("permissions", permissions);
6191        }
6192        Directory {
6193            proc: self.proc.clone(),
6194            selection: query,
6195            graphql_client: self.graphql_client.clone(),
6196        }
6197    }
6198    /// Retrieves this directory plus a new directory created at the given path.
6199    ///
6200    /// # Arguments
6201    ///
6202    /// * `path` - Location of the directory created (e.g., "/logs").
6203    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6204    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6205        let mut query = self.selection.select("withNewDirectory");
6206        query = query.arg("path", path.into());
6207        Directory {
6208            proc: self.proc.clone(),
6209            selection: query,
6210            graphql_client: self.graphql_client.clone(),
6211        }
6212    }
6213    /// Retrieves this directory plus a new directory created at the given path.
6214    ///
6215    /// # Arguments
6216    ///
6217    /// * `path` - Location of the directory created (e.g., "/logs").
6218    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6219    pub fn with_new_directory_opts(
6220        &self,
6221        path: impl Into<String>,
6222        opts: DirectoryWithNewDirectoryOpts,
6223    ) -> Directory {
6224        let mut query = self.selection.select("withNewDirectory");
6225        query = query.arg("path", path.into());
6226        if let Some(permissions) = opts.permissions {
6227            query = query.arg("permissions", permissions);
6228        }
6229        Directory {
6230            proc: self.proc.clone(),
6231            selection: query,
6232            graphql_client: self.graphql_client.clone(),
6233        }
6234    }
6235    /// Return a snapshot with a new file added
6236    ///
6237    /// # Arguments
6238    ///
6239    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6240    /// * `contents` - Contents of the new file. Example: "Hello world!"
6241    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6242    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
6243        let mut query = self.selection.select("withNewFile");
6244        query = query.arg("path", path.into());
6245        query = query.arg("contents", contents.into());
6246        Directory {
6247            proc: self.proc.clone(),
6248            selection: query,
6249            graphql_client: self.graphql_client.clone(),
6250        }
6251    }
6252    /// Return a snapshot with a new file added
6253    ///
6254    /// # Arguments
6255    ///
6256    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6257    /// * `contents` - Contents of the new file. Example: "Hello world!"
6258    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6259    pub fn with_new_file_opts(
6260        &self,
6261        path: impl Into<String>,
6262        contents: impl Into<String>,
6263        opts: DirectoryWithNewFileOpts,
6264    ) -> Directory {
6265        let mut query = self.selection.select("withNewFile");
6266        query = query.arg("path", path.into());
6267        query = query.arg("contents", contents.into());
6268        if let Some(permissions) = opts.permissions {
6269            query = query.arg("permissions", permissions);
6270        }
6271        Directory {
6272            proc: self.proc.clone(),
6273            selection: query,
6274            graphql_client: self.graphql_client.clone(),
6275        }
6276    }
6277    /// Retrieves this directory with the given Git-compatible patch applied.
6278    ///
6279    /// # Arguments
6280    ///
6281    /// * `patch` - Patch to apply (e.g., "diff --git a/file.txt b/file.txt\nindex 1234567..abcdef8 100644\n--- a/file.txt\n+++ b/file.txt\n@@ -1,1 +1,1 @@\n-Hello\n+World\n").
6282    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6283    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
6284        let mut query = self.selection.select("withPatch");
6285        query = query.arg("patch", patch.into());
6286        Directory {
6287            proc: self.proc.clone(),
6288            selection: query,
6289            graphql_client: self.graphql_client.clone(),
6290        }
6291    }
6292    /// Retrieves this directory with the given Git-compatible patch applied.
6293    ///
6294    /// # Arguments
6295    ///
6296    /// * `patch` - Patch to apply (e.g., "diff --git a/file.txt b/file.txt\nindex 1234567..abcdef8 100644\n--- a/file.txt\n+++ b/file.txt\n@@ -1,1 +1,1 @@\n-Hello\n+World\n").
6297    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6298    pub fn with_patch_opts(
6299        &self,
6300        patch: impl Into<String>,
6301        opts: DirectoryWithPatchOpts,
6302    ) -> Directory {
6303        let mut query = self.selection.select("withPatch");
6304        query = query.arg("patch", patch.into());
6305        if let Some(on_conflict) = opts.on_conflict {
6306            query = query.arg("onConflict", on_conflict);
6307        }
6308        Directory {
6309            proc: self.proc.clone(),
6310            selection: query,
6311            graphql_client: self.graphql_client.clone(),
6312        }
6313    }
6314    /// Retrieves this directory with the given Git-compatible patch file applied.
6315    ///
6316    /// # Arguments
6317    ///
6318    /// * `patch` - File containing the patch to apply
6319    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6320    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
6321        let mut query = self.selection.select("withPatchFile");
6322        query = query.arg_lazy(
6323            "patch",
6324            Box::new(move || {
6325                let patch = patch.clone();
6326                Box::pin(async move { patch.into_id().await.unwrap().quote() })
6327            }),
6328        );
6329        Directory {
6330            proc: self.proc.clone(),
6331            selection: query,
6332            graphql_client: self.graphql_client.clone(),
6333        }
6334    }
6335    /// Retrieves this directory with the given Git-compatible patch file applied.
6336    ///
6337    /// # Arguments
6338    ///
6339    /// * `patch` - File containing the patch to apply
6340    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6341    pub fn with_patch_file_opts(
6342        &self,
6343        patch: impl IntoID<Id>,
6344        opts: DirectoryWithPatchFileOpts,
6345    ) -> Directory {
6346        let mut query = self.selection.select("withPatchFile");
6347        query = query.arg_lazy(
6348            "patch",
6349            Box::new(move || {
6350                let patch = patch.clone();
6351                Box::pin(async move { patch.into_id().await.unwrap().quote() })
6352            }),
6353        );
6354        if let Some(on_conflict) = opts.on_conflict {
6355            query = query.arg("onConflict", on_conflict);
6356        }
6357        Directory {
6358            proc: self.proc.clone(),
6359            selection: query,
6360            graphql_client: self.graphql_client.clone(),
6361        }
6362    }
6363    /// Return a snapshot with a symlink
6364    ///
6365    /// # Arguments
6366    ///
6367    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
6368    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
6369    pub fn with_symlink(
6370        &self,
6371        target: impl Into<String>,
6372        link_name: impl Into<String>,
6373    ) -> Directory {
6374        let mut query = self.selection.select("withSymlink");
6375        query = query.arg("target", target.into());
6376        query = query.arg("linkName", link_name.into());
6377        Directory {
6378            proc: self.proc.clone(),
6379            selection: query,
6380            graphql_client: self.graphql_client.clone(),
6381        }
6382    }
6383    /// Retrieves this directory with all file/dir timestamps set to the given time.
6384    ///
6385    /// # Arguments
6386    ///
6387    /// * `timestamp` - Timestamp to set dir/files in.
6388    ///
6389    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6390    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
6391        let mut query = self.selection.select("withTimestamps");
6392        query = query.arg("timestamp", timestamp);
6393        Directory {
6394            proc: self.proc.clone(),
6395            selection: query,
6396            graphql_client: self.graphql_client.clone(),
6397        }
6398    }
6399    /// Return a snapshot with a subdirectory removed
6400    ///
6401    /// # Arguments
6402    ///
6403    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
6404    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
6405        let mut query = self.selection.select("withoutDirectory");
6406        query = query.arg("path", path.into());
6407        Directory {
6408            proc: self.proc.clone(),
6409            selection: query,
6410            graphql_client: self.graphql_client.clone(),
6411        }
6412    }
6413    /// Return a snapshot with a file removed
6414    ///
6415    /// # Arguments
6416    ///
6417    /// * `path` - Path of the file to remove (e.g., "/file.txt").
6418    pub fn without_file(&self, path: impl Into<String>) -> Directory {
6419        let mut query = self.selection.select("withoutFile");
6420        query = query.arg("path", path.into());
6421        Directory {
6422            proc: self.proc.clone(),
6423            selection: query,
6424            graphql_client: self.graphql_client.clone(),
6425        }
6426    }
6427    /// Return a snapshot with files removed
6428    ///
6429    /// # Arguments
6430    ///
6431    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
6432    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
6433        let mut query = self.selection.select("withoutFiles");
6434        query = query.arg(
6435            "paths",
6436            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6437        );
6438        Directory {
6439            proc: self.proc.clone(),
6440            selection: query,
6441            graphql_client: self.graphql_client.clone(),
6442        }
6443    }
6444}
6445impl Exportable for Directory {
6446    fn export(
6447        &self,
6448        path: impl Into<String>,
6449    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
6450        let mut query = self.selection.select("export");
6451        query = query.arg("path", path.into());
6452        let graphql_client = self.graphql_client.clone();
6453        async move { query.execute(graphql_client).await }
6454    }
6455    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6456        let query = self.selection.select("id");
6457        let graphql_client = self.graphql_client.clone();
6458        async move { query.execute(graphql_client).await }
6459    }
6460}
6461impl Node for Directory {
6462    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6463        let query = self.selection.select("id");
6464        let graphql_client = self.graphql_client.clone();
6465        async move { query.execute(graphql_client).await }
6466    }
6467}
6468impl Syncer for Directory {
6469    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6470        let query = self.selection.select("id");
6471        let graphql_client = self.graphql_client.clone();
6472        async move { query.execute(graphql_client).await }
6473    }
6474    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
6475        let query = self.selection.select("sync");
6476        let proc = self.proc.clone();
6477        let graphql_client = self.graphql_client.clone();
6478        async move {
6479            let id: Id = query.execute(graphql_client.clone()).await?;
6480            Ok(Self {
6481                proc,
6482                selection: query
6483                    .root()
6484                    .select("node")
6485                    .arg("id", &id.0)
6486                    .inline_fragment("Directory"),
6487                graphql_client,
6488            })
6489        }
6490    }
6491}
6492#[derive(Clone)]
6493pub struct Engine {
6494    pub proc: Option<Arc<DaggerSessionProc>>,
6495    pub selection: Selection,
6496    pub graphql_client: DynGraphQLClient,
6497}
6498impl IntoID<Id> for Engine {
6499    fn into_id(
6500        self,
6501    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6502        Box::pin(async move { self.id().await })
6503    }
6504}
6505impl Loadable for Engine {
6506    fn graphql_type() -> &'static str {
6507        "Engine"
6508    }
6509    fn from_query(
6510        proc: Option<Arc<DaggerSessionProc>>,
6511        selection: Selection,
6512        graphql_client: DynGraphQLClient,
6513    ) -> Self {
6514        Self {
6515            proc,
6516            selection,
6517            graphql_client,
6518        }
6519    }
6520}
6521impl Engine {
6522    /// The list of connected client IDs
6523    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
6524        let query = self.selection.select("clients");
6525        query.execute(self.graphql_client.clone()).await
6526    }
6527    /// A unique identifier for this Engine.
6528    pub async fn id(&self) -> Result<Id, DaggerError> {
6529        let query = self.selection.select("id");
6530        query.execute(self.graphql_client.clone()).await
6531    }
6532    /// The local engine cache state tracked by dagql
6533    pub fn local_cache(&self) -> EngineCache {
6534        let query = self.selection.select("localCache");
6535        EngineCache {
6536            proc: self.proc.clone(),
6537            selection: query,
6538            graphql_client: self.graphql_client.clone(),
6539        }
6540    }
6541    /// The name of the engine instance.
6542    pub async fn name(&self) -> Result<String, DaggerError> {
6543        let query = self.selection.select("name");
6544        query.execute(self.graphql_client.clone()).await
6545    }
6546}
6547impl Node for Engine {
6548    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6549        let query = self.selection.select("id");
6550        let graphql_client = self.graphql_client.clone();
6551        async move { query.execute(graphql_client).await }
6552    }
6553}
6554#[derive(Clone)]
6555pub struct EngineCache {
6556    pub proc: Option<Arc<DaggerSessionProc>>,
6557    pub selection: Selection,
6558    pub graphql_client: DynGraphQLClient,
6559}
6560#[derive(Builder, Debug, PartialEq)]
6561pub struct EngineCacheEntrySetOpts<'a> {
6562    #[builder(setter(into, strip_option), default)]
6563    pub key: Option<&'a str>,
6564}
6565#[derive(Builder, Debug, PartialEq)]
6566pub struct EngineCachePruneOpts<'a> {
6567    /// Override the maximum structural metadata estimate in absolute bytes. Explicit values must be positive; the configured/default value is used when omitted.
6568    #[builder(setter(into, strip_option), default)]
6569    pub max_estimated_bytes: Option<isize>,
6570    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
6571    #[builder(setter(into, strip_option), default)]
6572    pub max_used_space: Option<&'a str>,
6573    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
6574    #[builder(setter(into, strip_option), default)]
6575    pub min_free_space: Option<&'a str>,
6576    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
6577    #[builder(setter(into, strip_option), default)]
6578    pub reserved_space: Option<&'a str>,
6579    /// Override the structural metadata estimate to target in absolute bytes. Explicit values must be positive and lower than the resolved maximum; the configured/default value is used when omitted.
6580    #[builder(setter(into, strip_option), default)]
6581    pub target_estimated_bytes: Option<isize>,
6582    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
6583    #[builder(setter(into, strip_option), default)]
6584    pub target_space: Option<&'a str>,
6585    /// Use enabled engine-wide default disk and structural policies. If no default disk policy is enabled, the disk stage falls back to pruning all releasable disk-cache entries. If false, explicit options select stages; with no options, all releasable disk-cache entries are pruned.
6586    #[builder(setter(into, strip_option), default)]
6587    pub use_default_policy: Option<bool>,
6588}
6589impl IntoID<Id> for EngineCache {
6590    fn into_id(
6591        self,
6592    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6593        Box::pin(async move { self.id().await })
6594    }
6595}
6596impl Loadable for EngineCache {
6597    fn graphql_type() -> &'static str {
6598        "EngineCache"
6599    }
6600    fn from_query(
6601        proc: Option<Arc<DaggerSessionProc>>,
6602        selection: Selection,
6603        graphql_client: DynGraphQLClient,
6604    ) -> Self {
6605        Self {
6606            proc,
6607            selection,
6608            graphql_client,
6609        }
6610    }
6611}
6612impl EngineCache {
6613    /// The current set of entries in the cache
6614    ///
6615    /// # Arguments
6616    ///
6617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6618    pub fn entry_set(&self) -> EngineCacheEntrySet {
6619        let query = self.selection.select("entrySet");
6620        EngineCacheEntrySet {
6621            proc: self.proc.clone(),
6622            selection: query,
6623            graphql_client: self.graphql_client.clone(),
6624        }
6625    }
6626    /// The current set of entries in the cache
6627    ///
6628    /// # Arguments
6629    ///
6630    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6631    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6632        let mut query = self.selection.select("entrySet");
6633        if let Some(key) = opts.key {
6634            query = query.arg("key", key);
6635        }
6636        EngineCacheEntrySet {
6637            proc: self.proc.clone(),
6638            selection: query,
6639            graphql_client: self.graphql_client.clone(),
6640        }
6641    }
6642    /// A unique identifier for this EngineCache.
6643    pub async fn id(&self) -> Result<Id, DaggerError> {
6644        let query = self.selection.select("id");
6645        query.execute(self.graphql_client.clone()).await
6646    }
6647    /// The maximum bytes to keep in the cache without pruning.
6648    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6649        let query = self.selection.select("maxUsedSpace");
6650        query.execute(self.graphql_client.clone()).await
6651    }
6652    /// The target amount of free disk space the garbage collector will attempt to leave.
6653    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6654        let query = self.selection.select("minFreeSpace");
6655        query.execute(self.graphql_client.clone()).await
6656    }
6657    /// Prune the cache of releaseable entries
6658    ///
6659    /// # Arguments
6660    ///
6661    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6662    pub async fn prune(&self) -> Result<Void, DaggerError> {
6663        let query = self.selection.select("prune");
6664        query.execute(self.graphql_client.clone()).await
6665    }
6666    /// Prune the cache of releaseable entries
6667    ///
6668    /// # Arguments
6669    ///
6670    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6671    pub async fn prune_opts<'a>(
6672        &self,
6673        opts: EngineCachePruneOpts<'a>,
6674    ) -> Result<Void, DaggerError> {
6675        let mut query = self.selection.select("prune");
6676        if let Some(use_default_policy) = opts.use_default_policy {
6677            query = query.arg("useDefaultPolicy", use_default_policy);
6678        }
6679        if let Some(max_used_space) = opts.max_used_space {
6680            query = query.arg("maxUsedSpace", max_used_space);
6681        }
6682        if let Some(reserved_space) = opts.reserved_space {
6683            query = query.arg("reservedSpace", reserved_space);
6684        }
6685        if let Some(min_free_space) = opts.min_free_space {
6686            query = query.arg("minFreeSpace", min_free_space);
6687        }
6688        if let Some(target_space) = opts.target_space {
6689            query = query.arg("targetSpace", target_space);
6690        }
6691        if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
6692            query = query.arg("maxEstimatedBytes", max_estimated_bytes);
6693        }
6694        if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
6695            query = query.arg("targetEstimatedBytes", target_estimated_bytes);
6696        }
6697        query.execute(self.graphql_client.clone()).await
6698    }
6699    /// The minimum amount of disk space this policy is guaranteed to retain.
6700    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6701        let query = self.selection.select("reservedSpace");
6702        query.execute(self.graphql_client.clone()).await
6703    }
6704    /// The target number of bytes to keep when pruning.
6705    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6706        let query = self.selection.select("targetSpace");
6707        query.execute(self.graphql_client.clone()).await
6708    }
6709}
6710impl Node for EngineCache {
6711    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6712        let query = self.selection.select("id");
6713        let graphql_client = self.graphql_client.clone();
6714        async move { query.execute(graphql_client).await }
6715    }
6716}
6717#[derive(Clone)]
6718pub struct EngineCacheEntry {
6719    pub proc: Option<Arc<DaggerSessionProc>>,
6720    pub selection: Selection,
6721    pub graphql_client: DynGraphQLClient,
6722}
6723impl IntoID<Id> for EngineCacheEntry {
6724    fn into_id(
6725        self,
6726    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6727        Box::pin(async move { self.id().await })
6728    }
6729}
6730impl Loadable for EngineCacheEntry {
6731    fn graphql_type() -> &'static str {
6732        "EngineCacheEntry"
6733    }
6734    fn from_query(
6735        proc: Option<Arc<DaggerSessionProc>>,
6736        selection: Selection,
6737        graphql_client: DynGraphQLClient,
6738    ) -> Self {
6739        Self {
6740            proc,
6741            selection,
6742            graphql_client,
6743        }
6744    }
6745}
6746impl EngineCacheEntry {
6747    /// Whether the cache entry is actively being used.
6748    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6749        let query = self.selection.select("activelyUsed");
6750        query.execute(self.graphql_client.clone()).await
6751    }
6752    /// The time the cache entry was created, in Unix nanoseconds.
6753    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6754        let query = self.selection.select("createdTimeUnixNano");
6755        query.execute(self.graphql_client.clone()).await
6756    }
6757    /// The DagQL call that produced this cache entry.
6758    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
6759        let query = self.selection.select("dagqlCall");
6760        query.execute(self.graphql_client.clone()).await
6761    }
6762    /// The description of the cache entry.
6763    pub async fn description(&self) -> Result<String, DaggerError> {
6764        let query = self.selection.select("description");
6765        query.execute(self.graphql_client.clone()).await
6766    }
6767    /// The disk space used by the cache entry.
6768    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6769        let query = self.selection.select("diskSpaceBytes");
6770        query.execute(self.graphql_client.clone()).await
6771    }
6772    /// A unique identifier for this EngineCacheEntry.
6773    pub async fn id(&self) -> Result<Id, DaggerError> {
6774        let query = self.selection.select("id");
6775        query.execute(self.graphql_client.clone()).await
6776    }
6777    /// The most recent time the cache entry was used, in Unix nanoseconds.
6778    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6779        let query = self.selection.select("mostRecentUseTimeUnixNano");
6780        query.execute(self.graphql_client.clone()).await
6781    }
6782    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
6783    pub async fn record_type(&self) -> Result<String, DaggerError> {
6784        let query = self.selection.select("recordType");
6785        query.execute(self.graphql_client.clone()).await
6786    }
6787    /// The storage record types represented by this cache entry.
6788    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
6789        let query = self.selection.select("recordTypes");
6790        query.execute(self.graphql_client.clone()).await
6791    }
6792}
6793impl Node for EngineCacheEntry {
6794    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6795        let query = self.selection.select("id");
6796        let graphql_client = self.graphql_client.clone();
6797        async move { query.execute(graphql_client).await }
6798    }
6799}
6800#[derive(Clone)]
6801pub struct EngineCacheEntrySet {
6802    pub proc: Option<Arc<DaggerSessionProc>>,
6803    pub selection: Selection,
6804    pub graphql_client: DynGraphQLClient,
6805}
6806impl IntoID<Id> for EngineCacheEntrySet {
6807    fn into_id(
6808        self,
6809    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6810        Box::pin(async move { self.id().await })
6811    }
6812}
6813impl Loadable for EngineCacheEntrySet {
6814    fn graphql_type() -> &'static str {
6815        "EngineCacheEntrySet"
6816    }
6817    fn from_query(
6818        proc: Option<Arc<DaggerSessionProc>>,
6819        selection: Selection,
6820        graphql_client: DynGraphQLClient,
6821    ) -> Self {
6822        Self {
6823            proc,
6824            selection,
6825            graphql_client,
6826        }
6827    }
6828}
6829impl EngineCacheEntrySet {
6830    /// The total disk space used by the cache entries in this set.
6831    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6832        let query = self.selection.select("diskSpaceBytes");
6833        query.execute(self.graphql_client.clone()).await
6834    }
6835    /// The list of individual cache entries in the set
6836    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6837        let query = self.selection.select("entries");
6838        let query = query.select("id");
6839        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6840        Ok(ids
6841            .into_iter()
6842            .map(|id| EngineCacheEntry {
6843                proc: self.proc.clone(),
6844                selection: crate::querybuilder::query()
6845                    .select("node")
6846                    .arg("id", &id.0)
6847                    .inline_fragment("EngineCacheEntry"),
6848                graphql_client: self.graphql_client.clone(),
6849            })
6850            .collect())
6851    }
6852    /// The number of cache entries in this set.
6853    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6854        let query = self.selection.select("entryCount");
6855        query.execute(self.graphql_client.clone()).await
6856    }
6857    /// A unique identifier for this EngineCacheEntrySet.
6858    pub async fn id(&self) -> Result<Id, DaggerError> {
6859        let query = self.selection.select("id");
6860        query.execute(self.graphql_client.clone()).await
6861    }
6862}
6863impl Node for EngineCacheEntrySet {
6864    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6865        let query = self.selection.select("id");
6866        let graphql_client = self.graphql_client.clone();
6867        async move { query.execute(graphql_client).await }
6868    }
6869}
6870#[derive(Clone)]
6871pub struct EnumTypeDef {
6872    pub proc: Option<Arc<DaggerSessionProc>>,
6873    pub selection: Selection,
6874    pub graphql_client: DynGraphQLClient,
6875}
6876impl IntoID<Id> for EnumTypeDef {
6877    fn into_id(
6878        self,
6879    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6880        Box::pin(async move { self.id().await })
6881    }
6882}
6883impl Loadable for EnumTypeDef {
6884    fn graphql_type() -> &'static str {
6885        "EnumTypeDef"
6886    }
6887    fn from_query(
6888        proc: Option<Arc<DaggerSessionProc>>,
6889        selection: Selection,
6890        graphql_client: DynGraphQLClient,
6891    ) -> Self {
6892        Self {
6893            proc,
6894            selection,
6895            graphql_client,
6896        }
6897    }
6898}
6899impl EnumTypeDef {
6900    /// A doc string for the enum, if any.
6901    pub async fn description(&self) -> Result<String, DaggerError> {
6902        let query = self.selection.select("description");
6903        query.execute(self.graphql_client.clone()).await
6904    }
6905    /// A unique identifier for this EnumTypeDef.
6906    pub async fn id(&self) -> Result<Id, DaggerError> {
6907        let query = self.selection.select("id");
6908        query.execute(self.graphql_client.clone()).await
6909    }
6910    /// The members of the enum.
6911    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6912        let query = self.selection.select("members");
6913        let query = query.select("id");
6914        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6915        Ok(ids
6916            .into_iter()
6917            .map(|id| EnumValueTypeDef {
6918                proc: self.proc.clone(),
6919                selection: crate::querybuilder::query()
6920                    .select("node")
6921                    .arg("id", &id.0)
6922                    .inline_fragment("EnumValueTypeDef"),
6923                graphql_client: self.graphql_client.clone(),
6924            })
6925            .collect())
6926    }
6927    /// The name of the enum.
6928    pub async fn name(&self) -> Result<String, DaggerError> {
6929        let query = self.selection.select("name");
6930        query.execute(self.graphql_client.clone()).await
6931    }
6932    /// The location of this enum declaration.
6933    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6934        let query = self.selection.select("sourceMap");
6935        let query = query.select("id");
6936        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6937        Ok(id.map(|id| SourceMap {
6938            proc: self.proc.clone(),
6939            selection: query
6940                .root()
6941                .select("node")
6942                .arg("id", &id.0)
6943                .inline_fragment("SourceMap"),
6944            graphql_client: self.graphql_client.clone(),
6945        }))
6946    }
6947    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6948    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6949        let query = self.selection.select("sourceModuleName");
6950        query.execute(self.graphql_client.clone()).await
6951    }
6952    /// The members of the enum.
6953    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6954        let query = self.selection.select("values");
6955        let query = query.select("id");
6956        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6957        Ok(ids
6958            .into_iter()
6959            .map(|id| EnumValueTypeDef {
6960                proc: self.proc.clone(),
6961                selection: crate::querybuilder::query()
6962                    .select("node")
6963                    .arg("id", &id.0)
6964                    .inline_fragment("EnumValueTypeDef"),
6965                graphql_client: self.graphql_client.clone(),
6966            })
6967            .collect())
6968    }
6969}
6970impl Node for EnumTypeDef {
6971    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6972        let query = self.selection.select("id");
6973        let graphql_client = self.graphql_client.clone();
6974        async move { query.execute(graphql_client).await }
6975    }
6976}
6977#[derive(Clone)]
6978pub struct EnumValueTypeDef {
6979    pub proc: Option<Arc<DaggerSessionProc>>,
6980    pub selection: Selection,
6981    pub graphql_client: DynGraphQLClient,
6982}
6983impl IntoID<Id> for EnumValueTypeDef {
6984    fn into_id(
6985        self,
6986    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6987        Box::pin(async move { self.id().await })
6988    }
6989}
6990impl Loadable for EnumValueTypeDef {
6991    fn graphql_type() -> &'static str {
6992        "EnumValueTypeDef"
6993    }
6994    fn from_query(
6995        proc: Option<Arc<DaggerSessionProc>>,
6996        selection: Selection,
6997        graphql_client: DynGraphQLClient,
6998    ) -> Self {
6999        Self {
7000            proc,
7001            selection,
7002            graphql_client,
7003        }
7004    }
7005}
7006impl EnumValueTypeDef {
7007    /// The reason this enum member is deprecated, if any.
7008    pub async fn deprecated(&self) -> Result<String, DaggerError> {
7009        let query = self.selection.select("deprecated");
7010        query.execute(self.graphql_client.clone()).await
7011    }
7012    /// A doc string for the enum member, if any.
7013    pub async fn description(&self) -> Result<String, DaggerError> {
7014        let query = self.selection.select("description");
7015        query.execute(self.graphql_client.clone()).await
7016    }
7017    /// A unique identifier for this EnumValueTypeDef.
7018    pub async fn id(&self) -> Result<Id, DaggerError> {
7019        let query = self.selection.select("id");
7020        query.execute(self.graphql_client.clone()).await
7021    }
7022    /// The name of the enum member.
7023    pub async fn name(&self) -> Result<String, DaggerError> {
7024        let query = self.selection.select("name");
7025        query.execute(self.graphql_client.clone()).await
7026    }
7027    /// The location of this enum member declaration.
7028    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7029        let query = self.selection.select("sourceMap");
7030        let query = query.select("id");
7031        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7032        Ok(id.map(|id| SourceMap {
7033            proc: self.proc.clone(),
7034            selection: query
7035                .root()
7036                .select("node")
7037                .arg("id", &id.0)
7038                .inline_fragment("SourceMap"),
7039            graphql_client: self.graphql_client.clone(),
7040        }))
7041    }
7042    /// The value of the enum member
7043    pub async fn value(&self) -> Result<String, DaggerError> {
7044        let query = self.selection.select("value");
7045        query.execute(self.graphql_client.clone()).await
7046    }
7047}
7048impl Node for EnumValueTypeDef {
7049    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7050        let query = self.selection.select("id");
7051        let graphql_client = self.graphql_client.clone();
7052        async move { query.execute(graphql_client).await }
7053    }
7054}
7055#[derive(Clone)]
7056pub struct EnvFile {
7057    pub proc: Option<Arc<DaggerSessionProc>>,
7058    pub selection: Selection,
7059    pub graphql_client: DynGraphQLClient,
7060}
7061#[derive(Builder, Debug, PartialEq)]
7062pub struct EnvFileGetOpts {
7063    /// Return the value exactly as written to the file. No quote removal or variable expansion
7064    #[builder(setter(into, strip_option), default)]
7065    pub raw: Option<bool>,
7066}
7067#[derive(Builder, Debug, PartialEq)]
7068pub struct EnvFileVariablesOpts {
7069    /// Return values exactly as written to the file. No quote removal or variable expansion
7070    #[builder(setter(into, strip_option), default)]
7071    pub raw: Option<bool>,
7072}
7073impl IntoID<Id> for EnvFile {
7074    fn into_id(
7075        self,
7076    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7077        Box::pin(async move { self.id().await })
7078    }
7079}
7080impl Loadable for EnvFile {
7081    fn graphql_type() -> &'static str {
7082        "EnvFile"
7083    }
7084    fn from_query(
7085        proc: Option<Arc<DaggerSessionProc>>,
7086        selection: Selection,
7087        graphql_client: DynGraphQLClient,
7088    ) -> Self {
7089        Self {
7090            proc,
7091            selection,
7092            graphql_client,
7093        }
7094    }
7095}
7096impl EnvFile {
7097    /// Return as a file
7098    pub fn as_file(&self) -> File {
7099        let query = self.selection.select("asFile");
7100        File {
7101            proc: self.proc.clone(),
7102            selection: query,
7103            graphql_client: self.graphql_client.clone(),
7104        }
7105    }
7106    /// Check if a variable exists
7107    ///
7108    /// # Arguments
7109    ///
7110    /// * `name` - Variable name
7111    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7112        let mut query = self.selection.select("exists");
7113        query = query.arg("name", name.into());
7114        query.execute(self.graphql_client.clone()).await
7115    }
7116    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7117    ///
7118    /// # Arguments
7119    ///
7120    /// * `name` - Variable name
7121    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7122    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7123        let mut query = self.selection.select("get");
7124        query = query.arg("name", name.into());
7125        query.execute(self.graphql_client.clone()).await
7126    }
7127    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7128    ///
7129    /// # Arguments
7130    ///
7131    /// * `name` - Variable name
7132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7133    pub async fn get_opts(
7134        &self,
7135        name: impl Into<String>,
7136        opts: EnvFileGetOpts,
7137    ) -> Result<String, DaggerError> {
7138        let mut query = self.selection.select("get");
7139        query = query.arg("name", name.into());
7140        if let Some(raw) = opts.raw {
7141            query = query.arg("raw", raw);
7142        }
7143        query.execute(self.graphql_client.clone()).await
7144    }
7145    /// A unique identifier for this EnvFile.
7146    pub async fn id(&self) -> Result<Id, DaggerError> {
7147        let query = self.selection.select("id");
7148        query.execute(self.graphql_client.clone()).await
7149    }
7150    /// Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MY_APP_" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello
7151    ///
7152    /// # Arguments
7153    ///
7154    /// * `prefix` - The prefix to filter by
7155    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
7156        let mut query = self.selection.select("namespace");
7157        query = query.arg("prefix", prefix.into());
7158        EnvFile {
7159            proc: self.proc.clone(),
7160            selection: query,
7161            graphql_client: self.graphql_client.clone(),
7162        }
7163    }
7164    /// Return all variables
7165    ///
7166    /// # Arguments
7167    ///
7168    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7169    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
7170        let query = self.selection.select("variables");
7171        let query = query.select("id");
7172        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7173        Ok(ids
7174            .into_iter()
7175            .map(|id| EnvVariable {
7176                proc: self.proc.clone(),
7177                selection: crate::querybuilder::query()
7178                    .select("node")
7179                    .arg("id", &id.0)
7180                    .inline_fragment("EnvVariable"),
7181                graphql_client: self.graphql_client.clone(),
7182            })
7183            .collect())
7184    }
7185    /// Return all variables
7186    ///
7187    /// # Arguments
7188    ///
7189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7190    pub async fn variables_opts(
7191        &self,
7192        opts: EnvFileVariablesOpts,
7193    ) -> Result<Vec<EnvVariable>, DaggerError> {
7194        let mut query = self.selection.select("variables");
7195        if let Some(raw) = opts.raw {
7196            query = query.arg("raw", raw);
7197        }
7198        let query = query.select("id");
7199        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7200        Ok(ids
7201            .into_iter()
7202            .map(|id| EnvVariable {
7203                proc: self.proc.clone(),
7204                selection: crate::querybuilder::query()
7205                    .select("node")
7206                    .arg("id", &id.0)
7207                    .inline_fragment("EnvVariable"),
7208                graphql_client: self.graphql_client.clone(),
7209            })
7210            .collect())
7211    }
7212    /// Add a variable
7213    ///
7214    /// # Arguments
7215    ///
7216    /// * `name` - Variable name
7217    /// * `value` - Variable value
7218    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7219        let mut query = self.selection.select("withVariable");
7220        query = query.arg("name", name.into());
7221        query = query.arg("value", value.into());
7222        EnvFile {
7223            proc: self.proc.clone(),
7224            selection: query,
7225            graphql_client: self.graphql_client.clone(),
7226        }
7227    }
7228    /// Remove all occurrences of the named variable
7229    ///
7230    /// # Arguments
7231    ///
7232    /// * `name` - Variable name
7233    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7234        let mut query = self.selection.select("withoutVariable");
7235        query = query.arg("name", name.into());
7236        EnvFile {
7237            proc: self.proc.clone(),
7238            selection: query,
7239            graphql_client: self.graphql_client.clone(),
7240        }
7241    }
7242}
7243impl Node for EnvFile {
7244    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7245        let query = self.selection.select("id");
7246        let graphql_client = self.graphql_client.clone();
7247        async move { query.execute(graphql_client).await }
7248    }
7249}
7250#[derive(Clone)]
7251pub struct EnvVariable {
7252    pub proc: Option<Arc<DaggerSessionProc>>,
7253    pub selection: Selection,
7254    pub graphql_client: DynGraphQLClient,
7255}
7256impl IntoID<Id> for EnvVariable {
7257    fn into_id(
7258        self,
7259    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7260        Box::pin(async move { self.id().await })
7261    }
7262}
7263impl Loadable for EnvVariable {
7264    fn graphql_type() -> &'static str {
7265        "EnvVariable"
7266    }
7267    fn from_query(
7268        proc: Option<Arc<DaggerSessionProc>>,
7269        selection: Selection,
7270        graphql_client: DynGraphQLClient,
7271    ) -> Self {
7272        Self {
7273            proc,
7274            selection,
7275            graphql_client,
7276        }
7277    }
7278}
7279impl EnvVariable {
7280    /// A unique identifier for this EnvVariable.
7281    pub async fn id(&self) -> Result<Id, DaggerError> {
7282        let query = self.selection.select("id");
7283        query.execute(self.graphql_client.clone()).await
7284    }
7285    /// The environment variable name.
7286    pub async fn name(&self) -> Result<String, DaggerError> {
7287        let query = self.selection.select("name");
7288        query.execute(self.graphql_client.clone()).await
7289    }
7290    /// The environment variable value.
7291    pub async fn value(&self) -> Result<String, DaggerError> {
7292        let query = self.selection.select("value");
7293        query.execute(self.graphql_client.clone()).await
7294    }
7295}
7296impl Node for EnvVariable {
7297    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7298        let query = self.selection.select("id");
7299        let graphql_client = self.graphql_client.clone();
7300        async move { query.execute(graphql_client).await }
7301    }
7302}
7303#[derive(Clone)]
7304pub struct Error {
7305    pub proc: Option<Arc<DaggerSessionProc>>,
7306    pub selection: Selection,
7307    pub graphql_client: DynGraphQLClient,
7308}
7309impl IntoID<Id> for Error {
7310    fn into_id(
7311        self,
7312    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7313        Box::pin(async move { self.id().await })
7314    }
7315}
7316impl Loadable for Error {
7317    fn graphql_type() -> &'static str {
7318        "Error"
7319    }
7320    fn from_query(
7321        proc: Option<Arc<DaggerSessionProc>>,
7322        selection: Selection,
7323        graphql_client: DynGraphQLClient,
7324    ) -> Self {
7325        Self {
7326            proc,
7327            selection,
7328            graphql_client,
7329        }
7330    }
7331}
7332impl Error {
7333    /// A unique identifier for this Error.
7334    pub async fn id(&self) -> Result<Id, DaggerError> {
7335        let query = self.selection.select("id");
7336        query.execute(self.graphql_client.clone()).await
7337    }
7338    /// A description of the error.
7339    pub async fn message(&self) -> Result<String, DaggerError> {
7340        let query = self.selection.select("message");
7341        query.execute(self.graphql_client.clone()).await
7342    }
7343    /// The extensions of the error.
7344    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
7345        let query = self.selection.select("values");
7346        let query = query.select("id");
7347        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7348        Ok(ids
7349            .into_iter()
7350            .map(|id| ErrorValue {
7351                proc: self.proc.clone(),
7352                selection: crate::querybuilder::query()
7353                    .select("node")
7354                    .arg("id", &id.0)
7355                    .inline_fragment("ErrorValue"),
7356                graphql_client: self.graphql_client.clone(),
7357            })
7358            .collect())
7359    }
7360    /// Add a value to the error.
7361    ///
7362    /// # Arguments
7363    ///
7364    /// * `name` - The name of the value.
7365    /// * `value` - The value to store on the error.
7366    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7367        let mut query = self.selection.select("withValue");
7368        query = query.arg("name", name.into());
7369        query = query.arg("value", value);
7370        Error {
7371            proc: self.proc.clone(),
7372            selection: query,
7373            graphql_client: self.graphql_client.clone(),
7374        }
7375    }
7376}
7377impl Node for Error {
7378    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7379        let query = self.selection.select("id");
7380        let graphql_client = self.graphql_client.clone();
7381        async move { query.execute(graphql_client).await }
7382    }
7383}
7384#[derive(Clone)]
7385pub struct ErrorValue {
7386    pub proc: Option<Arc<DaggerSessionProc>>,
7387    pub selection: Selection,
7388    pub graphql_client: DynGraphQLClient,
7389}
7390impl IntoID<Id> for ErrorValue {
7391    fn into_id(
7392        self,
7393    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7394        Box::pin(async move { self.id().await })
7395    }
7396}
7397impl Loadable for ErrorValue {
7398    fn graphql_type() -> &'static str {
7399        "ErrorValue"
7400    }
7401    fn from_query(
7402        proc: Option<Arc<DaggerSessionProc>>,
7403        selection: Selection,
7404        graphql_client: DynGraphQLClient,
7405    ) -> Self {
7406        Self {
7407            proc,
7408            selection,
7409            graphql_client,
7410        }
7411    }
7412}
7413impl ErrorValue {
7414    /// A unique identifier for this ErrorValue.
7415    pub async fn id(&self) -> Result<Id, DaggerError> {
7416        let query = self.selection.select("id");
7417        query.execute(self.graphql_client.clone()).await
7418    }
7419    /// The name of the value.
7420    pub async fn name(&self) -> Result<String, DaggerError> {
7421        let query = self.selection.select("name");
7422        query.execute(self.graphql_client.clone()).await
7423    }
7424    /// The value.
7425    pub async fn value(&self) -> Result<Json, DaggerError> {
7426        let query = self.selection.select("value");
7427        query.execute(self.graphql_client.clone()).await
7428    }
7429}
7430impl Node for ErrorValue {
7431    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7432        let query = self.selection.select("id");
7433        let graphql_client = self.graphql_client.clone();
7434        async move { query.execute(graphql_client).await }
7435    }
7436}
7437#[derive(Clone)]
7438pub struct FieldTypeDef {
7439    pub proc: Option<Arc<DaggerSessionProc>>,
7440    pub selection: Selection,
7441    pub graphql_client: DynGraphQLClient,
7442}
7443impl IntoID<Id> for FieldTypeDef {
7444    fn into_id(
7445        self,
7446    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7447        Box::pin(async move { self.id().await })
7448    }
7449}
7450impl Loadable for FieldTypeDef {
7451    fn graphql_type() -> &'static str {
7452        "FieldTypeDef"
7453    }
7454    fn from_query(
7455        proc: Option<Arc<DaggerSessionProc>>,
7456        selection: Selection,
7457        graphql_client: DynGraphQLClient,
7458    ) -> Self {
7459        Self {
7460            proc,
7461            selection,
7462            graphql_client,
7463        }
7464    }
7465}
7466impl FieldTypeDef {
7467    /// The reason this enum member is deprecated, if any.
7468    pub async fn deprecated(&self) -> Result<String, DaggerError> {
7469        let query = self.selection.select("deprecated");
7470        query.execute(self.graphql_client.clone()).await
7471    }
7472    /// A doc string for the field, if any.
7473    pub async fn description(&self) -> Result<String, DaggerError> {
7474        let query = self.selection.select("description");
7475        query.execute(self.graphql_client.clone()).await
7476    }
7477    /// A unique identifier for this FieldTypeDef.
7478    pub async fn id(&self) -> Result<Id, DaggerError> {
7479        let query = self.selection.select("id");
7480        query.execute(self.graphql_client.clone()).await
7481    }
7482    /// The name of the field in lowerCamelCase format.
7483    pub async fn name(&self) -> Result<String, DaggerError> {
7484        let query = self.selection.select("name");
7485        query.execute(self.graphql_client.clone()).await
7486    }
7487    /// The location of this field declaration.
7488    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7489        let query = self.selection.select("sourceMap");
7490        let query = query.select("id");
7491        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7492        Ok(id.map(|id| SourceMap {
7493            proc: self.proc.clone(),
7494            selection: query
7495                .root()
7496                .select("node")
7497                .arg("id", &id.0)
7498                .inline_fragment("SourceMap"),
7499            graphql_client: self.graphql_client.clone(),
7500        }))
7501    }
7502    /// The type of the field.
7503    pub fn type_def(&self) -> TypeDef {
7504        let query = self.selection.select("typeDef");
7505        TypeDef {
7506            proc: self.proc.clone(),
7507            selection: query,
7508            graphql_client: self.graphql_client.clone(),
7509        }
7510    }
7511}
7512impl Node for FieldTypeDef {
7513    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7514        let query = self.selection.select("id");
7515        let graphql_client = self.graphql_client.clone();
7516        async move { query.execute(graphql_client).await }
7517    }
7518}
7519#[derive(Clone)]
7520pub struct File {
7521    pub proc: Option<Arc<DaggerSessionProc>>,
7522    pub selection: Selection,
7523    pub graphql_client: DynGraphQLClient,
7524}
7525#[derive(Builder, Debug, PartialEq)]
7526pub struct FileAsEnvFileOpts {
7527    /// Replace "${VAR}" or "$VAR" with the value of other vars
7528    #[builder(setter(into, strip_option), default)]
7529    pub expand: Option<bool>,
7530}
7531#[derive(Builder, Debug, PartialEq)]
7532pub struct FileContentsOpts {
7533    /// Maximum number of lines to read
7534    #[builder(setter(into, strip_option), default)]
7535    pub limit_lines: Option<isize>,
7536    /// Start reading after this line
7537    #[builder(setter(into, strip_option), default)]
7538    pub offset_lines: Option<isize>,
7539}
7540#[derive(Builder, Debug, PartialEq)]
7541pub struct FileDigestOpts {
7542    /// If true, exclude metadata from the digest.
7543    #[builder(setter(into, strip_option), default)]
7544    pub exclude_metadata: Option<bool>,
7545}
7546#[derive(Builder, Debug, PartialEq)]
7547pub struct FileExportOpts {
7548    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
7549    #[builder(setter(into, strip_option), default)]
7550    pub allow_parent_dir_path: Option<bool>,
7551}
7552#[derive(Builder, Debug, PartialEq)]
7553pub struct FileSearchOpts<'a> {
7554    /// Allow the . pattern to match newlines in multiline mode.
7555    #[builder(setter(into, strip_option), default)]
7556    pub dotall: Option<bool>,
7557    /// Only return matching files, not lines and content
7558    #[builder(setter(into, strip_option), default)]
7559    pub files_only: Option<bool>,
7560    #[builder(setter(into, strip_option), default)]
7561    pub globs: Option<Vec<&'a str>>,
7562    /// Enable case-insensitive matching.
7563    #[builder(setter(into, strip_option), default)]
7564    pub insensitive: Option<bool>,
7565    /// Limit the number of results to return
7566    #[builder(setter(into, strip_option), default)]
7567    pub limit: Option<isize>,
7568    /// Interpret the pattern as a literal string instead of a regular expression.
7569    #[builder(setter(into, strip_option), default)]
7570    pub literal: Option<bool>,
7571    /// Enable searching across multiple lines.
7572    #[builder(setter(into, strip_option), default)]
7573    pub multiline: Option<bool>,
7574    #[builder(setter(into, strip_option), default)]
7575    pub paths: Option<Vec<&'a str>>,
7576    /// Skip hidden files (files starting with .).
7577    #[builder(setter(into, strip_option), default)]
7578    pub skip_hidden: Option<bool>,
7579    /// Honor .gitignore, .ignore, and .rgignore files.
7580    #[builder(setter(into, strip_option), default)]
7581    pub skip_ignored: Option<bool>,
7582}
7583#[derive(Builder, Debug, PartialEq)]
7584pub struct FileWithReplacedOpts {
7585    /// Replace all occurrences of the pattern.
7586    #[builder(setter(into, strip_option), default)]
7587    pub all: Option<bool>,
7588    /// Replace the first match starting from the specified line.
7589    #[builder(setter(into, strip_option), default)]
7590    pub first_from: Option<isize>,
7591}
7592impl IntoID<Id> for File {
7593    fn into_id(
7594        self,
7595    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7596        Box::pin(async move { self.id().await })
7597    }
7598}
7599impl Loadable for File {
7600    fn graphql_type() -> &'static str {
7601        "File"
7602    }
7603    fn from_query(
7604        proc: Option<Arc<DaggerSessionProc>>,
7605        selection: Selection,
7606        graphql_client: DynGraphQLClient,
7607    ) -> Self {
7608        Self {
7609            proc,
7610            selection,
7611            graphql_client,
7612        }
7613    }
7614}
7615impl File {
7616    /// Parse as an env file
7617    ///
7618    /// # Arguments
7619    ///
7620    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7621    pub fn as_env_file(&self) -> EnvFile {
7622        let query = self.selection.select("asEnvFile");
7623        EnvFile {
7624            proc: self.proc.clone(),
7625            selection: query,
7626            graphql_client: self.graphql_client.clone(),
7627        }
7628    }
7629    /// Parse as an env file
7630    ///
7631    /// # Arguments
7632    ///
7633    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7634    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7635        let mut query = self.selection.select("asEnvFile");
7636        if let Some(expand) = opts.expand {
7637            query = query.arg("expand", expand);
7638        }
7639        EnvFile {
7640            proc: self.proc.clone(),
7641            selection: query,
7642            graphql_client: self.graphql_client.clone(),
7643        }
7644    }
7645    /// Interpret this file as a Git bundle by lazily parsing its header.
7646    pub fn as_git_bundle(&self) -> GitBundle {
7647        let query = self.selection.select("asGitBundle");
7648        GitBundle {
7649            proc: self.proc.clone(),
7650            selection: query,
7651            graphql_client: self.graphql_client.clone(),
7652        }
7653    }
7654    /// Parse the file contents as JSON.
7655    pub fn as_json(&self) -> JsonValue {
7656        let query = self.selection.select("asJSON");
7657        JsonValue {
7658            proc: self.proc.clone(),
7659            selection: query,
7660            graphql_client: self.graphql_client.clone(),
7661        }
7662    }
7663    /// Change the owner of the file recursively.
7664    ///
7665    /// # Arguments
7666    ///
7667    /// * `owner` - A user:group to set for the file.
7668    ///
7669    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
7670    ///
7671    /// If the group is omitted, it defaults to the same as the user.
7672    pub fn chown(&self, owner: impl Into<String>) -> File {
7673        let mut query = self.selection.select("chown");
7674        query = query.arg("owner", owner.into());
7675        File {
7676            proc: self.proc.clone(),
7677            selection: query,
7678            graphql_client: self.graphql_client.clone(),
7679        }
7680    }
7681    /// Retrieves the contents of the file.
7682    ///
7683    /// # Arguments
7684    ///
7685    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7686    pub async fn contents(&self) -> Result<String, DaggerError> {
7687        let query = self.selection.select("contents");
7688        query.execute(self.graphql_client.clone()).await
7689    }
7690    /// Retrieves the contents of the file.
7691    ///
7692    /// # Arguments
7693    ///
7694    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7695    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7696        let mut query = self.selection.select("contents");
7697        if let Some(offset_lines) = opts.offset_lines {
7698            query = query.arg("offsetLines", offset_lines);
7699        }
7700        if let Some(limit_lines) = opts.limit_lines {
7701            query = query.arg("limitLines", limit_lines);
7702        }
7703        query.execute(self.graphql_client.clone()).await
7704    }
7705    /// Return the file's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
7706    ///
7707    /// # Arguments
7708    ///
7709    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7710    pub async fn digest(&self) -> Result<String, DaggerError> {
7711        let query = self.selection.select("digest");
7712        query.execute(self.graphql_client.clone()).await
7713    }
7714    /// Return the file's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
7715    ///
7716    /// # Arguments
7717    ///
7718    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7719    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7720        let mut query = self.selection.select("digest");
7721        if let Some(exclude_metadata) = opts.exclude_metadata {
7722            query = query.arg("excludeMetadata", exclude_metadata);
7723        }
7724        query.execute(self.graphql_client.clone()).await
7725    }
7726    /// Writes the file to a file path on the host.
7727    ///
7728    /// # Arguments
7729    ///
7730    /// * `path` - Location of the written directory (e.g., "output.txt").
7731    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7732    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7733        let mut query = self.selection.select("export");
7734        query = query.arg("path", path.into());
7735        query.execute(self.graphql_client.clone()).await
7736    }
7737    /// Writes the file to a file path on the host.
7738    ///
7739    /// # Arguments
7740    ///
7741    /// * `path` - Location of the written directory (e.g., "output.txt").
7742    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7743    pub async fn export_opts(
7744        &self,
7745        path: impl Into<String>,
7746        opts: FileExportOpts,
7747    ) -> Result<String, DaggerError> {
7748        let mut query = self.selection.select("export");
7749        query = query.arg("path", path.into());
7750        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7751            query = query.arg("allowParentDirPath", allow_parent_dir_path);
7752        }
7753        query.execute(self.graphql_client.clone()).await
7754    }
7755    /// A unique identifier for this File.
7756    pub async fn id(&self) -> Result<Id, DaggerError> {
7757        let query = self.selection.select("id");
7758        query.execute(self.graphql_client.clone()).await
7759    }
7760    /// Retrieves the name of the file.
7761    pub async fn name(&self) -> Result<String, DaggerError> {
7762        let query = self.selection.select("name");
7763        query.execute(self.graphql_client.clone()).await
7764    }
7765    /// Searches for content matching the given regular expression or literal string.
7766    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7767    ///
7768    /// # Arguments
7769    ///
7770    /// * `pattern` - The text to match.
7771    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7772    pub async fn search(
7773        &self,
7774        pattern: impl Into<String>,
7775    ) -> Result<Vec<SearchResult>, DaggerError> {
7776        let mut query = self.selection.select("search");
7777        query = query.arg("pattern", pattern.into());
7778        let query = query.select("id");
7779        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7780        Ok(ids
7781            .into_iter()
7782            .map(|id| SearchResult {
7783                proc: self.proc.clone(),
7784                selection: crate::querybuilder::query()
7785                    .select("node")
7786                    .arg("id", &id.0)
7787                    .inline_fragment("SearchResult"),
7788                graphql_client: self.graphql_client.clone(),
7789            })
7790            .collect())
7791    }
7792    /// Searches for content matching the given regular expression or literal string.
7793    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7794    ///
7795    /// # Arguments
7796    ///
7797    /// * `pattern` - The text to match.
7798    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7799    pub async fn search_opts<'a>(
7800        &self,
7801        pattern: impl Into<String>,
7802        opts: FileSearchOpts<'a>,
7803    ) -> Result<Vec<SearchResult>, DaggerError> {
7804        let mut query = self.selection.select("search");
7805        query = query.arg("pattern", pattern.into());
7806        if let Some(literal) = opts.literal {
7807            query = query.arg("literal", literal);
7808        }
7809        if let Some(multiline) = opts.multiline {
7810            query = query.arg("multiline", multiline);
7811        }
7812        if let Some(dotall) = opts.dotall {
7813            query = query.arg("dotall", dotall);
7814        }
7815        if let Some(insensitive) = opts.insensitive {
7816            query = query.arg("insensitive", insensitive);
7817        }
7818        if let Some(skip_ignored) = opts.skip_ignored {
7819            query = query.arg("skipIgnored", skip_ignored);
7820        }
7821        if let Some(skip_hidden) = opts.skip_hidden {
7822            query = query.arg("skipHidden", skip_hidden);
7823        }
7824        if let Some(files_only) = opts.files_only {
7825            query = query.arg("filesOnly", files_only);
7826        }
7827        if let Some(limit) = opts.limit {
7828            query = query.arg("limit", limit);
7829        }
7830        if let Some(paths) = opts.paths {
7831            query = query.arg("paths", paths);
7832        }
7833        if let Some(globs) = opts.globs {
7834            query = query.arg("globs", globs);
7835        }
7836        let query = query.select("id");
7837        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7838        Ok(ids
7839            .into_iter()
7840            .map(|id| SearchResult {
7841                proc: self.proc.clone(),
7842                selection: crate::querybuilder::query()
7843                    .select("node")
7844                    .arg("id", &id.0)
7845                    .inline_fragment("SearchResult"),
7846                graphql_client: self.graphql_client.clone(),
7847            })
7848            .collect())
7849    }
7850    /// Retrieves the size of the file, in bytes.
7851    pub async fn size(&self) -> Result<isize, DaggerError> {
7852        let query = self.selection.select("size");
7853        query.execute(self.graphql_client.clone()).await
7854    }
7855    /// Return file status
7856    pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
7857        let query = self.selection.select("stat");
7858        let query = query.select("id");
7859        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7860        Ok(id.map(|id| Stat {
7861            proc: self.proc.clone(),
7862            selection: query
7863                .root()
7864                .select("node")
7865                .arg("id", &id.0)
7866                .inline_fragment("Stat"),
7867            graphql_client: self.graphql_client.clone(),
7868        }))
7869    }
7870    /// Force evaluation in the engine.
7871    pub async fn sync(&self) -> Result<File, DaggerError> {
7872        let query = self.selection.select("sync");
7873        let id: Id = query.execute(self.graphql_client.clone()).await?;
7874        Ok(File {
7875            proc: self.proc.clone(),
7876            selection: query
7877                .root()
7878                .select("node")
7879                .arg("id", &id.0)
7880                .inline_fragment("File"),
7881            graphql_client: self.graphql_client.clone(),
7882        })
7883    }
7884    /// Retrieves this file with its name set to the given name.
7885    ///
7886    /// # Arguments
7887    ///
7888    /// * `name` - Name to set file to.
7889    pub fn with_name(&self, name: impl Into<String>) -> File {
7890        let mut query = self.selection.select("withName");
7891        query = query.arg("name", name.into());
7892        File {
7893            proc: self.proc.clone(),
7894            selection: query,
7895            graphql_client: self.graphql_client.clone(),
7896        }
7897    }
7898    /// Retrieves the file with content replaced with the given text.
7899    /// If 'all' is true, all occurrences of the pattern will be replaced.
7900    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7901    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7902    /// If there are no matches for the pattern, this will error.
7903    ///
7904    /// # Arguments
7905    ///
7906    /// * `search` - The text to match.
7907    /// * `replacement` - The text to match.
7908    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7909    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7910        let mut query = self.selection.select("withReplaced");
7911        query = query.arg("search", search.into());
7912        query = query.arg("replacement", replacement.into());
7913        File {
7914            proc: self.proc.clone(),
7915            selection: query,
7916            graphql_client: self.graphql_client.clone(),
7917        }
7918    }
7919    /// Retrieves the file with content replaced with the given text.
7920    /// If 'all' is true, all occurrences of the pattern will be replaced.
7921    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7922    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7923    /// If there are no matches for the pattern, this will error.
7924    ///
7925    /// # Arguments
7926    ///
7927    /// * `search` - The text to match.
7928    /// * `replacement` - The text to match.
7929    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7930    pub fn with_replaced_opts(
7931        &self,
7932        search: impl Into<String>,
7933        replacement: impl Into<String>,
7934        opts: FileWithReplacedOpts,
7935    ) -> File {
7936        let mut query = self.selection.select("withReplaced");
7937        query = query.arg("search", search.into());
7938        query = query.arg("replacement", replacement.into());
7939        if let Some(all) = opts.all {
7940            query = query.arg("all", all);
7941        }
7942        if let Some(first_from) = opts.first_from {
7943            query = query.arg("firstFrom", first_from);
7944        }
7945        File {
7946            proc: self.proc.clone(),
7947            selection: query,
7948            graphql_client: self.graphql_client.clone(),
7949        }
7950    }
7951    /// Retrieves this file with its created/modified timestamps set to the given time.
7952    ///
7953    /// # Arguments
7954    ///
7955    /// * `timestamp` - Timestamp to set dir/files in.
7956    ///
7957    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7958    pub fn with_timestamps(&self, timestamp: isize) -> File {
7959        let mut query = self.selection.select("withTimestamps");
7960        query = query.arg("timestamp", timestamp);
7961        File {
7962            proc: self.proc.clone(),
7963            selection: query,
7964            graphql_client: self.graphql_client.clone(),
7965        }
7966    }
7967}
7968impl Exportable for File {
7969    fn export(
7970        &self,
7971        path: impl Into<String>,
7972    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7973        let mut query = self.selection.select("export");
7974        query = query.arg("path", path.into());
7975        let graphql_client = self.graphql_client.clone();
7976        async move { query.execute(graphql_client).await }
7977    }
7978    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7979        let query = self.selection.select("id");
7980        let graphql_client = self.graphql_client.clone();
7981        async move { query.execute(graphql_client).await }
7982    }
7983}
7984impl Node for File {
7985    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7986        let query = self.selection.select("id");
7987        let graphql_client = self.graphql_client.clone();
7988        async move { query.execute(graphql_client).await }
7989    }
7990}
7991impl Syncer for File {
7992    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7993        let query = self.selection.select("id");
7994        let graphql_client = self.graphql_client.clone();
7995        async move { query.execute(graphql_client).await }
7996    }
7997    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7998        let query = self.selection.select("sync");
7999        let proc = self.proc.clone();
8000        let graphql_client = self.graphql_client.clone();
8001        async move {
8002            let id: Id = query.execute(graphql_client.clone()).await?;
8003            Ok(Self {
8004                proc,
8005                selection: query
8006                    .root()
8007                    .select("node")
8008                    .arg("id", &id.0)
8009                    .inline_fragment("File"),
8010                graphql_client,
8011            })
8012        }
8013    }
8014}
8015#[derive(Clone)]
8016pub struct Function {
8017    pub proc: Option<Arc<DaggerSessionProc>>,
8018    pub selection: Selection,
8019    pub graphql_client: DynGraphQLClient,
8020}
8021#[derive(Builder, Debug, PartialEq)]
8022pub struct FunctionWithArgOpts<'a> {
8023    #[builder(setter(into, strip_option), default)]
8024    pub default_address: Option<&'a str>,
8025    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
8026    #[builder(setter(into, strip_option), default)]
8027    pub default_path: Option<&'a str>,
8028    /// A default value to use for this argument if not explicitly set by the caller, if any
8029    #[builder(setter(into, strip_option), default)]
8030    pub default_value: Option<Json>,
8031    /// If deprecated, the reason or migration path.
8032    #[builder(setter(into, strip_option), default)]
8033    pub deprecated: Option<&'a str>,
8034    /// A doc string for the argument, if any
8035    #[builder(setter(into, strip_option), default)]
8036    pub description: Option<&'a str>,
8037    /// Patterns to ignore when loading the contextual argument value.
8038    #[builder(setter(into, strip_option), default)]
8039    pub ignore: Option<Vec<&'a str>>,
8040    /// The source map for the argument definition.
8041    #[builder(setter(into, strip_option), default)]
8042    pub source_map: Option<Id>,
8043}
8044#[derive(Builder, Debug, PartialEq)]
8045pub struct FunctionWithCachePolicyOpts<'a> {
8046    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
8047    #[builder(setter(into, strip_option), default)]
8048    pub time_to_live: Option<&'a str>,
8049}
8050#[derive(Builder, Debug, PartialEq)]
8051pub struct FunctionWithDeprecatedOpts<'a> {
8052    /// Reason or migration path describing the deprecation.
8053    #[builder(setter(into, strip_option), default)]
8054    pub reason: Option<&'a str>,
8055}
8056impl IntoID<Id> for Function {
8057    fn into_id(
8058        self,
8059    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8060        Box::pin(async move { self.id().await })
8061    }
8062}
8063impl Loadable for Function {
8064    fn graphql_type() -> &'static str {
8065        "Function"
8066    }
8067    fn from_query(
8068        proc: Option<Arc<DaggerSessionProc>>,
8069        selection: Selection,
8070        graphql_client: DynGraphQLClient,
8071    ) -> Self {
8072        Self {
8073            proc,
8074            selection,
8075            graphql_client,
8076        }
8077    }
8078}
8079impl Function {
8080    /// Arguments accepted by the function, if any.
8081    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
8082        let query = self.selection.select("args");
8083        let query = query.select("id");
8084        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8085        Ok(ids
8086            .into_iter()
8087            .map(|id| FunctionArg {
8088                proc: self.proc.clone(),
8089                selection: crate::querybuilder::query()
8090                    .select("node")
8091                    .arg("id", &id.0)
8092                    .inline_fragment("FunctionArg"),
8093                graphql_client: self.graphql_client.clone(),
8094            })
8095            .collect())
8096    }
8097    /// The reason this function is deprecated, if any.
8098    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8099        let query = self.selection.select("deprecated");
8100        query.execute(self.graphql_client.clone()).await
8101    }
8102    /// A doc string for the function, if any.
8103    pub async fn description(&self) -> Result<String, DaggerError> {
8104        let query = self.selection.select("description");
8105        query.execute(self.graphql_client.clone()).await
8106    }
8107    /// A unique identifier for this Function.
8108    pub async fn id(&self) -> Result<Id, DaggerError> {
8109        let query = self.selection.select("id");
8110        query.execute(self.graphql_client.clone()).await
8111    }
8112    /// The name of the function.
8113    pub async fn name(&self) -> Result<String, DaggerError> {
8114        let query = self.selection.select("name");
8115        query.execute(self.graphql_client.clone()).await
8116    }
8117    /// The type returned by the function.
8118    pub fn return_type(&self) -> TypeDef {
8119        let query = self.selection.select("returnType");
8120        TypeDef {
8121            proc: self.proc.clone(),
8122            selection: query,
8123            graphql_client: self.graphql_client.clone(),
8124        }
8125    }
8126    /// The location of this function declaration.
8127    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8128        let query = self.selection.select("sourceMap");
8129        let query = query.select("id");
8130        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8131        Ok(id.map(|id| SourceMap {
8132            proc: self.proc.clone(),
8133            selection: query
8134                .root()
8135                .select("node")
8136                .arg("id", &id.0)
8137                .inline_fragment("SourceMap"),
8138            graphql_client: self.graphql_client.clone(),
8139        }))
8140    }
8141    /// If this function is provided by a module, the name of the module. Unset otherwise.
8142    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8143        let query = self.selection.select("sourceModuleName");
8144        query.execute(self.graphql_client.clone()).await
8145    }
8146    /// Returns the function with a flag indicating it is an agent middleware.
8147    pub fn with_agent(&self) -> Function {
8148        let query = self.selection.select("withAgent");
8149        Function {
8150            proc: self.proc.clone(),
8151            selection: query,
8152            graphql_client: self.graphql_client.clone(),
8153        }
8154    }
8155    /// Returns the function with the provided argument
8156    ///
8157    /// # Arguments
8158    ///
8159    /// * `name` - The name of the argument
8160    /// * `type_def` - The type of the argument
8161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8162    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
8163        let mut query = self.selection.select("withArg");
8164        query = query.arg("name", name.into());
8165        query = query.arg_lazy(
8166            "typeDef",
8167            Box::new(move || {
8168                let type_def = type_def.clone();
8169                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8170            }),
8171        );
8172        Function {
8173            proc: self.proc.clone(),
8174            selection: query,
8175            graphql_client: self.graphql_client.clone(),
8176        }
8177    }
8178    /// Returns the function with the provided argument
8179    ///
8180    /// # Arguments
8181    ///
8182    /// * `name` - The name of the argument
8183    /// * `type_def` - The type of the argument
8184    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8185    pub fn with_arg_opts<'a>(
8186        &self,
8187        name: impl Into<String>,
8188        type_def: impl IntoID<Id>,
8189        opts: FunctionWithArgOpts<'a>,
8190    ) -> Function {
8191        let mut query = self.selection.select("withArg");
8192        query = query.arg("name", name.into());
8193        query = query.arg_lazy(
8194            "typeDef",
8195            Box::new(move || {
8196                let type_def = type_def.clone();
8197                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8198            }),
8199        );
8200        if let Some(description) = opts.description {
8201            query = query.arg("description", description);
8202        }
8203        if let Some(default_value) = opts.default_value {
8204            query = query.arg("defaultValue", default_value);
8205        }
8206        if let Some(default_path) = opts.default_path {
8207            query = query.arg("defaultPath", default_path);
8208        }
8209        if let Some(ignore) = opts.ignore {
8210            query = query.arg("ignore", ignore);
8211        }
8212        if let Some(source_map) = opts.source_map {
8213            query = query.arg("sourceMap", source_map);
8214        }
8215        if let Some(deprecated) = opts.deprecated {
8216            query = query.arg("deprecated", deprecated);
8217        }
8218        if let Some(default_address) = opts.default_address {
8219            query = query.arg("defaultAddress", default_address);
8220        }
8221        Function {
8222            proc: self.proc.clone(),
8223            selection: query,
8224            graphql_client: self.graphql_client.clone(),
8225        }
8226    }
8227    /// Returns the function updated to use the provided cache policy.
8228    ///
8229    /// # Arguments
8230    ///
8231    /// * `policy` - The cache policy to use.
8232    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8233    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
8234        let mut query = self.selection.select("withCachePolicy");
8235        query = query.arg("policy", policy);
8236        Function {
8237            proc: self.proc.clone(),
8238            selection: query,
8239            graphql_client: self.graphql_client.clone(),
8240        }
8241    }
8242    /// Returns the function updated to use the provided cache policy.
8243    ///
8244    /// # Arguments
8245    ///
8246    /// * `policy` - The cache policy to use.
8247    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8248    pub fn with_cache_policy_opts<'a>(
8249        &self,
8250        policy: FunctionCachePolicy,
8251        opts: FunctionWithCachePolicyOpts<'a>,
8252    ) -> Function {
8253        let mut query = self.selection.select("withCachePolicy");
8254        query = query.arg("policy", policy);
8255        if let Some(time_to_live) = opts.time_to_live {
8256            query = query.arg("timeToLive", time_to_live);
8257        }
8258        Function {
8259            proc: self.proc.clone(),
8260            selection: query,
8261            graphql_client: self.graphql_client.clone(),
8262        }
8263    }
8264    /// Returns the function with a flag indicating it's a check.
8265    pub fn with_check(&self) -> Function {
8266        let query = self.selection.select("withCheck");
8267        Function {
8268            proc: self.proc.clone(),
8269            selection: query,
8270            graphql_client: self.graphql_client.clone(),
8271        }
8272    }
8273    /// Returns the function with the provided deprecation reason.
8274    ///
8275    /// # Arguments
8276    ///
8277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8278    pub fn with_deprecated(&self) -> Function {
8279        let query = self.selection.select("withDeprecated");
8280        Function {
8281            proc: self.proc.clone(),
8282            selection: query,
8283            graphql_client: self.graphql_client.clone(),
8284        }
8285    }
8286    /// Returns the function with the provided deprecation reason.
8287    ///
8288    /// # Arguments
8289    ///
8290    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8291    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
8292        let mut query = self.selection.select("withDeprecated");
8293        if let Some(reason) = opts.reason {
8294            query = query.arg("reason", reason);
8295        }
8296        Function {
8297            proc: self.proc.clone(),
8298            selection: query,
8299            graphql_client: self.graphql_client.clone(),
8300        }
8301    }
8302    /// Returns the function with the given doc string.
8303    ///
8304    /// # Arguments
8305    ///
8306    /// * `description` - The doc string to set.
8307    pub fn with_description(&self, description: impl Into<String>) -> Function {
8308        let mut query = self.selection.select("withDescription");
8309        query = query.arg("description", description.into());
8310        Function {
8311            proc: self.proc.clone(),
8312            selection: query,
8313            graphql_client: self.graphql_client.clone(),
8314        }
8315    }
8316    /// Returns the function with a flag indicating it's a generator.
8317    pub fn with_generator(&self) -> Function {
8318        let query = self.selection.select("withGenerator");
8319        Function {
8320            proc: self.proc.clone(),
8321            selection: query,
8322            graphql_client: self.graphql_client.clone(),
8323        }
8324    }
8325    /// Returns the function with the given source map.
8326    ///
8327    /// # Arguments
8328    ///
8329    /// * `source_map` - The source map for the function definition.
8330    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
8331        let mut query = self.selection.select("withSourceMap");
8332        query = query.arg_lazy(
8333            "sourceMap",
8334            Box::new(move || {
8335                let source_map = source_map.clone();
8336                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8337            }),
8338        );
8339        Function {
8340            proc: self.proc.clone(),
8341            selection: query,
8342            graphql_client: self.graphql_client.clone(),
8343        }
8344    }
8345    /// Returns the function with a flag indicating it returns a service for dagger up.
8346    pub fn with_up(&self) -> Function {
8347        let query = self.selection.select("withUp");
8348        Function {
8349            proc: self.proc.clone(),
8350            selection: query,
8351            graphql_client: self.graphql_client.clone(),
8352        }
8353    }
8354}
8355impl Node for Function {
8356    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8357        let query = self.selection.select("id");
8358        let graphql_client = self.graphql_client.clone();
8359        async move { query.execute(graphql_client).await }
8360    }
8361}
8362#[derive(Clone)]
8363pub struct FunctionArg {
8364    pub proc: Option<Arc<DaggerSessionProc>>,
8365    pub selection: Selection,
8366    pub graphql_client: DynGraphQLClient,
8367}
8368impl IntoID<Id> for FunctionArg {
8369    fn into_id(
8370        self,
8371    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8372        Box::pin(async move { self.id().await })
8373    }
8374}
8375impl Loadable for FunctionArg {
8376    fn graphql_type() -> &'static str {
8377        "FunctionArg"
8378    }
8379    fn from_query(
8380        proc: Option<Arc<DaggerSessionProc>>,
8381        selection: Selection,
8382        graphql_client: DynGraphQLClient,
8383    ) -> Self {
8384        Self {
8385            proc,
8386            selection,
8387            graphql_client,
8388        }
8389    }
8390}
8391impl FunctionArg {
8392    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
8393    pub async fn default_address(&self) -> Result<String, DaggerError> {
8394        let query = self.selection.select("defaultAddress");
8395        query.execute(self.graphql_client.clone()).await
8396    }
8397    /// Only applies to arguments of type File or Directory. If the argument is not set, load it from the given path in the context directory
8398    pub async fn default_path(&self) -> Result<String, DaggerError> {
8399        let query = self.selection.select("defaultPath");
8400        query.execute(self.graphql_client.clone()).await
8401    }
8402    /// A default value to use for this argument when not explicitly set by the caller, if any.
8403    pub async fn default_value(&self) -> Result<Json, DaggerError> {
8404        let query = self.selection.select("defaultValue");
8405        query.execute(self.graphql_client.clone()).await
8406    }
8407    /// The reason this function is deprecated, if any.
8408    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8409        let query = self.selection.select("deprecated");
8410        query.execute(self.graphql_client.clone()).await
8411    }
8412    /// A doc string for the argument, if any.
8413    pub async fn description(&self) -> Result<String, DaggerError> {
8414        let query = self.selection.select("description");
8415        query.execute(self.graphql_client.clone()).await
8416    }
8417    /// A unique identifier for this FunctionArg.
8418    pub async fn id(&self) -> Result<Id, DaggerError> {
8419        let query = self.selection.select("id");
8420        query.execute(self.graphql_client.clone()).await
8421    }
8422    /// Only applies to arguments of type Directory. The ignore patterns are applied to the input directory, and matching entries are filtered out, in a cache-efficient manner.
8423    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8424        let query = self.selection.select("ignore");
8425        query.execute(self.graphql_client.clone()).await
8426    }
8427    /// The name of the argument in lowerCamelCase format.
8428    pub async fn name(&self) -> Result<String, DaggerError> {
8429        let query = self.selection.select("name");
8430        query.execute(self.graphql_client.clone()).await
8431    }
8432    /// The location of this arg declaration.
8433    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8434        let query = self.selection.select("sourceMap");
8435        let query = query.select("id");
8436        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8437        Ok(id.map(|id| SourceMap {
8438            proc: self.proc.clone(),
8439            selection: query
8440                .root()
8441                .select("node")
8442                .arg("id", &id.0)
8443                .inline_fragment("SourceMap"),
8444            graphql_client: self.graphql_client.clone(),
8445        }))
8446    }
8447    /// The type of the argument.
8448    pub fn type_def(&self) -> TypeDef {
8449        let query = self.selection.select("typeDef");
8450        TypeDef {
8451            proc: self.proc.clone(),
8452            selection: query,
8453            graphql_client: self.graphql_client.clone(),
8454        }
8455    }
8456}
8457impl Node for FunctionArg {
8458    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8459        let query = self.selection.select("id");
8460        let graphql_client = self.graphql_client.clone();
8461        async move { query.execute(graphql_client).await }
8462    }
8463}
8464#[derive(Clone)]
8465pub struct FunctionCall {
8466    pub proc: Option<Arc<DaggerSessionProc>>,
8467    pub selection: Selection,
8468    pub graphql_client: DynGraphQLClient,
8469}
8470impl IntoID<Id> for FunctionCall {
8471    fn into_id(
8472        self,
8473    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8474        Box::pin(async move { self.id().await })
8475    }
8476}
8477impl Loadable for FunctionCall {
8478    fn graphql_type() -> &'static str {
8479        "FunctionCall"
8480    }
8481    fn from_query(
8482        proc: Option<Arc<DaggerSessionProc>>,
8483        selection: Selection,
8484        graphql_client: DynGraphQLClient,
8485    ) -> Self {
8486        Self {
8487            proc,
8488            selection,
8489            graphql_client,
8490        }
8491    }
8492}
8493impl FunctionCall {
8494    /// A unique identifier for this FunctionCall.
8495    pub async fn id(&self) -> Result<Id, DaggerError> {
8496        let query = self.selection.select("id");
8497        query.execute(self.graphql_client.clone()).await
8498    }
8499    /// The argument values the function is being invoked with.
8500    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
8501        let query = self.selection.select("inputArgs");
8502        let query = query.select("id");
8503        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8504        Ok(ids
8505            .into_iter()
8506            .map(|id| FunctionCallArgValue {
8507                proc: self.proc.clone(),
8508                selection: crate::querybuilder::query()
8509                    .select("node")
8510                    .arg("id", &id.0)
8511                    .inline_fragment("FunctionCallArgValue"),
8512                graphql_client: self.graphql_client.clone(),
8513            })
8514            .collect())
8515    }
8516    /// The name of the function being called.
8517    pub async fn name(&self) -> Result<String, DaggerError> {
8518        let query = self.selection.select("name");
8519        query.execute(self.graphql_client.clone()).await
8520    }
8521    /// The value of the parent object of the function being called. If the function is top-level to the module, this is always an empty object.
8522    pub async fn parent(&self) -> Result<Json, DaggerError> {
8523        let query = self.selection.select("parent");
8524        query.execute(self.graphql_client.clone()).await
8525    }
8526    /// The name of the parent object of the function being called. If the function is top-level to the module, this is the name of the module.
8527    pub async fn parent_name(&self) -> Result<String, DaggerError> {
8528        let query = self.selection.select("parentName");
8529        query.execute(self.graphql_client.clone()).await
8530    }
8531    /// Return an error from the function.
8532    ///
8533    /// # Arguments
8534    ///
8535    /// * `error` - The error to return.
8536    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
8537        let mut query = self.selection.select("returnError");
8538        query = query.arg_lazy(
8539            "error",
8540            Box::new(move || {
8541                let error = error.clone();
8542                Box::pin(async move { error.into_id().await.unwrap().quote() })
8543            }),
8544        );
8545        query.execute(self.graphql_client.clone()).await
8546    }
8547    /// Set the return value of the function call to the provided value.
8548    ///
8549    /// # Arguments
8550    ///
8551    /// * `value` - JSON serialization of the return value.
8552    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8553        let mut query = self.selection.select("returnValue");
8554        query = query.arg("value", value);
8555        query.execute(self.graphql_client.clone()).await
8556    }
8557}
8558impl Node for FunctionCall {
8559    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8560        let query = self.selection.select("id");
8561        let graphql_client = self.graphql_client.clone();
8562        async move { query.execute(graphql_client).await }
8563    }
8564}
8565#[derive(Clone)]
8566pub struct FunctionCallArgValue {
8567    pub proc: Option<Arc<DaggerSessionProc>>,
8568    pub selection: Selection,
8569    pub graphql_client: DynGraphQLClient,
8570}
8571impl IntoID<Id> for FunctionCallArgValue {
8572    fn into_id(
8573        self,
8574    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8575        Box::pin(async move { self.id().await })
8576    }
8577}
8578impl Loadable for FunctionCallArgValue {
8579    fn graphql_type() -> &'static str {
8580        "FunctionCallArgValue"
8581    }
8582    fn from_query(
8583        proc: Option<Arc<DaggerSessionProc>>,
8584        selection: Selection,
8585        graphql_client: DynGraphQLClient,
8586    ) -> Self {
8587        Self {
8588            proc,
8589            selection,
8590            graphql_client,
8591        }
8592    }
8593}
8594impl FunctionCallArgValue {
8595    /// A unique identifier for this FunctionCallArgValue.
8596    pub async fn id(&self) -> Result<Id, DaggerError> {
8597        let query = self.selection.select("id");
8598        query.execute(self.graphql_client.clone()).await
8599    }
8600    /// The name of the argument.
8601    pub async fn name(&self) -> Result<String, DaggerError> {
8602        let query = self.selection.select("name");
8603        query.execute(self.graphql_client.clone()).await
8604    }
8605    /// The value of the argument represented as a JSON serialized string.
8606    pub async fn value(&self) -> Result<Json, DaggerError> {
8607        let query = self.selection.select("value");
8608        query.execute(self.graphql_client.clone()).await
8609    }
8610}
8611impl Node for FunctionCallArgValue {
8612    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8613        let query = self.selection.select("id");
8614        let graphql_client = self.graphql_client.clone();
8615        async move { query.execute(graphql_client).await }
8616    }
8617}
8618#[derive(Clone)]
8619pub struct GeneratedCode {
8620    pub proc: Option<Arc<DaggerSessionProc>>,
8621    pub selection: Selection,
8622    pub graphql_client: DynGraphQLClient,
8623}
8624impl IntoID<Id> for GeneratedCode {
8625    fn into_id(
8626        self,
8627    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8628        Box::pin(async move { self.id().await })
8629    }
8630}
8631impl Loadable for GeneratedCode {
8632    fn graphql_type() -> &'static str {
8633        "GeneratedCode"
8634    }
8635    fn from_query(
8636        proc: Option<Arc<DaggerSessionProc>>,
8637        selection: Selection,
8638        graphql_client: DynGraphQLClient,
8639    ) -> Self {
8640        Self {
8641            proc,
8642            selection,
8643            graphql_client,
8644        }
8645    }
8646}
8647impl GeneratedCode {
8648    /// The directory containing the generated code.
8649    pub fn code(&self) -> Directory {
8650        let query = self.selection.select("code");
8651        Directory {
8652            proc: self.proc.clone(),
8653            selection: query,
8654            graphql_client: self.graphql_client.clone(),
8655        }
8656    }
8657    /// A unique identifier for this GeneratedCode.
8658    pub async fn id(&self) -> Result<Id, DaggerError> {
8659        let query = self.selection.select("id");
8660        query.execute(self.graphql_client.clone()).await
8661    }
8662    /// List of paths to mark generated in version control (i.e. .gitattributes).
8663    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8664        let query = self.selection.select("vcsGeneratedPaths");
8665        query.execute(self.graphql_client.clone()).await
8666    }
8667    /// List of paths to ignore in version control (i.e. .gitignore).
8668    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8669        let query = self.selection.select("vcsIgnoredPaths");
8670        query.execute(self.graphql_client.clone()).await
8671    }
8672    /// Set the list of paths to mark generated in version control.
8673    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8674        let mut query = self.selection.select("withVCSGeneratedPaths");
8675        query = query.arg(
8676            "paths",
8677            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8678        );
8679        GeneratedCode {
8680            proc: self.proc.clone(),
8681            selection: query,
8682            graphql_client: self.graphql_client.clone(),
8683        }
8684    }
8685    /// Set the list of paths to ignore in version control.
8686    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8687        let mut query = self.selection.select("withVCSIgnoredPaths");
8688        query = query.arg(
8689            "paths",
8690            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8691        );
8692        GeneratedCode {
8693            proc: self.proc.clone(),
8694            selection: query,
8695            graphql_client: self.graphql_client.clone(),
8696        }
8697    }
8698}
8699impl Node for GeneratedCode {
8700    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8701        let query = self.selection.select("id");
8702        let graphql_client = self.graphql_client.clone();
8703        async move { query.execute(graphql_client).await }
8704    }
8705}
8706#[derive(Clone)]
8707pub struct Generator {
8708    pub proc: Option<Arc<DaggerSessionProc>>,
8709    pub selection: Selection,
8710    pub graphql_client: DynGraphQLClient,
8711}
8712impl IntoID<Id> for Generator {
8713    fn into_id(
8714        self,
8715    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8716        Box::pin(async move { self.id().await })
8717    }
8718}
8719impl Loadable for Generator {
8720    fn graphql_type() -> &'static str {
8721        "Generator"
8722    }
8723    fn from_query(
8724        proc: Option<Arc<DaggerSessionProc>>,
8725        selection: Selection,
8726        graphql_client: DynGraphQLClient,
8727    ) -> Self {
8728        Self {
8729            proc,
8730            selection,
8731            graphql_client,
8732        }
8733    }
8734}
8735impl Generator {
8736    /// The generated changeset from the last run
8737    pub fn changes(&self) -> Changeset {
8738        let query = self.selection.select("changes");
8739        Changeset {
8740            proc: self.proc.clone(),
8741            selection: query,
8742            graphql_client: self.graphql_client.clone(),
8743        }
8744    }
8745    /// Whether the generator complete
8746    pub async fn completed(&self) -> Result<bool, DaggerError> {
8747        let query = self.selection.select("completed");
8748        query.execute(self.graphql_client.clone()).await
8749    }
8750    /// Return the description of the generator
8751    pub async fn description(&self) -> Result<String, DaggerError> {
8752        let query = self.selection.select("description");
8753        query.execute(self.graphql_client.clone()).await
8754    }
8755    /// A unique identifier for this Generator.
8756    pub async fn id(&self) -> Result<Id, DaggerError> {
8757        let query = self.selection.select("id");
8758        query.execute(self.graphql_client.clone()).await
8759    }
8760    /// Whether changeset from the last generator run is empty or not
8761    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8762        let query = self.selection.select("isEmpty");
8763        query.execute(self.graphql_client.clone()).await
8764    }
8765    /// Return the command name of the generator. Entrypoint targets omit the module prefix.
8766    pub async fn name(&self) -> Result<String, DaggerError> {
8767        let query = self.selection.select("name");
8768        query.execute(self.graphql_client.clone()).await
8769    }
8770    /// The module that defined the generator, or null for an engine-defined generator
8771    pub async fn original_module(&self) -> Result<Option<Module>, DaggerError> {
8772        let query = self.selection.select("originalModule");
8773        let query = query.select("id");
8774        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8775        Ok(id.map(|id| Module {
8776            proc: self.proc.clone(),
8777            selection: query
8778                .root()
8779                .select("node")
8780                .arg("id", &id.0)
8781                .inline_fragment("Module"),
8782            graphql_client: self.graphql_client.clone(),
8783        }))
8784    }
8785    /// The path of the generator within its module
8786    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8787        let query = self.selection.select("path");
8788        query.execute(self.graphql_client.clone()).await
8789    }
8790    /// Execute the generator
8791    pub fn run(&self) -> Generator {
8792        let query = self.selection.select("run");
8793        Generator {
8794            proc: self.proc.clone(),
8795            selection: query,
8796            graphql_client: self.graphql_client.clone(),
8797        }
8798    }
8799}
8800impl Node for Generator {
8801    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8802        let query = self.selection.select("id");
8803        let graphql_client = self.graphql_client.clone();
8804        async move { query.execute(graphql_client).await }
8805    }
8806}
8807#[derive(Clone)]
8808pub struct GeneratorGroup {
8809    pub proc: Option<Arc<DaggerSessionProc>>,
8810    pub selection: Selection,
8811    pub graphql_client: DynGraphQLClient,
8812}
8813#[derive(Builder, Debug, PartialEq)]
8814pub struct GeneratorGroupChangesOpts {
8815    /// Strategy to apply on conflicts between generators
8816    #[builder(setter(into, strip_option), default)]
8817    pub on_conflict: Option<ChangesetsMergeConflict>,
8818}
8819#[derive(Builder, Debug, PartialEq)]
8820pub struct GeneratorGroupWorkspaceOpts {
8821    /// Strategy to apply on conflicts between generators
8822    #[builder(setter(into, strip_option), default)]
8823    pub on_conflict: Option<ChangesetsMergeConflict>,
8824}
8825impl IntoID<Id> for GeneratorGroup {
8826    fn into_id(
8827        self,
8828    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8829        Box::pin(async move { self.id().await })
8830    }
8831}
8832impl Loadable for GeneratorGroup {
8833    fn graphql_type() -> &'static str {
8834        "GeneratorGroup"
8835    }
8836    fn from_query(
8837        proc: Option<Arc<DaggerSessionProc>>,
8838        selection: Selection,
8839        graphql_client: DynGraphQLClient,
8840    ) -> Self {
8841        Self {
8842            proc,
8843            selection,
8844            graphql_client,
8845        }
8846    }
8847}
8848impl GeneratorGroup {
8849    /// The combined changes from the last run of the generators
8850    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
8851    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
8852    ///
8853    /// # Arguments
8854    ///
8855    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8856    pub fn changes(&self) -> Changeset {
8857        let query = self.selection.select("changes");
8858        Changeset {
8859            proc: self.proc.clone(),
8860            selection: query,
8861            graphql_client: self.graphql_client.clone(),
8862        }
8863    }
8864    /// The combined changes from the last run of the generators
8865    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
8866    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
8867    ///
8868    /// # Arguments
8869    ///
8870    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8871    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
8872        let mut query = self.selection.select("changes");
8873        if let Some(on_conflict) = opts.on_conflict {
8874            query = query.arg("onConflict", on_conflict);
8875        }
8876        Changeset {
8877            proc: self.proc.clone(),
8878            selection: query,
8879            graphql_client: self.graphql_client.clone(),
8880        }
8881    }
8882    /// A unique identifier for this GeneratorGroup.
8883    pub async fn id(&self) -> Result<Id, DaggerError> {
8884        let query = self.selection.select("id");
8885        query.execute(self.graphql_client.clone()).await
8886    }
8887    /// Whether the generated changeset from the last run is empty or not
8888    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8889        let query = self.selection.select("isEmpty");
8890        query.execute(self.graphql_client.clone()).await
8891    }
8892    /// Return a list of individual generators and their details
8893    pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
8894        let query = self.selection.select("list");
8895        let query = query.select("id");
8896        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8897        Ok(ids
8898            .into_iter()
8899            .map(|id| Generator {
8900                proc: self.proc.clone(),
8901                selection: crate::querybuilder::query()
8902                    .select("node")
8903                    .arg("id", &id.0)
8904                    .inline_fragment("Generator"),
8905                graphql_client: self.graphql_client.clone(),
8906            })
8907            .collect())
8908    }
8909    /// Load failures tolerated while collecting the generators.
8910    /// Empty unless a workspace module could not be loaded during an unscoped 'dagger generate' (no selector), where load failures are tolerated so the modules that do load still generate. Each entry is a human-readable error message. An explicit selector keeps failing hard instead.
8911    pub async fn load_failures(&self) -> Result<Vec<String>, DaggerError> {
8912        let query = self.selection.select("loadFailures");
8913        query.execute(self.graphql_client.clone()).await
8914    }
8915    /// Execute all selected generators
8916    pub fn run(&self) -> GeneratorGroup {
8917        let query = self.selection.select("run");
8918        GeneratorGroup {
8919            proc: self.proc.clone(),
8920            selection: query,
8921            graphql_client: self.graphql_client.clone(),
8922        }
8923    }
8924    /// The workspace with the combined output from the last generator run
8925    ///
8926    /// # Arguments
8927    ///
8928    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8929    pub fn workspace(&self) -> Workspace {
8930        let query = self.selection.select("workspace");
8931        Workspace {
8932            proc: self.proc.clone(),
8933            selection: query,
8934            graphql_client: self.graphql_client.clone(),
8935        }
8936    }
8937    /// The workspace with the combined output from the last generator run
8938    ///
8939    /// # Arguments
8940    ///
8941    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8942    pub fn workspace_opts(&self, opts: GeneratorGroupWorkspaceOpts) -> Workspace {
8943        let mut query = self.selection.select("workspace");
8944        if let Some(on_conflict) = opts.on_conflict {
8945            query = query.arg("onConflict", on_conflict);
8946        }
8947        Workspace {
8948            proc: self.proc.clone(),
8949            selection: query,
8950            graphql_client: self.graphql_client.clone(),
8951        }
8952    }
8953}
8954impl Node for GeneratorGroup {
8955    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8956        let query = self.selection.select("id");
8957        let graphql_client = self.graphql_client.clone();
8958        async move { query.execute(graphql_client).await }
8959    }
8960}
8961#[derive(Clone)]
8962pub struct GitBundle {
8963    pub proc: Option<Arc<DaggerSessionProc>>,
8964    pub selection: Selection,
8965    pub graphql_client: DynGraphQLClient,
8966}
8967impl IntoID<Id> for GitBundle {
8968    fn into_id(
8969        self,
8970    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8971        Box::pin(async move { self.id().await })
8972    }
8973}
8974impl Loadable for GitBundle {
8975    fn graphql_type() -> &'static str {
8976        "GitBundle"
8977    }
8978    fn from_query(
8979        proc: Option<Arc<DaggerSessionProc>>,
8980        selection: Selection,
8981        graphql_client: DynGraphQLClient,
8982    ) -> Self {
8983        Self {
8984            proc,
8985            selection,
8986            graphql_client,
8987        }
8988    }
8989}
8990impl GitBundle {
8991    /// Return the bundle bytes as a File.
8992    pub fn as_file(&self) -> File {
8993        let query = self.selection.select("asFile");
8994        File {
8995            proc: self.proc.clone(),
8996            selection: query,
8997            graphql_client: self.graphql_client.clone(),
8998        }
8999    }
9000    /// A unique identifier for this GitBundle.
9001    pub async fn id(&self) -> Result<Id, DaggerError> {
9002        let query = self.selection.select("id");
9003        query.execute(self.graphql_client.clone()).await
9004    }
9005    /// Object format capability: sha1 or sha256.
9006    pub async fn object_format(&self) -> Result<String, DaggerError> {
9007        let query = self.selection.select("objectFormat");
9008        query.execute(self.graphql_client.clone()).await
9009    }
9010    /// Commits that must already exist wherever this bundle is applied.
9011    pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
9012        let query = self.selection.select("prerequisiteSHAs");
9013        query.execute(self.graphql_client.clone()).await
9014    }
9015    /// Refs advertised by the bundle and the object IDs they resolve to.
9016    pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
9017        let query = self.selection.select("refs");
9018        let query = query.select("id");
9019        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9020        Ok(ids
9021            .into_iter()
9022            .map(|id| GitBundleRef {
9023                proc: self.proc.clone(),
9024                selection: crate::querybuilder::query()
9025                    .select("node")
9026                    .arg("id", &id.0)
9027                    .inline_fragment("GitBundleRef"),
9028                graphql_client: self.graphql_client.clone(),
9029            })
9030            .collect())
9031    }
9032    /// Perform full structural verification of the bundle and error if it is malformed.
9033    pub fn validate(&self) -> GitBundle {
9034        let query = self.selection.select("validate");
9035        GitBundle {
9036            proc: self.proc.clone(),
9037            selection: query,
9038            graphql_client: self.graphql_client.clone(),
9039        }
9040    }
9041    /// Bundle format version (2 or 3).
9042    pub async fn version(&self) -> Result<isize, DaggerError> {
9043        let query = self.selection.select("version");
9044        query.execute(self.graphql_client.clone()).await
9045    }
9046}
9047impl Node for GitBundle {
9048    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9049        let query = self.selection.select("id");
9050        let graphql_client = self.graphql_client.clone();
9051        async move { query.execute(graphql_client).await }
9052    }
9053}
9054#[derive(Clone)]
9055pub struct GitBundleRef {
9056    pub proc: Option<Arc<DaggerSessionProc>>,
9057    pub selection: Selection,
9058    pub graphql_client: DynGraphQLClient,
9059}
9060impl IntoID<Id> for GitBundleRef {
9061    fn into_id(
9062        self,
9063    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9064        Box::pin(async move { self.id().await })
9065    }
9066}
9067impl Loadable for GitBundleRef {
9068    fn graphql_type() -> &'static str {
9069        "GitBundleRef"
9070    }
9071    fn from_query(
9072        proc: Option<Arc<DaggerSessionProc>>,
9073        selection: Selection,
9074        graphql_client: DynGraphQLClient,
9075    ) -> Self {
9076        Self {
9077            proc,
9078            selection,
9079            graphql_client,
9080        }
9081    }
9082}
9083impl GitBundleRef {
9084    /// A unique identifier for this GitBundleRef.
9085    pub async fn id(&self) -> Result<Id, DaggerError> {
9086        let query = self.selection.select("id");
9087        query.execute(self.graphql_client.clone()).await
9088    }
9089    /// The advertised ref name.
9090    pub async fn name(&self) -> Result<String, DaggerError> {
9091        let query = self.selection.select("name");
9092        query.execute(self.graphql_client.clone()).await
9093    }
9094    /// The object ID the advertised ref resolves to.
9095    pub async fn sha(&self) -> Result<String, DaggerError> {
9096        let query = self.selection.select("sha");
9097        query.execute(self.graphql_client.clone()).await
9098    }
9099}
9100impl Node for GitBundleRef {
9101    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9102        let query = self.selection.select("id");
9103        let graphql_client = self.graphql_client.clone();
9104        async move { query.execute(graphql_client).await }
9105    }
9106}
9107#[derive(Clone)]
9108pub struct GitCommit {
9109    pub proc: Option<Arc<DaggerSessionProc>>,
9110    pub selection: Selection,
9111    pub graphql_client: DynGraphQLClient,
9112}
9113#[derive(Builder, Debug, PartialEq)]
9114pub struct GitCommitAncestorReleaseTagOpts {
9115    /// Include pre-release tags when choosing the latest tag.
9116    #[builder(setter(into, strip_option), default)]
9117    pub include_pre_release: Option<bool>,
9118}
9119#[derive(Builder, Debug, PartialEq)]
9120pub struct GitCommitChangesOpts {
9121    /// Use this commit as the comparison base instead of the first parent. The comparison commit may belong to an unrelated history or repository.
9122    #[builder(setter(into, strip_option), default)]
9123    pub against: Option<Id>,
9124}
9125#[derive(Builder, Debug, PartialEq)]
9126pub struct GitCommitReleaseTagOpts {
9127    /// Include pre-release tags when choosing the latest tag.
9128    #[builder(setter(into, strip_option), default)]
9129    pub include_pre_release: Option<bool>,
9130}
9131#[derive(Builder, Debug, PartialEq)]
9132pub struct GitCommitTreeOpts {
9133    /// The depth of the tree to fetch.
9134    #[builder(setter(into, strip_option), default)]
9135    pub depth: Option<isize>,
9136    /// Set to true to discard .git directory.
9137    #[builder(setter(into, strip_option), default)]
9138    pub discard_git_dir: Option<bool>,
9139    /// Set to true to populate tag refs in the local checkout .git.
9140    #[builder(setter(into, strip_option), default)]
9141    pub include_tags: Option<bool>,
9142}
9143impl IntoID<Id> for GitCommit {
9144    fn into_id(
9145        self,
9146    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9147        Box::pin(async move { self.id().await })
9148    }
9149}
9150impl Loadable for GitCommit {
9151    fn graphql_type() -> &'static str {
9152        "GitCommit"
9153    }
9154    fn from_query(
9155        proc: Option<Arc<DaggerSessionProc>>,
9156        selection: Selection,
9157        graphql_client: DynGraphQLClient,
9158    ) -> Self {
9159        Self {
9160            proc,
9161            selection,
9162            graphql_client,
9163        }
9164    }
9165}
9166impl GitCommit {
9167    /// The latest semver release tag reachable from this commit.
9168    ///
9169    /// # Arguments
9170    ///
9171    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9172    pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
9173        let query = self.selection.select("ancestorReleaseTag");
9174        let query = query.select("id");
9175        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9176        Ok(id.map(|id| GitRef {
9177            proc: self.proc.clone(),
9178            selection: query
9179                .root()
9180                .select("node")
9181                .arg("id", &id.0)
9182                .inline_fragment("GitRef"),
9183            graphql_client: self.graphql_client.clone(),
9184        }))
9185    }
9186    /// The latest semver release tag reachable from this commit.
9187    ///
9188    /// # Arguments
9189    ///
9190    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9191    pub async fn ancestor_release_tag_opts(
9192        &self,
9193        opts: GitCommitAncestorReleaseTagOpts,
9194    ) -> Result<Option<GitRef>, DaggerError> {
9195        let mut query = self.selection.select("ancestorReleaseTag");
9196        if let Some(include_pre_release) = opts.include_pre_release {
9197            query = query.arg("includePreRelease", include_pre_release);
9198        }
9199        let query = query.select("id");
9200        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9201        Ok(id.map(|id| GitRef {
9202            proc: self.proc.clone(),
9203            selection: query
9204                .root()
9205                .select("node")
9206                .arg("id", &id.0)
9207                .inline_fragment("GitRef"),
9208            graphql_client: self.graphql_client.clone(),
9209        }))
9210    }
9211    /// Git author email.
9212    pub async fn author_email(&self) -> Result<String, DaggerError> {
9213        let query = self.selection.select("authorEmail");
9214        query.execute(self.graphql_client.clone()).await
9215    }
9216    /// Git author name.
9217    pub async fn author_name(&self) -> Result<String, DaggerError> {
9218        let query = self.selection.select("authorName");
9219        query.execute(self.graphql_client.clone()).await
9220    }
9221    /// Git author date, in RFC3339 format.
9222    pub async fn authored_date(&self) -> Result<String, DaggerError> {
9223        let query = self.selection.select("authoredDate");
9224        query.execute(self.graphql_client.clone()).await
9225    }
9226    /// Returns the changes from the first parent to this commit, excluding Git metadata.
9227    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
9228    ///
9229    /// # Arguments
9230    ///
9231    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9232    pub fn changes(&self) -> Changeset {
9233        let query = self.selection.select("changes");
9234        Changeset {
9235            proc: self.proc.clone(),
9236            selection: query,
9237            graphql_client: self.graphql_client.clone(),
9238        }
9239    }
9240    /// Returns the changes from the first parent to this commit, excluding Git metadata.
9241    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
9242    ///
9243    /// # Arguments
9244    ///
9245    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9246    pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
9247        let mut query = self.selection.select("changes");
9248        if let Some(against) = opts.against {
9249            query = query.arg("against", against);
9250        }
9251        Changeset {
9252            proc: self.proc.clone(),
9253            selection: query,
9254            graphql_client: self.graphql_client.clone(),
9255        }
9256    }
9257    /// Git committer date, in RFC3339 format.
9258    pub async fn committed_date(&self) -> Result<String, DaggerError> {
9259        let query = self.selection.select("committedDate");
9260        query.execute(self.graphql_client.clone()).await
9261    }
9262    /// Git committer email.
9263    pub async fn committer_email(&self) -> Result<String, DaggerError> {
9264        let query = self.selection.select("committerEmail");
9265        query.execute(self.graphql_client.clone()).await
9266    }
9267    /// Git committer name.
9268    pub async fn committer_name(&self) -> Result<String, DaggerError> {
9269        let query = self.selection.select("committerName");
9270        query.execute(self.graphql_client.clone()).await
9271    }
9272    /// A unique identifier for this GitCommit.
9273    pub async fn id(&self) -> Result<Id, DaggerError> {
9274        let query = self.selection.select("id");
9275        query.execute(self.graphql_client.clone()).await
9276    }
9277    /// Full commit message.
9278    pub async fn message(&self) -> Result<String, DaggerError> {
9279        let query = self.selection.select("message");
9280        query.execute(self.graphql_client.clone()).await
9281    }
9282    /// Commit message body, excluding the headline.
9283    pub async fn message_body(&self) -> Result<String, DaggerError> {
9284        let query = self.selection.select("messageBody");
9285        query.execute(self.graphql_client.clone()).await
9286    }
9287    /// First line of the commit message.
9288    pub async fn message_headline(&self) -> Result<String, DaggerError> {
9289        let query = self.selection.select("messageHeadline");
9290        query.execute(self.graphql_client.clone()).await
9291    }
9292    /// Parent commit SHAs.
9293    pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
9294        let query = self.selection.select("parentShas");
9295        query.execute(self.graphql_client.clone()).await
9296    }
9297    /// The latest semver release tag that points directly at this commit.
9298    ///
9299    /// # Arguments
9300    ///
9301    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9302    pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
9303        let query = self.selection.select("releaseTag");
9304        let query = query.select("id");
9305        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9306        Ok(id.map(|id| GitRef {
9307            proc: self.proc.clone(),
9308            selection: query
9309                .root()
9310                .select("node")
9311                .arg("id", &id.0)
9312                .inline_fragment("GitRef"),
9313            graphql_client: self.graphql_client.clone(),
9314        }))
9315    }
9316    /// The latest semver release tag that points directly at this commit.
9317    ///
9318    /// # Arguments
9319    ///
9320    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9321    pub async fn release_tag_opts(
9322        &self,
9323        opts: GitCommitReleaseTagOpts,
9324    ) -> Result<Option<GitRef>, DaggerError> {
9325        let mut query = self.selection.select("releaseTag");
9326        if let Some(include_pre_release) = opts.include_pre_release {
9327            query = query.arg("includePreRelease", include_pre_release);
9328        }
9329        let query = query.select("id");
9330        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9331        Ok(id.map(|id| GitRef {
9332            proc: self.proc.clone(),
9333            selection: query
9334                .root()
9335                .select("node")
9336                .arg("id", &id.0)
9337                .inline_fragment("GitRef"),
9338            graphql_client: self.graphql_client.clone(),
9339        }))
9340    }
9341    /// The full commit SHA.
9342    pub async fn sha(&self) -> Result<String, DaggerError> {
9343        let query = self.selection.select("sha");
9344        query.execute(self.graphql_client.clone()).await
9345    }
9346    /// The abbreviated commit SHA.
9347    pub async fn short_sha(&self) -> Result<String, DaggerError> {
9348        let query = self.selection.select("shortSha");
9349        query.execute(self.graphql_client.clone()).await
9350    }
9351    /// The filesystem tree at this commit.
9352    ///
9353    /// # Arguments
9354    ///
9355    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9356    pub fn tree(&self) -> Directory {
9357        let query = self.selection.select("tree");
9358        Directory {
9359            proc: self.proc.clone(),
9360            selection: query,
9361            graphql_client: self.graphql_client.clone(),
9362        }
9363    }
9364    /// The filesystem tree at this commit.
9365    ///
9366    /// # Arguments
9367    ///
9368    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9369    pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
9370        let mut query = self.selection.select("tree");
9371        if let Some(discard_git_dir) = opts.discard_git_dir {
9372            query = query.arg("discardGitDir", discard_git_dir);
9373        }
9374        if let Some(depth) = opts.depth {
9375            query = query.arg("depth", depth);
9376        }
9377        if let Some(include_tags) = opts.include_tags {
9378            query = query.arg("includeTags", include_tags);
9379        }
9380        Directory {
9381            proc: self.proc.clone(),
9382            selection: query,
9383            graphql_client: self.graphql_client.clone(),
9384        }
9385    }
9386}
9387impl Node for GitCommit {
9388    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9389        let query = self.selection.select("id");
9390        let graphql_client = self.graphql_client.clone();
9391        async move { query.execute(graphql_client).await }
9392    }
9393}
9394#[derive(Clone)]
9395pub struct GitPushResult {
9396    pub proc: Option<Arc<DaggerSessionProc>>,
9397    pub selection: Selection,
9398    pub graphql_client: DynGraphQLClient,
9399}
9400impl IntoID<Id> for GitPushResult {
9401    fn into_id(
9402        self,
9403    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9404        Box::pin(async move { self.id().await })
9405    }
9406}
9407impl Loadable for GitPushResult {
9408    fn graphql_type() -> &'static str {
9409        "GitPushResult"
9410    }
9411    fn from_query(
9412        proc: Option<Arc<DaggerSessionProc>>,
9413        selection: Selection,
9414        graphql_client: DynGraphQLClient,
9415    ) -> Self {
9416        Self {
9417            proc,
9418            selection,
9419            graphql_client,
9420        }
9421    }
9422}
9423impl GitPushResult {
9424    /// How the remote ref was updated.
9425    pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
9426        let query = self.selection.select("disposition");
9427        query.execute(self.graphql_client.clone()).await
9428    }
9429    /// A unique identifier for this GitPushResult.
9430    pub async fn id(&self) -> Result<Id, DaggerError> {
9431        let query = self.selection.select("id");
9432        query.execute(self.graphql_client.clone()).await
9433    }
9434    /// The previous remote object ID; empty when the ref was created.
9435    pub async fn previous_sha(&self) -> Result<String, DaggerError> {
9436        let query = self.selection.select("previousSHA");
9437        query.execute(self.graphql_client.clone()).await
9438    }
9439    /// The fully qualified remote ref.
9440    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9441        let query = self.selection.select("ref");
9442        query.execute(self.graphql_client.clone()).await
9443    }
9444    /// The object ID pushed to the remote.
9445    pub async fn sha(&self) -> Result<String, DaggerError> {
9446        let query = self.selection.select("sha");
9447        query.execute(self.graphql_client.clone()).await
9448    }
9449}
9450impl Node for GitPushResult {
9451    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9452        let query = self.selection.select("id");
9453        let graphql_client = self.graphql_client.clone();
9454        async move { query.execute(graphql_client).await }
9455    }
9456}
9457#[derive(Clone)]
9458pub struct GitRef {
9459    pub proc: Option<Arc<DaggerSessionProc>>,
9460    pub selection: Selection,
9461    pub graphql_client: DynGraphQLClient,
9462}
9463#[derive(Builder, Debug, PartialEq)]
9464pub struct GitRefAsWorkspaceOpts<'a> {
9465    /// Current working directory inside the workspace root. Defaults to the workspace root.
9466    #[builder(setter(into, strip_option), default)]
9467    pub cwd: Option<&'a str>,
9468}
9469#[derive(Builder, Debug, PartialEq)]
9470pub struct GitRefLogOpts<'a> {
9471    /// Exclude commits reachable from this ref, i.e. only list commits added on top of it.
9472    #[builder(setter(into, strip_option), default)]
9473    pub base: Option<Id>,
9474    /// Maximum number of commits to return.
9475    #[builder(setter(into, strip_option), default)]
9476    pub limit: Option<isize>,
9477    /// Only include commits touching these paths, relative to the root of the repository.
9478    #[builder(setter(into, strip_option), default)]
9479    pub paths: Option<Vec<&'a str>>,
9480}
9481#[derive(Builder, Debug, PartialEq)]
9482pub struct GitRefPushOpts<'a> {
9483    /// Destination branch; a refs/ prefix is used verbatim. Defaults to this ref's branch name. Required for detached and non-branch refs.
9484    #[builder(setter(into, strip_option), default)]
9485    pub branch: Option<&'a str>,
9486    /// Optional lease: a full lowercase object ID allows replacement only if the remote ref still has that value. Checked even for up-to-date pushes. Empty or omitted uses normal non-force rules, creating the ref if it does not exist.
9487    #[builder(setter(into, strip_option), default)]
9488    pub expected_remote_sha: Option<&'a str>,
9489    /// Name of a registered remote to push to (see GitRepository.withRemote). Defaults to origin. The remote's push URLs, or its URL, become the destination; more than one push URL requires an explicit to instead.
9490    #[builder(setter(into, strip_option), default)]
9491    pub remote: Option<&'a str>,
9492    /// Destination remote repository. Defaults to the origin remote's push routing, or the source's repository URL when none is registered. Required when the source has no remote URL.
9493    #[builder(setter(into, strip_option), default)]
9494    pub to: Option<Id>,
9495}
9496#[derive(Builder, Debug, PartialEq)]
9497pub struct GitRefTreeOpts {
9498    /// The depth of the tree to fetch.
9499    #[builder(setter(into, strip_option), default)]
9500    pub depth: Option<isize>,
9501    /// Set to true to discard .git directory.
9502    #[builder(setter(into, strip_option), default)]
9503    pub discard_git_dir: Option<bool>,
9504    /// Set to true to populate tag refs in the local checkout .git.
9505    #[builder(setter(into, strip_option), default)]
9506    pub include_tags: Option<bool>,
9507}
9508#[derive(Builder, Debug, PartialEq)]
9509pub struct GitRefWithCommitOpts<'a> {
9510    /// Allow a commit whose tree matches its parent, including when the supplied edits are already present. Defaults to false.
9511    #[builder(setter(into, strip_option), default)]
9512    pub allow_empty: Option<bool>,
9513    /// RFC3339 committer date. Defaults to date.
9514    #[builder(setter(into, strip_option), default)]
9515    pub committer_date: Option<&'a str>,
9516    /// Committer email. Defaults to authorEmail.
9517    #[builder(setter(into, strip_option), default)]
9518    pub committer_email: Option<&'a str>,
9519    /// Committer name. Defaults to authorName.
9520    #[builder(setter(into, strip_option), default)]
9521    pub committer_name: Option<&'a str>,
9522    /// Add a Signed-off-by trailer using the commit author's name and email.
9523    #[builder(setter(into, strip_option), default)]
9524    pub signoff: Option<bool>,
9525}
9526impl IntoID<Id> for GitRef {
9527    fn into_id(
9528        self,
9529    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9530        Box::pin(async move { self.id().await })
9531    }
9532}
9533impl Loadable for GitRef {
9534    fn graphql_type() -> &'static str {
9535        "GitRef"
9536    }
9537    fn from_query(
9538        proc: Option<Arc<DaggerSessionProc>>,
9539        selection: Selection,
9540        graphql_client: DynGraphQLClient,
9541    ) -> Self {
9542        Self {
9543            proc,
9544            selection,
9545            graphql_client,
9546        }
9547    }
9548}
9549impl GitRef {
9550    /// Return this ref's repository with HEAD pinned to the selected commit.
9551    /// Preserves the original repository backend, connection information, and other refs. Does not modify a branch or checkout, or prune history.
9552    pub fn as_repository(&self) -> GitRepository {
9553        let query = self.selection.select("asRepository");
9554        GitRepository {
9555            proc: self.proc.clone(),
9556            selection: query,
9557            graphql_client: self.graphql_client.clone(),
9558        }
9559    }
9560    /// Creates a synthetic workspace from this git ref.
9561    ///
9562    /// # Arguments
9563    ///
9564    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9565    pub fn as_workspace(&self) -> Workspace {
9566        let query = self.selection.select("asWorkspace");
9567        Workspace {
9568            proc: self.proc.clone(),
9569            selection: query,
9570            graphql_client: self.graphql_client.clone(),
9571        }
9572    }
9573    /// Creates a synthetic workspace from this git ref.
9574    ///
9575    /// # Arguments
9576    ///
9577    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9578    pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
9579        let mut query = self.selection.select("asWorkspace");
9580        if let Some(cwd) = opts.cwd {
9581            query = query.arg("cwd", cwd);
9582        }
9583        Workspace {
9584            proc: self.proc.clone(),
9585            selection: query,
9586            graphql_client: self.graphql_client.clone(),
9587        }
9588    }
9589    /// The resolved commit id at this ref.
9590    pub async fn commit(&self) -> Result<String, DaggerError> {
9591        let query = self.selection.select("commit");
9592        query.execute(self.graphql_client.clone()).await
9593    }
9594    /// The resolved commit SHA at this ref.
9595    pub async fn commit_sha(&self) -> Result<String, DaggerError> {
9596        let query = self.selection.select("commitSHA");
9597        query.execute(self.graphql_client.clone()).await
9598    }
9599    /// Find the best common ancestor between this ref and another ref.
9600    ///
9601    /// # Arguments
9602    ///
9603    /// * `other` - The other ref to compare against.
9604    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9605        let mut query = self.selection.select("commonAncestor");
9606        query = query.arg_lazy(
9607            "other",
9608            Box::new(move || {
9609                let other = other.clone();
9610                Box::pin(async move { other.into_id().await.unwrap().quote() })
9611            }),
9612        );
9613        GitRef {
9614            proc: self.proc.clone(),
9615            selection: query,
9616            graphql_client: self.graphql_client.clone(),
9617        }
9618    }
9619    /// A unique identifier for this GitRef.
9620    pub async fn id(&self) -> Result<Id, DaggerError> {
9621        let query = self.selection.select("id");
9622        query.execute(self.graphql_client.clone()).await
9623    }
9624    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
9625    ///
9626    /// # Arguments
9627    ///
9628    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9629    pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
9630        let query = self.selection.select("log");
9631        let query = query.select("id");
9632        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9633        Ok(ids
9634            .into_iter()
9635            .map(|id| GitCommit {
9636                proc: self.proc.clone(),
9637                selection: crate::querybuilder::query()
9638                    .select("node")
9639                    .arg("id", &id.0)
9640                    .inline_fragment("GitCommit"),
9641                graphql_client: self.graphql_client.clone(),
9642            })
9643            .collect())
9644    }
9645    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
9646    ///
9647    /// # Arguments
9648    ///
9649    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9650    pub async fn log_opts<'a>(
9651        &self,
9652        opts: GitRefLogOpts<'a>,
9653    ) -> Result<Vec<GitCommit>, DaggerError> {
9654        let mut query = self.selection.select("log");
9655        if let Some(limit) = opts.limit {
9656            query = query.arg("limit", limit);
9657        }
9658        if let Some(paths) = opts.paths {
9659            query = query.arg("paths", paths);
9660        }
9661        if let Some(base) = opts.base {
9662            query = query.arg("base", base);
9663        }
9664        let query = query.select("id");
9665        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9666        Ok(ids
9667            .into_iter()
9668            .map(|id| GitCommit {
9669                proc: self.proc.clone(),
9670                selection: crate::querybuilder::query()
9671                    .select("node")
9672                    .arg("id", &id.0)
9673                    .inline_fragment("GitCommit"),
9674                graphql_client: self.graphql_client.clone(),
9675            })
9676            .collect())
9677    }
9678    /// The resolved name of this ref.
9679    pub async fn name(&self) -> Result<String, DaggerError> {
9680        let query = self.selection.select("name");
9681        query.execute(self.graphql_client.clone()).await
9682    }
9683    /// Push this ref's commit and history to a remote repository using the destination's credentials.
9684    /// The source can come from a remote repository or an engine-side Git repository. To publish a workspace's commits, use Workspace.git.head.push. Pushing does not modify the calling client's checkout, and checkout hooks do not run.
9685    /// A missing remote ref is created. Without a lease, Git's normal non-force rules apply. Each invocation performs a push; loading the returned receipt does not push again.
9686    ///
9687    /// # Arguments
9688    ///
9689    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9690    pub fn push(&self) -> GitPushResult {
9691        let query = self.selection.select("push");
9692        GitPushResult {
9693            proc: self.proc.clone(),
9694            selection: query,
9695            graphql_client: self.graphql_client.clone(),
9696        }
9697    }
9698    /// Push this ref's commit and history to a remote repository using the destination's credentials.
9699    /// The source can come from a remote repository or an engine-side Git repository. To publish a workspace's commits, use Workspace.git.head.push. Pushing does not modify the calling client's checkout, and checkout hooks do not run.
9700    /// A missing remote ref is created. Without a lease, Git's normal non-force rules apply. Each invocation performs a push; loading the returned receipt does not push again.
9701    ///
9702    /// # Arguments
9703    ///
9704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9705    pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
9706        let mut query = self.selection.select("push");
9707        if let Some(to) = opts.to {
9708            query = query.arg("to", to);
9709        }
9710        if let Some(remote) = opts.remote {
9711            query = query.arg("remote", remote);
9712        }
9713        if let Some(branch) = opts.branch {
9714            query = query.arg("branch", branch);
9715        }
9716        if let Some(expected_remote_sha) = opts.expected_remote_sha {
9717            query = query.arg("expectedRemoteSHA", expected_remote_sha);
9718        }
9719        GitPushResult {
9720            proc: self.proc.clone(),
9721            selection: query,
9722            graphql_client: self.graphql_client.clone(),
9723        }
9724    }
9725    /// The resolved ref name at this ref.
9726    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9727        let query = self.selection.select("ref");
9728        query.execute(self.graphql_client.clone()).await
9729    }
9730    /// The commit this ref resolves to.
9731    pub fn target_commit(&self) -> GitCommit {
9732        let query = self.selection.select("targetCommit");
9733        GitCommit {
9734            proc: self.proc.clone(),
9735            selection: query,
9736            graphql_client: self.graphql_client.clone(),
9737        }
9738    }
9739    /// The filesystem tree at this ref.
9740    ///
9741    /// # Arguments
9742    ///
9743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9744    pub fn tree(&self) -> Directory {
9745        let query = self.selection.select("tree");
9746        Directory {
9747            proc: self.proc.clone(),
9748            selection: query,
9749            graphql_client: self.graphql_client.clone(),
9750        }
9751    }
9752    /// The filesystem tree at this ref.
9753    ///
9754    /// # Arguments
9755    ///
9756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9757    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9758        let mut query = self.selection.select("tree");
9759        if let Some(discard_git_dir) = opts.discard_git_dir {
9760            query = query.arg("discardGitDir", discard_git_dir);
9761        }
9762        if let Some(depth) = opts.depth {
9763            query = query.arg("depth", depth);
9764        }
9765        if let Some(include_tags) = opts.include_tags {
9766            query = query.arg("includeTags", include_tags);
9767        }
9768        Directory {
9769            proc: self.proc.clone(),
9770            selection: query,
9771            graphql_client: self.graphql_client.clone(),
9772        }
9773    }
9774    /// Create a single-parent commit on this ref by applying a changeset's edits.
9775    /// Three-way merges the changeset against this ref's tree, using its before snapshot as the base. Preserves compatible parent edits and fails on conflicts. Does not modify the input repository or host checkout.
9776    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
9777    ///
9778    /// # Arguments
9779    ///
9780    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
9781    /// * `message` - Commit message.
9782    /// * `date` - RFC3339 author date; also the default committer date.
9783    /// * `author_name` - Author name.
9784    /// * `author_email` - Author email.
9785    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9786    pub fn with_commit(
9787        &self,
9788        changes: impl IntoID<Id>,
9789        message: impl Into<String>,
9790        date: impl Into<String>,
9791        author_name: impl Into<String>,
9792        author_email: impl Into<String>,
9793    ) -> GitRef {
9794        let mut query = self.selection.select("withCommit");
9795        query = query.arg_lazy(
9796            "changes",
9797            Box::new(move || {
9798                let changes = changes.clone();
9799                Box::pin(async move { changes.into_id().await.unwrap().quote() })
9800            }),
9801        );
9802        query = query.arg("message", message.into());
9803        query = query.arg("date", date.into());
9804        query = query.arg("authorName", author_name.into());
9805        query = query.arg("authorEmail", author_email.into());
9806        GitRef {
9807            proc: self.proc.clone(),
9808            selection: query,
9809            graphql_client: self.graphql_client.clone(),
9810        }
9811    }
9812    /// Create a single-parent commit on this ref by applying a changeset's edits.
9813    /// Three-way merges the changeset against this ref's tree, using its before snapshot as the base. Preserves compatible parent edits and fails on conflicts. Does not modify the input repository or host checkout.
9814    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
9815    ///
9816    /// # Arguments
9817    ///
9818    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
9819    /// * `message` - Commit message.
9820    /// * `date` - RFC3339 author date; also the default committer date.
9821    /// * `author_name` - Author name.
9822    /// * `author_email` - Author email.
9823    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9824    pub fn with_commit_opts<'a>(
9825        &self,
9826        changes: impl IntoID<Id>,
9827        message: impl Into<String>,
9828        date: impl Into<String>,
9829        author_name: impl Into<String>,
9830        author_email: impl Into<String>,
9831        opts: GitRefWithCommitOpts<'a>,
9832    ) -> GitRef {
9833        let mut query = self.selection.select("withCommit");
9834        query = query.arg_lazy(
9835            "changes",
9836            Box::new(move || {
9837                let changes = changes.clone();
9838                Box::pin(async move { changes.into_id().await.unwrap().quote() })
9839            }),
9840        );
9841        query = query.arg("message", message.into());
9842        query = query.arg("date", date.into());
9843        query = query.arg("authorName", author_name.into());
9844        query = query.arg("authorEmail", author_email.into());
9845        if let Some(committer_name) = opts.committer_name {
9846            query = query.arg("committerName", committer_name);
9847        }
9848        if let Some(committer_email) = opts.committer_email {
9849            query = query.arg("committerEmail", committer_email);
9850        }
9851        if let Some(committer_date) = opts.committer_date {
9852            query = query.arg("committerDate", committer_date);
9853        }
9854        if let Some(allow_empty) = opts.allow_empty {
9855            query = query.arg("allowEmpty", allow_empty);
9856        }
9857        if let Some(signoff) = opts.signoff {
9858            query = query.arg("signoff", signoff);
9859        }
9860        GitRef {
9861            proc: self.proc.clone(),
9862            selection: query,
9863            graphql_client: self.graphql_client.clone(),
9864        }
9865    }
9866}
9867impl Node for GitRef {
9868    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9869        let query = self.selection.select("id");
9870        let graphql_client = self.graphql_client.clone();
9871        async move { query.execute(graphql_client).await }
9872    }
9873}
9874#[derive(Clone)]
9875pub struct GitRepository {
9876    pub proc: Option<Arc<DaggerSessionProc>>,
9877    pub selection: Selection,
9878    pub graphql_client: DynGraphQLClient,
9879}
9880#[derive(Builder, Debug, PartialEq)]
9881pub struct GitRepositoryAsWorkspaceOpts<'a> {
9882    /// Current working directory inside the workspace root. Defaults to the workspace root.
9883    #[builder(setter(into, strip_option), default)]
9884    pub cwd: Option<&'a str>,
9885}
9886#[derive(Builder, Debug, PartialEq)]
9887pub struct GitRepositoryBranchesOpts<'a> {
9888    /// Glob patterns (e.g., "refs/tags/v*").
9889    #[builder(setter(into, strip_option), default)]
9890    pub patterns: Option<Vec<&'a str>>,
9891}
9892#[derive(Builder, Debug, PartialEq)]
9893pub struct GitRepositoryBundleOpts {
9894    /// A Git ref whose reachable objects are omitted and recorded as a prerequisite.
9895    #[builder(setter(into, strip_option), default)]
9896    pub base: Option<Id>,
9897}
9898#[derive(Builder, Debug, PartialEq)]
9899pub struct GitRepositoryLatestOpts<'a> {
9900    /// Version query used to select the greatest matching release ref.
9901    #[builder(setter(into, strip_option), default)]
9902    pub version: Option<&'a str>,
9903}
9904#[derive(Builder, Debug, PartialEq)]
9905pub struct GitRepositoryTagsOpts<'a> {
9906    /// Glob patterns (e.g., "refs/tags/v*").
9907    #[builder(setter(into, strip_option), default)]
9908    pub patterns: Option<Vec<&'a str>>,
9909}
9910#[derive(Builder, Debug, PartialEq)]
9911pub struct GitRepositoryWithBundleOpts<'a> {
9912    /// An optional remote ref hint for fetching a prerequisite when the remote does not allow fetches by object ID.
9913    #[builder(setter(into, strip_option), default)]
9914    pub prerequisite_ref: Option<&'a str>,
9915}
9916#[derive(Builder, Debug, PartialEq)]
9917pub struct GitRepositoryWithRemoteOpts<'a> {
9918    /// Push destination, when pushes go somewhere other than url. Empty uses url.
9919    #[builder(setter(into, strip_option), default)]
9920    pub push_url: Option<&'a str>,
9921}
9922impl IntoID<Id> for GitRepository {
9923    fn into_id(
9924        self,
9925    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9926        Box::pin(async move { self.id().await })
9927    }
9928}
9929impl Loadable for GitRepository {
9930    fn graphql_type() -> &'static str {
9931        "GitRepository"
9932    }
9933    fn from_query(
9934        proc: Option<Arc<DaggerSessionProc>>,
9935        selection: Selection,
9936        graphql_client: DynGraphQLClient,
9937    ) -> Self {
9938        Self {
9939            proc,
9940            selection,
9941            graphql_client,
9942        }
9943    }
9944}
9945impl GitRepository {
9946    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
9947    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
9948    ///
9949    /// # Arguments
9950    ///
9951    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9952    pub fn as_workspace(&self) -> Workspace {
9953        let query = self.selection.select("asWorkspace");
9954        Workspace {
9955            proc: self.proc.clone(),
9956            selection: query,
9957            graphql_client: self.graphql_client.clone(),
9958        }
9959    }
9960    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
9961    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
9962    ///
9963    /// # Arguments
9964    ///
9965    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9966    pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
9967        let mut query = self.selection.select("asWorkspace");
9968        if let Some(cwd) = opts.cwd {
9969            query = query.arg("cwd", cwd);
9970        }
9971        Workspace {
9972            proc: self.proc.clone(),
9973            selection: query,
9974            graphql_client: self.graphql_client.clone(),
9975        }
9976    }
9977    /// Returns details of a branch.
9978    ///
9979    /// # Arguments
9980    ///
9981    /// * `name` - Branch's name (e.g., "main").
9982    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9983        let mut query = self.selection.select("branch");
9984        query = query.arg("name", name.into());
9985        GitRef {
9986            proc: self.proc.clone(),
9987            selection: query,
9988            graphql_client: self.graphql_client.clone(),
9989        }
9990    }
9991    /// branches that match any of the given glob patterns.
9992    ///
9993    /// # Arguments
9994    ///
9995    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9996    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9997        let query = self.selection.select("branches");
9998        query.execute(self.graphql_client.clone()).await
9999    }
10000    /// branches that match any of the given glob patterns.
10001    ///
10002    /// # Arguments
10003    ///
10004    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10005    pub async fn branches_opts<'a>(
10006        &self,
10007        opts: GitRepositoryBranchesOpts<'a>,
10008    ) -> Result<Vec<String>, DaggerError> {
10009        let mut query = self.selection.select("branches");
10010        if let Some(patterns) = opts.patterns {
10011            query = query.arg("patterns", patterns);
10012        }
10013        query.execute(self.graphql_client.clone()).await
10014    }
10015    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
10016    ///
10017    /// # Arguments
10018    ///
10019    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
10020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10021    pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
10022        let mut query = self.selection.select("bundle");
10023        query = query.arg(
10024            "refs",
10025            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10026        );
10027        GitBundle {
10028            proc: self.proc.clone(),
10029            selection: query,
10030            graphql_client: self.graphql_client.clone(),
10031        }
10032    }
10033    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
10034    ///
10035    /// # Arguments
10036    ///
10037    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
10038    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10039    pub fn bundle_opts(
10040        &self,
10041        refs: Vec<impl Into<String>>,
10042        opts: GitRepositoryBundleOpts,
10043    ) -> GitBundle {
10044        let mut query = self.selection.select("bundle");
10045        query = query.arg(
10046            "refs",
10047            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10048        );
10049        if let Some(base) = opts.base {
10050            query = query.arg("base", base);
10051        }
10052        GitBundle {
10053            proc: self.proc.clone(),
10054            selection: query,
10055            graphql_client: self.graphql_client.clone(),
10056        }
10057    }
10058    /// Returns details of a commit.
10059    ///
10060    /// # Arguments
10061    ///
10062    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
10063    ///
10064    /// May be abbreviated to an unambiguous hex prefix (4-40 characters), which is expanded against locally available objects. Remote repositories (resolved via ls-remote) can only expand prefixes of already-fetched commits; use the full SHA otherwise.
10065    pub fn commit(&self, id: impl Into<String>) -> GitCommit {
10066        let mut query = self.selection.select("commit");
10067        query = query.arg("id", id.into());
10068        GitCommit {
10069            proc: self.proc.clone(),
10070            selection: query,
10071            graphql_client: self.graphql_client.clone(),
10072        }
10073    }
10074    /// Returns details for HEAD.
10075    pub fn head(&self) -> GitRef {
10076        let query = self.selection.select("head");
10077        GitRef {
10078            proc: self.proc.clone(),
10079            selection: query,
10080            graphql_client: self.graphql_client.clone(),
10081        }
10082    }
10083    /// A unique identifier for this GitRepository.
10084    pub async fn id(&self) -> Result<Id, DaggerError> {
10085        let query = self.selection.select("id");
10086        query.execute(self.graphql_client.clone()).await
10087    }
10088    /// Return the latest stable release tag, falling back to HEAD when no release exists.
10089    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned.
10090    ///
10091    /// # Arguments
10092    ///
10093    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10094    pub fn latest(&self) -> GitRef {
10095        let query = self.selection.select("latest");
10096        GitRef {
10097            proc: self.proc.clone(),
10098            selection: query,
10099            graphql_client: self.graphql_client.clone(),
10100        }
10101    }
10102    /// Return the latest stable release tag, falling back to HEAD when no release exists.
10103    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned.
10104    ///
10105    /// # Arguments
10106    ///
10107    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10108    pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
10109        let mut query = self.selection.select("latest");
10110        if let Some(version) = opts.version {
10111            query = query.arg("version", version);
10112        }
10113        GitRef {
10114            proc: self.proc.clone(),
10115            selection: query,
10116            graphql_client: self.graphql_client.clone(),
10117        }
10118    }
10119    /// Returns details of a ref.
10120    ///
10121    /// # Arguments
10122    ///
10123    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10124    ///
10125    /// Commit identifiers may be abbreviated: an unambiguous hex prefix (4-40 characters) of a commit SHA resolves like git rev-parse, with named refs taking precedence. Abbreviated SHAs resolve against locally available objects, so remote repositories (resolved via ls-remote) can only expand prefixes of already-fetched commits; use the full SHA or a named ref otherwise.
10126    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10127        let mut query = self.selection.select("ref");
10128        query = query.arg("name", name.into());
10129        GitRef {
10130            proc: self.proc.clone(),
10131            selection: query,
10132            graphql_client: self.graphql_client.clone(),
10133        }
10134    }
10135    /// Returns details of a tag.
10136    ///
10137    /// # Arguments
10138    ///
10139    /// * `name` - Tag's name (e.g., "v0.3.9").
10140    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10141        let mut query = self.selection.select("tag");
10142        query = query.arg("name", name.into());
10143        GitRef {
10144            proc: self.proc.clone(),
10145            selection: query,
10146            graphql_client: self.graphql_client.clone(),
10147        }
10148    }
10149    /// tags that match any of the given glob patterns.
10150    ///
10151    /// # Arguments
10152    ///
10153    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10154    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10155        let query = self.selection.select("tags");
10156        query.execute(self.graphql_client.clone()).await
10157    }
10158    /// tags that match any of the given glob patterns.
10159    ///
10160    /// # Arguments
10161    ///
10162    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10163    pub async fn tags_opts<'a>(
10164        &self,
10165        opts: GitRepositoryTagsOpts<'a>,
10166    ) -> Result<Vec<String>, DaggerError> {
10167        let mut query = self.selection.select("tags");
10168        if let Some(patterns) = opts.patterns {
10169            query = query.arg("patterns", patterns);
10170        }
10171        query.execute(self.graphql_client.clone()).await
10172    }
10173    /// Returns the changeset of uncommitted changes in the git repository.
10174    pub fn uncommitted(&self) -> Changeset {
10175        let query = self.selection.select("uncommitted");
10176        Changeset {
10177            proc: self.proc.clone(),
10178            selection: query,
10179            graphql_client: self.graphql_client.clone(),
10180        }
10181    }
10182    /// The URL of the git repository.
10183    pub async fn url(&self) -> Result<String, DaggerError> {
10184        let query = self.selection.select("url");
10185        query.execute(self.graphql_client.clone()).await
10186    }
10187    /// Import a Git bundle after fetching and verifying all of its prerequisites.
10188    ///
10189    /// # Arguments
10190    ///
10191    /// * `bundle` - The Git bundle to import.
10192    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10193    pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
10194        let mut query = self.selection.select("withBundle");
10195        query = query.arg_lazy(
10196            "bundle",
10197            Box::new(move || {
10198                let bundle = bundle.clone();
10199                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
10200            }),
10201        );
10202        GitRepository {
10203            proc: self.proc.clone(),
10204            selection: query,
10205            graphql_client: self.graphql_client.clone(),
10206        }
10207    }
10208    /// Import a Git bundle after fetching and verifying all of its prerequisites.
10209    ///
10210    /// # Arguments
10211    ///
10212    /// * `bundle` - The Git bundle to import.
10213    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10214    pub fn with_bundle_opts<'a>(
10215        &self,
10216        bundle: impl IntoID<Id>,
10217        opts: GitRepositoryWithBundleOpts<'a>,
10218    ) -> GitRepository {
10219        let mut query = self.selection.select("withBundle");
10220        query = query.arg_lazy(
10221            "bundle",
10222            Box::new(move || {
10223                let bundle = bundle.clone();
10224                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
10225            }),
10226        );
10227        if let Some(prerequisite_ref) = opts.prerequisite_ref {
10228            query = query.arg("prerequisiteRef", prerequisite_ref);
10229        }
10230        GitRepository {
10231            proc: self.proc.clone(),
10232            selection: query,
10233            graphql_client: self.graphql_client.clone(),
10234        }
10235    }
10236    /// Replace this repository's storage with the supplied self-contained Git repository, retaining its logical URL and push destinations.
10237    /// Accepts a whole checkout (including .git and pending file edits), .git contents, or a bare repository. Does not initialize a repository, merge histories, or modify either input.
10238    /// The receiver's logical routing wins over the supplied Git configuration; that configuration is not rewritten. Use Directory.asGit to open the supplied repository without retaining the receiver's routing.
10239    ///
10240    /// # Arguments
10241    ///
10242    /// * `directory` - Existing Git storage to open. Git metadata and object dependencies must be contained in this directory.
10243    pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
10244        let mut query = self.selection.select("withContents");
10245        query = query.arg_lazy(
10246            "directory",
10247            Box::new(move || {
10248                let directory = directory.clone();
10249                Box::pin(async move { directory.into_id().await.unwrap().quote() })
10250            }),
10251        );
10252        GitRepository {
10253            proc: self.proc.clone(),
10254            selection: query,
10255            graphql_client: self.graphql_client.clone(),
10256        }
10257    }
10258    /// Register a named remote on this repository, replacing any registered remote of the same name.
10259    /// Registered remotes are recorded in checkouts materialized from this repository (GitRef.tree, Workspace.git.directory), so remote-aware tooling like gh can resolve and fetch from them. The origin remote also routes push when no explicit destination is passed: its push URL, or its URL, becomes the default destination.
10260    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
10261    ///
10262    /// # Arguments
10263    ///
10264    /// * `name` - The remote's name, e.g. "origin" or "upstream".
10265    /// * `url` - The remote's fetch URL.
10266    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10267    pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
10268        let mut query = self.selection.select("withRemote");
10269        query = query.arg("name", name.into());
10270        query = query.arg("url", url.into());
10271        GitRepository {
10272            proc: self.proc.clone(),
10273            selection: query,
10274            graphql_client: self.graphql_client.clone(),
10275        }
10276    }
10277    /// Register a named remote on this repository, replacing any registered remote of the same name.
10278    /// Registered remotes are recorded in checkouts materialized from this repository (GitRef.tree, Workspace.git.directory), so remote-aware tooling like gh can resolve and fetch from them. The origin remote also routes push when no explicit destination is passed: its push URL, or its URL, becomes the default destination.
10279    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
10280    ///
10281    /// # Arguments
10282    ///
10283    /// * `name` - The remote's name, e.g. "origin" or "upstream".
10284    /// * `url` - The remote's fetch URL.
10285    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10286    pub fn with_remote_opts<'a>(
10287        &self,
10288        name: impl Into<String>,
10289        url: impl Into<String>,
10290        opts: GitRepositoryWithRemoteOpts<'a>,
10291    ) -> GitRepository {
10292        let mut query = self.selection.select("withRemote");
10293        query = query.arg("name", name.into());
10294        query = query.arg("url", url.into());
10295        if let Some(push_url) = opts.push_url {
10296            query = query.arg("pushUrl", push_url);
10297        }
10298        GitRepository {
10299            proc: self.proc.clone(),
10300            selection: query,
10301            graphql_client: self.graphql_client.clone(),
10302        }
10303    }
10304}
10305impl Node for GitRepository {
10306    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10307        let query = self.selection.select("id");
10308        let graphql_client = self.graphql_client.clone();
10309        async move { query.execute(graphql_client).await }
10310    }
10311}
10312#[derive(Clone)]
10313pub struct HttpState {
10314    pub proc: Option<Arc<DaggerSessionProc>>,
10315    pub selection: Selection,
10316    pub graphql_client: DynGraphQLClient,
10317}
10318impl IntoID<Id> for HttpState {
10319    fn into_id(
10320        self,
10321    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10322        Box::pin(async move { self.id().await })
10323    }
10324}
10325impl Loadable for HttpState {
10326    fn graphql_type() -> &'static str {
10327        "HTTPState"
10328    }
10329    fn from_query(
10330        proc: Option<Arc<DaggerSessionProc>>,
10331        selection: Selection,
10332        graphql_client: DynGraphQLClient,
10333    ) -> Self {
10334        Self {
10335            proc,
10336            selection,
10337            graphql_client,
10338        }
10339    }
10340}
10341impl HttpState {
10342    /// A unique identifier for this HTTPState.
10343    pub async fn id(&self) -> Result<Id, DaggerError> {
10344        let query = self.selection.select("id");
10345        query.execute(self.graphql_client.clone()).await
10346    }
10347}
10348impl Node for HttpState {
10349    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10350        let query = self.selection.select("id");
10351        let graphql_client = self.graphql_client.clone();
10352        async move { query.execute(graphql_client).await }
10353    }
10354}
10355#[derive(Clone)]
10356pub struct HealthcheckConfig {
10357    pub proc: Option<Arc<DaggerSessionProc>>,
10358    pub selection: Selection,
10359    pub graphql_client: DynGraphQLClient,
10360}
10361impl IntoID<Id> for HealthcheckConfig {
10362    fn into_id(
10363        self,
10364    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10365        Box::pin(async move { self.id().await })
10366    }
10367}
10368impl Loadable for HealthcheckConfig {
10369    fn graphql_type() -> &'static str {
10370        "HealthcheckConfig"
10371    }
10372    fn from_query(
10373        proc: Option<Arc<DaggerSessionProc>>,
10374        selection: Selection,
10375        graphql_client: DynGraphQLClient,
10376    ) -> Self {
10377        Self {
10378            proc,
10379            selection,
10380            graphql_client,
10381        }
10382    }
10383}
10384impl HealthcheckConfig {
10385    /// Healthcheck command arguments.
10386    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10387        let query = self.selection.select("args");
10388        query.execute(self.graphql_client.clone()).await
10389    }
10390    /// A unique identifier for this HealthcheckConfig.
10391    pub async fn id(&self) -> Result<Id, DaggerError> {
10392        let query = self.selection.select("id");
10393        query.execute(self.graphql_client.clone()).await
10394    }
10395    /// Interval between running healthcheck. Example:30s
10396    pub async fn interval(&self) -> Result<String, DaggerError> {
10397        let query = self.selection.select("interval");
10398        query.execute(self.graphql_client.clone()).await
10399    }
10400    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10401    pub async fn retries(&self) -> Result<isize, DaggerError> {
10402        let query = self.selection.select("retries");
10403        query.execute(self.graphql_client.clone()).await
10404    }
10405    /// Healthcheck command is a shell command.
10406    pub async fn shell(&self) -> Result<bool, DaggerError> {
10407        let query = self.selection.select("shell");
10408        query.execute(self.graphql_client.clone()).await
10409    }
10410    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10411    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10412        let query = self.selection.select("startInterval");
10413        query.execute(self.graphql_client.clone()).await
10414    }
10415    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10416    pub async fn start_period(&self) -> Result<String, DaggerError> {
10417        let query = self.selection.select("startPeriod");
10418        query.execute(self.graphql_client.clone()).await
10419    }
10420    /// Healthcheck timeout. Example:3s
10421    pub async fn timeout(&self) -> Result<String, DaggerError> {
10422        let query = self.selection.select("timeout");
10423        query.execute(self.graphql_client.clone()).await
10424    }
10425}
10426impl Node for HealthcheckConfig {
10427    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10428        let query = self.selection.select("id");
10429        let graphql_client = self.graphql_client.clone();
10430        async move { query.execute(graphql_client).await }
10431    }
10432}
10433#[derive(Clone)]
10434pub struct Host {
10435    pub proc: Option<Arc<DaggerSessionProc>>,
10436    pub selection: Selection,
10437    pub graphql_client: DynGraphQLClient,
10438}
10439#[derive(Builder, Debug, PartialEq)]
10440pub struct HostDirectoryOpts<'a> {
10441    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10442    #[builder(setter(into, strip_option), default)]
10443    pub exclude: Option<Vec<&'a str>>,
10444    /// Apply .gitignore filter rules inside the directory
10445    #[builder(setter(into, strip_option), default)]
10446    pub gitignore: Option<bool>,
10447    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10448    #[builder(setter(into, strip_option), default)]
10449    pub include: Option<Vec<&'a str>>,
10450    /// If true, the directory will always be reloaded from the host.
10451    #[builder(setter(into, strip_option), default)]
10452    pub no_cache: Option<bool>,
10453}
10454#[derive(Builder, Debug, PartialEq)]
10455pub struct HostFileOpts {
10456    /// If true, the file will always be reloaded from the host.
10457    #[builder(setter(into, strip_option), default)]
10458    pub no_cache: Option<bool>,
10459}
10460#[derive(Builder, Debug, PartialEq)]
10461pub struct HostFindUpOpts {
10462    #[builder(setter(into, strip_option), default)]
10463    pub no_cache: Option<bool>,
10464}
10465#[derive(Builder, Debug, PartialEq)]
10466pub struct HostServiceOpts<'a> {
10467    /// Upstream host to forward traffic to.
10468    #[builder(setter(into, strip_option), default)]
10469    pub host: Option<&'a str>,
10470}
10471#[derive(Builder, Debug, PartialEq)]
10472pub struct HostTunnelOpts {
10473    /// Map each service port to the same port on the host, as if the service were running natively.
10474    /// Note: enabling may result in port conflicts.
10475    #[builder(setter(into, strip_option), default)]
10476    pub native: Option<bool>,
10477    /// Configure explicit port forwarding rules for the tunnel.
10478    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10479    /// If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
10480    /// If ports are given and native is true, the ports are additive.
10481    #[builder(setter(into, strip_option), default)]
10482    pub ports: Option<Vec<PortForward>>,
10483}
10484impl IntoID<Id> for Host {
10485    fn into_id(
10486        self,
10487    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10488        Box::pin(async move { self.id().await })
10489    }
10490}
10491impl Loadable for Host {
10492    fn graphql_type() -> &'static str {
10493        "Host"
10494    }
10495    fn from_query(
10496        proc: Option<Arc<DaggerSessionProc>>,
10497        selection: Selection,
10498        graphql_client: DynGraphQLClient,
10499    ) -> Self {
10500        Self {
10501            proc,
10502            selection,
10503            graphql_client,
10504        }
10505    }
10506}
10507impl Host {
10508    /// Accesses a container image on the host.
10509    ///
10510    /// # Arguments
10511    ///
10512    /// * `name` - Name of the image to access.
10513    pub fn container_image(&self, name: impl Into<String>) -> Container {
10514        let mut query = self.selection.select("containerImage");
10515        query = query.arg("name", name.into());
10516        Container {
10517            proc: self.proc.clone(),
10518            selection: query,
10519            graphql_client: self.graphql_client.clone(),
10520        }
10521    }
10522    /// Accesses a directory on the host.
10523    ///
10524    /// # Arguments
10525    ///
10526    /// * `path` - Location of the directory to access (e.g., ".").
10527    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10528    pub fn directory(&self, path: impl Into<String>) -> Directory {
10529        let mut query = self.selection.select("directory");
10530        query = query.arg("path", path.into());
10531        Directory {
10532            proc: self.proc.clone(),
10533            selection: query,
10534            graphql_client: self.graphql_client.clone(),
10535        }
10536    }
10537    /// Accesses a directory on the host.
10538    ///
10539    /// # Arguments
10540    ///
10541    /// * `path` - Location of the directory to access (e.g., ".").
10542    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10543    pub fn directory_opts<'a>(
10544        &self,
10545        path: impl Into<String>,
10546        opts: HostDirectoryOpts<'a>,
10547    ) -> Directory {
10548        let mut query = self.selection.select("directory");
10549        query = query.arg("path", path.into());
10550        if let Some(exclude) = opts.exclude {
10551            query = query.arg("exclude", exclude);
10552        }
10553        if let Some(include) = opts.include {
10554            query = query.arg("include", include);
10555        }
10556        if let Some(no_cache) = opts.no_cache {
10557            query = query.arg("noCache", no_cache);
10558        }
10559        if let Some(gitignore) = opts.gitignore {
10560            query = query.arg("gitignore", gitignore);
10561        }
10562        Directory {
10563            proc: self.proc.clone(),
10564            selection: query,
10565            graphql_client: self.graphql_client.clone(),
10566        }
10567    }
10568    /// Accesses a file on the host.
10569    ///
10570    /// # Arguments
10571    ///
10572    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10574    pub fn file(&self, path: impl Into<String>) -> File {
10575        let mut query = self.selection.select("file");
10576        query = query.arg("path", path.into());
10577        File {
10578            proc: self.proc.clone(),
10579            selection: query,
10580            graphql_client: self.graphql_client.clone(),
10581        }
10582    }
10583    /// Accesses a file on the host.
10584    ///
10585    /// # Arguments
10586    ///
10587    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10588    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10589    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10590        let mut query = self.selection.select("file");
10591        query = query.arg("path", path.into());
10592        if let Some(no_cache) = opts.no_cache {
10593            query = query.arg("noCache", no_cache);
10594        }
10595        File {
10596            proc: self.proc.clone(),
10597            selection: query,
10598            graphql_client: self.graphql_client.clone(),
10599        }
10600    }
10601    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10602    ///
10603    /// # Arguments
10604    ///
10605    /// * `name` - name of the file or directory to search for
10606    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10607    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10608        let mut query = self.selection.select("findUp");
10609        query = query.arg("name", name.into());
10610        query.execute(self.graphql_client.clone()).await
10611    }
10612    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10613    ///
10614    /// # Arguments
10615    ///
10616    /// * `name` - name of the file or directory to search for
10617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10618    pub async fn find_up_opts(
10619        &self,
10620        name: impl Into<String>,
10621        opts: HostFindUpOpts,
10622    ) -> Result<String, DaggerError> {
10623        let mut query = self.selection.select("findUp");
10624        query = query.arg("name", name.into());
10625        if let Some(no_cache) = opts.no_cache {
10626            query = query.arg("noCache", no_cache);
10627        }
10628        query.execute(self.graphql_client.clone()).await
10629    }
10630    /// A unique identifier for this Host.
10631    pub async fn id(&self) -> Result<Id, DaggerError> {
10632        let query = self.selection.select("id");
10633        query.execute(self.graphql_client.clone()).await
10634    }
10635    /// Creates a service that forwards traffic to a specified address via the host.
10636    ///
10637    /// # Arguments
10638    ///
10639    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10640    ///
10641    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10642    ///
10643    /// An empty set of ports is not valid; an error will be returned.
10644    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10645    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10646        let mut query = self.selection.select("service");
10647        query = query.arg("ports", ports);
10648        Service {
10649            proc: self.proc.clone(),
10650            selection: query,
10651            graphql_client: self.graphql_client.clone(),
10652        }
10653    }
10654    /// Creates a service that forwards traffic to a specified address via the host.
10655    ///
10656    /// # Arguments
10657    ///
10658    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10659    ///
10660    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10661    ///
10662    /// An empty set of ports is not valid; an error will be returned.
10663    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10664    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10665        let mut query = self.selection.select("service");
10666        query = query.arg("ports", ports);
10667        if let Some(host) = opts.host {
10668            query = query.arg("host", host);
10669        }
10670        Service {
10671            proc: self.proc.clone(),
10672            selection: query,
10673            graphql_client: self.graphql_client.clone(),
10674        }
10675    }
10676    /// Creates a tunnel that forwards traffic from the host to a service.
10677    ///
10678    /// # Arguments
10679    ///
10680    /// * `service` - Service to send traffic from the tunnel.
10681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10682    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10683        let mut query = self.selection.select("tunnel");
10684        query = query.arg_lazy(
10685            "service",
10686            Box::new(move || {
10687                let service = service.clone();
10688                Box::pin(async move { service.into_id().await.unwrap().quote() })
10689            }),
10690        );
10691        Service {
10692            proc: self.proc.clone(),
10693            selection: query,
10694            graphql_client: self.graphql_client.clone(),
10695        }
10696    }
10697    /// Creates a tunnel that forwards traffic from the host to a service.
10698    ///
10699    /// # Arguments
10700    ///
10701    /// * `service` - Service to send traffic from the tunnel.
10702    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10703    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10704        let mut query = self.selection.select("tunnel");
10705        query = query.arg_lazy(
10706            "service",
10707            Box::new(move || {
10708                let service = service.clone();
10709                Box::pin(async move { service.into_id().await.unwrap().quote() })
10710            }),
10711        );
10712        if let Some(native) = opts.native {
10713            query = query.arg("native", native);
10714        }
10715        if let Some(ports) = opts.ports {
10716            query = query.arg("ports", ports);
10717        }
10718        Service {
10719            proc: self.proc.clone(),
10720            selection: query,
10721            graphql_client: self.graphql_client.clone(),
10722        }
10723    }
10724    /// Accesses a Unix socket on the host.
10725    ///
10726    /// # Arguments
10727    ///
10728    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10729    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10730        let mut query = self.selection.select("unixSocket");
10731        query = query.arg("path", path.into());
10732        Socket {
10733            proc: self.proc.clone(),
10734            selection: query,
10735            graphql_client: self.graphql_client.clone(),
10736        }
10737    }
10738}
10739impl Node for Host {
10740    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10741        let query = self.selection.select("id");
10742        let graphql_client = self.graphql_client.clone();
10743        async move { query.execute(graphql_client).await }
10744    }
10745}
10746#[derive(Clone)]
10747pub struct InputTypeDef {
10748    pub proc: Option<Arc<DaggerSessionProc>>,
10749    pub selection: Selection,
10750    pub graphql_client: DynGraphQLClient,
10751}
10752impl IntoID<Id> for InputTypeDef {
10753    fn into_id(
10754        self,
10755    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10756        Box::pin(async move { self.id().await })
10757    }
10758}
10759impl Loadable for InputTypeDef {
10760    fn graphql_type() -> &'static str {
10761        "InputTypeDef"
10762    }
10763    fn from_query(
10764        proc: Option<Arc<DaggerSessionProc>>,
10765        selection: Selection,
10766        graphql_client: DynGraphQLClient,
10767    ) -> Self {
10768        Self {
10769            proc,
10770            selection,
10771            graphql_client,
10772        }
10773    }
10774}
10775impl InputTypeDef {
10776    /// Static fields defined on this input object, if any.
10777    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10778        let query = self.selection.select("fields");
10779        let query = query.select("id");
10780        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10781        Ok(ids
10782            .into_iter()
10783            .map(|id| FieldTypeDef {
10784                proc: self.proc.clone(),
10785                selection: crate::querybuilder::query()
10786                    .select("node")
10787                    .arg("id", &id.0)
10788                    .inline_fragment("FieldTypeDef"),
10789                graphql_client: self.graphql_client.clone(),
10790            })
10791            .collect())
10792    }
10793    /// A unique identifier for this InputTypeDef.
10794    pub async fn id(&self) -> Result<Id, DaggerError> {
10795        let query = self.selection.select("id");
10796        query.execute(self.graphql_client.clone()).await
10797    }
10798    /// The name of the input object.
10799    pub async fn name(&self) -> Result<String, DaggerError> {
10800        let query = self.selection.select("name");
10801        query.execute(self.graphql_client.clone()).await
10802    }
10803}
10804impl Node for InputTypeDef {
10805    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10806        let query = self.selection.select("id");
10807        let graphql_client = self.graphql_client.clone();
10808        async move { query.execute(graphql_client).await }
10809    }
10810}
10811#[derive(Clone)]
10812pub struct InterfaceTypeDef {
10813    pub proc: Option<Arc<DaggerSessionProc>>,
10814    pub selection: Selection,
10815    pub graphql_client: DynGraphQLClient,
10816}
10817impl IntoID<Id> for InterfaceTypeDef {
10818    fn into_id(
10819        self,
10820    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10821        Box::pin(async move { self.id().await })
10822    }
10823}
10824impl Loadable for InterfaceTypeDef {
10825    fn graphql_type() -> &'static str {
10826        "InterfaceTypeDef"
10827    }
10828    fn from_query(
10829        proc: Option<Arc<DaggerSessionProc>>,
10830        selection: Selection,
10831        graphql_client: DynGraphQLClient,
10832    ) -> Self {
10833        Self {
10834            proc,
10835            selection,
10836            graphql_client,
10837        }
10838    }
10839}
10840impl InterfaceTypeDef {
10841    /// The doc string for the interface, if any.
10842    pub async fn description(&self) -> Result<String, DaggerError> {
10843        let query = self.selection.select("description");
10844        query.execute(self.graphql_client.clone()).await
10845    }
10846    /// Functions defined on this interface, if any.
10847    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10848        let query = self.selection.select("functions");
10849        let query = query.select("id");
10850        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10851        Ok(ids
10852            .into_iter()
10853            .map(|id| Function {
10854                proc: self.proc.clone(),
10855                selection: crate::querybuilder::query()
10856                    .select("node")
10857                    .arg("id", &id.0)
10858                    .inline_fragment("Function"),
10859                graphql_client: self.graphql_client.clone(),
10860            })
10861            .collect())
10862    }
10863    /// A unique identifier for this InterfaceTypeDef.
10864    pub async fn id(&self) -> Result<Id, DaggerError> {
10865        let query = self.selection.select("id");
10866        query.execute(self.graphql_client.clone()).await
10867    }
10868    /// The name of the interface.
10869    pub async fn name(&self) -> Result<String, DaggerError> {
10870        let query = self.selection.select("name");
10871        query.execute(self.graphql_client.clone()).await
10872    }
10873    /// The location of this interface declaration.
10874    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
10875        let query = self.selection.select("sourceMap");
10876        let query = query.select("id");
10877        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10878        Ok(id.map(|id| SourceMap {
10879            proc: self.proc.clone(),
10880            selection: query
10881                .root()
10882                .select("node")
10883                .arg("id", &id.0)
10884                .inline_fragment("SourceMap"),
10885            graphql_client: self.graphql_client.clone(),
10886        }))
10887    }
10888    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10889    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10890        let query = self.selection.select("sourceModuleName");
10891        query.execute(self.graphql_client.clone()).await
10892    }
10893}
10894impl Node for InterfaceTypeDef {
10895    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10896        let query = self.selection.select("id");
10897        let graphql_client = self.graphql_client.clone();
10898        async move { query.execute(graphql_client).await }
10899    }
10900}
10901#[derive(Clone)]
10902pub struct JsonValue {
10903    pub proc: Option<Arc<DaggerSessionProc>>,
10904    pub selection: Selection,
10905    pub graphql_client: DynGraphQLClient,
10906}
10907#[derive(Builder, Debug, PartialEq)]
10908pub struct JsonValueContentsOpts<'a> {
10909    /// Optional line prefix
10910    #[builder(setter(into, strip_option), default)]
10911    pub indent: Option<&'a str>,
10912    /// Pretty-print
10913    #[builder(setter(into, strip_option), default)]
10914    pub pretty: Option<bool>,
10915}
10916impl IntoID<Id> for JsonValue {
10917    fn into_id(
10918        self,
10919    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10920        Box::pin(async move { self.id().await })
10921    }
10922}
10923impl Loadable for JsonValue {
10924    fn graphql_type() -> &'static str {
10925        "JSONValue"
10926    }
10927    fn from_query(
10928        proc: Option<Arc<DaggerSessionProc>>,
10929        selection: Selection,
10930        graphql_client: DynGraphQLClient,
10931    ) -> Self {
10932        Self {
10933            proc,
10934            selection,
10935            graphql_client,
10936        }
10937    }
10938}
10939impl JsonValue {
10940    /// Decode an array from json
10941    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10942        let query = self.selection.select("asArray");
10943        let query = query.select("id");
10944        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10945        Ok(ids
10946            .into_iter()
10947            .map(|id| JsonValue {
10948                proc: self.proc.clone(),
10949                selection: crate::querybuilder::query()
10950                    .select("node")
10951                    .arg("id", &id.0)
10952                    .inline_fragment("JSONValue"),
10953                graphql_client: self.graphql_client.clone(),
10954            })
10955            .collect())
10956    }
10957    /// Decode a boolean from json
10958    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10959        let query = self.selection.select("asBoolean");
10960        query.execute(self.graphql_client.clone()).await
10961    }
10962    /// Decode an integer from json
10963    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10964        let query = self.selection.select("asInteger");
10965        query.execute(self.graphql_client.clone()).await
10966    }
10967    /// Decode a string from json
10968    pub async fn as_string(&self) -> Result<String, DaggerError> {
10969        let query = self.selection.select("asString");
10970        query.execute(self.graphql_client.clone()).await
10971    }
10972    /// Return the value encoded as json
10973    ///
10974    /// # Arguments
10975    ///
10976    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10977    pub async fn contents(&self) -> Result<Json, DaggerError> {
10978        let query = self.selection.select("contents");
10979        query.execute(self.graphql_client.clone()).await
10980    }
10981    /// Return the value encoded as json
10982    ///
10983    /// # Arguments
10984    ///
10985    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10986    pub async fn contents_opts<'a>(
10987        &self,
10988        opts: JsonValueContentsOpts<'a>,
10989    ) -> Result<Json, DaggerError> {
10990        let mut query = self.selection.select("contents");
10991        if let Some(pretty) = opts.pretty {
10992            query = query.arg("pretty", pretty);
10993        }
10994        if let Some(indent) = opts.indent {
10995            query = query.arg("indent", indent);
10996        }
10997        query.execute(self.graphql_client.clone()).await
10998    }
10999    /// Lookup the field at the given path, and return its value.
11000    ///
11001    /// # Arguments
11002    ///
11003    /// * `path` - Path of the field to lookup, encoded as an array of field names
11004    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
11005        let mut query = self.selection.select("field");
11006        query = query.arg(
11007            "path",
11008            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11009        );
11010        JsonValue {
11011            proc: self.proc.clone(),
11012            selection: query,
11013            graphql_client: self.graphql_client.clone(),
11014        }
11015    }
11016    /// List fields of the encoded object
11017    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
11018        let query = self.selection.select("fields");
11019        query.execute(self.graphql_client.clone()).await
11020    }
11021    /// A unique identifier for this JSONValue.
11022    pub async fn id(&self) -> Result<Id, DaggerError> {
11023        let query = self.selection.select("id");
11024        query.execute(self.graphql_client.clone()).await
11025    }
11026    /// Encode a boolean to json
11027    ///
11028    /// # Arguments
11029    ///
11030    /// * `value` - New boolean value
11031    pub fn new_boolean(&self, value: bool) -> JsonValue {
11032        let mut query = self.selection.select("newBoolean");
11033        query = query.arg("value", value);
11034        JsonValue {
11035            proc: self.proc.clone(),
11036            selection: query,
11037            graphql_client: self.graphql_client.clone(),
11038        }
11039    }
11040    /// Encode an integer to json
11041    ///
11042    /// # Arguments
11043    ///
11044    /// * `value` - New integer value
11045    pub fn new_integer(&self, value: isize) -> JsonValue {
11046        let mut query = self.selection.select("newInteger");
11047        query = query.arg("value", value);
11048        JsonValue {
11049            proc: self.proc.clone(),
11050            selection: query,
11051            graphql_client: self.graphql_client.clone(),
11052        }
11053    }
11054    /// Encode a string to json
11055    ///
11056    /// # Arguments
11057    ///
11058    /// * `value` - New string value
11059    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
11060        let mut query = self.selection.select("newString");
11061        query = query.arg("value", value.into());
11062        JsonValue {
11063            proc: self.proc.clone(),
11064            selection: query,
11065            graphql_client: self.graphql_client.clone(),
11066        }
11067    }
11068    /// Return a new json value, decoded from the given content
11069    ///
11070    /// # Arguments
11071    ///
11072    /// * `contents` - New JSON-encoded contents
11073    pub fn with_contents(&self, contents: Json) -> JsonValue {
11074        let mut query = self.selection.select("withContents");
11075        query = query.arg("contents", contents);
11076        JsonValue {
11077            proc: self.proc.clone(),
11078            selection: query,
11079            graphql_client: self.graphql_client.clone(),
11080        }
11081    }
11082    /// Set a new field at the given path
11083    ///
11084    /// # Arguments
11085    ///
11086    /// * `path` - Path of the field to set, encoded as an array of field names
11087    /// * `value` - The new value of the field
11088    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
11089        let mut query = self.selection.select("withField");
11090        query = query.arg(
11091            "path",
11092            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11093        );
11094        query = query.arg_lazy(
11095            "value",
11096            Box::new(move || {
11097                let value = value.clone();
11098                Box::pin(async move { value.into_id().await.unwrap().quote() })
11099            }),
11100        );
11101        JsonValue {
11102            proc: self.proc.clone(),
11103            selection: query,
11104            graphql_client: self.graphql_client.clone(),
11105        }
11106    }
11107}
11108impl Node for JsonValue {
11109    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11110        let query = self.selection.select("id");
11111        let graphql_client = self.graphql_client.clone();
11112        async move { query.execute(graphql_client).await }
11113    }
11114}
11115#[derive(Clone)]
11116pub struct Llm {
11117    pub proc: Option<Arc<DaggerSessionProc>>,
11118    pub selection: Selection,
11119    pub graphql_client: DynGraphQLClient,
11120}
11121#[derive(Builder, Debug, PartialEq)]
11122pub struct LlmLoopOpts {
11123    /// Cap the number of steps. The loop fails if the cap is reached before the model ends its turn.
11124    #[builder(setter(into, strip_option), default)]
11125    pub max_steps: Option<isize>,
11126    /// Cap the model's output tokens on each step. Defaults to the model's maximum.
11127    #[builder(setter(into, strip_option), default)]
11128    pub max_tokens: Option<isize>,
11129}
11130#[derive(Builder, Debug, PartialEq)]
11131pub struct LlmSpawnOpts<'a> {
11132    /// The loop error to create the agent with, for state FAILED. Refused with any other state.
11133    #[builder(setter(into, strip_option), default)]
11134    pub error: Option<&'a str>,
11135    /// The runtime handle to restore the instance under, as published on its loop span as dagger.io/agent.id. Omit to mint a fresh instance.
11136    #[builder(setter(into, strip_option), default)]
11137    pub handle: Option<&'a str>,
11138    /// Display label for the agent — telemetry and error messages; carries no identity. Defaults to a short name derived from the conversation.
11139    #[builder(setter(into, strip_option), default)]
11140    pub name: Option<&'a str>,
11141    /// The lifecycle state to create the agent in, as facts on the entry: IDLE is ready to be prompted, PAUSED parks it, FAILED holds an error a resume retries past, STOPPED preserves a dormant snapshot that send or resume can relaunch.
11142    /// RUNNING and WAITING_INPUT are refused: they describe a loop, and a restored loop died with the session that published it — restore such an agent as IDLE, its interrupted turn's input still pending on the conversation.
11143    #[builder(setter(into, strip_option), default)]
11144    pub state: Option<AgentState>,
11145}
11146#[derive(Builder, Debug, PartialEq)]
11147pub struct LlmStepOpts {
11148    /// Cap the model's output tokens for this step. Defaults to the model's maximum.
11149    #[builder(setter(into, strip_option), default)]
11150    pub max_tokens: Option<isize>,
11151}
11152#[derive(Builder, Debug, PartialEq)]
11153pub struct LlmWithModelOpts<'a> {
11154    /// The provider serving the model, e.g. "openai". Overrides the provider otherwise inferred from the model name — useful when the name matches no known pattern (e.g. a fine-tune), or matches the wrong one.
11155    #[builder(setter(into, strip_option), default)]
11156    pub provider: Option<&'a str>,
11157}
11158#[derive(Builder, Debug, PartialEq)]
11159pub struct LlmWithPromptOpts {
11160    /// The message's recorded provenance, when it arrived through an agent mailbox rather than from the user. Rendered to the model as an attribution header at request-build time.
11161    #[builder(setter(into, strip_option), default)]
11162    pub origin: Option<LlmMessageOriginInput>,
11163}
11164#[derive(Builder, Debug, PartialEq)]
11165pub struct LlmWithResponseOpts {
11166    /// Cached input tokens read
11167    #[builder(setter(into, strip_option), default)]
11168    pub cached_token_reads: Option<isize>,
11169    /// Cached input tokens written
11170    #[builder(setter(into, strip_option), default)]
11171    pub cached_token_writes: Option<isize>,
11172    /// Uncached input tokens sent
11173    #[builder(setter(into, strip_option), default)]
11174    pub input_tokens: Option<isize>,
11175    /// Tokens received from the model, including text and tool calls
11176    #[builder(setter(into, strip_option), default)]
11177    pub output_tokens: Option<isize>,
11178    /// Total tokens consumed by this response
11179    #[builder(setter(into, strip_option), default)]
11180    pub total_tokens: Option<isize>,
11181}
11182#[derive(Builder, Debug, PartialEq)]
11183pub struct LlmWithToolsOpts<'a> {
11184    /// Method names to exclude from the toolset (e.g. constructors, entrypoints).
11185    #[builder(setter(into, strip_option), default)]
11186    pub except: Option<Vec<&'a str>>,
11187}
11188impl IntoID<Id> for Llm {
11189    fn into_id(
11190        self,
11191    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11192        Box::pin(async move { self.id().await })
11193    }
11194}
11195impl Loadable for Llm {
11196    fn graphql_type() -> &'static str {
11197        "LLM"
11198    }
11199    fn from_query(
11200        proc: Option<Arc<DaggerSessionProc>>,
11201        selection: Selection,
11202        graphql_client: DynGraphQLClient,
11203    ) -> Self {
11204        Self {
11205            proc,
11206            selection,
11207            graphql_client,
11208        }
11209    }
11210}
11211impl Llm {
11212    /// Reconstruct a spawned agent from its runtime handle.
11213    /// This is the lookup spawn pins its result's identity through: the returned handle's ID is an honest, replayable chain denoting the one instance the spawn minted. It never creates an instance itself.
11214    ///
11215    /// # Arguments
11216    ///
11217    /// * `handle` - The opaque runtime handle minted by the spawn that created the agent.
11218    /// * `name` - The agent's display name, as recorded by the spawn.
11219    pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
11220        let mut query = self.selection.select("agent");
11221        query = query.arg("handle", handle.into());
11222        query = query.arg("name", name.into());
11223        Agent {
11224            proc: self.proc.clone(),
11225            selection: query,
11226            graphql_client: self.graphql_client.clone(),
11227        }
11228    }
11229    /// estimated number of tokens currently occupying the context window; unlike tokenUsage this is not cumulative over the session
11230    pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
11231        let query = self.selection.select("contextTokens");
11232        query.execute(self.graphql_client.clone()).await
11233    }
11234    /// The model's total context window in tokens, or null if unknown (e.g. a local or uncatalogued model).
11235    pub async fn context_window(&self) -> Result<isize, DaggerError> {
11236        let query = self.selection.select("contextWindow");
11237        query.execute(self.graphql_client.clone()).await
11238    }
11239    /// Fork the conversation, so that otherwise-identical follow-ups evaluate independently instead of deduplicating to a single cached result.
11240    ///
11241    /// # Arguments
11242    ///
11243    /// * `label` - A label distinguishing this fork from its siblings, e.g. "attempt-2" when retrying a flaky evaluation.
11244    pub fn fork(&self, label: impl Into<String>) -> Llm {
11245        let mut query = self.selection.select("fork");
11246        query = query.arg("label", label.into());
11247        Llm {
11248            proc: self.proc.clone(),
11249            selection: query,
11250            graphql_client: self.graphql_client.clone(),
11251        }
11252    }
11253    /// Report whether anything is queued to send to the model: an unsent prompt or unevaluated tool results. When true, another step will do work; when false, the turn is complete.
11254    pub async fn has_pending(&self) -> Result<bool, DaggerError> {
11255        let query = self.selection.select("hasPending");
11256        query.execute(self.graphql_client.clone()).await
11257    }
11258    /// A unique identifier for this LLM.
11259    pub async fn id(&self) -> Result<Id, DaggerError> {
11260        let query = self.selection.select("id");
11261        query.execute(self.graphql_client.clone()).await
11262    }
11263    /// The text of the model's most recent reply.
11264    pub async fn last_reply(&self) -> Result<String, DaggerError> {
11265        let query = self.selection.select("lastReply");
11266        query.execute(self.graphql_client.clone()).await
11267    }
11268    /// Send the queued prompt and step the model against the available tools, until it ends its turn: a reply with no tool calls and nothing left queued.
11269    ///
11270    /// # Arguments
11271    ///
11272    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11273    pub fn r#loop(&self) -> Llm {
11274        let query = self.selection.select("loop");
11275        Llm {
11276            proc: self.proc.clone(),
11277            selection: query,
11278            graphql_client: self.graphql_client.clone(),
11279        }
11280    }
11281    /// Send the queued prompt and step the model against the available tools, until it ends its turn: a reply with no tool calls and nothing left queued.
11282    ///
11283    /// # Arguments
11284    ///
11285    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11286    pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
11287        let mut query = self.selection.select("loop");
11288        if let Some(max_steps) = opts.max_steps {
11289            query = query.arg("maxSteps", max_steps);
11290        }
11291        if let Some(max_tokens) = opts.max_tokens {
11292            query = query.arg("maxTokens", max_tokens);
11293        }
11294        Llm {
11295            proc: self.proc.clone(),
11296            selection: query,
11297            graphql_client: self.graphql_client.clone(),
11298        }
11299    }
11300    /// The full message history, as structured messages.
11301    pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
11302        let query = self.selection.select("messages");
11303        let query = query.select("id");
11304        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11305        Ok(ids
11306            .into_iter()
11307            .map(|id| LlmMessage {
11308                proc: self.proc.clone(),
11309                selection: crate::querybuilder::query()
11310                    .select("node")
11311                    .arg("id", &id.0)
11312                    .inline_fragment("LLMMessage"),
11313                graphql_client: self.graphql_client.clone(),
11314            })
11315            .collect())
11316    }
11317    /// The model the conversation is running against, after resolving any configured default.
11318    pub async fn model(&self) -> Result<String, DaggerError> {
11319        let query = self.selection.select("model");
11320        query.execute(self.graphql_client.clone()).await
11321    }
11322    /// A portable, self-contained ID for the conversation that node() can resolve in any session. Unlike id, which may return an engine-local runtime handle valid only within the current session, this returns the recipe form suitable for persisting and later restoring the conversation. The recipe is flattened: bindings superseded during the session (workspace overlays recorded by each mutating tool call, and re-bound toolsets) are dropped, while the current workspace binding — including any pending, un-exported edits — is preserved.
11323    pub async fn portable_id(&self) -> Result<Id, DaggerError> {
11324        let query = self.selection.select("portableID");
11325        query.execute(self.graphql_client.clone()).await
11326    }
11327    /// The provider serving the model, e.g. "anthropic", "openai", "google", or "local".
11328    pub async fn provider(&self) -> Result<String, DaggerError> {
11329        let query = self.selection.select("provider");
11330        query.execute(self.graphql_client.clone()).await
11331    }
11332    /// The reasoning effort in use, e.g. "low", "medium", or "high". Empty or "none" when reasoning is disabled.
11333    pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
11334        let query = self.selection.select("reasoningEffort");
11335        query.execute(self.graphql_client.clone()).await
11336    }
11337    /// Re-emit telemetry spans for the full message history, so a loaded conversation displays in the TUI.
11338    pub async fn replay(&self) -> Result<Llm, DaggerError> {
11339        let query = self.selection.select("replay");
11340        let id: Id = query.execute(self.graphql_client.clone()).await?;
11341        Ok(Llm {
11342            proc: self.proc.clone(),
11343            selection: query
11344                .root()
11345                .select("node")
11346                .arg("id", &id.0)
11347                .inline_fragment("LLM"),
11348            graphql_client: self.graphql_client.clone(),
11349        })
11350    }
11351    /// The skills visible to the model, exactly as the ListSkills tool serves them: engine-embedded skills, skills installed with withSkills, and skills discovered in the workspace.
11352    pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
11353        let query = self.selection.select("skills");
11354        let query = query.select("id");
11355        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11356        Ok(ids
11357            .into_iter()
11358            .map(|id| LlmSkill {
11359                proc: self.proc.clone(),
11360                selection: crate::querybuilder::query()
11361                    .select("node")
11362                    .arg("id", &id.0)
11363                    .inline_fragment("LLMSkill"),
11364                graphql_client: self.graphql_client.clone(),
11365            })
11366            .collect())
11367    }
11368    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
11369    /// Every spawn mints a unique agent instance — two spawns of an identical conversation are two distinct agents, like two calls to a process spawn. The result is pinned to the instance (via the agent lookup field), so re-loading its ID re-addresses the same agent from any request in the session.
11370    /// The loop is not started: the agent spends nothing until it is prompted or resumed, and any input pending on the conversation is stepped then.
11371    /// With a handle, spawn restores an instance instead of minting one: this conversation becomes the committed history of the agent that handle names, so prompting it continues where it left off — rebuild a conversation's ID from a trace, load it, and spawn it under the handle it belonged to. Fails if that instance already has a runtime entry in this session: a restore must happen before anything else addresses the instance, since by then it may have stepped.
11372    ///
11373    /// # Arguments
11374    ///
11375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11376    pub async fn spawn(&self) -> Result<Agent, DaggerError> {
11377        let query = self.selection.select("spawn");
11378        let id: Id = query.execute(self.graphql_client.clone()).await?;
11379        Ok(Agent {
11380            proc: self.proc.clone(),
11381            selection: query
11382                .root()
11383                .select("node")
11384                .arg("id", &id.0)
11385                .inline_fragment("Agent"),
11386            graphql_client: self.graphql_client.clone(),
11387        })
11388    }
11389    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
11390    /// Every spawn mints a unique agent instance — two spawns of an identical conversation are two distinct agents, like two calls to a process spawn. The result is pinned to the instance (via the agent lookup field), so re-loading its ID re-addresses the same agent from any request in the session.
11391    /// The loop is not started: the agent spends nothing until it is prompted or resumed, and any input pending on the conversation is stepped then.
11392    /// With a handle, spawn restores an instance instead of minting one: this conversation becomes the committed history of the agent that handle names, so prompting it continues where it left off — rebuild a conversation's ID from a trace, load it, and spawn it under the handle it belonged to. Fails if that instance already has a runtime entry in this session: a restore must happen before anything else addresses the instance, since by then it may have stepped.
11393    ///
11394    /// # Arguments
11395    ///
11396    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11397    pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
11398        let mut query = self.selection.select("spawn");
11399        if let Some(name) = opts.name {
11400            query = query.arg("name", name);
11401        }
11402        if let Some(handle) = opts.handle {
11403            query = query.arg("handle", handle);
11404        }
11405        if let Some(state) = opts.state {
11406            query = query.arg("state", state);
11407        }
11408        if let Some(error) = opts.error {
11409            query = query.arg("error", error);
11410        }
11411        let id: Id = query.execute(self.graphql_client.clone()).await?;
11412        Ok(Agent {
11413            proc: self.proc.clone(),
11414            selection: query
11415                .root()
11416                .select("node")
11417                .arg("id", &id.0)
11418                .inline_fragment("Agent"),
11419            graphql_client: self.graphql_client.clone(),
11420        })
11421    }
11422    /// Advance the conversation by a single step: send the queued prompt or tool results to the model, evaluate any tool calls it makes, and queue their results. Use loop to step until the model ends its turn.
11423    ///
11424    /// # Arguments
11425    ///
11426    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11427    pub fn step(&self) -> Llm {
11428        let query = self.selection.select("step");
11429        Llm {
11430            proc: self.proc.clone(),
11431            selection: query,
11432            graphql_client: self.graphql_client.clone(),
11433        }
11434    }
11435    /// Advance the conversation by a single step: send the queued prompt or tool results to the model, evaluate any tool calls it makes, and queue their results. Use loop to step until the model ends its turn.
11436    ///
11437    /// # Arguments
11438    ///
11439    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11440    pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
11441        let mut query = self.selection.select("step");
11442        if let Some(max_tokens) = opts.max_tokens {
11443            query = query.arg("maxTokens", max_tokens);
11444        }
11445        Llm {
11446            proc: self.proc.clone(),
11447            selection: query,
11448            graphql_client: self.graphql_client.clone(),
11449        }
11450    }
11451    /// Force evaluation of the conversation's pending operations (prompts, steps, loops) in the engine.
11452    pub async fn sync(&self) -> Result<Llm, DaggerError> {
11453        let query = self.selection.select("sync");
11454        let id: Id = query.execute(self.graphql_client.clone()).await?;
11455        Ok(Llm {
11456            proc: self.proc.clone(),
11457            selection: query
11458                .root()
11459                .select("node")
11460                .arg("id", &id.0)
11461                .inline_fragment("LLM"),
11462            graphql_client: self.graphql_client.clone(),
11463        })
11464    }
11465    /// The cumulative token usage, summed across every API call in the conversation.
11466    pub fn token_usage(&self) -> LlmTokenUsage {
11467        let query = self.selection.select("tokenUsage");
11468        LlmTokenUsage {
11469            proc: self.proc.clone(),
11470            selection: query,
11471            graphql_client: self.graphql_client.clone(),
11472        }
11473    }
11474    /// Render documentation for the tools currently exposed to the model.
11475    pub async fn tools(&self) -> Result<String, DaggerError> {
11476        let query = self.selection.select("tools");
11477        query.execute(self.graphql_client.clone()).await
11478    }
11479    /// The message history rendered as a plain-text transcript, suitable for feeding back to an LLM (e.g. for summarization).
11480    pub async fn transcript(&self) -> Result<String, DaggerError> {
11481        let query = self.selection.select("transcript");
11482        query.execute(self.graphql_client.clone()).await
11483    }
11484    /// Add an external MCP server to the LLM
11485    ///
11486    /// # Arguments
11487    ///
11488    /// * `name` - The name of the MCP server
11489    /// * `service` - The MCP service to run and communicate with over stdio
11490    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11491        let mut query = self.selection.select("withMCPServer");
11492        query = query.arg("name", name.into());
11493        query = query.arg_lazy(
11494            "service",
11495            Box::new(move || {
11496                let service = service.clone();
11497                Box::pin(async move { service.into_id().await.unwrap().quote() })
11498            }),
11499        );
11500        Llm {
11501            proc: self.proc.clone(),
11502            selection: query,
11503            graphql_client: self.graphql_client.clone(),
11504        }
11505    }
11506    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
11507    ///
11508    /// # Arguments
11509    ///
11510    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
11511    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11512    pub fn with_model(&self, model: impl Into<String>) -> Llm {
11513        let mut query = self.selection.select("withModel");
11514        query = query.arg("model", model.into());
11515        Llm {
11516            proc: self.proc.clone(),
11517            selection: query,
11518            graphql_client: self.graphql_client.clone(),
11519        }
11520    }
11521    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
11522    ///
11523    /// # Arguments
11524    ///
11525    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
11526    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11527    pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
11528        let mut query = self.selection.select("withModel");
11529        query = query.arg("model", model.into());
11530        if let Some(provider) = opts.provider {
11531            query = query.arg("provider", provider);
11532        }
11533        Llm {
11534            proc: self.proc.clone(),
11535            selection: query,
11536            graphql_client: self.graphql_client.clone(),
11537        }
11538    }
11539    /// Queue a user prompt, to be sent to the model on the next step or loop.
11540    ///
11541    /// # Arguments
11542    ///
11543    /// * `prompt` - The prompt to send
11544    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11545    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11546        let mut query = self.selection.select("withPrompt");
11547        query = query.arg("prompt", prompt.into());
11548        Llm {
11549            proc: self.proc.clone(),
11550            selection: query,
11551            graphql_client: self.graphql_client.clone(),
11552        }
11553    }
11554    /// Queue a user prompt, to be sent to the model on the next step or loop.
11555    ///
11556    /// # Arguments
11557    ///
11558    /// * `prompt` - The prompt to send
11559    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11560    pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
11561        let mut query = self.selection.select("withPrompt");
11562        query = query.arg("prompt", prompt.into());
11563        if let Some(origin) = opts.origin {
11564            query = query.arg("origin", origin);
11565        }
11566        Llm {
11567            proc: self.proc.clone(),
11568            selection: query,
11569            graphql_client: self.graphql_client.clone(),
11570        }
11571    }
11572    /// Queue a file's contents as a user prompt, like withPrompt.
11573    ///
11574    /// # Arguments
11575    ///
11576    /// * `file` - The file to read the prompt from
11577    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11578        let mut query = self.selection.select("withPromptFile");
11579        query = query.arg_lazy(
11580            "file",
11581            Box::new(move || {
11582                let file = file.clone();
11583                Box::pin(async move { file.into_id().await.unwrap().quote() })
11584            }),
11585        );
11586        Llm {
11587            proc: self.proc.clone(),
11588            selection: query,
11589            graphql_client: self.graphql_client.clone(),
11590        }
11591    }
11592    /// Change the reasoning effort for the rest of the conversation, overriding any configured default. The message history is preserved; the new effort takes effect on the next step.
11593    ///
11594    /// # Arguments
11595    ///
11596    /// * `effort` - The reasoning effort, e.g. "low", "medium", or "high"; "none" disables reasoning. Supported levels are model-specific — some models also accept e.g. "minimal", "xhigh", or "max".
11597    pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
11598        let mut query = self.selection.select("withReasoningEffort");
11599        query = query.arg("effort", effort.into());
11600        Llm {
11601            proc: self.proc.clone(),
11602            selection: query,
11603            graphql_client: self.graphql_client.clone(),
11604        }
11605    }
11606    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
11607    ///
11608    /// # Arguments
11609    ///
11610    /// * `content` - The response content
11611    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11612    pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
11613        let mut query = self.selection.select("withResponse");
11614        query = query.arg("content", content);
11615        Llm {
11616            proc: self.proc.clone(),
11617            selection: query,
11618            graphql_client: self.graphql_client.clone(),
11619        }
11620    }
11621    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
11622    ///
11623    /// # Arguments
11624    ///
11625    /// * `content` - The response content
11626    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11627    pub fn with_response_opts(
11628        &self,
11629        content: Vec<LlmContentBlockInput>,
11630        opts: LlmWithResponseOpts,
11631    ) -> Llm {
11632        let mut query = self.selection.select("withResponse");
11633        query = query.arg("content", content);
11634        if let Some(input_tokens) = opts.input_tokens {
11635            query = query.arg("inputTokens", input_tokens);
11636        }
11637        if let Some(output_tokens) = opts.output_tokens {
11638            query = query.arg("outputTokens", output_tokens);
11639        }
11640        if let Some(cached_token_reads) = opts.cached_token_reads {
11641            query = query.arg("cachedTokenReads", cached_token_reads);
11642        }
11643        if let Some(cached_token_writes) = opts.cached_token_writes {
11644            query = query.arg("cachedTokenWrites", cached_token_writes);
11645        }
11646        if let Some(total_tokens) = opts.total_tokens {
11647            query = query.arg("totalTokens", total_tokens);
11648        }
11649        Llm {
11650            proc: self.proc.clone(),
11651            selection: query,
11652            graphql_client: self.graphql_client.clone(),
11653        }
11654    }
11655    /// Install skills from a directory, adding them to the skills the model discovers with ListSkills and reads with ReadSkill. Each skill is a directory containing a SKILL.md with name and description frontmatter, discovered anywhere in the tree. Installed skills take precedence over skills discovered in the workspace, but cannot shadow the engine's built-in skills.
11656    ///
11657    /// # Arguments
11658    ///
11659    /// * `directory` - A directory containing skills, each a subdirectory holding a SKILL.md.
11660    pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
11661        let mut query = self.selection.select("withSkills");
11662        query = query.arg_lazy(
11663            "directory",
11664            Box::new(move || {
11665                let directory = directory.clone();
11666                Box::pin(async move { directory.into_id().await.unwrap().quote() })
11667            }),
11668        );
11669        Llm {
11670            proc: self.proc.clone(),
11671            selection: query,
11672            graphql_client: self.graphql_client.clone(),
11673        }
11674    }
11675    /// Switch to the configured small model for the current provider, or that provider's recommended default. The message history is preserved; unknown providers without a small-model configuration keep their current model.
11676    pub fn with_small_model(&self) -> Llm {
11677        let query = self.selection.select("withSmallModel");
11678        Llm {
11679            proc: self.proc.clone(),
11680            selection: query,
11681            graphql_client: self.graphql_client.clone(),
11682        }
11683    }
11684    /// Add a system prompt, instructing the model across the whole conversation.
11685    ///
11686    /// # Arguments
11687    ///
11688    /// * `prompt` - The system prompt to send
11689    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11690        let mut query = self.selection.select("withSystemPrompt");
11691        query = query.arg("prompt", prompt.into());
11692        Llm {
11693            proc: self.proc.clone(),
11694            selection: query,
11695            graphql_client: self.graphql_client.clone(),
11696        }
11697    }
11698    /// Append the result of a tool call to the message history.
11699    ///
11700    /// # Arguments
11701    ///
11702    /// * `call_id` - The ID of the tool call this result responds to
11703    /// * `content` - The content returned by the tool
11704    /// * `errored` - Whether the tool call resulted in an error
11705    pub fn with_tool_result(
11706        &self,
11707        call_id: impl Into<String>,
11708        content: impl Into<String>,
11709        errored: bool,
11710    ) -> Llm {
11711        let mut query = self.selection.select("withToolResult");
11712        query = query.arg("callId", call_id.into());
11713        query = query.arg("content", content.into());
11714        query = query.arg("errored", errored);
11715        Llm {
11716            proc: self.proc.clone(),
11717            selection: query,
11718            graphql_client: self.graphql_client.clone(),
11719        }
11720    }
11721    /// Expose an object's methods as tools. Every eligible method of the bound object becomes a tool; a tool that returns this object's own type replaces it as the new state. Repeatable to bind several objects.
11722    ///
11723    /// # Arguments
11724    ///
11725    /// * `object` - The object whose methods become tools.
11726    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11727    pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
11728        let mut query = self.selection.select("withTools");
11729        query = query.arg_lazy(
11730            "object",
11731            Box::new(move || {
11732                let object = object.clone();
11733                Box::pin(async move { object.into_id().await.unwrap().quote() })
11734            }),
11735        );
11736        Llm {
11737            proc: self.proc.clone(),
11738            selection: query,
11739            graphql_client: self.graphql_client.clone(),
11740        }
11741    }
11742    /// Expose an object's methods as tools. Every eligible method of the bound object becomes a tool; a tool that returns this object's own type replaces it as the new state. Repeatable to bind several objects.
11743    ///
11744    /// # Arguments
11745    ///
11746    /// * `object` - The object whose methods become tools.
11747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11748    pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
11749        let mut query = self.selection.select("withTools");
11750        query = query.arg_lazy(
11751            "object",
11752            Box::new(move || {
11753                let object = object.clone();
11754                Box::pin(async move { object.into_id().await.unwrap().quote() })
11755            }),
11756        );
11757        if let Some(except) = opts.except {
11758            query = query.arg("except", except);
11759        }
11760        Llm {
11761            proc: self.proc.clone(),
11762            selection: query,
11763            graphql_client: self.graphql_client.clone(),
11764        }
11765    }
11766    /// Bind the LLM to a workspace, exposing its modules as tools exactly as the Dagger CLI would serve them for that workspace.
11767    ///
11768    /// # Arguments
11769    ///
11770    /// * `workspace` - The workspace to work in.
11771    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
11772        let mut query = self.selection.select("withWorkspace");
11773        query = query.arg_lazy(
11774            "workspace",
11775            Box::new(move || {
11776                let workspace = workspace.clone();
11777                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
11778            }),
11779        );
11780        Llm {
11781            proc: self.proc.clone(),
11782            selection: query,
11783            graphql_client: self.graphql_client.clone(),
11784        }
11785    }
11786    /// Disable the default system prompt
11787    pub fn without_default_system_prompt(&self) -> Llm {
11788        let query = self.selection.select("withoutDefaultSystemPrompt");
11789        Llm {
11790            proc: self.proc.clone(),
11791            selection: query,
11792            graphql_client: self.graphql_client.clone(),
11793        }
11794    }
11795    /// Clear the message history, keeping only the system prompts.
11796    pub fn without_message_history(&self) -> Llm {
11797        let query = self.selection.select("withoutMessageHistory");
11798        Llm {
11799            proc: self.proc.clone(),
11800            selection: query,
11801            graphql_client: self.graphql_client.clone(),
11802        }
11803    }
11804    /// Clear the user-added system prompts, keeping only the default system prompt.
11805    pub fn without_system_prompts(&self) -> Llm {
11806        let query = self.selection.select("withoutSystemPrompts");
11807        Llm {
11808            proc: self.proc.clone(),
11809            selection: query,
11810            graphql_client: self.graphql_client.clone(),
11811        }
11812    }
11813    /// Return the workspace the LLM is bound to.
11814    pub fn workspace(&self) -> Workspace {
11815        let query = self.selection.select("workspace");
11816        Workspace {
11817            proc: self.proc.clone(),
11818            selection: query,
11819            graphql_client: self.graphql_client.clone(),
11820        }
11821    }
11822}
11823impl Node for Llm {
11824    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11825        let query = self.selection.select("id");
11826        let graphql_client = self.graphql_client.clone();
11827        async move { query.execute(graphql_client).await }
11828    }
11829}
11830impl Syncer for Llm {
11831    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11832        let query = self.selection.select("id");
11833        let graphql_client = self.graphql_client.clone();
11834        async move { query.execute(graphql_client).await }
11835    }
11836    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
11837        let query = self.selection.select("sync");
11838        let proc = self.proc.clone();
11839        let graphql_client = self.graphql_client.clone();
11840        async move {
11841            let id: Id = query.execute(graphql_client.clone()).await?;
11842            Ok(Self {
11843                proc,
11844                selection: query
11845                    .root()
11846                    .select("node")
11847                    .arg("id", &id.0)
11848                    .inline_fragment("LLM"),
11849                graphql_client,
11850            })
11851        }
11852    }
11853}
11854#[derive(Clone)]
11855pub struct LlmContentBlock {
11856    pub proc: Option<Arc<DaggerSessionProc>>,
11857    pub selection: Selection,
11858    pub graphql_client: DynGraphQLClient,
11859}
11860impl IntoID<Id> for LlmContentBlock {
11861    fn into_id(
11862        self,
11863    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11864        Box::pin(async move { self.id().await })
11865    }
11866}
11867impl Loadable for LlmContentBlock {
11868    fn graphql_type() -> &'static str {
11869        "LLMContentBlock"
11870    }
11871    fn from_query(
11872        proc: Option<Arc<DaggerSessionProc>>,
11873        selection: Selection,
11874        graphql_client: DynGraphQLClient,
11875    ) -> Self {
11876        Self {
11877            proc,
11878            selection,
11879            graphql_client,
11880        }
11881    }
11882}
11883impl LlmContentBlock {
11884    /// The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).
11885    pub async fn arguments(&self) -> Result<Json, DaggerError> {
11886        let query = self.selection.select("arguments");
11887        query.execute(self.graphql_client.clone()).await
11888    }
11889    /// The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
11890    pub async fn call_id(&self) -> Result<String, DaggerError> {
11891        let query = self.selection.select("callId");
11892        query.execute(self.graphql_client.clone()).await
11893    }
11894    /// Whether the tool call resulted in an error (for TOOL_RESULT kind).
11895    pub async fn errored(&self) -> Result<bool, DaggerError> {
11896        let query = self.selection.select("errored");
11897        query.execute(self.graphql_client.clone()).await
11898    }
11899    /// A unique identifier for this LLMContentBlock.
11900    pub async fn id(&self) -> Result<Id, DaggerError> {
11901        let query = self.selection.select("id");
11902        query.execute(self.graphql_client.clone()).await
11903    }
11904    /// The kind of content block, which determines the other populated fields.
11905    pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
11906        let query = self.selection.select("kind");
11907        query.execute(self.graphql_client.clone()).await
11908    }
11909    /// Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.
11910    pub async fn signature(&self) -> Result<String, DaggerError> {
11911        let query = self.selection.select("signature");
11912        query.execute(self.graphql_client.clone()).await
11913    }
11914    /// Text content (for TEXT, THINKING, or TOOL_RESULT kinds).
11915    pub async fn text(&self) -> Result<String, DaggerError> {
11916        let query = self.selection.select("text");
11917        query.execute(self.graphql_client.clone()).await
11918    }
11919    /// The name of the tool called (for TOOL_CALL kind).
11920    pub async fn tool_name(&self) -> Result<String, DaggerError> {
11921        let query = self.selection.select("toolName");
11922        query.execute(self.graphql_client.clone()).await
11923    }
11924}
11925impl Node for LlmContentBlock {
11926    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11927        let query = self.selection.select("id");
11928        let graphql_client = self.graphql_client.clone();
11929        async move { query.execute(graphql_client).await }
11930    }
11931}
11932#[derive(Clone)]
11933pub struct LlmMessage {
11934    pub proc: Option<Arc<DaggerSessionProc>>,
11935    pub selection: Selection,
11936    pub graphql_client: DynGraphQLClient,
11937}
11938impl IntoID<Id> for LlmMessage {
11939    fn into_id(
11940        self,
11941    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11942        Box::pin(async move { self.id().await })
11943    }
11944}
11945impl Loadable for LlmMessage {
11946    fn graphql_type() -> &'static str {
11947        "LLMMessage"
11948    }
11949    fn from_query(
11950        proc: Option<Arc<DaggerSessionProc>>,
11951        selection: Selection,
11952        graphql_client: DynGraphQLClient,
11953    ) -> Self {
11954        Self {
11955            proc,
11956            selection,
11957            graphql_client,
11958        }
11959    }
11960}
11961impl LlmMessage {
11962    /// The message's content blocks, in the order the model produced them.
11963    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
11964        let query = self.selection.select("content");
11965        let query = query.select("id");
11966        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11967        Ok(ids
11968            .into_iter()
11969            .map(|id| LlmContentBlock {
11970                proc: self.proc.clone(),
11971                selection: crate::querybuilder::query()
11972                    .select("node")
11973                    .arg("id", &id.0)
11974                    .inline_fragment("LLMContentBlock"),
11975                graphql_client: self.graphql_client.clone(),
11976            })
11977            .collect())
11978    }
11979    /// A unique identifier for this LLMMessage.
11980    pub async fn id(&self) -> Result<Id, DaggerError> {
11981        let query = self.selection.select("id");
11982        query.execute(self.graphql_client.clone()).await
11983    }
11984    /// Who put this message on the record, when it arrived through an agent mailbox.
11985    /// Null for the user's own prompts and for everything the model or tools produced.
11986    pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
11987        let query = self.selection.select("origin");
11988        let query = query.select("id");
11989        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11990        Ok(id.map(|id| LlmMessageOrigin {
11991            proc: self.proc.clone(),
11992            selection: query
11993                .root()
11994                .select("node")
11995                .arg("id", &id.0)
11996                .inline_fragment("LLMMessageOrigin"),
11997            graphql_client: self.graphql_client.clone(),
11998        }))
11999    }
12000    /// The role that produced this message.
12001    pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
12002        let query = self.selection.select("role");
12003        query.execute(self.graphql_client.clone()).await
12004    }
12005    /// Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.
12006    pub fn token_usage(&self) -> LlmTokenUsage {
12007        let query = self.selection.select("tokenUsage");
12008        LlmTokenUsage {
12009            proc: self.proc.clone(),
12010            selection: query,
12011            graphql_client: self.graphql_client.clone(),
12012        }
12013    }
12014}
12015impl Node for LlmMessage {
12016    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12017        let query = self.selection.select("id");
12018        let graphql_client = self.graphql_client.clone();
12019        async move { query.execute(graphql_client).await }
12020    }
12021}
12022#[derive(Clone)]
12023pub struct LlmMessageOrigin {
12024    pub proc: Option<Arc<DaggerSessionProc>>,
12025    pub selection: Selection,
12026    pub graphql_client: DynGraphQLClient,
12027}
12028impl IntoID<Id> for LlmMessageOrigin {
12029    fn into_id(
12030        self,
12031    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12032        Box::pin(async move { self.id().await })
12033    }
12034}
12035impl Loadable for LlmMessageOrigin {
12036    fn graphql_type() -> &'static str {
12037        "LLMMessageOrigin"
12038    }
12039    fn from_query(
12040        proc: Option<Arc<DaggerSessionProc>>,
12041        selection: Selection,
12042        graphql_client: DynGraphQLClient,
12043    ) -> Self {
12044        Self {
12045            proc,
12046            selection,
12047            graphql_client,
12048        }
12049    }
12050}
12051impl LlmMessageOrigin {
12052    /// The display name of the sending agent (for AGENT origins) or the observed agent (for EVENT origins).
12053    pub async fn agent_name(&self) -> Result<String, DaggerError> {
12054        let query = self.selection.select("agentName");
12055        query.execute(self.graphql_client.clone()).await
12056    }
12057    /// A unique identifier for this LLMMessageOrigin.
12058    pub async fn id(&self) -> Result<Id, DaggerError> {
12059        let query = self.selection.select("id");
12060        query.execute(self.graphql_client.clone()).await
12061    }
12062    /// Who put this message on the record.
12063    pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
12064        let query = self.selection.select("kind");
12065        query.execute(self.graphql_client.clone()).await
12066    }
12067    /// The message's short ref within the receiving agent's runtime, e.g. "#3": the deterministic token replies name (send's replyTo) and the message lookup takes.
12068    pub async fn r#ref(&self) -> Result<String, DaggerError> {
12069        let query = self.selection.select("ref");
12070        query.execute(self.graphql_client.clone()).await
12071    }
12072    /// The ref of the message this one answers, in the sender's own runtime, if any.
12073    pub async fn reply_to(&self) -> Result<String, DaggerError> {
12074        let query = self.selection.select("replyTo");
12075        query.execute(self.graphql_client.clone()).await
12076    }
12077}
12078impl Node for LlmMessageOrigin {
12079    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12080        let query = self.selection.select("id");
12081        let graphql_client = self.graphql_client.clone();
12082        async move { query.execute(graphql_client).await }
12083    }
12084}
12085#[derive(Clone)]
12086pub struct LlmSkill {
12087    pub proc: Option<Arc<DaggerSessionProc>>,
12088    pub selection: Selection,
12089    pub graphql_client: DynGraphQLClient,
12090}
12091impl IntoID<Id> for LlmSkill {
12092    fn into_id(
12093        self,
12094    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12095        Box::pin(async move { self.id().await })
12096    }
12097}
12098impl Loadable for LlmSkill {
12099    fn graphql_type() -> &'static str {
12100        "LLMSkill"
12101    }
12102    fn from_query(
12103        proc: Option<Arc<DaggerSessionProc>>,
12104        selection: Selection,
12105        graphql_client: DynGraphQLClient,
12106    ) -> Self {
12107        Self {
12108            proc,
12109            selection,
12110            graphql_client,
12111        }
12112    }
12113}
12114impl LlmSkill {
12115    /// The one-line description from the SKILL.md frontmatter.
12116    pub async fn description(&self) -> Result<String, DaggerError> {
12117        let query = self.selection.select("description");
12118        query.execute(self.graphql_client.clone()).await
12119    }
12120    /// A unique identifier for this LLMSkill.
12121    pub async fn id(&self) -> Result<Id, DaggerError> {
12122        let query = self.selection.select("id");
12123        query.execute(self.graphql_client.clone()).await
12124    }
12125    /// The skill name, as passed to ReadSkill.
12126    pub async fn name(&self) -> Result<String, DaggerError> {
12127        let query = self.selection.select("name");
12128        query.execute(self.graphql_client.clone()).await
12129    }
12130}
12131impl Node for LlmSkill {
12132    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12133        let query = self.selection.select("id");
12134        let graphql_client = self.graphql_client.clone();
12135        async move { query.execute(graphql_client).await }
12136    }
12137}
12138#[derive(Clone)]
12139pub struct LlmTokenUsage {
12140    pub proc: Option<Arc<DaggerSessionProc>>,
12141    pub selection: Selection,
12142    pub graphql_client: DynGraphQLClient,
12143}
12144impl IntoID<Id> for LlmTokenUsage {
12145    fn into_id(
12146        self,
12147    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12148        Box::pin(async move { self.id().await })
12149    }
12150}
12151impl Loadable for LlmTokenUsage {
12152    fn graphql_type() -> &'static str {
12153        "LLMTokenUsage"
12154    }
12155    fn from_query(
12156        proc: Option<Arc<DaggerSessionProc>>,
12157        selection: Selection,
12158        graphql_client: DynGraphQLClient,
12159    ) -> Self {
12160        Self {
12161            proc,
12162            selection,
12163            graphql_client,
12164        }
12165    }
12166}
12167impl LlmTokenUsage {
12168    /// Input tokens served from the provider's prompt cache.
12169    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
12170        let query = self.selection.select("cachedTokenReads");
12171        query.execute(self.graphql_client.clone()).await
12172    }
12173    /// Input tokens written to the provider's prompt cache.
12174    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
12175        let query = self.selection.select("cachedTokenWrites");
12176        query.execute(self.graphql_client.clone()).await
12177    }
12178    /// A unique identifier for this LLMTokenUsage.
12179    pub async fn id(&self) -> Result<Id, DaggerError> {
12180        let query = self.selection.select("id");
12181        query.execute(self.graphql_client.clone()).await
12182    }
12183    /// Uncached input tokens sent to the model.
12184    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
12185        let query = self.selection.select("inputTokens");
12186        query.execute(self.graphql_client.clone()).await
12187    }
12188    /// Tokens received from the model, including text and tool calls.
12189    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
12190        let query = self.selection.select("outputTokens");
12191        query.execute(self.graphql_client.clone()).await
12192    }
12193    /// Total tokens consumed, as reported by the provider.
12194    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
12195        let query = self.selection.select("totalTokens");
12196        query.execute(self.graphql_client.clone()).await
12197    }
12198}
12199impl Node for LlmTokenUsage {
12200    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12201        let query = self.selection.select("id");
12202        let graphql_client = self.graphql_client.clone();
12203        async move { query.execute(graphql_client).await }
12204    }
12205}
12206#[derive(Clone)]
12207pub struct Label {
12208    pub proc: Option<Arc<DaggerSessionProc>>,
12209    pub selection: Selection,
12210    pub graphql_client: DynGraphQLClient,
12211}
12212impl IntoID<Id> for Label {
12213    fn into_id(
12214        self,
12215    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12216        Box::pin(async move { self.id().await })
12217    }
12218}
12219impl Loadable for Label {
12220    fn graphql_type() -> &'static str {
12221        "Label"
12222    }
12223    fn from_query(
12224        proc: Option<Arc<DaggerSessionProc>>,
12225        selection: Selection,
12226        graphql_client: DynGraphQLClient,
12227    ) -> Self {
12228        Self {
12229            proc,
12230            selection,
12231            graphql_client,
12232        }
12233    }
12234}
12235impl Label {
12236    /// A unique identifier for this Label.
12237    pub async fn id(&self) -> Result<Id, DaggerError> {
12238        let query = self.selection.select("id");
12239        query.execute(self.graphql_client.clone()).await
12240    }
12241    /// The label name.
12242    pub async fn name(&self) -> Result<String, DaggerError> {
12243        let query = self.selection.select("name");
12244        query.execute(self.graphql_client.clone()).await
12245    }
12246    /// The label value.
12247    pub async fn value(&self) -> Result<String, DaggerError> {
12248        let query = self.selection.select("value");
12249        query.execute(self.graphql_client.clone()).await
12250    }
12251}
12252impl Node for Label {
12253    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12254        let query = self.selection.select("id");
12255        let graphql_client = self.graphql_client.clone();
12256        async move { query.execute(graphql_client).await }
12257    }
12258}
12259#[derive(Clone)]
12260pub struct ListTypeDef {
12261    pub proc: Option<Arc<DaggerSessionProc>>,
12262    pub selection: Selection,
12263    pub graphql_client: DynGraphQLClient,
12264}
12265impl IntoID<Id> for ListTypeDef {
12266    fn into_id(
12267        self,
12268    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12269        Box::pin(async move { self.id().await })
12270    }
12271}
12272impl Loadable for ListTypeDef {
12273    fn graphql_type() -> &'static str {
12274        "ListTypeDef"
12275    }
12276    fn from_query(
12277        proc: Option<Arc<DaggerSessionProc>>,
12278        selection: Selection,
12279        graphql_client: DynGraphQLClient,
12280    ) -> Self {
12281        Self {
12282            proc,
12283            selection,
12284            graphql_client,
12285        }
12286    }
12287}
12288impl ListTypeDef {
12289    /// The type of the elements in the list.
12290    pub fn element_type_def(&self) -> TypeDef {
12291        let query = self.selection.select("elementTypeDef");
12292        TypeDef {
12293            proc: self.proc.clone(),
12294            selection: query,
12295            graphql_client: self.graphql_client.clone(),
12296        }
12297    }
12298    /// A unique identifier for this ListTypeDef.
12299    pub async fn id(&self) -> Result<Id, DaggerError> {
12300        let query = self.selection.select("id");
12301        query.execute(self.graphql_client.clone()).await
12302    }
12303}
12304impl Node for ListTypeDef {
12305    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12306        let query = self.selection.select("id");
12307        let graphql_client = self.graphql_client.clone();
12308        async move { query.execute(graphql_client).await }
12309    }
12310}
12311#[derive(Clone)]
12312pub struct Module {
12313    pub proc: Option<Arc<DaggerSessionProc>>,
12314    pub selection: Selection,
12315    pub graphql_client: DynGraphQLClient,
12316}
12317#[derive(Builder, Debug, PartialEq)]
12318pub struct ModuleChecksOpts<'a> {
12319    /// Only include checks matching the specified patterns
12320    #[builder(setter(into, strip_option), default)]
12321    pub include: Option<Vec<&'a str>>,
12322    /// When true, only return annotated check functions; exclude generate-as-checks
12323    #[builder(setter(into, strip_option), default)]
12324    pub no_generate: Option<bool>,
12325}
12326#[derive(Builder, Debug, PartialEq)]
12327pub struct ModuleGeneratorsOpts<'a> {
12328    /// Only include generators matching the specified patterns
12329    #[builder(setter(into, strip_option), default)]
12330    pub include: Option<Vec<&'a str>>,
12331}
12332#[derive(Builder, Debug, PartialEq)]
12333pub struct ModuleServeOpts {
12334    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
12335    #[builder(setter(into, strip_option), default)]
12336    pub entrypoint: Option<bool>,
12337    /// Expose the dependencies of this module to the client
12338    #[builder(setter(into, strip_option), default)]
12339    pub include_dependencies: Option<bool>,
12340}
12341#[derive(Builder, Debug, PartialEq)]
12342pub struct ModuleServicesOpts<'a> {
12343    /// Only include services matching the specified patterns
12344    #[builder(setter(into, strip_option), default)]
12345    pub include: Option<Vec<&'a str>>,
12346}
12347impl IntoID<Id> for Module {
12348    fn into_id(
12349        self,
12350    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12351        Box::pin(async move { self.id().await })
12352    }
12353}
12354impl Loadable for Module {
12355    fn graphql_type() -> &'static str {
12356        "Module"
12357    }
12358    fn from_query(
12359        proc: Option<Arc<DaggerSessionProc>>,
12360        selection: Selection,
12361        graphql_client: DynGraphQLClient,
12362    ) -> Self {
12363        Self {
12364            proc,
12365            selection,
12366            graphql_client,
12367        }
12368    }
12369}
12370impl Module {
12371    /// Return the check defined by the module with the given name. Must match to exactly one check.
12372    ///
12373    /// # Arguments
12374    ///
12375    /// * `name` - The name of the check to retrieve
12376    pub fn check(&self, name: impl Into<String>) -> Check {
12377        let mut query = self.selection.select("check");
12378        query = query.arg("name", name.into());
12379        Check {
12380            proc: self.proc.clone(),
12381            selection: query,
12382            graphql_client: self.graphql_client.clone(),
12383        }
12384    }
12385    /// Return all checks defined by the module
12386    ///
12387    /// # Arguments
12388    ///
12389    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12390    pub fn checks(&self) -> CheckGroup {
12391        let query = self.selection.select("checks");
12392        CheckGroup {
12393            proc: self.proc.clone(),
12394            selection: query,
12395            graphql_client: self.graphql_client.clone(),
12396        }
12397    }
12398    /// Return all checks defined by the module
12399    ///
12400    /// # Arguments
12401    ///
12402    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12403    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
12404        let mut query = self.selection.select("checks");
12405        if let Some(include) = opts.include {
12406            query = query.arg("include", include);
12407        }
12408        if let Some(no_generate) = opts.no_generate {
12409            query = query.arg("noGenerate", no_generate);
12410        }
12411        CheckGroup {
12412            proc: self.proc.clone(),
12413            selection: query,
12414            graphql_client: self.graphql_client.clone(),
12415        }
12416    }
12417    /// The dependencies of the module.
12418    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
12419        let query = self.selection.select("dependencies");
12420        let query = query.select("id");
12421        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12422        Ok(ids
12423            .into_iter()
12424            .map(|id| Module {
12425                proc: self.proc.clone(),
12426                selection: crate::querybuilder::query()
12427                    .select("node")
12428                    .arg("id", &id.0)
12429                    .inline_fragment("Module"),
12430                graphql_client: self.graphql_client.clone(),
12431            })
12432            .collect())
12433    }
12434    /// The doc string of the module, if any
12435    pub async fn description(&self) -> Result<String, DaggerError> {
12436        let query = self.selection.select("description");
12437        query.execute(self.graphql_client.clone()).await
12438    }
12439    /// Enumerations served by this module.
12440    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
12441        let query = self.selection.select("enums");
12442        let query = query.select("id");
12443        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12444        Ok(ids
12445            .into_iter()
12446            .map(|id| TypeDef {
12447                proc: self.proc.clone(),
12448                selection: crate::querybuilder::query()
12449                    .select("node")
12450                    .arg("id", &id.0)
12451                    .inline_fragment("TypeDef"),
12452                graphql_client: self.graphql_client.clone(),
12453            })
12454            .collect())
12455    }
12456    /// The generated files and directories made on top of the module source's context directory.
12457    pub fn generated_context_directory(&self) -> Directory {
12458        let query = self.selection.select("generatedContextDirectory");
12459        Directory {
12460            proc: self.proc.clone(),
12461            selection: query,
12462            graphql_client: self.graphql_client.clone(),
12463        }
12464    }
12465    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
12466    ///
12467    /// # Arguments
12468    ///
12469    /// * `name` - The name of the generator to retrieve
12470    pub fn generator(&self, name: impl Into<String>) -> Generator {
12471        let mut query = self.selection.select("generator");
12472        query = query.arg("name", name.into());
12473        Generator {
12474            proc: self.proc.clone(),
12475            selection: query,
12476            graphql_client: self.graphql_client.clone(),
12477        }
12478    }
12479    /// Return all generators defined by the module
12480    ///
12481    /// # Arguments
12482    ///
12483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12484    pub fn generators(&self) -> GeneratorGroup {
12485        let query = self.selection.select("generators");
12486        GeneratorGroup {
12487            proc: self.proc.clone(),
12488            selection: query,
12489            graphql_client: self.graphql_client.clone(),
12490        }
12491    }
12492    /// Return all generators defined by the module
12493    ///
12494    /// # Arguments
12495    ///
12496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12497    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
12498        let mut query = self.selection.select("generators");
12499        if let Some(include) = opts.include {
12500            query = query.arg("include", include);
12501        }
12502        GeneratorGroup {
12503            proc: self.proc.clone(),
12504            selection: query,
12505            graphql_client: self.graphql_client.clone(),
12506        }
12507    }
12508    /// A unique identifier for this Module.
12509    pub async fn id(&self) -> Result<Id, DaggerError> {
12510        let query = self.selection.select("id");
12511        query.execute(self.graphql_client.clone()).await
12512    }
12513    /// Interfaces served by this module.
12514    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
12515        let query = self.selection.select("interfaces");
12516        let query = query.select("id");
12517        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12518        Ok(ids
12519            .into_iter()
12520            .map(|id| TypeDef {
12521                proc: self.proc.clone(),
12522                selection: crate::querybuilder::query()
12523                    .select("node")
12524                    .arg("id", &id.0)
12525                    .inline_fragment("TypeDef"),
12526                graphql_client: self.graphql_client.clone(),
12527            })
12528            .collect())
12529    }
12530    /// The introspection schema JSON file for this module.
12531    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
12532    /// Note: this is in the context of a module, so some core types may be hidden.
12533    pub fn introspection_schema_json(&self) -> File {
12534        let query = self.selection.select("introspectionSchemaJSON");
12535        File {
12536            proc: self.proc.clone(),
12537            selection: query,
12538            graphql_client: self.graphql_client.clone(),
12539        }
12540    }
12541    /// The name of the module
12542    pub async fn name(&self) -> Result<String, DaggerError> {
12543        let query = self.selection.select("name");
12544        query.execute(self.graphql_client.clone()).await
12545    }
12546    /// Objects served by this module.
12547    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
12548        let query = self.selection.select("objects");
12549        let query = query.select("id");
12550        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12551        Ok(ids
12552            .into_iter()
12553            .map(|id| TypeDef {
12554                proc: self.proc.clone(),
12555                selection: crate::querybuilder::query()
12556                    .select("node")
12557                    .arg("id", &id.0)
12558                    .inline_fragment("TypeDef"),
12559                graphql_client: self.graphql_client.clone(),
12560            })
12561            .collect())
12562    }
12563    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
12564    pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
12565        let query = self.selection.select("runtime");
12566        let query = query.select("id");
12567        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12568        Ok(id.map(|id| Container {
12569            proc: self.proc.clone(),
12570            selection: query
12571                .root()
12572                .select("node")
12573                .arg("id", &id.0)
12574                .inline_fragment("Container"),
12575            graphql_client: self.graphql_client.clone(),
12576        }))
12577    }
12578    /// The SDK config used by this module.
12579    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
12580        let query = self.selection.select("sdk");
12581        let query = query.select("id");
12582        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12583        Ok(id.map(|id| SdkConfig {
12584            proc: self.proc.clone(),
12585            selection: query
12586                .root()
12587                .select("node")
12588                .arg("id", &id.0)
12589                .inline_fragment("SDKConfig"),
12590            graphql_client: self.graphql_client.clone(),
12591        }))
12592    }
12593    /// Serve a module's API in the current session.
12594    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
12595    ///
12596    /// # Arguments
12597    ///
12598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12599    pub async fn serve(&self) -> Result<Void, DaggerError> {
12600        let query = self.selection.select("serve");
12601        query.execute(self.graphql_client.clone()).await
12602    }
12603    /// Serve a module's API in the current session.
12604    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
12605    ///
12606    /// # Arguments
12607    ///
12608    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12609    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
12610        let mut query = self.selection.select("serve");
12611        if let Some(include_dependencies) = opts.include_dependencies {
12612            query = query.arg("includeDependencies", include_dependencies);
12613        }
12614        if let Some(entrypoint) = opts.entrypoint {
12615            query = query.arg("entrypoint", entrypoint);
12616        }
12617        query.execute(self.graphql_client.clone()).await
12618    }
12619    /// Return all services defined by the module
12620    ///
12621    /// # Arguments
12622    ///
12623    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12624    pub fn services(&self) -> UpGroup {
12625        let query = self.selection.select("services");
12626        UpGroup {
12627            proc: self.proc.clone(),
12628            selection: query,
12629            graphql_client: self.graphql_client.clone(),
12630        }
12631    }
12632    /// Return all services defined by the module
12633    ///
12634    /// # Arguments
12635    ///
12636    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12637    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
12638        let mut query = self.selection.select("services");
12639        if let Some(include) = opts.include {
12640            query = query.arg("include", include);
12641        }
12642        UpGroup {
12643            proc: self.proc.clone(),
12644            selection: query,
12645            graphql_client: self.graphql_client.clone(),
12646        }
12647    }
12648    /// The source for the module.
12649    pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
12650        let query = self.selection.select("source");
12651        let query = query.select("id");
12652        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12653        Ok(id.map(|id| ModuleSource {
12654            proc: self.proc.clone(),
12655            selection: query
12656                .root()
12657                .select("node")
12658                .arg("id", &id.0)
12659                .inline_fragment("ModuleSource"),
12660            graphql_client: self.graphql_client.clone(),
12661        }))
12662    }
12663    /// Forces evaluation of the module, including any loading into the engine and associated validation.
12664    pub async fn sync(&self) -> Result<Module, DaggerError> {
12665        let query = self.selection.select("sync");
12666        let id: Id = query.execute(self.graphql_client.clone()).await?;
12667        Ok(Module {
12668            proc: self.proc.clone(),
12669            selection: query
12670                .root()
12671                .select("node")
12672                .arg("id", &id.0)
12673                .inline_fragment("Module"),
12674            graphql_client: self.graphql_client.clone(),
12675        })
12676    }
12677    /// User-defined default values, loaded from local .env files.
12678    pub fn user_defaults(&self) -> EnvFile {
12679        let query = self.selection.select("userDefaults");
12680        EnvFile {
12681            proc: self.proc.clone(),
12682            selection: query,
12683            graphql_client: self.graphql_client.clone(),
12684        }
12685    }
12686    /// Retrieves the module with the given description
12687    ///
12688    /// # Arguments
12689    ///
12690    /// * `description` - The description to set
12691    pub fn with_description(&self, description: impl Into<String>) -> Module {
12692        let mut query = self.selection.select("withDescription");
12693        query = query.arg("description", description.into());
12694        Module {
12695            proc: self.proc.clone(),
12696            selection: query,
12697            graphql_client: self.graphql_client.clone(),
12698        }
12699    }
12700    /// This module plus the given Enum type and associated values
12701    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
12702        let mut query = self.selection.select("withEnum");
12703        query = query.arg_lazy(
12704            "enum",
12705            Box::new(move || {
12706                let r#enum = r#enum.clone();
12707                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
12708            }),
12709        );
12710        Module {
12711            proc: self.proc.clone(),
12712            selection: query,
12713            graphql_client: self.graphql_client.clone(),
12714        }
12715    }
12716    /// This module plus the given Interface type and associated functions
12717    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
12718        let mut query = self.selection.select("withInterface");
12719        query = query.arg_lazy(
12720            "iface",
12721            Box::new(move || {
12722                let iface = iface.clone();
12723                Box::pin(async move { iface.into_id().await.unwrap().quote() })
12724            }),
12725        );
12726        Module {
12727            proc: self.proc.clone(),
12728            selection: query,
12729            graphql_client: self.graphql_client.clone(),
12730        }
12731    }
12732    /// This module plus the given Object type and associated functions.
12733    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
12734        let mut query = self.selection.select("withObject");
12735        query = query.arg_lazy(
12736            "object",
12737            Box::new(move || {
12738                let object = object.clone();
12739                Box::pin(async move { object.into_id().await.unwrap().quote() })
12740            }),
12741        );
12742        Module {
12743            proc: self.proc.clone(),
12744            selection: query,
12745            graphql_client: self.graphql_client.clone(),
12746        }
12747    }
12748}
12749impl Node for Module {
12750    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12751        let query = self.selection.select("id");
12752        let graphql_client = self.graphql_client.clone();
12753        async move { query.execute(graphql_client).await }
12754    }
12755}
12756impl Syncer for Module {
12757    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12758        let query = self.selection.select("id");
12759        let graphql_client = self.graphql_client.clone();
12760        async move { query.execute(graphql_client).await }
12761    }
12762    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
12763        let query = self.selection.select("sync");
12764        let proc = self.proc.clone();
12765        let graphql_client = self.graphql_client.clone();
12766        async move {
12767            let id: Id = query.execute(graphql_client.clone()).await?;
12768            Ok(Self {
12769                proc,
12770                selection: query
12771                    .root()
12772                    .select("node")
12773                    .arg("id", &id.0)
12774                    .inline_fragment("Module"),
12775                graphql_client,
12776            })
12777        }
12778    }
12779}
12780#[derive(Clone)]
12781pub struct ModuleConfigClient {
12782    pub proc: Option<Arc<DaggerSessionProc>>,
12783    pub selection: Selection,
12784    pub graphql_client: DynGraphQLClient,
12785}
12786impl IntoID<Id> for ModuleConfigClient {
12787    fn into_id(
12788        self,
12789    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12790        Box::pin(async move { self.id().await })
12791    }
12792}
12793impl Loadable for ModuleConfigClient {
12794    fn graphql_type() -> &'static str {
12795        "ModuleConfigClient"
12796    }
12797    fn from_query(
12798        proc: Option<Arc<DaggerSessionProc>>,
12799        selection: Selection,
12800        graphql_client: DynGraphQLClient,
12801    ) -> Self {
12802        Self {
12803            proc,
12804            selection,
12805            graphql_client,
12806        }
12807    }
12808}
12809impl ModuleConfigClient {
12810    /// The directory the client is generated in.
12811    pub async fn directory(&self) -> Result<String, DaggerError> {
12812        let query = self.selection.select("directory");
12813        query.execute(self.graphql_client.clone()).await
12814    }
12815    /// The generator to use
12816    pub async fn generator(&self) -> Result<String, DaggerError> {
12817        let query = self.selection.select("generator");
12818        query.execute(self.graphql_client.clone()).await
12819    }
12820    /// A unique identifier for this ModuleConfigClient.
12821    pub async fn id(&self) -> Result<Id, DaggerError> {
12822        let query = self.selection.select("id");
12823        query.execute(self.graphql_client.clone()).await
12824    }
12825}
12826impl Node for ModuleConfigClient {
12827    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12828        let query = self.selection.select("id");
12829        let graphql_client = self.graphql_client.clone();
12830        async move { query.execute(graphql_client).await }
12831    }
12832}
12833#[derive(Clone)]
12834pub struct ModuleSource {
12835    pub proc: Option<Arc<DaggerSessionProc>>,
12836    pub selection: Selection,
12837    pub graphql_client: DynGraphQLClient,
12838}
12839impl IntoID<Id> for ModuleSource {
12840    fn into_id(
12841        self,
12842    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12843        Box::pin(async move { self.id().await })
12844    }
12845}
12846impl Loadable for ModuleSource {
12847    fn graphql_type() -> &'static str {
12848        "ModuleSource"
12849    }
12850    fn from_query(
12851        proc: Option<Arc<DaggerSessionProc>>,
12852        selection: Selection,
12853        graphql_client: DynGraphQLClient,
12854    ) -> Self {
12855        Self {
12856            proc,
12857            selection,
12858            graphql_client,
12859        }
12860    }
12861}
12862impl ModuleSource {
12863    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
12864    pub fn as_module(&self) -> Module {
12865        let query = self.selection.select("asModule");
12866        Module {
12867            proc: self.proc.clone(),
12868            selection: query,
12869            graphql_client: self.graphql_client.clone(),
12870        }
12871    }
12872    /// A human readable ref string representation of this module source.
12873    pub async fn as_string(&self) -> Result<String, DaggerError> {
12874        let query = self.selection.select("asString");
12875        query.execute(self.graphql_client.clone()).await
12876    }
12877    /// The blueprint referenced by the module source.
12878    pub fn blueprint(&self) -> ModuleSource {
12879        let query = self.selection.select("blueprint");
12880        ModuleSource {
12881            proc: self.proc.clone(),
12882            selection: query,
12883            graphql_client: self.graphql_client.clone(),
12884        }
12885    }
12886    /// The client-facing introspection schema JSON file for this module source.
12887    /// This is the schema consumed by client codegen: unlike introspectionSchemaJSON (the module-facing schema), it hides no core types and installs this module (reached via dag.<moduleName>) so a generated client can bind it. The module's dependencies are excluded: a client is generated for a single module plus core, not its dependency graph.
12888    pub fn client_schema_introspection_json(&self) -> File {
12889        let query = self.selection.select("clientSchemaIntrospectionJSON");
12890        File {
12891            proc: self.proc.clone(),
12892            selection: query,
12893            graphql_client: self.graphql_client.clone(),
12894        }
12895    }
12896    /// The ref to clone the root of the git repo from. Only valid for git sources.
12897    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
12898        let query = self.selection.select("cloneRef");
12899        query.execute(self.graphql_client.clone()).await
12900    }
12901    /// The resolved commit of the git repo this source points to.
12902    pub async fn commit(&self) -> Result<String, DaggerError> {
12903        let query = self.selection.select("commit");
12904        query.execute(self.graphql_client.clone()).await
12905    }
12906    /// The clients generated for the module.
12907    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
12908        let query = self.selection.select("configClients");
12909        let query = query.select("id");
12910        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12911        Ok(ids
12912            .into_iter()
12913            .map(|id| ModuleConfigClient {
12914                proc: self.proc.clone(),
12915                selection: crate::querybuilder::query()
12916                    .select("node")
12917                    .arg("id", &id.0)
12918                    .inline_fragment("ModuleConfigClient"),
12919                graphql_client: self.graphql_client.clone(),
12920            })
12921            .collect())
12922    }
12923    /// Whether an existing module config file was found.
12924    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
12925        let query = self.selection.select("configExists");
12926        query.execute(self.graphql_client.clone()).await
12927    }
12928    /// The full directory loaded for the module source, including the source code as a subdirectory.
12929    pub fn context_directory(&self) -> Directory {
12930        let query = self.selection.select("contextDirectory");
12931        Directory {
12932            proc: self.proc.clone(),
12933            selection: query,
12934            graphql_client: self.graphql_client.clone(),
12935        }
12936    }
12937    /// The dependencies of the module source.
12938    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12939        let query = self.selection.select("dependencies");
12940        let query = query.select("id");
12941        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12942        Ok(ids
12943            .into_iter()
12944            .map(|id| ModuleSource {
12945                proc: self.proc.clone(),
12946                selection: crate::querybuilder::query()
12947                    .select("node")
12948                    .arg("id", &id.0)
12949                    .inline_fragment("ModuleSource"),
12950                graphql_client: self.graphql_client.clone(),
12951            })
12952            .collect())
12953    }
12954    /// A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.
12955    pub async fn digest(&self) -> Result<String, DaggerError> {
12956        let query = self.selection.select("digest");
12957        query.execute(self.graphql_client.clone()).await
12958    }
12959    /// The directory containing the module configuration and source code (source code may be in a subdir).
12960    ///
12961    /// # Arguments
12962    ///
12963    /// * `path` - A subpath from the source directory to select.
12964    pub fn directory(&self, path: impl Into<String>) -> Directory {
12965        let mut query = self.selection.select("directory");
12966        query = query.arg("path", path.into());
12967        Directory {
12968            proc: self.proc.clone(),
12969            selection: query,
12970            graphql_client: self.graphql_client.clone(),
12971        }
12972    }
12973    /// The engine version of the module.
12974    pub async fn engine_version(&self) -> Result<String, DaggerError> {
12975        let query = self.selection.select("engineVersion");
12976        query.execute(self.graphql_client.clone()).await
12977    }
12978    /// Return the supplied workspace with this module's generated context applied.
12979    /// The workspace change baseline is preserved, so a later Workspace.changes call includes this generation together with any other edits made by the caller.
12980    ///
12981    /// # Arguments
12982    ///
12983    /// * `workspace` - The workspace to apply generated files to.
12984    pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
12985        let mut query = self.selection.select("generate");
12986        query = query.arg_lazy(
12987            "workspace",
12988            Box::new(move || {
12989                let workspace = workspace.clone();
12990                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
12991            }),
12992        );
12993        Workspace {
12994            proc: self.proc.clone(),
12995            selection: query,
12996            graphql_client: self.graphql_client.clone(),
12997        }
12998    }
12999    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
13000    pub fn generated_context_changeset(&self) -> Changeset {
13001        let query = self.selection.select("generatedContextChangeset");
13002        Changeset {
13003            proc: self.proc.clone(),
13004            selection: query,
13005            graphql_client: self.graphql_client.clone(),
13006        }
13007    }
13008    /// The generated files and directories made on top of the module source's context directory.
13009    pub fn generated_context_directory(&self) -> Directory {
13010        let query = self.selection.select("generatedContextDirectory");
13011        Directory {
13012            proc: self.proc.clone(),
13013            selection: query,
13014            graphql_client: self.graphql_client.clone(),
13015        }
13016    }
13017    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
13018    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
13019        let query = self.selection.select("htmlRepoURL");
13020        query.execute(self.graphql_client.clone()).await
13021    }
13022    /// The URL to the source's git repo in a web browser. Only valid for git sources.
13023    pub async fn html_url(&self) -> Result<String, DaggerError> {
13024        let query = self.selection.select("htmlURL");
13025        query.execute(self.graphql_client.clone()).await
13026    }
13027    /// A unique identifier for this ModuleSource.
13028    pub async fn id(&self) -> Result<Id, DaggerError> {
13029        let query = self.selection.select("id");
13030        query.execute(self.graphql_client.clone()).await
13031    }
13032    /// The introspection schema JSON file for this module source.
13033    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
13034    /// Note: this is in the context of a module, so some core types may be hidden.
13035    pub fn introspection_schema_json(&self) -> File {
13036        let query = self.selection.select("introspectionSchemaJSON");
13037        File {
13038            proc: self.proc.clone(),
13039            selection: query,
13040            graphql_client: self.graphql_client.clone(),
13041        }
13042    }
13043    /// The kind of module source (currently local, git or dir).
13044    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
13045        let query = self.selection.select("kind");
13046        query.execute(self.graphql_client.clone()).await
13047    }
13048    /// The full absolute path to the context directory on the caller's host filesystem that this module source is loaded from. Only valid for local module sources.
13049    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
13050        let query = self.selection.select("localContextDirectoryPath");
13051        query.execute(self.graphql_client.clone()).await
13052    }
13053    /// The name of the module, including any setting via the withName API.
13054    pub async fn module_name(&self) -> Result<String, DaggerError> {
13055        let query = self.selection.select("moduleName");
13056        query.execute(self.graphql_client.clone()).await
13057    }
13058    /// The original name of the module as read from the module config file (or set for the first time with the withName API).
13059    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
13060        let query = self.selection.select("moduleOriginalName");
13061        query.execute(self.graphql_client.clone()).await
13062    }
13063    /// The original subpath used when instantiating this module source, relative to the context directory.
13064    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
13065        let query = self.selection.select("originalSubpath");
13066        query.execute(self.graphql_client.clone()).await
13067    }
13068    /// The pinned version of this module source.
13069    pub async fn pin(&self) -> Result<String, DaggerError> {
13070        let query = self.selection.select("pin");
13071        query.execute(self.graphql_client.clone()).await
13072    }
13073    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
13074    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
13075        let query = self.selection.select("repoRootPath");
13076        query.execute(self.graphql_client.clone()).await
13077    }
13078    /// The SDK configuration of the module.
13079    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
13080        let query = self.selection.select("sdk");
13081        let query = query.select("id");
13082        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13083        Ok(id.map(|id| SdkConfig {
13084            proc: self.proc.clone(),
13085            selection: query
13086                .root()
13087                .select("node")
13088                .arg("id", &id.0)
13089                .inline_fragment("SDKConfig"),
13090            graphql_client: self.graphql_client.clone(),
13091        }))
13092    }
13093    /// The path, relative to the context directory, that contains the module config.
13094    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
13095        let query = self.selection.select("sourceRootSubpath");
13096        query.execute(self.graphql_client.clone()).await
13097    }
13098    /// The path to the directory containing the module's source code, relative to the context directory.
13099    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
13100        let query = self.selection.select("sourceSubpath");
13101        query.execute(self.graphql_client.clone()).await
13102    }
13103    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
13104    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
13105        let query = self.selection.select("sync");
13106        let id: Id = query.execute(self.graphql_client.clone()).await?;
13107        Ok(ModuleSource {
13108            proc: self.proc.clone(),
13109            selection: query
13110                .root()
13111                .select("node")
13112                .arg("id", &id.0)
13113                .inline_fragment("ModuleSource"),
13114            graphql_client: self.graphql_client.clone(),
13115        })
13116    }
13117    /// The toolchains referenced by the module source.
13118    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
13119        let query = self.selection.select("toolchains");
13120        let query = query.select("id");
13121        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13122        Ok(ids
13123            .into_iter()
13124            .map(|id| ModuleSource {
13125                proc: self.proc.clone(),
13126                selection: crate::querybuilder::query()
13127                    .select("node")
13128                    .arg("id", &id.0)
13129                    .inline_fragment("ModuleSource"),
13130                graphql_client: self.graphql_client.clone(),
13131            })
13132            .collect())
13133    }
13134    /// The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.
13135    /// Unlike generatedContextDirectory, this does not run codegen and does not validate the engine version against the running engine, so it can be used to declare an engine requirement newer than the running engine. Loading or serving such a module still fails at moduleSource.asModule.
13136    pub fn updated_config_directory(&self) -> Directory {
13137        let query = self.selection.select("updatedConfigDirectory");
13138        Directory {
13139            proc: self.proc.clone(),
13140            selection: query,
13141            graphql_client: self.graphql_client.clone(),
13142        }
13143    }
13144    /// User-defined defaults read from local .env files
13145    pub fn user_defaults(&self) -> EnvFile {
13146        let query = self.selection.select("userDefaults");
13147        EnvFile {
13148            proc: self.proc.clone(),
13149            selection: query,
13150            graphql_client: self.graphql_client.clone(),
13151        }
13152    }
13153    /// The specified version of the git repo this source points to.
13154    pub async fn version(&self) -> Result<String, DaggerError> {
13155        let query = self.selection.select("version");
13156        query.execute(self.graphql_client.clone()).await
13157    }
13158    /// Set a blueprint for the module source.
13159    ///
13160    /// # Arguments
13161    ///
13162    /// * `blueprint` - The blueprint module to set.
13163    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
13164        let mut query = self.selection.select("withBlueprint");
13165        query = query.arg_lazy(
13166            "blueprint",
13167            Box::new(move || {
13168                let blueprint = blueprint.clone();
13169                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
13170            }),
13171        );
13172        ModuleSource {
13173            proc: self.proc.clone(),
13174            selection: query,
13175            graphql_client: self.graphql_client.clone(),
13176        }
13177    }
13178    /// Update the module source with a new client to generate.
13179    ///
13180    /// # Arguments
13181    ///
13182    /// * `generator` - The generator to use
13183    /// * `output_dir` - The output directory for the generated client.
13184    pub fn with_client(
13185        &self,
13186        generator: impl Into<String>,
13187        output_dir: impl Into<String>,
13188    ) -> ModuleSource {
13189        let mut query = self.selection.select("withClient");
13190        query = query.arg("generator", generator.into());
13191        query = query.arg("outputDir", output_dir.into());
13192        ModuleSource {
13193            proc: self.proc.clone(),
13194            selection: query,
13195            graphql_client: self.graphql_client.clone(),
13196        }
13197    }
13198    /// Append the provided dependencies to the module source's dependency list.
13199    ///
13200    /// # Arguments
13201    ///
13202    /// * `dependencies` - The dependencies to append.
13203    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
13204        let mut query = self.selection.select("withDependencies");
13205        query = query.arg("dependencies", dependencies);
13206        ModuleSource {
13207            proc: self.proc.clone(),
13208            selection: query,
13209            graphql_client: self.graphql_client.clone(),
13210        }
13211    }
13212    /// Upgrade the engine version of the module to the given value.
13213    ///
13214    /// # Arguments
13215    ///
13216    /// * `version` - The engine version to upgrade to.
13217    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
13218        let mut query = self.selection.select("withEngineVersion");
13219        query = query.arg("version", version.into());
13220        ModuleSource {
13221            proc: self.proc.clone(),
13222            selection: query,
13223            graphql_client: self.graphql_client.clone(),
13224        }
13225    }
13226    /// Enable the experimental features for the module source.
13227    ///
13228    /// # Arguments
13229    ///
13230    /// * `features` - The experimental features to enable.
13231    pub fn with_experimental_features(
13232        &self,
13233        features: Vec<ModuleSourceExperimentalFeature>,
13234    ) -> ModuleSource {
13235        let mut query = self.selection.select("withExperimentalFeatures");
13236        query = query.arg("features", features);
13237        ModuleSource {
13238            proc: self.proc.clone(),
13239            selection: query,
13240            graphql_client: self.graphql_client.clone(),
13241        }
13242    }
13243    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
13244    ///
13245    /// # Arguments
13246    ///
13247    /// * `patterns` - The new additional include patterns.
13248    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
13249        let mut query = self.selection.select("withIncludes");
13250        query = query.arg(
13251            "patterns",
13252            patterns
13253                .into_iter()
13254                .map(|i| i.into())
13255                .collect::<Vec<String>>(),
13256        );
13257        ModuleSource {
13258            proc: self.proc.clone(),
13259            selection: query,
13260            graphql_client: self.graphql_client.clone(),
13261        }
13262    }
13263    /// Update the module source with a new name.
13264    ///
13265    /// # Arguments
13266    ///
13267    /// * `name` - The name to set.
13268    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
13269        let mut query = self.selection.select("withName");
13270        query = query.arg("name", name.into());
13271        ModuleSource {
13272            proc: self.proc.clone(),
13273            selection: query,
13274            graphql_client: self.graphql_client.clone(),
13275        }
13276    }
13277    /// Update the module source with a new SDK.
13278    ///
13279    /// # Arguments
13280    ///
13281    /// * `source` - The SDK source to set.
13282    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
13283        let mut query = self.selection.select("withSDK");
13284        query = query.arg("source", source.into());
13285        ModuleSource {
13286            proc: self.proc.clone(),
13287            selection: query,
13288            graphql_client: self.graphql_client.clone(),
13289        }
13290    }
13291    /// Update the module source with a new source subpath.
13292    ///
13293    /// # Arguments
13294    ///
13295    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
13296    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
13297        let mut query = self.selection.select("withSourceSubpath");
13298        query = query.arg("path", path.into());
13299        ModuleSource {
13300            proc: self.proc.clone(),
13301            selection: query,
13302            graphql_client: self.graphql_client.clone(),
13303        }
13304    }
13305    /// Add toolchains to the module source.
13306    ///
13307    /// # Arguments
13308    ///
13309    /// * `toolchains` - The toolchain modules to add.
13310    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
13311        let mut query = self.selection.select("withToolchains");
13312        query = query.arg("toolchains", toolchains);
13313        ModuleSource {
13314            proc: self.proc.clone(),
13315            selection: query,
13316            graphql_client: self.graphql_client.clone(),
13317        }
13318    }
13319    /// Update the blueprint module to the latest version.
13320    pub fn with_update_blueprint(&self) -> ModuleSource {
13321        let query = self.selection.select("withUpdateBlueprint");
13322        ModuleSource {
13323            proc: self.proc.clone(),
13324            selection: query,
13325            graphql_client: self.graphql_client.clone(),
13326        }
13327    }
13328    /// Update one or more module dependencies.
13329    ///
13330    /// # Arguments
13331    ///
13332    /// * `dependencies` - The dependencies to update.
13333    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
13334        let mut query = self.selection.select("withUpdateDependencies");
13335        query = query.arg(
13336            "dependencies",
13337            dependencies
13338                .into_iter()
13339                .map(|i| i.into())
13340                .collect::<Vec<String>>(),
13341        );
13342        ModuleSource {
13343            proc: self.proc.clone(),
13344            selection: query,
13345            graphql_client: self.graphql_client.clone(),
13346        }
13347    }
13348    /// Update one or more toolchains.
13349    ///
13350    /// # Arguments
13351    ///
13352    /// * `toolchains` - The toolchains to update.
13353    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
13354        let mut query = self.selection.select("withUpdateToolchains");
13355        query = query.arg(
13356            "toolchains",
13357            toolchains
13358                .into_iter()
13359                .map(|i| i.into())
13360                .collect::<Vec<String>>(),
13361        );
13362        ModuleSource {
13363            proc: self.proc.clone(),
13364            selection: query,
13365            graphql_client: self.graphql_client.clone(),
13366        }
13367    }
13368    /// Update one or more clients.
13369    ///
13370    /// # Arguments
13371    ///
13372    /// * `clients` - The clients to update
13373    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
13374        let mut query = self.selection.select("withUpdatedClients");
13375        query = query.arg(
13376            "clients",
13377            clients
13378                .into_iter()
13379                .map(|i| i.into())
13380                .collect::<Vec<String>>(),
13381        );
13382        ModuleSource {
13383            proc: self.proc.clone(),
13384            selection: query,
13385            graphql_client: self.graphql_client.clone(),
13386        }
13387    }
13388    /// Remove the current blueprint from the module source.
13389    pub fn without_blueprint(&self) -> ModuleSource {
13390        let query = self.selection.select("withoutBlueprint");
13391        ModuleSource {
13392            proc: self.proc.clone(),
13393            selection: query,
13394            graphql_client: self.graphql_client.clone(),
13395        }
13396    }
13397    /// Remove a client from the module source.
13398    ///
13399    /// # Arguments
13400    ///
13401    /// * `path` - The path of the client to remove.
13402    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
13403        let mut query = self.selection.select("withoutClient");
13404        query = query.arg("path", path.into());
13405        ModuleSource {
13406            proc: self.proc.clone(),
13407            selection: query,
13408            graphql_client: self.graphql_client.clone(),
13409        }
13410    }
13411    /// Remove the provided dependencies from the module source's dependency list.
13412    ///
13413    /// # Arguments
13414    ///
13415    /// * `dependencies` - The dependencies to remove.
13416    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
13417        let mut query = self.selection.select("withoutDependencies");
13418        query = query.arg(
13419            "dependencies",
13420            dependencies
13421                .into_iter()
13422                .map(|i| i.into())
13423                .collect::<Vec<String>>(),
13424        );
13425        ModuleSource {
13426            proc: self.proc.clone(),
13427            selection: query,
13428            graphql_client: self.graphql_client.clone(),
13429        }
13430    }
13431    /// Disable experimental features for the module source.
13432    ///
13433    /// # Arguments
13434    ///
13435    /// * `features` - The experimental features to disable.
13436    pub fn without_experimental_features(
13437        &self,
13438        features: Vec<ModuleSourceExperimentalFeature>,
13439    ) -> ModuleSource {
13440        let mut query = self.selection.select("withoutExperimentalFeatures");
13441        query = query.arg("features", features);
13442        ModuleSource {
13443            proc: self.proc.clone(),
13444            selection: query,
13445            graphql_client: self.graphql_client.clone(),
13446        }
13447    }
13448    /// Remove the provided toolchains from the module source.
13449    ///
13450    /// # Arguments
13451    ///
13452    /// * `toolchains` - The toolchains to remove.
13453    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
13454        let mut query = self.selection.select("withoutToolchains");
13455        query = query.arg(
13456            "toolchains",
13457            toolchains
13458                .into_iter()
13459                .map(|i| i.into())
13460                .collect::<Vec<String>>(),
13461        );
13462        ModuleSource {
13463            proc: self.proc.clone(),
13464            selection: query,
13465            graphql_client: self.graphql_client.clone(),
13466        }
13467    }
13468}
13469impl Node for ModuleSource {
13470    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13471        let query = self.selection.select("id");
13472        let graphql_client = self.graphql_client.clone();
13473        async move { query.execute(graphql_client).await }
13474    }
13475}
13476impl Syncer for ModuleSource {
13477    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13478        let query = self.selection.select("id");
13479        let graphql_client = self.graphql_client.clone();
13480        async move { query.execute(graphql_client).await }
13481    }
13482    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13483        let query = self.selection.select("sync");
13484        let proc = self.proc.clone();
13485        let graphql_client = self.graphql_client.clone();
13486        async move {
13487            let id: Id = query.execute(graphql_client.clone()).await?;
13488            Ok(Self {
13489                proc,
13490                selection: query
13491                    .root()
13492                    .select("node")
13493                    .arg("id", &id.0)
13494                    .inline_fragment("ModuleSource"),
13495                graphql_client,
13496            })
13497        }
13498    }
13499}
13500#[derive(Clone)]
13501pub struct ObjectTypeDef {
13502    pub proc: Option<Arc<DaggerSessionProc>>,
13503    pub selection: Selection,
13504    pub graphql_client: DynGraphQLClient,
13505}
13506impl IntoID<Id> for ObjectTypeDef {
13507    fn into_id(
13508        self,
13509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13510        Box::pin(async move { self.id().await })
13511    }
13512}
13513impl Loadable for ObjectTypeDef {
13514    fn graphql_type() -> &'static str {
13515        "ObjectTypeDef"
13516    }
13517    fn from_query(
13518        proc: Option<Arc<DaggerSessionProc>>,
13519        selection: Selection,
13520        graphql_client: DynGraphQLClient,
13521    ) -> Self {
13522        Self {
13523            proc,
13524            selection,
13525            graphql_client,
13526        }
13527    }
13528}
13529impl ObjectTypeDef {
13530    /// The function used to construct new instances of this object, if any.
13531    pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
13532        let query = self.selection.select("constructor");
13533        let query = query.select("id");
13534        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13535        Ok(id.map(|id| Function {
13536            proc: self.proc.clone(),
13537            selection: query
13538                .root()
13539                .select("node")
13540                .arg("id", &id.0)
13541                .inline_fragment("Function"),
13542            graphql_client: self.graphql_client.clone(),
13543        }))
13544    }
13545    /// The reason this enum member is deprecated, if any.
13546    pub async fn deprecated(&self) -> Result<String, DaggerError> {
13547        let query = self.selection.select("deprecated");
13548        query.execute(self.graphql_client.clone()).await
13549    }
13550    /// The doc string for the object, if any.
13551    pub async fn description(&self) -> Result<String, DaggerError> {
13552        let query = self.selection.select("description");
13553        query.execute(self.graphql_client.clone()).await
13554    }
13555    /// Static fields defined on this object, if any.
13556    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
13557        let query = self.selection.select("fields");
13558        let query = query.select("id");
13559        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13560        Ok(ids
13561            .into_iter()
13562            .map(|id| FieldTypeDef {
13563                proc: self.proc.clone(),
13564                selection: crate::querybuilder::query()
13565                    .select("node")
13566                    .arg("id", &id.0)
13567                    .inline_fragment("FieldTypeDef"),
13568                graphql_client: self.graphql_client.clone(),
13569            })
13570            .collect())
13571    }
13572    /// Functions defined on this object, if any.
13573    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
13574        let query = self.selection.select("functions");
13575        let query = query.select("id");
13576        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13577        Ok(ids
13578            .into_iter()
13579            .map(|id| Function {
13580                proc: self.proc.clone(),
13581                selection: crate::querybuilder::query()
13582                    .select("node")
13583                    .arg("id", &id.0)
13584                    .inline_fragment("Function"),
13585                graphql_client: self.graphql_client.clone(),
13586            })
13587            .collect())
13588    }
13589    /// A unique identifier for this ObjectTypeDef.
13590    pub async fn id(&self) -> Result<Id, DaggerError> {
13591        let query = self.selection.select("id");
13592        query.execute(self.graphql_client.clone()).await
13593    }
13594    /// The name of the object.
13595    pub async fn name(&self) -> Result<String, DaggerError> {
13596        let query = self.selection.select("name");
13597        query.execute(self.graphql_client.clone()).await
13598    }
13599    /// The location of this object declaration.
13600    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
13601        let query = self.selection.select("sourceMap");
13602        let query = query.select("id");
13603        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13604        Ok(id.map(|id| SourceMap {
13605            proc: self.proc.clone(),
13606            selection: query
13607                .root()
13608                .select("node")
13609                .arg("id", &id.0)
13610                .inline_fragment("SourceMap"),
13611            graphql_client: self.graphql_client.clone(),
13612        }))
13613    }
13614    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
13615    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
13616        let query = self.selection.select("sourceModuleName");
13617        query.execute(self.graphql_client.clone()).await
13618    }
13619}
13620impl Node for ObjectTypeDef {
13621    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13622        let query = self.selection.select("id");
13623        let graphql_client = self.graphql_client.clone();
13624        async move { query.execute(graphql_client).await }
13625    }
13626}
13627#[derive(Clone)]
13628pub struct Port {
13629    pub proc: Option<Arc<DaggerSessionProc>>,
13630    pub selection: Selection,
13631    pub graphql_client: DynGraphQLClient,
13632}
13633impl IntoID<Id> for Port {
13634    fn into_id(
13635        self,
13636    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13637        Box::pin(async move { self.id().await })
13638    }
13639}
13640impl Loadable for Port {
13641    fn graphql_type() -> &'static str {
13642        "Port"
13643    }
13644    fn from_query(
13645        proc: Option<Arc<DaggerSessionProc>>,
13646        selection: Selection,
13647        graphql_client: DynGraphQLClient,
13648    ) -> Self {
13649        Self {
13650            proc,
13651            selection,
13652            graphql_client,
13653        }
13654    }
13655}
13656impl Port {
13657    /// The port description.
13658    pub async fn description(&self) -> Result<String, DaggerError> {
13659        let query = self.selection.select("description");
13660        query.execute(self.graphql_client.clone()).await
13661    }
13662    /// Skip the health check when run as a service.
13663    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
13664        let query = self.selection.select("experimentalSkipHealthcheck");
13665        query.execute(self.graphql_client.clone()).await
13666    }
13667    /// A unique identifier for this Port.
13668    pub async fn id(&self) -> Result<Id, DaggerError> {
13669        let query = self.selection.select("id");
13670        query.execute(self.graphql_client.clone()).await
13671    }
13672    /// The port number.
13673    pub async fn port(&self) -> Result<isize, DaggerError> {
13674        let query = self.selection.select("port");
13675        query.execute(self.graphql_client.clone()).await
13676    }
13677    /// The transport layer protocol.
13678    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
13679        let query = self.selection.select("protocol");
13680        query.execute(self.graphql_client.clone()).await
13681    }
13682}
13683impl Node for Port {
13684    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13685        let query = self.selection.select("id");
13686        let graphql_client = self.graphql_client.clone();
13687        async move { query.execute(graphql_client).await }
13688    }
13689}
13690#[derive(Clone)]
13691pub struct Query {
13692    pub proc: Option<Arc<DaggerSessionProc>>,
13693    pub selection: Selection,
13694    pub graphql_client: DynGraphQLClient,
13695}
13696#[derive(Builder, Debug, PartialEq)]
13697pub struct QueryBlobOpts {
13698    /// Permissions of the new file. Example: 0600
13699    #[builder(setter(into, strip_option), default)]
13700    pub permissions: Option<isize>,
13701}
13702#[derive(Builder, Debug, PartialEq)]
13703pub struct QueryCacheVolumeOpts<'a> {
13704    /// A user:group to set for the cache volume root.
13705    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
13706    /// If the group is omitted, it defaults to the same as the user.
13707    #[builder(setter(into, strip_option), default)]
13708    pub owner: Option<&'a str>,
13709    /// Sharing mode of the cache volume.
13710    #[builder(setter(into, strip_option), default)]
13711    pub sharing: Option<CacheSharingMode>,
13712    /// Identifier of the directory to use as the cache volume's root.
13713    #[builder(setter(into, strip_option), default)]
13714    pub source: Option<Id>,
13715}
13716#[derive(Builder, Debug, PartialEq)]
13717pub struct QueryContainerOpts {
13718    /// Platform to initialize the container with. Defaults to the native platform of the current engine
13719    #[builder(setter(into, strip_option), default)]
13720    pub platform: Option<Platform>,
13721}
13722#[derive(Builder, Debug, PartialEq)]
13723pub struct QueryCurrentTypeDefsOpts {
13724    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
13725    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
13726    #[builder(setter(into, strip_option), default)]
13727    pub hide_core: Option<bool>,
13728    /// Return the full referenced typedef closure instead of only top-level served typedefs.
13729    #[builder(setter(into, strip_option), default)]
13730    pub return_all_types: Option<bool>,
13731}
13732#[derive(Builder, Debug, PartialEq)]
13733pub struct QueryEngineVolumeOpts<'a> {
13734    /// Optional existing subdirectory within the volume payload to mount.
13735    #[builder(setter(into, strip_option), default)]
13736    pub subdir: Option<&'a str>,
13737}
13738#[derive(Builder, Debug, PartialEq)]
13739pub struct QueryEnvFileOpts {
13740    /// Replace "${VAR}" or "$VAR" with the value of other vars
13741    #[builder(setter(into, strip_option), default)]
13742    pub expand: Option<bool>,
13743}
13744#[derive(Builder, Debug, PartialEq)]
13745pub struct QueryFileOpts {
13746    /// Permissions of the new file. Example: 0600
13747    #[builder(setter(into, strip_option), default)]
13748    pub permissions: Option<isize>,
13749}
13750#[derive(Builder, Debug, PartialEq)]
13751pub struct QueryGitOpts<'a> {
13752    /// A service which must be started before the repo is fetched.
13753    #[builder(setter(into, strip_option), default)]
13754    pub experimental_service_host: Option<Id>,
13755    /// Secret used to populate the Authorization HTTP header
13756    #[builder(setter(into, strip_option), default)]
13757    pub http_auth_header: Option<Id>,
13758    /// Secret used to populate the password during basic HTTP Authorization
13759    #[builder(setter(into, strip_option), default)]
13760    pub http_auth_token: Option<Id>,
13761    /// Username used to populate the password during basic HTTP Authorization
13762    #[builder(setter(into, strip_option), default)]
13763    pub http_auth_username: Option<&'a str>,
13764    /// DEPRECATED: Set to true to keep .git directory.
13765    #[builder(setter(into, strip_option), default)]
13766    pub keep_git_dir: Option<bool>,
13767    /// Set SSH auth socket
13768    #[builder(setter(into, strip_option), default)]
13769    pub ssh_auth_socket: Option<Id>,
13770    /// Set SSH known hosts
13771    #[builder(setter(into, strip_option), default)]
13772    pub ssh_known_hosts: Option<&'a str>,
13773}
13774#[derive(Builder, Debug, PartialEq)]
13775pub struct QueryHttpOpts<'a> {
13776    /// Secret used to populate the Authorization HTTP header
13777    #[builder(setter(into, strip_option), default)]
13778    pub auth_header: Option<Id>,
13779    /// Expected digest of the downloaded content (e.g., "sha256:...").
13780    #[builder(setter(into, strip_option), default)]
13781    pub checksum: Option<&'a str>,
13782    /// A service which must be started before the URL is fetched.
13783    #[builder(setter(into, strip_option), default)]
13784    pub experimental_service_host: Option<Id>,
13785    /// File name to use for the file. Defaults to the last part of the URL.
13786    #[builder(setter(into, strip_option), default)]
13787    pub name: Option<&'a str>,
13788    /// Permissions to set on the file.
13789    #[builder(setter(into, strip_option), default)]
13790    pub permissions: Option<isize>,
13791}
13792#[derive(Builder, Debug, PartialEq)]
13793pub struct QueryLlmOpts<'a> {
13794    /// The model to converse with, e.g. "claude-sonnet-4-5" or "gpt-5.4". Defaults to the configured default model.
13795    #[builder(setter(into, strip_option), default)]
13796    pub model: Option<&'a str>,
13797    /// The provider serving the model, e.g. "openai". Overrides the provider otherwise inferred from the model name — useful when the name matches no known pattern (e.g. a fine-tune), or matches the wrong one.
13798    #[builder(setter(into, strip_option), default)]
13799    pub provider: Option<&'a str>,
13800}
13801#[derive(Builder, Debug, PartialEq)]
13802pub struct QueryModuleSourceOpts<'a> {
13803    /// If true, do not error out if the provided ref string is a local path and does not exist yet. Useful when initializing new modules in directories that don't exist yet.
13804    #[builder(setter(into, strip_option), default)]
13805    pub allow_not_exists: Option<bool>,
13806    /// If true, do not attempt to find a module config file in a parent directory of the provided path. Only relevant for local module sources.
13807    #[builder(setter(into, strip_option), default)]
13808    pub disable_find_up: Option<bool>,
13809    /// The pinned version of the module source
13810    #[builder(setter(into, strip_option), default)]
13811    pub ref_pin: Option<&'a str>,
13812    /// If set, error out if the ref string is not of the provided requireKind.
13813    #[builder(setter(into, strip_option), default)]
13814    pub require_kind: Option<ModuleSourceKind>,
13815    /// Version query for a Git module source.
13816    #[builder(setter(into, strip_option), default)]
13817    pub version: Option<&'a str>,
13818}
13819#[derive(Builder, Debug, PartialEq)]
13820pub struct QuerySecretOpts<'a> {
13821    /// If set, the given string will be used as the cache key for this secret. This means that any secrets with the same cache key will be considered equivalent in terms of cache lookups, even if they have different URIs or plaintext values.
13822    /// For example, two secrets with the same cache key provided as secret env vars to other wise equivalent containers will result in the container withExecs hitting the cache for each other.
13823    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
13824    #[builder(setter(into, strip_option), default)]
13825    pub cache_key: Option<&'a str>,
13826}
13827#[derive(Builder, Debug, PartialEq)]
13828pub struct QueryServeModuleOpts<'a> {
13829    /// The pinned version of a remote module address.
13830    #[builder(setter(into, strip_option), default)]
13831    pub ref_pin: Option<&'a str>,
13832}
13833#[derive(Builder, Debug, PartialEq)]
13834pub struct QuerySshfsVolumeOpts<'a> {
13835    /// Optional cache equivalence key. If set, volumes with the same cacheKey may be considered equivalent for cache lookups, still subject to their resource dependencies.
13836    #[builder(setter(into, strip_option), default)]
13837    pub cache_key: Option<&'a str>,
13838    /// Service to use as the SSHFS network endpoint while verifying the original host key.
13839    #[builder(setter(into, strip_option), default)]
13840    pub experimental_service_host: Option<Id>,
13841    /// Disable SSH host key verification. This is insecure and must be explicitly opted into.
13842    #[builder(setter(into, strip_option), default)]
13843    pub insecure_skip_host_key_check: Option<bool>,
13844    /// known_hosts material used to verify the remote host key. Required unless insecureSkipHostKeyCheck is true.
13845    #[builder(setter(into, strip_option), default)]
13846    pub known_hosts: Option<Id>,
13847}
13848impl IntoID<Id> for Query {
13849    fn into_id(
13850        self,
13851    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13852        Box::pin(async move { self.id().await })
13853    }
13854}
13855impl Loadable for Query {
13856    fn graphql_type() -> &'static str {
13857        "Query"
13858    }
13859    fn from_query(
13860        proc: Option<Arc<DaggerSessionProc>>,
13861        selection: Selection,
13862        graphql_client: DynGraphQLClient,
13863    ) -> Self {
13864        Self {
13865            proc,
13866            selection,
13867            graphql_client,
13868        }
13869    }
13870}
13871impl Query {
13872    /// initialize an address to load directories, containers, secrets or other object types.
13873    pub fn address(&self, value: impl Into<String>) -> Address {
13874        let mut query = self.selection.select("address");
13875        query = query.arg("value", value.into());
13876        Address {
13877            proc: self.proc.clone(),
13878            selection: query,
13879            graphql_client: self.graphql_client.clone(),
13880        }
13881    }
13882    /// Creates a file from arbitrary binary contents.
13883    ///
13884    /// # Arguments
13885    ///
13886    /// * `name` - Name of the new file. Example: "archive.tar"
13887    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
13888    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13889    pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
13890        let mut query = self.selection.select("blob");
13891        query = query.arg("name", name.into());
13892        query = query.arg("contents", contents);
13893        File {
13894            proc: self.proc.clone(),
13895            selection: query,
13896            graphql_client: self.graphql_client.clone(),
13897        }
13898    }
13899    /// Creates a file from arbitrary binary contents.
13900    ///
13901    /// # Arguments
13902    ///
13903    /// * `name` - Name of the new file. Example: "archive.tar"
13904    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
13905    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13906    pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
13907        let mut query = self.selection.select("blob");
13908        query = query.arg("name", name.into());
13909        query = query.arg("contents", contents);
13910        if let Some(permissions) = opts.permissions {
13911            query = query.arg("permissions", permissions);
13912        }
13913        File {
13914            proc: self.proc.clone(),
13915            selection: query,
13916            graphql_client: self.graphql_client.clone(),
13917        }
13918    }
13919    /// Constructs a cache volume for a given cache key.
13920    ///
13921    /// # Arguments
13922    ///
13923    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
13924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13925    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
13926        let mut query = self.selection.select("cacheVolume");
13927        query = query.arg("key", key.into());
13928        CacheVolume {
13929            proc: self.proc.clone(),
13930            selection: query,
13931            graphql_client: self.graphql_client.clone(),
13932        }
13933    }
13934    /// Constructs a cache volume for a given cache key.
13935    ///
13936    /// # Arguments
13937    ///
13938    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
13939    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13940    pub fn cache_volume_opts<'a>(
13941        &self,
13942        key: impl Into<String>,
13943        opts: QueryCacheVolumeOpts<'a>,
13944    ) -> CacheVolume {
13945        let mut query = self.selection.select("cacheVolume");
13946        query = query.arg("key", key.into());
13947        if let Some(source) = opts.source {
13948            query = query.arg("source", source);
13949        }
13950        if let Some(sharing) = opts.sharing {
13951            query = query.arg("sharing", sharing);
13952        }
13953        if let Some(owner) = opts.owner {
13954            query = query.arg("owner", owner);
13955        }
13956        CacheVolume {
13957            proc: self.proc.clone(),
13958            selection: query,
13959            graphql_client: self.graphql_client.clone(),
13960        }
13961    }
13962    /// Creates an empty changeset
13963    pub fn changeset(&self) -> Changeset {
13964        let query = self.selection.select("changeset");
13965        Changeset {
13966            proc: self.proc.clone(),
13967            selection: query,
13968            graphql_client: self.graphql_client.clone(),
13969        }
13970    }
13971    /// Dagger Cloud configuration and state
13972    pub fn cloud(&self) -> Cloud {
13973        let query = self.selection.select("cloud");
13974        Cloud {
13975            proc: self.proc.clone(),
13976            selection: query,
13977            graphql_client: self.graphql_client.clone(),
13978        }
13979    }
13980    /// Creates a scratch container, with no image or metadata.
13981    /// To pull an image, follow up with the "from" function.
13982    ///
13983    /// # Arguments
13984    ///
13985    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13986    pub fn container(&self) -> Container {
13987        let query = self.selection.select("container");
13988        Container {
13989            proc: self.proc.clone(),
13990            selection: query,
13991            graphql_client: self.graphql_client.clone(),
13992        }
13993    }
13994    /// Creates a scratch container, with no image or metadata.
13995    /// To pull an image, follow up with the "from" function.
13996    ///
13997    /// # Arguments
13998    ///
13999    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14000    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
14001        let mut query = self.selection.select("container");
14002        if let Some(platform) = opts.platform {
14003            query = query.arg("platform", platform);
14004        }
14005        Container {
14006            proc: self.proc.clone(),
14007            selection: query,
14008            graphql_client: self.graphql_client.clone(),
14009        }
14010    }
14011    /// The FunctionCall context that the SDK caller is currently executing in.
14012    /// If the caller is not currently executing in a function, this will return an error.
14013    pub fn current_function_call(&self) -> FunctionCall {
14014        let query = self.selection.select("currentFunctionCall");
14015        FunctionCall {
14016            proc: self.proc.clone(),
14017            selection: query,
14018            graphql_client: self.graphql_client.clone(),
14019        }
14020    }
14021    /// The module currently being served in the session, if any.
14022    pub fn current_module(&self) -> CurrentModule {
14023        let query = self.selection.select("currentModule");
14024        CurrentModule {
14025            proc: self.proc.clone(),
14026            selection: query,
14027            graphql_client: self.graphql_client.clone(),
14028        }
14029    }
14030    /// The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).
14031    pub fn current_node(&self) -> NodeClient {
14032        let query = self.selection.select("currentNode");
14033        NodeClient {
14034            proc: self.proc.clone(),
14035            selection: query,
14036            graphql_client: self.graphql_client.clone(),
14037        }
14038    }
14039    /// The current UTC time in RFC3339 format. Never cached.
14040    pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
14041        let query = self.selection.select("currentTimestamp");
14042        query.execute(self.graphql_client.clone()).await
14043    }
14044    /// The TypeDef representations of the objects currently being served in the session.
14045    ///
14046    /// # Arguments
14047    ///
14048    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14049    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
14050        let query = self.selection.select("currentTypeDefs");
14051        let query = query.select("id");
14052        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14053        Ok(ids
14054            .into_iter()
14055            .map(|id| TypeDef {
14056                proc: self.proc.clone(),
14057                selection: crate::querybuilder::query()
14058                    .select("node")
14059                    .arg("id", &id.0)
14060                    .inline_fragment("TypeDef"),
14061                graphql_client: self.graphql_client.clone(),
14062            })
14063            .collect())
14064    }
14065    /// The TypeDef representations of the objects currently being served in the session.
14066    ///
14067    /// # Arguments
14068    ///
14069    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14070    pub async fn current_type_defs_opts(
14071        &self,
14072        opts: QueryCurrentTypeDefsOpts,
14073    ) -> Result<Vec<TypeDef>, DaggerError> {
14074        let mut query = self.selection.select("currentTypeDefs");
14075        if let Some(return_all_types) = opts.return_all_types {
14076            query = query.arg("returnAllTypes", return_all_types);
14077        }
14078        if let Some(hide_core) = opts.hide_core {
14079            query = query.arg("hideCore", hide_core);
14080        }
14081        let query = query.select("id");
14082        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14083        Ok(ids
14084            .into_iter()
14085            .map(|id| TypeDef {
14086                proc: self.proc.clone(),
14087                selection: crate::querybuilder::query()
14088                    .select("node")
14089                    .arg("id", &id.0)
14090                    .inline_fragment("TypeDef"),
14091                graphql_client: self.graphql_client.clone(),
14092            })
14093            .collect())
14094    }
14095    /// Detect and return the current workspace.
14096    pub fn current_workspace(&self) -> Workspace {
14097        let query = self.selection.select("currentWorkspace");
14098        Workspace {
14099            proc: self.proc.clone(),
14100            selection: query,
14101            graphql_client: self.graphql_client.clone(),
14102        }
14103    }
14104    /// The default platform of the engine.
14105    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
14106        let query = self.selection.select("defaultPlatform");
14107        query.execute(self.graphql_client.clone()).await
14108    }
14109    /// Creates an empty directory.
14110    pub fn directory(&self) -> Directory {
14111        let query = self.selection.select("directory");
14112        Directory {
14113            proc: self.proc.clone(),
14114            selection: query,
14115            graphql_client: self.graphql_client.clone(),
14116        }
14117    }
14118    /// The Dagger engine container configuration and state
14119    pub fn engine(&self) -> Engine {
14120        let query = self.selection.select("engine");
14121        Engine {
14122            proc: self.proc.clone(),
14123            selection: query,
14124            graphql_client: self.graphql_client.clone(),
14125        }
14126    }
14127    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
14128    ///
14129    /// # Arguments
14130    ///
14131    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
14132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14133    pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
14134        let mut query = self.selection.select("engineVolume");
14135        query = query.arg("name", name.into());
14136        Volume {
14137            proc: self.proc.clone(),
14138            selection: query,
14139            graphql_client: self.graphql_client.clone(),
14140        }
14141    }
14142    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
14143    ///
14144    /// # Arguments
14145    ///
14146    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
14147    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14148    pub fn engine_volume_opts<'a>(
14149        &self,
14150        name: impl Into<String>,
14151        opts: QueryEngineVolumeOpts<'a>,
14152    ) -> Volume {
14153        let mut query = self.selection.select("engineVolume");
14154        query = query.arg("name", name.into());
14155        if let Some(subdir) = opts.subdir {
14156            query = query.arg("subdir", subdir);
14157        }
14158        Volume {
14159            proc: self.proc.clone(),
14160            selection: query,
14161            graphql_client: self.graphql_client.clone(),
14162        }
14163    }
14164    /// Initialize an environment file
14165    ///
14166    /// # Arguments
14167    ///
14168    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14169    pub fn env_file(&self) -> EnvFile {
14170        let query = self.selection.select("envFile");
14171        EnvFile {
14172            proc: self.proc.clone(),
14173            selection: query,
14174            graphql_client: self.graphql_client.clone(),
14175        }
14176    }
14177    /// Initialize an environment file
14178    ///
14179    /// # Arguments
14180    ///
14181    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14182    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
14183        let mut query = self.selection.select("envFile");
14184        if let Some(expand) = opts.expand {
14185            query = query.arg("expand", expand);
14186        }
14187        EnvFile {
14188            proc: self.proc.clone(),
14189            selection: query,
14190            graphql_client: self.graphql_client.clone(),
14191        }
14192    }
14193    /// Create a new error.
14194    ///
14195    /// # Arguments
14196    ///
14197    /// * `message` - A brief description of the error.
14198    pub fn error(&self, message: impl Into<String>) -> Error {
14199        let mut query = self.selection.select("error");
14200        query = query.arg("message", message.into());
14201        Error {
14202            proc: self.proc.clone(),
14203            selection: query,
14204            graphql_client: self.graphql_client.clone(),
14205        }
14206    }
14207    /// Creates a file with the specified contents.
14208    ///
14209    /// # Arguments
14210    ///
14211    /// * `name` - Name of the new file. Example: "foo.txt"
14212    /// * `contents` - Contents of the new file. Example: "Hello world!"
14213    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14214    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
14215        let mut query = self.selection.select("file");
14216        query = query.arg("name", name.into());
14217        query = query.arg("contents", contents.into());
14218        File {
14219            proc: self.proc.clone(),
14220            selection: query,
14221            graphql_client: self.graphql_client.clone(),
14222        }
14223    }
14224    /// Creates a file with the specified contents.
14225    ///
14226    /// # Arguments
14227    ///
14228    /// * `name` - Name of the new file. Example: "foo.txt"
14229    /// * `contents` - Contents of the new file. Example: "Hello world!"
14230    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14231    pub fn file_opts(
14232        &self,
14233        name: impl Into<String>,
14234        contents: impl Into<String>,
14235        opts: QueryFileOpts,
14236    ) -> File {
14237        let mut query = self.selection.select("file");
14238        query = query.arg("name", name.into());
14239        query = query.arg("contents", contents.into());
14240        if let Some(permissions) = opts.permissions {
14241            query = query.arg("permissions", permissions);
14242        }
14243        File {
14244            proc: self.proc.clone(),
14245            selection: query,
14246            graphql_client: self.graphql_client.clone(),
14247        }
14248    }
14249    /// Creates a function.
14250    ///
14251    /// # Arguments
14252    ///
14253    /// * `name` - Name of the function, in its original format from the implementation language.
14254    /// * `return_type` - Return type of the function.
14255    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
14256        let mut query = self.selection.select("function");
14257        query = query.arg("name", name.into());
14258        query = query.arg_lazy(
14259            "returnType",
14260            Box::new(move || {
14261                let return_type = return_type.clone();
14262                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
14263            }),
14264        );
14265        Function {
14266            proc: self.proc.clone(),
14267            selection: query,
14268            graphql_client: self.graphql_client.clone(),
14269        }
14270    }
14271    /// Create a code generation result, given a directory containing the generated code.
14272    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
14273        let mut query = self.selection.select("generatedCode");
14274        query = query.arg_lazy(
14275            "code",
14276            Box::new(move || {
14277                let code = code.clone();
14278                Box::pin(async move { code.into_id().await.unwrap().quote() })
14279            }),
14280        );
14281        GeneratedCode {
14282            proc: self.proc.clone(),
14283            selection: query,
14284            graphql_client: self.graphql_client.clone(),
14285        }
14286    }
14287    /// Queries a Git repository.
14288    ///
14289    /// # Arguments
14290    ///
14291    /// * `url` - URL of the git repository.
14292    ///
14293    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
14294    ///
14295    /// Suffix ".git" is optional.
14296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14297    pub fn git(&self, url: impl Into<String>) -> GitRepository {
14298        let mut query = self.selection.select("git");
14299        query = query.arg("url", url.into());
14300        GitRepository {
14301            proc: self.proc.clone(),
14302            selection: query,
14303            graphql_client: self.graphql_client.clone(),
14304        }
14305    }
14306    /// Queries a Git repository.
14307    ///
14308    /// # Arguments
14309    ///
14310    /// * `url` - URL of the git repository.
14311    ///
14312    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
14313    ///
14314    /// Suffix ".git" is optional.
14315    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14316    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
14317        let mut query = self.selection.select("git");
14318        query = query.arg("url", url.into());
14319        if let Some(keep_git_dir) = opts.keep_git_dir {
14320            query = query.arg("keepGitDir", keep_git_dir);
14321        }
14322        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
14323            query = query.arg("sshKnownHosts", ssh_known_hosts);
14324        }
14325        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
14326            query = query.arg("sshAuthSocket", ssh_auth_socket);
14327        }
14328        if let Some(http_auth_username) = opts.http_auth_username {
14329            query = query.arg("httpAuthUsername", http_auth_username);
14330        }
14331        if let Some(http_auth_token) = opts.http_auth_token {
14332            query = query.arg("httpAuthToken", http_auth_token);
14333        }
14334        if let Some(http_auth_header) = opts.http_auth_header {
14335            query = query.arg("httpAuthHeader", http_auth_header);
14336        }
14337        if let Some(experimental_service_host) = opts.experimental_service_host {
14338            query = query.arg("experimentalServiceHost", experimental_service_host);
14339        }
14340        GitRepository {
14341            proc: self.proc.clone(),
14342            selection: query,
14343            graphql_client: self.graphql_client.clone(),
14344        }
14345    }
14346    /// Queries the host environment.
14347    pub fn host(&self) -> Host {
14348        let query = self.selection.select("host");
14349        Host {
14350            proc: self.proc.clone(),
14351            selection: query,
14352            graphql_client: self.graphql_client.clone(),
14353        }
14354    }
14355    /// Returns a file containing an http remote url content.
14356    ///
14357    /// # Arguments
14358    ///
14359    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
14360    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14361    pub fn http(&self, url: impl Into<String>) -> File {
14362        let mut query = self.selection.select("http");
14363        query = query.arg("url", url.into());
14364        File {
14365            proc: self.proc.clone(),
14366            selection: query,
14367            graphql_client: self.graphql_client.clone(),
14368        }
14369    }
14370    /// Returns a file containing an http remote url content.
14371    ///
14372    /// # Arguments
14373    ///
14374    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
14375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14376    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
14377        let mut query = self.selection.select("http");
14378        query = query.arg("url", url.into());
14379        if let Some(name) = opts.name {
14380            query = query.arg("name", name);
14381        }
14382        if let Some(permissions) = opts.permissions {
14383            query = query.arg("permissions", permissions);
14384        }
14385        if let Some(checksum) = opts.checksum {
14386            query = query.arg("checksum", checksum);
14387        }
14388        if let Some(auth_header) = opts.auth_header {
14389            query = query.arg("authHeader", auth_header);
14390        }
14391        if let Some(experimental_service_host) = opts.experimental_service_host {
14392            query = query.arg("experimentalServiceHost", experimental_service_host);
14393        }
14394        File {
14395            proc: self.proc.clone(),
14396            selection: query,
14397            graphql_client: self.graphql_client.clone(),
14398        }
14399    }
14400    /// A unique identifier for this Query.
14401    pub async fn id(&self) -> Result<Id, DaggerError> {
14402        let query = self.selection.select("id");
14403        query.execute(self.graphql_client.clone()).await
14404    }
14405    /// Initialize a JSON value
14406    pub fn json(&self) -> JsonValue {
14407        let query = self.selection.select("json");
14408        JsonValue {
14409            proc: self.proc.clone(),
14410            selection: query,
14411            graphql_client: self.graphql_client.clone(),
14412        }
14413    }
14414    /// Initialize a new LLM conversation.
14415    ///
14416    /// # Arguments
14417    ///
14418    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14419    pub fn llm(&self) -> Llm {
14420        let query = self.selection.select("llm");
14421        Llm {
14422            proc: self.proc.clone(),
14423            selection: query,
14424            graphql_client: self.graphql_client.clone(),
14425        }
14426    }
14427    /// Initialize a new LLM conversation.
14428    ///
14429    /// # Arguments
14430    ///
14431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14432    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
14433        let mut query = self.selection.select("llm");
14434        if let Some(model) = opts.model {
14435            query = query.arg("model", model);
14436        }
14437        if let Some(provider) = opts.provider {
14438            query = query.arg("provider", provider);
14439        }
14440        Llm {
14441            proc: self.proc.clone(),
14442            selection: query,
14443            graphql_client: self.graphql_client.clone(),
14444        }
14445    }
14446    /// Create a new module.
14447    pub fn module(&self) -> Module {
14448        let query = self.selection.select("module");
14449        Module {
14450            proc: self.proc.clone(),
14451            selection: query,
14452            graphql_client: self.graphql_client.clone(),
14453        }
14454    }
14455    /// Create a new module source instance from a source ref string
14456    ///
14457    /// # Arguments
14458    ///
14459    /// * `ref_string` - The string ref representation of the module source
14460    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14461    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14462        let mut query = self.selection.select("moduleSource");
14463        query = query.arg("refString", ref_string.into());
14464        ModuleSource {
14465            proc: self.proc.clone(),
14466            selection: query,
14467            graphql_client: self.graphql_client.clone(),
14468        }
14469    }
14470    /// Create a new module source instance from a source ref string
14471    ///
14472    /// # Arguments
14473    ///
14474    /// * `ref_string` - The string ref representation of the module source
14475    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14476    pub fn module_source_opts<'a>(
14477        &self,
14478        ref_string: impl Into<String>,
14479        opts: QueryModuleSourceOpts<'a>,
14480    ) -> ModuleSource {
14481        let mut query = self.selection.select("moduleSource");
14482        query = query.arg("refString", ref_string.into());
14483        if let Some(version) = opts.version {
14484            query = query.arg("version", version);
14485        }
14486        if let Some(ref_pin) = opts.ref_pin {
14487            query = query.arg("refPin", ref_pin);
14488        }
14489        if let Some(disable_find_up) = opts.disable_find_up {
14490            query = query.arg("disableFindUp", disable_find_up);
14491        }
14492        if let Some(allow_not_exists) = opts.allow_not_exists {
14493            query = query.arg("allowNotExists", allow_not_exists);
14494        }
14495        if let Some(require_kind) = opts.require_kind {
14496            query = query.arg("requireKind", require_kind);
14497        }
14498        ModuleSource {
14499            proc: self.proc.clone(),
14500            selection: query,
14501            graphql_client: self.graphql_client.clone(),
14502        }
14503    }
14504    /// Load any object by its ID.
14505    pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
14506        let mut query = self.selection.select("node");
14507        query = query.arg_lazy(
14508            "id",
14509            Box::new(move || {
14510                let id = id.clone();
14511                Box::pin(async move { id.into_id().await.unwrap().quote() })
14512            }),
14513        );
14514        let query = query.select("id");
14515        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14516        Ok(id.map(|id| NodeClient {
14517            proc: self.proc.clone(),
14518            selection: query
14519                .root()
14520                .select("node")
14521                .arg("id", &id.0)
14522                .inline_fragment("Node"),
14523            graphql_client: self.graphql_client.clone(),
14524        }))
14525    }
14526    /// Load a GraphQL introspection schema for merging.
14527    ///
14528    /// # Arguments
14529    ///
14530    /// * `json` - The introspection schema JSON to load.
14531    pub fn schema(&self, json: Json) -> Schema {
14532        let mut query = self.selection.select("schema");
14533        query = query.arg("json", json);
14534        Schema {
14535            proc: self.proc.clone(),
14536            selection: query,
14537            graphql_client: self.graphql_client.clone(),
14538        }
14539    }
14540    /// Creates a new secret.
14541    ///
14542    /// # Arguments
14543    ///
14544    /// * `uri` - The URI of the secret store
14545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14546    pub fn secret(&self, uri: impl Into<String>) -> Secret {
14547        let mut query = self.selection.select("secret");
14548        query = query.arg("uri", uri.into());
14549        Secret {
14550            proc: self.proc.clone(),
14551            selection: query,
14552            graphql_client: self.graphql_client.clone(),
14553        }
14554    }
14555    /// Creates a new secret.
14556    ///
14557    /// # Arguments
14558    ///
14559    /// * `uri` - The URI of the secret store
14560    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14561    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14562        let mut query = self.selection.select("secret");
14563        query = query.arg("uri", uri.into());
14564        if let Some(cache_key) = opts.cache_key {
14565            query = query.arg("cacheKey", cache_key);
14566        }
14567        Secret {
14568            proc: self.proc.clone(),
14569            selection: query,
14570            graphql_client: self.graphql_client.clone(),
14571        }
14572    }
14573    /// Load the module at the given address and serve its API in the current session.
14574    /// A local address resolves against the caller's workspace, so a generated client can serve the module it is bound to without reaching for the workspace itself.
14575    ///
14576    /// # Arguments
14577    ///
14578    /// * `address` - A module address, or an explicit path into the caller's workspace.
14579    ///
14580    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
14581    ///
14582    /// Installed module names are not accepted.
14583    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14584    pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
14585        let mut query = self.selection.select("serveModule");
14586        query = query.arg("address", address.into());
14587        query.execute(self.graphql_client.clone()).await
14588    }
14589    /// Load the module at the given address and serve its API in the current session.
14590    /// A local address resolves against the caller's workspace, so a generated client can serve the module it is bound to without reaching for the workspace itself.
14591    ///
14592    /// # Arguments
14593    ///
14594    /// * `address` - A module address, or an explicit path into the caller's workspace.
14595    ///
14596    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
14597    ///
14598    /// Installed module names are not accepted.
14599    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14600    pub async fn serve_module_opts<'a>(
14601        &self,
14602        address: impl Into<String>,
14603        opts: QueryServeModuleOpts<'a>,
14604    ) -> Result<Void, DaggerError> {
14605        let mut query = self.selection.select("serveModule");
14606        query = query.arg("address", address.into());
14607        if let Some(ref_pin) = opts.ref_pin {
14608            query = query.arg("refPin", ref_pin);
14609        }
14610        query.execute(self.graphql_client.clone()).await
14611    }
14612    /// Sets a secret given a user defined name to its plaintext and returns the secret.
14613    /// The plaintext value is limited to a size of 128000 bytes.
14614    ///
14615    /// # Arguments
14616    ///
14617    /// * `name` - The user defined name for this secret
14618    /// * `plaintext` - The plaintext of the secret
14619    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14620        let mut query = self.selection.select("setSecret");
14621        query = query.arg("name", name.into());
14622        query = query.arg("plaintext", plaintext.into());
14623        Secret {
14624            proc: self.proc.clone(),
14625            selection: query,
14626            graphql_client: self.graphql_client.clone(),
14627        }
14628    }
14629    /// Creates source map metadata.
14630    ///
14631    /// # Arguments
14632    ///
14633    /// * `filename` - The filename from the module source.
14634    /// * `line` - The line number within the filename.
14635    /// * `column` - The column number within the line.
14636    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14637        let mut query = self.selection.select("sourceMap");
14638        query = query.arg("filename", filename.into());
14639        query = query.arg("line", line);
14640        query = query.arg("column", column);
14641        SourceMap {
14642            proc: self.proc.clone(),
14643            selection: query,
14644            graphql_client: self.graphql_client.clone(),
14645        }
14646    }
14647    /// Constructs an SSHFS volume.
14648    ///
14649    /// # Arguments
14650    ///
14651    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
14652    /// * `private_key` - Private key secret used to authenticate to the remote host.
14653    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14654    pub fn sshfs_volume(
14655        &self,
14656        endpoint: impl Into<String>,
14657        private_key: impl IntoID<Id>,
14658    ) -> Volume {
14659        let mut query = self.selection.select("sshfsVolume");
14660        query = query.arg("endpoint", endpoint.into());
14661        query = query.arg_lazy(
14662            "privateKey",
14663            Box::new(move || {
14664                let private_key = private_key.clone();
14665                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14666            }),
14667        );
14668        Volume {
14669            proc: self.proc.clone(),
14670            selection: query,
14671            graphql_client: self.graphql_client.clone(),
14672        }
14673    }
14674    /// Constructs an SSHFS volume.
14675    ///
14676    /// # Arguments
14677    ///
14678    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
14679    /// * `private_key` - Private key secret used to authenticate to the remote host.
14680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14681    pub fn sshfs_volume_opts<'a>(
14682        &self,
14683        endpoint: impl Into<String>,
14684        private_key: impl IntoID<Id>,
14685        opts: QuerySshfsVolumeOpts<'a>,
14686    ) -> Volume {
14687        let mut query = self.selection.select("sshfsVolume");
14688        query = query.arg("endpoint", endpoint.into());
14689        query = query.arg_lazy(
14690            "privateKey",
14691            Box::new(move || {
14692                let private_key = private_key.clone();
14693                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14694            }),
14695        );
14696        if let Some(known_hosts) = opts.known_hosts {
14697            query = query.arg("knownHosts", known_hosts);
14698        }
14699        if let Some(cache_key) = opts.cache_key {
14700            query = query.arg("cacheKey", cache_key);
14701        }
14702        if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
14703            query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
14704        }
14705        if let Some(experimental_service_host) = opts.experimental_service_host {
14706            query = query.arg("experimentalServiceHost", experimental_service_host);
14707        }
14708        Volume {
14709            proc: self.proc.clone(),
14710            selection: query,
14711            graphql_client: self.graphql_client.clone(),
14712        }
14713    }
14714    /// Create a new TypeDef.
14715    pub fn type_def(&self) -> TypeDef {
14716        let query = self.selection.select("typeDef");
14717        TypeDef {
14718            proc: self.proc.clone(),
14719            selection: query,
14720            graphql_client: self.graphql_client.clone(),
14721        }
14722    }
14723    /// Get the current Dagger Engine version.
14724    pub async fn version(&self) -> Result<String, DaggerError> {
14725        let query = self.selection.select("version");
14726        query.execute(self.graphql_client.clone()).await
14727    }
14728}
14729impl Node for Query {
14730    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14731        let query = self.selection.select("id");
14732        let graphql_client = self.graphql_client.clone();
14733        async move { query.execute(graphql_client).await }
14734    }
14735}
14736#[derive(Clone)]
14737pub struct RemoteGitMirror {
14738    pub proc: Option<Arc<DaggerSessionProc>>,
14739    pub selection: Selection,
14740    pub graphql_client: DynGraphQLClient,
14741}
14742impl IntoID<Id> for RemoteGitMirror {
14743    fn into_id(
14744        self,
14745    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14746        Box::pin(async move { self.id().await })
14747    }
14748}
14749impl Loadable for RemoteGitMirror {
14750    fn graphql_type() -> &'static str {
14751        "RemoteGitMirror"
14752    }
14753    fn from_query(
14754        proc: Option<Arc<DaggerSessionProc>>,
14755        selection: Selection,
14756        graphql_client: DynGraphQLClient,
14757    ) -> Self {
14758        Self {
14759            proc,
14760            selection,
14761            graphql_client,
14762        }
14763    }
14764}
14765impl RemoteGitMirror {
14766    /// A unique identifier for this RemoteGitMirror.
14767    pub async fn id(&self) -> Result<Id, DaggerError> {
14768        let query = self.selection.select("id");
14769        query.execute(self.graphql_client.clone()).await
14770    }
14771}
14772impl Node for RemoteGitMirror {
14773    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14774        let query = self.selection.select("id");
14775        let graphql_client = self.graphql_client.clone();
14776        async move { query.execute(graphql_client).await }
14777    }
14778}
14779#[derive(Clone)]
14780pub struct SdkConfig {
14781    pub proc: Option<Arc<DaggerSessionProc>>,
14782    pub selection: Selection,
14783    pub graphql_client: DynGraphQLClient,
14784}
14785impl IntoID<Id> for SdkConfig {
14786    fn into_id(
14787        self,
14788    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14789        Box::pin(async move { self.id().await })
14790    }
14791}
14792impl Loadable for SdkConfig {
14793    fn graphql_type() -> &'static str {
14794        "SDKConfig"
14795    }
14796    fn from_query(
14797        proc: Option<Arc<DaggerSessionProc>>,
14798        selection: Selection,
14799        graphql_client: DynGraphQLClient,
14800    ) -> Self {
14801        Self {
14802            proc,
14803            selection,
14804            graphql_client,
14805        }
14806    }
14807}
14808impl SdkConfig {
14809    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
14810    pub async fn debug(&self) -> Result<bool, DaggerError> {
14811        let query = self.selection.select("debug");
14812        query.execute(self.graphql_client.clone()).await
14813    }
14814    /// A unique identifier for this SDKConfig.
14815    pub async fn id(&self) -> Result<Id, DaggerError> {
14816        let query = self.selection.select("id");
14817        query.execute(self.graphql_client.clone()).await
14818    }
14819    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
14820    pub async fn source(&self) -> Result<String, DaggerError> {
14821        let query = self.selection.select("source");
14822        query.execute(self.graphql_client.clone()).await
14823    }
14824}
14825impl Node for SdkConfig {
14826    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14827        let query = self.selection.select("id");
14828        let graphql_client = self.graphql_client.clone();
14829        async move { query.execute(graphql_client).await }
14830    }
14831}
14832#[derive(Clone)]
14833pub struct ScalarTypeDef {
14834    pub proc: Option<Arc<DaggerSessionProc>>,
14835    pub selection: Selection,
14836    pub graphql_client: DynGraphQLClient,
14837}
14838impl IntoID<Id> for ScalarTypeDef {
14839    fn into_id(
14840        self,
14841    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14842        Box::pin(async move { self.id().await })
14843    }
14844}
14845impl Loadable for ScalarTypeDef {
14846    fn graphql_type() -> &'static str {
14847        "ScalarTypeDef"
14848    }
14849    fn from_query(
14850        proc: Option<Arc<DaggerSessionProc>>,
14851        selection: Selection,
14852        graphql_client: DynGraphQLClient,
14853    ) -> Self {
14854        Self {
14855            proc,
14856            selection,
14857            graphql_client,
14858        }
14859    }
14860}
14861impl ScalarTypeDef {
14862    /// A doc string for the scalar, if any.
14863    pub async fn description(&self) -> Result<String, DaggerError> {
14864        let query = self.selection.select("description");
14865        query.execute(self.graphql_client.clone()).await
14866    }
14867    /// A unique identifier for this ScalarTypeDef.
14868    pub async fn id(&self) -> Result<Id, DaggerError> {
14869        let query = self.selection.select("id");
14870        query.execute(self.graphql_client.clone()).await
14871    }
14872    /// The name of the scalar.
14873    pub async fn name(&self) -> Result<String, DaggerError> {
14874        let query = self.selection.select("name");
14875        query.execute(self.graphql_client.clone()).await
14876    }
14877    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
14878    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14879        let query = self.selection.select("sourceModuleName");
14880        query.execute(self.graphql_client.clone()).await
14881    }
14882}
14883impl Node for ScalarTypeDef {
14884    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14885        let query = self.selection.select("id");
14886        let graphql_client = self.graphql_client.clone();
14887        async move { query.execute(graphql_client).await }
14888    }
14889}
14890#[derive(Clone)]
14891pub struct Schema {
14892    pub proc: Option<Arc<DaggerSessionProc>>,
14893    pub selection: Selection,
14894    pub graphql_client: DynGraphQLClient,
14895}
14896impl IntoID<Id> for Schema {
14897    fn into_id(
14898        self,
14899    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14900        Box::pin(async move { self.id().await })
14901    }
14902}
14903impl Loadable for Schema {
14904    fn graphql_type() -> &'static str {
14905        "Schema"
14906    }
14907    fn from_query(
14908        proc: Option<Arc<DaggerSessionProc>>,
14909        selection: Selection,
14910        graphql_client: DynGraphQLClient,
14911    ) -> Self {
14912        Self {
14913            proc,
14914            selection,
14915            graphql_client,
14916        }
14917    }
14918}
14919impl Schema {
14920    /// Serialize the schema back to introspection JSON.
14921    pub async fn contents(&self) -> Result<Json, DaggerError> {
14922        let query = self.selection.select("contents");
14923        query.execute(self.graphql_client.clone()).await
14924    }
14925    /// A unique identifier for this Schema.
14926    pub async fn id(&self) -> Result<Id, DaggerError> {
14927        let query = self.selection.select("id");
14928        query.execute(self.graphql_client.clone()).await
14929    }
14930    /// Merge a module's introspection-shaped type definitions into the schema, returning the combined schema.
14931    ///
14932    /// # Arguments
14933    ///
14934    /// * `module_types` - Introspection JSON describing the types the module defines. Object, interface and enum types are appended to the schema, and a constructor field for the module is added to the Query type.
14935    /// * `module_name` - The name of the module whose types are being merged. Used to stamp the @sourceMap directive and to derive the module's constructor field.
14936    pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
14937        let mut query = self.selection.select("merge");
14938        query = query.arg("moduleTypes", module_types);
14939        query = query.arg("moduleName", module_name.into());
14940        Schema {
14941            proc: self.proc.clone(),
14942            selection: query,
14943            graphql_client: self.graphql_client.clone(),
14944        }
14945    }
14946}
14947impl Node for Schema {
14948    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14949        let query = self.selection.select("id");
14950        let graphql_client = self.graphql_client.clone();
14951        async move { query.execute(graphql_client).await }
14952    }
14953}
14954#[derive(Clone)]
14955pub struct SearchResult {
14956    pub proc: Option<Arc<DaggerSessionProc>>,
14957    pub selection: Selection,
14958    pub graphql_client: DynGraphQLClient,
14959}
14960impl IntoID<Id> for SearchResult {
14961    fn into_id(
14962        self,
14963    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14964        Box::pin(async move { self.id().await })
14965    }
14966}
14967impl Loadable for SearchResult {
14968    fn graphql_type() -> &'static str {
14969        "SearchResult"
14970    }
14971    fn from_query(
14972        proc: Option<Arc<DaggerSessionProc>>,
14973        selection: Selection,
14974        graphql_client: DynGraphQLClient,
14975    ) -> Self {
14976        Self {
14977            proc,
14978            selection,
14979            graphql_client,
14980        }
14981    }
14982}
14983impl SearchResult {
14984    /// The byte offset of this line within the file.
14985    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14986        let query = self.selection.select("absoluteOffset");
14987        query.execute(self.graphql_client.clone()).await
14988    }
14989    /// The path to the file that matched.
14990    pub async fn file_path(&self) -> Result<String, DaggerError> {
14991        let query = self.selection.select("filePath");
14992        query.execute(self.graphql_client.clone()).await
14993    }
14994    /// A unique identifier for this SearchResult.
14995    pub async fn id(&self) -> Result<Id, DaggerError> {
14996        let query = self.selection.select("id");
14997        query.execute(self.graphql_client.clone()).await
14998    }
14999    /// The first line that matched.
15000    pub async fn line_number(&self) -> Result<isize, DaggerError> {
15001        let query = self.selection.select("lineNumber");
15002        query.execute(self.graphql_client.clone()).await
15003    }
15004    /// The line content that matched.
15005    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
15006        let query = self.selection.select("matchedLines");
15007        query.execute(self.graphql_client.clone()).await
15008    }
15009    /// Sub-match positions and content within the matched lines.
15010    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
15011        let query = self.selection.select("submatches");
15012        let query = query.select("id");
15013        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15014        Ok(ids
15015            .into_iter()
15016            .map(|id| SearchSubmatch {
15017                proc: self.proc.clone(),
15018                selection: crate::querybuilder::query()
15019                    .select("node")
15020                    .arg("id", &id.0)
15021                    .inline_fragment("SearchSubmatch"),
15022                graphql_client: self.graphql_client.clone(),
15023            })
15024            .collect())
15025    }
15026}
15027impl Node for SearchResult {
15028    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15029        let query = self.selection.select("id");
15030        let graphql_client = self.graphql_client.clone();
15031        async move { query.execute(graphql_client).await }
15032    }
15033}
15034#[derive(Clone)]
15035pub struct SearchSubmatch {
15036    pub proc: Option<Arc<DaggerSessionProc>>,
15037    pub selection: Selection,
15038    pub graphql_client: DynGraphQLClient,
15039}
15040impl IntoID<Id> for SearchSubmatch {
15041    fn into_id(
15042        self,
15043    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15044        Box::pin(async move { self.id().await })
15045    }
15046}
15047impl Loadable for SearchSubmatch {
15048    fn graphql_type() -> &'static str {
15049        "SearchSubmatch"
15050    }
15051    fn from_query(
15052        proc: Option<Arc<DaggerSessionProc>>,
15053        selection: Selection,
15054        graphql_client: DynGraphQLClient,
15055    ) -> Self {
15056        Self {
15057            proc,
15058            selection,
15059            graphql_client,
15060        }
15061    }
15062}
15063impl SearchSubmatch {
15064    /// The match's end offset within the matched lines.
15065    pub async fn end(&self) -> Result<isize, DaggerError> {
15066        let query = self.selection.select("end");
15067        query.execute(self.graphql_client.clone()).await
15068    }
15069    /// A unique identifier for this SearchSubmatch.
15070    pub async fn id(&self) -> Result<Id, DaggerError> {
15071        let query = self.selection.select("id");
15072        query.execute(self.graphql_client.clone()).await
15073    }
15074    /// The match's start offset within the matched lines.
15075    pub async fn start(&self) -> Result<isize, DaggerError> {
15076        let query = self.selection.select("start");
15077        query.execute(self.graphql_client.clone()).await
15078    }
15079    /// The matched text.
15080    pub async fn text(&self) -> Result<String, DaggerError> {
15081        let query = self.selection.select("text");
15082        query.execute(self.graphql_client.clone()).await
15083    }
15084}
15085impl Node for SearchSubmatch {
15086    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15087        let query = self.selection.select("id");
15088        let graphql_client = self.graphql_client.clone();
15089        async move { query.execute(graphql_client).await }
15090    }
15091}
15092#[derive(Clone)]
15093pub struct Secret {
15094    pub proc: Option<Arc<DaggerSessionProc>>,
15095    pub selection: Selection,
15096    pub graphql_client: DynGraphQLClient,
15097}
15098impl IntoID<Id> for Secret {
15099    fn into_id(
15100        self,
15101    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15102        Box::pin(async move { self.id().await })
15103    }
15104}
15105impl Loadable for Secret {
15106    fn graphql_type() -> &'static str {
15107        "Secret"
15108    }
15109    fn from_query(
15110        proc: Option<Arc<DaggerSessionProc>>,
15111        selection: Selection,
15112        graphql_client: DynGraphQLClient,
15113    ) -> Self {
15114        Self {
15115            proc,
15116            selection,
15117            graphql_client,
15118        }
15119    }
15120}
15121impl Secret {
15122    /// A unique identifier for this Secret.
15123    pub async fn id(&self) -> Result<Id, DaggerError> {
15124        let query = self.selection.select("id");
15125        query.execute(self.graphql_client.clone()).await
15126    }
15127    /// The name of this secret.
15128    pub async fn name(&self) -> Result<String, DaggerError> {
15129        let query = self.selection.select("name");
15130        query.execute(self.graphql_client.clone()).await
15131    }
15132    /// The value of this secret.
15133    pub async fn plaintext(&self) -> Result<String, DaggerError> {
15134        let query = self.selection.select("plaintext");
15135        query.execute(self.graphql_client.clone()).await
15136    }
15137    /// The URI of this secret.
15138    pub async fn uri(&self) -> Result<String, DaggerError> {
15139        let query = self.selection.select("uri");
15140        query.execute(self.graphql_client.clone()).await
15141    }
15142}
15143impl Node for Secret {
15144    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15145        let query = self.selection.select("id");
15146        let graphql_client = self.graphql_client.clone();
15147        async move { query.execute(graphql_client).await }
15148    }
15149}
15150#[derive(Clone)]
15151pub struct Service {
15152    pub proc: Option<Arc<DaggerSessionProc>>,
15153    pub selection: Selection,
15154    pub graphql_client: DynGraphQLClient,
15155}
15156#[derive(Builder, Debug, PartialEq)]
15157pub struct ServiceEndpointOpts<'a> {
15158    /// The exposed port number for the endpoint
15159    #[builder(setter(into, strip_option), default)]
15160    pub port: Option<isize>,
15161    /// Return a URL with the given scheme, eg. http for http://
15162    #[builder(setter(into, strip_option), default)]
15163    pub scheme: Option<&'a str>,
15164}
15165#[derive(Builder, Debug, PartialEq)]
15166pub struct ServiceStopOpts {
15167    /// Immediately kill the service without waiting for a graceful exit
15168    #[builder(setter(into, strip_option), default)]
15169    pub kill: Option<bool>,
15170}
15171#[derive(Builder, Debug, PartialEq)]
15172pub struct ServiceTerminalOpts<'a> {
15173    #[builder(setter(into, strip_option), default)]
15174    pub cmd: Option<Vec<&'a str>>,
15175}
15176#[derive(Builder, Debug, PartialEq)]
15177pub struct ServiceUpOpts {
15178    /// List of frontend/backend port mappings to forward.
15179    /// Frontend is the port accepting traffic on the host, backend is the service port.
15180    #[builder(setter(into, strip_option), default)]
15181    pub ports: Option<Vec<PortForward>>,
15182    /// Bind each tunnel port to a random port on the host.
15183    #[builder(setter(into, strip_option), default)]
15184    pub random: Option<bool>,
15185}
15186impl IntoID<Id> for Service {
15187    fn into_id(
15188        self,
15189    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15190        Box::pin(async move { self.id().await })
15191    }
15192}
15193impl Loadable for Service {
15194    fn graphql_type() -> &'static str {
15195        "Service"
15196    }
15197    fn from_query(
15198        proc: Option<Arc<DaggerSessionProc>>,
15199        selection: Selection,
15200        graphql_client: DynGraphQLClient,
15201    ) -> Self {
15202        Self {
15203            proc,
15204            selection,
15205            graphql_client,
15206        }
15207    }
15208}
15209impl Service {
15210    /// Retrieves an endpoint that clients can use to reach this container.
15211    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15212    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15213    ///
15214    /// # Arguments
15215    ///
15216    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15217    pub async fn endpoint(&self) -> Result<String, DaggerError> {
15218        let query = self.selection.select("endpoint");
15219        query.execute(self.graphql_client.clone()).await
15220    }
15221    /// Retrieves an endpoint that clients can use to reach this container.
15222    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15223    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15224    ///
15225    /// # Arguments
15226    ///
15227    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15228    pub async fn endpoint_opts<'a>(
15229        &self,
15230        opts: ServiceEndpointOpts<'a>,
15231    ) -> Result<String, DaggerError> {
15232        let mut query = self.selection.select("endpoint");
15233        if let Some(port) = opts.port {
15234            query = query.arg("port", port);
15235        }
15236        if let Some(scheme) = opts.scheme {
15237            query = query.arg("scheme", scheme);
15238        }
15239        query.execute(self.graphql_client.clone()).await
15240    }
15241    /// Retrieves a hostname which can be used by clients to reach this container.
15242    pub async fn hostname(&self) -> Result<String, DaggerError> {
15243        let query = self.selection.select("hostname");
15244        query.execute(self.graphql_client.clone()).await
15245    }
15246    /// A unique identifier for this Service.
15247    pub async fn id(&self) -> Result<Id, DaggerError> {
15248        let query = self.selection.select("id");
15249        query.execute(self.graphql_client.clone()).await
15250    }
15251    /// Retrieves the list of ports provided by the service.
15252    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15253        let query = self.selection.select("ports");
15254        let query = query.select("id");
15255        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15256        Ok(ids
15257            .into_iter()
15258            .map(|id| Port {
15259                proc: self.proc.clone(),
15260                selection: crate::querybuilder::query()
15261                    .select("node")
15262                    .arg("id", &id.0)
15263                    .inline_fragment("Port"),
15264                graphql_client: self.graphql_client.clone(),
15265            })
15266            .collect())
15267    }
15268    /// Start the service and wait for its health checks to succeed.
15269    /// Services bound to a Container do not need to be manually started.
15270    pub async fn start(&self) -> Result<Service, DaggerError> {
15271        let query = self.selection.select("start");
15272        let id: Id = query.execute(self.graphql_client.clone()).await?;
15273        Ok(Service {
15274            proc: self.proc.clone(),
15275            selection: query
15276                .root()
15277                .select("node")
15278                .arg("id", &id.0)
15279                .inline_fragment("Service"),
15280            graphql_client: self.graphql_client.clone(),
15281        })
15282    }
15283    /// Stop the service.
15284    ///
15285    /// # Arguments
15286    ///
15287    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15288    pub async fn stop(&self) -> Result<Service, DaggerError> {
15289        let query = self.selection.select("stop");
15290        let id: Id = query.execute(self.graphql_client.clone()).await?;
15291        Ok(Service {
15292            proc: self.proc.clone(),
15293            selection: query
15294                .root()
15295                .select("node")
15296                .arg("id", &id.0)
15297                .inline_fragment("Service"),
15298            graphql_client: self.graphql_client.clone(),
15299        })
15300    }
15301    /// Stop the service.
15302    ///
15303    /// # Arguments
15304    ///
15305    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15306    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15307        let mut query = self.selection.select("stop");
15308        if let Some(kill) = opts.kill {
15309            query = query.arg("kill", kill);
15310        }
15311        let id: Id = query.execute(self.graphql_client.clone()).await?;
15312        Ok(Service {
15313            proc: self.proc.clone(),
15314            selection: query
15315                .root()
15316                .select("node")
15317                .arg("id", &id.0)
15318                .inline_fragment("Service"),
15319            graphql_client: self.graphql_client.clone(),
15320        })
15321    }
15322    /// Forces evaluation of the pipeline in the engine.
15323    pub async fn sync(&self) -> Result<Service, DaggerError> {
15324        let query = self.selection.select("sync");
15325        let id: Id = query.execute(self.graphql_client.clone()).await?;
15326        Ok(Service {
15327            proc: self.proc.clone(),
15328            selection: query
15329                .root()
15330                .select("node")
15331                .arg("id", &id.0)
15332                .inline_fragment("Service"),
15333            graphql_client: self.graphql_client.clone(),
15334        })
15335    }
15336    ///
15337    /// # Arguments
15338    ///
15339    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15340    pub fn terminal(&self) -> Service {
15341        let query = self.selection.select("terminal");
15342        Service {
15343            proc: self.proc.clone(),
15344            selection: query,
15345            graphql_client: self.graphql_client.clone(),
15346        }
15347    }
15348    ///
15349    /// # Arguments
15350    ///
15351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15352    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15353        let mut query = self.selection.select("terminal");
15354        if let Some(cmd) = opts.cmd {
15355            query = query.arg("cmd", cmd);
15356        }
15357        Service {
15358            proc: self.proc.clone(),
15359            selection: query,
15360            graphql_client: self.graphql_client.clone(),
15361        }
15362    }
15363    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15364    ///
15365    /// # Arguments
15366    ///
15367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15368    pub async fn up(&self) -> Result<Void, DaggerError> {
15369        let query = self.selection.select("up");
15370        query.execute(self.graphql_client.clone()).await
15371    }
15372    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15373    ///
15374    /// # Arguments
15375    ///
15376    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15377    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15378        let mut query = self.selection.select("up");
15379        if let Some(ports) = opts.ports {
15380            query = query.arg("ports", ports);
15381        }
15382        if let Some(random) = opts.random {
15383            query = query.arg("random", random);
15384        }
15385        query.execute(self.graphql_client.clone()).await
15386    }
15387    /// Configures a hostname which can be used by clients within the session to reach this container.
15388    ///
15389    /// # Arguments
15390    ///
15391    /// * `hostname` - The hostname to use.
15392    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15393        let mut query = self.selection.select("withHostname");
15394        query = query.arg("hostname", hostname.into());
15395        Service {
15396            proc: self.proc.clone(),
15397            selection: query,
15398            graphql_client: self.graphql_client.clone(),
15399        }
15400    }
15401}
15402impl Node for Service {
15403    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15404        let query = self.selection.select("id");
15405        let graphql_client = self.graphql_client.clone();
15406        async move { query.execute(graphql_client).await }
15407    }
15408}
15409impl Syncer for Service {
15410    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15411        let query = self.selection.select("id");
15412        let graphql_client = self.graphql_client.clone();
15413        async move { query.execute(graphql_client).await }
15414    }
15415    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15416        let query = self.selection.select("sync");
15417        let proc = self.proc.clone();
15418        let graphql_client = self.graphql_client.clone();
15419        async move {
15420            let id: Id = query.execute(graphql_client.clone()).await?;
15421            Ok(Self {
15422                proc,
15423                selection: query
15424                    .root()
15425                    .select("node")
15426                    .arg("id", &id.0)
15427                    .inline_fragment("Service"),
15428                graphql_client,
15429            })
15430        }
15431    }
15432}
15433#[derive(Clone)]
15434pub struct Socket {
15435    pub proc: Option<Arc<DaggerSessionProc>>,
15436    pub selection: Selection,
15437    pub graphql_client: DynGraphQLClient,
15438}
15439impl IntoID<Id> for Socket {
15440    fn into_id(
15441        self,
15442    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15443        Box::pin(async move { self.id().await })
15444    }
15445}
15446impl Loadable for Socket {
15447    fn graphql_type() -> &'static str {
15448        "Socket"
15449    }
15450    fn from_query(
15451        proc: Option<Arc<DaggerSessionProc>>,
15452        selection: Selection,
15453        graphql_client: DynGraphQLClient,
15454    ) -> Self {
15455        Self {
15456            proc,
15457            selection,
15458            graphql_client,
15459        }
15460    }
15461}
15462impl Socket {
15463    /// A unique identifier for this Socket.
15464    pub async fn id(&self) -> Result<Id, DaggerError> {
15465        let query = self.selection.select("id");
15466        query.execute(self.graphql_client.clone()).await
15467    }
15468}
15469impl Node for Socket {
15470    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15471        let query = self.selection.select("id");
15472        let graphql_client = self.graphql_client.clone();
15473        async move { query.execute(graphql_client).await }
15474    }
15475}
15476#[derive(Clone)]
15477pub struct SourceMap {
15478    pub proc: Option<Arc<DaggerSessionProc>>,
15479    pub selection: Selection,
15480    pub graphql_client: DynGraphQLClient,
15481}
15482impl IntoID<Id> for SourceMap {
15483    fn into_id(
15484        self,
15485    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15486        Box::pin(async move { self.id().await })
15487    }
15488}
15489impl Loadable for SourceMap {
15490    fn graphql_type() -> &'static str {
15491        "SourceMap"
15492    }
15493    fn from_query(
15494        proc: Option<Arc<DaggerSessionProc>>,
15495        selection: Selection,
15496        graphql_client: DynGraphQLClient,
15497    ) -> Self {
15498        Self {
15499            proc,
15500            selection,
15501            graphql_client,
15502        }
15503    }
15504}
15505impl SourceMap {
15506    /// The column number within the line.
15507    pub async fn column(&self) -> Result<isize, DaggerError> {
15508        let query = self.selection.select("column");
15509        query.execute(self.graphql_client.clone()).await
15510    }
15511    /// The filename from the module source.
15512    pub async fn filename(&self) -> Result<String, DaggerError> {
15513        let query = self.selection.select("filename");
15514        query.execute(self.graphql_client.clone()).await
15515    }
15516    /// A unique identifier for this SourceMap.
15517    pub async fn id(&self) -> Result<Id, DaggerError> {
15518        let query = self.selection.select("id");
15519        query.execute(self.graphql_client.clone()).await
15520    }
15521    /// The line number within the filename.
15522    pub async fn line(&self) -> Result<isize, DaggerError> {
15523        let query = self.selection.select("line");
15524        query.execute(self.graphql_client.clone()).await
15525    }
15526    /// The module dependency this was declared in.
15527    pub async fn module(&self) -> Result<String, DaggerError> {
15528        let query = self.selection.select("module");
15529        query.execute(self.graphql_client.clone()).await
15530    }
15531    /// The URL to the file, if any. This can be used to link to the source map in the browser.
15532    pub async fn url(&self) -> Result<String, DaggerError> {
15533        let query = self.selection.select("url");
15534        query.execute(self.graphql_client.clone()).await
15535    }
15536}
15537impl Node for SourceMap {
15538    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15539        let query = self.selection.select("id");
15540        let graphql_client = self.graphql_client.clone();
15541        async move { query.execute(graphql_client).await }
15542    }
15543}
15544#[derive(Clone)]
15545pub struct Stat {
15546    pub proc: Option<Arc<DaggerSessionProc>>,
15547    pub selection: Selection,
15548    pub graphql_client: DynGraphQLClient,
15549}
15550impl IntoID<Id> for Stat {
15551    fn into_id(
15552        self,
15553    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15554        Box::pin(async move { self.id().await })
15555    }
15556}
15557impl Loadable for Stat {
15558    fn graphql_type() -> &'static str {
15559        "Stat"
15560    }
15561    fn from_query(
15562        proc: Option<Arc<DaggerSessionProc>>,
15563        selection: Selection,
15564        graphql_client: DynGraphQLClient,
15565    ) -> Self {
15566        Self {
15567            proc,
15568            selection,
15569            graphql_client,
15570        }
15571    }
15572}
15573impl Stat {
15574    /// file type
15575    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15576        let query = self.selection.select("fileType");
15577        query.execute(self.graphql_client.clone()).await
15578    }
15579    /// A unique identifier for this Stat.
15580    pub async fn id(&self) -> Result<Id, DaggerError> {
15581        let query = self.selection.select("id");
15582        query.execute(self.graphql_client.clone()).await
15583    }
15584    /// file name
15585    pub async fn name(&self) -> Result<String, DaggerError> {
15586        let query = self.selection.select("name");
15587        query.execute(self.graphql_client.clone()).await
15588    }
15589    /// permission bits
15590    pub async fn permissions(&self) -> Result<isize, DaggerError> {
15591        let query = self.selection.select("permissions");
15592        query.execute(self.graphql_client.clone()).await
15593    }
15594    /// file size
15595    pub async fn size(&self) -> Result<isize, DaggerError> {
15596        let query = self.selection.select("size");
15597        query.execute(self.graphql_client.clone()).await
15598    }
15599}
15600impl Node for Stat {
15601    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15602        let query = self.selection.select("id");
15603        let graphql_client = self.graphql_client.clone();
15604        async move { query.execute(graphql_client).await }
15605    }
15606}
15607#[derive(Clone)]
15608pub struct Terminal {
15609    pub proc: Option<Arc<DaggerSessionProc>>,
15610    pub selection: Selection,
15611    pub graphql_client: DynGraphQLClient,
15612}
15613impl IntoID<Id> for Terminal {
15614    fn into_id(
15615        self,
15616    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15617        Box::pin(async move { self.id().await })
15618    }
15619}
15620impl Loadable for Terminal {
15621    fn graphql_type() -> &'static str {
15622        "Terminal"
15623    }
15624    fn from_query(
15625        proc: Option<Arc<DaggerSessionProc>>,
15626        selection: Selection,
15627        graphql_client: DynGraphQLClient,
15628    ) -> Self {
15629        Self {
15630            proc,
15631            selection,
15632            graphql_client,
15633        }
15634    }
15635}
15636impl Terminal {
15637    /// A unique identifier for this Terminal.
15638    pub async fn id(&self) -> Result<Id, DaggerError> {
15639        let query = self.selection.select("id");
15640        query.execute(self.graphql_client.clone()).await
15641    }
15642    /// Forces evaluation of the pipeline in the engine.
15643    /// It doesn't run the default command if no exec has been set.
15644    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15645        let query = self.selection.select("sync");
15646        let id: Id = query.execute(self.graphql_client.clone()).await?;
15647        Ok(Terminal {
15648            proc: self.proc.clone(),
15649            selection: query
15650                .root()
15651                .select("node")
15652                .arg("id", &id.0)
15653                .inline_fragment("Terminal"),
15654            graphql_client: self.graphql_client.clone(),
15655        })
15656    }
15657}
15658impl Node for Terminal {
15659    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15660        let query = self.selection.select("id");
15661        let graphql_client = self.graphql_client.clone();
15662        async move { query.execute(graphql_client).await }
15663    }
15664}
15665impl Syncer for Terminal {
15666    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15667        let query = self.selection.select("id");
15668        let graphql_client = self.graphql_client.clone();
15669        async move { query.execute(graphql_client).await }
15670    }
15671    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15672        let query = self.selection.select("sync");
15673        let proc = self.proc.clone();
15674        let graphql_client = self.graphql_client.clone();
15675        async move {
15676            let id: Id = query.execute(graphql_client.clone()).await?;
15677            Ok(Self {
15678                proc,
15679                selection: query
15680                    .root()
15681                    .select("node")
15682                    .arg("id", &id.0)
15683                    .inline_fragment("Terminal"),
15684                graphql_client,
15685            })
15686        }
15687    }
15688}
15689#[derive(Clone)]
15690pub struct TerminalGroup {
15691    pub proc: Option<Arc<DaggerSessionProc>>,
15692    pub selection: Selection,
15693    pub graphql_client: DynGraphQLClient,
15694}
15695impl IntoID<Id> for TerminalGroup {
15696    fn into_id(
15697        self,
15698    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15699        Box::pin(async move { self.id().await })
15700    }
15701}
15702impl Loadable for TerminalGroup {
15703    fn graphql_type() -> &'static str {
15704        "TerminalGroup"
15705    }
15706    fn from_query(
15707        proc: Option<Arc<DaggerSessionProc>>,
15708        selection: Selection,
15709        graphql_client: DynGraphQLClient,
15710    ) -> Self {
15711        Self {
15712            proc,
15713            selection,
15714            graphql_client,
15715        }
15716    }
15717}
15718impl TerminalGroup {
15719    /// A unique identifier for this TerminalGroup.
15720    pub async fn id(&self) -> Result<Id, DaggerError> {
15721        let query = self.selection.select("id");
15722        query.execute(self.graphql_client.clone()).await
15723    }
15724    /// Return the selected terminal targets and their details
15725    pub async fn list(&self) -> Result<Vec<TerminalTarget>, DaggerError> {
15726        let query = self.selection.select("list");
15727        let query = query.select("id");
15728        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15729        Ok(ids
15730            .into_iter()
15731            .map(|id| TerminalTarget {
15732                proc: self.proc.clone(),
15733                selection: crate::querybuilder::query()
15734                    .select("node")
15735                    .arg("id", &id.0)
15736                    .inline_fragment("TerminalTarget"),
15737                graphql_client: self.graphql_client.clone(),
15738            })
15739            .collect())
15740    }
15741    /// Open the selected terminal target
15742    pub fn run(&self) -> TerminalGroup {
15743        let query = self.selection.select("run");
15744        TerminalGroup {
15745            proc: self.proc.clone(),
15746            selection: query,
15747            graphql_client: self.graphql_client.clone(),
15748        }
15749    }
15750}
15751impl Node for TerminalGroup {
15752    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15753        let query = self.selection.select("id");
15754        let graphql_client = self.graphql_client.clone();
15755        async move { query.execute(graphql_client).await }
15756    }
15757}
15758#[derive(Clone)]
15759pub struct TerminalTarget {
15760    pub proc: Option<Arc<DaggerSessionProc>>,
15761    pub selection: Selection,
15762    pub graphql_client: DynGraphQLClient,
15763}
15764impl IntoID<Id> for TerminalTarget {
15765    fn into_id(
15766        self,
15767    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15768        Box::pin(async move { self.id().await })
15769    }
15770}
15771impl Loadable for TerminalTarget {
15772    fn graphql_type() -> &'static str {
15773        "TerminalTarget"
15774    }
15775    fn from_query(
15776        proc: Option<Arc<DaggerSessionProc>>,
15777        selection: Selection,
15778        graphql_client: DynGraphQLClient,
15779    ) -> Self {
15780        Self {
15781            proc,
15782            selection,
15783            graphql_client,
15784        }
15785    }
15786}
15787impl TerminalTarget {
15788    /// The description of the terminal target
15789    pub async fn description(&self) -> Result<String, DaggerError> {
15790        let query = self.selection.select("description");
15791        query.execute(self.graphql_client.clone()).await
15792    }
15793    /// A unique identifier for this TerminalTarget.
15794    pub async fn id(&self) -> Result<Id, DaggerError> {
15795        let query = self.selection.select("id");
15796        query.execute(self.graphql_client.clone()).await
15797    }
15798    /// Return the command name of the terminal target. Entrypoint targets omit the module prefix.
15799    pub async fn name(&self) -> Result<String, DaggerError> {
15800        let query = self.selection.select("name");
15801        query.execute(self.graphql_client.clone()).await
15802    }
15803    /// The module in which the terminal target is defined
15804    pub fn original_module(&self) -> Module {
15805        let query = self.selection.select("originalModule");
15806        Module {
15807            proc: self.proc.clone(),
15808            selection: query,
15809            graphql_client: self.graphql_client.clone(),
15810        }
15811    }
15812    /// The path of the terminal target within its module
15813    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
15814        let query = self.selection.select("path");
15815        query.execute(self.graphql_client.clone()).await
15816    }
15817}
15818impl Node for TerminalTarget {
15819    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15820        let query = self.selection.select("id");
15821        let graphql_client = self.graphql_client.clone();
15822        async move { query.execute(graphql_client).await }
15823    }
15824}
15825#[derive(Clone)]
15826pub struct TypeDef {
15827    pub proc: Option<Arc<DaggerSessionProc>>,
15828    pub selection: Selection,
15829    pub graphql_client: DynGraphQLClient,
15830}
15831#[derive(Builder, Debug, PartialEq)]
15832pub struct TypeDefWithEnumOpts<'a> {
15833    /// A doc string for the enum, if any
15834    #[builder(setter(into, strip_option), default)]
15835    pub description: Option<&'a str>,
15836    /// The source map for the enum definition.
15837    #[builder(setter(into, strip_option), default)]
15838    pub source_map: Option<Id>,
15839}
15840#[derive(Builder, Debug, PartialEq)]
15841pub struct TypeDefWithEnumMemberOpts<'a> {
15842    /// If deprecated, the reason or migration path.
15843    #[builder(setter(into, strip_option), default)]
15844    pub deprecated: Option<&'a str>,
15845    /// A doc string for the member, if any
15846    #[builder(setter(into, strip_option), default)]
15847    pub description: Option<&'a str>,
15848    /// The source map for the enum member definition.
15849    #[builder(setter(into, strip_option), default)]
15850    pub source_map: Option<Id>,
15851    /// The value of the member in the enum
15852    #[builder(setter(into, strip_option), default)]
15853    pub value: Option<&'a str>,
15854}
15855#[derive(Builder, Debug, PartialEq)]
15856pub struct TypeDefWithEnumValueOpts<'a> {
15857    /// If deprecated, the reason or migration path.
15858    #[builder(setter(into, strip_option), default)]
15859    pub deprecated: Option<&'a str>,
15860    /// A doc string for the value, if any
15861    #[builder(setter(into, strip_option), default)]
15862    pub description: Option<&'a str>,
15863    /// The source map for the enum value definition.
15864    #[builder(setter(into, strip_option), default)]
15865    pub source_map: Option<Id>,
15866}
15867#[derive(Builder, Debug, PartialEq)]
15868pub struct TypeDefWithFieldOpts<'a> {
15869    /// If deprecated, the reason or migration path.
15870    #[builder(setter(into, strip_option), default)]
15871    pub deprecated: Option<&'a str>,
15872    /// A doc string for the field, if any
15873    #[builder(setter(into, strip_option), default)]
15874    pub description: Option<&'a str>,
15875    /// The source map for the field definition.
15876    #[builder(setter(into, strip_option), default)]
15877    pub source_map: Option<Id>,
15878}
15879#[derive(Builder, Debug, PartialEq)]
15880pub struct TypeDefWithInterfaceOpts<'a> {
15881    #[builder(setter(into, strip_option), default)]
15882    pub description: Option<&'a str>,
15883    #[builder(setter(into, strip_option), default)]
15884    pub source_map: Option<Id>,
15885}
15886#[derive(Builder, Debug, PartialEq)]
15887pub struct TypeDefWithObjectOpts<'a> {
15888    #[builder(setter(into, strip_option), default)]
15889    pub deprecated: Option<&'a str>,
15890    #[builder(setter(into, strip_option), default)]
15891    pub description: Option<&'a str>,
15892    #[builder(setter(into, strip_option), default)]
15893    pub source_map: Option<Id>,
15894}
15895#[derive(Builder, Debug, PartialEq)]
15896pub struct TypeDefWithScalarOpts<'a> {
15897    #[builder(setter(into, strip_option), default)]
15898    pub description: Option<&'a str>,
15899}
15900impl IntoID<Id> for TypeDef {
15901    fn into_id(
15902        self,
15903    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15904        Box::pin(async move { self.id().await })
15905    }
15906}
15907impl Loadable for TypeDef {
15908    fn graphql_type() -> &'static str {
15909        "TypeDef"
15910    }
15911    fn from_query(
15912        proc: Option<Arc<DaggerSessionProc>>,
15913        selection: Selection,
15914        graphql_client: DynGraphQLClient,
15915    ) -> Self {
15916        Self {
15917            proc,
15918            selection,
15919            graphql_client,
15920        }
15921    }
15922}
15923impl TypeDef {
15924    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
15925    pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
15926        let query = self.selection.select("asEnum");
15927        let query = query.select("id");
15928        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15929        Ok(id.map(|id| EnumTypeDef {
15930            proc: self.proc.clone(),
15931            selection: query
15932                .root()
15933                .select("node")
15934                .arg("id", &id.0)
15935                .inline_fragment("EnumTypeDef"),
15936            graphql_client: self.graphql_client.clone(),
15937        }))
15938    }
15939    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
15940    pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
15941        let query = self.selection.select("asInput");
15942        let query = query.select("id");
15943        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15944        Ok(id.map(|id| InputTypeDef {
15945            proc: self.proc.clone(),
15946            selection: query
15947                .root()
15948                .select("node")
15949                .arg("id", &id.0)
15950                .inline_fragment("InputTypeDef"),
15951            graphql_client: self.graphql_client.clone(),
15952        }))
15953    }
15954    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
15955    pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
15956        let query = self.selection.select("asInterface");
15957        let query = query.select("id");
15958        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15959        Ok(id.map(|id| InterfaceTypeDef {
15960            proc: self.proc.clone(),
15961            selection: query
15962                .root()
15963                .select("node")
15964                .arg("id", &id.0)
15965                .inline_fragment("InterfaceTypeDef"),
15966            graphql_client: self.graphql_client.clone(),
15967        }))
15968    }
15969    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
15970    pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
15971        let query = self.selection.select("asList");
15972        let query = query.select("id");
15973        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15974        Ok(id.map(|id| ListTypeDef {
15975            proc: self.proc.clone(),
15976            selection: query
15977                .root()
15978                .select("node")
15979                .arg("id", &id.0)
15980                .inline_fragment("ListTypeDef"),
15981            graphql_client: self.graphql_client.clone(),
15982        }))
15983    }
15984    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
15985    pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
15986        let query = self.selection.select("asObject");
15987        let query = query.select("id");
15988        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15989        Ok(id.map(|id| ObjectTypeDef {
15990            proc: self.proc.clone(),
15991            selection: query
15992                .root()
15993                .select("node")
15994                .arg("id", &id.0)
15995                .inline_fragment("ObjectTypeDef"),
15996            graphql_client: self.graphql_client.clone(),
15997        }))
15998    }
15999    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
16000    pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
16001        let query = self.selection.select("asScalar");
16002        let query = query.select("id");
16003        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
16004        Ok(id.map(|id| ScalarTypeDef {
16005            proc: self.proc.clone(),
16006            selection: query
16007                .root()
16008                .select("node")
16009                .arg("id", &id.0)
16010                .inline_fragment("ScalarTypeDef"),
16011            graphql_client: self.graphql_client.clone(),
16012        }))
16013    }
16014    /// A unique identifier for this TypeDef.
16015    pub async fn id(&self) -> Result<Id, DaggerError> {
16016        let query = self.selection.select("id");
16017        query.execute(self.graphql_client.clone()).await
16018    }
16019    /// The kind of type this is (e.g. primitive, list, object).
16020    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
16021        let query = self.selection.select("kind");
16022        query.execute(self.graphql_client.clone()).await
16023    }
16024    /// The canonical non-optional name of the type.
16025    pub async fn name(&self) -> Result<String, DaggerError> {
16026        let query = self.selection.select("name");
16027        query.execute(self.graphql_client.clone()).await
16028    }
16029    /// Whether this type can be set to null. Defaults to false.
16030    pub async fn optional(&self) -> Result<bool, DaggerError> {
16031        let query = self.selection.select("optional");
16032        query.execute(self.graphql_client.clone()).await
16033    }
16034    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
16035    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
16036        let mut query = self.selection.select("withConstructor");
16037        query = query.arg_lazy(
16038            "function",
16039            Box::new(move || {
16040                let function = function.clone();
16041                Box::pin(async move { function.into_id().await.unwrap().quote() })
16042            }),
16043        );
16044        TypeDef {
16045            proc: self.proc.clone(),
16046            selection: query,
16047            graphql_client: self.graphql_client.clone(),
16048        }
16049    }
16050    /// Returns a TypeDef of kind Enum with the provided name.
16051    /// Note that an enum's values may be omitted if the intent is only to refer to an enum. This is how functions are able to return their own, or any other circular reference.
16052    ///
16053    /// # Arguments
16054    ///
16055    /// * `name` - The name of the enum
16056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16057    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
16058        let mut query = self.selection.select("withEnum");
16059        query = query.arg("name", name.into());
16060        TypeDef {
16061            proc: self.proc.clone(),
16062            selection: query,
16063            graphql_client: self.graphql_client.clone(),
16064        }
16065    }
16066    /// Returns a TypeDef of kind Enum with the provided name.
16067    /// Note that an enum's values may be omitted if the intent is only to refer to an enum. This is how functions are able to return their own, or any other circular reference.
16068    ///
16069    /// # Arguments
16070    ///
16071    /// * `name` - The name of the enum
16072    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16073    pub fn with_enum_opts<'a>(
16074        &self,
16075        name: impl Into<String>,
16076        opts: TypeDefWithEnumOpts<'a>,
16077    ) -> TypeDef {
16078        let mut query = self.selection.select("withEnum");
16079        query = query.arg("name", name.into());
16080        if let Some(description) = opts.description {
16081            query = query.arg("description", description);
16082        }
16083        if let Some(source_map) = opts.source_map {
16084            query = query.arg("sourceMap", source_map);
16085        }
16086        TypeDef {
16087            proc: self.proc.clone(),
16088            selection: query,
16089            graphql_client: self.graphql_client.clone(),
16090        }
16091    }
16092    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
16093    ///
16094    /// # Arguments
16095    ///
16096    /// * `name` - The name of the member in the enum
16097    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16098    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
16099        let mut query = self.selection.select("withEnumMember");
16100        query = query.arg("name", name.into());
16101        TypeDef {
16102            proc: self.proc.clone(),
16103            selection: query,
16104            graphql_client: self.graphql_client.clone(),
16105        }
16106    }
16107    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
16108    ///
16109    /// # Arguments
16110    ///
16111    /// * `name` - The name of the member in the enum
16112    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16113    pub fn with_enum_member_opts<'a>(
16114        &self,
16115        name: impl Into<String>,
16116        opts: TypeDefWithEnumMemberOpts<'a>,
16117    ) -> TypeDef {
16118        let mut query = self.selection.select("withEnumMember");
16119        query = query.arg("name", name.into());
16120        if let Some(value) = opts.value {
16121            query = query.arg("value", value);
16122        }
16123        if let Some(description) = opts.description {
16124            query = query.arg("description", description);
16125        }
16126        if let Some(source_map) = opts.source_map {
16127            query = query.arg("sourceMap", source_map);
16128        }
16129        if let Some(deprecated) = opts.deprecated {
16130            query = query.arg("deprecated", deprecated);
16131        }
16132        TypeDef {
16133            proc: self.proc.clone(),
16134            selection: query,
16135            graphql_client: self.graphql_client.clone(),
16136        }
16137    }
16138    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
16139    ///
16140    /// # Arguments
16141    ///
16142    /// * `value` - The name of the value in the enum
16143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16144    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
16145        let mut query = self.selection.select("withEnumValue");
16146        query = query.arg("value", value.into());
16147        TypeDef {
16148            proc: self.proc.clone(),
16149            selection: query,
16150            graphql_client: self.graphql_client.clone(),
16151        }
16152    }
16153    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
16154    ///
16155    /// # Arguments
16156    ///
16157    /// * `value` - The name of the value in the enum
16158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16159    pub fn with_enum_value_opts<'a>(
16160        &self,
16161        value: impl Into<String>,
16162        opts: TypeDefWithEnumValueOpts<'a>,
16163    ) -> TypeDef {
16164        let mut query = self.selection.select("withEnumValue");
16165        query = query.arg("value", value.into());
16166        if let Some(description) = opts.description {
16167            query = query.arg("description", description);
16168        }
16169        if let Some(source_map) = opts.source_map {
16170            query = query.arg("sourceMap", source_map);
16171        }
16172        if let Some(deprecated) = opts.deprecated {
16173            query = query.arg("deprecated", deprecated);
16174        }
16175        TypeDef {
16176            proc: self.proc.clone(),
16177            selection: query,
16178            graphql_client: self.graphql_client.clone(),
16179        }
16180    }
16181    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
16182    ///
16183    /// # Arguments
16184    ///
16185    /// * `name` - The name of the field in the object
16186    /// * `type_def` - The type of the field
16187    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16188    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
16189        let mut query = self.selection.select("withField");
16190        query = query.arg("name", name.into());
16191        query = query.arg_lazy(
16192            "typeDef",
16193            Box::new(move || {
16194                let type_def = type_def.clone();
16195                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16196            }),
16197        );
16198        TypeDef {
16199            proc: self.proc.clone(),
16200            selection: query,
16201            graphql_client: self.graphql_client.clone(),
16202        }
16203    }
16204    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
16205    ///
16206    /// # Arguments
16207    ///
16208    /// * `name` - The name of the field in the object
16209    /// * `type_def` - The type of the field
16210    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16211    pub fn with_field_opts<'a>(
16212        &self,
16213        name: impl Into<String>,
16214        type_def: impl IntoID<Id>,
16215        opts: TypeDefWithFieldOpts<'a>,
16216    ) -> TypeDef {
16217        let mut query = self.selection.select("withField");
16218        query = query.arg("name", name.into());
16219        query = query.arg_lazy(
16220            "typeDef",
16221            Box::new(move || {
16222                let type_def = type_def.clone();
16223                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16224            }),
16225        );
16226        if let Some(description) = opts.description {
16227            query = query.arg("description", description);
16228        }
16229        if let Some(source_map) = opts.source_map {
16230            query = query.arg("sourceMap", source_map);
16231        }
16232        if let Some(deprecated) = opts.deprecated {
16233            query = query.arg("deprecated", deprecated);
16234        }
16235        TypeDef {
16236            proc: self.proc.clone(),
16237            selection: query,
16238            graphql_client: self.graphql_client.clone(),
16239        }
16240    }
16241    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
16242    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
16243        let mut query = self.selection.select("withFunction");
16244        query = query.arg_lazy(
16245            "function",
16246            Box::new(move || {
16247                let function = function.clone();
16248                Box::pin(async move { function.into_id().await.unwrap().quote() })
16249            }),
16250        );
16251        TypeDef {
16252            proc: self.proc.clone(),
16253            selection: query,
16254            graphql_client: self.graphql_client.clone(),
16255        }
16256    }
16257    /// Returns a TypeDef of kind Interface with the provided name.
16258    ///
16259    /// # Arguments
16260    ///
16261    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16262    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
16263        let mut query = self.selection.select("withInterface");
16264        query = query.arg("name", name.into());
16265        TypeDef {
16266            proc: self.proc.clone(),
16267            selection: query,
16268            graphql_client: self.graphql_client.clone(),
16269        }
16270    }
16271    /// Returns a TypeDef of kind Interface with the provided name.
16272    ///
16273    /// # Arguments
16274    ///
16275    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16276    pub fn with_interface_opts<'a>(
16277        &self,
16278        name: impl Into<String>,
16279        opts: TypeDefWithInterfaceOpts<'a>,
16280    ) -> TypeDef {
16281        let mut query = self.selection.select("withInterface");
16282        query = query.arg("name", name.into());
16283        if let Some(description) = opts.description {
16284            query = query.arg("description", description);
16285        }
16286        if let Some(source_map) = opts.source_map {
16287            query = query.arg("sourceMap", source_map);
16288        }
16289        TypeDef {
16290            proc: self.proc.clone(),
16291            selection: query,
16292            graphql_client: self.graphql_client.clone(),
16293        }
16294    }
16295    /// Sets the kind of the type.
16296    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
16297        let mut query = self.selection.select("withKind");
16298        query = query.arg("kind", kind);
16299        TypeDef {
16300            proc: self.proc.clone(),
16301            selection: query,
16302            graphql_client: self.graphql_client.clone(),
16303        }
16304    }
16305    /// Returns a TypeDef of kind List with the provided type for its elements.
16306    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
16307        let mut query = self.selection.select("withListOf");
16308        query = query.arg_lazy(
16309            "elementType",
16310            Box::new(move || {
16311                let element_type = element_type.clone();
16312                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
16313            }),
16314        );
16315        TypeDef {
16316            proc: self.proc.clone(),
16317            selection: query,
16318            graphql_client: self.graphql_client.clone(),
16319        }
16320    }
16321    /// Returns a TypeDef of kind Object with the provided name.
16322    /// Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
16323    ///
16324    /// # Arguments
16325    ///
16326    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16327    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
16328        let mut query = self.selection.select("withObject");
16329        query = query.arg("name", name.into());
16330        TypeDef {
16331            proc: self.proc.clone(),
16332            selection: query,
16333            graphql_client: self.graphql_client.clone(),
16334        }
16335    }
16336    /// Returns a TypeDef of kind Object with the provided name.
16337    /// Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
16338    ///
16339    /// # Arguments
16340    ///
16341    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16342    pub fn with_object_opts<'a>(
16343        &self,
16344        name: impl Into<String>,
16345        opts: TypeDefWithObjectOpts<'a>,
16346    ) -> TypeDef {
16347        let mut query = self.selection.select("withObject");
16348        query = query.arg("name", name.into());
16349        if let Some(description) = opts.description {
16350            query = query.arg("description", description);
16351        }
16352        if let Some(source_map) = opts.source_map {
16353            query = query.arg("sourceMap", source_map);
16354        }
16355        if let Some(deprecated) = opts.deprecated {
16356            query = query.arg("deprecated", deprecated);
16357        }
16358        TypeDef {
16359            proc: self.proc.clone(),
16360            selection: query,
16361            graphql_client: self.graphql_client.clone(),
16362        }
16363    }
16364    /// Sets whether this type can be set to null.
16365    pub fn with_optional(&self, optional: bool) -> TypeDef {
16366        let mut query = self.selection.select("withOptional");
16367        query = query.arg("optional", optional);
16368        TypeDef {
16369            proc: self.proc.clone(),
16370            selection: query,
16371            graphql_client: self.graphql_client.clone(),
16372        }
16373    }
16374    /// Returns a TypeDef of kind Scalar with the provided name.
16375    ///
16376    /// # Arguments
16377    ///
16378    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16379    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16380        let mut query = self.selection.select("withScalar");
16381        query = query.arg("name", name.into());
16382        TypeDef {
16383            proc: self.proc.clone(),
16384            selection: query,
16385            graphql_client: self.graphql_client.clone(),
16386        }
16387    }
16388    /// Returns a TypeDef of kind Scalar with the provided name.
16389    ///
16390    /// # Arguments
16391    ///
16392    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16393    pub fn with_scalar_opts<'a>(
16394        &self,
16395        name: impl Into<String>,
16396        opts: TypeDefWithScalarOpts<'a>,
16397    ) -> TypeDef {
16398        let mut query = self.selection.select("withScalar");
16399        query = query.arg("name", name.into());
16400        if let Some(description) = opts.description {
16401            query = query.arg("description", description);
16402        }
16403        TypeDef {
16404            proc: self.proc.clone(),
16405            selection: query,
16406            graphql_client: self.graphql_client.clone(),
16407        }
16408    }
16409}
16410impl Node for TypeDef {
16411    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16412        let query = self.selection.select("id");
16413        let graphql_client = self.graphql_client.clone();
16414        async move { query.execute(graphql_client).await }
16415    }
16416}
16417#[derive(Clone)]
16418pub struct Up {
16419    pub proc: Option<Arc<DaggerSessionProc>>,
16420    pub selection: Selection,
16421    pub graphql_client: DynGraphQLClient,
16422}
16423impl IntoID<Id> for Up {
16424    fn into_id(
16425        self,
16426    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16427        Box::pin(async move { self.id().await })
16428    }
16429}
16430impl Loadable for Up {
16431    fn graphql_type() -> &'static str {
16432        "Up"
16433    }
16434    fn from_query(
16435        proc: Option<Arc<DaggerSessionProc>>,
16436        selection: Selection,
16437        graphql_client: DynGraphQLClient,
16438    ) -> Self {
16439        Self {
16440            proc,
16441            selection,
16442            graphql_client,
16443        }
16444    }
16445}
16446impl Up {
16447    /// The description of the service
16448    pub async fn description(&self) -> Result<String, DaggerError> {
16449        let query = self.selection.select("description");
16450        query.execute(self.graphql_client.clone()).await
16451    }
16452    /// A unique identifier for this Up.
16453    pub async fn id(&self) -> Result<Id, DaggerError> {
16454        let query = self.selection.select("id");
16455        query.execute(self.graphql_client.clone()).await
16456    }
16457    /// Return the command name of the service. Entrypoint targets omit the module prefix.
16458    pub async fn name(&self) -> Result<String, DaggerError> {
16459        let query = self.selection.select("name");
16460        query.execute(self.graphql_client.clone()).await
16461    }
16462    /// The original module in which the service has been defined
16463    pub fn original_module(&self) -> Module {
16464        let query = self.selection.select("originalModule");
16465        Module {
16466            proc: self.proc.clone(),
16467            selection: query,
16468            graphql_client: self.graphql_client.clone(),
16469        }
16470    }
16471    /// The path of the service within its module
16472    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16473        let query = self.selection.select("path");
16474        query.execute(self.graphql_client.clone()).await
16475    }
16476    /// Execute the service function
16477    pub fn run(&self) -> Up {
16478        let query = self.selection.select("run");
16479        Up {
16480            proc: self.proc.clone(),
16481            selection: query,
16482            graphql_client: self.graphql_client.clone(),
16483        }
16484    }
16485}
16486impl Node for Up {
16487    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16488        let query = self.selection.select("id");
16489        let graphql_client = self.graphql_client.clone();
16490        async move { query.execute(graphql_client).await }
16491    }
16492}
16493#[derive(Clone)]
16494pub struct UpGroup {
16495    pub proc: Option<Arc<DaggerSessionProc>>,
16496    pub selection: Selection,
16497    pub graphql_client: DynGraphQLClient,
16498}
16499impl IntoID<Id> for UpGroup {
16500    fn into_id(
16501        self,
16502    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16503        Box::pin(async move { self.id().await })
16504    }
16505}
16506impl Loadable for UpGroup {
16507    fn graphql_type() -> &'static str {
16508        "UpGroup"
16509    }
16510    fn from_query(
16511        proc: Option<Arc<DaggerSessionProc>>,
16512        selection: Selection,
16513        graphql_client: DynGraphQLClient,
16514    ) -> Self {
16515        Self {
16516            proc,
16517            selection,
16518            graphql_client,
16519        }
16520    }
16521}
16522impl UpGroup {
16523    /// A unique identifier for this UpGroup.
16524    pub async fn id(&self) -> Result<Id, DaggerError> {
16525        let query = self.selection.select("id");
16526        query.execute(self.graphql_client.clone()).await
16527    }
16528    /// Return a list of individual services and their details
16529    pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16530        let query = self.selection.select("list");
16531        let query = query.select("id");
16532        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16533        Ok(ids
16534            .into_iter()
16535            .map(|id| Up {
16536                proc: self.proc.clone(),
16537                selection: crate::querybuilder::query()
16538                    .select("node")
16539                    .arg("id", &id.0)
16540                    .inline_fragment("Up"),
16541                graphql_client: self.graphql_client.clone(),
16542            })
16543            .collect())
16544    }
16545    /// Execute all selected service functions
16546    pub fn run(&self) -> UpGroup {
16547        let query = self.selection.select("run");
16548        UpGroup {
16549            proc: self.proc.clone(),
16550            selection: query,
16551            graphql_client: self.graphql_client.clone(),
16552        }
16553    }
16554}
16555impl Node for UpGroup {
16556    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16557        let query = self.selection.select("id");
16558        let graphql_client = self.graphql_client.clone();
16559        async move { query.execute(graphql_client).await }
16560    }
16561}
16562#[derive(Clone)]
16563pub struct Volume {
16564    pub proc: Option<Arc<DaggerSessionProc>>,
16565    pub selection: Selection,
16566    pub graphql_client: DynGraphQLClient,
16567}
16568impl IntoID<Id> for Volume {
16569    fn into_id(
16570        self,
16571    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16572        Box::pin(async move { self.id().await })
16573    }
16574}
16575impl Loadable for Volume {
16576    fn graphql_type() -> &'static str {
16577        "Volume"
16578    }
16579    fn from_query(
16580        proc: Option<Arc<DaggerSessionProc>>,
16581        selection: Selection,
16582        graphql_client: DynGraphQLClient,
16583    ) -> Self {
16584        Self {
16585            proc,
16586            selection,
16587            graphql_client,
16588        }
16589    }
16590}
16591impl Volume {
16592    /// A unique identifier for this Volume.
16593    pub async fn id(&self) -> Result<Id, DaggerError> {
16594        let query = self.selection.select("id");
16595        query.execute(self.graphql_client.clone()).await
16596    }
16597}
16598impl Node for Volume {
16599    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16600        let query = self.selection.select("id");
16601        let graphql_client = self.graphql_client.clone();
16602        async move { query.execute(graphql_client).await }
16603    }
16604}
16605#[derive(Clone)]
16606pub struct Workspace {
16607    pub proc: Option<Arc<DaggerSessionProc>>,
16608    pub selection: Selection,
16609    pub graphql_client: DynGraphQLClient,
16610}
16611#[derive(Builder, Debug, PartialEq)]
16612pub struct WorkspaceAgentsOpts<'a> {
16613    /// Exclude agents matching the specified patterns
16614    #[builder(setter(into, strip_option), default)]
16615    pub exclude: Option<Vec<&'a str>>,
16616    /// Only include agents matching the specified patterns
16617    #[builder(setter(into, strip_option), default)]
16618    pub include: Option<Vec<&'a str>>,
16619}
16620#[derive(Builder, Debug, PartialEq)]
16621pub struct WorkspaceChangesOpts {
16622    /// An earlier workspace state to compare against.
16623    #[builder(setter(into, strip_option), default)]
16624    pub from: Option<Id>,
16625}
16626#[derive(Builder, Debug, PartialEq)]
16627pub struct WorkspaceChecksOpts<'a> {
16628    /// Only include checks matching the specified patterns
16629    #[builder(setter(into, strip_option), default)]
16630    pub include: Option<Vec<&'a str>>,
16631    /// When true, only return annotated check functions; exclude generate-as-checks
16632    #[builder(setter(into, strip_option), default)]
16633    pub no_generate: Option<bool>,
16634    /// When true, only return generate-as-checks; exclude annotated check functions
16635    #[builder(setter(into, strip_option), default)]
16636    pub only_generate: Option<bool>,
16637    /// Skip checks matching the specified patterns
16638    #[builder(setter(into, strip_option), default)]
16639    pub skip: Option<Vec<&'a str>>,
16640}
16641#[derive(Builder, Debug, PartialEq)]
16642pub struct WorkspaceCompareCommitsFromOpts<'a> {
16643    /// Full lowercase commit hashes or unambiguous lowercase hex prefixes (4-40 characters) to select, in any order. Prefixes resolve against the frozen source's Git objects and are recorded as full hashes; duplicate selections after resolution are rejected. Empty selects all new source commits. Selected commits must be within the source's latest 10000 commits.
16644    #[builder(setter(into, strip_option), default)]
16645    pub commits: Option<Vec<&'a str>>,
16646    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
16647    #[builder(setter(into, strip_option), default)]
16648    pub max_commits: Option<isize>,
16649}
16650#[derive(Builder, Debug, PartialEq)]
16651pub struct WorkspaceConfigReadOpts<'a> {
16652    /// Dotted key path (e.g. modules.greeter.source). Empty for full config.
16653    #[builder(setter(into, strip_option), default)]
16654    pub key: Option<&'a str>,
16655}
16656#[derive(Builder, Debug, PartialEq)]
16657pub struct WorkspaceDirectoryOpts<'a> {
16658    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
16659    #[builder(setter(into, strip_option), default)]
16660    pub exclude: Option<Vec<&'a str>>,
16661    /// Apply .gitignore filter rules inside the directory.
16662    #[builder(setter(into, strip_option), default)]
16663    pub gitignore: Option<bool>,
16664    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
16665    #[builder(setter(into, strip_option), default)]
16666    pub include: Option<Vec<&'a str>>,
16667}
16668#[derive(Builder, Debug, PartialEq)]
16669pub struct WorkspaceExportOpts<'a> {
16670    /// Earlier workspace state to compare against. With path, this must be a previously exported frozen source workspace.
16671    #[builder(setter(into, strip_option), default)]
16672    pub from: Option<Id>,
16673    /// Destination checkout path on the calling client. Relative paths start at the client's working directory. Omit to apply a local workspace's overlay changes at its host root.
16674    #[builder(setter(into, strip_option), default)]
16675    pub path: Option<&'a str>,
16676}
16677#[derive(Builder, Debug, PartialEq)]
16678pub struct WorkspaceFindRootsOpts<'a> {
16679    /// Glob patterns pruning the walk below start (e.g. ["**/node_modules/**"]).
16680    #[builder(setter(into, strip_option), default)]
16681    pub exclude: Option<Vec<&'a str>>,
16682    /// Directory to start from. Relative paths resolve from the workspace cwd.
16683    #[builder(setter(into, strip_option), default)]
16684    pub start: Option<&'a str>,
16685}
16686#[derive(Builder, Debug, PartialEq)]
16687pub struct WorkspaceFindUpOpts<'a> {
16688    /// Path to start the search from. Relative paths resolve from the workspace cwd; absolute paths resolve from the workspace root.
16689    #[builder(setter(into, strip_option), default)]
16690    pub from: Option<&'a str>,
16691}
16692#[derive(Builder, Debug, PartialEq)]
16693pub struct WorkspaceGeneratorsOpts<'a> {
16694    /// Only include generators matching the specified patterns
16695    #[builder(setter(into, strip_option), default)]
16696    pub include: Option<Vec<&'a str>>,
16697}
16698#[derive(Builder, Debug, PartialEq)]
16699pub struct WorkspaceMigrateOpts<'a> {
16700    /// Additional local modules to migrate. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
16701    #[builder(setter(into, strip_option), default)]
16702    pub modules: Option<Vec<&'a str>>,
16703}
16704#[derive(Builder, Debug, PartialEq)]
16705pub struct WorkspaceMigrateModuleOpts<'a> {
16706    /// Module directory. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
16707    #[builder(setter(into, strip_option), default)]
16708    pub path: Option<&'a str>,
16709}
16710#[derive(Builder, Debug, PartialEq)]
16711pub struct WorkspaceSearchOpts<'a> {
16712    /// Allow the . pattern to match newlines in multiline mode.
16713    #[builder(setter(into, strip_option), default)]
16714    pub dotall: Option<bool>,
16715    /// Only return matching files, not lines and content
16716    #[builder(setter(into, strip_option), default)]
16717    pub files_only: Option<bool>,
16718    /// Glob patterns to match (e.g., "*.md")
16719    #[builder(setter(into, strip_option), default)]
16720    pub globs: Option<Vec<&'a str>>,
16721    /// Enable case-insensitive matching.
16722    #[builder(setter(into, strip_option), default)]
16723    pub insensitive: Option<bool>,
16724    /// Limit the number of results to return
16725    #[builder(setter(into, strip_option), default)]
16726    pub limit: Option<isize>,
16727    /// Interpret the pattern as a literal string instead of a regular expression.
16728    #[builder(setter(into, strip_option), default)]
16729    pub literal: Option<bool>,
16730    /// Enable searching across multiple lines.
16731    #[builder(setter(into, strip_option), default)]
16732    pub multiline: Option<bool>,
16733    /// Directory or file paths to search
16734    #[builder(setter(into, strip_option), default)]
16735    pub paths: Option<Vec<&'a str>>,
16736    /// Skip hidden files (files starting with .).
16737    #[builder(setter(into, strip_option), default)]
16738    pub skip_hidden: Option<bool>,
16739    /// Honor .gitignore, .ignore, and .rgignore files.
16740    #[builder(setter(into, strip_option), default)]
16741    pub skip_ignored: Option<bool>,
16742}
16743#[derive(Builder, Debug, PartialEq)]
16744pub struct WorkspaceServicesOpts<'a> {
16745    /// Only include services matching the specified patterns
16746    #[builder(setter(into, strip_option), default)]
16747    pub include: Option<Vec<&'a str>>,
16748}
16749#[derive(Builder, Debug, PartialEq)]
16750pub struct WorkspaceTerminalsOpts<'a> {
16751    /// Only include terminal targets matching the specified patterns
16752    #[builder(setter(into, strip_option), default)]
16753    pub include: Option<Vec<&'a str>>,
16754}
16755#[derive(Builder, Debug, PartialEq)]
16756pub struct WorkspaceWithClientOpts<'a> {
16757    /// Optional SDK name. Inspect all installed SDKs when omitted.
16758    #[builder(setter(into, strip_option), default)]
16759    pub sdk: Option<&'a str>,
16760    /// Explicit SDK-module constructor setting overrides for this scope. Requires an explicit SDK name.
16761    #[builder(setter(into, strip_option), default)]
16762    pub settings: Option<Json>,
16763}
16764#[derive(Builder, Debug, PartialEq)]
16765pub struct WorkspaceWithCommitOpts<'a> {
16766    /// Author and committer email. Defaults to git config user.email in the calling client's working directory, otherwise dagger@localhost.
16767    #[builder(setter(into, strip_option), default)]
16768    pub author_email: Option<&'a str>,
16769    /// Author and committer name. Defaults to git config user.name in the calling client's working directory, otherwise Dagger.
16770    #[builder(setter(into, strip_option), default)]
16771    pub author_name: Option<&'a str>,
16772    /// Add a Signed-off-by trailer using the commit author's name and email.
16773    #[builder(setter(into, strip_option), default)]
16774    pub signoff: Option<bool>,
16775}
16776#[derive(Builder, Debug, PartialEq)]
16777pub struct WorkspaceWithCommitsFromOpts<'a> {
16778    /// Full lowercase commit hashes or unambiguous lowercase hex prefixes (4-40 characters) to select, in any order. Prefixes resolve against the frozen source's Git objects and are recorded as full hashes; duplicate selections after resolution are rejected. Empty selects all new source commits. Selected commits must be within the source's latest 10000 commits.
16779    #[builder(setter(into, strip_option), default)]
16780    pub commits: Option<Vec<&'a str>>,
16781    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
16782    #[builder(setter(into, strip_option), default)]
16783    pub max_commits: Option<isize>,
16784}
16785#[derive(Builder, Debug, PartialEq)]
16786pub struct WorkspaceWithConfigEnvOpts {
16787    /// Write to the workspace config directory at the workspace cwd.
16788    #[builder(setter(into, strip_option), default)]
16789    pub here: Option<bool>,
16790}
16791#[derive(Builder, Debug, PartialEq)]
16792pub struct WorkspaceWithConfigValueOpts<'a> {
16793    /// Write to the workspace config directory at the workspace cwd.
16794    #[builder(setter(into, strip_option), default)]
16795    pub here: Option<bool>,
16796    /// List value to set. Elements are stored verbatim, with no auto-detection. Mutually exclusive with value.
16797    #[builder(setter(into, strip_option), default)]
16798    pub values: Option<Vec<&'a str>>,
16799}
16800#[derive(Builder, Debug, PartialEq)]
16801pub struct WorkspaceWithFileOpts {
16802    /// Permissions of the added file. Defaults to the source file permissions.
16803    #[builder(setter(into, strip_option), default)]
16804    pub permissions: Option<isize>,
16805}
16806#[derive(Builder, Debug, PartialEq)]
16807pub struct WorkspaceWithInitModuleOpts<'a> {
16808    /// Select this module as the entrypoint and install it. False prevents automatic selection. When omitted, select only if both path and name are omitted and the module is installed.
16809    #[builder(setter(into, strip_option), default)]
16810    pub entrypoint: Option<bool>,
16811    /// Install the module. When omitted, install only if path is omitted.
16812    #[builder(setter(into, strip_option), default)]
16813    pub install: Option<bool>,
16814    /// Module name. The engine infers it from path, the active config file, or the workspace root when omitted.
16815    #[builder(setter(into, strip_option), default)]
16816    pub name: Option<&'a str>,
16817    /// Module path relative to the workspace cwd, or an absolute workspace path. Defaults to .dagger/modules/<name> beside the active workspace config.
16818    #[builder(setter(into, strip_option), default)]
16819    pub path: Option<&'a str>,
16820    /// Explicit SDK-module constructor setting overrides for this scope.
16821    #[builder(setter(into, strip_option), default)]
16822    pub settings: Option<Json>,
16823}
16824#[derive(Builder, Debug, PartialEq)]
16825pub struct WorkspaceWithModuleOpts<'a> {
16826    /// Write to the workspace config directory at the workspace cwd.
16827    #[builder(setter(into, strip_option), default)]
16828    pub here: Option<bool>,
16829    /// Override name for the installed module entry.
16830    #[builder(setter(into, strip_option), default)]
16831    pub name: Option<&'a str>,
16832}
16833#[derive(Builder, Debug, PartialEq)]
16834pub struct WorkspaceWithNewFileOpts {
16835    /// Permissions of the new file.
16836    #[builder(setter(into, strip_option), default)]
16837    pub permissions: Option<isize>,
16838}
16839#[derive(Builder, Debug, PartialEq)]
16840pub struct WorkspaceWithResetOpts {
16841    /// Discard uncommitted changes, resetting the working tree to the commit.
16842    #[builder(setter(into, strip_option), default)]
16843    pub hard: Option<bool>,
16844}
16845#[derive(Builder, Debug, PartialEq)]
16846pub struct WorkspaceWithSdkOpts<'a> {
16847    /// Optional override for the SDK name conventionally derived from the installed module name.
16848    #[builder(setter(into, strip_option), default)]
16849    pub as_sdk_name: Option<&'a str>,
16850    /// Write to the workspace config directory at the workspace cwd.
16851    #[builder(setter(into, strip_option), default)]
16852    pub here: Option<bool>,
16853    /// Override name for the installed SDK entry.
16854    #[builder(setter(into, strip_option), default)]
16855    pub name: Option<&'a str>,
16856}
16857#[derive(Builder, Debug, PartialEq)]
16858pub struct WorkspaceWithUpdatedClientsOpts<'a> {
16859    /// Select clients in every scope instead of only the scopes containing the workspace cwd.
16860    #[builder(setter(into, strip_option), default)]
16861    pub all: Option<bool>,
16862    /// Recorded client targets to update. All targets in the selected scopes are updated when omitted.
16863    #[builder(setter(into, strip_option), default)]
16864    pub modules: Option<Vec<&'a str>>,
16865    /// Optional SDK name. All installed SDK modules are selected when omitted.
16866    #[builder(setter(into, strip_option), default)]
16867    pub sdk: Option<&'a str>,
16868}
16869#[derive(Builder, Debug, PartialEq)]
16870pub struct WorkspaceWithUpdatedLockOpts {
16871    /// Do not regenerate SDK client scopes.
16872    #[builder(setter(into, strip_option), default)]
16873    pub no_generate: Option<bool>,
16874}
16875#[derive(Builder, Debug, PartialEq)]
16876pub struct WorkspaceWithUpdatedModulesOpts<'a> {
16877    /// Installed module names or sources. A version suffix sets a new request. An empty list refreshes all installed modules.
16878    #[builder(setter(into, strip_option), default)]
16879    pub names: Option<Vec<&'a str>>,
16880    /// New version request for exactly one selected module. Cannot be combined with a version suffix.
16881    #[builder(setter(into, strip_option), default)]
16882    pub version: Option<&'a str>,
16883}
16884#[derive(Builder, Debug, PartialEq)]
16885pub struct WorkspaceWithoutClientOpts<'a> {
16886    /// Optional SDK name. Search all installed SDKs when omitted.
16887    #[builder(setter(into, strip_option), default)]
16888    pub sdk: Option<&'a str>,
16889}
16890#[derive(Builder, Debug, PartialEq)]
16891pub struct WorkspaceWithoutConfigEnvOpts {
16892    /// Write to the workspace config directory at the workspace cwd.
16893    #[builder(setter(into, strip_option), default)]
16894    pub here: Option<bool>,
16895}
16896#[derive(Builder, Debug, PartialEq)]
16897pub struct WorkspaceWithoutConfigValueOpts {
16898    /// Write to the workspace config directory at the workspace cwd.
16899    #[builder(setter(into, strip_option), default)]
16900    pub here: Option<bool>,
16901}
16902#[derive(Builder, Debug, PartialEq)]
16903pub struct WorkspaceWithoutModuleOpts {
16904    /// Write to the workspace config directory at the workspace cwd.
16905    #[builder(setter(into, strip_option), default)]
16906    pub here: Option<bool>,
16907}
16908#[derive(Builder, Debug, PartialEq)]
16909pub struct WorkspaceWithoutSdkOpts {
16910    /// Write to the workspace config directory at the workspace cwd.
16911    #[builder(setter(into, strip_option), default)]
16912    pub here: Option<bool>,
16913}
16914impl IntoID<Id> for Workspace {
16915    fn into_id(
16916        self,
16917    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16918        Box::pin(async move { self.id().await })
16919    }
16920}
16921impl Loadable for Workspace {
16922    fn graphql_type() -> &'static str {
16923        "Workspace"
16924    }
16925    fn from_query(
16926        proc: Option<Arc<DaggerSessionProc>>,
16927        selection: Selection,
16928        graphql_client: DynGraphQLClient,
16929    ) -> Self {
16930        Self {
16931            proc,
16932            selection,
16933            graphql_client,
16934        }
16935    }
16936}
16937impl Workspace {
16938    /// Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
16939    pub async fn address(&self) -> Result<String, DaggerError> {
16940        let query = self.selection.select("address");
16941        query.execute(self.graphql_client.clone()).await
16942    }
16943    /// Return all agent middlewares from modules loaded in the workspace.
16944    ///
16945    /// # Arguments
16946    ///
16947    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16948    pub fn agents(&self) -> AgentMiddlewareGroup {
16949        let query = self.selection.select("agents");
16950        AgentMiddlewareGroup {
16951            proc: self.proc.clone(),
16952            selection: query,
16953            graphql_client: self.graphql_client.clone(),
16954        }
16955    }
16956    /// Return all agent middlewares from modules loaded in the workspace.
16957    ///
16958    /// # Arguments
16959    ///
16960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16961    pub fn agents_opts<'a>(&self, opts: WorkspaceAgentsOpts<'a>) -> AgentMiddlewareGroup {
16962        let mut query = self.selection.select("agents");
16963        if let Some(include) = opts.include {
16964            query = query.arg("include", include);
16965        }
16966        if let Some(exclude) = opts.exclude {
16967            query = query.arg("exclude", exclude);
16968        }
16969        AgentMiddlewareGroup {
16970            proc: self.proc.clone(),
16971            selection: query,
16972            graphql_client: self.graphql_client.clone(),
16973        }
16974    }
16975    /// Return this workspace's changes, with paths relative to its working directory.
16976    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
16977    ///
16978    /// # Arguments
16979    ///
16980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16981    pub fn changes(&self) -> Changeset {
16982        let query = self.selection.select("changes");
16983        Changeset {
16984            proc: self.proc.clone(),
16985            selection: query,
16986            graphql_client: self.graphql_client.clone(),
16987        }
16988    }
16989    /// Return this workspace's changes, with paths relative to its working directory.
16990    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
16991    ///
16992    /// # Arguments
16993    ///
16994    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16995    pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
16996        let mut query = self.selection.select("changes");
16997        if let Some(from) = opts.from {
16998            query = query.arg("from", from);
16999        }
17000        Changeset {
17001            proc: self.proc.clone(),
17002            selection: query,
17003            graphql_client: self.graphql_client.clone(),
17004        }
17005    }
17006    /// Return all checks from modules loaded in the workspace.
17007    ///
17008    /// # Arguments
17009    ///
17010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17011    pub fn checks(&self) -> CheckGroup {
17012        let query = self.selection.select("checks");
17013        CheckGroup {
17014            proc: self.proc.clone(),
17015            selection: query,
17016            graphql_client: self.graphql_client.clone(),
17017        }
17018    }
17019    /// Return all checks from modules loaded in the workspace.
17020    ///
17021    /// # Arguments
17022    ///
17023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17024    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
17025        let mut query = self.selection.select("checks");
17026        if let Some(include) = opts.include {
17027            query = query.arg("include", include);
17028        }
17029        if let Some(skip) = opts.skip {
17030            query = query.arg("skip", skip);
17031        }
17032        if let Some(no_generate) = opts.no_generate {
17033            query = query.arg("noGenerate", no_generate);
17034        }
17035        if let Some(only_generate) = opts.only_generate {
17036            query = query.arg("onlyGenerate", only_generate);
17037        }
17038        CheckGroup {
17039            proc: self.proc.clone(),
17040            selection: query,
17041            graphql_client: self.graphql_client.clone(),
17042        }
17043    }
17044    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
17045    /// Results are ordered oldest first and account for earlier applicable commits in the same preview. The preview does not apply commits or write to the checkout.
17046    /// A local receiver is snapshotted automatically; untracked files require interactive approval. Source uncommitted changes are ignored. Exceeding maxCommits fails rather than returning a partial preview. Divergent merge commits require manual integration.
17047    ///
17048    /// # Arguments
17049    ///
17050    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
17051    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17052    pub async fn compare_commits_from(
17053        &self,
17054        source: impl IntoID<Id>,
17055    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
17056        let mut query = self.selection.select("compareCommitsFrom");
17057        query = query.arg_lazy(
17058            "source",
17059            Box::new(move || {
17060                let source = source.clone();
17061                Box::pin(async move { source.into_id().await.unwrap().quote() })
17062            }),
17063        );
17064        let query = query.select("id");
17065        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17066        Ok(ids
17067            .into_iter()
17068            .map(|id| WorkspaceCommitPick {
17069                proc: self.proc.clone(),
17070                selection: crate::querybuilder::query()
17071                    .select("node")
17072                    .arg("id", &id.0)
17073                    .inline_fragment("WorkspaceCommitPick"),
17074                graphql_client: self.graphql_client.clone(),
17075            })
17076            .collect())
17077    }
17078    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
17079    /// Results are ordered oldest first and account for earlier applicable commits in the same preview. The preview does not apply commits or write to the checkout.
17080    /// A local receiver is snapshotted automatically; untracked files require interactive approval. Source uncommitted changes are ignored. Exceeding maxCommits fails rather than returning a partial preview. Divergent merge commits require manual integration.
17081    ///
17082    /// # Arguments
17083    ///
17084    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
17085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17086    pub async fn compare_commits_from_opts<'a>(
17087        &self,
17088        source: impl IntoID<Id>,
17089        opts: WorkspaceCompareCommitsFromOpts<'a>,
17090    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
17091        let mut query = self.selection.select("compareCommitsFrom");
17092        query = query.arg_lazy(
17093            "source",
17094            Box::new(move || {
17095                let source = source.clone();
17096                Box::pin(async move { source.into_id().await.unwrap().quote() })
17097            }),
17098        );
17099        if let Some(commits) = opts.commits {
17100            query = query.arg("commits", commits);
17101        }
17102        if let Some(max_commits) = opts.max_commits {
17103            query = query.arg("maxCommits", max_commits);
17104        }
17105        let query = query.select("id");
17106        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17107        Ok(ids
17108            .into_iter()
17109            .map(|id| WorkspaceCommitPick {
17110                proc: self.proc.clone(),
17111                selection: crate::querybuilder::query()
17112                    .select("node")
17113                    .arg("id", &id.0)
17114                    .inline_fragment("WorkspaceCommitPick"),
17115                graphql_client: self.graphql_client.clone(),
17116            })
17117            .collect())
17118    }
17119    /// Selected native workspace config file relative to the workspace cwd, if any.
17120    pub async fn config_file(&self) -> Result<String, DaggerError> {
17121        let query = self.selection.select("configFile");
17122        query.execute(self.graphql_client.clone()).await
17123    }
17124    /// Read a configuration value from dagger.toml.
17125    /// If key is empty, returns the full config.
17126    /// If key points to a scalar, returns the value.
17127    /// If key points to a table, returns flattened dotted-key output.
17128    ///
17129    /// # Arguments
17130    ///
17131    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17132    pub async fn config_read(&self) -> Result<String, DaggerError> {
17133        let query = self.selection.select("configRead");
17134        query.execute(self.graphql_client.clone()).await
17135    }
17136    /// Read a configuration value from dagger.toml.
17137    /// If key is empty, returns the full config.
17138    /// If key points to a scalar, returns the value.
17139    /// If key points to a table, returns flattened dotted-key output.
17140    ///
17141    /// # Arguments
17142    ///
17143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17144    pub async fn config_read_opts<'a>(
17145        &self,
17146        opts: WorkspaceConfigReadOpts<'a>,
17147    ) -> Result<String, DaggerError> {
17148        let mut query = self.selection.select("configRead");
17149        if let Some(key) = opts.key {
17150            query = query.arg("key", key);
17151        }
17152        query.execute(self.graphql_client.clone()).await
17153    }
17154    /// Current location within the workspace root.
17155    /// The workspace root is returned as "/".
17156    /// Relative paths in workspace APIs resolve from here.
17157    pub async fn cwd(&self) -> Result<String, DaggerError> {
17158        let query = self.selection.select("cwd");
17159        query.execute(self.graphql_client.clone()).await
17160    }
17161    /// Return the selected SDK module's current scope at this workspace location.
17162    ///
17163    /// # Arguments
17164    ///
17165    /// * `sdk` - SDK name to probe. Required.
17166    pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
17167        let mut query = self.selection.select("detectScope");
17168        query = query.arg("sdk", sdk.into());
17169        query.execute(self.graphql_client.clone()).await
17170    }
17171    /// Returns a Directory from the workspace.
17172    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
17173    ///
17174    /// # Arguments
17175    ///
17176    /// * `path` - Location of the directory to retrieve. Relative paths (e.g., "src") resolve from the workspace cwd; absolute paths (e.g., "/src") resolve from the workspace root.
17177    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17178    pub fn directory(&self, path: impl Into<String>) -> Directory {
17179        let mut query = self.selection.select("directory");
17180        query = query.arg("path", path.into());
17181        Directory {
17182            proc: self.proc.clone(),
17183            selection: query,
17184            graphql_client: self.graphql_client.clone(),
17185        }
17186    }
17187    /// Returns a Directory from the workspace.
17188    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
17189    ///
17190    /// # Arguments
17191    ///
17192    /// * `path` - Location of the directory to retrieve. Relative paths (e.g., "src") resolve from the workspace cwd; absolute paths (e.g., "/src") resolve from the workspace root.
17193    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17194    pub fn directory_opts<'a>(
17195        &self,
17196        path: impl Into<String>,
17197        opts: WorkspaceDirectoryOpts<'a>,
17198    ) -> Directory {
17199        let mut query = self.selection.select("directory");
17200        query = query.arg("path", path.into());
17201        if let Some(exclude) = opts.exclude {
17202            query = query.arg("exclude", exclude);
17203        }
17204        if let Some(include) = opts.include {
17205            query = query.arg("include", include);
17206        }
17207        if let Some(gitignore) = opts.gitignore {
17208            query = query.arg("gitignore", gitignore);
17209        }
17210        Directory {
17211            proc: self.proc.clone(),
17212            selection: query,
17213            graphql_client: self.graphql_client.clone(),
17214        }
17215    }
17216    /// Installed name of the module selected as the workspace entrypoint, or an empty string when none is selected.
17217    /// Reflects the selected env's effective view. Fails if several modules are selected.
17218    pub async fn entrypoint(&self) -> Result<String, DaggerError> {
17219        let query = self.selection.select("entrypoint");
17220        query.execute(self.graphql_client.clone()).await
17221    }
17222    /// List named environments defined in the workspace configuration.
17223    pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
17224        let query = self.selection.select("envList");
17225        query.execute(self.graphql_client.clone()).await
17226    }
17227    /// Write this workspace's commits and pending changes to a checkout on the calling client.
17228    /// With path, accept a frozen source, integrate divergent commits by cherry-picking, preserve unrelated checkout edits, and refuse conflicts. The source is unchanged. Pass from to save only work since an earlier source value, including previously saved pending edits that are now committed.
17229    /// Without path, apply a local workspace's overlay changes at its host root. Pass from to apply only changes since an earlier local workspace state. Export paths are relative to the workspace root regardless of its working directory. Like Directory.export, this writes only to the client making the call, never the source's client.
17230    ///
17231    /// # Arguments
17232    ///
17233    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17234    pub async fn export(&self) -> Result<Void, DaggerError> {
17235        let query = self.selection.select("export");
17236        query.execute(self.graphql_client.clone()).await
17237    }
17238    /// Write this workspace's commits and pending changes to a checkout on the calling client.
17239    /// With path, accept a frozen source, integrate divergent commits by cherry-picking, preserve unrelated checkout edits, and refuse conflicts. The source is unchanged. Pass from to save only work since an earlier source value, including previously saved pending edits that are now committed.
17240    /// Without path, apply a local workspace's overlay changes at its host root. Pass from to apply only changes since an earlier local workspace state. Export paths are relative to the workspace root regardless of its working directory. Like Directory.export, this writes only to the client making the call, never the source's client.
17241    ///
17242    /// # Arguments
17243    ///
17244    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17245    pub async fn export_opts<'a>(
17246        &self,
17247        opts: WorkspaceExportOpts<'a>,
17248    ) -> Result<Void, DaggerError> {
17249        let mut query = self.selection.select("export");
17250        if let Some(path) = opts.path {
17251            query = query.arg("path", path);
17252        }
17253        if let Some(from) = opts.from {
17254            query = query.arg("from", from);
17255        }
17256        query.execute(self.graphql_client.clone()).await
17257    }
17258    /// Returns a File from the workspace.
17259    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
17260    ///
17261    /// # Arguments
17262    ///
17263    /// * `path` - Location of the file to retrieve. Relative paths (e.g., "go.mod") resolve from the workspace cwd; absolute paths (e.g., "/go.mod") resolve from the workspace root.
17264    pub fn file(&self, path: impl Into<String>) -> File {
17265        let mut query = self.selection.select("file");
17266        query = query.arg("path", path.into());
17267        File {
17268            proc: self.proc.clone(),
17269            selection: query,
17270            graphql_client: self.graphql_client.clone(),
17271        }
17272    }
17273    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
17274    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
17275    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
17276    ///
17277    /// # Arguments
17278    ///
17279    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
17280    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17281    pub async fn find_roots(
17282        &self,
17283        markers: Vec<impl Into<String>>,
17284    ) -> Result<Vec<String>, DaggerError> {
17285        let mut query = self.selection.select("findRoots");
17286        query = query.arg(
17287            "markers",
17288            markers
17289                .into_iter()
17290                .map(|i| i.into())
17291                .collect::<Vec<String>>(),
17292        );
17293        query.execute(self.graphql_client.clone()).await
17294    }
17295    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
17296    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
17297    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
17298    ///
17299    /// # Arguments
17300    ///
17301    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
17302    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17303    pub async fn find_roots_opts<'a>(
17304        &self,
17305        markers: Vec<impl Into<String>>,
17306        opts: WorkspaceFindRootsOpts<'a>,
17307    ) -> Result<Vec<String>, DaggerError> {
17308        let mut query = self.selection.select("findRoots");
17309        query = query.arg(
17310            "markers",
17311            markers
17312                .into_iter()
17313                .map(|i| i.into())
17314                .collect::<Vec<String>>(),
17315        );
17316        if let Some(start) = opts.start {
17317            query = query.arg("start", start);
17318        }
17319        if let Some(exclude) = opts.exclude {
17320            query = query.arg("exclude", exclude);
17321        }
17322        query.execute(self.graphql_client.clone()).await
17323    }
17324    /// Search for a file or directory by walking up from the start path within the workspace.
17325    /// Returns the absolute workspace path if found, or null if not found.
17326    /// Relative start paths resolve from the workspace cwd.
17327    /// The search stops at the workspace root and will not traverse above it.
17328    ///
17329    /// # Arguments
17330    ///
17331    /// * `name` - The name of the file or directory to search for.
17332    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17333    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
17334        let mut query = self.selection.select("findUp");
17335        query = query.arg("name", name.into());
17336        query.execute(self.graphql_client.clone()).await
17337    }
17338    /// Search for a file or directory by walking up from the start path within the workspace.
17339    /// Returns the absolute workspace path if found, or null if not found.
17340    /// Relative start paths resolve from the workspace cwd.
17341    /// The search stops at the workspace root and will not traverse above it.
17342    ///
17343    /// # Arguments
17344    ///
17345    /// * `name` - The name of the file or directory to search for.
17346    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17347    pub async fn find_up_opts<'a>(
17348        &self,
17349        name: impl Into<String>,
17350        opts: WorkspaceFindUpOpts<'a>,
17351    ) -> Result<String, DaggerError> {
17352        let mut query = self.selection.select("findUp");
17353        query = query.arg("name", name.into());
17354        if let Some(from) = opts.from {
17355            query = query.arg("from", from);
17356        }
17357        query.execute(self.graphql_client.clone()).await
17358    }
17359    /// Return all generators from modules loaded in the workspace.
17360    ///
17361    /// # Arguments
17362    ///
17363    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17364    pub fn generators(&self) -> GeneratorGroup {
17365        let query = self.selection.select("generators");
17366        GeneratorGroup {
17367            proc: self.proc.clone(),
17368            selection: query,
17369            graphql_client: self.graphql_client.clone(),
17370        }
17371    }
17372    /// Return all generators from modules loaded in the workspace.
17373    ///
17374    /// # Arguments
17375    ///
17376    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17377    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
17378        let mut query = self.selection.select("generators");
17379        if let Some(include) = opts.include {
17380            query = query.arg("include", include);
17381        }
17382        GeneratorGroup {
17383            proc: self.proc.clone(),
17384            selection: query,
17385            graphql_client: self.graphql_client.clone(),
17386        }
17387    }
17388    /// Git state for this workspace. Errors if the workspace is not in a git repository.
17389    pub fn git(&self) -> WorkspaceGit {
17390        let query = self.selection.select("git");
17391        WorkspaceGit {
17392            proc: self.proc.clone(),
17393            selection: query,
17394            graphql_client: self.graphql_client.clone(),
17395        }
17396    }
17397    /// Returns a list of files and directories that match the given pattern.
17398    /// Patterns match paths relative to the workspace root.
17399    ///
17400    /// # Arguments
17401    ///
17402    /// * `pattern` - Pattern to match (e.g., "*.md").
17403    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
17404        let mut query = self.selection.select("glob");
17405        query = query.arg("pattern", pattern.into());
17406        query.execute(self.graphql_client.clone()).await
17407    }
17408    /// A unique identifier for this Workspace.
17409    pub async fn id(&self) -> Result<Id, DaggerError> {
17410        let query = self.selection.select("id");
17411        query.execute(self.graphql_client.clone()).await
17412    }
17413    /// Plan the explicit migration needed for the current workspace.
17414    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
17415    /// The returned plan has an empty changeset and no steps when no migration is needed.
17416    ///
17417    /// # Arguments
17418    ///
17419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17420    pub fn migrate(&self) -> WorkspaceMigration {
17421        let query = self.selection.select("migrate");
17422        WorkspaceMigration {
17423            proc: self.proc.clone(),
17424            selection: query,
17425            graphql_client: self.graphql_client.clone(),
17426        }
17427    }
17428    /// Plan the explicit migration needed for the current workspace.
17429    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
17430    /// The returned plan has an empty changeset and no steps when no migration is needed.
17431    ///
17432    /// # Arguments
17433    ///
17434    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17435    pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
17436        let mut query = self.selection.select("migrate");
17437        if let Some(modules) = opts.modules {
17438            query = query.arg("modules", modules);
17439        }
17440        WorkspaceMigration {
17441            proc: self.proc.clone(),
17442            selection: query,
17443            graphql_client: self.graphql_client.clone(),
17444        }
17445    }
17446    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
17447    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
17448    ///
17449    /// # Arguments
17450    ///
17451    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17452    pub fn migrate_module(&self) -> WorkspaceMigration {
17453        let query = self.selection.select("migrateModule");
17454        WorkspaceMigration {
17455            proc: self.proc.clone(),
17456            selection: query,
17457            graphql_client: self.graphql_client.clone(),
17458        }
17459    }
17460    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
17461    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
17462    ///
17463    /// # Arguments
17464    ///
17465    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17466    pub fn migrate_module_opts<'a>(
17467        &self,
17468        opts: WorkspaceMigrateModuleOpts<'a>,
17469    ) -> WorkspaceMigration {
17470        let mut query = self.selection.select("migrateModule");
17471        if let Some(path) = opts.path {
17472            query = query.arg("path", path);
17473        }
17474        WorkspaceMigration {
17475            proc: self.proc.clone(),
17476            selection: query,
17477            graphql_client: self.graphql_client.clone(),
17478        }
17479    }
17480    /// Return a module defined in the workspace configuration.
17481    /// Reflects the selected env's effective view.
17482    ///
17483    /// # Arguments
17484    ///
17485    /// * `name` - Module name to inspect.
17486    pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
17487        let mut query = self.selection.select("module");
17488        query = query.arg("name", name.into());
17489        WorkspaceModule {
17490            proc: self.proc.clone(),
17491            selection: query,
17492            graphql_client: self.graphql_client.clone(),
17493        }
17494    }
17495    /// Load a module source from a path within the workspace.
17496    /// Relative paths (e.g., "foo") resolve from the workspace cwd; absolute paths (e.g., "/foo") resolve from the workspace root.
17497    /// Fails if the path does not point to an initialized module.
17498    ///
17499    /// # Arguments
17500    ///
17501    /// * `path` - Location of the module source to load, relative to the workspace cwd or absolute from the workspace root.
17502    pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
17503        let mut query = self.selection.select("moduleSource");
17504        query = query.arg("path", path.into());
17505        ModuleSource {
17506            proc: self.proc.clone(),
17507            selection: query,
17508            graphql_client: self.graphql_client.clone(),
17509        }
17510    }
17511    /// List modules defined in the workspace configuration.
17512    /// Reflects the selected env's effective view.
17513    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
17514        let query = self.selection.select("modules");
17515        let query = query.select("id");
17516        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17517        Ok(ids
17518            .into_iter()
17519            .map(|id| WorkspaceModule {
17520                proc: self.proc.clone(),
17521                selection: crate::querybuilder::query()
17522                    .select("node")
17523                    .arg("id", &id.0)
17524                    .inline_fragment("WorkspaceModule"),
17525                graphql_client: self.graphql_client.clone(),
17526            })
17527            .collect())
17528    }
17529    /// An installed SDK, by name.
17530    ///
17531    /// # Arguments
17532    ///
17533    /// * `name` - SDK name to look up.
17534    pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
17535        let mut query = self.selection.select("sdk");
17536        query = query.arg("name", name.into());
17537        WorkspaceSdk {
17538            proc: self.proc.clone(),
17539            selection: query,
17540            graphql_client: self.graphql_client.clone(),
17541        }
17542    }
17543    /// Installed SDKs.
17544    pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
17545        let query = self.selection.select("sdks");
17546        let query = query.select("id");
17547        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17548        Ok(ids
17549            .into_iter()
17550            .map(|id| WorkspaceSdk {
17551                proc: self.proc.clone(),
17552                selection: crate::querybuilder::query()
17553                    .select("node")
17554                    .arg("id", &id.0)
17555                    .inline_fragment("WorkspaceSDK"),
17556                graphql_client: self.graphql_client.clone(),
17557            })
17558            .collect())
17559    }
17560    /// Searches for content matching the given regular expression or literal string.
17561    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
17562    /// Runs ripgrep on the client host, falling back to grep if unavailable.
17563    ///
17564    /// # Arguments
17565    ///
17566    /// * `pattern` - The text to match.
17567    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17568    pub async fn search(
17569        &self,
17570        pattern: impl Into<String>,
17571    ) -> Result<Vec<SearchResult>, DaggerError> {
17572        let mut query = self.selection.select("search");
17573        query = query.arg("pattern", pattern.into());
17574        let query = query.select("id");
17575        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17576        Ok(ids
17577            .into_iter()
17578            .map(|id| SearchResult {
17579                proc: self.proc.clone(),
17580                selection: crate::querybuilder::query()
17581                    .select("node")
17582                    .arg("id", &id.0)
17583                    .inline_fragment("SearchResult"),
17584                graphql_client: self.graphql_client.clone(),
17585            })
17586            .collect())
17587    }
17588    /// Searches for content matching the given regular expression or literal string.
17589    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
17590    /// Runs ripgrep on the client host, falling back to grep if unavailable.
17591    ///
17592    /// # Arguments
17593    ///
17594    /// * `pattern` - The text to match.
17595    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17596    pub async fn search_opts<'a>(
17597        &self,
17598        pattern: impl Into<String>,
17599        opts: WorkspaceSearchOpts<'a>,
17600    ) -> Result<Vec<SearchResult>, DaggerError> {
17601        let mut query = self.selection.select("search");
17602        query = query.arg("pattern", pattern.into());
17603        if let Some(paths) = opts.paths {
17604            query = query.arg("paths", paths);
17605        }
17606        if let Some(globs) = opts.globs {
17607            query = query.arg("globs", globs);
17608        }
17609        if let Some(literal) = opts.literal {
17610            query = query.arg("literal", literal);
17611        }
17612        if let Some(multiline) = opts.multiline {
17613            query = query.arg("multiline", multiline);
17614        }
17615        if let Some(dotall) = opts.dotall {
17616            query = query.arg("dotall", dotall);
17617        }
17618        if let Some(insensitive) = opts.insensitive {
17619            query = query.arg("insensitive", insensitive);
17620        }
17621        if let Some(skip_ignored) = opts.skip_ignored {
17622            query = query.arg("skipIgnored", skip_ignored);
17623        }
17624        if let Some(skip_hidden) = opts.skip_hidden {
17625            query = query.arg("skipHidden", skip_hidden);
17626        }
17627        if let Some(files_only) = opts.files_only {
17628            query = query.arg("filesOnly", files_only);
17629        }
17630        if let Some(limit) = opts.limit {
17631            query = query.arg("limit", limit);
17632        }
17633        let query = query.select("id");
17634        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17635        Ok(ids
17636            .into_iter()
17637            .map(|id| SearchResult {
17638                proc: self.proc.clone(),
17639                selection: crate::querybuilder::query()
17640                    .select("node")
17641                    .arg("id", &id.0)
17642                    .inline_fragment("SearchResult"),
17643                graphql_client: self.graphql_client.clone(),
17644            })
17645            .collect())
17646    }
17647    /// Return all services from modules loaded in the workspace.
17648    ///
17649    /// # Arguments
17650    ///
17651    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17652    pub fn services(&self) -> UpGroup {
17653        let query = self.selection.select("services");
17654        UpGroup {
17655            proc: self.proc.clone(),
17656            selection: query,
17657            graphql_client: self.graphql_client.clone(),
17658        }
17659    }
17660    /// Return all services from modules loaded in the workspace.
17661    ///
17662    /// # Arguments
17663    ///
17664    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17665    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
17666        let mut query = self.selection.select("services");
17667        if let Some(include) = opts.include {
17668            query = query.arg("include", include);
17669        }
17670        UpGroup {
17671            proc: self.proc.clone(),
17672            selection: query,
17673            graphql_client: self.graphql_client.clone(),
17674        }
17675    }
17676    /// Return a snapshot of this workspace as a stable value.
17677    /// Git capture is a progressive enhancement: if the workspace has no Git repository or commits, or the client cannot capture Git, return this workspace unchanged. Approval rejections and capture failures remain errors.
17678    /// Use the returned workspace for subsequent reads, edits, and module loading against the captured baseline. Snapshotting an existing stable value preserves its baseline; snapshot currentWorkspace again to capture later checkout changes.
17679    /// Only the owning client can capture a local checkout. Tracked changes are captured automatically; untracked files require interactive approval. Remote Git refs are pinned to their resolved commits. Capturing leaves the checkout unchanged.
17680    /// The recipe is portable when a remote can serve its base; otherwise it is frozen for this session only.
17681    pub fn snapshot(&self) -> Workspace {
17682        let query = self.selection.select("snapshot");
17683        Workspace {
17684            proc: self.proc.clone(),
17685            selection: query,
17686            graphql_client: self.graphql_client.clone(),
17687        }
17688    }
17689    /// Return all terminal targets from modules loaded in the workspace.
17690    ///
17691    /// # Arguments
17692    ///
17693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17694    pub fn terminals(&self) -> TerminalGroup {
17695        let query = self.selection.select("terminals");
17696        TerminalGroup {
17697            proc: self.proc.clone(),
17698            selection: query,
17699            graphql_client: self.graphql_client.clone(),
17700        }
17701    }
17702    /// Return all terminal targets from modules loaded in the workspace.
17703    ///
17704    /// # Arguments
17705    ///
17706    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17707    pub fn terminals_opts<'a>(&self, opts: WorkspaceTerminalsOpts<'a>) -> TerminalGroup {
17708        let mut query = self.selection.select("terminals");
17709        if let Some(include) = opts.include {
17710            query = query.arg("include", include);
17711        }
17712        TerminalGroup {
17713            proc: self.proc.clone(),
17714            selection: query,
17715            graphql_client: self.graphql_client.clone(),
17716        }
17717    }
17718    /// Return this workspace with a changeset applied, without mutating the source.
17719    ///
17720    /// # Arguments
17721    ///
17722    /// * `changes` - Changes to apply.
17723    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
17724        let mut query = self.selection.select("withChanges");
17725        query = query.arg_lazy(
17726            "changes",
17727            Box::new(move || {
17728                let changes = changes.clone();
17729                Box::pin(async move { changes.into_id().await.unwrap().quote() })
17730            }),
17731        );
17732        Workspace {
17733            proc: self.proc.clone(),
17734            selection: query,
17735            graphql_client: self.graphql_client.clone(),
17736        }
17737    }
17738    /// Return this workspace with a generated module client added to one SDK scope.
17739    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
17740    ///
17741    /// # Arguments
17742    ///
17743    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
17744    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17745    pub fn with_client(&self, module: impl Into<String>) -> Workspace {
17746        let mut query = self.selection.select("withClient");
17747        query = query.arg("module", module.into());
17748        Workspace {
17749            proc: self.proc.clone(),
17750            selection: query,
17751            graphql_client: self.graphql_client.clone(),
17752        }
17753    }
17754    /// Return this workspace with a generated module client added to one SDK scope.
17755    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
17756    ///
17757    /// # Arguments
17758    ///
17759    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
17760    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17761    pub fn with_client_opts<'a>(
17762        &self,
17763        module: impl Into<String>,
17764        opts: WorkspaceWithClientOpts<'a>,
17765    ) -> Workspace {
17766        let mut query = self.selection.select("withClient");
17767        query = query.arg("module", module.into());
17768        if let Some(sdk) = opts.sdk {
17769            query = query.arg("sdk", sdk);
17770        }
17771        if let Some(settings) = opts.settings {
17772            query = query.arg("settings", settings);
17773        }
17774        Workspace {
17775            proc: self.proc.clone(),
17776            selection: query,
17777            graphql_client: self.graphql_client.clone(),
17778        }
17779    }
17780    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
17781    /// The changeset is three-way merged into both HEAD and the frozen working tree. Compatible unselected edits remain uncommitted; incoming changes need not already be in the working tree. Conflicts with either tree fail without modifying the workspace. Empty changesets, or changes already present in HEAD, fail with nothing to commit.
17782    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
17783    /// Missing author fields are resolved from Git config in the calling client's working directory at commit time, then recorded explicitly for reproducible commits. Unconfigured fields default to Dagger and dagger@localhost.
17784    ///
17785    /// # Arguments
17786    ///
17787    /// * `changes` - Changeset to commit, for example git.uncommitted.filter(...). Paths are rooted at the repository; rename sides are determined by the changeset. Git metadata (.git) is ignored; metadata-only changes fail with nothing to commit.
17788    /// * `message` - Commit message.
17789    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
17790    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17791    pub fn with_commit(
17792        &self,
17793        changes: impl IntoID<Id>,
17794        message: impl Into<String>,
17795        date: impl Into<String>,
17796    ) -> Workspace {
17797        let mut query = self.selection.select("withCommit");
17798        query = query.arg_lazy(
17799            "changes",
17800            Box::new(move || {
17801                let changes = changes.clone();
17802                Box::pin(async move { changes.into_id().await.unwrap().quote() })
17803            }),
17804        );
17805        query = query.arg("message", message.into());
17806        query = query.arg("date", date.into());
17807        Workspace {
17808            proc: self.proc.clone(),
17809            selection: query,
17810            graphql_client: self.graphql_client.clone(),
17811        }
17812    }
17813    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
17814    /// The changeset is three-way merged into both HEAD and the frozen working tree. Compatible unselected edits remain uncommitted; incoming changes need not already be in the working tree. Conflicts with either tree fail without modifying the workspace. Empty changesets, or changes already present in HEAD, fail with nothing to commit.
17815    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
17816    /// Missing author fields are resolved from Git config in the calling client's working directory at commit time, then recorded explicitly for reproducible commits. Unconfigured fields default to Dagger and dagger@localhost.
17817    ///
17818    /// # Arguments
17819    ///
17820    /// * `changes` - Changeset to commit, for example git.uncommitted.filter(...). Paths are rooted at the repository; rename sides are determined by the changeset. Git metadata (.git) is ignored; metadata-only changes fail with nothing to commit.
17821    /// * `message` - Commit message.
17822    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
17823    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17824    pub fn with_commit_opts<'a>(
17825        &self,
17826        changes: impl IntoID<Id>,
17827        message: impl Into<String>,
17828        date: impl Into<String>,
17829        opts: WorkspaceWithCommitOpts<'a>,
17830    ) -> Workspace {
17831        let mut query = self.selection.select("withCommit");
17832        query = query.arg_lazy(
17833            "changes",
17834            Box::new(move || {
17835                let changes = changes.clone();
17836                Box::pin(async move { changes.into_id().await.unwrap().quote() })
17837            }),
17838        );
17839        query = query.arg("message", message.into());
17840        query = query.arg("date", date.into());
17841        if let Some(author_name) = opts.author_name {
17842            query = query.arg("authorName", author_name);
17843        }
17844        if let Some(author_email) = opts.author_email {
17845            query = query.arg("authorEmail", author_email);
17846        }
17847        if let Some(signoff) = opts.signoff {
17848            query = query.arg("signoff", signoff);
17849        }
17850        Workspace {
17851            proc: self.proc.clone(),
17852            selection: query,
17853            graphql_client: self.graphql_client.clone(),
17854        }
17855    }
17856    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
17857    /// Fast-forward when the selected commits include all new ancestors of their tip; otherwise cherry-pick them oldest first. Already integrated commits and patches already present are skipped. Any conflict fails the operation. Source uncommitted changes are not transferred; merge them explicitly if needed. Use compareCommitsFrom to preview the integration.
17858    /// A local receiver is snapshotted automatically; untracked files require interactive approval. The checkout is not modified. Export the result with an explicit path to write it to a checkout.
17859    /// Cherry-picks preserve the source author and author date, use the calling client's Git config for committer identity, and reuse the source committer date for reproducible hashes. Origin trailers track cherry-picked commits. Divergent merge commits require manual integration.
17860    ///
17861    /// # Arguments
17862    ///
17863    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
17864    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17865    pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
17866        let mut query = self.selection.select("withCommitsFrom");
17867        query = query.arg_lazy(
17868            "source",
17869            Box::new(move || {
17870                let source = source.clone();
17871                Box::pin(async move { source.into_id().await.unwrap().quote() })
17872            }),
17873        );
17874        Workspace {
17875            proc: self.proc.clone(),
17876            selection: query,
17877            graphql_client: self.graphql_client.clone(),
17878        }
17879    }
17880    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
17881    /// Fast-forward when the selected commits include all new ancestors of their tip; otherwise cherry-pick them oldest first. Already integrated commits and patches already present are skipped. Any conflict fails the operation. Source uncommitted changes are not transferred; merge them explicitly if needed. Use compareCommitsFrom to preview the integration.
17882    /// A local receiver is snapshotted automatically; untracked files require interactive approval. The checkout is not modified. Export the result with an explicit path to write it to a checkout.
17883    /// Cherry-picks preserve the source author and author date, use the calling client's Git config for committer identity, and reuse the source committer date for reproducible hashes. Origin trailers track cherry-picked commits. Divergent merge commits require manual integration.
17884    ///
17885    /// # Arguments
17886    ///
17887    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
17888    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17889    pub fn with_commits_from_opts<'a>(
17890        &self,
17891        source: impl IntoID<Id>,
17892        opts: WorkspaceWithCommitsFromOpts<'a>,
17893    ) -> Workspace {
17894        let mut query = self.selection.select("withCommitsFrom");
17895        query = query.arg_lazy(
17896            "source",
17897            Box::new(move || {
17898                let source = source.clone();
17899                Box::pin(async move { source.into_id().await.unwrap().quote() })
17900            }),
17901        );
17902        if let Some(commits) = opts.commits {
17903            query = query.arg("commits", commits);
17904        }
17905        if let Some(max_commits) = opts.max_commits {
17906            query = query.arg("maxCommits", max_commits);
17907        }
17908        Workspace {
17909            proc: self.proc.clone(),
17910            selection: query,
17911            graphql_client: self.graphql_client.clone(),
17912        }
17913    }
17914    /// Return this workspace with a named config environment created.
17915    ///
17916    /// # Arguments
17917    ///
17918    /// * `name` - Environment name.
17919    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17920    pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
17921        let mut query = self.selection.select("withConfigEnv");
17922        query = query.arg("name", name.into());
17923        Workspace {
17924            proc: self.proc.clone(),
17925            selection: query,
17926            graphql_client: self.graphql_client.clone(),
17927        }
17928    }
17929    /// Return this workspace with a named config environment created.
17930    ///
17931    /// # Arguments
17932    ///
17933    /// * `name` - Environment name.
17934    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17935    pub fn with_config_env_opts(
17936        &self,
17937        name: impl Into<String>,
17938        opts: WorkspaceWithConfigEnvOpts,
17939    ) -> Workspace {
17940        let mut query = self.selection.select("withConfigEnv");
17941        query = query.arg("name", name.into());
17942        if let Some(here) = opts.here {
17943            query = query.arg("here", here);
17944        }
17945        Workspace {
17946            proc: self.proc.clone(),
17947            selection: query,
17948            graphql_client: self.graphql_client.clone(),
17949        }
17950    }
17951    /// Select the config environment carried by this workspace.
17952    ///
17953    /// # Arguments
17954    ///
17955    /// * `name` - Environment name, or empty to clear the selection.
17956    pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
17957        let mut query = self.selection.select("withConfigEnvironment");
17958        query = query.arg("name", name.into());
17959        Workspace {
17960            proc: self.proc.clone(),
17961            selection: query,
17962            graphql_client: self.graphql_client.clone(),
17963        }
17964    }
17965    /// Select workspace-root-relative config and lockfile paths. Empty paths clear the selection.
17966    ///
17967    /// # Arguments
17968    ///
17969    /// * `config_file` - Config file path.
17970    /// * `lock_file` - Lockfile path.
17971    pub fn with_config_paths(
17972        &self,
17973        config_file: impl Into<String>,
17974        lock_file: impl Into<String>,
17975    ) -> Workspace {
17976        let mut query = self.selection.select("withConfigPaths");
17977        query = query.arg("configFile", config_file.into());
17978        query = query.arg("lockFile", lock_file.into());
17979        Workspace {
17980            proc: self.proc.clone(),
17981            selection: query,
17982            graphql_client: self.graphql_client.clone(),
17983        }
17984    }
17985    /// Return this workspace with a configuration value written.
17986    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
17987    ///
17988    /// # Arguments
17989    ///
17990    /// * `key` - Dotted key path.
17991    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
17992    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17993    pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
17994        let mut query = self.selection.select("withConfigValue");
17995        query = query.arg("key", key.into());
17996        query = query.arg("value", value.into());
17997        Workspace {
17998            proc: self.proc.clone(),
17999            selection: query,
18000            graphql_client: self.graphql_client.clone(),
18001        }
18002    }
18003    /// Return this workspace with a configuration value written.
18004    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
18005    ///
18006    /// # Arguments
18007    ///
18008    /// * `key` - Dotted key path.
18009    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
18010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18011    pub fn with_config_value_opts<'a>(
18012        &self,
18013        key: impl Into<String>,
18014        value: impl Into<String>,
18015        opts: WorkspaceWithConfigValueOpts<'a>,
18016    ) -> Workspace {
18017        let mut query = self.selection.select("withConfigValue");
18018        query = query.arg("key", key.into());
18019        query = query.arg("value", value.into());
18020        if let Some(values) = opts.values {
18021            query = query.arg("values", values);
18022        }
18023        if let Some(here) = opts.here {
18024            query = query.arg("here", here);
18025        }
18026        Workspace {
18027            proc: self.proc.clone(),
18028            selection: query,
18029            graphql_client: self.graphql_client.clone(),
18030        }
18031    }
18032    /// Return this workspace with a directory merged into the given path, without mutating the source.
18033    /// Anything already at the path stays, and files the source carries win, as with Directory.withDirectory. Use withNewDirectory to replace the path instead.
18034    ///
18035    /// # Arguments
18036    ///
18037    /// * `path` - Path to merge into. Relative paths resolve from the workspace cwd.
18038    /// * `source` - Directory to merge there.
18039    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
18040        let mut query = self.selection.select("withDirectory");
18041        query = query.arg("path", path.into());
18042        query = query.arg_lazy(
18043            "source",
18044            Box::new(move || {
18045                let source = source.clone();
18046                Box::pin(async move { source.into_id().await.unwrap().quote() })
18047            }),
18048        );
18049        Workspace {
18050            proc: self.proc.clone(),
18051            selection: query,
18052            graphql_client: self.graphql_client.clone(),
18053        }
18054    }
18055    /// Return this workspace with an installed module selected as its entrypoint.
18056    /// Every other entrypoint selection is cleared. Entrypoints live in the base workspace config.
18057    ///
18058    /// # Arguments
18059    ///
18060    /// * `name` - Exact installed module name.
18061    pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
18062        let mut query = self.selection.select("withEntrypoint");
18063        query = query.arg("name", name.into());
18064        Workspace {
18065            proc: self.proc.clone(),
18066            selection: query,
18067            graphql_client: self.graphql_client.clone(),
18068        }
18069    }
18070    /// Return this workspace with a file added or replaced, without mutating the source.
18071    ///
18072    /// # Arguments
18073    ///
18074    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
18075    /// * `source` - File to add.
18076    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18077    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
18078        let mut query = self.selection.select("withFile");
18079        query = query.arg("path", path.into());
18080        query = query.arg_lazy(
18081            "source",
18082            Box::new(move || {
18083                let source = source.clone();
18084                Box::pin(async move { source.into_id().await.unwrap().quote() })
18085            }),
18086        );
18087        Workspace {
18088            proc: self.proc.clone(),
18089            selection: query,
18090            graphql_client: self.graphql_client.clone(),
18091        }
18092    }
18093    /// Return this workspace with a file added or replaced, without mutating the source.
18094    ///
18095    /// # Arguments
18096    ///
18097    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
18098    /// * `source` - File to add.
18099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18100    pub fn with_file_opts(
18101        &self,
18102        path: impl Into<String>,
18103        source: impl IntoID<Id>,
18104        opts: WorkspaceWithFileOpts,
18105    ) -> Workspace {
18106        let mut query = self.selection.select("withFile");
18107        query = query.arg("path", path.into());
18108        query = query.arg_lazy(
18109            "source",
18110            Box::new(move || {
18111                let source = source.clone();
18112                Box::pin(async move { source.into_id().await.unwrap().quote() })
18113            }),
18114        );
18115        if let Some(permissions) = opts.permissions {
18116            query = query.arg("permissions", permissions);
18117        }
18118        Workspace {
18119            proc: self.proc.clone(),
18120            selection: query,
18121            graphql_client: self.graphql_client.clone(),
18122        }
18123    }
18124    /// Return this workspace with a location initialized as a module scope.
18125    /// The selected SDK module records the scope and generates the module source.
18126    ///
18127    /// # Arguments
18128    ///
18129    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
18130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18131    pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
18132        let mut query = self.selection.select("withInitModule");
18133        query = query.arg("sdk", sdk.into());
18134        Workspace {
18135            proc: self.proc.clone(),
18136            selection: query,
18137            graphql_client: self.graphql_client.clone(),
18138        }
18139    }
18140    /// Return this workspace with a location initialized as a module scope.
18141    /// The selected SDK module records the scope and generates the module source.
18142    ///
18143    /// # Arguments
18144    ///
18145    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
18146    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18147    pub fn with_init_module_opts<'a>(
18148        &self,
18149        sdk: impl Into<String>,
18150        opts: WorkspaceWithInitModuleOpts<'a>,
18151    ) -> Workspace {
18152        let mut query = self.selection.select("withInitModule");
18153        query = query.arg("sdk", sdk.into());
18154        if let Some(name) = opts.name {
18155            query = query.arg("name", name);
18156        }
18157        if let Some(path) = opts.path {
18158            query = query.arg("path", path);
18159        }
18160        if let Some(install) = opts.install {
18161            query = query.arg("install", install);
18162        }
18163        if let Some(entrypoint) = opts.entrypoint {
18164            query = query.arg("entrypoint", entrypoint);
18165        }
18166        if let Some(settings) = opts.settings {
18167            query = query.arg("settings", settings);
18168        }
18169        Workspace {
18170            proc: self.proc.clone(),
18171            selection: query,
18172            graphql_client: self.graphql_client.clone(),
18173        }
18174    }
18175    /// Return this workspace with a native configuration, without changing an existing configuration.
18176    /// Fail if legacy configuration needs workspace migration.
18177    pub fn with_initialized(&self) -> Workspace {
18178        let query = self.selection.select("withInitialized");
18179        Workspace {
18180            proc: self.proc.clone(),
18181            selection: query,
18182            graphql_client: self.graphql_client.clone(),
18183        }
18184    }
18185    /// Return this workspace with a module installed in its config.
18186    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
18187    ///
18188    /// # Arguments
18189    ///
18190    /// * `r#ref` - Module reference to install.
18191    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18192    pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
18193        let mut query = self.selection.select("withModule");
18194        query = query.arg("ref", r#ref.into());
18195        Workspace {
18196            proc: self.proc.clone(),
18197            selection: query,
18198            graphql_client: self.graphql_client.clone(),
18199        }
18200    }
18201    /// Return this workspace with a module installed in its config.
18202    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
18203    ///
18204    /// # Arguments
18205    ///
18206    /// * `r#ref` - Module reference to install.
18207    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18208    pub fn with_module_opts<'a>(
18209        &self,
18210        r#ref: impl Into<String>,
18211        opts: WorkspaceWithModuleOpts<'a>,
18212    ) -> Workspace {
18213        let mut query = self.selection.select("withModule");
18214        query = query.arg("ref", r#ref.into());
18215        if let Some(name) = opts.name {
18216            query = query.arg("name", name);
18217        }
18218        if let Some(here) = opts.here {
18219            query = query.arg("here", here);
18220        }
18221        Workspace {
18222            proc: self.proc.clone(),
18223            selection: query,
18224            graphql_client: self.graphql_client.clone(),
18225        }
18226    }
18227    /// Return this workspace with a directory mounted read-only at the given path, without mutating the source.
18228    /// Mounted content is readable through the normal workspace file tools but shadows the source at the mount path and stays out of the pending changeset: it never appears in changes, is never exported, and cannot be modified.
18229    ///
18230    /// # Arguments
18231    ///
18232    /// * `path` - Location of the mounted directory. Relative paths resolve from the workspace cwd.
18233    /// * `source` - Directory to mount.
18234    pub fn with_mounted_directory(
18235        &self,
18236        path: impl Into<String>,
18237        source: impl IntoID<Id>,
18238    ) -> Workspace {
18239        let mut query = self.selection.select("withMountedDirectory");
18240        query = query.arg("path", path.into());
18241        query = query.arg_lazy(
18242            "source",
18243            Box::new(move || {
18244                let source = source.clone();
18245                Box::pin(async move { source.into_id().await.unwrap().quote() })
18246            }),
18247        );
18248        Workspace {
18249            proc: self.proc.clone(),
18250            selection: query,
18251            graphql_client: self.graphql_client.clone(),
18252        }
18253    }
18254    /// Return this workspace with a file mounted read-only at the given path, without mutating the source.
18255    /// Mounted content is readable through the normal workspace file tools but shadows the source at the mount path and stays out of the pending changeset: it never appears in changes, is never exported, and cannot be modified.
18256    ///
18257    /// # Arguments
18258    ///
18259    /// * `path` - Location of the mounted file. Relative paths resolve from the workspace cwd.
18260    /// * `source` - File to mount.
18261    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
18262        let mut query = self.selection.select("withMountedFile");
18263        query = query.arg("path", path.into());
18264        query = query.arg_lazy(
18265            "source",
18266            Box::new(move || {
18267                let source = source.clone();
18268                Box::pin(async move { source.into_id().await.unwrap().quote() })
18269            }),
18270        );
18271        Workspace {
18272            proc: self.proc.clone(),
18273            selection: query,
18274            graphql_client: self.graphql_client.clone(),
18275        }
18276    }
18277    /// Return this workspace with the given path replaced by a directory, without mutating the source.
18278    /// The source becomes the entire contents of the path: anything already there that the source does not carry is removed. Use withDirectory to keep it instead.
18279    ///
18280    /// # Arguments
18281    ///
18282    /// * `path` - Path to replace. Relative paths resolve from the workspace cwd.
18283    /// * `source` - Directory to write there.
18284    pub fn with_new_directory(
18285        &self,
18286        path: impl Into<String>,
18287        source: impl IntoID<Id>,
18288    ) -> Workspace {
18289        let mut query = self.selection.select("withNewDirectory");
18290        query = query.arg("path", path.into());
18291        query = query.arg_lazy(
18292            "source",
18293            Box::new(move || {
18294                let source = source.clone();
18295                Box::pin(async move { source.into_id().await.unwrap().quote() })
18296            }),
18297        );
18298        Workspace {
18299            proc: self.proc.clone(),
18300            selection: query,
18301            graphql_client: self.graphql_client.clone(),
18302        }
18303    }
18304    /// Return this workspace with a new or replaced file, without mutating the source.
18305    ///
18306    /// # Arguments
18307    ///
18308    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
18309    /// * `contents` - Contents of the new file.
18310    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18311    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
18312        let mut query = self.selection.select("withNewFile");
18313        query = query.arg("path", path.into());
18314        query = query.arg("contents", contents.into());
18315        Workspace {
18316            proc: self.proc.clone(),
18317            selection: query,
18318            graphql_client: self.graphql_client.clone(),
18319        }
18320    }
18321    /// Return this workspace with a new or replaced file, without mutating the source.
18322    ///
18323    /// # Arguments
18324    ///
18325    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
18326    /// * `contents` - Contents of the new file.
18327    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18328    pub fn with_new_file_opts(
18329        &self,
18330        path: impl Into<String>,
18331        contents: impl Into<String>,
18332        opts: WorkspaceWithNewFileOpts,
18333    ) -> Workspace {
18334        let mut query = self.selection.select("withNewFile");
18335        query = query.arg("path", path.into());
18336        query = query.arg("contents", contents.into());
18337        if let Some(permissions) = opts.permissions {
18338            query = query.arg("permissions", permissions);
18339        }
18340        Workspace {
18341            proc: self.proc.clone(),
18342            selection: query,
18343            graphql_client: self.graphql_client.clone(),
18344        }
18345    }
18346    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18347    /// A local workspace is snapshotted automatically before resetting; untracked files require interactive approval. The host checkout is not modified. By default the difference between the previous working tree and the target commit stays uncommitted, as with git reset --mixed, so history can be reworked and reapplied with withCommit — e.g. to amend the latest commit message, reset to its parent and commit again.
18348    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18349    /// Commits orphaned by the reset are not preserved: the frozen repository keeps reachable history only, so a reset cannot be undone by resetting forward again.
18350    ///
18351    /// # Arguments
18352    ///
18353    /// * `commit` - Full commit hash to reset HEAD to.
18354    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18355    pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
18356        let mut query = self.selection.select("withReset");
18357        query = query.arg("commit", commit.into());
18358        Workspace {
18359            proc: self.proc.clone(),
18360            selection: query,
18361            graphql_client: self.graphql_client.clone(),
18362        }
18363    }
18364    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18365    /// A local workspace is snapshotted automatically before resetting; untracked files require interactive approval. The host checkout is not modified. By default the difference between the previous working tree and the target commit stays uncommitted, as with git reset --mixed, so history can be reworked and reapplied with withCommit — e.g. to amend the latest commit message, reset to its parent and commit again.
18366    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18367    /// Commits orphaned by the reset are not preserved: the frozen repository keeps reachable history only, so a reset cannot be undone by resetting forward again.
18368    ///
18369    /// # Arguments
18370    ///
18371    /// * `commit` - Full commit hash to reset HEAD to.
18372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18373    pub fn with_reset_opts(
18374        &self,
18375        commit: impl Into<String>,
18376        opts: WorkspaceWithResetOpts,
18377    ) -> Workspace {
18378        let mut query = self.selection.select("withReset");
18379        query = query.arg("commit", commit.into());
18380        if let Some(hard) = opts.hard {
18381            query = query.arg("hard", hard);
18382        }
18383        Workspace {
18384            proc: self.proc.clone(),
18385            selection: query,
18386            graphql_client: self.graphql_client.clone(),
18387        }
18388    }
18389    /// Return this workspace with an SDK installed in its config.
18390    ///
18391    /// # Arguments
18392    ///
18393    /// * `r#ref` - SDK module reference to install.
18394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18395    pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
18396        let mut query = self.selection.select("withSDK");
18397        query = query.arg("ref", r#ref.into());
18398        Workspace {
18399            proc: self.proc.clone(),
18400            selection: query,
18401            graphql_client: self.graphql_client.clone(),
18402        }
18403    }
18404    /// Return this workspace with an SDK installed in its config.
18405    ///
18406    /// # Arguments
18407    ///
18408    /// * `r#ref` - SDK module reference to install.
18409    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18410    pub fn with_sdk_opts<'a>(
18411        &self,
18412        r#ref: impl Into<String>,
18413        opts: WorkspaceWithSdkOpts<'a>,
18414    ) -> Workspace {
18415        let mut query = self.selection.select("withSDK");
18416        query = query.arg("ref", r#ref.into());
18417        if let Some(name) = opts.name {
18418            query = query.arg("name", name);
18419        }
18420        if let Some(here) = opts.here {
18421            query = query.arg("here", here);
18422        }
18423        if let Some(as_sdk_name) = opts.as_sdk_name {
18424            query = query.arg("asSdkName", as_sdk_name);
18425        }
18426        Workspace {
18427            proc: self.proc.clone(),
18428            selection: query,
18429            graphql_client: self.graphql_client.clone(),
18430        }
18431    }
18432    /// Return this workspace with the selected module clients updated.
18433    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
18434    /// The selected SDK module then regenerates every scope that owns one of the targets.
18435    ///
18436    /// # Arguments
18437    ///
18438    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18439    pub fn with_updated_clients(&self) -> Workspace {
18440        let query = self.selection.select("withUpdatedClients");
18441        Workspace {
18442            proc: self.proc.clone(),
18443            selection: query,
18444            graphql_client: self.graphql_client.clone(),
18445        }
18446    }
18447    /// Return this workspace with the selected module clients updated.
18448    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
18449    /// The selected SDK module then regenerates every scope that owns one of the targets.
18450    ///
18451    /// # Arguments
18452    ///
18453    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18454    pub fn with_updated_clients_opts<'a>(
18455        &self,
18456        opts: WorkspaceWithUpdatedClientsOpts<'a>,
18457    ) -> Workspace {
18458        let mut query = self.selection.select("withUpdatedClients");
18459        if let Some(modules) = opts.modules {
18460            query = query.arg("modules", modules);
18461        }
18462        if let Some(all) = opts.all {
18463            query = query.arg("all", all);
18464        }
18465        if let Some(sdk) = opts.sdk {
18466            query = query.arg("sdk", sdk);
18467        }
18468        Workspace {
18469            proc: self.proc.clone(),
18470            selection: query,
18471            graphql_client: self.graphql_client.clone(),
18472        }
18473    }
18474    /// Return this workspace with refreshed lockfile state.
18475    /// SDK client scopes are regenerated unless noGenerate is true.
18476    ///
18477    /// # Arguments
18478    ///
18479    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18480    pub fn with_updated_lock(&self) -> Workspace {
18481        let query = self.selection.select("withUpdatedLock");
18482        Workspace {
18483            proc: self.proc.clone(),
18484            selection: query,
18485            graphql_client: self.graphql_client.clone(),
18486        }
18487    }
18488    /// Return this workspace with refreshed lockfile state.
18489    /// SDK client scopes are regenerated unless noGenerate is true.
18490    ///
18491    /// # Arguments
18492    ///
18493    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18494    pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
18495        let mut query = self.selection.select("withUpdatedLock");
18496        if let Some(no_generate) = opts.no_generate {
18497            query = query.arg("noGenerate", no_generate);
18498        }
18499        Workspace {
18500            proc: self.proc.clone(),
18501            selection: query,
18502            graphql_client: self.graphql_client.clone(),
18503        }
18504    }
18505    /// Return this workspace with updated module versions and lockfile state.
18506    /// An SDK client scope is regenerated when it targets an updated module.
18507    ///
18508    /// # Arguments
18509    ///
18510    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18511    pub fn with_updated_modules(&self) -> Workspace {
18512        let query = self.selection.select("withUpdatedModules");
18513        Workspace {
18514            proc: self.proc.clone(),
18515            selection: query,
18516            graphql_client: self.graphql_client.clone(),
18517        }
18518    }
18519    /// Return this workspace with updated module versions and lockfile state.
18520    /// An SDK client scope is regenerated when it targets an updated module.
18521    ///
18522    /// # Arguments
18523    ///
18524    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18525    pub fn with_updated_modules_opts<'a>(
18526        &self,
18527        opts: WorkspaceWithUpdatedModulesOpts<'a>,
18528    ) -> Workspace {
18529        let mut query = self.selection.select("withUpdatedModules");
18530        if let Some(names) = opts.names {
18531            query = query.arg("names", names);
18532        }
18533        if let Some(version) = opts.version {
18534            query = query.arg("version", version);
18535        }
18536        Workspace {
18537            proc: self.proc.clone(),
18538            selection: query,
18539            graphql_client: self.graphql_client.clone(),
18540        }
18541    }
18542    /// Return this workspace with its working directory pointed at the given workspace-relative path.
18543    ///
18544    /// # Arguments
18545    ///
18546    /// * `path` - Workspace-relative path to use as the working directory.
18547    pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
18548        let mut query = self.selection.select("withWorkdir");
18549        query = query.arg("path", path.into());
18550        Workspace {
18551            proc: self.proc.clone(),
18552            selection: query,
18553            graphql_client: self.graphql_client.clone(),
18554        }
18555    }
18556    /// Return this workspace with a module client removed from the deepest matching recorded scope.
18557    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
18558    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
18559    ///
18560    /// # Arguments
18561    ///
18562    /// * `module` - The recorded target to remove.
18563    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18564    pub fn without_client(&self, module: impl Into<String>) -> Workspace {
18565        let mut query = self.selection.select("withoutClient");
18566        query = query.arg("module", module.into());
18567        Workspace {
18568            proc: self.proc.clone(),
18569            selection: query,
18570            graphql_client: self.graphql_client.clone(),
18571        }
18572    }
18573    /// Return this workspace with a module client removed from the deepest matching recorded scope.
18574    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
18575    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
18576    ///
18577    /// # Arguments
18578    ///
18579    /// * `module` - The recorded target to remove.
18580    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18581    pub fn without_client_opts<'a>(
18582        &self,
18583        module: impl Into<String>,
18584        opts: WorkspaceWithoutClientOpts<'a>,
18585    ) -> Workspace {
18586        let mut query = self.selection.select("withoutClient");
18587        query = query.arg("module", module.into());
18588        if let Some(sdk) = opts.sdk {
18589            query = query.arg("sdk", sdk);
18590        }
18591        Workspace {
18592            proc: self.proc.clone(),
18593            selection: query,
18594            graphql_client: self.graphql_client.clone(),
18595        }
18596    }
18597    /// Return this workspace with a named config environment removed.
18598    ///
18599    /// # Arguments
18600    ///
18601    /// * `name` - Environment name.
18602    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18603    pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
18604        let mut query = self.selection.select("withoutConfigEnv");
18605        query = query.arg("name", name.into());
18606        Workspace {
18607            proc: self.proc.clone(),
18608            selection: query,
18609            graphql_client: self.graphql_client.clone(),
18610        }
18611    }
18612    /// Return this workspace with a named config environment removed.
18613    ///
18614    /// # Arguments
18615    ///
18616    /// * `name` - Environment name.
18617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18618    pub fn without_config_env_opts(
18619        &self,
18620        name: impl Into<String>,
18621        opts: WorkspaceWithoutConfigEnvOpts,
18622    ) -> Workspace {
18623        let mut query = self.selection.select("withoutConfigEnv");
18624        query = query.arg("name", name.into());
18625        if let Some(here) = opts.here {
18626            query = query.arg("here", here);
18627        }
18628        Workspace {
18629            proc: self.proc.clone(),
18630            selection: query,
18631            graphql_client: self.graphql_client.clone(),
18632        }
18633    }
18634    /// Return this workspace with a configuration value removed.
18635    /// Errors when the key is not currently set.
18636    /// When the session selects an env, the key is scoped to that env's overlay.
18637    ///
18638    /// # Arguments
18639    ///
18640    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
18641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18642    pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
18643        let mut query = self.selection.select("withoutConfigValue");
18644        query = query.arg("key", key.into());
18645        Workspace {
18646            proc: self.proc.clone(),
18647            selection: query,
18648            graphql_client: self.graphql_client.clone(),
18649        }
18650    }
18651    /// Return this workspace with a configuration value removed.
18652    /// Errors when the key is not currently set.
18653    /// When the session selects an env, the key is scoped to that env's overlay.
18654    ///
18655    /// # Arguments
18656    ///
18657    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
18658    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18659    pub fn without_config_value_opts(
18660        &self,
18661        key: impl Into<String>,
18662        opts: WorkspaceWithoutConfigValueOpts,
18663    ) -> Workspace {
18664        let mut query = self.selection.select("withoutConfigValue");
18665        query = query.arg("key", key.into());
18666        if let Some(here) = opts.here {
18667            query = query.arg("here", here);
18668        }
18669        Workspace {
18670            proc: self.proc.clone(),
18671            selection: query,
18672            graphql_client: self.graphql_client.clone(),
18673        }
18674    }
18675    /// Return this workspace with a directory removed, without mutating the source.
18676    ///
18677    /// # Arguments
18678    ///
18679    /// * `path` - Path of the directory to remove. Relative paths resolve from the workspace cwd.
18680    pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
18681        let mut query = self.selection.select("withoutDirectory");
18682        query = query.arg("path", path.into());
18683        Workspace {
18684            proc: self.proc.clone(),
18685            selection: query,
18686            graphql_client: self.graphql_client.clone(),
18687        }
18688    }
18689    /// Return this workspace with no module selected as its entrypoint.
18690    pub fn without_entrypoint(&self) -> Workspace {
18691        let query = self.selection.select("withoutEntrypoint");
18692        Workspace {
18693            proc: self.proc.clone(),
18694            selection: query,
18695            graphql_client: self.graphql_client.clone(),
18696        }
18697    }
18698    /// Return this workspace with a file removed, without mutating the source.
18699    ///
18700    /// # Arguments
18701    ///
18702    /// * `path` - Path of the file to remove. Relative paths resolve from the workspace cwd.
18703    pub fn without_file(&self, path: impl Into<String>) -> Workspace {
18704        let mut query = self.selection.select("withoutFile");
18705        query = query.arg("path", path.into());
18706        Workspace {
18707            proc: self.proc.clone(),
18708            selection: query,
18709            graphql_client: self.graphql_client.clone(),
18710        }
18711    }
18712    /// Return this workspace with a module removed from its config.
18713    /// When the session selects an env, only that env's overlay entry is removed.
18714    ///
18715    /// # Arguments
18716    ///
18717    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
18718    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18719    pub fn without_module(&self, name: impl Into<String>) -> Workspace {
18720        let mut query = self.selection.select("withoutModule");
18721        query = query.arg("name", name.into());
18722        Workspace {
18723            proc: self.proc.clone(),
18724            selection: query,
18725            graphql_client: self.graphql_client.clone(),
18726        }
18727    }
18728    /// Return this workspace with a module removed from its config.
18729    /// When the session selects an env, only that env's overlay entry is removed.
18730    ///
18731    /// # Arguments
18732    ///
18733    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
18734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18735    pub fn without_module_opts(
18736        &self,
18737        name: impl Into<String>,
18738        opts: WorkspaceWithoutModuleOpts,
18739    ) -> Workspace {
18740        let mut query = self.selection.select("withoutModule");
18741        query = query.arg("name", name.into());
18742        if let Some(here) = opts.here {
18743            query = query.arg("here", here);
18744        }
18745        Workspace {
18746            proc: self.proc.clone(),
18747            selection: query,
18748            graphql_client: self.graphql_client.clone(),
18749        }
18750    }
18751    /// Return this workspace with the content mounted at the given path unmounted.
18752    /// Removes directory and file mounts at or below the path, revealing the underlying workspace content. Other mounts and pending changes are preserved.
18753    ///
18754    /// # Arguments
18755    ///
18756    /// * `path` - Location of the mount to remove. Relative paths resolve from the workspace cwd. Use / to remove all mounts.
18757    pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
18758        let mut query = self.selection.select("withoutMount");
18759        query = query.arg("path", path.into());
18760        Workspace {
18761            proc: self.proc.clone(),
18762            selection: query,
18763            graphql_client: self.graphql_client.clone(),
18764        }
18765    }
18766    /// Return this workspace with an SDK removed from its config.
18767    ///
18768    /// # Arguments
18769    ///
18770    /// * `name` - Name of the installed SDK entry to remove.
18771    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18772    pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
18773        let mut query = self.selection.select("withoutSDK");
18774        query = query.arg("name", name.into());
18775        Workspace {
18776            proc: self.proc.clone(),
18777            selection: query,
18778            graphql_client: self.graphql_client.clone(),
18779        }
18780    }
18781    /// Return this workspace with an SDK removed from its config.
18782    ///
18783    /// # Arguments
18784    ///
18785    /// * `name` - Name of the installed SDK entry to remove.
18786    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18787    pub fn without_sdk_opts(
18788        &self,
18789        name: impl Into<String>,
18790        opts: WorkspaceWithoutSdkOpts,
18791    ) -> Workspace {
18792        let mut query = self.selection.select("withoutSDK");
18793        query = query.arg("name", name.into());
18794        if let Some(here) = opts.here {
18795            query = query.arg("here", here);
18796        }
18797        Workspace {
18798            proc: self.proc.clone(),
18799            selection: query,
18800            graphql_client: self.graphql_client.clone(),
18801        }
18802    }
18803}
18804impl Node for Workspace {
18805    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18806        let query = self.selection.select("id");
18807        let graphql_client = self.graphql_client.clone();
18808        async move { query.execute(graphql_client).await }
18809    }
18810}
18811#[derive(Clone)]
18812pub struct WorkspaceCommitPick {
18813    pub proc: Option<Arc<DaggerSessionProc>>,
18814    pub selection: Selection,
18815    pub graphql_client: DynGraphQLClient,
18816}
18817impl IntoID<Id> for WorkspaceCommitPick {
18818    fn into_id(
18819        self,
18820    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18821        Box::pin(async move { self.id().await })
18822    }
18823}
18824impl Loadable for WorkspaceCommitPick {
18825    fn graphql_type() -> &'static str {
18826        "WorkspaceCommitPick"
18827    }
18828    fn from_query(
18829        proc: Option<Arc<DaggerSessionProc>>,
18830        selection: Selection,
18831        graphql_client: DynGraphQLClient,
18832    ) -> Self {
18833        Self {
18834            proc,
18835            selection,
18836            graphql_client,
18837        }
18838    }
18839}
18840impl WorkspaceCommitPick {
18841    /// The commit in the source workspace.
18842    pub fn commit(&self) -> GitCommit {
18843        let query = self.selection.select("commit");
18844        GitCommit {
18845            proc: self.proc.clone(),
18846            selection: query,
18847            graphql_client: self.graphql_client.clone(),
18848        }
18849    }
18850    /// Workspace-root-relative conflicting paths. Empty unless the status is CONFLICT.
18851    pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
18852        let query = self.selection.select("conflictPaths");
18853        query.execute(self.graphql_client.clone()).await
18854    }
18855    /// A unique identifier for this WorkspaceCommitPick.
18856    pub async fn id(&self) -> Result<Id, DaggerError> {
18857        let query = self.selection.select("id");
18858        query.execute(self.graphql_client.clone()).await
18859    }
18860    /// Why the commit conflicts, or NONE.
18861    pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
18862        let query = self.selection.select("reason");
18863        query.execute(self.graphql_client.clone()).await
18864    }
18865    /// Whether this commit can be applied.
18866    pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
18867        let query = self.selection.select("status");
18868        query.execute(self.graphql_client.clone()).await
18869    }
18870}
18871impl Node for WorkspaceCommitPick {
18872    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18873        let query = self.selection.select("id");
18874        let graphql_client = self.graphql_client.clone();
18875        async move { query.execute(graphql_client).await }
18876    }
18877}
18878#[derive(Clone)]
18879pub struct WorkspaceGit {
18880    pub proc: Option<Arc<DaggerSessionProc>>,
18881    pub selection: Selection,
18882    pub graphql_client: DynGraphQLClient,
18883}
18884impl IntoID<Id> for WorkspaceGit {
18885    fn into_id(
18886        self,
18887    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18888        Box::pin(async move { self.id().await })
18889    }
18890}
18891impl Loadable for WorkspaceGit {
18892    fn graphql_type() -> &'static str {
18893        "WorkspaceGit"
18894    }
18895    fn from_query(
18896        proc: Option<Arc<DaggerSessionProc>>,
18897        selection: Selection,
18898        graphql_client: DynGraphQLClient,
18899    ) -> Self {
18900        Self {
18901            proc,
18902            selection,
18903            graphql_client,
18904        }
18905    }
18906}
18907impl WorkspaceGit {
18908    /// Return a self-contained Git metadata directory for this workspace's HEAD, including its full reachable history and an index matching HEAD.
18909    /// Mount this directory at .git alongside workspace.directory("/") to create a usable checkout. Pending workspace edits remain uncommitted; the original checkout's staging state is not preserved.
18910    /// This is a snapshot: Git writes to a mounted copy do not update the workspace. The workspace must have a Git repository with a HEAD commit.
18911    pub fn directory(&self) -> Directory {
18912        let query = self.selection.select("directory");
18913        Directory {
18914            proc: self.proc.clone(),
18915            selection: query,
18916            graphql_client: self.graphql_client.clone(),
18917        }
18918    }
18919    /// The checked-out HEAD of this workspace.
18920    pub fn head(&self) -> GitRef {
18921        let query = self.selection.select("head");
18922        GitRef {
18923            proc: self.proc.clone(),
18924            selection: query,
18925            graphql_client: self.graphql_client.clone(),
18926        }
18927    }
18928    /// A unique identifier for this WorkspaceGit.
18929    pub async fn id(&self) -> Result<Id, DaggerError> {
18930        let query = self.selection.select("id");
18931        query.execute(self.graphql_client.clone()).await
18932    }
18933    /// Uncommitted changes in this workspace, using the same rules as GitRepository.uncommitted.
18934    pub fn uncommitted(&self) -> Changeset {
18935        let query = self.selection.select("uncommitted");
18936        Changeset {
18937            proc: self.proc.clone(),
18938            selection: query,
18939            graphql_client: self.graphql_client.clone(),
18940        }
18941    }
18942}
18943impl Node for WorkspaceGit {
18944    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18945        let query = self.selection.select("id");
18946        let graphql_client = self.graphql_client.clone();
18947        async move { query.execute(graphql_client).await }
18948    }
18949}
18950#[derive(Clone)]
18951pub struct WorkspaceMigration {
18952    pub proc: Option<Arc<DaggerSessionProc>>,
18953    pub selection: Selection,
18954    pub graphql_client: DynGraphQLClient,
18955}
18956impl IntoID<Id> for WorkspaceMigration {
18957    fn into_id(
18958        self,
18959    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18960        Box::pin(async move { self.id().await })
18961    }
18962}
18963impl Loadable for WorkspaceMigration {
18964    fn graphql_type() -> &'static str {
18965        "WorkspaceMigration"
18966    }
18967    fn from_query(
18968        proc: Option<Arc<DaggerSessionProc>>,
18969        selection: Selection,
18970        graphql_client: DynGraphQLClient,
18971    ) -> Self {
18972        Self {
18973            proc,
18974            selection,
18975            graphql_client,
18976        }
18977    }
18978}
18979impl WorkspaceMigration {
18980    /// Filesystem changes for the full migration plan.
18981    pub fn changes(&self) -> Changeset {
18982        let query = self.selection.select("changes");
18983        Changeset {
18984            proc: self.proc.clone(),
18985            selection: query,
18986            graphql_client: self.graphql_client.clone(),
18987        }
18988    }
18989    /// Native workspace config path after migration, relative to the workspace root. Empty if no workspace config exists.
18990    pub async fn config_file(&self) -> Result<String, DaggerError> {
18991        let query = self.selection.select("configFile");
18992        query.execute(self.graphql_client.clone()).await
18993    }
18994    /// A unique identifier for this WorkspaceMigration.
18995    pub async fn id(&self) -> Result<Id, DaggerError> {
18996        let query = self.selection.select("id");
18997        query.execute(self.graphql_client.clone()).await
18998    }
18999    /// Unselected legacy module directories relative to the workspace root. Candidates can include fixtures.
19000    pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
19001        let query = self.selection.select("moduleCandidates");
19002        query.execute(self.graphql_client.clone()).await
19003    }
19004    /// Logical migration steps, each identified by a stable code.
19005    pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
19006        let query = self.selection.select("steps");
19007        let query = query.select("id");
19008        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19009        Ok(ids
19010            .into_iter()
19011            .map(|id| WorkspaceMigrationStep {
19012                proc: self.proc.clone(),
19013                selection: crate::querybuilder::query()
19014                    .select("node")
19015                    .arg("id", &id.0)
19016                    .inline_fragment("WorkspaceMigrationStep"),
19017                graphql_client: self.graphql_client.clone(),
19018            })
19019            .collect())
19020    }
19021}
19022impl Node for WorkspaceMigration {
19023    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19024        let query = self.selection.select("id");
19025        let graphql_client = self.graphql_client.clone();
19026        async move { query.execute(graphql_client).await }
19027    }
19028}
19029#[derive(Clone)]
19030pub struct WorkspaceMigrationStep {
19031    pub proc: Option<Arc<DaggerSessionProc>>,
19032    pub selection: Selection,
19033    pub graphql_client: DynGraphQLClient,
19034}
19035impl IntoID<Id> for WorkspaceMigrationStep {
19036    fn into_id(
19037        self,
19038    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19039        Box::pin(async move { self.id().await })
19040    }
19041}
19042impl Loadable for WorkspaceMigrationStep {
19043    fn graphql_type() -> &'static str {
19044        "WorkspaceMigrationStep"
19045    }
19046    fn from_query(
19047        proc: Option<Arc<DaggerSessionProc>>,
19048        selection: Selection,
19049        graphql_client: DynGraphQLClient,
19050    ) -> Self {
19051        Self {
19052            proc,
19053            selection,
19054            graphql_client,
19055        }
19056    }
19057}
19058impl WorkspaceMigrationStep {
19059    /// Filesystem changes for this step.
19060    pub fn changes(&self) -> Changeset {
19061        let query = self.selection.select("changes");
19062        Changeset {
19063            proc: self.proc.clone(),
19064            selection: query,
19065            graphql_client: self.graphql_client.clone(),
19066        }
19067    }
19068    /// Stable code identifying this logical migration step.
19069    pub async fn code(&self) -> Result<String, DaggerError> {
19070        let query = self.selection.select("code");
19071        query.execute(self.graphql_client.clone()).await
19072    }
19073    /// Generic summary of this step's purpose and impact.
19074    pub async fn description(&self) -> Result<String, DaggerError> {
19075        let query = self.selection.select("description");
19076        query.execute(self.graphql_client.clone()).await
19077    }
19078    /// A unique identifier for this WorkspaceMigrationStep.
19079    pub async fn id(&self) -> Result<Id, DaggerError> {
19080        let query = self.selection.select("id");
19081        query.execute(self.graphql_client.clone()).await
19082    }
19083    /// Non-fatal warnings raised while planning this step.
19084    pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
19085        let query = self.selection.select("warnings");
19086        query.execute(self.graphql_client.clone()).await
19087    }
19088}
19089impl Node for WorkspaceMigrationStep {
19090    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19091        let query = self.selection.select("id");
19092        let graphql_client = self.graphql_client.clone();
19093        async move { query.execute(graphql_client).await }
19094    }
19095}
19096#[derive(Clone)]
19097pub struct WorkspaceModule {
19098    pub proc: Option<Arc<DaggerSessionProc>>,
19099    pub selection: Selection,
19100    pub graphql_client: DynGraphQLClient,
19101}
19102impl IntoID<Id> for WorkspaceModule {
19103    fn into_id(
19104        self,
19105    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19106        Box::pin(async move { self.id().await })
19107    }
19108}
19109impl Loadable for WorkspaceModule {
19110    fn graphql_type() -> &'static str {
19111        "WorkspaceModule"
19112    }
19113    fn from_query(
19114        proc: Option<Arc<DaggerSessionProc>>,
19115        selection: Selection,
19116        graphql_client: DynGraphQLClient,
19117    ) -> Self {
19118        Self {
19119            proc,
19120            selection,
19121            graphql_client,
19122        }
19123    }
19124}
19125impl WorkspaceModule {
19126    /// Whether the module is the workspace entrypoint (functions aliased to Query root).
19127    pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
19128        let query = self.selection.select("entrypoint");
19129        query.execute(self.graphql_client.clone()).await
19130    }
19131    /// List the functions of this module's main object, in GraphQL field form.
19132    pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
19133        let query = self.selection.select("functions");
19134        query.execute(self.graphql_client.clone()).await
19135    }
19136    /// A unique identifier for this WorkspaceModule.
19137    pub async fn id(&self) -> Result<Id, DaggerError> {
19138        let query = self.selection.select("id");
19139        query.execute(self.graphql_client.clone()).await
19140    }
19141    /// The module name.
19142    pub async fn name(&self) -> Result<String, DaggerError> {
19143        let query = self.selection.select("name");
19144        query.execute(self.graphql_client.clone()).await
19145    }
19146    /// List constructor-backed settings for this module.
19147    pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
19148        let query = self.selection.select("settings");
19149        let query = query.select("id");
19150        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19151        Ok(ids
19152            .into_iter()
19153            .map(|id| WorkspaceModuleSetting {
19154                proc: self.proc.clone(),
19155                selection: crate::querybuilder::query()
19156                    .select("node")
19157                    .arg("id", &id.0)
19158                    .inline_fragment("WorkspaceModuleSetting"),
19159                graphql_client: self.graphql_client.clone(),
19160            })
19161            .collect())
19162    }
19163    /// The module source path.
19164    pub async fn source(&self) -> Result<String, DaggerError> {
19165        let query = self.selection.select("source");
19166        query.execute(self.graphql_client.clone()).await
19167    }
19168}
19169impl Node for WorkspaceModule {
19170    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19171        let query = self.selection.select("id");
19172        let graphql_client = self.graphql_client.clone();
19173        async move { query.execute(graphql_client).await }
19174    }
19175}
19176#[derive(Clone)]
19177pub struct WorkspaceModuleSetting {
19178    pub proc: Option<Arc<DaggerSessionProc>>,
19179    pub selection: Selection,
19180    pub graphql_client: DynGraphQLClient,
19181}
19182impl IntoID<Id> for WorkspaceModuleSetting {
19183    fn into_id(
19184        self,
19185    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19186        Box::pin(async move { self.id().await })
19187    }
19188}
19189impl Loadable for WorkspaceModuleSetting {
19190    fn graphql_type() -> &'static str {
19191        "WorkspaceModuleSetting"
19192    }
19193    fn from_query(
19194        proc: Option<Arc<DaggerSessionProc>>,
19195        selection: Selection,
19196        graphql_client: DynGraphQLClient,
19197    ) -> Self {
19198        Self {
19199            proc,
19200            selection,
19201            graphql_client,
19202        }
19203    }
19204}
19205impl WorkspaceModuleSetting {
19206    /// The constructor argument's declared default, formatted like value, or empty when the argument has no default.
19207    pub async fn default_value(&self) -> Result<String, DaggerError> {
19208        let query = self.selection.select("defaultValue");
19209        query.execute(self.graphql_client.clone()).await
19210    }
19211    /// The constructor argument description.
19212    pub async fn description(&self) -> Result<String, DaggerError> {
19213        let query = self.selection.select("description");
19214        query.execute(self.graphql_client.clone()).await
19215    }
19216    /// A unique identifier for this WorkspaceModuleSetting.
19217    pub async fn id(&self) -> Result<Id, DaggerError> {
19218        let query = self.selection.select("id");
19219        query.execute(self.graphql_client.clone()).await
19220    }
19221    /// Whether the setting accepts a list of values.
19222    pub async fn is_list(&self) -> Result<bool, DaggerError> {
19223        let query = self.selection.select("isList");
19224        query.execute(self.graphql_client.clone()).await
19225    }
19226    /// Whether the setting is an object type resolved from an address string (Container, Directory, File, Secret, Service, ...), which may be a module reference.
19227    pub async fn is_object(&self) -> Result<bool, DaggerError> {
19228        let query = self.selection.select("isObject");
19229        query.execute(self.graphql_client.clone()).await
19230    }
19231    /// Whether the setting is a string argument, stored as a TOML string even when the value reads as a number or boolean.
19232    pub async fn is_string(&self) -> Result<bool, DaggerError> {
19233        let query = self.selection.select("isString");
19234        query.execute(self.graphql_client.clone()).await
19235    }
19236    /// The setting key.
19237    pub async fn key(&self) -> Result<String, DaggerError> {
19238        let query = self.selection.select("key");
19239        query.execute(self.graphql_client.clone()).await
19240    }
19241    /// The value stored in workspace config after applying the selected workspace environment, or empty when unset.
19242    pub async fn value(&self) -> Result<String, DaggerError> {
19243        let query = self.selection.select("value");
19244        query.execute(self.graphql_client.clone()).await
19245    }
19246}
19247impl Node for WorkspaceModuleSetting {
19248    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19249        let query = self.selection.select("id");
19250        let graphql_client = self.graphql_client.clone();
19251        async move { query.execute(graphql_client).await }
19252    }
19253}
19254#[derive(Clone)]
19255pub struct WorkspaceSdk {
19256    pub proc: Option<Arc<DaggerSessionProc>>,
19257    pub selection: Selection,
19258    pub graphql_client: DynGraphQLClient,
19259}
19260impl IntoID<Id> for WorkspaceSdk {
19261    fn into_id(
19262        self,
19263    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19264        Box::pin(async move { self.id().await })
19265    }
19266}
19267impl Loadable for WorkspaceSdk {
19268    fn graphql_type() -> &'static str {
19269        "WorkspaceSDK"
19270    }
19271    fn from_query(
19272        proc: Option<Arc<DaggerSessionProc>>,
19273        selection: Selection,
19274        graphql_client: DynGraphQLClient,
19275    ) -> Self {
19276        Self {
19277            proc,
19278            selection,
19279            graphql_client,
19280        }
19281    }
19282}
19283impl WorkspaceSdk {
19284    /// Clients generated with this SDK.
19285    pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
19286        let query = self.selection.select("clients");
19287        let query = query.select("id");
19288        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19289        Ok(ids
19290            .into_iter()
19291            .map(|id| WorkspaceModule {
19292                proc: self.proc.clone(),
19293                selection: crate::querybuilder::query()
19294                    .select("node")
19295                    .arg("id", &id.0)
19296                    .inline_fragment("WorkspaceModule"),
19297                graphql_client: self.graphql_client.clone(),
19298            })
19299            .collect())
19300    }
19301    /// A unique identifier for this WorkspaceSDK.
19302    pub async fn id(&self) -> Result<Id, DaggerError> {
19303        let query = self.selection.select("id");
19304        query.execute(self.graphql_client.clone()).await
19305    }
19306    /// Modules authored with this SDK.
19307    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
19308        let query = self.selection.select("modules");
19309        let query = query.select("id");
19310        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19311        Ok(ids
19312            .into_iter()
19313            .map(|id| WorkspaceModule {
19314                proc: self.proc.clone(),
19315                selection: crate::querybuilder::query()
19316                    .select("node")
19317                    .arg("id", &id.0)
19318                    .inline_fragment("WorkspaceModule"),
19319                graphql_client: self.graphql_client.clone(),
19320            })
19321            .collect())
19322    }
19323    /// The user-facing SDK name.
19324    pub async fn name(&self) -> Result<String, DaggerError> {
19325        let query = self.selection.select("name");
19326        query.execute(self.graphql_client.clone()).await
19327    }
19328    /// The module reference this SDK was installed from.
19329    pub async fn r#ref(&self) -> Result<String, DaggerError> {
19330        let query = self.selection.select("ref");
19331        query.execute(self.graphql_client.clone()).await
19332    }
19333}
19334impl Node for WorkspaceSdk {
19335    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19336        let query = self.selection.select("id");
19337        let graphql_client = self.graphql_client.clone();
19338        async move { query.execute(graphql_client).await }
19339    }
19340}
19341#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19342pub enum AgentMessageDelivery {
19343    #[serde(rename = "QUEUED")]
19344    Queued,
19345    #[serde(rename = "STARTED")]
19346    Started,
19347    #[serde(rename = "STEERED")]
19348    Steered,
19349}
19350#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19351pub enum AgentState {
19352    #[serde(rename = "FAILED")]
19353    Failed,
19354    #[serde(rename = "IDLE")]
19355    Idle,
19356    #[serde(rename = "PAUSED")]
19357    Paused,
19358    #[serde(rename = "RUNNING")]
19359    Running,
19360    #[serde(rename = "STOPPED")]
19361    Stopped,
19362    #[serde(rename = "WAITING_INPUT")]
19363    WaitingInput,
19364}
19365#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19366pub enum CacheSharingMode {
19367    #[serde(rename = "LOCKED")]
19368    Locked,
19369    #[serde(rename = "PRIVATE")]
19370    Private,
19371    #[serde(rename = "SHARED")]
19372    Shared,
19373}
19374#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19375pub enum ChangesetMergeConflict {
19376    #[serde(rename = "FAIL")]
19377    Fail,
19378    #[serde(rename = "FAIL_EARLY")]
19379    FailEarly,
19380    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
19381    LeaveConflictMarkers,
19382    #[serde(rename = "PREFER_OURS")]
19383    PreferOurs,
19384    #[serde(rename = "PREFER_THEIRS")]
19385    PreferTheirs,
19386}
19387#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19388pub enum ChangesetsMergeConflict {
19389    #[serde(rename = "FAIL")]
19390    Fail,
19391    #[serde(rename = "FAIL_EARLY")]
19392    FailEarly,
19393}
19394#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19395pub enum DiffStatKind {
19396    #[serde(rename = "ADDED")]
19397    Added,
19398    #[serde(rename = "MODIFIED")]
19399    Modified,
19400    #[serde(rename = "REMOVED")]
19401    Removed,
19402    #[serde(rename = "RENAMED")]
19403    Renamed,
19404}
19405#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19406pub enum ExistsType {
19407    #[serde(rename = "DIRECTORY_TYPE")]
19408    DirectoryType,
19409    #[serde(rename = "REGULAR_TYPE")]
19410    RegularType,
19411    #[serde(rename = "SYMLINK_TYPE")]
19412    SymlinkType,
19413}
19414#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19415pub enum FileType {
19416    #[serde(rename = "DIRECTORY")]
19417    Directory,
19418    #[serde(rename = "DIRECTORY_TYPE")]
19419    DirectoryType,
19420    #[serde(rename = "REGULAR")]
19421    Regular,
19422    #[serde(rename = "REGULAR_TYPE")]
19423    RegularType,
19424    #[serde(rename = "SYMLINK")]
19425    Symlink,
19426    #[serde(rename = "SYMLINK_TYPE")]
19427    SymlinkType,
19428    #[serde(rename = "UNKNOWN")]
19429    Unknown,
19430}
19431#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19432pub enum FunctionCachePolicy {
19433    #[serde(rename = "Default")]
19434    Default,
19435    #[serde(rename = "Never")]
19436    Never,
19437    #[serde(rename = "PerSession")]
19438    PerSession,
19439}
19440#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19441pub enum GitPushDisposition {
19442    #[serde(rename = "CREATED")]
19443    Created,
19444    #[serde(rename = "FAST_FORWARD")]
19445    FastForward,
19446    #[serde(rename = "FORCED")]
19447    Forced,
19448    #[serde(rename = "UP_TO_DATE")]
19449    UpToDate,
19450}
19451#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19452pub enum ImageLayerCompression {
19453    #[serde(rename = "EStarGZ")]
19454    EStarGz,
19455    #[serde(rename = "ESTARGZ")]
19456    Estargz,
19457    #[serde(rename = "Gzip")]
19458    Gzip,
19459    #[serde(rename = "Uncompressed")]
19460    Uncompressed,
19461    #[serde(rename = "Zstd")]
19462    Zstd,
19463}
19464#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19465pub enum ImageMediaTypes {
19466    #[serde(rename = "DOCKER")]
19467    Docker,
19468    #[serde(rename = "DockerMediaTypes")]
19469    DockerMediaTypes,
19470    #[serde(rename = "OCI")]
19471    Oci,
19472    #[serde(rename = "OCIMediaTypes")]
19473    OciMediaTypes,
19474}
19475#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19476pub enum LlmContentBlockKind {
19477    #[serde(rename = "TEXT")]
19478    Text,
19479    #[serde(rename = "THINKING")]
19480    Thinking,
19481    #[serde(rename = "TOOL_CALL")]
19482    ToolCall,
19483    #[serde(rename = "TOOL_RESULT")]
19484    ToolResult,
19485}
19486#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19487pub enum LlmMessageOriginKind {
19488    #[serde(rename = "AGENT")]
19489    Agent,
19490    #[serde(rename = "EVENT")]
19491    Event,
19492    #[serde(rename = "USER")]
19493    User,
19494}
19495#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19496pub enum LlmMessageRole {
19497    #[serde(rename = "ASSISTANT")]
19498    Assistant,
19499    #[serde(rename = "SYSTEM")]
19500    System,
19501    #[serde(rename = "USER")]
19502    User,
19503}
19504#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19505pub enum ModuleSourceExperimentalFeature {
19506    #[serde(rename = "SELF_CALLS")]
19507    SelfCalls,
19508}
19509#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19510pub enum ModuleSourceKind {
19511    #[serde(rename = "DIR")]
19512    Dir,
19513    #[serde(rename = "DIR_SOURCE")]
19514    DirSource,
19515    #[serde(rename = "GIT")]
19516    Git,
19517    #[serde(rename = "GIT_SOURCE")]
19518    GitSource,
19519    #[serde(rename = "LOCAL")]
19520    Local,
19521    #[serde(rename = "LOCAL_SOURCE")]
19522    LocalSource,
19523}
19524#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19525pub enum NetworkProtocol {
19526    #[serde(rename = "TCP")]
19527    Tcp,
19528    #[serde(rename = "UDP")]
19529    Udp,
19530}
19531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19532pub enum PatchConflict {
19533    #[serde(rename = "FAIL")]
19534    Fail,
19535    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
19536    LeaveConflictMarkers,
19537}
19538#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19539pub enum RegistryProtocol {
19540    #[serde(rename = "HTTP")]
19541    Http,
19542    #[serde(rename = "HTTPS")]
19543    Https,
19544}
19545#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19546pub enum ReturnType {
19547    #[serde(rename = "ANY")]
19548    Any,
19549    #[serde(rename = "FAILURE")]
19550    Failure,
19551    #[serde(rename = "SUCCESS")]
19552    Success,
19553}
19554#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19555pub enum TypeDefKind {
19556    #[serde(rename = "BOOLEAN")]
19557    Boolean,
19558    #[serde(rename = "BOOLEAN_KIND")]
19559    BooleanKind,
19560    #[serde(rename = "ENUM")]
19561    Enum,
19562    #[serde(rename = "ENUM_KIND")]
19563    EnumKind,
19564    #[serde(rename = "FLOAT")]
19565    Float,
19566    #[serde(rename = "FLOAT_KIND")]
19567    FloatKind,
19568    #[serde(rename = "INPUT")]
19569    Input,
19570    #[serde(rename = "INPUT_KIND")]
19571    InputKind,
19572    #[serde(rename = "INTEGER")]
19573    Integer,
19574    #[serde(rename = "INTEGER_KIND")]
19575    IntegerKind,
19576    #[serde(rename = "INTERFACE")]
19577    Interface,
19578    #[serde(rename = "INTERFACE_KIND")]
19579    InterfaceKind,
19580    #[serde(rename = "LIST")]
19581    List,
19582    #[serde(rename = "LIST_KIND")]
19583    ListKind,
19584    #[serde(rename = "OBJECT")]
19585    Object,
19586    #[serde(rename = "OBJECT_KIND")]
19587    ObjectKind,
19588    #[serde(rename = "SCALAR")]
19589    Scalar,
19590    #[serde(rename = "SCALAR_KIND")]
19591    ScalarKind,
19592    #[serde(rename = "STRING")]
19593    String,
19594    #[serde(rename = "STRING_KIND")]
19595    StringKind,
19596    #[serde(rename = "VOID")]
19597    Void,
19598    #[serde(rename = "VOID_KIND")]
19599    VoidKind,
19600}
19601#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19602pub enum WorkspaceCommitPickReason {
19603    #[serde(rename = "CONTENT")]
19604    Content,
19605    #[serde(rename = "DIRTY")]
19606    Dirty,
19607    #[serde(rename = "NONE")]
19608    None,
19609}
19610#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19611pub enum WorkspaceCommitPickStatus {
19612    #[serde(rename = "CONFLICT")]
19613    Conflict,
19614    #[serde(rename = "PICKABLE")]
19615    Pickable,
19616    #[serde(rename = "PICKED")]
19617    Picked,
19618    #[serde(rename = "REDUNDANT")]
19619    Redundant,
19620}