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 content: Vec<LlmContentBlockInput>,
115    pub data: Bytes,
116    pub errored: bool,
117    pub file: Id,
118    pub kind: LlmContentBlockKind,
119    pub mime_type: String,
120    pub signature: String,
121    pub text: String,
122    pub tool_name: String,
123}
124#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
125pub struct LlmMessageOriginInput {
126    pub agent_name: String,
127    pub kind: LlmMessageOriginKind,
128    pub r#ref: String,
129    pub reply_to: String,
130}
131#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
132pub struct PipelineLabel {
133    pub name: String,
134    pub value: String,
135}
136#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
137pub struct PortForward {
138    pub backend: isize,
139    pub frontend: isize,
140    pub protocol: NetworkProtocol,
141}
142/// An object that can be exported to the host.
143/// Calling export writes the object to a path on the host filesystem and returns the path that was written.
144pub trait Exportable {
145    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
146    fn export(
147        &self,
148        path: impl Into<String>,
149    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
150}
151#[derive(Clone)]
152pub struct ExportableClient {
153    pub proc: Option<Arc<DaggerSessionProc>>,
154    pub selection: Selection,
155    pub graphql_client: DynGraphQLClient,
156}
157impl IntoID<Id> for ExportableClient {
158    fn into_id(
159        self,
160    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
161        Box::pin(async move { self.id().await })
162    }
163}
164impl ExportableClient {
165    pub async fn id(&self) -> Result<Id, DaggerError> {
166        let query = self.selection.select("id");
167        query.execute(self.graphql_client.clone()).await
168    }
169    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
170        let mut query = self.selection.select("export");
171        query = query.arg("path", path.into());
172        query.execute(self.graphql_client.clone()).await
173    }
174}
175impl Loadable for ExportableClient {
176    fn graphql_type() -> &'static str {
177        "Exportable"
178    }
179    fn from_query(
180        proc: Option<Arc<DaggerSessionProc>>,
181        selection: Selection,
182        graphql_client: DynGraphQLClient,
183    ) -> Self {
184        Self {
185            proc,
186            selection,
187            graphql_client,
188        }
189    }
190}
191impl Exportable for ExportableClient {
192    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
193        let query = self.selection.select("id");
194        let graphql_client = self.graphql_client.clone();
195        async move { query.execute(graphql_client).await }
196    }
197    fn export(
198        &self,
199        path: impl Into<String>,
200    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
201        let mut query = self.selection.select("export");
202        query = query.arg("path", path.into());
203        let graphql_client = self.graphql_client.clone();
204        async move { query.execute(graphql_client).await }
205    }
206}
207/// An object with a globally unique ID.
208pub trait Node {
209    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
210}
211#[derive(Clone)]
212pub struct NodeClient {
213    pub proc: Option<Arc<DaggerSessionProc>>,
214    pub selection: Selection,
215    pub graphql_client: DynGraphQLClient,
216}
217impl IntoID<Id> for NodeClient {
218    fn into_id(
219        self,
220    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
221        Box::pin(async move { self.id().await })
222    }
223}
224impl NodeClient {
225    pub async fn id(&self) -> Result<Id, DaggerError> {
226        let query = self.selection.select("id");
227        query.execute(self.graphql_client.clone()).await
228    }
229}
230impl Loadable for NodeClient {
231    fn graphql_type() -> &'static str {
232        "Node"
233    }
234    fn from_query(
235        proc: Option<Arc<DaggerSessionProc>>,
236        selection: Selection,
237        graphql_client: DynGraphQLClient,
238    ) -> Self {
239        Self {
240            proc,
241            selection,
242            graphql_client,
243        }
244    }
245}
246impl Node for NodeClient {
247    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
248        let query = self.selection.select("id");
249        let graphql_client = self.graphql_client.clone();
250        async move { query.execute(graphql_client).await }
251    }
252}
253/// An object that can be force-evaluated.
254/// Calling sync ensures that the object's entire dependency DAG has been evaluated, returning the object's ID once complete.
255pub trait Syncer {
256    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
257    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send
258    where
259        Self: Sized;
260}
261#[derive(Clone)]
262pub struct SyncerClient {
263    pub proc: Option<Arc<DaggerSessionProc>>,
264    pub selection: Selection,
265    pub graphql_client: DynGraphQLClient,
266}
267impl IntoID<Id> for SyncerClient {
268    fn into_id(
269        self,
270    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
271        Box::pin(async move { self.id().await })
272    }
273}
274impl SyncerClient {
275    pub async fn id(&self) -> Result<Id, DaggerError> {
276        let query = self.selection.select("id");
277        query.execute(self.graphql_client.clone()).await
278    }
279    pub async fn sync(&self) -> Result<SyncerClient, DaggerError> {
280        let query = self.selection.select("sync");
281        let id: Id = query.execute(self.graphql_client.clone()).await?;
282        Ok(SyncerClient {
283            proc: self.proc.clone(),
284            selection: query
285                .root()
286                .select("node")
287                .arg("id", &id.0)
288                .inline_fragment("Syncer"),
289            graphql_client: self.graphql_client.clone(),
290        })
291    }
292}
293impl Loadable for SyncerClient {
294    fn graphql_type() -> &'static str {
295        "Syncer"
296    }
297    fn from_query(
298        proc: Option<Arc<DaggerSessionProc>>,
299        selection: Selection,
300        graphql_client: DynGraphQLClient,
301    ) -> Self {
302        Self {
303            proc,
304            selection,
305            graphql_client,
306        }
307    }
308}
309impl Syncer for SyncerClient {
310    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
311        let query = self.selection.select("id");
312        let graphql_client = self.graphql_client.clone();
313        async move { query.execute(graphql_client).await }
314    }
315    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
316        let query = self.selection.select("sync");
317        let proc = self.proc.clone();
318        let graphql_client = self.graphql_client.clone();
319        async move {
320            let id: Id = query.execute(graphql_client.clone()).await?;
321            Ok(Self {
322                proc,
323                selection: query
324                    .root()
325                    .select("node")
326                    .arg("id", &id.0)
327                    .inline_fragment("Syncer"),
328                graphql_client,
329            })
330        }
331    }
332}
333#[derive(Clone)]
334pub struct Address {
335    pub proc: Option<Arc<DaggerSessionProc>>,
336    pub selection: Selection,
337    pub graphql_client: DynGraphQLClient,
338}
339#[derive(Builder, Debug, PartialEq)]
340pub struct AddressContainerOpts {
341    /// Resolve the address's image tag live, ignoring the workspace lockfile: neither read a pinned value nor record one.
342    /// A DAG address is unaffected: its module evaluates as usual.
343    #[builder(setter(into, strip_option), default)]
344    pub no_lock: Option<bool>,
345}
346#[derive(Builder, Debug, PartialEq)]
347pub struct AddressDirectoryOpts<'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    /// Resolve the address's git ref live, ignoring the workspace lockfile: neither read a pinned value nor record one.
357    /// A DAG address is unaffected: its module evaluates as usual.
358    #[builder(setter(into, strip_option), default)]
359    pub no_lock: Option<bool>,
360}
361#[derive(Builder, Debug, PartialEq)]
362pub struct AddressFileOpts<'a> {
363    #[builder(setter(into, strip_option), default)]
364    pub exclude: Option<Vec<&'a str>>,
365    #[builder(setter(into, strip_option), default)]
366    pub gitignore: Option<bool>,
367    #[builder(setter(into, strip_option), default)]
368    pub include: Option<Vec<&'a str>>,
369    #[builder(setter(into, strip_option), default)]
370    pub no_cache: Option<bool>,
371    /// Resolve the address's git ref live, ignoring the workspace lockfile: neither read a pinned value nor record one.
372    /// A DAG address is unaffected: its module evaluates as usual.
373    #[builder(setter(into, strip_option), default)]
374    pub no_lock: Option<bool>,
375}
376#[derive(Builder, Debug, PartialEq)]
377pub struct AddressGitRefOpts {
378    /// Resolve the address's git ref live, ignoring the workspace lockfile: neither read a pinned value nor record one.
379    /// A DAG address is unaffected: its module evaluates as usual.
380    #[builder(setter(into, strip_option), default)]
381    pub no_lock: Option<bool>,
382}
383impl IntoID<Id> for Address {
384    fn into_id(
385        self,
386    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
387        Box::pin(async move { self.id().await })
388    }
389}
390impl Loadable for Address {
391    fn graphql_type() -> &'static str {
392        "Address"
393    }
394    fn from_query(
395        proc: Option<Arc<DaggerSessionProc>>,
396        selection: Selection,
397        graphql_client: DynGraphQLClient,
398    ) -> Self {
399        Self {
400            proc,
401            selection,
402            graphql_client,
403        }
404    }
405}
406impl Address {
407    /// A unique identifier for this Address.
408    pub async fn id(&self) -> Result<Id, DaggerError> {
409        let query = self.selection.select("id");
410        query.execute(self.graphql_client.clone()).await
411    }
412    /// The address value
413    pub async fn value(&self) -> Result<String, DaggerError> {
414        let query = self.selection.select("value");
415        query.execute(self.graphql_client.clone()).await
416    }
417    /// Load a container from the address.
418    ///
419    /// # Arguments
420    ///
421    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
422    pub fn container(&self) -> Container {
423        let query = self.selection.select("container");
424        Container {
425            proc: self.proc.clone(),
426            selection: query,
427            graphql_client: self.graphql_client.clone(),
428        }
429    }
430    /// Load a container from the address.
431    ///
432    /// # Arguments
433    ///
434    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
435    pub fn container_opts(&self, opts: AddressContainerOpts) -> Container {
436        let mut query = self.selection.select("container");
437        if let Some(no_lock) = opts.no_lock {
438            query = query.arg("noLock", no_lock);
439        }
440        Container {
441            proc: self.proc.clone(),
442            selection: query,
443            graphql_client: self.graphql_client.clone(),
444        }
445    }
446    /// Load a directory from the address.
447    ///
448    /// # Arguments
449    ///
450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
451    pub fn directory(&self) -> Directory {
452        let query = self.selection.select("directory");
453        Directory {
454            proc: self.proc.clone(),
455            selection: query,
456            graphql_client: self.graphql_client.clone(),
457        }
458    }
459    /// Load a directory from the address.
460    ///
461    /// # Arguments
462    ///
463    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
464    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
465        let mut query = self.selection.select("directory");
466        if let Some(exclude) = opts.exclude {
467            query = query.arg("exclude", exclude);
468        }
469        if let Some(include) = opts.include {
470            query = query.arg("include", include);
471        }
472        if let Some(gitignore) = opts.gitignore {
473            query = query.arg("gitignore", gitignore);
474        }
475        if let Some(no_cache) = opts.no_cache {
476            query = query.arg("noCache", no_cache);
477        }
478        if let Some(no_lock) = opts.no_lock {
479            query = query.arg("noLock", no_lock);
480        }
481        Directory {
482            proc: self.proc.clone(),
483            selection: query,
484            graphql_client: self.graphql_client.clone(),
485        }
486    }
487    /// Load a file from the address.
488    ///
489    /// # Arguments
490    ///
491    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
492    pub fn file(&self) -> File {
493        let query = self.selection.select("file");
494        File {
495            proc: self.proc.clone(),
496            selection: query,
497            graphql_client: self.graphql_client.clone(),
498        }
499    }
500    /// Load a file from the address.
501    ///
502    /// # Arguments
503    ///
504    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
505    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
506        let mut query = self.selection.select("file");
507        if let Some(exclude) = opts.exclude {
508            query = query.arg("exclude", exclude);
509        }
510        if let Some(include) = opts.include {
511            query = query.arg("include", include);
512        }
513        if let Some(gitignore) = opts.gitignore {
514            query = query.arg("gitignore", gitignore);
515        }
516        if let Some(no_cache) = opts.no_cache {
517            query = query.arg("noCache", no_cache);
518        }
519        if let Some(no_lock) = opts.no_lock {
520            query = query.arg("noLock", no_lock);
521        }
522        File {
523            proc: self.proc.clone(),
524            selection: query,
525            graphql_client: self.graphql_client.clone(),
526        }
527    }
528    /// Load a git ref (branch, tag or commit) from the address.
529    ///
530    /// # Arguments
531    ///
532    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
533    pub fn git_ref(&self) -> GitRef {
534        let query = self.selection.select("gitRef");
535        GitRef {
536            proc: self.proc.clone(),
537            selection: query,
538            graphql_client: self.graphql_client.clone(),
539        }
540    }
541    /// Load a git ref (branch, tag or commit) from the address.
542    ///
543    /// # Arguments
544    ///
545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
546    pub fn git_ref_opts(&self, opts: AddressGitRefOpts) -> GitRef {
547        let mut query = self.selection.select("gitRef");
548        if let Some(no_lock) = opts.no_lock {
549            query = query.arg("noLock", no_lock);
550        }
551        GitRef {
552            proc: self.proc.clone(),
553            selection: query,
554            graphql_client: self.graphql_client.clone(),
555        }
556    }
557    /// Load a git repository from the address.
558    pub fn git_repository(&self) -> GitRepository {
559        let query = self.selection.select("gitRepository");
560        GitRepository {
561            proc: self.proc.clone(),
562            selection: query,
563            graphql_client: self.graphql_client.clone(),
564        }
565    }
566    /// Load a secret from the address.
567    pub fn secret(&self) -> Secret {
568        let query = self.selection.select("secret");
569        Secret {
570            proc: self.proc.clone(),
571            selection: query,
572            graphql_client: self.graphql_client.clone(),
573        }
574    }
575    /// Load a service from the address.
576    pub fn service(&self) -> Service {
577        let query = self.selection.select("service");
578        Service {
579            proc: self.proc.clone(),
580            selection: query,
581            graphql_client: self.graphql_client.clone(),
582        }
583    }
584    /// Load a local socket from the address.
585    pub fn socket(&self) -> Socket {
586        let query = self.selection.select("socket");
587        Socket {
588            proc: self.proc.clone(),
589            selection: query,
590            graphql_client: self.graphql_client.clone(),
591        }
592    }
593    /// Load a volume from the address.
594    pub fn volume(&self) -> Volume {
595        let query = self.selection.select("volume");
596        Volume {
597            proc: self.proc.clone(),
598            selection: query,
599            graphql_client: self.graphql_client.clone(),
600        }
601    }
602    /// Load a workspace from a module reference.
603    pub fn workspace(&self) -> Workspace {
604        let query = self.selection.select("workspace");
605        Workspace {
606            proc: self.proc.clone(),
607            selection: query,
608            graphql_client: self.graphql_client.clone(),
609        }
610    }
611}
612impl Node for Address {
613    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
614        let query = self.selection.select("id");
615        let graphql_client = self.graphql_client.clone();
616        async move { query.execute(graphql_client).await }
617    }
618}
619#[derive(Clone)]
620pub struct Agent {
621    pub proc: Option<Arc<DaggerSessionProc>>,
622    pub selection: Selection,
623    pub graphql_client: DynGraphQLClient,
624}
625#[derive(Builder, Debug, PartialEq)]
626pub struct AgentSendOpts<'a> {
627    /// Ordered TEXT, IMAGE, AUDIO, or DOCUMENT user content blocks. File inputs are resolved and all content is validated before enqueueing. Pass an empty message for media-only sends.
628    #[builder(setter(into, strip_option), default)]
629    pub content: Option<Vec<LlmContentBlockInput>>,
630    /// 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.
631    #[builder(setter(into, strip_option), default)]
632    pub reply_to: Option<&'a str>,
633}
634#[derive(Builder, Debug, PartialEq)]
635pub struct AgentPauseOpts {
636    /// 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.
637    #[builder(setter(into, strip_option), default)]
638    pub interrupt: Option<bool>,
639}
640#[derive(Builder, Debug, PartialEq)]
641pub struct AgentNotifyOpts {
642    /// The lifecycle states that fire an event. IDLE events carry the turn's final reply; FAILED events carry the loop error.
643    #[builder(setter(into, strip_option), default)]
644    pub on: Option<Vec<AgentState>>,
645}
646#[derive(Builder, Debug, PartialEq)]
647pub struct AgentStopOpts {
648    /// Cancel the loop immediately instead of letting an in-flight step finish. Either way the completed steps are preserved in the snapshot.
649    #[builder(setter(into, strip_option), default)]
650    pub kill: Option<bool>,
651}
652impl IntoID<Id> for Agent {
653    fn into_id(
654        self,
655    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
656        Box::pin(async move { self.id().await })
657    }
658}
659impl Loadable for Agent {
660    fn graphql_type() -> &'static str {
661        "Agent"
662    }
663    fn from_query(
664        proc: Option<Arc<DaggerSessionProc>>,
665        selection: Selection,
666        graphql_client: DynGraphQLClient,
667    ) -> Self {
668        Self {
669            proc,
670            selection,
671            graphql_client,
672        }
673    }
674}
675impl Agent {
676    /// A unique identifier for this Agent.
677    pub async fn id(&self) -> Result<Id, DaggerError> {
678        let query = self.selection.select("id");
679        query.execute(self.graphql_client.clone()).await
680    }
681    /// Display label for the agent; carries no identity.
682    pub async fn name(&self) -> Result<String, DaggerError> {
683        let query = self.selection.select("name");
684        query.execute(self.graphql_client.clone()).await
685    }
686    /// The opaque runtime handle minted by the spawn that created this agent.
687    /// 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.
688    pub async fn handle(&self) -> Result<String, DaggerError> {
689        let query = self.selection.select("handle");
690        query.execute(self.graphql_client.clone()).await
691    }
692    /// Computed lifecycle state; never stored.
693    /// An agent that was never started reports IDLE: its mailbox is empty and no turn is open.
694    pub async fn state(&self) -> Result<AgentState, DaggerError> {
695        let query = self.selection.select("state");
696        query.execute(self.graphql_client.clone()).await
697    }
698    /// Why the loop failed, for a FAILED agent; empty otherwise.
699    /// The snapshot holds the completed prefix — send or resume retries from it.
700    pub async fn error(&self) -> Result<String, DaggerError> {
701        let query = self.selection.select("error");
702        query.execute(self.graphql_client.clone()).await
703    }
704    /// The conversation the agent was spawned from: the tools, workspace and message history its loop started with.
705    /// Fixed by the spawn; stepping does not move it (see snapshot for the latest committed step). Its workspace is the baseline the agent's own changes are measured from.
706    /// For an agent restored under a handle, this is the conversation it was restored from.
707    pub fn seed(&self) -> Llm {
708        let query = self.selection.select("seed");
709        Llm {
710            proc: self.proc.clone(),
711            selection: query,
712            graphql_client: self.graphql_client.clone(),
713        }
714    }
715    /// The conversation as of the last committed step: immutable, branchable, persistable.
716    /// The seed conversation if the agent never stepped.
717    /// Branching from it does not affect the agent.
718    pub fn snapshot(&self) -> Llm {
719        let query = self.selection.select("snapshot");
720        Llm {
721            proc: self.proc.clone(),
722            selection: query,
723            graphql_client: self.graphql_client.clone(),
724        }
725    }
726    /// 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.
727    /// Never blocks, never drops; concurrent sends queue in order.
728    /// 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.
729    /// 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.
730    ///
731    /// # Arguments
732    ///
733    /// * `message` - The message text, appended to the agent's history as a prompt when a turn consumes it. When content is supplied, nonempty text precedes those blocks in the same user message.
734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
735    pub async fn send(&self, message: impl Into<String>) -> Result<AgentMessage, DaggerError> {
736        let mut query = self.selection.select("send");
737        query = query.arg("message", message.into());
738        let id: Id = query.execute(self.graphql_client.clone()).await?;
739        Ok(AgentMessage {
740            proc: self.proc.clone(),
741            selection: query
742                .root()
743                .select("node")
744                .arg("id", &id.0)
745                .inline_fragment("AgentMessage"),
746            graphql_client: self.graphql_client.clone(),
747        })
748    }
749    /// 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.
750    /// Never blocks, never drops; concurrent sends queue in order.
751    /// 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.
752    /// 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.
753    ///
754    /// # Arguments
755    ///
756    /// * `message` - The message text, appended to the agent's history as a prompt when a turn consumes it. When content is supplied, nonempty text precedes those blocks in the same user message.
757    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
758    pub async fn send_opts<'a>(
759        &self,
760        message: impl Into<String>,
761        opts: AgentSendOpts<'a>,
762    ) -> Result<AgentMessage, DaggerError> {
763        let mut query = self.selection.select("send");
764        query = query.arg("message", message.into());
765        if let Some(reply_to) = opts.reply_to {
766            query = query.arg("replyTo", reply_to);
767        }
768        if let Some(content) = opts.content {
769            query = query.arg("content", content);
770        }
771        let id: Id = query.execute(self.graphql_client.clone()).await?;
772        Ok(AgentMessage {
773            proc: self.proc.clone(),
774            selection: query
775                .root()
776                .select("node")
777                .arg("id", &id.0)
778                .inline_fragment("AgentMessage"),
779            graphql_client: self.graphql_client.clone(),
780        })
781    }
782    /// Look up a previously sent message by its ref.
783    /// 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).
784    /// Fails if the agent has no runtime entry in this session, or no record of the given ref.
785    ///
786    /// # Arguments
787    ///
788    /// * `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.
789    pub fn message(&self, r#ref: impl Into<String>) -> AgentMessage {
790        let mut query = self.selection.select("message");
791        query = query.arg("ref", r#ref.into());
792        AgentMessage {
793            proc: self.proc.clone(),
794            selection: query,
795            graphql_client: self.graphql_client.clone(),
796        }
797    }
798    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
799    /// 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.
800    /// 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.
801    ///
802    /// # Arguments
803    ///
804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
805    pub async fn pause(&self) -> Result<Agent, DaggerError> {
806        let query = self.selection.select("pause");
807        let id: Id = query.execute(self.graphql_client.clone()).await?;
808        Ok(Agent {
809            proc: self.proc.clone(),
810            selection: query
811                .root()
812                .select("node")
813                .arg("id", &id.0)
814                .inline_fragment("Agent"),
815            graphql_client: self.graphql_client.clone(),
816        })
817    }
818    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
819    /// 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.
820    /// 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.
821    ///
822    /// # Arguments
823    ///
824    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
825    pub async fn pause_opts(&self, opts: AgentPauseOpts) -> Result<Agent, DaggerError> {
826        let mut query = self.selection.select("pause");
827        if let Some(interrupt) = opts.interrupt {
828            query = query.arg("interrupt", interrupt);
829        }
830        let id: Id = query.execute(self.graphql_client.clone()).await?;
831        Ok(Agent {
832            proc: self.proc.clone(),
833            selection: query
834                .root()
835                .select("node")
836                .arg("id", &id.0)
837                .inline_fragment("Agent"),
838            graphql_client: self.graphql_client.clone(),
839        })
840    }
841    /// Resume draining the mailbox: a suspended turn continues from the last committed step, and queued messages drain.
842    /// 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.
843    /// No-op on a running or idle agent.
844    pub async fn resume(&self) -> Result<Agent, DaggerError> {
845        let query = self.selection.select("resume");
846        let id: Id = query.execute(self.graphql_client.clone()).await?;
847        Ok(Agent {
848            proc: self.proc.clone(),
849            selection: query
850                .root()
851                .select("node")
852                .arg("id", &id.0)
853                .inline_fragment("Agent"),
854            graphql_client: self.graphql_client.clone(),
855        })
856    }
857    /// Block until the agent settles: IDLE, FAILED, or STOPPED. Read which from state afterwards.
858    /// Unlike waiting for one exact state, this cannot hang merely because the agent settled in a different outcome.
859    pub async fn wait(&self) -> Result<Agent, DaggerError> {
860        let query = self.selection.select("wait");
861        let id: Id = query.execute(self.graphql_client.clone()).await?;
862        Ok(Agent {
863            proc: self.proc.clone(),
864            selection: query
865                .root()
866                .select("node")
867                .arg("id", &id.0)
868                .inline_fragment("Agent"),
869            graphql_client: self.graphql_client.clone(),
870        })
871    }
872    /// 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.
873    /// 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.
874    /// 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.
875    /// A restored agent that nothing has sent to, started, or resumed yet is the exception: its state was reached in the session it was restored from, so subscribing to it announces nothing until it next transitions. This is how a restore reinstalls recorded subscriptions without waking their subscribers.
876    /// Idempotent per subscriber; re-subscribing replaces the state set.
877    ///
878    /// # Arguments
879    ///
880    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
882    pub async fn notify(&self, subscriber: impl IntoID<Id>) -> Result<Agent, DaggerError> {
883        let mut query = self.selection.select("notify");
884        query = query.arg_lazy(
885            "subscriber",
886            Box::new(move || {
887                let subscriber = subscriber.clone();
888                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
889            }),
890        );
891        let id: Id = query.execute(self.graphql_client.clone()).await?;
892        Ok(Agent {
893            proc: self.proc.clone(),
894            selection: query
895                .root()
896                .select("node")
897                .arg("id", &id.0)
898                .inline_fragment("Agent"),
899            graphql_client: self.graphql_client.clone(),
900        })
901    }
902    /// 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.
903    /// 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.
904    /// 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.
905    /// A restored agent that nothing has sent to, started, or resumed yet is the exception: its state was reached in the session it was restored from, so subscribing to it announces nothing until it next transitions. This is how a restore reinstalls recorded subscriptions without waking their subscribers.
906    /// Idempotent per subscriber; re-subscribing replaces the state set.
907    ///
908    /// # Arguments
909    ///
910    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
911    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
912    pub async fn notify_opts(
913        &self,
914        subscriber: impl IntoID<Id>,
915        opts: AgentNotifyOpts,
916    ) -> Result<Agent, DaggerError> {
917        let mut query = self.selection.select("notify");
918        query = query.arg_lazy(
919            "subscriber",
920            Box::new(move || {
921                let subscriber = subscriber.clone();
922                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
923            }),
924        );
925        if let Some(on) = opts.on {
926            query = query.arg("on", on);
927        }
928        let id: Id = query.execute(self.graphql_client.clone()).await?;
929        Ok(Agent {
930            proc: self.proc.clone(),
931            selection: query
932                .root()
933                .select("node")
934                .arg("id", &id.0)
935                .inline_fragment("Agent"),
936            graphql_client: self.graphql_client.clone(),
937        })
938    }
939    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
940    ///
941    /// # Arguments
942    ///
943    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
944    pub async fn stop(&self) -> Result<Agent, DaggerError> {
945        let query = self.selection.select("stop");
946        let id: Id = query.execute(self.graphql_client.clone()).await?;
947        Ok(Agent {
948            proc: self.proc.clone(),
949            selection: query
950                .root()
951                .select("node")
952                .arg("id", &id.0)
953                .inline_fragment("Agent"),
954            graphql_client: self.graphql_client.clone(),
955        })
956    }
957    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
958    ///
959    /// # Arguments
960    ///
961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
962    pub async fn stop_opts(&self, opts: AgentStopOpts) -> Result<Agent, DaggerError> {
963        let mut query = self.selection.select("stop");
964        if let Some(kill) = opts.kill {
965            query = query.arg("kill", kill);
966        }
967        let id: Id = query.execute(self.graphql_client.clone()).await?;
968        Ok(Agent {
969            proc: self.proc.clone(),
970            selection: query
971                .root()
972                .select("node")
973                .arg("id", &id.0)
974                .inline_fragment("Agent"),
975            graphql_client: self.graphql_client.clone(),
976        })
977    }
978    /// 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.
979    /// 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.
980    /// 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.
981    /// 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.
982    ///
983    /// # Arguments
984    ///
985    /// * `conversation` - The conversation that becomes the agent's committed history, replacing the current one.
986    pub async fn reseed(&self, conversation: impl IntoID<Id>) -> Result<Agent, DaggerError> {
987        let mut query = self.selection.select("reseed");
988        query = query.arg_lazy(
989            "conversation",
990            Box::new(move || {
991                let conversation = conversation.clone();
992                Box::pin(async move { conversation.into_id().await.unwrap().quote() })
993            }),
994        );
995        let id: Id = query.execute(self.graphql_client.clone()).await?;
996        Ok(Agent {
997            proc: self.proc.clone(),
998            selection: query
999                .root()
1000                .select("node")
1001                .arg("id", &id.0)
1002                .inline_fragment("Agent"),
1003            graphql_client: self.graphql_client.clone(),
1004        })
1005    }
1006}
1007impl Node for Agent {
1008    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1009        let query = self.selection.select("id");
1010        let graphql_client = self.graphql_client.clone();
1011        async move { query.execute(graphql_client).await }
1012    }
1013}
1014#[derive(Clone)]
1015pub struct AgentMessage {
1016    pub proc: Option<Arc<DaggerSessionProc>>,
1017    pub selection: Selection,
1018    pub graphql_client: DynGraphQLClient,
1019}
1020impl IntoID<Id> for AgentMessage {
1021    fn into_id(
1022        self,
1023    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1024        Box::pin(async move { self.id().await })
1025    }
1026}
1027impl Loadable for AgentMessage {
1028    fn graphql_type() -> &'static str {
1029        "AgentMessage"
1030    }
1031    fn from_query(
1032        proc: Option<Arc<DaggerSessionProc>>,
1033        selection: Selection,
1034        graphql_client: DynGraphQLClient,
1035    ) -> Self {
1036        Self {
1037            proc,
1038            selection,
1039            graphql_client,
1040        }
1041    }
1042}
1043impl AgentMessage {
1044    /// A unique identifier for this AgentMessage.
1045    pub async fn id(&self) -> Result<Id, DaggerError> {
1046        let query = self.selection.select("id");
1047        query.execute(self.graphql_client.clone()).await
1048    }
1049    /// 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).
1050    /// Blocks until provider or native lifecycle evidence is conclusive. Once recorded, the result or cancellation error is immutable.
1051    pub async fn delivery(&self) -> Result<AgentMessageDelivery, DaggerError> {
1052        let query = self.selection.select("delivery");
1053        query.execute(self.graphql_client.clone()).await
1054    }
1055    /// The message's short ref within the receiving agent's runtime, e.g. "#3".
1056    /// 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.
1057    pub async fn r#ref(&self) -> Result<String, DaggerError> {
1058        let query = self.selection.select("ref");
1059        query.execute(self.graphql_client.clone()).await
1060    }
1061    /// 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.
1062    /// Idempotent: cancel and request the response again freely; concurrent waiters share the result.
1063    /// 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.
1064    /// 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.
1065    pub async fn response(&self) -> Result<String, DaggerError> {
1066        let query = self.selection.select("response");
1067        query.execute(self.graphql_client.clone()).await
1068    }
1069}
1070impl Node for AgentMessage {
1071    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1072        let query = self.selection.select("id");
1073        let graphql_client = self.graphql_client.clone();
1074        async move { query.execute(graphql_client).await }
1075    }
1076}
1077#[derive(Clone)]
1078pub struct Artifact {
1079    pub proc: Option<Arc<DaggerSessionProc>>,
1080    pub selection: Selection,
1081    pub graphql_client: DynGraphQLClient,
1082}
1083#[derive(Builder, Debug, PartialEq)]
1084pub struct ArtifactUriOpts {
1085    /// Prefix the workspace's Git address and commit: dag://<workspace>@<commit>:<path>. Fails if the artifact has no workspace, or its workspace has no Git address.
1086    #[builder(setter(into, strip_option), default)]
1087    pub absolute: Option<bool>,
1088    /// Include the dimension keys as a query. Without them, the address is a path selector.
1089    #[builder(setter(into, strip_option), default)]
1090    pub dimension_keys: Option<bool>,
1091    /// Include the artifact type in the scheme: dag+container://.
1092    #[builder(setter(into, strip_option), default)]
1093    pub type_assertion: Option<bool>,
1094}
1095impl IntoID<Id> for Artifact {
1096    fn into_id(
1097        self,
1098    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1099        Box::pin(async move { self.id().await })
1100    }
1101}
1102impl Loadable for Artifact {
1103    fn graphql_type() -> &'static str {
1104        "Artifact"
1105    }
1106    fn from_query(
1107        proc: Option<Arc<DaggerSessionProc>>,
1108        selection: Selection,
1109        graphql_client: DynGraphQLClient,
1110    ) -> Self {
1111        Self {
1112            proc,
1113            selection,
1114            graphql_client,
1115        }
1116    }
1117}
1118impl Artifact {
1119    /// A unique identifier for this Artifact.
1120    pub async fn id(&self) -> Result<Id, DaggerError> {
1121        let query = self.selection.select("id");
1122        query.execute(self.graphql_client.clone()).await
1123    }
1124    /// A module load failure, or an empty string if discovery succeeded.
1125    pub async fn load_error(&self) -> Result<String, DaggerError> {
1126        let query = self.selection.select("loadError");
1127        query.execute(self.graphql_client.clone()).await
1128    }
1129    /// The arguments accepted by the artifact field.
1130    pub async fn arguments(&self) -> Result<Vec<FunctionArg>, DaggerError> {
1131        let query = self.selection.select("arguments");
1132        let query = query.select("id");
1133        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1134        Ok(ids
1135            .into_iter()
1136            .map(|id| FunctionArg {
1137                proc: self.proc.clone(),
1138                selection: crate::querybuilder::query()
1139                    .select("node")
1140                    .arg("id", &id.0)
1141                    .inline_fragment("FunctionArg"),
1142                graphql_client: self.graphql_client.clone(),
1143            })
1144            .collect())
1145    }
1146    /// The description of the field that supplies this artifact.
1147    pub async fn description(&self) -> Result<String, DaggerError> {
1148        let query = self.selection.select("description");
1149        query.execute(self.graphql_client.clone()).await
1150    }
1151    /// The artifact's DAG address, such as dag://engine-dev/playground.
1152    ///
1153    /// # Arguments
1154    ///
1155    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1156    pub async fn uri(&self) -> Result<String, DaggerError> {
1157        let query = self.selection.select("uri");
1158        query.execute(self.graphql_client.clone()).await
1159    }
1160    /// The artifact's DAG address, such as dag://engine-dev/playground.
1161    ///
1162    /// # Arguments
1163    ///
1164    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1165    pub async fn uri_opts(&self, opts: ArtifactUriOpts) -> Result<String, DaggerError> {
1166        let mut query = self.selection.select("uri");
1167        if let Some(absolute) = opts.absolute {
1168            query = query.arg("absolute", absolute);
1169        }
1170        if let Some(dimension_keys) = opts.dimension_keys {
1171            query = query.arg("dimensionKeys", dimension_keys);
1172        }
1173        if let Some(type_assertion) = opts.type_assertion {
1174            query = query.arg("typeAssertion", type_assertion);
1175        }
1176        query.execute(self.graphql_client.clone()).await
1177    }
1178    /// The installed module name.
1179    pub async fn module_name(&self) -> Result<String, DaggerError> {
1180        let query = self.selection.select("moduleName");
1181        query.execute(self.graphql_client.clone()).await
1182    }
1183    /// Ordered, literal fields to follow. Entrypoint targets use their shorthand.
1184    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1185        let query = self.selection.select("path");
1186        query.execute(self.graphql_client.clone()).await
1187    }
1188    /// The module name, collection keys, and full path key in the artifact type dimension.
1189    pub async fn dimension_keys(&self) -> Result<Vec<ArtifactDimensionKey>, DaggerError> {
1190        let query = self.selection.select("dimensionKeys");
1191        let query = query.select("id");
1192        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1193        Ok(ids
1194            .into_iter()
1195            .map(|id| ArtifactDimensionKey {
1196                proc: self.proc.clone(),
1197                selection: crate::querybuilder::query()
1198                    .select("node")
1199                    .arg("id", &id.0)
1200                    .inline_fragment("ArtifactDimensionKey"),
1201                graphql_client: self.graphql_client.clone(),
1202            })
1203            .collect())
1204    }
1205    /// The directives carried by this artifact.
1206    pub async fn directives(&self) -> Result<Vec<String>, DaggerError> {
1207        let query = self.selection.select("directives");
1208        query.execute(self.graphql_client.clone()).await
1209    }
1210    /// Evaluate the target in the workspace that supplied this artifact.
1211    ///
1212    /// # Arguments
1213    ///
1214    /// * `arguments` - Field arguments as a JSON object.
1215    pub fn value(&self, arguments: Json) -> NodeClient {
1216        let mut query = self.selection.select("value");
1217        query = query.arg("arguments", arguments);
1218        NodeClient {
1219            proc: self.proc.clone(),
1220            selection: query,
1221            graphql_client: self.graphql_client.clone(),
1222        }
1223    }
1224}
1225impl Node for Artifact {
1226    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1227        let query = self.selection.select("id");
1228        let graphql_client = self.graphql_client.clone();
1229        async move { query.execute(graphql_client).await }
1230    }
1231}
1232#[derive(Clone)]
1233pub struct ArtifactDimension {
1234    pub proc: Option<Arc<DaggerSessionProc>>,
1235    pub selection: Selection,
1236    pub graphql_client: DynGraphQLClient,
1237}
1238impl IntoID<Id> for ArtifactDimension {
1239    fn into_id(
1240        self,
1241    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1242        Box::pin(async move { self.id().await })
1243    }
1244}
1245impl Loadable for ArtifactDimension {
1246    fn graphql_type() -> &'static str {
1247        "ArtifactDimension"
1248    }
1249    fn from_query(
1250        proc: Option<Arc<DaggerSessionProc>>,
1251        selection: Selection,
1252        graphql_client: DynGraphQLClient,
1253    ) -> Self {
1254        Self {
1255            proc,
1256            selection,
1257            graphql_client,
1258        }
1259    }
1260}
1261impl ArtifactDimension {
1262    /// A unique identifier for this ArtifactDimension.
1263    pub async fn id(&self) -> Result<Id, DaggerError> {
1264        let query = self.selection.select("id");
1265        query.execute(self.graphql_client.clone()).await
1266    }
1267    /// How this dimension gets its keys.
1268    pub async fn kind(&self) -> Result<ArtifactDimensionKind, DaggerError> {
1269        let query = self.selection.select("kind");
1270        query.execute(self.graphql_client.clone()).await
1271    }
1272    /// The collection type, or null for a static dimension.
1273    pub async fn collection_type(&self) -> Result<String, DaggerError> {
1274        let query = self.selection.select("collectionType");
1275        query.execute(self.graphql_client.clone()).await
1276    }
1277    /// Stable identifier: collection schema path, type:TypeName for an artifact type, or module.
1278    pub async fn identifier(&self) -> Result<String, DaggerError> {
1279        let query = self.selection.select("identifier");
1280        query.execute(self.graphql_client.clone()).await
1281    }
1282    /// Short name used to select this dimension.
1283    pub async fn name(&self) -> Result<String, DaggerError> {
1284        let query = self.selection.select("name");
1285        query.execute(self.graphql_client.clone()).await
1286    }
1287    /// Qualified name used when the short name is ambiguous.
1288    pub async fn qualified_name(&self) -> Result<String, DaggerError> {
1289        let query = self.selection.select("qualifiedName");
1290        query.execute(self.graphql_client.clone()).await
1291    }
1292    /// The collection item or artifact type name, or empty for the module dimension.
1293    pub async fn item_type(&self) -> Result<String, DaggerError> {
1294        let query = self.selection.select("itemType");
1295        query.execute(self.graphql_client.clone()).await
1296    }
1297    /// The collection key argument name, or name for a static dimension.
1298    pub async fn key_name(&self) -> Result<String, DaggerError> {
1299        let query = self.selection.select("keyName");
1300        query.execute(self.graphql_client.clone()).await
1301    }
1302    /// The collection key argument description, or empty for a static dimension.
1303    pub async fn key_description(&self) -> Result<String, DaggerError> {
1304        let query = self.selection.select("keyDescription");
1305        query.execute(self.graphql_client.clone()).await
1306    }
1307}
1308impl Node for ArtifactDimension {
1309    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1310        let query = self.selection.select("id");
1311        let graphql_client = self.graphql_client.clone();
1312        async move { query.execute(graphql_client).await }
1313    }
1314}
1315#[derive(Clone)]
1316pub struct ArtifactDimensionKey {
1317    pub proc: Option<Arc<DaggerSessionProc>>,
1318    pub selection: Selection,
1319    pub graphql_client: DynGraphQLClient,
1320}
1321impl IntoID<Id> for ArtifactDimensionKey {
1322    fn into_id(
1323        self,
1324    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1325        Box::pin(async move { self.id().await })
1326    }
1327}
1328impl Loadable for ArtifactDimensionKey {
1329    fn graphql_type() -> &'static str {
1330        "ArtifactDimensionKey"
1331    }
1332    fn from_query(
1333        proc: Option<Arc<DaggerSessionProc>>,
1334        selection: Selection,
1335        graphql_client: DynGraphQLClient,
1336    ) -> Self {
1337        Self {
1338            proc,
1339            selection,
1340            graphql_client,
1341        }
1342    }
1343}
1344impl ArtifactDimensionKey {
1345    /// A unique identifier for this ArtifactDimensionKey.
1346    pub async fn id(&self) -> Result<Id, DaggerError> {
1347        let query = self.selection.select("id");
1348        query.execute(self.graphql_client.clone()).await
1349    }
1350    /// The dimension identifier, fixed across the workspace schema.
1351    pub async fn dimension(&self) -> Result<String, DaggerError> {
1352        let query = self.selection.select("dimension");
1353        query.execute(self.graphql_client.clone()).await
1354    }
1355    /// The dimension item's key.
1356    pub async fn key(&self) -> Result<String, DaggerError> {
1357        let query = self.selection.select("key");
1358        query.execute(self.graphql_client.clone()).await
1359    }
1360}
1361impl Node for ArtifactDimensionKey {
1362    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1363        let query = self.selection.select("id");
1364        let graphql_client = self.graphql_client.clone();
1365        async move { query.execute(graphql_client).await }
1366    }
1367}
1368#[derive(Clone)]
1369pub struct ArtifactPath {
1370    pub proc: Option<Arc<DaggerSessionProc>>,
1371    pub selection: Selection,
1372    pub graphql_client: DynGraphQLClient,
1373}
1374impl IntoID<Id> for ArtifactPath {
1375    fn into_id(
1376        self,
1377    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1378        Box::pin(async move { self.id().await })
1379    }
1380}
1381impl Loadable for ArtifactPath {
1382    fn graphql_type() -> &'static str {
1383        "ArtifactPath"
1384    }
1385    fn from_query(
1386        proc: Option<Arc<DaggerSessionProc>>,
1387        selection: Selection,
1388        graphql_client: DynGraphQLClient,
1389    ) -> Self {
1390        Self {
1391            proc,
1392            selection,
1393            graphql_client,
1394        }
1395    }
1396}
1397impl ArtifactPath {
1398    /// A unique identifier for this ArtifactPath.
1399    pub async fn id(&self) -> Result<Id, DaggerError> {
1400        let query = self.selection.select("id");
1401        query.execute(self.graphql_client.clone()).await
1402    }
1403    /// The installed module name.
1404    pub async fn module_name(&self) -> Result<String, DaggerError> {
1405        let query = self.selection.select("moduleName");
1406        query.execute(self.graphql_client.clone()).await
1407    }
1408    /// The DAG address of this path, without dimension keys.
1409    pub async fn uri(&self) -> Result<String, DaggerError> {
1410        let query = self.selection.select("uri");
1411        query.execute(self.graphql_client.clone()).await
1412    }
1413    /// The description of the field at this path.
1414    pub async fn description(&self) -> Result<String, DaggerError> {
1415        let query = self.selection.select("description");
1416        query.execute(self.graphql_client.clone()).await
1417    }
1418    /// A module load failure for this path, or an empty string.
1419    pub async fn load_error(&self) -> Result<String, DaggerError> {
1420        let query = self.selection.select("loadError");
1421        query.execute(self.graphql_client.clone()).await
1422    }
1423    /// The dimension identifiers required by this path.
1424    pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
1425        let query = self.selection.select("dimensions");
1426        query.execute(self.graphql_client.clone()).await
1427    }
1428}
1429impl Node for ArtifactPath {
1430    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1431        let query = self.selection.select("id");
1432        let graphql_client = self.graphql_client.clone();
1433        async move { query.execute(graphql_client).await }
1434    }
1435}
1436#[derive(Clone)]
1437pub struct ArtifactResult {
1438    pub proc: Option<Arc<DaggerSessionProc>>,
1439    pub selection: Selection,
1440    pub graphql_client: DynGraphQLClient,
1441}
1442impl IntoID<Id> for ArtifactResult {
1443    fn into_id(
1444        self,
1445    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1446        Box::pin(async move { self.id().await })
1447    }
1448}
1449impl Loadable for ArtifactResult {
1450    fn graphql_type() -> &'static str {
1451        "ArtifactResult"
1452    }
1453    fn from_query(
1454        proc: Option<Arc<DaggerSessionProc>>,
1455        selection: Selection,
1456        graphql_client: DynGraphQLClient,
1457    ) -> Self {
1458        Self {
1459            proc,
1460            selection,
1461            graphql_client,
1462        }
1463    }
1464}
1465impl ArtifactResult {
1466    /// A unique identifier for this ArtifactResult.
1467    pub async fn id(&self) -> Result<Id, DaggerError> {
1468        let query = self.selection.select("id");
1469        query.execute(self.graphql_client.clone()).await
1470    }
1471    /// The artifact that was evaluated.
1472    pub fn artifact(&self) -> Artifact {
1473        let query = self.selection.select("artifact");
1474        Artifact {
1475            proc: self.proc.clone(),
1476            selection: query,
1477            graphql_client: self.graphql_client.clone(),
1478        }
1479    }
1480    /// The evaluation failure, if any.
1481    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1482        let query = self.selection.select("error");
1483        let query = query.select("id");
1484        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1485        Ok(id.map(|id| Error {
1486            proc: self.proc.clone(),
1487            selection: query
1488                .root()
1489                .select("node")
1490                .arg("id", &id.0)
1491                .inline_fragment("Error"),
1492            graphql_client: self.graphql_client.clone(),
1493        }))
1494    }
1495    /// The evaluated value, or null when evaluation failed.
1496    pub async fn value(&self) -> Result<Option<NodeClient>, DaggerError> {
1497        let query = self.selection.select("value");
1498        let query = query.select("id");
1499        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1500        Ok(id.map(|id| NodeClient {
1501            proc: self.proc.clone(),
1502            selection: query
1503                .root()
1504                .select("node")
1505                .arg("id", &id.0)
1506                .inline_fragment("Node"),
1507            graphql_client: self.graphql_client.clone(),
1508        }))
1509    }
1510}
1511impl Node for ArtifactResult {
1512    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1513        let query = self.selection.select("id");
1514        let graphql_client = self.graphql_client.clone();
1515        async move { query.execute(graphql_client).await }
1516    }
1517}
1518#[derive(Clone)]
1519pub struct Artifacts {
1520    pub proc: Option<Arc<DaggerSessionProc>>,
1521    pub selection: Selection,
1522    pub graphql_client: DynGraphQLClient,
1523}
1524#[derive(Builder, Debug, PartialEq)]
1525pub struct ArtifactsPathDefinitionsOpts<'a> {
1526    /// Prefix each address with the workspace's Git address and commit.
1527    #[builder(setter(into, strip_option), default)]
1528    pub absolute: Option<bool>,
1529    /// Project paths to the items of this collection dimension. Preserve parent dimensions and remove descendant dimensions.
1530    #[builder(setter(into, strip_option), default)]
1531    pub dimension: Option<&'a str>,
1532    /// Include the artifact type in each address scheme.
1533    #[builder(setter(into, strip_option), default)]
1534    pub type_assertion: Option<bool>,
1535}
1536#[derive(Builder, Debug, PartialEq)]
1537pub struct ArtifactsValuesOpts {
1538    /// Field arguments applied to each artifact, as a JSON object.
1539    #[builder(setter(into, strip_option), default)]
1540    pub arguments: Option<Json>,
1541    /// Cancel remaining work after the first failure.
1542    #[builder(setter(into, strip_option), default)]
1543    pub fail_fast: Option<bool>,
1544    /// Evaluate at most this many artifacts at once on this engine; the rest wait. Checks that scale out to cloud engines are not counted. 0 means no limit.
1545    #[builder(setter(into, strip_option), default)]
1546    pub max_concurrency: Option<isize>,
1547}
1548#[derive(Builder, Debug, PartialEq)]
1549pub struct ArtifactsFilterDirectivesOpts {
1550    /// Remove the matching artifacts instead.
1551    #[builder(setter(into, strip_option), default)]
1552    pub exclude: Option<bool>,
1553}
1554#[derive(Builder, Debug, PartialEq)]
1555pub struct ArtifactsFilterParentTypesOpts {
1556    /// Remove the matching artifacts instead.
1557    #[builder(setter(into, strip_option), default)]
1558    pub exclude: Option<bool>,
1559}
1560#[derive(Builder, Debug, PartialEq)]
1561pub struct ArtifactsFilterParentDirectivesOpts {
1562    /// Remove the matching artifacts instead.
1563    #[builder(setter(into, strip_option), default)]
1564    pub exclude: Option<bool>,
1565}
1566#[derive(Builder, Debug, PartialEq)]
1567pub struct ArtifactsFilterTypesOpts {
1568    /// Remove the matching artifacts instead.
1569    #[builder(setter(into, strip_option), default)]
1570    pub exclude: Option<bool>,
1571}
1572impl IntoID<Id> for Artifacts {
1573    fn into_id(
1574        self,
1575    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1576        Box::pin(async move { self.id().await })
1577    }
1578}
1579impl Loadable for Artifacts {
1580    fn graphql_type() -> &'static str {
1581        "Artifacts"
1582    }
1583    fn from_query(
1584        proc: Option<Arc<DaggerSessionProc>>,
1585        selection: Selection,
1586        graphql_client: DynGraphQLClient,
1587    ) -> Self {
1588        Self {
1589            proc,
1590            selection,
1591            graphql_client,
1592        }
1593    }
1594}
1595impl Artifacts {
1596    /// A unique identifier for this Artifacts.
1597    pub async fn id(&self) -> Result<Id, DaggerError> {
1598        let query = self.selection.select("id");
1599        query.execute(self.graphql_client.clone()).await
1600    }
1601    /// Convert the selection to expertise without running the functions. Fail if any artifact is not a source of expertise.
1602    pub async fn as_expertise(&self) -> Result<Vec<Expertise>, DaggerError> {
1603        let query = self.selection.select("asExpertise");
1604        let query = query.select("id");
1605        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1606        Ok(ids
1607            .into_iter()
1608            .map(|id| Expertise {
1609                proc: self.proc.clone(),
1610                selection: crate::querybuilder::query()
1611                    .select("node")
1612                    .arg("id", &id.0)
1613                    .inline_fragment("Expertise"),
1614                graphql_client: self.graphql_client.clone(),
1615            })
1616            .collect())
1617    }
1618    /// Convert the selection to Generators without running them. Fail if any artifact is not a Generator.
1619    pub async fn as_generators(&self) -> Result<Vec<Generator>, DaggerError> {
1620        let query = self.selection.select("asGenerators");
1621        let query = query.select("id");
1622        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1623        Ok(ids
1624            .into_iter()
1625            .map(|id| Generator {
1626                proc: self.proc.clone(),
1627                selection: crate::querybuilder::query()
1628                    .select("node")
1629                    .arg("id", &id.0)
1630                    .inline_fragment("Generator"),
1631                graphql_client: self.graphql_client.clone(),
1632            })
1633            .collect())
1634    }
1635    /// Convert the selection to Checks. Fail if any artifact is not a Check. Does not apply command filters or run the checks.
1636    pub async fn as_checks(&self) -> Result<Vec<Check>, DaggerError> {
1637        let query = self.selection.select("asChecks");
1638        let query = query.select("id");
1639        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1640        Ok(ids
1641            .into_iter()
1642            .map(|id| Check {
1643                proc: self.proc.clone(),
1644                selection: crate::querybuilder::query()
1645                    .select("node")
1646                    .arg("id", &id.0)
1647                    .inline_fragment("Check"),
1648                graphql_client: self.graphql_client.clone(),
1649            })
1650            .collect())
1651    }
1652    /// Convert the selection to Changesets. Fail if any artifact is not a Changeset. Does not apply command filters.
1653    pub async fn as_changesets(&self) -> Result<Vec<Changeset>, DaggerError> {
1654        let query = self.selection.select("asChangesets");
1655        let query = query.select("id");
1656        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1657        Ok(ids
1658            .into_iter()
1659            .map(|id| Changeset {
1660                proc: self.proc.clone(),
1661                selection: crate::querybuilder::query()
1662                    .select("node")
1663                    .arg("id", &id.0)
1664                    .inline_fragment("Changeset"),
1665                graphql_client: self.graphql_client.clone(),
1666            })
1667            .collect())
1668    }
1669    /// Convert the selection to Services. Fail if any artifact is not a Service. Does not apply command filters or start the services.
1670    pub async fn as_services(&self) -> Result<Vec<Service>, DaggerError> {
1671        let query = self.selection.select("asServices");
1672        let query = query.select("id");
1673        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1674        Ok(ids
1675            .into_iter()
1676            .map(|id| Service {
1677                proc: self.proc.clone(),
1678                selection: crate::querybuilder::query()
1679                    .select("node")
1680                    .arg("id", &id.0)
1681                    .inline_fragment("Service"),
1682                graphql_client: self.graphql_client.clone(),
1683            })
1684            .collect())
1685    }
1686    /// List selected schema paths, including empty collections. Does not read runtime values. Applies type keys and collection presence; collection key values require items.
1687    ///
1688    /// # Arguments
1689    ///
1690    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1691    pub async fn path_definitions(&self) -> Result<Vec<ArtifactPath>, DaggerError> {
1692        let query = self.selection.select("pathDefinitions");
1693        let query = query.select("id");
1694        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1695        Ok(ids
1696            .into_iter()
1697            .map(|id| ArtifactPath {
1698                proc: self.proc.clone(),
1699                selection: crate::querybuilder::query()
1700                    .select("node")
1701                    .arg("id", &id.0)
1702                    .inline_fragment("ArtifactPath"),
1703                graphql_client: self.graphql_client.clone(),
1704            })
1705            .collect())
1706    }
1707    /// List selected schema paths, including empty collections. Does not read runtime values. Applies type keys and collection presence; collection key values require items.
1708    ///
1709    /// # Arguments
1710    ///
1711    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1712    pub async fn path_definitions_opts<'a>(
1713        &self,
1714        opts: ArtifactsPathDefinitionsOpts<'a>,
1715    ) -> Result<Vec<ArtifactPath>, DaggerError> {
1716        let mut query = self.selection.select("pathDefinitions");
1717        if let Some(absolute) = opts.absolute {
1718            query = query.arg("absolute", absolute);
1719        }
1720        if let Some(type_assertion) = opts.type_assertion {
1721            query = query.arg("typeAssertion", type_assertion);
1722        }
1723        if let Some(dimension) = opts.dimension {
1724            query = query.arg("dimension", dimension);
1725        }
1726        let query = query.select("id");
1727        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1728        Ok(ids
1729            .into_iter()
1730            .map(|id| ArtifactPath {
1731                proc: self.proc.clone(),
1732                selection: crate::querybuilder::query()
1733                    .select("node")
1734                    .arg("id", &id.0)
1735                    .inline_fragment("ArtifactPath"),
1736                graphql_client: self.graphql_client.clone(),
1737            })
1738            .collect())
1739    }
1740    /// List dimensions on the selected schema paths, including empty collections. Does not read runtime values.
1741    pub async fn dimension_definitions(&self) -> Result<Vec<ArtifactDimension>, DaggerError> {
1742        let query = self.selection.select("dimensionDefinitions");
1743        let query = query.select("id");
1744        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1745        Ok(ids
1746            .into_iter()
1747            .map(|id| ArtifactDimension {
1748                proc: self.proc.clone(),
1749                selection: crate::querybuilder::query()
1750                    .select("node")
1751                    .arg("id", &id.0)
1752                    .inline_fragment("ArtifactDimension"),
1753                graphql_client: self.graphql_client.clone(),
1754            })
1755            .collect())
1756    }
1757    /// Evaluate the selection in parallel, retaining each result and error.
1758    ///
1759    /// # Arguments
1760    ///
1761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1762    pub async fn values(&self) -> Result<Vec<ArtifactResult>, DaggerError> {
1763        let query = self.selection.select("values");
1764        let query = query.select("id");
1765        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1766        Ok(ids
1767            .into_iter()
1768            .map(|id| ArtifactResult {
1769                proc: self.proc.clone(),
1770                selection: crate::querybuilder::query()
1771                    .select("node")
1772                    .arg("id", &id.0)
1773                    .inline_fragment("ArtifactResult"),
1774                graphql_client: self.graphql_client.clone(),
1775            })
1776            .collect())
1777    }
1778    /// Evaluate the selection in parallel, retaining each result and error.
1779    ///
1780    /// # Arguments
1781    ///
1782    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1783    pub async fn values_opts(
1784        &self,
1785        opts: ArtifactsValuesOpts,
1786    ) -> Result<Vec<ArtifactResult>, DaggerError> {
1787        let mut query = self.selection.select("values");
1788        if let Some(fail_fast) = opts.fail_fast {
1789            query = query.arg("failFast", fail_fast);
1790        }
1791        if let Some(arguments) = opts.arguments {
1792            query = query.arg("arguments", arguments);
1793        }
1794        if let Some(max_concurrency) = opts.max_concurrency {
1795            query = query.arg("maxConcurrency", max_concurrency);
1796        }
1797        let query = query.select("id");
1798        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1799        Ok(ids
1800            .into_iter()
1801            .map(|id| ArtifactResult {
1802                proc: self.proc.clone(),
1803                selection: crate::querybuilder::query()
1804                    .select("node")
1805                    .arg("id", &id.0)
1806                    .inline_fragment("ArtifactResult"),
1807                graphql_client: self.graphql_client.clone(),
1808            })
1809            .collect())
1810    }
1811    /// List the modules represented in this selection without evaluating artifact values.
1812    pub async fn modules(&self) -> Result<Vec<Module>, DaggerError> {
1813        let query = self.selection.select("modules");
1814        let query = query.select("id");
1815        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1816        Ok(ids
1817            .into_iter()
1818            .map(|id| Module {
1819                proc: self.proc.clone(),
1820                selection: crate::querybuilder::query()
1821                    .select("node")
1822                    .arg("id", &id.0)
1823                    .inline_fragment("Module"),
1824                graphql_client: self.graphql_client.clone(),
1825            })
1826            .collect())
1827    }
1828    /// List concrete type definitions represented in this selection, sorted by name with no duplicates.
1829    pub async fn types(&self) -> Result<Vec<TypeDef>, DaggerError> {
1830        let query = self.selection.select("types");
1831        let query = query.select("id");
1832        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1833        Ok(ids
1834            .into_iter()
1835            .map(|id| TypeDef {
1836                proc: self.proc.clone(),
1837                selection: crate::querybuilder::query()
1838                    .select("node")
1839                    .arg("id", &id.0)
1840                    .inline_fragment("TypeDef"),
1841                graphql_client: self.graphql_client.clone(),
1842            })
1843            .collect())
1844    }
1845    /// Keep artifacts with any listed directive. Does not filter by type or workspace settings.
1846    ///
1847    /// # Arguments
1848    ///
1849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1850    pub fn filter_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1851        let mut query = self.selection.select("filterDirectives");
1852        query = query.arg(
1853            "directives",
1854            directives
1855                .into_iter()
1856                .map(|i| i.into())
1857                .collect::<Vec<String>>(),
1858        );
1859        Artifacts {
1860            proc: self.proc.clone(),
1861            selection: query,
1862            graphql_client: self.graphql_client.clone(),
1863        }
1864    }
1865    /// Keep artifacts with any listed directive. Does not filter by type or workspace settings.
1866    ///
1867    /// # Arguments
1868    ///
1869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1870    pub fn filter_directives_opts(
1871        &self,
1872        directives: Vec<impl Into<String>>,
1873        opts: ArtifactsFilterDirectivesOpts,
1874    ) -> Artifacts {
1875        let mut query = self.selection.select("filterDirectives");
1876        query = query.arg(
1877            "directives",
1878            directives
1879                .into_iter()
1880                .map(|i| i.into())
1881                .collect::<Vec<String>>(),
1882        );
1883        if let Some(exclude) = opts.exclude {
1884            query = query.arg("exclude", exclude);
1885        }
1886        Artifacts {
1887            proc: self.proc.clone(),
1888            selection: query,
1889            graphql_client: self.graphql_client.clone(),
1890        }
1891    }
1892    /// Keep artifacts whose immediate parent has any listed object type. Artifacts without a typed parent do not match.
1893    ///
1894    /// # Arguments
1895    ///
1896    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1897    pub fn filter_parent_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
1898        let mut query = self.selection.select("filterParentTypes");
1899        query = query.arg(
1900            "types",
1901            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1902        );
1903        Artifacts {
1904            proc: self.proc.clone(),
1905            selection: query,
1906            graphql_client: self.graphql_client.clone(),
1907        }
1908    }
1909    /// Keep artifacts whose immediate parent has any listed object type. Artifacts without a typed parent do not match.
1910    ///
1911    /// # Arguments
1912    ///
1913    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1914    pub fn filter_parent_types_opts(
1915        &self,
1916        types: Vec<impl Into<String>>,
1917        opts: ArtifactsFilterParentTypesOpts,
1918    ) -> Artifacts {
1919        let mut query = self.selection.select("filterParentTypes");
1920        query = query.arg(
1921            "types",
1922            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1923        );
1924        if let Some(exclude) = opts.exclude {
1925            query = query.arg("exclude", exclude);
1926        }
1927        Artifacts {
1928            proc: self.proc.clone(),
1929            selection: query,
1930            graphql_client: self.graphql_client.clone(),
1931        }
1932    }
1933    /// Keep artifacts whose immediate parent has any listed directive. Artifacts without a parent do not match.
1934    ///
1935    /// # Arguments
1936    ///
1937    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1938    pub fn filter_parent_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1939        let mut query = self.selection.select("filterParentDirectives");
1940        query = query.arg(
1941            "directives",
1942            directives
1943                .into_iter()
1944                .map(|i| i.into())
1945                .collect::<Vec<String>>(),
1946        );
1947        Artifacts {
1948            proc: self.proc.clone(),
1949            selection: query,
1950            graphql_client: self.graphql_client.clone(),
1951        }
1952    }
1953    /// Keep artifacts whose immediate parent has any listed directive. Artifacts without a parent do not match.
1954    ///
1955    /// # Arguments
1956    ///
1957    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1958    pub fn filter_parent_directives_opts(
1959        &self,
1960        directives: Vec<impl Into<String>>,
1961        opts: ArtifactsFilterParentDirectivesOpts,
1962    ) -> Artifacts {
1963        let mut query = self.selection.select("filterParentDirectives");
1964        query = query.arg(
1965            "directives",
1966            directives
1967                .into_iter()
1968                .map(|i| i.into())
1969                .collect::<Vec<String>>(),
1970        );
1971        if let Some(exclude) = opts.exclude {
1972            query = query.arg("exclude", exclude);
1973        }
1974        Artifacts {
1975            proc: self.proc.clone(),
1976            selection: query,
1977            graphql_client: self.graphql_client.clone(),
1978        }
1979    }
1980    /// Combine two selections, keeping each workspace address once. Different addresses remain distinct even if they return the same object.
1981    pub fn with_artifacts(&self, artifacts: impl IntoID<Id>) -> Artifacts {
1982        let mut query = self.selection.select("withArtifacts");
1983        query = query.arg_lazy(
1984            "artifacts",
1985            Box::new(move || {
1986                let artifacts = artifacts.clone();
1987                Box::pin(async move { artifacts.into_id().await.unwrap().quote() })
1988            }),
1989        );
1990        Artifacts {
1991            proc: self.proc.clone(),
1992            selection: query,
1993            graphql_client: self.graphql_client.clone(),
1994        }
1995    }
1996    /// Remove artifacts selected by a DAG address.
1997    pub fn without_uri(&self, uri: impl Into<String>) -> Artifacts {
1998        let mut query = self.selection.select("withoutUri");
1999        query = query.arg("uri", uri.into());
2000        Artifacts {
2001            proc: self.proc.clone(),
2002            selection: query,
2003            graphql_client: self.graphql_client.clone(),
2004        }
2005    }
2006    /// Keep artifacts of any listed concrete GraphQL type.
2007    ///
2008    /// # Arguments
2009    ///
2010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2011    pub fn filter_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
2012        let mut query = self.selection.select("filterTypes");
2013        query = query.arg(
2014            "types",
2015            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2016        );
2017        Artifacts {
2018            proc: self.proc.clone(),
2019            selection: query,
2020            graphql_client: self.graphql_client.clone(),
2021        }
2022    }
2023    /// Keep artifacts of any listed concrete GraphQL type.
2024    ///
2025    /// # Arguments
2026    ///
2027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2028    pub fn filter_types_opts(
2029        &self,
2030        types: Vec<impl Into<String>>,
2031        opts: ArtifactsFilterTypesOpts,
2032    ) -> Artifacts {
2033        let mut query = self.selection.select("filterTypes");
2034        query = query.arg(
2035            "types",
2036            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2037        );
2038        if let Some(exclude) = opts.exclude {
2039            query = query.arg("exclude", exclude);
2040        }
2041        Artifacts {
2042            proc: self.proc.clone(),
2043            selection: query,
2044            graphql_client: self.graphql_client.clone(),
2045        }
2046    }
2047    /// Match one complete, ordered field sequence exactly.
2048    pub fn filter_path(&self, path: Vec<impl Into<String>>) -> Artifacts {
2049        let mut query = self.selection.select("filterPath");
2050        query = query.arg(
2051            "path",
2052            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2053        );
2054        Artifacts {
2055            proc: self.proc.clone(),
2056            selection: query,
2057            graphql_client: self.graphql_client.clone(),
2058        }
2059    }
2060    /// Keep paths that match a glob pattern. A literal path matches exactly. Both module-qualified and entrypoint paths match.
2061    pub fn filter_path_pattern(&self, pattern: impl Into<String>) -> Artifacts {
2062        let mut query = self.selection.select("filterPathPattern");
2063        query = query.arg("pattern", pattern.into());
2064        Artifacts {
2065            proc: self.proc.clone(),
2066            selection: query,
2067            graphql_client: self.graphql_client.clone(),
2068        }
2069    }
2070    /// Keep artifacts selected through any listed dimension.
2071    pub fn filter_dimensions(&self, dimensions: Vec<impl Into<String>>) -> Artifacts {
2072        let mut query = self.selection.select("filterDimensions");
2073        query = query.arg(
2074            "dimensions",
2075            dimensions
2076                .into_iter()
2077                .map(|i| i.into())
2078                .collect::<Vec<String>>(),
2079        );
2080        Artifacts {
2081            proc: self.proc.clone(),
2082            selection: query,
2083            graphql_client: self.graphql_client.clone(),
2084        }
2085    }
2086    /// Keep artifacts with any listed key in this dimension.
2087    pub fn filter_dimension_keys(
2088        &self,
2089        dimension: impl Into<String>,
2090        keys: Vec<impl Into<String>>,
2091    ) -> Artifacts {
2092        let mut query = self.selection.select("filterDimensionKeys");
2093        query = query.arg("dimension", dimension.into());
2094        query = query.arg(
2095            "keys",
2096            keys.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2097        );
2098        Artifacts {
2099            proc: self.proc.clone(),
2100            selection: query,
2101            graphql_client: self.graphql_client.clone(),
2102        }
2103    }
2104    /// Apply a DAG address as one filter: the chain of path, type, and dimension-key filters it encodes.
2105    /// The scheme is optional. The path may be a pattern; an empty path selects all artifacts.
2106    ///
2107    /// # Arguments
2108    ///
2109    /// * `uri` - A DAG address: [dag[+<type>]://][<path>][?<dimension>=<key>&...]
2110    pub fn filter_uri(&self, uri: impl Into<String>) -> Artifacts {
2111        let mut query = self.selection.select("filterUri");
2112        query = query.arg("uri", uri.into());
2113        Artifacts {
2114            proc: self.proc.clone(),
2115            selection: query,
2116            graphql_client: self.graphql_client.clone(),
2117        }
2118    }
2119    /// List dimension identifiers represented in this selection, sorted with no duplicates.
2120    pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
2121        let query = self.selection.select("dimensions");
2122        query.execute(self.graphql_client.clone()).await
2123    }
2124    /// List keys represented in this selection for the given dimension, sorted with no duplicates.
2125    pub async fn dimension_keys(
2126        &self,
2127        dimension: impl Into<String>,
2128    ) -> Result<Vec<String>, DaggerError> {
2129        let mut query = self.selection.select("dimensionKeys");
2130        query = query.arg("dimension", dimension.into());
2131        query.execute(self.graphql_client.clone()).await
2132    }
2133    /// List collection items represented in this selection for the given dimension. Preserve parent keys and remove duplicate item addresses. Does not evaluate item values.
2134    pub async fn dimension_items(
2135        &self,
2136        dimension: impl Into<String>,
2137    ) -> Result<Vec<Artifact>, DaggerError> {
2138        let mut query = self.selection.select("dimensionItems");
2139        query = query.arg("dimension", dimension.into());
2140        let query = query.select("id");
2141        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2142        Ok(ids
2143            .into_iter()
2144            .map(|id| Artifact {
2145                proc: self.proc.clone(),
2146                selection: crate::querybuilder::query()
2147                    .select("node")
2148                    .arg("id", &id.0)
2149                    .inline_fragment("Artifact"),
2150                graphql_client: self.graphql_client.clone(),
2151            })
2152            .collect())
2153    }
2154    /// Enumerate complete artifacts without evaluating their values.
2155    pub async fn items(&self) -> Result<Vec<Artifact>, DaggerError> {
2156        let query = self.selection.select("items");
2157        let query = query.select("id");
2158        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2159        Ok(ids
2160            .into_iter()
2161            .map(|id| Artifact {
2162                proc: self.proc.clone(),
2163                selection: crate::querybuilder::query()
2164                    .select("node")
2165                    .arg("id", &id.0)
2166                    .inline_fragment("Artifact"),
2167                graphql_client: self.graphql_client.clone(),
2168            })
2169            .collect())
2170    }
2171    /// Require exactly one artifact; fail if there are zero or multiple matches. Several matches are listed, one address per line.
2172    pub fn one(&self) -> Artifact {
2173        let query = self.selection.select("one");
2174        Artifact {
2175            proc: self.proc.clone(),
2176            selection: query,
2177            graphql_client: self.graphql_client.clone(),
2178        }
2179    }
2180    /// The DAG address that selects this whole selection: filterUri(uri) selects the same set.
2181    pub async fn uri(&self) -> Result<String, DaggerError> {
2182        let query = self.selection.select("uri");
2183        query.execute(self.graphql_client.clone()).await
2184    }
2185}
2186impl Node for Artifacts {
2187    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2188        let query = self.selection.select("id");
2189        let graphql_client = self.graphql_client.clone();
2190        async move { query.execute(graphql_client).await }
2191    }
2192}
2193#[derive(Clone)]
2194pub struct CacheVolume {
2195    pub proc: Option<Arc<DaggerSessionProc>>,
2196    pub selection: Selection,
2197    pub graphql_client: DynGraphQLClient,
2198}
2199impl IntoID<Id> for CacheVolume {
2200    fn into_id(
2201        self,
2202    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2203        Box::pin(async move { self.id().await })
2204    }
2205}
2206impl Loadable for CacheVolume {
2207    fn graphql_type() -> &'static str {
2208        "CacheVolume"
2209    }
2210    fn from_query(
2211        proc: Option<Arc<DaggerSessionProc>>,
2212        selection: Selection,
2213        graphql_client: DynGraphQLClient,
2214    ) -> Self {
2215        Self {
2216            proc,
2217            selection,
2218            graphql_client,
2219        }
2220    }
2221}
2222impl CacheVolume {
2223    /// A unique identifier for this CacheVolume.
2224    pub async fn id(&self) -> Result<Id, DaggerError> {
2225        let query = self.selection.select("id");
2226        query.execute(self.graphql_client.clone()).await
2227    }
2228}
2229impl Node for CacheVolume {
2230    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2231        let query = self.selection.select("id");
2232        let graphql_client = self.graphql_client.clone();
2233        async move { query.execute(graphql_client).await }
2234    }
2235}
2236#[derive(Clone)]
2237pub struct Changeset {
2238    pub proc: Option<Arc<DaggerSessionProc>>,
2239    pub selection: Selection,
2240    pub graphql_client: DynGraphQLClient,
2241}
2242#[derive(Builder, Debug, PartialEq)]
2243pub struct ChangesetFilterOpts<'a> {
2244    /// Exclude changes at paths matching these patterns.
2245    #[builder(setter(into, strip_option), default)]
2246    pub exclude: Option<Vec<&'a str>>,
2247    /// Only include changes at paths matching these patterns. Empty includes all paths.
2248    #[builder(setter(into, strip_option), default)]
2249    pub include: Option<Vec<&'a str>>,
2250}
2251#[derive(Builder, Debug, PartialEq)]
2252pub struct ChangesetWithChangesetOpts {
2253    /// What to do on a merge conflict
2254    #[builder(setter(into, strip_option), default)]
2255    pub on_conflict: Option<ChangesetMergeConflict>,
2256}
2257#[derive(Builder, Debug, PartialEq)]
2258pub struct ChangesetWithChangesetsOpts {
2259    /// What to do on a merge conflict
2260    #[builder(setter(into, strip_option), default)]
2261    pub on_conflict: Option<ChangesetsMergeConflict>,
2262}
2263impl IntoID<Id> for Changeset {
2264    fn into_id(
2265        self,
2266    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2267        Box::pin(async move { self.id().await })
2268    }
2269}
2270impl Loadable for Changeset {
2271    fn graphql_type() -> &'static str {
2272        "Changeset"
2273    }
2274    fn from_query(
2275        proc: Option<Arc<DaggerSessionProc>>,
2276        selection: Selection,
2277        graphql_client: DynGraphQLClient,
2278    ) -> Self {
2279        Self {
2280            proc,
2281            selection,
2282            graphql_client,
2283        }
2284    }
2285}
2286impl Changeset {
2287    /// A unique identifier for this Changeset.
2288    pub async fn id(&self) -> Result<Id, DaggerError> {
2289        let query = self.selection.select("id");
2290        query.execute(self.graphql_client.clone()).await
2291    }
2292    /// Force evaluation in the engine.
2293    pub async fn sync(&self) -> Result<Changeset, DaggerError> {
2294        let query = self.selection.select("sync");
2295        let id: Id = query.execute(self.graphql_client.clone()).await?;
2296        Ok(Changeset {
2297            proc: self.proc.clone(),
2298            selection: query
2299                .root()
2300                .select("node")
2301                .arg("id", &id.0)
2302                .inline_fragment("Changeset"),
2303            graphql_client: self.graphql_client.clone(),
2304        })
2305    }
2306    /// Select changes matching the supplied glob patterns, preserving their original baseline.
2307    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
2308    ///
2309    /// # Arguments
2310    ///
2311    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2312    pub fn filter(&self) -> Changeset {
2313        let query = self.selection.select("filter");
2314        Changeset {
2315            proc: self.proc.clone(),
2316            selection: query,
2317            graphql_client: self.graphql_client.clone(),
2318        }
2319    }
2320    /// Select changes matching the supplied glob patterns, preserving their original baseline.
2321    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
2322    ///
2323    /// # Arguments
2324    ///
2325    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2326    pub fn filter_opts<'a>(&self, opts: ChangesetFilterOpts<'a>) -> Changeset {
2327        let mut query = self.selection.select("filter");
2328        if let Some(include) = opts.include {
2329            query = query.arg("include", include);
2330        }
2331        if let Some(exclude) = opts.exclude {
2332            query = query.arg("exclude", exclude);
2333        }
2334        Changeset {
2335            proc: self.proc.clone(),
2336            selection: query,
2337            graphql_client: self.graphql_client.clone(),
2338        }
2339    }
2340    /// Return a snapshot containing only the created and modified files
2341    pub fn layer(&self) -> Directory {
2342        let query = self.selection.select("layer");
2343        Directory {
2344            proc: self.proc.clone(),
2345            selection: query,
2346            graphql_client: self.graphql_client.clone(),
2347        }
2348    }
2349    /// Return a Git-compatible patch of the changes
2350    pub fn as_patch(&self) -> File {
2351        let query = self.selection.select("asPatch");
2352        File {
2353            proc: self.proc.clone(),
2354            selection: query,
2355            graphql_client: self.graphql_client.clone(),
2356        }
2357    }
2358    /// Applies the diff represented by this changeset to a path on the host.
2359    ///
2360    /// # Arguments
2361    ///
2362    /// * `path` - Location of the copied directory (e.g., "logs/").
2363    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2364        let mut query = self.selection.select("export");
2365        query = query.arg("path", path.into());
2366        query.execute(self.graphql_client.clone()).await
2367    }
2368    /// Returns true if the changeset is empty (i.e. there are no changes).
2369    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2370        let query = self.selection.select("isEmpty");
2371        query.execute(self.graphql_client.clone()).await
2372    }
2373    /// Files and directories that were added in the newer directory.
2374    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2375        let query = self.selection.select("addedPaths");
2376        query.execute(self.graphql_client.clone()).await
2377    }
2378    /// Files and directories that existed before and were updated in the newer directory.
2379    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2380        let query = self.selection.select("modifiedPaths");
2381        query.execute(self.graphql_client.clone()).await
2382    }
2383    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2384    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2385        let query = self.selection.select("removedPaths");
2386        query.execute(self.graphql_client.clone()).await
2387    }
2388    /// Structured per-path diff statistics (kind and line counts) for this changeset.
2389    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
2390        let query = self.selection.select("diffStats");
2391        let query = query.select("id");
2392        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2393        Ok(ids
2394            .into_iter()
2395            .map(|id| DiffStat {
2396                proc: self.proc.clone(),
2397                selection: crate::querybuilder::query()
2398                    .select("node")
2399                    .arg("id", &id.0)
2400                    .inline_fragment("DiffStat"),
2401                graphql_client: self.graphql_client.clone(),
2402            })
2403            .collect())
2404    }
2405    /// Add changes to an existing changeset
2406    /// 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
2407    ///
2408    /// # Arguments
2409    ///
2410    /// * `changes` - Changes to merge into the actual changeset
2411    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2412    pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
2413        let mut query = self.selection.select("withChangeset");
2414        query = query.arg_lazy(
2415            "changes",
2416            Box::new(move || {
2417                let changes = changes.clone();
2418                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2419            }),
2420        );
2421        Changeset {
2422            proc: self.proc.clone(),
2423            selection: query,
2424            graphql_client: self.graphql_client.clone(),
2425        }
2426    }
2427    /// Add changes to an existing changeset
2428    /// 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
2429    ///
2430    /// # Arguments
2431    ///
2432    /// * `changes` - Changes to merge into the actual changeset
2433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2434    pub fn with_changeset_opts(
2435        &self,
2436        changes: impl IntoID<Id>,
2437        opts: ChangesetWithChangesetOpts,
2438    ) -> Changeset {
2439        let mut query = self.selection.select("withChangeset");
2440        query = query.arg_lazy(
2441            "changes",
2442            Box::new(move || {
2443                let changes = changes.clone();
2444                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2445            }),
2446        );
2447        if let Some(on_conflict) = opts.on_conflict {
2448            query = query.arg("onConflict", on_conflict);
2449        }
2450        Changeset {
2451            proc: self.proc.clone(),
2452            selection: query,
2453            graphql_client: self.graphql_client.clone(),
2454        }
2455    }
2456    /// Add changes from multiple changesets using git octopus merge strategy
2457    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2458    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2459    ///
2460    /// # Arguments
2461    ///
2462    /// * `changes` - List of changesets to merge into the actual changeset
2463    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2464    pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
2465        let mut query = self.selection.select("withChangesets");
2466        query = query.arg("changes", changes);
2467        Changeset {
2468            proc: self.proc.clone(),
2469            selection: query,
2470            graphql_client: self.graphql_client.clone(),
2471        }
2472    }
2473    /// Add changes from multiple changesets using git octopus merge strategy
2474    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2475    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2476    ///
2477    /// # Arguments
2478    ///
2479    /// * `changes` - List of changesets to merge into the actual changeset
2480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2481    pub fn with_changesets_opts(
2482        &self,
2483        changes: Vec<Id>,
2484        opts: ChangesetWithChangesetsOpts,
2485    ) -> Changeset {
2486        let mut query = self.selection.select("withChangesets");
2487        query = query.arg("changes", changes);
2488        if let Some(on_conflict) = opts.on_conflict {
2489            query = query.arg("onConflict", on_conflict);
2490        }
2491        Changeset {
2492            proc: self.proc.clone(),
2493            selection: query,
2494            graphql_client: self.graphql_client.clone(),
2495        }
2496    }
2497    /// The older/lower snapshot to compare against.
2498    pub fn before(&self) -> Directory {
2499        let query = self.selection.select("before");
2500        Directory {
2501            proc: self.proc.clone(),
2502            selection: query,
2503            graphql_client: self.graphql_client.clone(),
2504        }
2505    }
2506    /// The newer/upper snapshot.
2507    pub fn after(&self) -> Directory {
2508        let query = self.selection.select("after");
2509        Directory {
2510            proc: self.proc.clone(),
2511            selection: query,
2512            graphql_client: self.graphql_client.clone(),
2513        }
2514    }
2515}
2516impl Exportable for Changeset {
2517    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2518        let query = self.selection.select("id");
2519        let graphql_client = self.graphql_client.clone();
2520        async move { query.execute(graphql_client).await }
2521    }
2522    fn export(
2523        &self,
2524        path: impl Into<String>,
2525    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
2526        let mut query = self.selection.select("export");
2527        query = query.arg("path", path.into());
2528        let graphql_client = self.graphql_client.clone();
2529        async move { query.execute(graphql_client).await }
2530    }
2531}
2532impl Node for Changeset {
2533    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2534        let query = self.selection.select("id");
2535        let graphql_client = self.graphql_client.clone();
2536        async move { query.execute(graphql_client).await }
2537    }
2538}
2539impl Syncer for Changeset {
2540    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2541        let query = self.selection.select("id");
2542        let graphql_client = self.graphql_client.clone();
2543        async move { query.execute(graphql_client).await }
2544    }
2545    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
2546        let query = self.selection.select("sync");
2547        let proc = self.proc.clone();
2548        let graphql_client = self.graphql_client.clone();
2549        async move {
2550            let id: Id = query.execute(graphql_client.clone()).await?;
2551            Ok(Self {
2552                proc,
2553                selection: query
2554                    .root()
2555                    .select("node")
2556                    .arg("id", &id.0)
2557                    .inline_fragment("Changeset"),
2558                graphql_client,
2559            })
2560        }
2561    }
2562}
2563#[derive(Clone)]
2564pub struct Check {
2565    pub proc: Option<Arc<DaggerSessionProc>>,
2566    pub selection: Selection,
2567    pub graphql_client: DynGraphQLClient,
2568}
2569impl IntoID<Id> for Check {
2570    fn into_id(
2571        self,
2572    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2573        Box::pin(async move { self.id().await })
2574    }
2575}
2576impl Loadable for Check {
2577    fn graphql_type() -> &'static str {
2578        "Check"
2579    }
2580    fn from_query(
2581        proc: Option<Arc<DaggerSessionProc>>,
2582        selection: Selection,
2583        graphql_client: DynGraphQLClient,
2584    ) -> Self {
2585        Self {
2586            proc,
2587            selection,
2588            graphql_client,
2589        }
2590    }
2591}
2592impl Check {
2593    /// A unique identifier for this Check.
2594    pub async fn id(&self) -> Result<Id, DaggerError> {
2595        let query = self.selection.select("id");
2596        query.execute(self.graphql_client.clone()).await
2597    }
2598    /// Run the check and retain its result.
2599    pub fn sync(&self) -> Check {
2600        let query = self.selection.select("sync");
2601        Check {
2602            proc: self.proc.clone(),
2603            selection: query,
2604            graphql_client: self.graphql_client.clone(),
2605        }
2606    }
2607    /// Run the check and return whether it passes.
2608    pub async fn pass(&self) -> Result<bool, DaggerError> {
2609        let query = self.selection.select("pass");
2610        query.execute(self.graphql_client.clone()).await
2611    }
2612    /// Run the check and return its failure, if any.
2613    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
2614        let query = self.selection.select("error");
2615        let query = query.select("id");
2616        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2617        Ok(id.map(|id| Error {
2618            proc: self.proc.clone(),
2619            selection: query
2620                .root()
2621                .select("node")
2622                .arg("id", &id.0)
2623                .inline_fragment("Error"),
2624            graphql_client: self.graphql_client.clone(),
2625        }))
2626    }
2627    /// The assertion that is false when this check fails.
2628    pub async fn assertion(&self) -> Result<String, DaggerError> {
2629        let query = self.selection.select("assertion");
2630        query.execute(self.graphql_client.clone()).await
2631    }
2632    /// An optional report produced by the check.
2633    pub async fn report(&self) -> Result<Option<Directory>, DaggerError> {
2634        let query = self.selection.select("report");
2635        let query = query.select("id");
2636        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2637        Ok(id.map(|id| Directory {
2638            proc: self.proc.clone(),
2639            selection: query
2640                .root()
2641                .select("node")
2642                .arg("id", &id.0)
2643                .inline_fragment("Directory"),
2644            graphql_client: self.graphql_client.clone(),
2645        }))
2646    }
2647}
2648impl Node for Check {
2649    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2650        let query = self.selection.select("id");
2651        let graphql_client = self.graphql_client.clone();
2652        async move { query.execute(graphql_client).await }
2653    }
2654}
2655#[derive(Clone)]
2656pub struct ClientFilesyncMirror {
2657    pub proc: Option<Arc<DaggerSessionProc>>,
2658    pub selection: Selection,
2659    pub graphql_client: DynGraphQLClient,
2660}
2661impl IntoID<Id> for ClientFilesyncMirror {
2662    fn into_id(
2663        self,
2664    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2665        Box::pin(async move { self.id().await })
2666    }
2667}
2668impl Loadable for ClientFilesyncMirror {
2669    fn graphql_type() -> &'static str {
2670        "ClientFilesyncMirror"
2671    }
2672    fn from_query(
2673        proc: Option<Arc<DaggerSessionProc>>,
2674        selection: Selection,
2675        graphql_client: DynGraphQLClient,
2676    ) -> Self {
2677        Self {
2678            proc,
2679            selection,
2680            graphql_client,
2681        }
2682    }
2683}
2684impl ClientFilesyncMirror {
2685    /// A unique identifier for this ClientFilesyncMirror.
2686    pub async fn id(&self) -> Result<Id, DaggerError> {
2687        let query = self.selection.select("id");
2688        query.execute(self.graphql_client.clone()).await
2689    }
2690}
2691impl Node for ClientFilesyncMirror {
2692    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2693        let query = self.selection.select("id");
2694        let graphql_client = self.graphql_client.clone();
2695        async move { query.execute(graphql_client).await }
2696    }
2697}
2698#[derive(Clone)]
2699pub struct Cloud {
2700    pub proc: Option<Arc<DaggerSessionProc>>,
2701    pub selection: Selection,
2702    pub graphql_client: DynGraphQLClient,
2703}
2704impl IntoID<Id> for Cloud {
2705    fn into_id(
2706        self,
2707    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2708        Box::pin(async move { self.id().await })
2709    }
2710}
2711impl Loadable for Cloud {
2712    fn graphql_type() -> &'static str {
2713        "Cloud"
2714    }
2715    fn from_query(
2716        proc: Option<Arc<DaggerSessionProc>>,
2717        selection: Selection,
2718        graphql_client: DynGraphQLClient,
2719    ) -> Self {
2720        Self {
2721            proc,
2722            selection,
2723            graphql_client,
2724        }
2725    }
2726}
2727impl Cloud {
2728    /// A unique identifier for this Cloud.
2729    pub async fn id(&self) -> Result<Id, DaggerError> {
2730        let query = self.selection.select("id");
2731        query.execute(self.graphql_client.clone()).await
2732    }
2733    /// The trace URL for the current session
2734    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2735        let query = self.selection.select("traceURL");
2736        query.execute(self.graphql_client.clone()).await
2737    }
2738}
2739impl Node for Cloud {
2740    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2741        let query = self.selection.select("id");
2742        let graphql_client = self.graphql_client.clone();
2743        async move { query.execute(graphql_client).await }
2744    }
2745}
2746#[derive(Clone)]
2747pub struct CollectionDelta {
2748    pub proc: Option<Arc<DaggerSessionProc>>,
2749    pub selection: Selection,
2750    pub graphql_client: DynGraphQLClient,
2751}
2752impl IntoID<Id> for CollectionDelta {
2753    fn into_id(
2754        self,
2755    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2756        Box::pin(async move { self.id().await })
2757    }
2758}
2759impl Loadable for CollectionDelta {
2760    fn graphql_type() -> &'static str {
2761        "CollectionDelta"
2762    }
2763    fn from_query(
2764        proc: Option<Arc<DaggerSessionProc>>,
2765        selection: Selection,
2766        graphql_client: DynGraphQLClient,
2767    ) -> Self {
2768        Self {
2769            proc,
2770            selection,
2771            graphql_client,
2772        }
2773    }
2774}
2775impl CollectionDelta {
2776    /// A unique identifier for this CollectionDelta.
2777    pub async fn id(&self) -> Result<Id, DaggerError> {
2778        let query = self.selection.select("id");
2779        query.execute(self.graphql_client.clone()).await
2780    }
2781    /// Current keys absent from the original collection, in current order.
2782    pub async fn added_keys(&self) -> Result<Vec<String>, DaggerError> {
2783        let query = self.selection.select("addedKeys");
2784        query.execute(self.graphql_client.clone()).await
2785    }
2786    /// Original keys absent from the current collection, in original order.
2787    pub async fn removed_keys(&self) -> Result<Vec<String>, DaggerError> {
2788        let query = self.selection.select("removedKeys");
2789        query.execute(self.graphql_client.clone()).await
2790    }
2791}
2792impl Node for CollectionDelta {
2793    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2794        let query = self.selection.select("id");
2795        let graphql_client = self.graphql_client.clone();
2796        async move { query.execute(graphql_client).await }
2797    }
2798}
2799#[derive(Clone)]
2800pub struct CollectionTypeDef {
2801    pub proc: Option<Arc<DaggerSessionProc>>,
2802    pub selection: Selection,
2803    pub graphql_client: DynGraphQLClient,
2804}
2805impl IntoID<Id> for CollectionTypeDef {
2806    fn into_id(
2807        self,
2808    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2809        Box::pin(async move { self.id().await })
2810    }
2811}
2812impl Loadable for CollectionTypeDef {
2813    fn graphql_type() -> &'static str {
2814        "CollectionTypeDef"
2815    }
2816    fn from_query(
2817        proc: Option<Arc<DaggerSessionProc>>,
2818        selection: Selection,
2819        graphql_client: DynGraphQLClient,
2820    ) -> Self {
2821        Self {
2822            proc,
2823            selection,
2824            graphql_client,
2825        }
2826    }
2827}
2828impl CollectionTypeDef {
2829    /// A unique identifier for this CollectionTypeDef.
2830    pub async fn id(&self) -> Result<Id, DaggerError> {
2831        let query = self.selection.select("id");
2832        query.execute(self.graphql_client.clone()).await
2833    }
2834    /// The type of collection keys.
2835    pub fn key_type(&self) -> TypeDef {
2836        let query = self.selection.select("keyType");
2837        TypeDef {
2838            proc: self.proc.clone(),
2839            selection: query,
2840            graphql_client: self.graphql_client.clone(),
2841        }
2842    }
2843    /// The object type returned by get.
2844    pub fn value_type(&self) -> TypeDef {
2845        let query = self.selection.select("valueType");
2846        TypeDef {
2847            proc: self.proc.clone(),
2848            selection: query,
2849            graphql_client: self.graphql_client.clone(),
2850        }
2851    }
2852    /// The type of batch operations, or null when there are none.
2853    pub async fn batch_type(&self) -> Result<Option<TypeDef>, DaggerError> {
2854        let query = self.selection.select("batchType");
2855        let query = query.select("id");
2856        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2857        Ok(id.map(|id| TypeDef {
2858            proc: self.proc.clone(),
2859            selection: query
2860                .root()
2861                .select("node")
2862                .arg("id", &id.0)
2863                .inline_fragment("TypeDef"),
2864            graphql_client: self.graphql_client.clone(),
2865        }))
2866    }
2867}
2868impl Node for CollectionTypeDef {
2869    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2870        let query = self.selection.select("id");
2871        let graphql_client = self.graphql_client.clone();
2872        async move { query.execute(graphql_client).await }
2873    }
2874}
2875#[derive(Clone)]
2876pub struct Command {
2877    pub proc: Option<Arc<DaggerSessionProc>>,
2878    pub selection: Selection,
2879    pub graphql_client: DynGraphQLClient,
2880}
2881impl IntoID<Id> for Command {
2882    fn into_id(
2883        self,
2884    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2885        Box::pin(async move { self.id().await })
2886    }
2887}
2888impl Loadable for Command {
2889    fn graphql_type() -> &'static str {
2890        "Command"
2891    }
2892    fn from_query(
2893        proc: Option<Arc<DaggerSessionProc>>,
2894        selection: Selection,
2895        graphql_client: DynGraphQLClient,
2896    ) -> Self {
2897        Self {
2898            proc,
2899            selection,
2900            graphql_client,
2901        }
2902    }
2903}
2904impl Command {
2905    /// A unique identifier for this Command.
2906    pub async fn id(&self) -> Result<Id, DaggerError> {
2907        let query = self.selection.select("id");
2908        query.execute(self.graphql_client.clone()).await
2909    }
2910    /// The command arguments.
2911    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
2912        let query = self.selection.select("args");
2913        query.execute(self.graphql_client.clone()).await
2914    }
2915    /// Environment variable overrides. Other variables come from the container.
2916    pub async fn env(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2917        let query = self.selection.select("env");
2918        let query = query.select("id");
2919        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2920        Ok(ids
2921            .into_iter()
2922            .map(|id| EnvVariable {
2923                proc: self.proc.clone(),
2924                selection: crate::querybuilder::query()
2925                    .select("node")
2926                    .arg("id", &id.0)
2927                    .inline_fragment("EnvVariable"),
2928                graphql_client: self.graphql_client.clone(),
2929            })
2930            .collect())
2931    }
2932    /// Working directory override. If unset, use the container's working directory.
2933    pub async fn workdir(&self) -> Result<String, DaggerError> {
2934        let query = self.selection.select("workdir");
2935        query.execute(self.graphql_client.clone()).await
2936    }
2937    /// Whether the command has access to Dagger.
2938    pub async fn privileged_nesting(&self) -> Result<bool, DaggerError> {
2939        let query = self.selection.select("privilegedNesting");
2940        query.execute(self.graphql_client.clone()).await
2941    }
2942    /// Whether the command has all root capabilities.
2943    pub async fn insecure_root_capabilities(&self) -> Result<bool, DaggerError> {
2944        let query = self.selection.select("insecureRootCapabilities");
2945        query.execute(self.graphql_client.clone()).await
2946    }
2947}
2948impl Node for Command {
2949    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2950        let query = self.selection.select("id");
2951        let graphql_client = self.graphql_client.clone();
2952        async move { query.execute(graphql_client).await }
2953    }
2954}
2955#[derive(Clone)]
2956pub struct Container {
2957    pub proc: Option<Arc<DaggerSessionProc>>,
2958    pub selection: Selection,
2959    pub graphql_client: DynGraphQLClient,
2960}
2961#[derive(Builder, Debug, PartialEq)]
2962pub struct ContainerFromOpts<'a> {
2963    /// Allow HTTPS registry communication without verifying the server certificate.
2964    #[builder(setter(into, strip_option), default)]
2965    pub insecure_skip_tls_verify: Option<bool>,
2966    /// Ignore the workspace lockfile for this lookup.
2967    #[builder(setter(into, strip_option), default)]
2968    pub no_lock: Option<bool>,
2969    /// Protocol to use for registry communication.
2970    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
2971    #[builder(setter(into, strip_option), default)]
2972    pub protocol: Option<RegistryProtocol>,
2973    /// Service to use as the registry endpoint for the image address.
2974    /// The service will be started only for this pull.
2975    #[builder(setter(into, strip_option), default)]
2976    pub registry_service: Option<Id>,
2977    /// Version query used to select an image tag. The address must not contain a tag or digest.
2978    #[builder(setter(into, strip_option), default)]
2979    pub version: Option<&'a str>,
2980}
2981#[derive(Builder, Debug, PartialEq)]
2982pub struct ContainerDirectoryOpts {
2983    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2984    #[builder(setter(into, strip_option), default)]
2985    pub expand: Option<bool>,
2986}
2987#[derive(Builder, Debug, PartialEq)]
2988pub struct ContainerFileOpts {
2989    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2990    #[builder(setter(into, strip_option), default)]
2991    pub expand: Option<bool>,
2992}
2993#[derive(Builder, Debug, PartialEq)]
2994pub struct ContainerWithWorkdirOpts {
2995    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2996    #[builder(setter(into, strip_option), default)]
2997    pub expand: Option<bool>,
2998}
2999#[derive(Builder, Debug, PartialEq)]
3000pub struct ContainerWithEnvVariableOpts {
3001    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
3002    #[builder(setter(into, strip_option), default)]
3003    pub expand: Option<bool>,
3004}
3005#[derive(Builder, Debug, PartialEq)]
3006pub struct ContainerWithDockerHealthcheckOpts<'a> {
3007    /// Interval between running healthcheck. Example: "30s"
3008    #[builder(setter(into, strip_option), default)]
3009    pub interval: Option<&'a str>,
3010    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
3011    #[builder(setter(into, strip_option), default)]
3012    pub retries: Option<isize>,
3013    /// When true, command must be a single element, which is run using the container's shell
3014    #[builder(setter(into, strip_option), default)]
3015    pub shell: Option<bool>,
3016    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
3017    #[builder(setter(into, strip_option), default)]
3018    pub start_interval: Option<&'a str>,
3019    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
3020    #[builder(setter(into, strip_option), default)]
3021    pub start_period: Option<&'a str>,
3022    /// Healthcheck timeout. Example: "3s"
3023    #[builder(setter(into, strip_option), default)]
3024    pub timeout: Option<&'a str>,
3025}
3026#[derive(Builder, Debug, PartialEq)]
3027pub struct ContainerWithEntrypointOpts {
3028    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
3029    #[builder(setter(into, strip_option), default)]
3030    pub keep_default_args: Option<bool>,
3031}
3032#[derive(Builder, Debug, PartialEq)]
3033pub struct ContainerWithoutEntrypointOpts {
3034    /// Don't remove the default arguments when unsetting the entrypoint.
3035    #[builder(setter(into, strip_option), default)]
3036    pub keep_default_args: Option<bool>,
3037}
3038#[derive(Builder, Debug, PartialEq)]
3039pub struct ContainerWithMountedDirectoryOpts<'a> {
3040    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3041    #[builder(setter(into, strip_option), default)]
3042    pub expand: Option<bool>,
3043    /// Set the owner to the container's current user.
3044    #[builder(setter(into, strip_option), default)]
3045    pub inherit_owner: Option<bool>,
3046    /// A user:group to set for the mounted directory and its contents.
3047    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3048    /// If the group is omitted, it defaults to the same as the user.
3049    #[builder(setter(into, strip_option), default)]
3050    pub owner: Option<&'a str>,
3051    /// Mount the directory read-only.
3052    #[builder(setter(into, strip_option), default)]
3053    pub read_only: Option<bool>,
3054}
3055#[derive(Builder, Debug, PartialEq)]
3056pub struct ContainerWithMountedFileOpts<'a> {
3057    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3058    #[builder(setter(into, strip_option), default)]
3059    pub expand: Option<bool>,
3060    /// Set the owner to the container's current user.
3061    #[builder(setter(into, strip_option), default)]
3062    pub inherit_owner: Option<bool>,
3063    /// A user or user:group to set for the mounted file.
3064    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3065    /// If the group is omitted, it defaults to the same as the user.
3066    #[builder(setter(into, strip_option), default)]
3067    pub owner: Option<&'a str>,
3068    /// Mount the file read-only.
3069    #[builder(setter(into, strip_option), default)]
3070    pub read_only: Option<bool>,
3071}
3072#[derive(Builder, Debug, PartialEq)]
3073pub struct ContainerWithMountedTempOpts {
3074    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3075    #[builder(setter(into, strip_option), default)]
3076    pub expand: Option<bool>,
3077    /// Size of the temporary directory in bytes.
3078    #[builder(setter(into, strip_option), default)]
3079    pub size: Option<isize>,
3080}
3081#[derive(Builder, Debug, PartialEq)]
3082pub struct ContainerWithMountedCacheOpts<'a> {
3083    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3084    #[builder(setter(into, strip_option), default)]
3085    pub expand: Option<bool>,
3086    /// Set the owner to the container's current user.
3087    #[builder(setter(into, strip_option), default)]
3088    pub inherit_owner: Option<bool>,
3089    /// A user:group to set for the mounted cache directory.
3090    /// 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.
3091    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3092    /// If the group is omitted, it defaults to the same as the user.
3093    #[builder(setter(into, strip_option), default)]
3094    pub owner: Option<&'a str>,
3095    /// Sharing mode of the cache volume.
3096    #[builder(setter(into, strip_option), default)]
3097    pub sharing: Option<CacheSharingMode>,
3098    /// Identifier of the directory to use as the cache volume's root.
3099    #[builder(setter(into, strip_option), default)]
3100    pub source: Option<Id>,
3101}
3102#[derive(Builder, Debug, PartialEq)]
3103pub struct ContainerWithMountedVolumeOpts {
3104    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3105    #[builder(setter(into, strip_option), default)]
3106    pub expand: Option<bool>,
3107    /// Mount the volume read-only.
3108    #[builder(setter(into, strip_option), default)]
3109    pub read_only: Option<bool>,
3110}
3111#[derive(Builder, Debug, PartialEq)]
3112pub struct ContainerWithMountedSecretOpts<'a> {
3113    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3114    #[builder(setter(into, strip_option), default)]
3115    pub expand: Option<bool>,
3116    /// Set the owner to the container's current user.
3117    #[builder(setter(into, strip_option), default)]
3118    pub inherit_owner: Option<bool>,
3119    /// Permission given to the mounted secret (e.g., 0600).
3120    /// This option requires an owner to be set to be active.
3121    #[builder(setter(into, strip_option), default)]
3122    pub mode: Option<isize>,
3123    /// A user:group to set for the mounted secret.
3124    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3125    /// If the group is omitted, it defaults to the same as the user.
3126    #[builder(setter(into, strip_option), default)]
3127    pub owner: Option<&'a str>,
3128}
3129#[derive(Builder, Debug, PartialEq)]
3130pub struct ContainerWithUnixSocketOpts<'a> {
3131    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3132    #[builder(setter(into, strip_option), default)]
3133    pub expand: Option<bool>,
3134    /// Set the owner to the container's current user.
3135    #[builder(setter(into, strip_option), default)]
3136    pub inherit_owner: Option<bool>,
3137    /// A user:group to set for the mounted socket.
3138    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3139    /// If the group is omitted, it defaults to the same as the user.
3140    #[builder(setter(into, strip_option), default)]
3141    pub owner: Option<&'a str>,
3142}
3143#[derive(Builder, Debug, PartialEq)]
3144pub struct ContainerWithoutUnixSocketOpts {
3145    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3146    #[builder(setter(into, strip_option), default)]
3147    pub expand: Option<bool>,
3148}
3149#[derive(Builder, Debug, PartialEq)]
3150pub struct ContainerWithoutMountOpts {
3151    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3152    #[builder(setter(into, strip_option), default)]
3153    pub expand: Option<bool>,
3154}
3155#[derive(Builder, Debug, PartialEq)]
3156pub struct ContainerWithFileOpts<'a> {
3157    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3158    #[builder(setter(into, strip_option), default)]
3159    pub expand: Option<bool>,
3160    /// Set the owner to the container's current user.
3161    #[builder(setter(into, strip_option), default)]
3162    pub inherit_owner: Option<bool>,
3163    /// A user:group to set for the file.
3164    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3165    /// If the group is omitted, it defaults to the same as the user.
3166    #[builder(setter(into, strip_option), default)]
3167    pub owner: Option<&'a str>,
3168    /// Permissions of the new file. Example: 0600
3169    #[builder(setter(into, strip_option), default)]
3170    pub permissions: Option<isize>,
3171}
3172#[derive(Builder, Debug, PartialEq)]
3173pub struct ContainerWithoutFileOpts {
3174    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3175    #[builder(setter(into, strip_option), default)]
3176    pub expand: Option<bool>,
3177}
3178#[derive(Builder, Debug, PartialEq)]
3179pub struct ContainerWithoutFilesOpts {
3180    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3181    #[builder(setter(into, strip_option), default)]
3182    pub expand: Option<bool>,
3183}
3184#[derive(Builder, Debug, PartialEq)]
3185pub struct ContainerWithFilesOpts<'a> {
3186    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3187    #[builder(setter(into, strip_option), default)]
3188    pub expand: Option<bool>,
3189    /// Set the owner to the container's current user.
3190    #[builder(setter(into, strip_option), default)]
3191    pub inherit_owner: Option<bool>,
3192    /// A user:group to set for the files.
3193    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3194    /// If the group is omitted, it defaults to the same as the user.
3195    #[builder(setter(into, strip_option), default)]
3196    pub owner: Option<&'a str>,
3197    /// Permission given to the copied files (e.g., 0600).
3198    #[builder(setter(into, strip_option), default)]
3199    pub permissions: Option<isize>,
3200}
3201#[derive(Builder, Debug, PartialEq)]
3202pub struct ContainerWithNewFileOpts<'a> {
3203    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3204    #[builder(setter(into, strip_option), default)]
3205    pub expand: Option<bool>,
3206    /// Set the owner to the container's current user.
3207    #[builder(setter(into, strip_option), default)]
3208    pub inherit_owner: Option<bool>,
3209    /// A user:group to set for the file.
3210    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3211    /// If the group is omitted, it defaults to the same as the user.
3212    #[builder(setter(into, strip_option), default)]
3213    pub owner: Option<&'a str>,
3214    /// Permissions of the new file. Example: 0600
3215    #[builder(setter(into, strip_option), default)]
3216    pub permissions: Option<isize>,
3217}
3218#[derive(Builder, Debug, PartialEq)]
3219pub struct ContainerWithDirectoryOpts<'a> {
3220    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
3221    #[builder(setter(into, strip_option), default)]
3222    pub exclude: Option<Vec<&'a str>>,
3223    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3224    #[builder(setter(into, strip_option), default)]
3225    pub expand: Option<bool>,
3226    /// Apply .gitignore rules when writing the directory.
3227    #[builder(setter(into, strip_option), default)]
3228    pub gitignore: Option<bool>,
3229    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
3230    #[builder(setter(into, strip_option), default)]
3231    pub include: Option<Vec<&'a str>>,
3232    /// Set the owner to the container's current user.
3233    #[builder(setter(into, strip_option), default)]
3234    pub inherit_owner: Option<bool>,
3235    /// A user:group to set for the directory and its contents.
3236    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3237    /// If the group is omitted, it defaults to the same as the user.
3238    #[builder(setter(into, strip_option), default)]
3239    pub owner: Option<&'a str>,
3240    #[builder(setter(into, strip_option), default)]
3241    pub permissions: Option<isize>,
3242}
3243#[derive(Builder, Debug, PartialEq)]
3244pub struct ContainerWithoutDirectoryOpts {
3245    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3246    #[builder(setter(into, strip_option), default)]
3247    pub expand: Option<bool>,
3248}
3249#[derive(Builder, Debug, PartialEq)]
3250pub struct ContainerExistsOpts {
3251    /// If specified, do not follow symlinks.
3252    #[builder(setter(into, strip_option), default)]
3253    pub do_not_follow_symlinks: Option<bool>,
3254    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3255    #[builder(setter(into, strip_option), default)]
3256    pub expand: Option<bool>,
3257    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
3258    #[builder(setter(into, strip_option), default)]
3259    pub expected_type: Option<ExistsType>,
3260}
3261#[derive(Builder, Debug, PartialEq)]
3262pub struct ContainerStatOpts {
3263    /// If specified, do not follow symlinks.
3264    #[builder(setter(into, strip_option), default)]
3265    pub do_not_follow_symlinks: Option<bool>,
3266}
3267#[derive(Builder, Debug, PartialEq)]
3268pub struct ContainerWithExecOpts<'a> {
3269    /// Connect Dagger clients started by the command to the current engine as new sessions, instead of as clients of the current session. Each connection gets its own session, released when that client closes.
3270    /// The command reaches the engine through DAGGER_ENGINE, so SDKs run a Dagger CLI: set _EXPERIMENTAL_DAGGER_CLI_BIN to one in the container, or let the SDK download one.
3271    /// Cannot be combined with "disableDaggerInDagger".
3272    #[builder(setter(into, strip_option), default)]
3273    pub dagger_in_dagger_new_session: Option<bool>,
3274    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3275    #[builder(setter(into, strip_option), default)]
3276    pub disable_dagger_in_dagger: Option<bool>,
3277    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3278    #[builder(setter(into, strip_option), default)]
3279    pub expand: Option<bool>,
3280    /// Exit codes this command is allowed to exit with without error
3281    #[builder(setter(into, strip_option), default)]
3282    pub expect: Option<ReturnType>,
3283    #[builder(setter(into, strip_option), default)]
3284    pub experimental_privileged_nesting: Option<bool>,
3285    /// Execute the command with all root capabilities. Like --privileged in Docker
3286    /// 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.
3287    #[builder(setter(into, strip_option), default)]
3288    pub insecure_root_capabilities: Option<bool>,
3289    /// Skip the automatic init process injected into containers by default.
3290    /// 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.
3291    #[builder(setter(into, strip_option), default)]
3292    pub no_init: Option<bool>,
3293    /// Redirect the command's standard error to a file in the container. The redirected output is not logged. Example: "./stderr.txt"
3294    #[builder(setter(into, strip_option), default)]
3295    pub redirect_stderr: Option<&'a str>,
3296    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
3297    #[builder(setter(into, strip_option), default)]
3298    pub redirect_stdin: Option<&'a str>,
3299    /// Redirect the command's standard output to a file in the container. The redirected output is not logged. Example: "./stdout.txt"
3300    #[builder(setter(into, strip_option), default)]
3301    pub redirect_stdout: Option<&'a str>,
3302    /// Content to write to the command's standard input. Example: "Hello world")
3303    #[builder(setter(into, strip_option), default)]
3304    pub stdin: Option<&'a str>,
3305    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
3306    #[builder(setter(into, strip_option), default)]
3307    pub use_entrypoint: Option<bool>,
3308}
3309#[derive(Builder, Debug, PartialEq)]
3310pub struct ContainerWithSymlinkOpts {
3311    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3312    #[builder(setter(into, strip_option), default)]
3313    pub expand: Option<bool>,
3314}
3315#[derive(Builder, Debug, PartialEq)]
3316pub struct ContainerPublishOpts {
3317    /// Force each layer of the published image to use the specified compression algorithm.
3318    /// 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.
3319    #[builder(setter(into, strip_option), default)]
3320    pub forced_compression: Option<ImageLayerCompression>,
3321    /// Allow HTTPS registry communication without verifying the server certificate.
3322    #[builder(setter(into, strip_option), default)]
3323    pub insecure_skip_tls_verify: Option<bool>,
3324    /// Use the specified media types for the published image's layers.
3325    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
3326    #[builder(setter(into, strip_option), default)]
3327    pub media_types: Option<ImageMediaTypes>,
3328    /// Identifiers for other platform specific containers.
3329    /// Used for multi-platform image.
3330    #[builder(setter(into, strip_option), default)]
3331    pub platform_variants: Option<Vec<Id>>,
3332    /// Protocol to use for registry communication.
3333    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
3334    #[builder(setter(into, strip_option), default)]
3335    pub protocol: Option<RegistryProtocol>,
3336    /// Service to use as the registry endpoint for the image address.
3337    /// The service will be started only for this push.
3338    #[builder(setter(into, strip_option), default)]
3339    pub registry_service: Option<Id>,
3340}
3341#[derive(Builder, Debug, PartialEq)]
3342pub struct ContainerExportOpts {
3343    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3344    #[builder(setter(into, strip_option), default)]
3345    pub expand: Option<bool>,
3346    /// Force each layer of the exported image to use the specified compression algorithm.
3347    /// 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.
3348    #[builder(setter(into, strip_option), default)]
3349    pub forced_compression: Option<ImageLayerCompression>,
3350    /// Use the specified media types for the exported image's layers.
3351    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3352    #[builder(setter(into, strip_option), default)]
3353    pub media_types: Option<ImageMediaTypes>,
3354    /// Identifiers for other platform specific containers.
3355    /// Used for multi-platform image.
3356    #[builder(setter(into, strip_option), default)]
3357    pub platform_variants: Option<Vec<Id>>,
3358}
3359#[derive(Builder, Debug, PartialEq)]
3360pub struct ContainerExportImageOpts {
3361    /// Force each layer of the exported image to use the specified compression algorithm.
3362    /// 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.
3363    #[builder(setter(into, strip_option), default)]
3364    pub forced_compression: Option<ImageLayerCompression>,
3365    /// Use the specified media types for the exported image's layers.
3366    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3367    #[builder(setter(into, strip_option), default)]
3368    pub media_types: Option<ImageMediaTypes>,
3369    /// Identifiers for other platform specific containers.
3370    /// Used for multi-platform image.
3371    #[builder(setter(into, strip_option), default)]
3372    pub platform_variants: Option<Vec<Id>>,
3373}
3374#[derive(Builder, Debug, PartialEq)]
3375pub struct ContainerAsTarballOpts {
3376    /// Force each layer of the image to use the specified compression algorithm.
3377    /// 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.
3378    #[builder(setter(into, strip_option), default)]
3379    pub forced_compression: Option<ImageLayerCompression>,
3380    /// Use the specified media types for the image's layers.
3381    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3382    #[builder(setter(into, strip_option), default)]
3383    pub media_types: Option<ImageMediaTypes>,
3384    /// Identifiers for other platform specific containers.
3385    /// Used for multi-platform images.
3386    #[builder(setter(into, strip_option), default)]
3387    pub platform_variants: Option<Vec<Id>>,
3388}
3389#[derive(Builder, Debug, PartialEq)]
3390pub struct ContainerImportOpts<'a> {
3391    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
3392    #[builder(setter(into, strip_option), default)]
3393    pub tag: Option<&'a str>,
3394}
3395#[derive(Builder, Debug, PartialEq)]
3396pub struct ContainerManifestOpts {
3397    /// Force each layer of the image to use the specified compression algorithm.
3398    /// 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.
3399    #[builder(setter(into, strip_option), default)]
3400    pub forced_compression: Option<ImageLayerCompression>,
3401    /// Media types to use for image layers. Defaults to OCI.
3402    #[builder(setter(into, strip_option), default)]
3403    pub media_types: Option<ImageMediaTypes>,
3404}
3405#[derive(Builder, Debug, PartialEq)]
3406pub struct ContainerLayerOpts {
3407    /// Force each layer of the image to use the specified compression algorithm.
3408    /// 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.
3409    #[builder(setter(into, strip_option), default)]
3410    pub forced_compression: Option<ImageLayerCompression>,
3411    /// Media types to use for image layers. Defaults to OCI.
3412    #[builder(setter(into, strip_option), default)]
3413    pub media_types: Option<ImageMediaTypes>,
3414}
3415#[derive(Builder, Debug, PartialEq)]
3416pub struct ContainerWithExposedPortOpts<'a> {
3417    /// Port description. Example: "payment API endpoint"
3418    #[builder(setter(into, strip_option), default)]
3419    pub description: Option<&'a str>,
3420    /// Skip the health check when run as a service.
3421    #[builder(setter(into, strip_option), default)]
3422    pub experimental_skip_healthcheck: Option<bool>,
3423    /// Network protocol. Example: "tcp"
3424    #[builder(setter(into, strip_option), default)]
3425    pub protocol: Option<NetworkProtocol>,
3426}
3427#[derive(Builder, Debug, PartialEq)]
3428pub struct ContainerWithoutExposedPortOpts {
3429    /// Port protocol to unexpose
3430    #[builder(setter(into, strip_option), default)]
3431    pub protocol: Option<NetworkProtocol>,
3432}
3433#[derive(Builder, Debug, PartialEq)]
3434pub struct ContainerWithDefaultTerminalCmdOpts {
3435    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3436    #[builder(setter(into, strip_option), default)]
3437    pub disable_dagger_in_dagger: Option<bool>,
3438    #[builder(setter(into, strip_option), default)]
3439    pub experimental_privileged_nesting: Option<bool>,
3440    /// 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.
3441    #[builder(setter(into, strip_option), default)]
3442    pub insecure_root_capabilities: Option<bool>,
3443}
3444#[derive(Builder, Debug, PartialEq)]
3445pub struct ContainerWithShellOpts<'a> {
3446    /// Command arguments for batch use. The script is appended as one argument. Defaults to interactive followed by "-c".
3447    #[builder(setter(into, strip_option), default)]
3448    pub batch: Option<Vec<&'a str>>,
3449    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3450    #[builder(setter(into, strip_option), default)]
3451    pub disable_dagger_in_dagger: Option<bool>,
3452    #[builder(setter(into, strip_option), default)]
3453    pub experimental_privileged_nesting: Option<bool>,
3454    /// Give the shell all root capabilities. Use only with trusted commands.
3455    #[builder(setter(into, strip_option), default)]
3456    pub insecure_root_capabilities: Option<bool>,
3457}
3458#[derive(Builder, Debug, PartialEq)]
3459pub struct ContainerShellOpts {
3460    /// Return the batch command instead of the interactive command.
3461    #[builder(setter(into, strip_option), default)]
3462    pub batch: Option<bool>,
3463}
3464#[derive(Builder, Debug, PartialEq)]
3465pub struct ContainerWithRunOpts<'a> {
3466    /// Override whether the shell is denied Dagger API access. Omit to use the configured shell setting.
3467    #[builder(setter(into, strip_option), default)]
3468    pub disable_dagger_in_dagger: Option<bool>,
3469    #[builder(setter(into, strip_option), default)]
3470    pub experimental_privileged_nesting: Option<bool>,
3471    /// Override whether the shell has all root capabilities.
3472    #[builder(setter(into, strip_option), default)]
3473    pub insecure_root_capabilities: Option<bool>,
3474    /// Override the batch shell arguments. Example: ["bash", "-c"].
3475    #[builder(setter(into, strip_option), default)]
3476    pub shell: Option<Vec<&'a str>>,
3477}
3478#[derive(Builder, Debug, PartialEq)]
3479pub struct ContainerTerminalOpts<'a> {
3480    /// If set, override the container's default terminal command and invoke these command arguments instead.
3481    #[builder(setter(into, strip_option), default)]
3482    pub cmd: Option<Vec<&'a str>>,
3483    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3484    #[builder(setter(into, strip_option), default)]
3485    pub disable_dagger_in_dagger: Option<bool>,
3486    #[builder(setter(into, strip_option), default)]
3487    pub experimental_privileged_nesting: Option<bool>,
3488    /// 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.
3489    #[builder(setter(into, strip_option), default)]
3490    pub insecure_root_capabilities: Option<bool>,
3491}
3492#[derive(Builder, Debug, PartialEq)]
3493pub struct ContainerAsServiceOpts<'a> {
3494    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3495    /// If empty, the container's default command is used.
3496    #[builder(setter(into, strip_option), default)]
3497    pub args: Option<Vec<&'a str>>,
3498    /// Connect Dagger clients started by the command to the current engine as new sessions, instead of as clients of the current session. Each connection gets its own session, released when that client closes.
3499    /// The command reaches the engine through DAGGER_ENGINE, so SDKs run a Dagger CLI: set _EXPERIMENTAL_DAGGER_CLI_BIN to one in the container, or let the SDK download one.
3500    /// Cannot be combined with "disableDaggerInDagger".
3501    #[builder(setter(into, strip_option), default)]
3502    pub dagger_in_dagger_new_session: Option<bool>,
3503    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3504    #[builder(setter(into, strip_option), default)]
3505    pub disable_dagger_in_dagger: Option<bool>,
3506    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3507    #[builder(setter(into, strip_option), default)]
3508    pub expand: Option<bool>,
3509    #[builder(setter(into, strip_option), default)]
3510    pub experimental_privileged_nesting: Option<bool>,
3511    /// 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.
3512    #[builder(setter(into, strip_option), default)]
3513    pub insecure_root_capabilities: Option<bool>,
3514    /// If set, skip the automatic init process injected into containers by default.
3515    /// 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.
3516    #[builder(setter(into, strip_option), default)]
3517    pub no_init: Option<bool>,
3518    /// If the container has an entrypoint, prepend it to the args.
3519    #[builder(setter(into, strip_option), default)]
3520    pub use_entrypoint: Option<bool>,
3521}
3522#[derive(Builder, Debug, PartialEq)]
3523pub struct ContainerUpOpts<'a> {
3524    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3525    /// If empty, the container's default command is used.
3526    #[builder(setter(into, strip_option), default)]
3527    pub args: Option<Vec<&'a str>>,
3528    /// Connect Dagger clients started by the command to the current engine as new sessions, instead of as clients of the current session. Each connection gets its own session, released when that client closes.
3529    /// The command reaches the engine through DAGGER_ENGINE, so SDKs run a Dagger CLI: set _EXPERIMENTAL_DAGGER_CLI_BIN to one in the container, or let the SDK download one.
3530    /// Cannot be combined with "disableDaggerInDagger".
3531    #[builder(setter(into, strip_option), default)]
3532    pub dagger_in_dagger_new_session: Option<bool>,
3533    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3534    #[builder(setter(into, strip_option), default)]
3535    pub disable_dagger_in_dagger: Option<bool>,
3536    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3537    #[builder(setter(into, strip_option), default)]
3538    pub expand: Option<bool>,
3539    #[builder(setter(into, strip_option), default)]
3540    pub experimental_privileged_nesting: Option<bool>,
3541    /// 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.
3542    #[builder(setter(into, strip_option), default)]
3543    pub insecure_root_capabilities: Option<bool>,
3544    /// If set, skip the automatic init process injected into containers by default.
3545    /// 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.
3546    #[builder(setter(into, strip_option), default)]
3547    pub no_init: Option<bool>,
3548    /// List of frontend/backend port mappings to forward.
3549    /// Frontend is the port accepting traffic on the host, backend is the service port.
3550    #[builder(setter(into, strip_option), default)]
3551    pub ports: Option<Vec<PortForward>>,
3552    /// Bind each tunnel port to a random port on the host.
3553    #[builder(setter(into, strip_option), default)]
3554    pub random: Option<bool>,
3555    /// If the container has an entrypoint, prepend it to the args.
3556    #[builder(setter(into, strip_option), default)]
3557    pub use_entrypoint: Option<bool>,
3558}
3559impl IntoID<Id> for Container {
3560    fn into_id(
3561        self,
3562    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
3563        Box::pin(async move { self.id().await })
3564    }
3565}
3566impl Loadable for Container {
3567    fn graphql_type() -> &'static str {
3568        "Container"
3569    }
3570    fn from_query(
3571        proc: Option<Arc<DaggerSessionProc>>,
3572        selection: Selection,
3573        graphql_client: DynGraphQLClient,
3574    ) -> Self {
3575        Self {
3576            proc,
3577            selection,
3578            graphql_client,
3579        }
3580    }
3581}
3582impl Container {
3583    /// A unique identifier for this Container.
3584    pub async fn id(&self) -> Result<Id, DaggerError> {
3585        let query = self.selection.select("id");
3586        query.execute(self.graphql_client.clone()).await
3587    }
3588    /// Forces evaluation of the pipeline in the engine.
3589    /// It doesn't run the default command if no exec has been set.
3590    pub async fn sync(&self) -> Result<Container, DaggerError> {
3591        let query = self.selection.select("sync");
3592        let id: Id = query.execute(self.graphql_client.clone()).await?;
3593        Ok(Container {
3594            proc: self.proc.clone(),
3595            selection: query
3596                .root()
3597                .select("node")
3598                .arg("id", &id.0)
3599                .inline_fragment("Container"),
3600            graphql_client: self.graphql_client.clone(),
3601        })
3602    }
3603    /// Download a container image, and apply it to the container state. All previous state will be lost.
3604    ///
3605    /// # Arguments
3606    ///
3607    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
3608    ///
3609    /// 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.
3610    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3611    pub fn from(&self, address: impl Into<String>) -> Container {
3612        let mut query = self.selection.select("from");
3613        query = query.arg("address", address.into());
3614        Container {
3615            proc: self.proc.clone(),
3616            selection: query,
3617            graphql_client: self.graphql_client.clone(),
3618        }
3619    }
3620    /// Download a container image, and apply it to the container state. All previous state will be lost.
3621    ///
3622    /// # Arguments
3623    ///
3624    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
3625    ///
3626    /// 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.
3627    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3628    pub fn from_opts<'a>(
3629        &self,
3630        address: impl Into<String>,
3631        opts: ContainerFromOpts<'a>,
3632    ) -> Container {
3633        let mut query = self.selection.select("from");
3634        query = query.arg("address", address.into());
3635        if let Some(version) = opts.version {
3636            query = query.arg("version", version);
3637        }
3638        if let Some(registry_service) = opts.registry_service {
3639            query = query.arg("registryService", registry_service);
3640        }
3641        if let Some(protocol) = opts.protocol {
3642            query = query.arg("protocol", protocol);
3643        }
3644        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
3645            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
3646        }
3647        if let Some(no_lock) = opts.no_lock {
3648            query = query.arg("noLock", no_lock);
3649        }
3650        Container {
3651            proc: self.proc.clone(),
3652            selection: query,
3653            graphql_client: self.graphql_client.clone(),
3654        }
3655    }
3656    /// 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.
3657    pub fn rootfs(&self) -> Directory {
3658        let query = self.selection.select("rootfs");
3659        Directory {
3660            proc: self.proc.clone(),
3661            selection: query,
3662            graphql_client: self.graphql_client.clone(),
3663        }
3664    }
3665    /// Change the container's root filesystem. The previous root filesystem will be lost.
3666    ///
3667    /// # Arguments
3668    ///
3669    /// * `directory` - The new root filesystem.
3670    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3671        let mut query = self.selection.select("withRootfs");
3672        query = query.arg_lazy(
3673            "directory",
3674            Box::new(move || {
3675                let directory = directory.clone();
3676                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3677            }),
3678        );
3679        Container {
3680            proc: self.proc.clone(),
3681            selection: query,
3682            graphql_client: self.graphql_client.clone(),
3683        }
3684    }
3685    /// Retrieve a directory from the container's root filesystem
3686    /// Mounts are included.
3687    ///
3688    /// # Arguments
3689    ///
3690    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3691    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3692    pub fn directory(&self, path: impl Into<String>) -> Directory {
3693        let mut query = self.selection.select("directory");
3694        query = query.arg("path", path.into());
3695        Directory {
3696            proc: self.proc.clone(),
3697            selection: query,
3698            graphql_client: self.graphql_client.clone(),
3699        }
3700    }
3701    /// Retrieve a directory from the container's root filesystem
3702    /// Mounts are included.
3703    ///
3704    /// # Arguments
3705    ///
3706    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3707    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3708    pub fn directory_opts(
3709        &self,
3710        path: impl Into<String>,
3711        opts: ContainerDirectoryOpts,
3712    ) -> Directory {
3713        let mut query = self.selection.select("directory");
3714        query = query.arg("path", path.into());
3715        if let Some(expand) = opts.expand {
3716            query = query.arg("expand", expand);
3717        }
3718        Directory {
3719            proc: self.proc.clone(),
3720            selection: query,
3721            graphql_client: self.graphql_client.clone(),
3722        }
3723    }
3724    /// Retrieves a file at the given path.
3725    /// Mounts are included.
3726    ///
3727    /// # Arguments
3728    ///
3729    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3731    pub fn file(&self, path: impl Into<String>) -> File {
3732        let mut query = self.selection.select("file");
3733        query = query.arg("path", path.into());
3734        File {
3735            proc: self.proc.clone(),
3736            selection: query,
3737            graphql_client: self.graphql_client.clone(),
3738        }
3739    }
3740    /// Retrieves a file at the given path.
3741    /// Mounts are included.
3742    ///
3743    /// # Arguments
3744    ///
3745    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3746    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3747    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3748        let mut query = self.selection.select("file");
3749        query = query.arg("path", path.into());
3750        if let Some(expand) = opts.expand {
3751            query = query.arg("expand", expand);
3752        }
3753        File {
3754            proc: self.proc.clone(),
3755            selection: query,
3756            graphql_client: self.graphql_client.clone(),
3757        }
3758    }
3759    /// Retrieves the user to be set for all commands.
3760    pub async fn user(&self) -> Result<String, DaggerError> {
3761        let query = self.selection.select("user");
3762        query.execute(self.graphql_client.clone()).await
3763    }
3764    /// Retrieves this container with a different command user.
3765    ///
3766    /// # Arguments
3767    ///
3768    /// * `name` - The user to set (e.g., "root").
3769    pub fn with_user(&self, name: impl Into<String>) -> Container {
3770        let mut query = self.selection.select("withUser");
3771        query = query.arg("name", name.into());
3772        Container {
3773            proc: self.proc.clone(),
3774            selection: query,
3775            graphql_client: self.graphql_client.clone(),
3776        }
3777    }
3778    /// Retrieves this container with an unset command user.
3779    /// Should default to root.
3780    pub fn without_user(&self) -> Container {
3781        let query = self.selection.select("withoutUser");
3782        Container {
3783            proc: self.proc.clone(),
3784            selection: query,
3785            graphql_client: self.graphql_client.clone(),
3786        }
3787    }
3788    /// Retrieves the working directory for all commands.
3789    pub async fn workdir(&self) -> Result<String, DaggerError> {
3790        let query = self.selection.select("workdir");
3791        query.execute(self.graphql_client.clone()).await
3792    }
3793    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3794    ///
3795    /// # Arguments
3796    ///
3797    /// * `path` - The path to set as the working directory (e.g., "/app").
3798    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3799    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3800        let mut query = self.selection.select("withWorkdir");
3801        query = query.arg("path", path.into());
3802        Container {
3803            proc: self.proc.clone(),
3804            selection: query,
3805            graphql_client: self.graphql_client.clone(),
3806        }
3807    }
3808    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3809    ///
3810    /// # Arguments
3811    ///
3812    /// * `path` - The path to set as the working directory (e.g., "/app").
3813    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3814    pub fn with_workdir_opts(
3815        &self,
3816        path: impl Into<String>,
3817        opts: ContainerWithWorkdirOpts,
3818    ) -> Container {
3819        let mut query = self.selection.select("withWorkdir");
3820        query = query.arg("path", path.into());
3821        if let Some(expand) = opts.expand {
3822            query = query.arg("expand", expand);
3823        }
3824        Container {
3825            proc: self.proc.clone(),
3826            selection: query,
3827            graphql_client: self.graphql_client.clone(),
3828        }
3829    }
3830    /// Unset the container's working directory.
3831    /// Should default to "/".
3832    pub fn without_workdir(&self) -> Container {
3833        let query = self.selection.select("withoutWorkdir");
3834        Container {
3835            proc: self.proc.clone(),
3836            selection: query,
3837            graphql_client: self.graphql_client.clone(),
3838        }
3839    }
3840    /// Retrieves the list of persistent environment variables configured on the container.
3841    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
3842        let query = self.selection.select("envVariables");
3843        let query = query.select("id");
3844        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
3845        Ok(ids
3846            .into_iter()
3847            .map(|id| EnvVariable {
3848                proc: self.proc.clone(),
3849                selection: crate::querybuilder::query()
3850                    .select("node")
3851                    .arg("id", &id.0)
3852                    .inline_fragment("EnvVariable"),
3853                graphql_client: self.graphql_client.clone(),
3854            })
3855            .collect())
3856    }
3857    /// Retrieves the value of the specified persistent environment variable.
3858    ///
3859    /// # Arguments
3860    ///
3861    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3862    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3863        let mut query = self.selection.select("envVariable");
3864        query = query.arg("name", name.into());
3865        query.execute(self.graphql_client.clone()).await
3866    }
3867    /// Set a new environment variable in the container.
3868    ///
3869    /// # Arguments
3870    ///
3871    /// * `name` - Name of the environment variable (e.g., "HOST").
3872    /// * `value` - Value of the environment variable. (e.g., "localhost").
3873    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3874    pub fn with_env_variable(
3875        &self,
3876        name: impl Into<String>,
3877        value: impl Into<String>,
3878    ) -> Container {
3879        let mut query = self.selection.select("withEnvVariable");
3880        query = query.arg("name", name.into());
3881        query = query.arg("value", value.into());
3882        Container {
3883            proc: self.proc.clone(),
3884            selection: query,
3885            graphql_client: self.graphql_client.clone(),
3886        }
3887    }
3888    /// Set a new environment variable in the container.
3889    ///
3890    /// # Arguments
3891    ///
3892    /// * `name` - Name of the environment variable (e.g., "HOST").
3893    /// * `value` - Value of the environment variable. (e.g., "localhost").
3894    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3895    pub fn with_env_variable_opts(
3896        &self,
3897        name: impl Into<String>,
3898        value: impl Into<String>,
3899        opts: ContainerWithEnvVariableOpts,
3900    ) -> Container {
3901        let mut query = self.selection.select("withEnvVariable");
3902        query = query.arg("name", name.into());
3903        query = query.arg("value", value.into());
3904        if let Some(expand) = opts.expand {
3905            query = query.arg("expand", expand);
3906        }
3907        Container {
3908            proc: self.proc.clone(),
3909            selection: query,
3910            graphql_client: self.graphql_client.clone(),
3911        }
3912    }
3913    /// Export environment variables from an env-file to the container.
3914    ///
3915    /// # Arguments
3916    ///
3917    /// * `source` - Identifier of the envfile
3918    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
3919        let mut query = self.selection.select("withEnvFileVariables");
3920        query = query.arg_lazy(
3921            "source",
3922            Box::new(move || {
3923                let source = source.clone();
3924                Box::pin(async move { source.into_id().await.unwrap().quote() })
3925            }),
3926        );
3927        Container {
3928            proc: self.proc.clone(),
3929            selection: query,
3930            graphql_client: self.graphql_client.clone(),
3931        }
3932    }
3933    /// Set a new environment variable, using a secret value
3934    ///
3935    /// # Arguments
3936    ///
3937    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3938    /// * `secret` - Identifier of the secret value.
3939    pub fn with_secret_variable(
3940        &self,
3941        name: impl Into<String>,
3942        secret: impl IntoID<Id>,
3943    ) -> Container {
3944        let mut query = self.selection.select("withSecretVariable");
3945        query = query.arg("name", name.into());
3946        query = query.arg_lazy(
3947            "secret",
3948            Box::new(move || {
3949                let secret = secret.clone();
3950                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3951            }),
3952        );
3953        Container {
3954            proc: self.proc.clone(),
3955            selection: query,
3956            graphql_client: self.graphql_client.clone(),
3957        }
3958    }
3959    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
3960    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
3961    ///
3962    /// # Arguments
3963    ///
3964    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
3965    /// * `value` - Value of the volatile variable.
3966    pub fn with_volatile_variable(
3967        &self,
3968        name: impl Into<String>,
3969        value: impl Into<String>,
3970    ) -> Container {
3971        let mut query = self.selection.select("withVolatileVariable");
3972        query = query.arg("name", name.into());
3973        query = query.arg("value", value.into());
3974        Container {
3975            proc: self.proc.clone(),
3976            selection: query,
3977            graphql_client: self.graphql_client.clone(),
3978        }
3979    }
3980    /// Retrieves this container minus the given environment variable.
3981    ///
3982    /// # Arguments
3983    ///
3984    /// * `name` - The name of the environment variable (e.g., "HOST").
3985    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3986        let mut query = self.selection.select("withoutEnvVariable");
3987        query = query.arg("name", name.into());
3988        Container {
3989            proc: self.proc.clone(),
3990            selection: query,
3991            graphql_client: self.graphql_client.clone(),
3992        }
3993    }
3994    /// Retrieves this container minus the given environment variable containing the secret.
3995    ///
3996    /// # Arguments
3997    ///
3998    /// * `name` - The name of the environment variable (e.g., "HOST").
3999    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4000        let mut query = self.selection.select("withoutSecretVariable");
4001        query = query.arg("name", name.into());
4002        Container {
4003            proc: self.proc.clone(),
4004            selection: query,
4005            graphql_client: self.graphql_client.clone(),
4006        }
4007    }
4008    /// Retrieves this container minus the given volatile environment variable.
4009    ///
4010    /// # Arguments
4011    ///
4012    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4013    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4014        let mut query = self.selection.select("withoutVolatileVariable");
4015        query = query.arg("name", name.into());
4016        Container {
4017            proc: self.proc.clone(),
4018            selection: query,
4019            graphql_client: self.graphql_client.clone(),
4020        }
4021    }
4022    /// Retrieves this container plus the given label.
4023    ///
4024    /// # Arguments
4025    ///
4026    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4027    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4028    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4029        let mut query = self.selection.select("withLabel");
4030        query = query.arg("name", name.into());
4031        query = query.arg("value", value.into());
4032        Container {
4033            proc: self.proc.clone(),
4034            selection: query,
4035            graphql_client: self.graphql_client.clone(),
4036        }
4037    }
4038    /// Retrieves the value of the specified label.
4039    ///
4040    /// # Arguments
4041    ///
4042    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4043    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
4044        let mut query = self.selection.select("label");
4045        query = query.arg("name", name.into());
4046        query.execute(self.graphql_client.clone()).await
4047    }
4048    /// Retrieves the list of labels passed to container.
4049    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
4050        let query = self.selection.select("labels");
4051        let query = query.select("id");
4052        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4053        Ok(ids
4054            .into_iter()
4055            .map(|id| Label {
4056                proc: self.proc.clone(),
4057                selection: crate::querybuilder::query()
4058                    .select("node")
4059                    .arg("id", &id.0)
4060                    .inline_fragment("Label"),
4061                graphql_client: self.graphql_client.clone(),
4062            })
4063            .collect())
4064    }
4065    /// Retrieves this container minus the given environment label.
4066    ///
4067    /// # Arguments
4068    ///
4069    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4070    pub fn without_label(&self, name: impl Into<String>) -> Container {
4071        let mut query = self.selection.select("withoutLabel");
4072        query = query.arg("name", name.into());
4073        Container {
4074            proc: self.proc.clone(),
4075            selection: query,
4076            graphql_client: self.graphql_client.clone(),
4077        }
4078    }
4079    /// Retrieves this container with the specificed docker healtcheck command set.
4080    ///
4081    /// # Arguments
4082    ///
4083    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4085    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4086        let mut query = self.selection.select("withDockerHealthcheck");
4087        query = query.arg(
4088            "args",
4089            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4090        );
4091        Container {
4092            proc: self.proc.clone(),
4093            selection: query,
4094            graphql_client: self.graphql_client.clone(),
4095        }
4096    }
4097    /// Retrieves this container with the specificed docker healtcheck command set.
4098    ///
4099    /// # Arguments
4100    ///
4101    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4102    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4103    pub fn with_docker_healthcheck_opts<'a>(
4104        &self,
4105        args: Vec<impl Into<String>>,
4106        opts: ContainerWithDockerHealthcheckOpts<'a>,
4107    ) -> Container {
4108        let mut query = self.selection.select("withDockerHealthcheck");
4109        query = query.arg(
4110            "args",
4111            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4112        );
4113        if let Some(shell) = opts.shell {
4114            query = query.arg("shell", shell);
4115        }
4116        if let Some(interval) = opts.interval {
4117            query = query.arg("interval", interval);
4118        }
4119        if let Some(timeout) = opts.timeout {
4120            query = query.arg("timeout", timeout);
4121        }
4122        if let Some(start_period) = opts.start_period {
4123            query = query.arg("startPeriod", start_period);
4124        }
4125        if let Some(start_interval) = opts.start_interval {
4126            query = query.arg("startInterval", start_interval);
4127        }
4128        if let Some(retries) = opts.retries {
4129            query = query.arg("retries", retries);
4130        }
4131        Container {
4132            proc: self.proc.clone(),
4133            selection: query,
4134            graphql_client: self.graphql_client.clone(),
4135        }
4136    }
4137    /// Retrieves this container without a configured docker healtcheck command.
4138    pub fn without_docker_healthcheck(&self) -> Container {
4139        let query = self.selection.select("withoutDockerHealthcheck");
4140        Container {
4141            proc: self.proc.clone(),
4142            selection: query,
4143            graphql_client: self.graphql_client.clone(),
4144        }
4145    }
4146    /// Retrieves this container's configured docker healthcheck.
4147    pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
4148        let query = self.selection.select("dockerHealthcheck");
4149        let query = query.select("id");
4150        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
4151        Ok(id.map(|id| HealthcheckConfig {
4152            proc: self.proc.clone(),
4153            selection: query
4154                .root()
4155                .select("node")
4156                .arg("id", &id.0)
4157                .inline_fragment("HealthcheckConfig"),
4158            graphql_client: self.graphql_client.clone(),
4159        }))
4160    }
4161    /// Return the container's OCI entrypoint.
4162    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
4163        let query = self.selection.select("entrypoint");
4164        query.execute(self.graphql_client.clone()).await
4165    }
4166    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4167    ///
4168    /// # Arguments
4169    ///
4170    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4171    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4172    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4173        let mut query = self.selection.select("withEntrypoint");
4174        query = query.arg(
4175            "args",
4176            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4177        );
4178        Container {
4179            proc: self.proc.clone(),
4180            selection: query,
4181            graphql_client: self.graphql_client.clone(),
4182        }
4183    }
4184    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4185    ///
4186    /// # Arguments
4187    ///
4188    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4190    pub fn with_entrypoint_opts(
4191        &self,
4192        args: Vec<impl Into<String>>,
4193        opts: ContainerWithEntrypointOpts,
4194    ) -> Container {
4195        let mut query = self.selection.select("withEntrypoint");
4196        query = query.arg(
4197            "args",
4198            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4199        );
4200        if let Some(keep_default_args) = opts.keep_default_args {
4201            query = query.arg("keepDefaultArgs", keep_default_args);
4202        }
4203        Container {
4204            proc: self.proc.clone(),
4205            selection: query,
4206            graphql_client: self.graphql_client.clone(),
4207        }
4208    }
4209    /// Reset the container's OCI entrypoint.
4210    ///
4211    /// # Arguments
4212    ///
4213    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4214    pub fn without_entrypoint(&self) -> Container {
4215        let query = self.selection.select("withoutEntrypoint");
4216        Container {
4217            proc: self.proc.clone(),
4218            selection: query,
4219            graphql_client: self.graphql_client.clone(),
4220        }
4221    }
4222    /// Reset the container's OCI entrypoint.
4223    ///
4224    /// # Arguments
4225    ///
4226    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4227    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4228        let mut query = self.selection.select("withoutEntrypoint");
4229        if let Some(keep_default_args) = opts.keep_default_args {
4230            query = query.arg("keepDefaultArgs", keep_default_args);
4231        }
4232        Container {
4233            proc: self.proc.clone(),
4234            selection: query,
4235            graphql_client: self.graphql_client.clone(),
4236        }
4237    }
4238    /// Return the container's default arguments.
4239    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
4240        let query = self.selection.select("defaultArgs");
4241        query.execute(self.graphql_client.clone()).await
4242    }
4243    /// Configures default arguments for future commands. Like CMD in Dockerfile.
4244    ///
4245    /// # Arguments
4246    ///
4247    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
4248    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4249        let mut query = self.selection.select("withDefaultArgs");
4250        query = query.arg(
4251            "args",
4252            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4253        );
4254        Container {
4255            proc: self.proc.clone(),
4256            selection: query,
4257            graphql_client: self.graphql_client.clone(),
4258        }
4259    }
4260    /// Remove the container's default arguments.
4261    pub fn without_default_args(&self) -> Container {
4262        let query = self.selection.select("withoutDefaultArgs");
4263        Container {
4264            proc: self.proc.clone(),
4265            selection: query,
4266            graphql_client: self.graphql_client.clone(),
4267        }
4268    }
4269    /// Retrieves the list of paths where a directory is mounted.
4270    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
4271        let query = self.selection.select("mounts");
4272        query.execute(self.graphql_client.clone()).await
4273    }
4274    /// Retrieves this container plus a directory mounted at the given path.
4275    ///
4276    /// # Arguments
4277    ///
4278    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4279    /// * `source` - Identifier of the mounted directory.
4280    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4281    pub fn with_mounted_directory(
4282        &self,
4283        path: impl Into<String>,
4284        source: impl IntoID<Id>,
4285    ) -> Container {
4286        let mut query = self.selection.select("withMountedDirectory");
4287        query = query.arg("path", path.into());
4288        query = query.arg_lazy(
4289            "source",
4290            Box::new(move || {
4291                let source = source.clone();
4292                Box::pin(async move { source.into_id().await.unwrap().quote() })
4293            }),
4294        );
4295        Container {
4296            proc: self.proc.clone(),
4297            selection: query,
4298            graphql_client: self.graphql_client.clone(),
4299        }
4300    }
4301    /// Retrieves this container plus a directory mounted at the given path.
4302    ///
4303    /// # Arguments
4304    ///
4305    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4306    /// * `source` - Identifier of the mounted directory.
4307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4308    pub fn with_mounted_directory_opts<'a>(
4309        &self,
4310        path: impl Into<String>,
4311        source: impl IntoID<Id>,
4312        opts: ContainerWithMountedDirectoryOpts<'a>,
4313    ) -> Container {
4314        let mut query = self.selection.select("withMountedDirectory");
4315        query = query.arg("path", path.into());
4316        query = query.arg_lazy(
4317            "source",
4318            Box::new(move || {
4319                let source = source.clone();
4320                Box::pin(async move { source.into_id().await.unwrap().quote() })
4321            }),
4322        );
4323        if let Some(owner) = opts.owner {
4324            query = query.arg("owner", owner);
4325        }
4326        if let Some(inherit_owner) = opts.inherit_owner {
4327            query = query.arg("inheritOwner", inherit_owner);
4328        }
4329        if let Some(read_only) = opts.read_only {
4330            query = query.arg("readOnly", read_only);
4331        }
4332        if let Some(expand) = opts.expand {
4333            query = query.arg("expand", expand);
4334        }
4335        Container {
4336            proc: self.proc.clone(),
4337            selection: query,
4338            graphql_client: self.graphql_client.clone(),
4339        }
4340    }
4341    /// Retrieves this container plus a file mounted at the given path.
4342    ///
4343    /// # Arguments
4344    ///
4345    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4346    /// * `source` - Identifier of the mounted file.
4347    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4348    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4349        let mut query = self.selection.select("withMountedFile");
4350        query = query.arg("path", path.into());
4351        query = query.arg_lazy(
4352            "source",
4353            Box::new(move || {
4354                let source = source.clone();
4355                Box::pin(async move { source.into_id().await.unwrap().quote() })
4356            }),
4357        );
4358        Container {
4359            proc: self.proc.clone(),
4360            selection: query,
4361            graphql_client: self.graphql_client.clone(),
4362        }
4363    }
4364    /// Retrieves this container plus a file mounted at the given path.
4365    ///
4366    /// # Arguments
4367    ///
4368    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4369    /// * `source` - Identifier of the mounted file.
4370    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4371    pub fn with_mounted_file_opts<'a>(
4372        &self,
4373        path: impl Into<String>,
4374        source: impl IntoID<Id>,
4375        opts: ContainerWithMountedFileOpts<'a>,
4376    ) -> Container {
4377        let mut query = self.selection.select("withMountedFile");
4378        query = query.arg("path", path.into());
4379        query = query.arg_lazy(
4380            "source",
4381            Box::new(move || {
4382                let source = source.clone();
4383                Box::pin(async move { source.into_id().await.unwrap().quote() })
4384            }),
4385        );
4386        if let Some(owner) = opts.owner {
4387            query = query.arg("owner", owner);
4388        }
4389        if let Some(inherit_owner) = opts.inherit_owner {
4390            query = query.arg("inheritOwner", inherit_owner);
4391        }
4392        if let Some(expand) = opts.expand {
4393            query = query.arg("expand", expand);
4394        }
4395        if let Some(read_only) = opts.read_only {
4396            query = query.arg("readOnly", read_only);
4397        }
4398        Container {
4399            proc: self.proc.clone(),
4400            selection: query,
4401            graphql_client: self.graphql_client.clone(),
4402        }
4403    }
4404    /// 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.
4405    ///
4406    /// # Arguments
4407    ///
4408    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4409    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4410    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4411        let mut query = self.selection.select("withMountedTemp");
4412        query = query.arg("path", path.into());
4413        Container {
4414            proc: self.proc.clone(),
4415            selection: query,
4416            graphql_client: self.graphql_client.clone(),
4417        }
4418    }
4419    /// 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.
4420    ///
4421    /// # Arguments
4422    ///
4423    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4424    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4425    pub fn with_mounted_temp_opts(
4426        &self,
4427        path: impl Into<String>,
4428        opts: ContainerWithMountedTempOpts,
4429    ) -> Container {
4430        let mut query = self.selection.select("withMountedTemp");
4431        query = query.arg("path", path.into());
4432        if let Some(size) = opts.size {
4433            query = query.arg("size", size);
4434        }
4435        if let Some(expand) = opts.expand {
4436            query = query.arg("expand", expand);
4437        }
4438        Container {
4439            proc: self.proc.clone(),
4440            selection: query,
4441            graphql_client: self.graphql_client.clone(),
4442        }
4443    }
4444    /// Retrieves this container plus a cache volume mounted at the given path.
4445    ///
4446    /// # Arguments
4447    ///
4448    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4449    /// * `cache` - Identifier of the cache volume to mount.
4450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4451    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
4452        let mut query = self.selection.select("withMountedCache");
4453        query = query.arg("path", path.into());
4454        query = query.arg_lazy(
4455            "cache",
4456            Box::new(move || {
4457                let cache = cache.clone();
4458                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4459            }),
4460        );
4461        Container {
4462            proc: self.proc.clone(),
4463            selection: query,
4464            graphql_client: self.graphql_client.clone(),
4465        }
4466    }
4467    /// Retrieves this container plus a cache volume mounted at the given path.
4468    ///
4469    /// # Arguments
4470    ///
4471    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4472    /// * `cache` - Identifier of the cache volume to mount.
4473    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4474    pub fn with_mounted_cache_opts<'a>(
4475        &self,
4476        path: impl Into<String>,
4477        cache: impl IntoID<Id>,
4478        opts: ContainerWithMountedCacheOpts<'a>,
4479    ) -> Container {
4480        let mut query = self.selection.select("withMountedCache");
4481        query = query.arg("path", path.into());
4482        query = query.arg_lazy(
4483            "cache",
4484            Box::new(move || {
4485                let cache = cache.clone();
4486                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4487            }),
4488        );
4489        if let Some(source) = opts.source {
4490            query = query.arg("source", source);
4491        }
4492        if let Some(sharing) = opts.sharing {
4493            query = query.arg("sharing", sharing);
4494        }
4495        if let Some(owner) = opts.owner {
4496            query = query.arg("owner", owner);
4497        }
4498        if let Some(inherit_owner) = opts.inherit_owner {
4499            query = query.arg("inheritOwner", inherit_owner);
4500        }
4501        if let Some(expand) = opts.expand {
4502            query = query.arg("expand", expand);
4503        }
4504        Container {
4505            proc: self.proc.clone(),
4506            selection: query,
4507            graphql_client: self.graphql_client.clone(),
4508        }
4509    }
4510    /// Retrieves this container plus a volume mounted at the given path.
4511    ///
4512    /// # Arguments
4513    ///
4514    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4515    /// * `volume` - Identifier of the volume to mount.
4516    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4517    pub fn with_mounted_volume(
4518        &self,
4519        path: impl Into<String>,
4520        volume: impl IntoID<Id>,
4521    ) -> Container {
4522        let mut query = self.selection.select("withMountedVolume");
4523        query = query.arg("path", path.into());
4524        query = query.arg_lazy(
4525            "volume",
4526            Box::new(move || {
4527                let volume = volume.clone();
4528                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4529            }),
4530        );
4531        Container {
4532            proc: self.proc.clone(),
4533            selection: query,
4534            graphql_client: self.graphql_client.clone(),
4535        }
4536    }
4537    /// Retrieves this container plus a volume mounted at the given path.
4538    ///
4539    /// # Arguments
4540    ///
4541    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4542    /// * `volume` - Identifier of the volume to mount.
4543    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4544    pub fn with_mounted_volume_opts(
4545        &self,
4546        path: impl Into<String>,
4547        volume: impl IntoID<Id>,
4548        opts: ContainerWithMountedVolumeOpts,
4549    ) -> Container {
4550        let mut query = self.selection.select("withMountedVolume");
4551        query = query.arg("path", path.into());
4552        query = query.arg_lazy(
4553            "volume",
4554            Box::new(move || {
4555                let volume = volume.clone();
4556                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4557            }),
4558        );
4559        if let Some(read_only) = opts.read_only {
4560            query = query.arg("readOnly", read_only);
4561        }
4562        if let Some(expand) = opts.expand {
4563            query = query.arg("expand", expand);
4564        }
4565        Container {
4566            proc: self.proc.clone(),
4567            selection: query,
4568            graphql_client: self.graphql_client.clone(),
4569        }
4570    }
4571    /// Retrieves this container plus a secret mounted into a file at the given path.
4572    ///
4573    /// # Arguments
4574    ///
4575    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4576    /// * `source` - Identifier of the secret to mount.
4577    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4578    pub fn with_mounted_secret(
4579        &self,
4580        path: impl Into<String>,
4581        source: impl IntoID<Id>,
4582    ) -> Container {
4583        let mut query = self.selection.select("withMountedSecret");
4584        query = query.arg("path", path.into());
4585        query = query.arg_lazy(
4586            "source",
4587            Box::new(move || {
4588                let source = source.clone();
4589                Box::pin(async move { source.into_id().await.unwrap().quote() })
4590            }),
4591        );
4592        Container {
4593            proc: self.proc.clone(),
4594            selection: query,
4595            graphql_client: self.graphql_client.clone(),
4596        }
4597    }
4598    /// Retrieves this container plus a secret mounted into a file at the given path.
4599    ///
4600    /// # Arguments
4601    ///
4602    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4603    /// * `source` - Identifier of the secret to mount.
4604    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4605    pub fn with_mounted_secret_opts<'a>(
4606        &self,
4607        path: impl Into<String>,
4608        source: impl IntoID<Id>,
4609        opts: ContainerWithMountedSecretOpts<'a>,
4610    ) -> Container {
4611        let mut query = self.selection.select("withMountedSecret");
4612        query = query.arg("path", path.into());
4613        query = query.arg_lazy(
4614            "source",
4615            Box::new(move || {
4616                let source = source.clone();
4617                Box::pin(async move { source.into_id().await.unwrap().quote() })
4618            }),
4619        );
4620        if let Some(owner) = opts.owner {
4621            query = query.arg("owner", owner);
4622        }
4623        if let Some(inherit_owner) = opts.inherit_owner {
4624            query = query.arg("inheritOwner", inherit_owner);
4625        }
4626        if let Some(mode) = opts.mode {
4627            query = query.arg("mode", mode);
4628        }
4629        if let Some(expand) = opts.expand {
4630            query = query.arg("expand", expand);
4631        }
4632        Container {
4633            proc: self.proc.clone(),
4634            selection: query,
4635            graphql_client: self.graphql_client.clone(),
4636        }
4637    }
4638    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4639    ///
4640    /// # Arguments
4641    ///
4642    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4643    /// * `source` - Identifier of the socket to forward.
4644    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4645    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4646        let mut query = self.selection.select("withUnixSocket");
4647        query = query.arg("path", path.into());
4648        query = query.arg_lazy(
4649            "source",
4650            Box::new(move || {
4651                let source = source.clone();
4652                Box::pin(async move { source.into_id().await.unwrap().quote() })
4653            }),
4654        );
4655        Container {
4656            proc: self.proc.clone(),
4657            selection: query,
4658            graphql_client: self.graphql_client.clone(),
4659        }
4660    }
4661    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4662    ///
4663    /// # Arguments
4664    ///
4665    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4666    /// * `source` - Identifier of the socket to forward.
4667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4668    pub fn with_unix_socket_opts<'a>(
4669        &self,
4670        path: impl Into<String>,
4671        source: impl IntoID<Id>,
4672        opts: ContainerWithUnixSocketOpts<'a>,
4673    ) -> Container {
4674        let mut query = self.selection.select("withUnixSocket");
4675        query = query.arg("path", path.into());
4676        query = query.arg_lazy(
4677            "source",
4678            Box::new(move || {
4679                let source = source.clone();
4680                Box::pin(async move { source.into_id().await.unwrap().quote() })
4681            }),
4682        );
4683        if let Some(owner) = opts.owner {
4684            query = query.arg("owner", owner);
4685        }
4686        if let Some(inherit_owner) = opts.inherit_owner {
4687            query = query.arg("inheritOwner", inherit_owner);
4688        }
4689        if let Some(expand) = opts.expand {
4690            query = query.arg("expand", expand);
4691        }
4692        Container {
4693            proc: self.proc.clone(),
4694            selection: query,
4695            graphql_client: self.graphql_client.clone(),
4696        }
4697    }
4698    /// Retrieves this container with a previously added Unix socket removed.
4699    ///
4700    /// # Arguments
4701    ///
4702    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4703    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4704    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4705        let mut query = self.selection.select("withoutUnixSocket");
4706        query = query.arg("path", path.into());
4707        Container {
4708            proc: self.proc.clone(),
4709            selection: query,
4710            graphql_client: self.graphql_client.clone(),
4711        }
4712    }
4713    /// Retrieves this container with a previously added Unix socket removed.
4714    ///
4715    /// # Arguments
4716    ///
4717    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4718    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4719    pub fn without_unix_socket_opts(
4720        &self,
4721        path: impl Into<String>,
4722        opts: ContainerWithoutUnixSocketOpts,
4723    ) -> Container {
4724        let mut query = self.selection.select("withoutUnixSocket");
4725        query = query.arg("path", path.into());
4726        if let Some(expand) = opts.expand {
4727            query = query.arg("expand", expand);
4728        }
4729        Container {
4730            proc: self.proc.clone(),
4731            selection: query,
4732            graphql_client: self.graphql_client.clone(),
4733        }
4734    }
4735    /// Retrieves this container after unmounting everything at the given path.
4736    ///
4737    /// # Arguments
4738    ///
4739    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4740    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4741    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4742        let mut query = self.selection.select("withoutMount");
4743        query = query.arg("path", path.into());
4744        Container {
4745            proc: self.proc.clone(),
4746            selection: query,
4747            graphql_client: self.graphql_client.clone(),
4748        }
4749    }
4750    /// Retrieves this container after unmounting everything at the given path.
4751    ///
4752    /// # Arguments
4753    ///
4754    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4755    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4756    pub fn without_mount_opts(
4757        &self,
4758        path: impl Into<String>,
4759        opts: ContainerWithoutMountOpts,
4760    ) -> Container {
4761        let mut query = self.selection.select("withoutMount");
4762        query = query.arg("path", path.into());
4763        if let Some(expand) = opts.expand {
4764            query = query.arg("expand", expand);
4765        }
4766        Container {
4767            proc: self.proc.clone(),
4768            selection: query,
4769            graphql_client: self.graphql_client.clone(),
4770        }
4771    }
4772    /// Return a container snapshot with a file added
4773    ///
4774    /// # Arguments
4775    ///
4776    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4777    /// * `source` - File to add
4778    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4779    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4780        let mut query = self.selection.select("withFile");
4781        query = query.arg("path", path.into());
4782        query = query.arg_lazy(
4783            "source",
4784            Box::new(move || {
4785                let source = source.clone();
4786                Box::pin(async move { source.into_id().await.unwrap().quote() })
4787            }),
4788        );
4789        Container {
4790            proc: self.proc.clone(),
4791            selection: query,
4792            graphql_client: self.graphql_client.clone(),
4793        }
4794    }
4795    /// Return a container snapshot with a file added
4796    ///
4797    /// # Arguments
4798    ///
4799    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4800    /// * `source` - File to add
4801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4802    pub fn with_file_opts<'a>(
4803        &self,
4804        path: impl Into<String>,
4805        source: impl IntoID<Id>,
4806        opts: ContainerWithFileOpts<'a>,
4807    ) -> Container {
4808        let mut query = self.selection.select("withFile");
4809        query = query.arg("path", path.into());
4810        query = query.arg_lazy(
4811            "source",
4812            Box::new(move || {
4813                let source = source.clone();
4814                Box::pin(async move { source.into_id().await.unwrap().quote() })
4815            }),
4816        );
4817        if let Some(permissions) = opts.permissions {
4818            query = query.arg("permissions", permissions);
4819        }
4820        if let Some(owner) = opts.owner {
4821            query = query.arg("owner", owner);
4822        }
4823        if let Some(inherit_owner) = opts.inherit_owner {
4824            query = query.arg("inheritOwner", inherit_owner);
4825        }
4826        if let Some(expand) = opts.expand {
4827            query = query.arg("expand", expand);
4828        }
4829        Container {
4830            proc: self.proc.clone(),
4831            selection: query,
4832            graphql_client: self.graphql_client.clone(),
4833        }
4834    }
4835    /// Retrieves this container with the file at the given path removed.
4836    ///
4837    /// # Arguments
4838    ///
4839    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4840    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4841    pub fn without_file(&self, path: impl Into<String>) -> Container {
4842        let mut query = self.selection.select("withoutFile");
4843        query = query.arg("path", path.into());
4844        Container {
4845            proc: self.proc.clone(),
4846            selection: query,
4847            graphql_client: self.graphql_client.clone(),
4848        }
4849    }
4850    /// Retrieves this container with the file at the given path removed.
4851    ///
4852    /// # Arguments
4853    ///
4854    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4855    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4856    pub fn without_file_opts(
4857        &self,
4858        path: impl Into<String>,
4859        opts: ContainerWithoutFileOpts,
4860    ) -> Container {
4861        let mut query = self.selection.select("withoutFile");
4862        query = query.arg("path", path.into());
4863        if let Some(expand) = opts.expand {
4864            query = query.arg("expand", expand);
4865        }
4866        Container {
4867            proc: self.proc.clone(),
4868            selection: query,
4869            graphql_client: self.graphql_client.clone(),
4870        }
4871    }
4872    /// Return a new container spanshot with specified files removed
4873    ///
4874    /// # Arguments
4875    ///
4876    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4877    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4878    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4879        let mut query = self.selection.select("withoutFiles");
4880        query = query.arg(
4881            "paths",
4882            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4883        );
4884        Container {
4885            proc: self.proc.clone(),
4886            selection: query,
4887            graphql_client: self.graphql_client.clone(),
4888        }
4889    }
4890    /// Return a new container spanshot with specified files removed
4891    ///
4892    /// # Arguments
4893    ///
4894    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4895    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4896    pub fn without_files_opts(
4897        &self,
4898        paths: Vec<impl Into<String>>,
4899        opts: ContainerWithoutFilesOpts,
4900    ) -> Container {
4901        let mut query = self.selection.select("withoutFiles");
4902        query = query.arg(
4903            "paths",
4904            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4905        );
4906        if let Some(expand) = opts.expand {
4907            query = query.arg("expand", expand);
4908        }
4909        Container {
4910            proc: self.proc.clone(),
4911            selection: query,
4912            graphql_client: self.graphql_client.clone(),
4913        }
4914    }
4915    /// Retrieves this container plus the contents of the given files copied to the given path.
4916    ///
4917    /// # Arguments
4918    ///
4919    /// * `path` - Location where copied files should be placed (e.g., "/src").
4920    /// * `sources` - Identifiers of the files to copy.
4921    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4922    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
4923        let mut query = self.selection.select("withFiles");
4924        query = query.arg("path", path.into());
4925        query = query.arg("sources", sources);
4926        Container {
4927            proc: self.proc.clone(),
4928            selection: query,
4929            graphql_client: self.graphql_client.clone(),
4930        }
4931    }
4932    /// Retrieves this container plus the contents of the given files copied to the given path.
4933    ///
4934    /// # Arguments
4935    ///
4936    /// * `path` - Location where copied files should be placed (e.g., "/src").
4937    /// * `sources` - Identifiers of the files to copy.
4938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4939    pub fn with_files_opts<'a>(
4940        &self,
4941        path: impl Into<String>,
4942        sources: Vec<Id>,
4943        opts: ContainerWithFilesOpts<'a>,
4944    ) -> Container {
4945        let mut query = self.selection.select("withFiles");
4946        query = query.arg("path", path.into());
4947        query = query.arg("sources", sources);
4948        if let Some(permissions) = opts.permissions {
4949            query = query.arg("permissions", permissions);
4950        }
4951        if let Some(owner) = opts.owner {
4952            query = query.arg("owner", owner);
4953        }
4954        if let Some(inherit_owner) = opts.inherit_owner {
4955            query = query.arg("inheritOwner", inherit_owner);
4956        }
4957        if let Some(expand) = opts.expand {
4958            query = query.arg("expand", expand);
4959        }
4960        Container {
4961            proc: self.proc.clone(),
4962            selection: query,
4963            graphql_client: self.graphql_client.clone(),
4964        }
4965    }
4966    /// Return a new container snapshot, with a file added to its filesystem with text content
4967    ///
4968    /// # Arguments
4969    ///
4970    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4971    /// * `contents` - Contents of the new file. Example: "Hello world!"
4972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4973    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4974        let mut query = self.selection.select("withNewFile");
4975        query = query.arg("path", path.into());
4976        query = query.arg("contents", contents.into());
4977        Container {
4978            proc: self.proc.clone(),
4979            selection: query,
4980            graphql_client: self.graphql_client.clone(),
4981        }
4982    }
4983    /// Return a new container snapshot, with a file added to its filesystem with text content
4984    ///
4985    /// # Arguments
4986    ///
4987    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4988    /// * `contents` - Contents of the new file. Example: "Hello world!"
4989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4990    pub fn with_new_file_opts<'a>(
4991        &self,
4992        path: impl Into<String>,
4993        contents: impl Into<String>,
4994        opts: ContainerWithNewFileOpts<'a>,
4995    ) -> Container {
4996        let mut query = self.selection.select("withNewFile");
4997        query = query.arg("path", path.into());
4998        query = query.arg("contents", contents.into());
4999        if let Some(permissions) = opts.permissions {
5000            query = query.arg("permissions", permissions);
5001        }
5002        if let Some(owner) = opts.owner {
5003            query = query.arg("owner", owner);
5004        }
5005        if let Some(inherit_owner) = opts.inherit_owner {
5006            query = query.arg("inheritOwner", inherit_owner);
5007        }
5008        if let Some(expand) = opts.expand {
5009            query = query.arg("expand", expand);
5010        }
5011        Container {
5012            proc: self.proc.clone(),
5013            selection: query,
5014            graphql_client: self.graphql_client.clone(),
5015        }
5016    }
5017    /// Return a new container snapshot, with a directory added to its filesystem
5018    ///
5019    /// # Arguments
5020    ///
5021    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
5022    /// * `source` - Identifier of the directory to write
5023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5024    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
5025        let mut query = self.selection.select("withDirectory");
5026        query = query.arg("path", path.into());
5027        query = query.arg_lazy(
5028            "source",
5029            Box::new(move || {
5030                let source = source.clone();
5031                Box::pin(async move { source.into_id().await.unwrap().quote() })
5032            }),
5033        );
5034        Container {
5035            proc: self.proc.clone(),
5036            selection: query,
5037            graphql_client: self.graphql_client.clone(),
5038        }
5039    }
5040    /// Return a new container snapshot, with a directory added to its filesystem
5041    ///
5042    /// # Arguments
5043    ///
5044    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
5045    /// * `source` - Identifier of the directory to write
5046    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5047    pub fn with_directory_opts<'a>(
5048        &self,
5049        path: impl Into<String>,
5050        source: impl IntoID<Id>,
5051        opts: ContainerWithDirectoryOpts<'a>,
5052    ) -> Container {
5053        let mut query = self.selection.select("withDirectory");
5054        query = query.arg("path", path.into());
5055        query = query.arg_lazy(
5056            "source",
5057            Box::new(move || {
5058                let source = source.clone();
5059                Box::pin(async move { source.into_id().await.unwrap().quote() })
5060            }),
5061        );
5062        if let Some(exclude) = opts.exclude {
5063            query = query.arg("exclude", exclude);
5064        }
5065        if let Some(include) = opts.include {
5066            query = query.arg("include", include);
5067        }
5068        if let Some(gitignore) = opts.gitignore {
5069            query = query.arg("gitignore", gitignore);
5070        }
5071        if let Some(owner) = opts.owner {
5072            query = query.arg("owner", owner);
5073        }
5074        if let Some(inherit_owner) = opts.inherit_owner {
5075            query = query.arg("inheritOwner", inherit_owner);
5076        }
5077        if let Some(expand) = opts.expand {
5078            query = query.arg("expand", expand);
5079        }
5080        if let Some(permissions) = opts.permissions {
5081            query = query.arg("permissions", permissions);
5082        }
5083        Container {
5084            proc: self.proc.clone(),
5085            selection: query,
5086            graphql_client: self.graphql_client.clone(),
5087        }
5088    }
5089    /// Return a new container snapshot, with a directory removed from its filesystem
5090    ///
5091    /// # Arguments
5092    ///
5093    /// * `path` - Location of the directory to remove (e.g., ".github/").
5094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5095    pub fn without_directory(&self, path: impl Into<String>) -> Container {
5096        let mut query = self.selection.select("withoutDirectory");
5097        query = query.arg("path", path.into());
5098        Container {
5099            proc: self.proc.clone(),
5100            selection: query,
5101            graphql_client: self.graphql_client.clone(),
5102        }
5103    }
5104    /// Return a new container snapshot, with a directory removed from its filesystem
5105    ///
5106    /// # Arguments
5107    ///
5108    /// * `path` - Location of the directory to remove (e.g., ".github/").
5109    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5110    pub fn without_directory_opts(
5111        &self,
5112        path: impl Into<String>,
5113        opts: ContainerWithoutDirectoryOpts,
5114    ) -> Container {
5115        let mut query = self.selection.select("withoutDirectory");
5116        query = query.arg("path", path.into());
5117        if let Some(expand) = opts.expand {
5118            query = query.arg("expand", expand);
5119        }
5120        Container {
5121            proc: self.proc.clone(),
5122            selection: query,
5123            graphql_client: self.graphql_client.clone(),
5124        }
5125    }
5126    /// check if a file or directory exists
5127    ///
5128    /// # Arguments
5129    ///
5130    /// * `path` - Path to check (e.g., "/file.txt").
5131    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5132    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5133        let mut query = self.selection.select("exists");
5134        query = query.arg("path", path.into());
5135        query.execute(self.graphql_client.clone()).await
5136    }
5137    /// check if a file or directory exists
5138    ///
5139    /// # Arguments
5140    ///
5141    /// * `path` - Path to check (e.g., "/file.txt").
5142    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5143    pub async fn exists_opts(
5144        &self,
5145        path: impl Into<String>,
5146        opts: ContainerExistsOpts,
5147    ) -> Result<bool, DaggerError> {
5148        let mut query = self.selection.select("exists");
5149        query = query.arg("path", path.into());
5150        if let Some(expected_type) = opts.expected_type {
5151            query = query.arg("expectedType", expected_type);
5152        }
5153        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5154            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5155        }
5156        if let Some(expand) = opts.expand {
5157            query = query.arg("expand", expand);
5158        }
5159        query.execute(self.graphql_client.clone()).await
5160    }
5161    /// Return file status
5162    ///
5163    /// # Arguments
5164    ///
5165    /// * `path` - Path to check (e.g., "/file.txt").
5166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5167    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5168        let mut query = self.selection.select("stat");
5169        query = query.arg("path", path.into());
5170        let query = query.select("id");
5171        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5172        Ok(id.map(|id| Stat {
5173            proc: self.proc.clone(),
5174            selection: query
5175                .root()
5176                .select("node")
5177                .arg("id", &id.0)
5178                .inline_fragment("Stat"),
5179            graphql_client: self.graphql_client.clone(),
5180        }))
5181    }
5182    /// Return file status
5183    ///
5184    /// # Arguments
5185    ///
5186    /// * `path` - Path to check (e.g., "/file.txt").
5187    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5188    pub async fn stat_opts(
5189        &self,
5190        path: impl Into<String>,
5191        opts: ContainerStatOpts,
5192    ) -> Result<Option<Stat>, DaggerError> {
5193        let mut query = self.selection.select("stat");
5194        query = query.arg("path", path.into());
5195        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5196            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5197        }
5198        let query = query.select("id");
5199        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5200        Ok(id.map(|id| Stat {
5201            proc: self.proc.clone(),
5202            selection: query
5203                .root()
5204                .select("node")
5205                .arg("id", &id.0)
5206                .inline_fragment("Stat"),
5207            graphql_client: self.graphql_client.clone(),
5208        }))
5209    }
5210    /// Raise an error.
5211    ///
5212    /// # Arguments
5213    ///
5214    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5215    pub fn with_error(&self, err: impl Into<String>) -> Container {
5216        let mut query = self.selection.select("withError");
5217        query = query.arg("err", err.into());
5218        Container {
5219            proc: self.proc.clone(),
5220            selection: query,
5221            graphql_client: self.graphql_client.clone(),
5222        }
5223    }
5224    /// Execute a command in the container, and return a new snapshot of the container state after execution.
5225    ///
5226    /// # Arguments
5227    ///
5228    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
5229    ///
5230    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
5231    ///
5232    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
5233    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5234    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
5235        let mut query = self.selection.select("withExec");
5236        query = query.arg(
5237            "args",
5238            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5239        );
5240        Container {
5241            proc: self.proc.clone(),
5242            selection: query,
5243            graphql_client: self.graphql_client.clone(),
5244        }
5245    }
5246    /// Execute a command in the container, and return a new snapshot of the container state after execution.
5247    ///
5248    /// # Arguments
5249    ///
5250    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
5251    ///
5252    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
5253    ///
5254    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
5255    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5256    pub fn with_exec_opts<'a>(
5257        &self,
5258        args: Vec<impl Into<String>>,
5259        opts: ContainerWithExecOpts<'a>,
5260    ) -> Container {
5261        let mut query = self.selection.select("withExec");
5262        query = query.arg(
5263            "args",
5264            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5265        );
5266        if let Some(use_entrypoint) = opts.use_entrypoint {
5267            query = query.arg("useEntrypoint", use_entrypoint);
5268        }
5269        if let Some(stdin) = opts.stdin {
5270            query = query.arg("stdin", stdin);
5271        }
5272        if let Some(redirect_stdin) = opts.redirect_stdin {
5273            query = query.arg("redirectStdin", redirect_stdin);
5274        }
5275        if let Some(redirect_stdout) = opts.redirect_stdout {
5276            query = query.arg("redirectStdout", redirect_stdout);
5277        }
5278        if let Some(redirect_stderr) = opts.redirect_stderr {
5279            query = query.arg("redirectStderr", redirect_stderr);
5280        }
5281        if let Some(expect) = opts.expect {
5282            query = query.arg("expect", expect);
5283        }
5284        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5285            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5286        }
5287        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5288            query = query.arg(
5289                "experimentalPrivilegedNesting",
5290                experimental_privileged_nesting,
5291            );
5292        }
5293        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
5294            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
5295        }
5296        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5297            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5298        }
5299        if let Some(expand) = opts.expand {
5300            query = query.arg("expand", expand);
5301        }
5302        if let Some(no_init) = opts.no_init {
5303            query = query.arg("noInit", no_init);
5304        }
5305        Container {
5306            proc: self.proc.clone(),
5307            selection: query,
5308            graphql_client: self.graphql_client.clone(),
5309        }
5310    }
5311    /// The buffered standard output stream of the last executed command
5312    /// Returns an error if no command was executed
5313    pub async fn stdout(&self) -> Result<String, DaggerError> {
5314        let query = self.selection.select("stdout");
5315        query.execute(self.graphql_client.clone()).await
5316    }
5317    /// The buffered standard error stream of the last executed command
5318    /// Returns an error if no command was executed
5319    pub async fn stderr(&self) -> Result<String, DaggerError> {
5320        let query = self.selection.select("stderr");
5321        query.execute(self.graphql_client.clone()).await
5322    }
5323    /// The combined buffered standard output and standard error stream of the last executed command
5324    /// Returns an error if no command was executed
5325    pub async fn combined_output(&self) -> Result<String, DaggerError> {
5326        let query = self.selection.select("combinedOutput");
5327        query.execute(self.graphql_client.clone()).await
5328    }
5329    /// The exit code of the last executed command
5330    /// Returns an error if no command was executed
5331    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
5332        let query = self.selection.select("exitCode");
5333        query.execute(self.graphql_client.clone()).await
5334    }
5335    /// Return a snapshot with a symlink
5336    ///
5337    /// # Arguments
5338    ///
5339    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5340    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5341    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5342    pub fn with_symlink(
5343        &self,
5344        target: impl Into<String>,
5345        link_name: impl Into<String>,
5346    ) -> Container {
5347        let mut query = self.selection.select("withSymlink");
5348        query = query.arg("target", target.into());
5349        query = query.arg("linkName", link_name.into());
5350        Container {
5351            proc: self.proc.clone(),
5352            selection: query,
5353            graphql_client: self.graphql_client.clone(),
5354        }
5355    }
5356    /// Return a snapshot with a symlink
5357    ///
5358    /// # Arguments
5359    ///
5360    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5361    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5363    pub fn with_symlink_opts(
5364        &self,
5365        target: impl Into<String>,
5366        link_name: impl Into<String>,
5367        opts: ContainerWithSymlinkOpts,
5368    ) -> Container {
5369        let mut query = self.selection.select("withSymlink");
5370        query = query.arg("target", target.into());
5371        query = query.arg("linkName", link_name.into());
5372        if let Some(expand) = opts.expand {
5373            query = query.arg("expand", expand);
5374        }
5375        Container {
5376            proc: self.proc.clone(),
5377            selection: query,
5378            graphql_client: self.graphql_client.clone(),
5379        }
5380    }
5381    /// Retrieves this container plus the given OCI annotation.
5382    ///
5383    /// # Arguments
5384    ///
5385    /// * `name` - The name of the annotation.
5386    /// * `value` - The value of the annotation.
5387    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
5388        let mut query = self.selection.select("withAnnotation");
5389        query = query.arg("name", name.into());
5390        query = query.arg("value", value.into());
5391        Container {
5392            proc: self.proc.clone(),
5393            selection: query,
5394            graphql_client: self.graphql_client.clone(),
5395        }
5396    }
5397    /// Retrieves this container minus the given OCI annotation.
5398    ///
5399    /// # Arguments
5400    ///
5401    /// * `name` - The name of the annotation.
5402    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5403        let mut query = self.selection.select("withoutAnnotation");
5404        query = query.arg("name", name.into());
5405        Container {
5406            proc: self.proc.clone(),
5407            selection: query,
5408            graphql_client: self.graphql_client.clone(),
5409        }
5410    }
5411    /// Package the container state as an OCI image, and publish it to a registry
5412    /// Returns the fully qualified address of the published image, with digest
5413    ///
5414    /// # Arguments
5415    ///
5416    /// * `address` - The OCI address to publish to
5417    ///
5418    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
5419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5420    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
5421        let mut query = self.selection.select("publish");
5422        query = query.arg("address", address.into());
5423        query.execute(self.graphql_client.clone()).await
5424    }
5425    /// Package the container state as an OCI image, and publish it to a registry
5426    /// Returns the fully qualified address of the published image, with digest
5427    ///
5428    /// # Arguments
5429    ///
5430    /// * `address` - The OCI address to publish to
5431    ///
5432    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
5433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5434    pub async fn publish_opts(
5435        &self,
5436        address: impl Into<String>,
5437        opts: ContainerPublishOpts,
5438    ) -> Result<String, DaggerError> {
5439        let mut query = self.selection.select("publish");
5440        query = query.arg("address", address.into());
5441        if let Some(platform_variants) = opts.platform_variants {
5442            query = query.arg("platformVariants", platform_variants);
5443        }
5444        if let Some(forced_compression) = opts.forced_compression {
5445            query = query.arg("forcedCompression", forced_compression);
5446        }
5447        if let Some(media_types) = opts.media_types {
5448            query = query.arg("mediaTypes", media_types);
5449        }
5450        if let Some(registry_service) = opts.registry_service {
5451            query = query.arg("registryService", registry_service);
5452        }
5453        if let Some(protocol) = opts.protocol {
5454            query = query.arg("protocol", protocol);
5455        }
5456        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
5457            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
5458        }
5459        query.execute(self.graphql_client.clone()).await
5460    }
5461    /// The platform this container executes and publishes as.
5462    pub async fn platform(&self) -> Result<Platform, DaggerError> {
5463        let query = self.selection.select("platform");
5464        query.execute(self.graphql_client.clone()).await
5465    }
5466    /// Writes the container as an OCI tarball to the destination file path on the host.
5467    /// It can also export platform variants.
5468    ///
5469    /// # Arguments
5470    ///
5471    /// * `path` - Host's destination path (e.g., "./tarball").
5472    ///
5473    /// Path can be relative to the engine's workdir or absolute.
5474    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5475    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5476        let mut query = self.selection.select("export");
5477        query = query.arg("path", path.into());
5478        query.execute(self.graphql_client.clone()).await
5479    }
5480    /// Writes the container as an OCI tarball to the destination file path on the host.
5481    /// It can also export platform variants.
5482    ///
5483    /// # Arguments
5484    ///
5485    /// * `path` - Host's destination path (e.g., "./tarball").
5486    ///
5487    /// Path can be relative to the engine's workdir or absolute.
5488    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5489    pub async fn export_opts(
5490        &self,
5491        path: impl Into<String>,
5492        opts: ContainerExportOpts,
5493    ) -> Result<String, DaggerError> {
5494        let mut query = self.selection.select("export");
5495        query = query.arg("path", path.into());
5496        if let Some(platform_variants) = opts.platform_variants {
5497            query = query.arg("platformVariants", platform_variants);
5498        }
5499        if let Some(forced_compression) = opts.forced_compression {
5500            query = query.arg("forcedCompression", forced_compression);
5501        }
5502        if let Some(media_types) = opts.media_types {
5503            query = query.arg("mediaTypes", media_types);
5504        }
5505        if let Some(expand) = opts.expand {
5506            query = query.arg("expand", expand);
5507        }
5508        query.execute(self.graphql_client.clone()).await
5509    }
5510    /// Exports the container as an image to the host's container image store.
5511    ///
5512    /// # Arguments
5513    ///
5514    /// * `name` - Name of image to export to in the host's store
5515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5516    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
5517        let mut query = self.selection.select("exportImage");
5518        query = query.arg("name", name.into());
5519        query.execute(self.graphql_client.clone()).await
5520    }
5521    /// Exports the container as an image to the host's container image store.
5522    ///
5523    /// # Arguments
5524    ///
5525    /// * `name` - Name of image to export to in the host's store
5526    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5527    pub async fn export_image_opts(
5528        &self,
5529        name: impl Into<String>,
5530        opts: ContainerExportImageOpts,
5531    ) -> Result<Void, DaggerError> {
5532        let mut query = self.selection.select("exportImage");
5533        query = query.arg("name", name.into());
5534        if let Some(platform_variants) = opts.platform_variants {
5535            query = query.arg("platformVariants", platform_variants);
5536        }
5537        if let Some(forced_compression) = opts.forced_compression {
5538            query = query.arg("forcedCompression", forced_compression);
5539        }
5540        if let Some(media_types) = opts.media_types {
5541            query = query.arg("mediaTypes", media_types);
5542        }
5543        query.execute(self.graphql_client.clone()).await
5544    }
5545    /// Package the container state as an OCI image, and return it as a tar archive
5546    ///
5547    /// # Arguments
5548    ///
5549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5550    pub fn as_tarball(&self) -> File {
5551        let query = self.selection.select("asTarball");
5552        File {
5553            proc: self.proc.clone(),
5554            selection: query,
5555            graphql_client: self.graphql_client.clone(),
5556        }
5557    }
5558    /// Package the container state as an OCI image, and return it as a tar archive
5559    ///
5560    /// # Arguments
5561    ///
5562    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5563    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
5564        let mut query = self.selection.select("asTarball");
5565        if let Some(platform_variants) = opts.platform_variants {
5566            query = query.arg("platformVariants", platform_variants);
5567        }
5568        if let Some(forced_compression) = opts.forced_compression {
5569            query = query.arg("forcedCompression", forced_compression);
5570        }
5571        if let Some(media_types) = opts.media_types {
5572            query = query.arg("mediaTypes", media_types);
5573        }
5574        File {
5575            proc: self.proc.clone(),
5576            selection: query,
5577            graphql_client: self.graphql_client.clone(),
5578        }
5579    }
5580    /// Reads the container from an OCI tarball.
5581    ///
5582    /// # Arguments
5583    ///
5584    /// * `source` - File to read the container from.
5585    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5586    pub fn import(&self, source: impl IntoID<Id>) -> Container {
5587        let mut query = self.selection.select("import");
5588        query = query.arg_lazy(
5589            "source",
5590            Box::new(move || {
5591                let source = source.clone();
5592                Box::pin(async move { source.into_id().await.unwrap().quote() })
5593            }),
5594        );
5595        Container {
5596            proc: self.proc.clone(),
5597            selection: query,
5598            graphql_client: self.graphql_client.clone(),
5599        }
5600    }
5601    /// Reads the container from an OCI tarball.
5602    ///
5603    /// # Arguments
5604    ///
5605    /// * `source` - File to read the container from.
5606    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5607    pub fn import_opts<'a>(
5608        &self,
5609        source: impl IntoID<Id>,
5610        opts: ContainerImportOpts<'a>,
5611    ) -> Container {
5612        let mut query = self.selection.select("import");
5613        query = query.arg_lazy(
5614            "source",
5615            Box::new(move || {
5616                let source = source.clone();
5617                Box::pin(async move { source.into_id().await.unwrap().quote() })
5618            }),
5619        );
5620        if let Some(tag) = opts.tag {
5621            query = query.arg("tag", tag);
5622        }
5623        Container {
5624            proc: self.proc.clone(),
5625            selection: query,
5626            graphql_client: self.graphql_client.clone(),
5627        }
5628    }
5629    /// Attach credentials for future publishing to a registry. Use in combination with publish
5630    ///
5631    /// # Arguments
5632    ///
5633    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
5634    /// * `username` - The username to authenticate with. Example: "alice"
5635    /// * `secret` - The API key, password or token to authenticate to this registry
5636    pub fn with_registry_auth(
5637        &self,
5638        address: impl Into<String>,
5639        username: impl Into<String>,
5640        secret: impl IntoID<Id>,
5641    ) -> Container {
5642        let mut query = self.selection.select("withRegistryAuth");
5643        query = query.arg("address", address.into());
5644        query = query.arg("username", username.into());
5645        query = query.arg_lazy(
5646            "secret",
5647            Box::new(move || {
5648                let secret = secret.clone();
5649                Box::pin(async move { secret.into_id().await.unwrap().quote() })
5650            }),
5651        );
5652        Container {
5653            proc: self.proc.clone(),
5654            selection: query,
5655            graphql_client: self.graphql_client.clone(),
5656        }
5657    }
5658    /// Retrieves this container without the registry authentication of a given address.
5659    ///
5660    /// # Arguments
5661    ///
5662    /// * `address` - Registry's address to remove the authentication from.
5663    ///
5664    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5665    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5666        let mut query = self.selection.select("withoutRegistryAuth");
5667        query = query.arg("address", address.into());
5668        Container {
5669            proc: self.proc.clone(),
5670            selection: query,
5671            graphql_client: self.graphql_client.clone(),
5672        }
5673    }
5674    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
5675    pub async fn image_ref(&self) -> Result<String, DaggerError> {
5676        let query = self.selection.select("imageRef");
5677        query.execute(self.graphql_client.clone()).await
5678    }
5679    /// Computes and returns the manifest for this container as a File.
5680    ///
5681    /// # Arguments
5682    ///
5683    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5684    pub fn manifest(&self) -> File {
5685        let query = self.selection.select("manifest");
5686        File {
5687            proc: self.proc.clone(),
5688            selection: query,
5689            graphql_client: self.graphql_client.clone(),
5690        }
5691    }
5692    /// Computes and returns the manifest for this container as a File.
5693    ///
5694    /// # Arguments
5695    ///
5696    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5697    pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
5698        let mut query = self.selection.select("manifest");
5699        if let Some(forced_compression) = opts.forced_compression {
5700            query = query.arg("forcedCompression", forced_compression);
5701        }
5702        if let Some(media_types) = opts.media_types {
5703            query = query.arg("mediaTypes", media_types);
5704        }
5705        File {
5706            proc: self.proc.clone(),
5707            selection: query,
5708            graphql_client: self.graphql_client.clone(),
5709        }
5710    }
5711    /// Returns the image layer or configuration blob with the given digest as a File.
5712    ///
5713    /// # Arguments
5714    ///
5715    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
5716    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5717    pub fn layer(&self, id: impl Into<String>) -> File {
5718        let mut query = self.selection.select("layer");
5719        query = query.arg("id", id.into());
5720        File {
5721            proc: self.proc.clone(),
5722            selection: query,
5723            graphql_client: self.graphql_client.clone(),
5724        }
5725    }
5726    /// Returns the image layer or configuration blob with the given digest as a File.
5727    ///
5728    /// # Arguments
5729    ///
5730    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
5731    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5732    pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
5733        let mut query = self.selection.select("layer");
5734        query = query.arg("id", id.into());
5735        if let Some(forced_compression) = opts.forced_compression {
5736            query = query.arg("forcedCompression", forced_compression);
5737        }
5738        if let Some(media_types) = opts.media_types {
5739            query = query.arg("mediaTypes", media_types);
5740        }
5741        File {
5742            proc: self.proc.clone(),
5743            selection: query,
5744            graphql_client: self.graphql_client.clone(),
5745        }
5746    }
5747    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
5748    /// Exposed ports serve two purposes:
5749    /// - For health checks and introspection, when running services
5750    /// - For setting the EXPOSE OCI field when publishing the container
5751    ///
5752    /// # Arguments
5753    ///
5754    /// * `port` - Port number to expose. Example: 8080
5755    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5756    pub fn with_exposed_port(&self, port: isize) -> Container {
5757        let mut query = self.selection.select("withExposedPort");
5758        query = query.arg("port", port);
5759        Container {
5760            proc: self.proc.clone(),
5761            selection: query,
5762            graphql_client: self.graphql_client.clone(),
5763        }
5764    }
5765    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
5766    /// Exposed ports serve two purposes:
5767    /// - For health checks and introspection, when running services
5768    /// - For setting the EXPOSE OCI field when publishing the container
5769    ///
5770    /// # Arguments
5771    ///
5772    /// * `port` - Port number to expose. Example: 8080
5773    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5774    pub fn with_exposed_port_opts<'a>(
5775        &self,
5776        port: isize,
5777        opts: ContainerWithExposedPortOpts<'a>,
5778    ) -> Container {
5779        let mut query = self.selection.select("withExposedPort");
5780        query = query.arg("port", port);
5781        if let Some(protocol) = opts.protocol {
5782            query = query.arg("protocol", protocol);
5783        }
5784        if let Some(description) = opts.description {
5785            query = query.arg("description", description);
5786        }
5787        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
5788            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
5789        }
5790        Container {
5791            proc: self.proc.clone(),
5792            selection: query,
5793            graphql_client: self.graphql_client.clone(),
5794        }
5795    }
5796    /// Unexpose a previously exposed port.
5797    ///
5798    /// # Arguments
5799    ///
5800    /// * `port` - Port number to unexpose
5801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5802    pub fn without_exposed_port(&self, port: isize) -> Container {
5803        let mut query = self.selection.select("withoutExposedPort");
5804        query = query.arg("port", port);
5805        Container {
5806            proc: self.proc.clone(),
5807            selection: query,
5808            graphql_client: self.graphql_client.clone(),
5809        }
5810    }
5811    /// Unexpose a previously exposed port.
5812    ///
5813    /// # Arguments
5814    ///
5815    /// * `port` - Port number to unexpose
5816    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5817    pub fn without_exposed_port_opts(
5818        &self,
5819        port: isize,
5820        opts: ContainerWithoutExposedPortOpts,
5821    ) -> Container {
5822        let mut query = self.selection.select("withoutExposedPort");
5823        query = query.arg("port", port);
5824        if let Some(protocol) = opts.protocol {
5825            query = query.arg("protocol", protocol);
5826        }
5827        Container {
5828            proc: self.proc.clone(),
5829            selection: query,
5830            graphql_client: self.graphql_client.clone(),
5831        }
5832    }
5833    /// Retrieves the list of exposed ports.
5834    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
5835    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
5836        let query = self.selection.select("exposedPorts");
5837        let query = query.select("id");
5838        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5839        Ok(ids
5840            .into_iter()
5841            .map(|id| Port {
5842                proc: self.proc.clone(),
5843                selection: crate::querybuilder::query()
5844                    .select("node")
5845                    .arg("id", &id.0)
5846                    .inline_fragment("Port"),
5847                graphql_client: self.graphql_client.clone(),
5848            })
5849            .collect())
5850    }
5851    /// Establish a runtime dependency from a container to a network service.
5852    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
5853    /// The service will be reachable from the container via the provided hostname alias.
5854    /// The service dependency will also convey to any files or directories produced by the container.
5855    ///
5856    /// # Arguments
5857    ///
5858    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
5859    /// * `service` - The target service
5860    pub fn with_service_binding(
5861        &self,
5862        alias: impl Into<String>,
5863        service: impl IntoID<Id>,
5864    ) -> Container {
5865        let mut query = self.selection.select("withServiceBinding");
5866        query = query.arg("alias", alias.into());
5867        query = query.arg_lazy(
5868            "service",
5869            Box::new(move || {
5870                let service = service.clone();
5871                Box::pin(async move { service.into_id().await.unwrap().quote() })
5872            }),
5873        );
5874        Container {
5875            proc: self.proc.clone(),
5876            selection: query,
5877            graphql_client: self.graphql_client.clone(),
5878        }
5879    }
5880    /// Set the default command to invoke for the container's terminal API.
5881    ///
5882    /// # Arguments
5883    ///
5884    /// * `args` - The args of the command.
5885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5886    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
5887        let mut query = self.selection.select("withDefaultTerminalCmd");
5888        query = query.arg(
5889            "args",
5890            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5891        );
5892        Container {
5893            proc: self.proc.clone(),
5894            selection: query,
5895            graphql_client: self.graphql_client.clone(),
5896        }
5897    }
5898    /// Set the default command to invoke for the container's terminal API.
5899    ///
5900    /// # Arguments
5901    ///
5902    /// * `args` - The args of the command.
5903    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5904    pub fn with_default_terminal_cmd_opts(
5905        &self,
5906        args: Vec<impl Into<String>>,
5907        opts: ContainerWithDefaultTerminalCmdOpts,
5908    ) -> Container {
5909        let mut query = self.selection.select("withDefaultTerminalCmd");
5910        query = query.arg(
5911            "args",
5912            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5913        );
5914        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5915            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5916        }
5917        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5918            query = query.arg(
5919                "experimentalPrivilegedNesting",
5920                experimental_privileged_nesting,
5921            );
5922        }
5923        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5924            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5925        }
5926        Container {
5927            proc: self.proc.clone(),
5928            selection: query,
5929            graphql_client: self.graphql_client.clone(),
5930        }
5931    }
5932    /// Set the shell used by terminal() and withRun().
5933    ///
5934    /// # Arguments
5935    ///
5936    /// * `interactive` - Command arguments for interactive use. Example: ["sh"].
5937    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5938    pub fn with_shell(&self, interactive: Vec<impl Into<String>>) -> Container {
5939        let mut query = self.selection.select("withShell");
5940        query = query.arg(
5941            "interactive",
5942            interactive
5943                .into_iter()
5944                .map(|i| i.into())
5945                .collect::<Vec<String>>(),
5946        );
5947        Container {
5948            proc: self.proc.clone(),
5949            selection: query,
5950            graphql_client: self.graphql_client.clone(),
5951        }
5952    }
5953    /// Set the shell used by terminal() and withRun().
5954    ///
5955    /// # Arguments
5956    ///
5957    /// * `interactive` - Command arguments for interactive use. Example: ["sh"].
5958    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5959    pub fn with_shell_opts<'a>(
5960        &self,
5961        interactive: Vec<impl Into<String>>,
5962        opts: ContainerWithShellOpts<'a>,
5963    ) -> Container {
5964        let mut query = self.selection.select("withShell");
5965        query = query.arg(
5966            "interactive",
5967            interactive
5968                .into_iter()
5969                .map(|i| i.into())
5970                .collect::<Vec<String>>(),
5971        );
5972        if let Some(batch) = opts.batch {
5973            query = query.arg("batch", batch);
5974        }
5975        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5976            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5977        }
5978        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5979            query = query.arg(
5980                "experimentalPrivilegedNesting",
5981                experimental_privileged_nesting,
5982            );
5983        }
5984        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5985            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5986        }
5987        Container {
5988            proc: self.proc.clone(),
5989            selection: query,
5990            graphql_client: self.graphql_client.clone(),
5991        }
5992    }
5993    /// Return the configured shell command. Defaults to ["sh"].
5994    ///
5995    /// # Arguments
5996    ///
5997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5998    pub fn shell(&self) -> Command {
5999        let query = self.selection.select("shell");
6000        Command {
6001            proc: self.proc.clone(),
6002            selection: query,
6003            graphql_client: self.graphql_client.clone(),
6004        }
6005    }
6006    /// Return the configured shell command. Defaults to ["sh"].
6007    ///
6008    /// # Arguments
6009    ///
6010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6011    pub fn shell_opts(&self, opts: ContainerShellOpts) -> Command {
6012        let mut query = self.selection.select("shell");
6013        if let Some(batch) = opts.batch {
6014            query = query.arg("batch", batch);
6015        }
6016        Command {
6017            proc: self.proc.clone(),
6018            selection: query,
6019            graphql_client: self.graphql_client.clone(),
6020        }
6021    }
6022    /// Execute a script with the configured batch shell and return the modified container.
6023    ///
6024    /// # Arguments
6025    ///
6026    /// * `command` - Script to append to the shell command as one argument.
6027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6028    pub fn with_run(&self, command: impl Into<String>) -> Container {
6029        let mut query = self.selection.select("withRun");
6030        query = query.arg("command", command.into());
6031        Container {
6032            proc: self.proc.clone(),
6033            selection: query,
6034            graphql_client: self.graphql_client.clone(),
6035        }
6036    }
6037    /// Execute a script with the configured batch shell and return the modified container.
6038    ///
6039    /// # Arguments
6040    ///
6041    /// * `command` - Script to append to the shell command as one argument.
6042    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6043    pub fn with_run_opts<'a>(
6044        &self,
6045        command: impl Into<String>,
6046        opts: ContainerWithRunOpts<'a>,
6047    ) -> Container {
6048        let mut query = self.selection.select("withRun");
6049        query = query.arg("command", command.into());
6050        if let Some(shell) = opts.shell {
6051            query = query.arg("shell", shell);
6052        }
6053        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6054            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6055        }
6056        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6057            query = query.arg(
6058                "experimentalPrivilegedNesting",
6059                experimental_privileged_nesting,
6060            );
6061        }
6062        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6063            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6064        }
6065        Container {
6066            proc: self.proc.clone(),
6067            selection: query,
6068            graphql_client: self.graphql_client.clone(),
6069        }
6070    }
6071    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
6072    ///
6073    /// # Arguments
6074    ///
6075    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6076    pub fn terminal(&self) -> Container {
6077        let query = self.selection.select("terminal");
6078        Container {
6079            proc: self.proc.clone(),
6080            selection: query,
6081            graphql_client: self.graphql_client.clone(),
6082        }
6083    }
6084    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
6085    ///
6086    /// # Arguments
6087    ///
6088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6089    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
6090        let mut query = self.selection.select("terminal");
6091        if let Some(cmd) = opts.cmd {
6092            query = query.arg("cmd", cmd);
6093        }
6094        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6095            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6096        }
6097        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6098            query = query.arg(
6099                "experimentalPrivilegedNesting",
6100                experimental_privileged_nesting,
6101            );
6102        }
6103        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6104            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6105        }
6106        Container {
6107            proc: self.proc.clone(),
6108            selection: query,
6109            graphql_client: self.graphql_client.clone(),
6110        }
6111    }
6112    /// Configures all GPUs available on the host to be accessible to this container.
6113    /// This currently works with NVIDIA devices only, and requires the engine to run with GPU support enabled.
6114    pub fn with_gpu(&self) -> Container {
6115        let query = self.selection.select("withGPU");
6116        Container {
6117            proc: self.proc.clone(),
6118            selection: query,
6119            graphql_client: self.graphql_client.clone(),
6120        }
6121    }
6122    /// Configures the provided list of devices to be accessible to this container.
6123    /// This currently works for Nvidia devices only.
6124    ///
6125    /// # Arguments
6126    ///
6127    /// * `devices` - List of devices to be accessible to this container.
6128    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
6129        let mut query = self.selection.select("experimentalWithGPU");
6130        query = query.arg(
6131            "devices",
6132            devices
6133                .into_iter()
6134                .map(|i| i.into())
6135                .collect::<Vec<String>>(),
6136        );
6137        Container {
6138            proc: self.proc.clone(),
6139            selection: query,
6140            graphql_client: self.graphql_client.clone(),
6141        }
6142    }
6143    /// Configures all available GPUs on the host to be accessible to this container.
6144    /// This currently works for Nvidia devices only.
6145    pub fn experimental_with_all_gp_us(&self) -> Container {
6146        let query = self.selection.select("experimentalWithAllGPUs");
6147        Container {
6148            proc: self.proc.clone(),
6149            selection: query,
6150            graphql_client: self.graphql_client.clone(),
6151        }
6152    }
6153    /// Turn the container into a Service.
6154    /// Be sure to set any exposed ports before this conversion.
6155    ///
6156    /// # Arguments
6157    ///
6158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6159    pub fn as_service(&self) -> Service {
6160        let query = self.selection.select("asService");
6161        Service {
6162            proc: self.proc.clone(),
6163            selection: query,
6164            graphql_client: self.graphql_client.clone(),
6165        }
6166    }
6167    /// Turn the container into a Service.
6168    /// Be sure to set any exposed ports before this conversion.
6169    ///
6170    /// # Arguments
6171    ///
6172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6173    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
6174        let mut query = self.selection.select("asService");
6175        if let Some(args) = opts.args {
6176            query = query.arg("args", args);
6177        }
6178        if let Some(use_entrypoint) = opts.use_entrypoint {
6179            query = query.arg("useEntrypoint", use_entrypoint);
6180        }
6181        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6182            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6183        }
6184        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6185            query = query.arg(
6186                "experimentalPrivilegedNesting",
6187                experimental_privileged_nesting,
6188            );
6189        }
6190        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6191            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6192        }
6193        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6194            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6195        }
6196        if let Some(expand) = opts.expand {
6197            query = query.arg("expand", expand);
6198        }
6199        if let Some(no_init) = opts.no_init {
6200            query = query.arg("noInit", no_init);
6201        }
6202        Service {
6203            proc: self.proc.clone(),
6204            selection: query,
6205            graphql_client: self.graphql_client.clone(),
6206        }
6207    }
6208    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
6209    /// Be sure to set any exposed ports before calling this api.
6210    ///
6211    /// # Arguments
6212    ///
6213    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6214    pub async fn up(&self) -> Result<Void, DaggerError> {
6215        let query = self.selection.select("up");
6216        query.execute(self.graphql_client.clone()).await
6217    }
6218    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
6219    /// Be sure to set any exposed ports before calling this api.
6220    ///
6221    /// # Arguments
6222    ///
6223    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6224    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
6225        let mut query = self.selection.select("up");
6226        if let Some(random) = opts.random {
6227            query = query.arg("random", random);
6228        }
6229        if let Some(ports) = opts.ports {
6230            query = query.arg("ports", ports);
6231        }
6232        if let Some(args) = opts.args {
6233            query = query.arg("args", args);
6234        }
6235        if let Some(use_entrypoint) = opts.use_entrypoint {
6236            query = query.arg("useEntrypoint", use_entrypoint);
6237        }
6238        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6239            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6240        }
6241        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6242            query = query.arg(
6243                "experimentalPrivilegedNesting",
6244                experimental_privileged_nesting,
6245            );
6246        }
6247        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6248            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6249        }
6250        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6251            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6252        }
6253        if let Some(expand) = opts.expand {
6254            query = query.arg("expand", expand);
6255        }
6256        if let Some(no_init) = opts.no_init {
6257            query = query.arg("noInit", no_init);
6258        }
6259        query.execute(self.graphql_client.clone()).await
6260    }
6261}
6262impl Exportable for Container {
6263    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6264        let query = self.selection.select("id");
6265        let graphql_client = self.graphql_client.clone();
6266        async move { query.execute(graphql_client).await }
6267    }
6268    fn export(
6269        &self,
6270        path: impl Into<String>,
6271    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
6272        let mut query = self.selection.select("export");
6273        query = query.arg("path", path.into());
6274        let graphql_client = self.graphql_client.clone();
6275        async move { query.execute(graphql_client).await }
6276    }
6277}
6278impl Node for Container {
6279    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6280        let query = self.selection.select("id");
6281        let graphql_client = self.graphql_client.clone();
6282        async move { query.execute(graphql_client).await }
6283    }
6284}
6285impl Syncer for Container {
6286    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6287        let query = self.selection.select("id");
6288        let graphql_client = self.graphql_client.clone();
6289        async move { query.execute(graphql_client).await }
6290    }
6291    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
6292        let query = self.selection.select("sync");
6293        let proc = self.proc.clone();
6294        let graphql_client = self.graphql_client.clone();
6295        async move {
6296            let id: Id = query.execute(graphql_client.clone()).await?;
6297            Ok(Self {
6298                proc,
6299                selection: query
6300                    .root()
6301                    .select("node")
6302                    .arg("id", &id.0)
6303                    .inline_fragment("Container"),
6304                graphql_client,
6305            })
6306        }
6307    }
6308}
6309#[derive(Clone)]
6310pub struct CurrentModule {
6311    pub proc: Option<Arc<DaggerSessionProc>>,
6312    pub selection: Selection,
6313    pub graphql_client: DynGraphQLClient,
6314}
6315#[derive(Builder, Debug, PartialEq)]
6316pub struct CurrentModuleWorkdirOpts<'a> {
6317    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6318    #[builder(setter(into, strip_option), default)]
6319    pub exclude: Option<Vec<&'a str>>,
6320    /// Apply .gitignore filter rules inside the directory
6321    #[builder(setter(into, strip_option), default)]
6322    pub gitignore: Option<bool>,
6323    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6324    #[builder(setter(into, strip_option), default)]
6325    pub include: Option<Vec<&'a str>>,
6326}
6327impl IntoID<Id> for CurrentModule {
6328    fn into_id(
6329        self,
6330    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6331        Box::pin(async move { self.id().await })
6332    }
6333}
6334impl Loadable for CurrentModule {
6335    fn graphql_type() -> &'static str {
6336        "CurrentModule"
6337    }
6338    fn from_query(
6339        proc: Option<Arc<DaggerSessionProc>>,
6340        selection: Selection,
6341        graphql_client: DynGraphQLClient,
6342    ) -> Self {
6343        Self {
6344            proc,
6345            selection,
6346            graphql_client,
6347        }
6348    }
6349}
6350impl CurrentModule {
6351    /// A unique identifier for this CurrentModule.
6352    pub async fn id(&self) -> Result<Id, DaggerError> {
6353        let query = self.selection.select("id");
6354        query.execute(self.graphql_client.clone()).await
6355    }
6356    /// The module's context directory loaded into the engine (plus any generated code that may have been created).
6357    /// It holds the module's source code and every other file the engine loaded for the module, at their paths relative to the context root. Use sourceSubpath to locate the source code in it.
6358    pub fn context_directory(&self) -> Directory {
6359        let query = self.selection.select("contextDirectory");
6360        Directory {
6361            proc: self.proc.clone(),
6362            selection: query,
6363            graphql_client: self.graphql_client.clone(),
6364        }
6365    }
6366    /// The dependencies of the module.
6367    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
6368        let query = self.selection.select("dependencies");
6369        let query = query.select("id");
6370        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6371        Ok(ids
6372            .into_iter()
6373            .map(|id| Module {
6374                proc: self.proc.clone(),
6375                selection: crate::querybuilder::query()
6376                    .select("node")
6377                    .arg("id", &id.0)
6378                    .inline_fragment("Module"),
6379                graphql_client: self.graphql_client.clone(),
6380            })
6381            .collect())
6382    }
6383    /// The generated files and directories made on top of the module source's context directory.
6384    pub fn generated_context_directory(&self) -> Directory {
6385        let query = self.selection.select("generatedContextDirectory");
6386        Directory {
6387            proc: self.proc.clone(),
6388            selection: query,
6389            graphql_client: self.graphql_client.clone(),
6390        }
6391    }
6392    /// The name of the module being executed in
6393    pub async fn name(&self) -> Result<String, DaggerError> {
6394        let query = self.selection.select("name");
6395        query.execute(self.graphql_client.clone()).await
6396    }
6397    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
6398    pub fn source(&self) -> Directory {
6399        let query = self.selection.select("source");
6400        Directory {
6401            proc: self.proc.clone(),
6402            selection: query,
6403            graphql_client: self.graphql_client.clone(),
6404        }
6405    }
6406    /// The path to the directory containing the module's source code, relative to the context directory.
6407    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6408        let query = self.selection.select("sourceSubpath");
6409        query.execute(self.graphql_client.clone()).await
6410    }
6411    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
6412    ///
6413    /// # Arguments
6414    ///
6415    /// * `path` - Location of the directory to access (e.g., ".").
6416    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6417    pub fn workdir(&self, path: impl Into<String>) -> Directory {
6418        let mut query = self.selection.select("workdir");
6419        query = query.arg("path", path.into());
6420        Directory {
6421            proc: self.proc.clone(),
6422            selection: query,
6423            graphql_client: self.graphql_client.clone(),
6424        }
6425    }
6426    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
6427    ///
6428    /// # Arguments
6429    ///
6430    /// * `path` - Location of the directory to access (e.g., ".").
6431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6432    pub fn workdir_opts<'a>(
6433        &self,
6434        path: impl Into<String>,
6435        opts: CurrentModuleWorkdirOpts<'a>,
6436    ) -> Directory {
6437        let mut query = self.selection.select("workdir");
6438        query = query.arg("path", path.into());
6439        if let Some(exclude) = opts.exclude {
6440            query = query.arg("exclude", exclude);
6441        }
6442        if let Some(include) = opts.include {
6443            query = query.arg("include", include);
6444        }
6445        if let Some(gitignore) = opts.gitignore {
6446            query = query.arg("gitignore", gitignore);
6447        }
6448        Directory {
6449            proc: self.proc.clone(),
6450            selection: query,
6451            graphql_client: self.graphql_client.clone(),
6452        }
6453    }
6454    /// 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.
6455    ///
6456    /// # Arguments
6457    ///
6458    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6459    pub fn workdir_file(&self, path: impl Into<String>) -> File {
6460        let mut query = self.selection.select("workdirFile");
6461        query = query.arg("path", path.into());
6462        File {
6463            proc: self.proc.clone(),
6464            selection: query,
6465            graphql_client: self.graphql_client.clone(),
6466        }
6467    }
6468}
6469impl Node for CurrentModule {
6470    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6471        let query = self.selection.select("id");
6472        let graphql_client = self.graphql_client.clone();
6473        async move { query.execute(graphql_client).await }
6474    }
6475}
6476#[derive(Clone)]
6477pub struct DiffStat {
6478    pub proc: Option<Arc<DaggerSessionProc>>,
6479    pub selection: Selection,
6480    pub graphql_client: DynGraphQLClient,
6481}
6482impl IntoID<Id> for DiffStat {
6483    fn into_id(
6484        self,
6485    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6486        Box::pin(async move { self.id().await })
6487    }
6488}
6489impl Loadable for DiffStat {
6490    fn graphql_type() -> &'static str {
6491        "DiffStat"
6492    }
6493    fn from_query(
6494        proc: Option<Arc<DaggerSessionProc>>,
6495        selection: Selection,
6496        graphql_client: DynGraphQLClient,
6497    ) -> Self {
6498        Self {
6499            proc,
6500            selection,
6501            graphql_client,
6502        }
6503    }
6504}
6505impl DiffStat {
6506    /// A unique identifier for this DiffStat.
6507    pub async fn id(&self) -> Result<Id, DaggerError> {
6508        let query = self.selection.select("id");
6509        query.execute(self.graphql_client.clone()).await
6510    }
6511    /// Path of the changed file or directory.
6512    pub async fn path(&self) -> Result<String, DaggerError> {
6513        let query = self.selection.select("path");
6514        query.execute(self.graphql_client.clone()).await
6515    }
6516    /// Previous path of the file, set only for renames.
6517    pub async fn old_path(&self) -> Result<String, DaggerError> {
6518        let query = self.selection.select("oldPath");
6519        query.execute(self.graphql_client.clone()).await
6520    }
6521    /// Type of change.
6522    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6523        let query = self.selection.select("kind");
6524        query.execute(self.graphql_client.clone()).await
6525    }
6526    /// Number of added lines for this path.
6527    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6528        let query = self.selection.select("addedLines");
6529        query.execute(self.graphql_client.clone()).await
6530    }
6531    /// Number of removed lines for this path.
6532    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6533        let query = self.selection.select("removedLines");
6534        query.execute(self.graphql_client.clone()).await
6535    }
6536}
6537impl Node for DiffStat {
6538    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6539        let query = self.selection.select("id");
6540        let graphql_client = self.graphql_client.clone();
6541        async move { query.execute(graphql_client).await }
6542    }
6543}
6544#[derive(Clone)]
6545pub struct Directory {
6546    pub proc: Option<Arc<DaggerSessionProc>>,
6547    pub selection: Selection,
6548    pub graphql_client: DynGraphQLClient,
6549}
6550#[derive(Builder, Debug, PartialEq)]
6551pub struct DirectoryEntriesOpts<'a> {
6552    /// Location of the directory to look at (e.g., "/src").
6553    #[builder(setter(into, strip_option), default)]
6554    pub path: Option<&'a str>,
6555}
6556#[derive(Builder, Debug, PartialEq)]
6557pub struct DirectorySearchOpts<'a> {
6558    /// Allow the . pattern to match newlines in multiline mode.
6559    #[builder(setter(into, strip_option), default)]
6560    pub dotall: Option<bool>,
6561    /// Only return matching files, not lines and content
6562    #[builder(setter(into, strip_option), default)]
6563    pub files_only: Option<bool>,
6564    /// Glob patterns to match (e.g., "*.md")
6565    #[builder(setter(into, strip_option), default)]
6566    pub globs: Option<Vec<&'a str>>,
6567    /// Enable case-insensitive matching.
6568    #[builder(setter(into, strip_option), default)]
6569    pub insensitive: Option<bool>,
6570    /// Limit the number of results to return
6571    #[builder(setter(into, strip_option), default)]
6572    pub limit: Option<isize>,
6573    /// Interpret the pattern as a literal string instead of a regular expression.
6574    #[builder(setter(into, strip_option), default)]
6575    pub literal: Option<bool>,
6576    /// Enable searching across multiple lines.
6577    #[builder(setter(into, strip_option), default)]
6578    pub multiline: Option<bool>,
6579    /// Directory or file paths to search
6580    #[builder(setter(into, strip_option), default)]
6581    pub paths: Option<Vec<&'a str>>,
6582    /// Skip hidden files (files starting with .).
6583    #[builder(setter(into, strip_option), default)]
6584    pub skip_hidden: Option<bool>,
6585    /// Honor .gitignore, .ignore, and .rgignore files.
6586    #[builder(setter(into, strip_option), default)]
6587    pub skip_ignored: Option<bool>,
6588}
6589#[derive(Builder, Debug, PartialEq)]
6590pub struct DirectoryWithFileOpts<'a> {
6591    /// A user:group to set for the copied directory and its contents.
6592    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6593    /// If the group is omitted, it defaults to the same as the user.
6594    #[builder(setter(into, strip_option), default)]
6595    pub owner: Option<&'a str>,
6596    /// Permission given to the copied file (e.g., 0600).
6597    #[builder(setter(into, strip_option), default)]
6598    pub permissions: Option<isize>,
6599}
6600#[derive(Builder, Debug, PartialEq)]
6601pub struct DirectoryWithFilesOpts {
6602    /// Permission given to the copied files (e.g., 0600).
6603    #[builder(setter(into, strip_option), default)]
6604    pub permissions: Option<isize>,
6605}
6606#[derive(Builder, Debug, PartialEq)]
6607pub struct DirectoryWithNewFileOpts {
6608    /// Permissions of the new file. Example: 0600
6609    #[builder(setter(into, strip_option), default)]
6610    pub permissions: Option<isize>,
6611}
6612#[derive(Builder, Debug, PartialEq)]
6613pub struct DirectoryExistsOpts {
6614    /// If specified, do not follow symlinks.
6615    #[builder(setter(into, strip_option), default)]
6616    pub do_not_follow_symlinks: Option<bool>,
6617    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
6618    #[builder(setter(into, strip_option), default)]
6619    pub expected_type: Option<ExistsType>,
6620}
6621#[derive(Builder, Debug, PartialEq)]
6622pub struct DirectoryStatOpts {
6623    /// If specified, do not follow symlinks.
6624    #[builder(setter(into, strip_option), default)]
6625    pub do_not_follow_symlinks: Option<bool>,
6626}
6627#[derive(Builder, Debug, PartialEq)]
6628pub struct DirectoryWithDirectoryOpts<'a> {
6629    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6630    #[builder(setter(into, strip_option), default)]
6631    pub exclude: Option<Vec<&'a str>>,
6632    /// Apply .gitignore filter rules inside the directory
6633    #[builder(setter(into, strip_option), default)]
6634    pub gitignore: Option<bool>,
6635    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6636    #[builder(setter(into, strip_option), default)]
6637    pub include: Option<Vec<&'a str>>,
6638    /// A user:group to set for the copied directory and its contents.
6639    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6640    /// If the group is omitted, it defaults to the same as the user.
6641    #[builder(setter(into, strip_option), default)]
6642    pub owner: Option<&'a str>,
6643    /// Permission given to the copied directory and contents (e.g., 0755).
6644    #[builder(setter(into, strip_option), default)]
6645    pub permissions: Option<isize>,
6646}
6647#[derive(Builder, Debug, PartialEq)]
6648pub struct DirectoryFilterOpts<'a> {
6649    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
6650    #[builder(setter(into, strip_option), default)]
6651    pub exclude: Option<Vec<&'a str>>,
6652    /// If set, apply .gitignore rules when filtering the directory.
6653    #[builder(setter(into, strip_option), default)]
6654    pub gitignore: Option<bool>,
6655    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
6656    #[builder(setter(into, strip_option), default)]
6657    pub include: Option<Vec<&'a str>>,
6658}
6659#[derive(Builder, Debug, PartialEq)]
6660pub struct DirectoryWithNewDirectoryOpts {
6661    /// Permission granted to the created directory (e.g., 0777).
6662    #[builder(setter(into, strip_option), default)]
6663    pub permissions: Option<isize>,
6664}
6665#[derive(Builder, Debug, PartialEq)]
6666pub struct DirectoryExportOpts {
6667    /// 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.
6668    #[builder(setter(into, strip_option), default)]
6669    pub wipe: Option<bool>,
6670}
6671#[derive(Builder, Debug, PartialEq)]
6672pub struct DirectoryDockerBuildOpts<'a> {
6673    /// Build arguments to use in the build.
6674    #[builder(setter(into, strip_option), default)]
6675    pub build_args: Option<Vec<BuildArg>>,
6676    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
6677    #[builder(setter(into, strip_option), default)]
6678    pub dockerfile: Option<&'a str>,
6679    /// If set, skip the automatic init process injected into containers created by RUN statements.
6680    /// 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.
6681    #[builder(setter(into, strip_option), default)]
6682    pub no_init: Option<bool>,
6683    /// The platform to build.
6684    #[builder(setter(into, strip_option), default)]
6685    pub platform: Option<Platform>,
6686    /// Secrets to pass to the build.
6687    /// They will be mounted at /run/secrets/[secret-name].
6688    #[builder(setter(into, strip_option), default)]
6689    pub secrets: Option<Vec<Id>>,
6690    /// A socket to use for SSH authentication during the build
6691    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
6692    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
6693    #[builder(setter(into, strip_option), default)]
6694    pub ssh: Option<Id>,
6695    /// Target build stage to build.
6696    #[builder(setter(into, strip_option), default)]
6697    pub target: Option<&'a str>,
6698}
6699#[derive(Builder, Debug, PartialEq)]
6700pub struct DirectoryWithPatchOpts {
6701    /// 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.
6702    #[builder(setter(into, strip_option), default)]
6703    pub on_conflict: Option<PatchConflict>,
6704}
6705#[derive(Builder, Debug, PartialEq)]
6706pub struct DirectoryWithPatchFileOpts {
6707    /// 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.
6708    #[builder(setter(into, strip_option), default)]
6709    pub on_conflict: Option<PatchConflict>,
6710}
6711#[derive(Builder, Debug, PartialEq)]
6712pub struct DirectoryAsWorkspaceOpts<'a> {
6713    /// Current working directory inside the workspace root. Defaults to the workspace root.
6714    #[builder(setter(into, strip_option), default)]
6715    pub cwd: Option<&'a str>,
6716}
6717#[derive(Builder, Debug, PartialEq)]
6718pub struct DirectoryTerminalOpts<'a> {
6719    /// If set, override the container's default terminal command and invoke these command arguments instead.
6720    #[builder(setter(into, strip_option), default)]
6721    pub cmd: Option<Vec<&'a str>>,
6722    /// If set, override the default container used for the terminal.
6723    #[builder(setter(into, strip_option), default)]
6724    pub container: Option<Id>,
6725    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
6726    #[builder(setter(into, strip_option), default)]
6727    pub disable_dagger_in_dagger: Option<bool>,
6728    #[builder(setter(into, strip_option), default)]
6729    pub experimental_privileged_nesting: Option<bool>,
6730    /// 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.
6731    #[builder(setter(into, strip_option), default)]
6732    pub insecure_root_capabilities: Option<bool>,
6733}
6734#[derive(Builder, Debug, PartialEq)]
6735pub struct DirectoryAsModuleOpts<'a> {
6736    /// An optional subpath of the directory which contains the module's configuration file.
6737    /// If not set, the module source code is loaded from the root of the directory.
6738    #[builder(setter(into, strip_option), default)]
6739    pub source_root_path: Option<&'a str>,
6740}
6741#[derive(Builder, Debug, PartialEq)]
6742pub struct DirectoryAsModuleSourceOpts<'a> {
6743    /// An optional subpath of the directory which contains the module's configuration file.
6744    /// If not set, the module source code is loaded from the root of the directory.
6745    #[builder(setter(into, strip_option), default)]
6746    pub source_root_path: Option<&'a str>,
6747}
6748impl IntoID<Id> for Directory {
6749    fn into_id(
6750        self,
6751    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6752        Box::pin(async move { self.id().await })
6753    }
6754}
6755impl Loadable for Directory {
6756    fn graphql_type() -> &'static str {
6757        "Directory"
6758    }
6759    fn from_query(
6760        proc: Option<Arc<DaggerSessionProc>>,
6761        selection: Selection,
6762        graphql_client: DynGraphQLClient,
6763    ) -> Self {
6764        Self {
6765            proc,
6766            selection,
6767            graphql_client,
6768        }
6769    }
6770}
6771impl Directory {
6772    /// A unique identifier for this Directory.
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    /// Force evaluation in the engine.
6778    pub async fn sync(&self) -> Result<Directory, DaggerError> {
6779        let query = self.selection.select("sync");
6780        let id: Id = query.execute(self.graphql_client.clone()).await?;
6781        Ok(Directory {
6782            proc: self.proc.clone(),
6783            selection: query
6784                .root()
6785                .select("node")
6786                .arg("id", &id.0)
6787                .inline_fragment("Directory"),
6788            graphql_client: self.graphql_client.clone(),
6789        })
6790    }
6791    /// Returns the name of the directory.
6792    pub async fn name(&self) -> Result<String, DaggerError> {
6793        let query = self.selection.select("name");
6794        query.execute(self.graphql_client.clone()).await
6795    }
6796    /// Returns a list of files and directories at the given path.
6797    ///
6798    /// # Arguments
6799    ///
6800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6801    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6802        let query = self.selection.select("entries");
6803        query.execute(self.graphql_client.clone()).await
6804    }
6805    /// Returns a list of files and directories at the given path.
6806    ///
6807    /// # Arguments
6808    ///
6809    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6810    pub async fn entries_opts<'a>(
6811        &self,
6812        opts: DirectoryEntriesOpts<'a>,
6813    ) -> Result<Vec<String>, DaggerError> {
6814        let mut query = self.selection.select("entries");
6815        if let Some(path) = opts.path {
6816            query = query.arg("path", path);
6817        }
6818        query.execute(self.graphql_client.clone()).await
6819    }
6820    /// Returns a list of files and directories that matche the given pattern.
6821    ///
6822    /// # Arguments
6823    ///
6824    /// * `pattern` - Pattern to match (e.g., "*.md").
6825    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6826        let mut query = self.selection.select("glob");
6827        query = query.arg("pattern", pattern.into());
6828        query.execute(self.graphql_client.clone()).await
6829    }
6830    /// Searches for content matching the given regular expression or literal string.
6831    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6832    ///
6833    /// # Arguments
6834    ///
6835    /// * `pattern` - The text to match.
6836    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6837    pub async fn search(
6838        &self,
6839        pattern: impl Into<String>,
6840    ) -> Result<Vec<SearchResult>, DaggerError> {
6841        let mut query = self.selection.select("search");
6842        query = query.arg("pattern", pattern.into());
6843        let query = query.select("id");
6844        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6845        Ok(ids
6846            .into_iter()
6847            .map(|id| SearchResult {
6848                proc: self.proc.clone(),
6849                selection: crate::querybuilder::query()
6850                    .select("node")
6851                    .arg("id", &id.0)
6852                    .inline_fragment("SearchResult"),
6853                graphql_client: self.graphql_client.clone(),
6854            })
6855            .collect())
6856    }
6857    /// Searches for content matching the given regular expression or literal string.
6858    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6859    ///
6860    /// # Arguments
6861    ///
6862    /// * `pattern` - The text to match.
6863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6864    pub async fn search_opts<'a>(
6865        &self,
6866        pattern: impl Into<String>,
6867        opts: DirectorySearchOpts<'a>,
6868    ) -> Result<Vec<SearchResult>, DaggerError> {
6869        let mut query = self.selection.select("search");
6870        query = query.arg("pattern", pattern.into());
6871        if let Some(paths) = opts.paths {
6872            query = query.arg("paths", paths);
6873        }
6874        if let Some(globs) = opts.globs {
6875            query = query.arg("globs", globs);
6876        }
6877        if let Some(literal) = opts.literal {
6878            query = query.arg("literal", literal);
6879        }
6880        if let Some(multiline) = opts.multiline {
6881            query = query.arg("multiline", multiline);
6882        }
6883        if let Some(dotall) = opts.dotall {
6884            query = query.arg("dotall", dotall);
6885        }
6886        if let Some(insensitive) = opts.insensitive {
6887            query = query.arg("insensitive", insensitive);
6888        }
6889        if let Some(skip_ignored) = opts.skip_ignored {
6890            query = query.arg("skipIgnored", skip_ignored);
6891        }
6892        if let Some(skip_hidden) = opts.skip_hidden {
6893            query = query.arg("skipHidden", skip_hidden);
6894        }
6895        if let Some(files_only) = opts.files_only {
6896            query = query.arg("filesOnly", files_only);
6897        }
6898        if let Some(limit) = opts.limit {
6899            query = query.arg("limit", limit);
6900        }
6901        let query = query.select("id");
6902        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6903        Ok(ids
6904            .into_iter()
6905            .map(|id| SearchResult {
6906                proc: self.proc.clone(),
6907                selection: crate::querybuilder::query()
6908                    .select("node")
6909                    .arg("id", &id.0)
6910                    .inline_fragment("SearchResult"),
6911                graphql_client: self.graphql_client.clone(),
6912            })
6913            .collect())
6914    }
6915    /// 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.
6916    pub async fn digest(&self) -> Result<String, DaggerError> {
6917        let query = self.selection.select("digest");
6918        query.execute(self.graphql_client.clone()).await
6919    }
6920    /// Retrieve a file at the given path.
6921    ///
6922    /// # Arguments
6923    ///
6924    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6925    pub fn file(&self, path: impl Into<String>) -> File {
6926        let mut query = self.selection.select("file");
6927        query = query.arg("path", path.into());
6928        File {
6929            proc: self.proc.clone(),
6930            selection: query,
6931            graphql_client: self.graphql_client.clone(),
6932        }
6933    }
6934    /// Retrieves this directory plus the contents of the given file copied to the given path.
6935    ///
6936    /// # Arguments
6937    ///
6938    /// * `path` - Location of the copied file (e.g., "/file.txt").
6939    /// * `source` - Identifier of the file to copy.
6940    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6941    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6942        let mut query = self.selection.select("withFile");
6943        query = query.arg("path", path.into());
6944        query = query.arg_lazy(
6945            "source",
6946            Box::new(move || {
6947                let source = source.clone();
6948                Box::pin(async move { source.into_id().await.unwrap().quote() })
6949            }),
6950        );
6951        Directory {
6952            proc: self.proc.clone(),
6953            selection: query,
6954            graphql_client: self.graphql_client.clone(),
6955        }
6956    }
6957    /// Retrieves this directory plus the contents of the given file copied to the given path.
6958    ///
6959    /// # Arguments
6960    ///
6961    /// * `path` - Location of the copied file (e.g., "/file.txt").
6962    /// * `source` - Identifier of the file to copy.
6963    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6964    pub fn with_file_opts<'a>(
6965        &self,
6966        path: impl Into<String>,
6967        source: impl IntoID<Id>,
6968        opts: DirectoryWithFileOpts<'a>,
6969    ) -> Directory {
6970        let mut query = self.selection.select("withFile");
6971        query = query.arg("path", path.into());
6972        query = query.arg_lazy(
6973            "source",
6974            Box::new(move || {
6975                let source = source.clone();
6976                Box::pin(async move { source.into_id().await.unwrap().quote() })
6977            }),
6978        );
6979        if let Some(permissions) = opts.permissions {
6980            query = query.arg("permissions", permissions);
6981        }
6982        if let Some(owner) = opts.owner {
6983            query = query.arg("owner", owner);
6984        }
6985        Directory {
6986            proc: self.proc.clone(),
6987            selection: query,
6988            graphql_client: self.graphql_client.clone(),
6989        }
6990    }
6991    /// Retrieves this directory plus the contents of the given files copied to the given path.
6992    ///
6993    /// # Arguments
6994    ///
6995    /// * `path` - Location where copied files should be placed (e.g., "/src").
6996    /// * `sources` - Identifiers of the files to copy.
6997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6998    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
6999        let mut query = self.selection.select("withFiles");
7000        query = query.arg("path", path.into());
7001        query = query.arg("sources", sources);
7002        Directory {
7003            proc: self.proc.clone(),
7004            selection: query,
7005            graphql_client: self.graphql_client.clone(),
7006        }
7007    }
7008    /// Retrieves this directory plus the contents of the given files copied to the given path.
7009    ///
7010    /// # Arguments
7011    ///
7012    /// * `path` - Location where copied files should be placed (e.g., "/src").
7013    /// * `sources` - Identifiers of the files to copy.
7014    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7015    pub fn with_files_opts(
7016        &self,
7017        path: impl Into<String>,
7018        sources: Vec<Id>,
7019        opts: DirectoryWithFilesOpts,
7020    ) -> Directory {
7021        let mut query = self.selection.select("withFiles");
7022        query = query.arg("path", path.into());
7023        query = query.arg("sources", sources);
7024        if let Some(permissions) = opts.permissions {
7025            query = query.arg("permissions", permissions);
7026        }
7027        Directory {
7028            proc: self.proc.clone(),
7029            selection: query,
7030            graphql_client: self.graphql_client.clone(),
7031        }
7032    }
7033    /// Return a snapshot with a new file added
7034    ///
7035    /// # Arguments
7036    ///
7037    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7038    /// * `contents` - Contents of the new file. Example: "Hello world!"
7039    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7040    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7041        let mut query = self.selection.select("withNewFile");
7042        query = query.arg("path", path.into());
7043        query = query.arg("contents", contents.into());
7044        Directory {
7045            proc: self.proc.clone(),
7046            selection: query,
7047            graphql_client: self.graphql_client.clone(),
7048        }
7049    }
7050    /// Return a snapshot with a new file added
7051    ///
7052    /// # Arguments
7053    ///
7054    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7055    /// * `contents` - Contents of the new file. Example: "Hello world!"
7056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7057    pub fn with_new_file_opts(
7058        &self,
7059        path: impl Into<String>,
7060        contents: impl Into<String>,
7061        opts: DirectoryWithNewFileOpts,
7062    ) -> Directory {
7063        let mut query = self.selection.select("withNewFile");
7064        query = query.arg("path", path.into());
7065        query = query.arg("contents", contents.into());
7066        if let Some(permissions) = opts.permissions {
7067            query = query.arg("permissions", permissions);
7068        }
7069        Directory {
7070            proc: self.proc.clone(),
7071            selection: query,
7072            graphql_client: self.graphql_client.clone(),
7073        }
7074    }
7075    /// Return a snapshot with a file removed
7076    ///
7077    /// # Arguments
7078    ///
7079    /// * `path` - Path of the file to remove (e.g., "/file.txt").
7080    pub fn without_file(&self, path: impl Into<String>) -> Directory {
7081        let mut query = self.selection.select("withoutFile");
7082        query = query.arg("path", path.into());
7083        Directory {
7084            proc: self.proc.clone(),
7085            selection: query,
7086            graphql_client: self.graphql_client.clone(),
7087        }
7088    }
7089    /// Return a snapshot with files removed
7090    ///
7091    /// # Arguments
7092    ///
7093    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
7094    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7095        let mut query = self.selection.select("withoutFiles");
7096        query = query.arg(
7097            "paths",
7098            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7099        );
7100        Directory {
7101            proc: self.proc.clone(),
7102            selection: query,
7103            graphql_client: self.graphql_client.clone(),
7104        }
7105    }
7106    /// check if a file or directory exists
7107    ///
7108    /// # Arguments
7109    ///
7110    /// * `path` - Path to check (e.g., "/file.txt").
7111    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7112    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
7113        let mut query = self.selection.select("exists");
7114        query = query.arg("path", path.into());
7115        query.execute(self.graphql_client.clone()).await
7116    }
7117    /// check if a file or directory exists
7118    ///
7119    /// # Arguments
7120    ///
7121    /// * `path` - Path to check (e.g., "/file.txt").
7122    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7123    pub async fn exists_opts(
7124        &self,
7125        path: impl Into<String>,
7126        opts: DirectoryExistsOpts,
7127    ) -> Result<bool, DaggerError> {
7128        let mut query = self.selection.select("exists");
7129        query = query.arg("path", path.into());
7130        if let Some(expected_type) = opts.expected_type {
7131            query = query.arg("expectedType", expected_type);
7132        }
7133        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7134            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7135        }
7136        query.execute(self.graphql_client.clone()).await
7137    }
7138    /// Return file status
7139    ///
7140    /// # Arguments
7141    ///
7142    /// * `path` - Path to stat (e.g., "/file.txt").
7143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7144    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
7145        let mut query = self.selection.select("stat");
7146        query = query.arg("path", path.into());
7147        let query = query.select("id");
7148        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7149        Ok(id.map(|id| Stat {
7150            proc: self.proc.clone(),
7151            selection: query
7152                .root()
7153                .select("node")
7154                .arg("id", &id.0)
7155                .inline_fragment("Stat"),
7156            graphql_client: self.graphql_client.clone(),
7157        }))
7158    }
7159    /// Return file status
7160    ///
7161    /// # Arguments
7162    ///
7163    /// * `path` - Path to stat (e.g., "/file.txt").
7164    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7165    pub async fn stat_opts(
7166        &self,
7167        path: impl Into<String>,
7168        opts: DirectoryStatOpts,
7169    ) -> Result<Option<Stat>, DaggerError> {
7170        let mut query = self.selection.select("stat");
7171        query = query.arg("path", path.into());
7172        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7173            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7174        }
7175        let query = query.select("id");
7176        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7177        Ok(id.map(|id| Stat {
7178            proc: self.proc.clone(),
7179            selection: query
7180                .root()
7181                .select("node")
7182                .arg("id", &id.0)
7183                .inline_fragment("Stat"),
7184            graphql_client: self.graphql_client.clone(),
7185        }))
7186    }
7187    /// Retrieves a directory at the given path.
7188    ///
7189    /// # Arguments
7190    ///
7191    /// * `path` - Location of the directory to retrieve. Example: "/src"
7192    pub fn directory(&self, path: impl Into<String>) -> Directory {
7193        let mut query = self.selection.select("directory");
7194        query = query.arg("path", path.into());
7195        Directory {
7196            proc: self.proc.clone(),
7197            selection: query,
7198            graphql_client: self.graphql_client.clone(),
7199        }
7200    }
7201    /// Return a snapshot with a directory added
7202    ///
7203    /// # Arguments
7204    ///
7205    /// * `path` - Location of the written directory (e.g., "/src/").
7206    /// * `source` - Identifier of the directory to copy.
7207    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7208    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
7209        let mut query = self.selection.select("withDirectory");
7210        query = query.arg("path", path.into());
7211        query = query.arg_lazy(
7212            "source",
7213            Box::new(move || {
7214                let source = source.clone();
7215                Box::pin(async move { source.into_id().await.unwrap().quote() })
7216            }),
7217        );
7218        Directory {
7219            proc: self.proc.clone(),
7220            selection: query,
7221            graphql_client: self.graphql_client.clone(),
7222        }
7223    }
7224    /// Return a snapshot with a directory added
7225    ///
7226    /// # Arguments
7227    ///
7228    /// * `path` - Location of the written directory (e.g., "/src/").
7229    /// * `source` - Identifier of the directory to copy.
7230    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7231    pub fn with_directory_opts<'a>(
7232        &self,
7233        path: impl Into<String>,
7234        source: impl IntoID<Id>,
7235        opts: DirectoryWithDirectoryOpts<'a>,
7236    ) -> Directory {
7237        let mut query = self.selection.select("withDirectory");
7238        query = query.arg("path", path.into());
7239        query = query.arg_lazy(
7240            "source",
7241            Box::new(move || {
7242                let source = source.clone();
7243                Box::pin(async move { source.into_id().await.unwrap().quote() })
7244            }),
7245        );
7246        if let Some(exclude) = opts.exclude {
7247            query = query.arg("exclude", exclude);
7248        }
7249        if let Some(include) = opts.include {
7250            query = query.arg("include", include);
7251        }
7252        if let Some(gitignore) = opts.gitignore {
7253            query = query.arg("gitignore", gitignore);
7254        }
7255        if let Some(owner) = opts.owner {
7256            query = query.arg("owner", owner);
7257        }
7258        if let Some(permissions) = opts.permissions {
7259            query = query.arg("permissions", permissions);
7260        }
7261        Directory {
7262            proc: self.proc.clone(),
7263            selection: query,
7264            graphql_client: self.graphql_client.clone(),
7265        }
7266    }
7267    /// Return a snapshot with some paths included or excluded
7268    ///
7269    /// # Arguments
7270    ///
7271    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7272    pub fn filter(&self) -> Directory {
7273        let query = self.selection.select("filter");
7274        Directory {
7275            proc: self.proc.clone(),
7276            selection: query,
7277            graphql_client: self.graphql_client.clone(),
7278        }
7279    }
7280    /// Return a snapshot with some paths included or excluded
7281    ///
7282    /// # Arguments
7283    ///
7284    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7285    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
7286        let mut query = self.selection.select("filter");
7287        if let Some(exclude) = opts.exclude {
7288            query = query.arg("exclude", exclude);
7289        }
7290        if let Some(include) = opts.include {
7291            query = query.arg("include", include);
7292        }
7293        if let Some(gitignore) = opts.gitignore {
7294            query = query.arg("gitignore", gitignore);
7295        }
7296        Directory {
7297            proc: self.proc.clone(),
7298            selection: query,
7299            graphql_client: self.graphql_client.clone(),
7300        }
7301    }
7302    /// Retrieves this directory plus a new directory created at the given path.
7303    ///
7304    /// # Arguments
7305    ///
7306    /// * `path` - Location of the directory created (e.g., "/logs").
7307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7308    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
7309        let mut query = self.selection.select("withNewDirectory");
7310        query = query.arg("path", path.into());
7311        Directory {
7312            proc: self.proc.clone(),
7313            selection: query,
7314            graphql_client: self.graphql_client.clone(),
7315        }
7316    }
7317    /// Retrieves this directory plus a new directory created at the given path.
7318    ///
7319    /// # Arguments
7320    ///
7321    /// * `path` - Location of the directory created (e.g., "/logs").
7322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7323    pub fn with_new_directory_opts(
7324        &self,
7325        path: impl Into<String>,
7326        opts: DirectoryWithNewDirectoryOpts,
7327    ) -> Directory {
7328        let mut query = self.selection.select("withNewDirectory");
7329        query = query.arg("path", path.into());
7330        if let Some(permissions) = opts.permissions {
7331            query = query.arg("permissions", permissions);
7332        }
7333        Directory {
7334            proc: self.proc.clone(),
7335            selection: query,
7336            graphql_client: self.graphql_client.clone(),
7337        }
7338    }
7339    /// Return a snapshot with a subdirectory removed
7340    ///
7341    /// # Arguments
7342    ///
7343    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
7344    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7345        let mut query = self.selection.select("withoutDirectory");
7346        query = query.arg("path", path.into());
7347        Directory {
7348            proc: self.proc.clone(),
7349            selection: query,
7350            graphql_client: self.graphql_client.clone(),
7351        }
7352    }
7353    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
7354    ///
7355    /// # Arguments
7356    ///
7357    /// * `other` - The directory to compare against
7358    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
7359        let mut query = self.selection.select("diff");
7360        query = query.arg_lazy(
7361            "other",
7362            Box::new(move || {
7363                let other = other.clone();
7364                Box::pin(async move { other.into_id().await.unwrap().quote() })
7365            }),
7366        );
7367        Directory {
7368            proc: self.proc.clone(),
7369            selection: query,
7370            graphql_client: self.graphql_client.clone(),
7371        }
7372    }
7373    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
7374    ///
7375    /// # Arguments
7376    ///
7377    /// * `name` - The name of the file or directory to search for
7378    /// * `start` - The path to start the search from
7379    pub async fn find_up(
7380        &self,
7381        name: impl Into<String>,
7382        start: impl Into<String>,
7383    ) -> Result<String, DaggerError> {
7384        let mut query = self.selection.select("findUp");
7385        query = query.arg("name", name.into());
7386        query = query.arg("start", start.into());
7387        query.execute(self.graphql_client.clone()).await
7388    }
7389    /// Return the difference between this directory and another directory, typically an older snapshot.
7390    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
7391    ///
7392    /// # Arguments
7393    ///
7394    /// * `from` - The base directory snapshot to compare against
7395    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
7396        let mut query = self.selection.select("changes");
7397        query = query.arg_lazy(
7398            "from",
7399            Box::new(move || {
7400                let from = from.clone();
7401                Box::pin(async move { from.into_id().await.unwrap().quote() })
7402            }),
7403        );
7404        Changeset {
7405            proc: self.proc.clone(),
7406            selection: query,
7407            graphql_client: self.graphql_client.clone(),
7408        }
7409    }
7410    /// Return a directory with changes from another directory applied to it.
7411    ///
7412    /// # Arguments
7413    ///
7414    /// * `changes` - Changes to apply to the directory
7415    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
7416        let mut query = self.selection.select("withChanges");
7417        query = query.arg_lazy(
7418            "changes",
7419            Box::new(move || {
7420                let changes = changes.clone();
7421                Box::pin(async move { changes.into_id().await.unwrap().quote() })
7422            }),
7423        );
7424        Directory {
7425            proc: self.proc.clone(),
7426            selection: query,
7427            graphql_client: self.graphql_client.clone(),
7428        }
7429    }
7430    /// Writes the contents of the directory to a path on the host.
7431    ///
7432    /// # Arguments
7433    ///
7434    /// * `path` - Location of the copied directory (e.g., "logs/").
7435    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7436    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7437        let mut query = self.selection.select("export");
7438        query = query.arg("path", path.into());
7439        query.execute(self.graphql_client.clone()).await
7440    }
7441    /// Writes the contents of the directory to a path on the host.
7442    ///
7443    /// # Arguments
7444    ///
7445    /// * `path` - Location of the copied directory (e.g., "logs/").
7446    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7447    pub async fn export_opts(
7448        &self,
7449        path: impl Into<String>,
7450        opts: DirectoryExportOpts,
7451    ) -> Result<String, DaggerError> {
7452        let mut query = self.selection.select("export");
7453        query = query.arg("path", path.into());
7454        if let Some(wipe) = opts.wipe {
7455            query = query.arg("wipe", wipe);
7456        }
7457        query.execute(self.graphql_client.clone()).await
7458    }
7459    /// 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.
7460    ///
7461    /// # Arguments
7462    ///
7463    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7464    pub fn docker_build(&self) -> Container {
7465        let query = self.selection.select("dockerBuild");
7466        Container {
7467            proc: self.proc.clone(),
7468            selection: query,
7469            graphql_client: self.graphql_client.clone(),
7470        }
7471    }
7472    /// 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.
7473    ///
7474    /// # Arguments
7475    ///
7476    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7477    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
7478        let mut query = self.selection.select("dockerBuild");
7479        if let Some(dockerfile) = opts.dockerfile {
7480            query = query.arg("dockerfile", dockerfile);
7481        }
7482        if let Some(platform) = opts.platform {
7483            query = query.arg("platform", platform);
7484        }
7485        if let Some(build_args) = opts.build_args {
7486            query = query.arg("buildArgs", build_args);
7487        }
7488        if let Some(target) = opts.target {
7489            query = query.arg("target", target);
7490        }
7491        if let Some(secrets) = opts.secrets {
7492            query = query.arg("secrets", secrets);
7493        }
7494        if let Some(no_init) = opts.no_init {
7495            query = query.arg("noInit", no_init);
7496        }
7497        if let Some(ssh) = opts.ssh {
7498            query = query.arg("ssh", ssh);
7499        }
7500        Container {
7501            proc: self.proc.clone(),
7502            selection: query,
7503            graphql_client: self.graphql_client.clone(),
7504        }
7505    }
7506    /// Retrieves this directory with all file/dir timestamps set to the given time.
7507    ///
7508    /// # Arguments
7509    ///
7510    /// * `timestamp` - Timestamp to set dir/files in.
7511    ///
7512    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7513    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7514        let mut query = self.selection.select("withTimestamps");
7515        query = query.arg("timestamp", timestamp);
7516        Directory {
7517            proc: self.proc.clone(),
7518            selection: query,
7519            graphql_client: self.graphql_client.clone(),
7520        }
7521    }
7522    /// Retrieves this directory with the given Git-compatible patch applied.
7523    ///
7524    /// # Arguments
7525    ///
7526    /// * `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").
7527    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7528    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
7529        let mut query = self.selection.select("withPatch");
7530        query = query.arg("patch", patch.into());
7531        Directory {
7532            proc: self.proc.clone(),
7533            selection: query,
7534            graphql_client: self.graphql_client.clone(),
7535        }
7536    }
7537    /// Retrieves this directory with the given Git-compatible patch applied.
7538    ///
7539    /// # Arguments
7540    ///
7541    /// * `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").
7542    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7543    pub fn with_patch_opts(
7544        &self,
7545        patch: impl Into<String>,
7546        opts: DirectoryWithPatchOpts,
7547    ) -> Directory {
7548        let mut query = self.selection.select("withPatch");
7549        query = query.arg("patch", patch.into());
7550        if let Some(on_conflict) = opts.on_conflict {
7551            query = query.arg("onConflict", on_conflict);
7552        }
7553        Directory {
7554            proc: self.proc.clone(),
7555            selection: query,
7556            graphql_client: self.graphql_client.clone(),
7557        }
7558    }
7559    /// Retrieves this directory with the given Git-compatible patch file applied.
7560    ///
7561    /// # Arguments
7562    ///
7563    /// * `patch` - File containing the patch to apply
7564    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7565    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
7566        let mut query = self.selection.select("withPatchFile");
7567        query = query.arg_lazy(
7568            "patch",
7569            Box::new(move || {
7570                let patch = patch.clone();
7571                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7572            }),
7573        );
7574        Directory {
7575            proc: self.proc.clone(),
7576            selection: query,
7577            graphql_client: self.graphql_client.clone(),
7578        }
7579    }
7580    /// Retrieves this directory with the given Git-compatible patch file applied.
7581    ///
7582    /// # Arguments
7583    ///
7584    /// * `patch` - File containing the patch to apply
7585    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7586    pub fn with_patch_file_opts(
7587        &self,
7588        patch: impl IntoID<Id>,
7589        opts: DirectoryWithPatchFileOpts,
7590    ) -> Directory {
7591        let mut query = self.selection.select("withPatchFile");
7592        query = query.arg_lazy(
7593            "patch",
7594            Box::new(move || {
7595                let patch = patch.clone();
7596                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7597            }),
7598        );
7599        if let Some(on_conflict) = opts.on_conflict {
7600            query = query.arg("onConflict", on_conflict);
7601        }
7602        Directory {
7603            proc: self.proc.clone(),
7604            selection: query,
7605            graphql_client: self.graphql_client.clone(),
7606        }
7607    }
7608    /// Converts this directory to a local git repository
7609    pub fn as_git(&self) -> GitRepository {
7610        let query = self.selection.select("asGit");
7611        GitRepository {
7612            proc: self.proc.clone(),
7613            selection: query,
7614            graphql_client: self.graphql_client.clone(),
7615        }
7616    }
7617    /// Creates a synthetic workspace from this directory.
7618    ///
7619    /// # Arguments
7620    ///
7621    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7622    pub fn as_workspace(&self) -> Workspace {
7623        let query = self.selection.select("asWorkspace");
7624        Workspace {
7625            proc: self.proc.clone(),
7626            selection: query,
7627            graphql_client: self.graphql_client.clone(),
7628        }
7629    }
7630    /// Creates a synthetic workspace from this directory.
7631    ///
7632    /// # Arguments
7633    ///
7634    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7635    pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
7636        let mut query = self.selection.select("asWorkspace");
7637        if let Some(cwd) = opts.cwd {
7638            query = query.arg("cwd", cwd);
7639        }
7640        Workspace {
7641            proc: self.proc.clone(),
7642            selection: query,
7643            graphql_client: self.graphql_client.clone(),
7644        }
7645    }
7646    /// Opens an interactive terminal in new container with this directory mounted inside.
7647    ///
7648    /// # Arguments
7649    ///
7650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7651    pub fn terminal(&self) -> Directory {
7652        let query = self.selection.select("terminal");
7653        Directory {
7654            proc: self.proc.clone(),
7655            selection: query,
7656            graphql_client: self.graphql_client.clone(),
7657        }
7658    }
7659    /// Opens an interactive terminal in new container with this directory mounted inside.
7660    ///
7661    /// # Arguments
7662    ///
7663    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7664    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
7665        let mut query = self.selection.select("terminal");
7666        if let Some(container) = opts.container {
7667            query = query.arg("container", container);
7668        }
7669        if let Some(cmd) = opts.cmd {
7670            query = query.arg("cmd", cmd);
7671        }
7672        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
7673            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
7674        }
7675        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
7676            query = query.arg(
7677                "experimentalPrivilegedNesting",
7678                experimental_privileged_nesting,
7679            );
7680        }
7681        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
7682            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
7683        }
7684        Directory {
7685            proc: self.proc.clone(),
7686            selection: query,
7687            graphql_client: self.graphql_client.clone(),
7688        }
7689    }
7690    /// Return a snapshot with a symlink
7691    ///
7692    /// # Arguments
7693    ///
7694    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
7695    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
7696    pub fn with_symlink(
7697        &self,
7698        target: impl Into<String>,
7699        link_name: impl Into<String>,
7700    ) -> Directory {
7701        let mut query = self.selection.select("withSymlink");
7702        query = query.arg("target", target.into());
7703        query = query.arg("linkName", link_name.into());
7704        Directory {
7705            proc: self.proc.clone(),
7706            selection: query,
7707            graphql_client: self.graphql_client.clone(),
7708        }
7709    }
7710    /// Change the owner of the directory contents recursively.
7711    ///
7712    /// # Arguments
7713    ///
7714    /// * `path` - Path of the directory to change ownership of (e.g., "/").
7715    /// * `owner` - A user:group to set for the mounted directory and its contents.
7716    ///
7717    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
7718    ///
7719    /// If the group is omitted, it defaults to the same as the user.
7720    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
7721        let mut query = self.selection.select("chown");
7722        query = query.arg("path", path.into());
7723        query = query.arg("owner", owner.into());
7724        Directory {
7725            proc: self.proc.clone(),
7726            selection: query,
7727            graphql_client: self.graphql_client.clone(),
7728        }
7729    }
7730    /// Raise an error.
7731    ///
7732    /// # Arguments
7733    ///
7734    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
7735    pub fn with_error(&self, err: impl Into<String>) -> Directory {
7736        let mut query = self.selection.select("withError");
7737        query = query.arg("err", err.into());
7738        Directory {
7739            proc: self.proc.clone(),
7740            selection: query,
7741            graphql_client: self.graphql_client.clone(),
7742        }
7743    }
7744    /// Load the directory as a Dagger module source
7745    ///
7746    /// # Arguments
7747    ///
7748    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7749    pub fn as_module(&self) -> Module {
7750        let query = self.selection.select("asModule");
7751        Module {
7752            proc: self.proc.clone(),
7753            selection: query,
7754            graphql_client: self.graphql_client.clone(),
7755        }
7756    }
7757    /// Load the directory as a Dagger module source
7758    ///
7759    /// # Arguments
7760    ///
7761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7762    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
7763        let mut query = self.selection.select("asModule");
7764        if let Some(source_root_path) = opts.source_root_path {
7765            query = query.arg("sourceRootPath", source_root_path);
7766        }
7767        Module {
7768            proc: self.proc.clone(),
7769            selection: query,
7770            graphql_client: self.graphql_client.clone(),
7771        }
7772    }
7773    /// Load the directory as a Dagger module source
7774    ///
7775    /// # Arguments
7776    ///
7777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7778    pub fn as_module_source(&self) -> ModuleSource {
7779        let query = self.selection.select("asModuleSource");
7780        ModuleSource {
7781            proc: self.proc.clone(),
7782            selection: query,
7783            graphql_client: self.graphql_client.clone(),
7784        }
7785    }
7786    /// Load the directory as a Dagger module source
7787    ///
7788    /// # Arguments
7789    ///
7790    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7791    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
7792        let mut query = self.selection.select("asModuleSource");
7793        if let Some(source_root_path) = opts.source_root_path {
7794            query = query.arg("sourceRootPath", source_root_path);
7795        }
7796        ModuleSource {
7797            proc: self.proc.clone(),
7798            selection: query,
7799            graphql_client: self.graphql_client.clone(),
7800        }
7801    }
7802}
7803impl Exportable for Directory {
7804    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7805        let query = self.selection.select("id");
7806        let graphql_client = self.graphql_client.clone();
7807        async move { query.execute(graphql_client).await }
7808    }
7809    fn export(
7810        &self,
7811        path: impl Into<String>,
7812    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7813        let mut query = self.selection.select("export");
7814        query = query.arg("path", path.into());
7815        let graphql_client = self.graphql_client.clone();
7816        async move { query.execute(graphql_client).await }
7817    }
7818}
7819impl Node for Directory {
7820    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7821        let query = self.selection.select("id");
7822        let graphql_client = self.graphql_client.clone();
7823        async move { query.execute(graphql_client).await }
7824    }
7825}
7826impl Syncer for Directory {
7827    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7828        let query = self.selection.select("id");
7829        let graphql_client = self.graphql_client.clone();
7830        async move { query.execute(graphql_client).await }
7831    }
7832    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7833        let query = self.selection.select("sync");
7834        let proc = self.proc.clone();
7835        let graphql_client = self.graphql_client.clone();
7836        async move {
7837            let id: Id = query.execute(graphql_client.clone()).await?;
7838            Ok(Self {
7839                proc,
7840                selection: query
7841                    .root()
7842                    .select("node")
7843                    .arg("id", &id.0)
7844                    .inline_fragment("Directory"),
7845                graphql_client,
7846            })
7847        }
7848    }
7849}
7850#[derive(Clone)]
7851pub struct Engine {
7852    pub proc: Option<Arc<DaggerSessionProc>>,
7853    pub selection: Selection,
7854    pub graphql_client: DynGraphQLClient,
7855}
7856impl IntoID<Id> for Engine {
7857    fn into_id(
7858        self,
7859    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7860        Box::pin(async move { self.id().await })
7861    }
7862}
7863impl Loadable for Engine {
7864    fn graphql_type() -> &'static str {
7865        "Engine"
7866    }
7867    fn from_query(
7868        proc: Option<Arc<DaggerSessionProc>>,
7869        selection: Selection,
7870        graphql_client: DynGraphQLClient,
7871    ) -> Self {
7872        Self {
7873            proc,
7874            selection,
7875            graphql_client,
7876        }
7877    }
7878}
7879impl Engine {
7880    /// A unique identifier for this Engine.
7881    pub async fn id(&self) -> Result<Id, DaggerError> {
7882        let query = self.selection.select("id");
7883        query.execute(self.graphql_client.clone()).await
7884    }
7885    /// The list of connected client IDs
7886    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7887        let query = self.selection.select("clients");
7888        query.execute(self.graphql_client.clone()).await
7889    }
7890    /// The name of the engine instance.
7891    pub async fn name(&self) -> Result<String, DaggerError> {
7892        let query = self.selection.select("name");
7893        query.execute(self.graphql_client.clone()).await
7894    }
7895    /// The local engine cache state tracked by dagql
7896    pub fn local_cache(&self) -> EngineCache {
7897        let query = self.selection.select("localCache");
7898        EngineCache {
7899            proc: self.proc.clone(),
7900            selection: query,
7901            graphql_client: self.graphql_client.clone(),
7902        }
7903    }
7904}
7905impl Node for Engine {
7906    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7907        let query = self.selection.select("id");
7908        let graphql_client = self.graphql_client.clone();
7909        async move { query.execute(graphql_client).await }
7910    }
7911}
7912#[derive(Clone)]
7913pub struct EngineCache {
7914    pub proc: Option<Arc<DaggerSessionProc>>,
7915    pub selection: Selection,
7916    pub graphql_client: DynGraphQLClient,
7917}
7918#[derive(Builder, Debug, PartialEq)]
7919pub struct EngineCacheEntrySetOpts<'a> {
7920    #[builder(setter(into, strip_option), default)]
7921    pub key: Option<&'a str>,
7922}
7923#[derive(Builder, Debug, PartialEq)]
7924pub struct EngineCachePruneOpts<'a> {
7925    /// Override the maximum structural metadata estimate in absolute bytes. Explicit values must be positive; the configured/default value is used when omitted.
7926    #[builder(setter(into, strip_option), default)]
7927    pub max_estimated_bytes: Option<isize>,
7928    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
7929    #[builder(setter(into, strip_option), default)]
7930    pub max_used_space: Option<&'a str>,
7931    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
7932    #[builder(setter(into, strip_option), default)]
7933    pub min_free_space: Option<&'a str>,
7934    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
7935    #[builder(setter(into, strip_option), default)]
7936    pub reserved_space: Option<&'a str>,
7937    /// 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.
7938    #[builder(setter(into, strip_option), default)]
7939    pub target_estimated_bytes: Option<isize>,
7940    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
7941    #[builder(setter(into, strip_option), default)]
7942    pub target_space: Option<&'a str>,
7943    /// 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.
7944    #[builder(setter(into, strip_option), default)]
7945    pub use_default_policy: Option<bool>,
7946}
7947impl IntoID<Id> for EngineCache {
7948    fn into_id(
7949        self,
7950    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7951        Box::pin(async move { self.id().await })
7952    }
7953}
7954impl Loadable for EngineCache {
7955    fn graphql_type() -> &'static str {
7956        "EngineCache"
7957    }
7958    fn from_query(
7959        proc: Option<Arc<DaggerSessionProc>>,
7960        selection: Selection,
7961        graphql_client: DynGraphQLClient,
7962    ) -> Self {
7963        Self {
7964            proc,
7965            selection,
7966            graphql_client,
7967        }
7968    }
7969}
7970impl EngineCache {
7971    /// A unique identifier for this EngineCache.
7972    pub async fn id(&self) -> Result<Id, DaggerError> {
7973        let query = self.selection.select("id");
7974        query.execute(self.graphql_client.clone()).await
7975    }
7976    /// The current set of entries in the cache
7977    ///
7978    /// # Arguments
7979    ///
7980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7981    pub fn entry_set(&self) -> EngineCacheEntrySet {
7982        let query = self.selection.select("entrySet");
7983        EngineCacheEntrySet {
7984            proc: self.proc.clone(),
7985            selection: query,
7986            graphql_client: self.graphql_client.clone(),
7987        }
7988    }
7989    /// The current set of entries in the cache
7990    ///
7991    /// # Arguments
7992    ///
7993    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7994    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
7995        let mut query = self.selection.select("entrySet");
7996        if let Some(key) = opts.key {
7997            query = query.arg("key", key);
7998        }
7999        EngineCacheEntrySet {
8000            proc: self.proc.clone(),
8001            selection: query,
8002            graphql_client: self.graphql_client.clone(),
8003        }
8004    }
8005    /// Prune the cache of releaseable entries
8006    ///
8007    /// # Arguments
8008    ///
8009    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8010    pub async fn prune(&self) -> Result<Void, DaggerError> {
8011        let query = self.selection.select("prune");
8012        query.execute(self.graphql_client.clone()).await
8013    }
8014    /// Prune the cache of releaseable entries
8015    ///
8016    /// # Arguments
8017    ///
8018    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8019    pub async fn prune_opts<'a>(
8020        &self,
8021        opts: EngineCachePruneOpts<'a>,
8022    ) -> Result<Void, DaggerError> {
8023        let mut query = self.selection.select("prune");
8024        if let Some(use_default_policy) = opts.use_default_policy {
8025            query = query.arg("useDefaultPolicy", use_default_policy);
8026        }
8027        if let Some(max_used_space) = opts.max_used_space {
8028            query = query.arg("maxUsedSpace", max_used_space);
8029        }
8030        if let Some(reserved_space) = opts.reserved_space {
8031            query = query.arg("reservedSpace", reserved_space);
8032        }
8033        if let Some(min_free_space) = opts.min_free_space {
8034            query = query.arg("minFreeSpace", min_free_space);
8035        }
8036        if let Some(target_space) = opts.target_space {
8037            query = query.arg("targetSpace", target_space);
8038        }
8039        if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
8040            query = query.arg("maxEstimatedBytes", max_estimated_bytes);
8041        }
8042        if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
8043            query = query.arg("targetEstimatedBytes", target_estimated_bytes);
8044        }
8045        query.execute(self.graphql_client.clone()).await
8046    }
8047    /// The maximum bytes to keep in the cache without pruning.
8048    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
8049        let query = self.selection.select("maxUsedSpace");
8050        query.execute(self.graphql_client.clone()).await
8051    }
8052    /// The target number of bytes to keep when pruning.
8053    pub async fn target_space(&self) -> Result<isize, DaggerError> {
8054        let query = self.selection.select("targetSpace");
8055        query.execute(self.graphql_client.clone()).await
8056    }
8057    /// The minimum amount of disk space this policy is guaranteed to retain.
8058    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
8059        let query = self.selection.select("reservedSpace");
8060        query.execute(self.graphql_client.clone()).await
8061    }
8062    /// The target amount of free disk space the garbage collector will attempt to leave.
8063    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
8064        let query = self.selection.select("minFreeSpace");
8065        query.execute(self.graphql_client.clone()).await
8066    }
8067}
8068impl Node for EngineCache {
8069    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8070        let query = self.selection.select("id");
8071        let graphql_client = self.graphql_client.clone();
8072        async move { query.execute(graphql_client).await }
8073    }
8074}
8075#[derive(Clone)]
8076pub struct EngineCacheEntry {
8077    pub proc: Option<Arc<DaggerSessionProc>>,
8078    pub selection: Selection,
8079    pub graphql_client: DynGraphQLClient,
8080}
8081impl IntoID<Id> for EngineCacheEntry {
8082    fn into_id(
8083        self,
8084    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8085        Box::pin(async move { self.id().await })
8086    }
8087}
8088impl Loadable for EngineCacheEntry {
8089    fn graphql_type() -> &'static str {
8090        "EngineCacheEntry"
8091    }
8092    fn from_query(
8093        proc: Option<Arc<DaggerSessionProc>>,
8094        selection: Selection,
8095        graphql_client: DynGraphQLClient,
8096    ) -> Self {
8097        Self {
8098            proc,
8099            selection,
8100            graphql_client,
8101        }
8102    }
8103}
8104impl EngineCacheEntry {
8105    /// A unique identifier for this EngineCacheEntry.
8106    pub async fn id(&self) -> Result<Id, DaggerError> {
8107        let query = self.selection.select("id");
8108        query.execute(self.graphql_client.clone()).await
8109    }
8110    /// The description of the cache entry.
8111    pub async fn description(&self) -> Result<String, DaggerError> {
8112        let query = self.selection.select("description");
8113        query.execute(self.graphql_client.clone()).await
8114    }
8115    /// The disk space used by the cache entry.
8116    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8117        let query = self.selection.select("diskSpaceBytes");
8118        query.execute(self.graphql_client.clone()).await
8119    }
8120    /// The time the cache entry was created, in Unix nanoseconds.
8121    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
8122        let query = self.selection.select("createdTimeUnixNano");
8123        query.execute(self.graphql_client.clone()).await
8124    }
8125    /// The most recent time the cache entry was used, in Unix nanoseconds.
8126    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
8127        let query = self.selection.select("mostRecentUseTimeUnixNano");
8128        query.execute(self.graphql_client.clone()).await
8129    }
8130    /// Whether the cache entry is actively being used.
8131    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
8132        let query = self.selection.select("activelyUsed");
8133        query.execute(self.graphql_client.clone()).await
8134    }
8135    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
8136    pub async fn record_type(&self) -> Result<String, DaggerError> {
8137        let query = self.selection.select("recordType");
8138        query.execute(self.graphql_client.clone()).await
8139    }
8140    /// The storage record types represented by this cache entry.
8141    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
8142        let query = self.selection.select("recordTypes");
8143        query.execute(self.graphql_client.clone()).await
8144    }
8145    /// The DagQL call that produced this cache entry.
8146    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
8147        let query = self.selection.select("dagqlCall");
8148        query.execute(self.graphql_client.clone()).await
8149    }
8150}
8151impl Node for EngineCacheEntry {
8152    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8153        let query = self.selection.select("id");
8154        let graphql_client = self.graphql_client.clone();
8155        async move { query.execute(graphql_client).await }
8156    }
8157}
8158#[derive(Clone)]
8159pub struct EngineCacheEntrySet {
8160    pub proc: Option<Arc<DaggerSessionProc>>,
8161    pub selection: Selection,
8162    pub graphql_client: DynGraphQLClient,
8163}
8164impl IntoID<Id> for EngineCacheEntrySet {
8165    fn into_id(
8166        self,
8167    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8168        Box::pin(async move { self.id().await })
8169    }
8170}
8171impl Loadable for EngineCacheEntrySet {
8172    fn graphql_type() -> &'static str {
8173        "EngineCacheEntrySet"
8174    }
8175    fn from_query(
8176        proc: Option<Arc<DaggerSessionProc>>,
8177        selection: Selection,
8178        graphql_client: DynGraphQLClient,
8179    ) -> Self {
8180        Self {
8181            proc,
8182            selection,
8183            graphql_client,
8184        }
8185    }
8186}
8187impl EngineCacheEntrySet {
8188    /// A unique identifier for this EngineCacheEntrySet.
8189    pub async fn id(&self) -> Result<Id, DaggerError> {
8190        let query = self.selection.select("id");
8191        query.execute(self.graphql_client.clone()).await
8192    }
8193    /// The list of individual cache entries in the set
8194    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
8195        let query = self.selection.select("entries");
8196        let query = query.select("id");
8197        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8198        Ok(ids
8199            .into_iter()
8200            .map(|id| EngineCacheEntry {
8201                proc: self.proc.clone(),
8202                selection: crate::querybuilder::query()
8203                    .select("node")
8204                    .arg("id", &id.0)
8205                    .inline_fragment("EngineCacheEntry"),
8206                graphql_client: self.graphql_client.clone(),
8207            })
8208            .collect())
8209    }
8210    /// The number of cache entries in this set.
8211    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
8212        let query = self.selection.select("entryCount");
8213        query.execute(self.graphql_client.clone()).await
8214    }
8215    /// The total disk space used by the cache entries in this set.
8216    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8217        let query = self.selection.select("diskSpaceBytes");
8218        query.execute(self.graphql_client.clone()).await
8219    }
8220}
8221impl Node for EngineCacheEntrySet {
8222    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8223        let query = self.selection.select("id");
8224        let graphql_client = self.graphql_client.clone();
8225        async move { query.execute(graphql_client).await }
8226    }
8227}
8228#[derive(Clone)]
8229pub struct EnumTypeDef {
8230    pub proc: Option<Arc<DaggerSessionProc>>,
8231    pub selection: Selection,
8232    pub graphql_client: DynGraphQLClient,
8233}
8234impl IntoID<Id> for EnumTypeDef {
8235    fn into_id(
8236        self,
8237    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8238        Box::pin(async move { self.id().await })
8239    }
8240}
8241impl Loadable for EnumTypeDef {
8242    fn graphql_type() -> &'static str {
8243        "EnumTypeDef"
8244    }
8245    fn from_query(
8246        proc: Option<Arc<DaggerSessionProc>>,
8247        selection: Selection,
8248        graphql_client: DynGraphQLClient,
8249    ) -> Self {
8250        Self {
8251            proc,
8252            selection,
8253            graphql_client,
8254        }
8255    }
8256}
8257impl EnumTypeDef {
8258    /// A unique identifier for this EnumTypeDef.
8259    pub async fn id(&self) -> Result<Id, DaggerError> {
8260        let query = self.selection.select("id");
8261        query.execute(self.graphql_client.clone()).await
8262    }
8263    /// The members of the enum.
8264    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8265        let query = self.selection.select("values");
8266        let query = query.select("id");
8267        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8268        Ok(ids
8269            .into_iter()
8270            .map(|id| EnumValueTypeDef {
8271                proc: self.proc.clone(),
8272                selection: crate::querybuilder::query()
8273                    .select("node")
8274                    .arg("id", &id.0)
8275                    .inline_fragment("EnumValueTypeDef"),
8276                graphql_client: self.graphql_client.clone(),
8277            })
8278            .collect())
8279    }
8280    /// The members of the enum.
8281    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8282        let query = self.selection.select("members");
8283        let query = query.select("id");
8284        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8285        Ok(ids
8286            .into_iter()
8287            .map(|id| EnumValueTypeDef {
8288                proc: self.proc.clone(),
8289                selection: crate::querybuilder::query()
8290                    .select("node")
8291                    .arg("id", &id.0)
8292                    .inline_fragment("EnumValueTypeDef"),
8293                graphql_client: self.graphql_client.clone(),
8294            })
8295            .collect())
8296    }
8297    /// The name of the enum.
8298    pub async fn name(&self) -> Result<String, DaggerError> {
8299        let query = self.selection.select("name");
8300        query.execute(self.graphql_client.clone()).await
8301    }
8302    /// A doc string for the enum, if any.
8303    pub async fn description(&self) -> Result<String, DaggerError> {
8304        let query = self.selection.select("description");
8305        query.execute(self.graphql_client.clone()).await
8306    }
8307    /// The location of this enum declaration.
8308    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8309        let query = self.selection.select("sourceMap");
8310        let query = query.select("id");
8311        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8312        Ok(id.map(|id| SourceMap {
8313            proc: self.proc.clone(),
8314            selection: query
8315                .root()
8316                .select("node")
8317                .arg("id", &id.0)
8318                .inline_fragment("SourceMap"),
8319            graphql_client: self.graphql_client.clone(),
8320        }))
8321    }
8322    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
8323    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8324        let query = self.selection.select("sourceModuleName");
8325        query.execute(self.graphql_client.clone()).await
8326    }
8327}
8328impl Node for EnumTypeDef {
8329    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8330        let query = self.selection.select("id");
8331        let graphql_client = self.graphql_client.clone();
8332        async move { query.execute(graphql_client).await }
8333    }
8334}
8335#[derive(Clone)]
8336pub struct EnumValueTypeDef {
8337    pub proc: Option<Arc<DaggerSessionProc>>,
8338    pub selection: Selection,
8339    pub graphql_client: DynGraphQLClient,
8340}
8341impl IntoID<Id> for EnumValueTypeDef {
8342    fn into_id(
8343        self,
8344    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8345        Box::pin(async move { self.id().await })
8346    }
8347}
8348impl Loadable for EnumValueTypeDef {
8349    fn graphql_type() -> &'static str {
8350        "EnumValueTypeDef"
8351    }
8352    fn from_query(
8353        proc: Option<Arc<DaggerSessionProc>>,
8354        selection: Selection,
8355        graphql_client: DynGraphQLClient,
8356    ) -> Self {
8357        Self {
8358            proc,
8359            selection,
8360            graphql_client,
8361        }
8362    }
8363}
8364impl EnumValueTypeDef {
8365    /// A unique identifier for this EnumValueTypeDef.
8366    pub async fn id(&self) -> Result<Id, DaggerError> {
8367        let query = self.selection.select("id");
8368        query.execute(self.graphql_client.clone()).await
8369    }
8370    /// The name of the enum member.
8371    pub async fn name(&self) -> Result<String, DaggerError> {
8372        let query = self.selection.select("name");
8373        query.execute(self.graphql_client.clone()).await
8374    }
8375    /// The value of the enum member
8376    pub async fn value(&self) -> Result<String, DaggerError> {
8377        let query = self.selection.select("value");
8378        query.execute(self.graphql_client.clone()).await
8379    }
8380    /// A doc string for the enum member, if any.
8381    pub async fn description(&self) -> Result<String, DaggerError> {
8382        let query = self.selection.select("description");
8383        query.execute(self.graphql_client.clone()).await
8384    }
8385    /// The location of this enum member declaration.
8386    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8387        let query = self.selection.select("sourceMap");
8388        let query = query.select("id");
8389        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8390        Ok(id.map(|id| SourceMap {
8391            proc: self.proc.clone(),
8392            selection: query
8393                .root()
8394                .select("node")
8395                .arg("id", &id.0)
8396                .inline_fragment("SourceMap"),
8397            graphql_client: self.graphql_client.clone(),
8398        }))
8399    }
8400    /// The reason this enum member is deprecated, if any.
8401    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8402        let query = self.selection.select("deprecated");
8403        query.execute(self.graphql_client.clone()).await
8404    }
8405}
8406impl Node for EnumValueTypeDef {
8407    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8408        let query = self.selection.select("id");
8409        let graphql_client = self.graphql_client.clone();
8410        async move { query.execute(graphql_client).await }
8411    }
8412}
8413#[derive(Clone)]
8414pub struct EnvFile {
8415    pub proc: Option<Arc<DaggerSessionProc>>,
8416    pub selection: Selection,
8417    pub graphql_client: DynGraphQLClient,
8418}
8419#[derive(Builder, Debug, PartialEq)]
8420pub struct EnvFileVariablesOpts {
8421    /// Return values exactly as written to the file. No quote removal or variable expansion
8422    #[builder(setter(into, strip_option), default)]
8423    pub raw: Option<bool>,
8424}
8425#[derive(Builder, Debug, PartialEq)]
8426pub struct EnvFileGetOpts {
8427    /// Return the value exactly as written to the file. No quote removal or variable expansion
8428    #[builder(setter(into, strip_option), default)]
8429    pub raw: Option<bool>,
8430}
8431impl IntoID<Id> for EnvFile {
8432    fn into_id(
8433        self,
8434    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8435        Box::pin(async move { self.id().await })
8436    }
8437}
8438impl Loadable for EnvFile {
8439    fn graphql_type() -> &'static str {
8440        "EnvFile"
8441    }
8442    fn from_query(
8443        proc: Option<Arc<DaggerSessionProc>>,
8444        selection: Selection,
8445        graphql_client: DynGraphQLClient,
8446    ) -> Self {
8447        Self {
8448            proc,
8449            selection,
8450            graphql_client,
8451        }
8452    }
8453}
8454impl EnvFile {
8455    /// A unique identifier for this EnvFile.
8456    pub async fn id(&self) -> Result<Id, DaggerError> {
8457        let query = self.selection.select("id");
8458        query.execute(self.graphql_client.clone()).await
8459    }
8460    /// Return all variables
8461    ///
8462    /// # Arguments
8463    ///
8464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8465    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8466        let query = self.selection.select("variables");
8467        let query = query.select("id");
8468        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8469        Ok(ids
8470            .into_iter()
8471            .map(|id| EnvVariable {
8472                proc: self.proc.clone(),
8473                selection: crate::querybuilder::query()
8474                    .select("node")
8475                    .arg("id", &id.0)
8476                    .inline_fragment("EnvVariable"),
8477                graphql_client: self.graphql_client.clone(),
8478            })
8479            .collect())
8480    }
8481    /// Return all variables
8482    ///
8483    /// # Arguments
8484    ///
8485    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8486    pub async fn variables_opts(
8487        &self,
8488        opts: EnvFileVariablesOpts,
8489    ) -> Result<Vec<EnvVariable>, DaggerError> {
8490        let mut query = self.selection.select("variables");
8491        if let Some(raw) = opts.raw {
8492            query = query.arg("raw", raw);
8493        }
8494        let query = query.select("id");
8495        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8496        Ok(ids
8497            .into_iter()
8498            .map(|id| EnvVariable {
8499                proc: self.proc.clone(),
8500                selection: crate::querybuilder::query()
8501                    .select("node")
8502                    .arg("id", &id.0)
8503                    .inline_fragment("EnvVariable"),
8504                graphql_client: self.graphql_client.clone(),
8505            })
8506            .collect())
8507    }
8508    /// Add a variable
8509    ///
8510    /// # Arguments
8511    ///
8512    /// * `name` - Variable name
8513    /// * `value` - Variable value
8514    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8515        let mut query = self.selection.select("withVariable");
8516        query = query.arg("name", name.into());
8517        query = query.arg("value", value.into());
8518        EnvFile {
8519            proc: self.proc.clone(),
8520            selection: query,
8521            graphql_client: self.graphql_client.clone(),
8522        }
8523    }
8524    /// Remove all occurrences of the named variable
8525    ///
8526    /// # Arguments
8527    ///
8528    /// * `name` - Variable name
8529    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8530        let mut query = self.selection.select("withoutVariable");
8531        query = query.arg("name", name.into());
8532        EnvFile {
8533            proc: self.proc.clone(),
8534            selection: query,
8535            graphql_client: self.graphql_client.clone(),
8536        }
8537    }
8538    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8539    ///
8540    /// # Arguments
8541    ///
8542    /// * `name` - Variable name
8543    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8544    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8545        let mut query = self.selection.select("get");
8546        query = query.arg("name", name.into());
8547        query.execute(self.graphql_client.clone()).await
8548    }
8549    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8550    ///
8551    /// # Arguments
8552    ///
8553    /// * `name` - Variable name
8554    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8555    pub async fn get_opts(
8556        &self,
8557        name: impl Into<String>,
8558        opts: EnvFileGetOpts,
8559    ) -> Result<String, DaggerError> {
8560        let mut query = self.selection.select("get");
8561        query = query.arg("name", name.into());
8562        if let Some(raw) = opts.raw {
8563            query = query.arg("raw", raw);
8564        }
8565        query.execute(self.graphql_client.clone()).await
8566    }
8567    /// Check if a variable exists
8568    ///
8569    /// # Arguments
8570    ///
8571    /// * `name` - Variable name
8572    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8573        let mut query = self.selection.select("exists");
8574        query = query.arg("name", name.into());
8575        query.execute(self.graphql_client.clone()).await
8576    }
8577    /// Return as a file
8578    pub fn as_file(&self) -> File {
8579        let query = self.selection.select("asFile");
8580        File {
8581            proc: self.proc.clone(),
8582            selection: query,
8583            graphql_client: self.graphql_client.clone(),
8584        }
8585    }
8586    /// 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
8587    ///
8588    /// # Arguments
8589    ///
8590    /// * `prefix` - The prefix to filter by
8591    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8592        let mut query = self.selection.select("namespace");
8593        query = query.arg("prefix", prefix.into());
8594        EnvFile {
8595            proc: self.proc.clone(),
8596            selection: query,
8597            graphql_client: self.graphql_client.clone(),
8598        }
8599    }
8600}
8601impl Node for EnvFile {
8602    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8603        let query = self.selection.select("id");
8604        let graphql_client = self.graphql_client.clone();
8605        async move { query.execute(graphql_client).await }
8606    }
8607}
8608#[derive(Clone)]
8609pub struct EnvVariable {
8610    pub proc: Option<Arc<DaggerSessionProc>>,
8611    pub selection: Selection,
8612    pub graphql_client: DynGraphQLClient,
8613}
8614impl IntoID<Id> for EnvVariable {
8615    fn into_id(
8616        self,
8617    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8618        Box::pin(async move { self.id().await })
8619    }
8620}
8621impl Loadable for EnvVariable {
8622    fn graphql_type() -> &'static str {
8623        "EnvVariable"
8624    }
8625    fn from_query(
8626        proc: Option<Arc<DaggerSessionProc>>,
8627        selection: Selection,
8628        graphql_client: DynGraphQLClient,
8629    ) -> Self {
8630        Self {
8631            proc,
8632            selection,
8633            graphql_client,
8634        }
8635    }
8636}
8637impl EnvVariable {
8638    /// A unique identifier for this EnvVariable.
8639    pub async fn id(&self) -> Result<Id, DaggerError> {
8640        let query = self.selection.select("id");
8641        query.execute(self.graphql_client.clone()).await
8642    }
8643    /// The environment variable name.
8644    pub async fn name(&self) -> Result<String, DaggerError> {
8645        let query = self.selection.select("name");
8646        query.execute(self.graphql_client.clone()).await
8647    }
8648    /// The environment variable value.
8649    pub async fn value(&self) -> Result<String, DaggerError> {
8650        let query = self.selection.select("value");
8651        query.execute(self.graphql_client.clone()).await
8652    }
8653}
8654impl Node for EnvVariable {
8655    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8656        let query = self.selection.select("id");
8657        let graphql_client = self.graphql_client.clone();
8658        async move { query.execute(graphql_client).await }
8659    }
8660}
8661#[derive(Clone)]
8662pub struct Error {
8663    pub proc: Option<Arc<DaggerSessionProc>>,
8664    pub selection: Selection,
8665    pub graphql_client: DynGraphQLClient,
8666}
8667impl IntoID<Id> for Error {
8668    fn into_id(
8669        self,
8670    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8671        Box::pin(async move { self.id().await })
8672    }
8673}
8674impl Loadable for Error {
8675    fn graphql_type() -> &'static str {
8676        "Error"
8677    }
8678    fn from_query(
8679        proc: Option<Arc<DaggerSessionProc>>,
8680        selection: Selection,
8681        graphql_client: DynGraphQLClient,
8682    ) -> Self {
8683        Self {
8684            proc,
8685            selection,
8686            graphql_client,
8687        }
8688    }
8689}
8690impl Error {
8691    /// A unique identifier for this Error.
8692    pub async fn id(&self) -> Result<Id, DaggerError> {
8693        let query = self.selection.select("id");
8694        query.execute(self.graphql_client.clone()).await
8695    }
8696    /// Add a value to the error.
8697    ///
8698    /// # Arguments
8699    ///
8700    /// * `name` - The name of the value.
8701    /// * `value` - The value to store on the error.
8702    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8703        let mut query = self.selection.select("withValue");
8704        query = query.arg("name", name.into());
8705        query = query.arg("value", value);
8706        Error {
8707            proc: self.proc.clone(),
8708            selection: query,
8709            graphql_client: self.graphql_client.clone(),
8710        }
8711    }
8712    /// A description of the error.
8713    pub async fn message(&self) -> Result<String, DaggerError> {
8714        let query = self.selection.select("message");
8715        query.execute(self.graphql_client.clone()).await
8716    }
8717    /// The extensions of the error.
8718    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8719        let query = self.selection.select("values");
8720        let query = query.select("id");
8721        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8722        Ok(ids
8723            .into_iter()
8724            .map(|id| ErrorValue {
8725                proc: self.proc.clone(),
8726                selection: crate::querybuilder::query()
8727                    .select("node")
8728                    .arg("id", &id.0)
8729                    .inline_fragment("ErrorValue"),
8730                graphql_client: self.graphql_client.clone(),
8731            })
8732            .collect())
8733    }
8734}
8735impl Node for Error {
8736    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8737        let query = self.selection.select("id");
8738        let graphql_client = self.graphql_client.clone();
8739        async move { query.execute(graphql_client).await }
8740    }
8741}
8742#[derive(Clone)]
8743pub struct ErrorValue {
8744    pub proc: Option<Arc<DaggerSessionProc>>,
8745    pub selection: Selection,
8746    pub graphql_client: DynGraphQLClient,
8747}
8748impl IntoID<Id> for ErrorValue {
8749    fn into_id(
8750        self,
8751    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8752        Box::pin(async move { self.id().await })
8753    }
8754}
8755impl Loadable for ErrorValue {
8756    fn graphql_type() -> &'static str {
8757        "ErrorValue"
8758    }
8759    fn from_query(
8760        proc: Option<Arc<DaggerSessionProc>>,
8761        selection: Selection,
8762        graphql_client: DynGraphQLClient,
8763    ) -> Self {
8764        Self {
8765            proc,
8766            selection,
8767            graphql_client,
8768        }
8769    }
8770}
8771impl ErrorValue {
8772    /// A unique identifier for this ErrorValue.
8773    pub async fn id(&self) -> Result<Id, DaggerError> {
8774        let query = self.selection.select("id");
8775        query.execute(self.graphql_client.clone()).await
8776    }
8777    /// The name of the value.
8778    pub async fn name(&self) -> Result<String, DaggerError> {
8779        let query = self.selection.select("name");
8780        query.execute(self.graphql_client.clone()).await
8781    }
8782    /// The value.
8783    pub async fn value(&self) -> Result<Json, DaggerError> {
8784        let query = self.selection.select("value");
8785        query.execute(self.graphql_client.clone()).await
8786    }
8787}
8788impl Node for ErrorValue {
8789    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8790        let query = self.selection.select("id");
8791        let graphql_client = self.graphql_client.clone();
8792        async move { query.execute(graphql_client).await }
8793    }
8794}
8795#[derive(Clone)]
8796pub struct Expertise {
8797    pub proc: Option<Arc<DaggerSessionProc>>,
8798    pub selection: Selection,
8799    pub graphql_client: DynGraphQLClient,
8800}
8801impl IntoID<Id> for Expertise {
8802    fn into_id(
8803        self,
8804    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8805        Box::pin(async move { self.id().await })
8806    }
8807}
8808impl Loadable for Expertise {
8809    fn graphql_type() -> &'static str {
8810        "Expertise"
8811    }
8812    fn from_query(
8813        proc: Option<Arc<DaggerSessionProc>>,
8814        selection: Selection,
8815        graphql_client: DynGraphQLClient,
8816    ) -> Self {
8817        Self {
8818            proc,
8819            selection,
8820            graphql_client,
8821        }
8822    }
8823}
8824impl Expertise {
8825    /// A unique identifier for this Expertise.
8826    pub async fn id(&self) -> Result<Id, DaggerError> {
8827        let query = self.selection.select("id");
8828        query.execute(self.graphql_client.clone()).await
8829    }
8830    /// The agent function's name.
8831    pub async fn name(&self) -> Result<String, DaggerError> {
8832        let query = self.selection.select("name");
8833        query.execute(self.graphql_client.clone()).await
8834    }
8835    /// The agent function's description.
8836    pub async fn description(&self) -> Result<String, DaggerError> {
8837        let query = self.selection.select("description");
8838        query.execute(self.graphql_client.clone()).await
8839    }
8840    /// The agent function's path within its module.
8841    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8842        let query = self.selection.select("path");
8843        query.execute(self.graphql_client.clone()).await
8844    }
8845    /// The module that defines the agent function.
8846    pub fn original_module(&self) -> Module {
8847        let query = self.selection.select("originalModule");
8848        Module {
8849            proc: self.proc.clone(),
8850            selection: query,
8851            graphql_client: self.graphql_client.clone(),
8852        }
8853    }
8854}
8855impl Node for Expertise {
8856    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8857        let query = self.selection.select("id");
8858        let graphql_client = self.graphql_client.clone();
8859        async move { query.execute(graphql_client).await }
8860    }
8861}
8862#[derive(Clone)]
8863pub struct FieldTypeDef {
8864    pub proc: Option<Arc<DaggerSessionProc>>,
8865    pub selection: Selection,
8866    pub graphql_client: DynGraphQLClient,
8867}
8868impl IntoID<Id> for FieldTypeDef {
8869    fn into_id(
8870        self,
8871    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8872        Box::pin(async move { self.id().await })
8873    }
8874}
8875impl Loadable for FieldTypeDef {
8876    fn graphql_type() -> &'static str {
8877        "FieldTypeDef"
8878    }
8879    fn from_query(
8880        proc: Option<Arc<DaggerSessionProc>>,
8881        selection: Selection,
8882        graphql_client: DynGraphQLClient,
8883    ) -> Self {
8884        Self {
8885            proc,
8886            selection,
8887            graphql_client,
8888        }
8889    }
8890}
8891impl FieldTypeDef {
8892    /// A unique identifier for this FieldTypeDef.
8893    pub async fn id(&self) -> Result<Id, DaggerError> {
8894        let query = self.selection.select("id");
8895        query.execute(self.graphql_client.clone()).await
8896    }
8897    /// The type of the field.
8898    pub fn type_def(&self) -> TypeDef {
8899        let query = self.selection.select("typeDef");
8900        TypeDef {
8901            proc: self.proc.clone(),
8902            selection: query,
8903            graphql_client: self.graphql_client.clone(),
8904        }
8905    }
8906    /// The name of the field in lowerCamelCase format.
8907    pub async fn name(&self) -> Result<String, DaggerError> {
8908        let query = self.selection.select("name");
8909        query.execute(self.graphql_client.clone()).await
8910    }
8911    /// A doc string for the field, if any.
8912    pub async fn description(&self) -> Result<String, DaggerError> {
8913        let query = self.selection.select("description");
8914        query.execute(self.graphql_client.clone()).await
8915    }
8916    /// The location of this field declaration.
8917    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8918        let query = self.selection.select("sourceMap");
8919        let query = query.select("id");
8920        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8921        Ok(id.map(|id| SourceMap {
8922            proc: self.proc.clone(),
8923            selection: query
8924                .root()
8925                .select("node")
8926                .arg("id", &id.0)
8927                .inline_fragment("SourceMap"),
8928            graphql_client: self.graphql_client.clone(),
8929        }))
8930    }
8931    /// The reason this enum member is deprecated, if any.
8932    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8933        let query = self.selection.select("deprecated");
8934        query.execute(self.graphql_client.clone()).await
8935    }
8936}
8937impl Node for FieldTypeDef {
8938    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8939        let query = self.selection.select("id");
8940        let graphql_client = self.graphql_client.clone();
8941        async move { query.execute(graphql_client).await }
8942    }
8943}
8944#[derive(Clone)]
8945pub struct File {
8946    pub proc: Option<Arc<DaggerSessionProc>>,
8947    pub selection: Selection,
8948    pub graphql_client: DynGraphQLClient,
8949}
8950#[derive(Builder, Debug, PartialEq)]
8951pub struct FileContentsOpts {
8952    /// Maximum number of lines to read
8953    #[builder(setter(into, strip_option), default)]
8954    pub limit_lines: Option<isize>,
8955    /// Start reading after this line
8956    #[builder(setter(into, strip_option), default)]
8957    pub offset_lines: Option<isize>,
8958}
8959#[derive(Builder, Debug, PartialEq)]
8960pub struct FileDigestOpts {
8961    /// If true, exclude metadata from the digest.
8962    #[builder(setter(into, strip_option), default)]
8963    pub exclude_metadata: Option<bool>,
8964}
8965#[derive(Builder, Debug, PartialEq)]
8966pub struct FileSearchOpts<'a> {
8967    /// Allow the . pattern to match newlines in multiline mode.
8968    #[builder(setter(into, strip_option), default)]
8969    pub dotall: Option<bool>,
8970    /// Only return matching files, not lines and content
8971    #[builder(setter(into, strip_option), default)]
8972    pub files_only: Option<bool>,
8973    #[builder(setter(into, strip_option), default)]
8974    pub globs: Option<Vec<&'a str>>,
8975    /// Enable case-insensitive matching.
8976    #[builder(setter(into, strip_option), default)]
8977    pub insensitive: Option<bool>,
8978    /// Limit the number of results to return
8979    #[builder(setter(into, strip_option), default)]
8980    pub limit: Option<isize>,
8981    /// Interpret the pattern as a literal string instead of a regular expression.
8982    #[builder(setter(into, strip_option), default)]
8983    pub literal: Option<bool>,
8984    /// Enable searching across multiple lines.
8985    #[builder(setter(into, strip_option), default)]
8986    pub multiline: Option<bool>,
8987    #[builder(setter(into, strip_option), default)]
8988    pub paths: Option<Vec<&'a str>>,
8989    /// Skip hidden files (files starting with .).
8990    #[builder(setter(into, strip_option), default)]
8991    pub skip_hidden: Option<bool>,
8992    /// Honor .gitignore, .ignore, and .rgignore files.
8993    #[builder(setter(into, strip_option), default)]
8994    pub skip_ignored: Option<bool>,
8995}
8996#[derive(Builder, Debug, PartialEq)]
8997pub struct FileWithReplacedOpts {
8998    /// Replace all occurrences of the pattern.
8999    #[builder(setter(into, strip_option), default)]
9000    pub all: Option<bool>,
9001    /// Replace the first match starting from the specified line.
9002    #[builder(setter(into, strip_option), default)]
9003    pub first_from: Option<isize>,
9004}
9005#[derive(Builder, Debug, PartialEq)]
9006pub struct FileExportOpts {
9007    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
9008    #[builder(setter(into, strip_option), default)]
9009    pub allow_parent_dir_path: Option<bool>,
9010}
9011#[derive(Builder, Debug, PartialEq)]
9012pub struct FileAsEnvFileOpts {
9013    /// Replace "${VAR}" or "$VAR" with the value of other vars
9014    #[builder(setter(into, strip_option), default)]
9015    pub expand: Option<bool>,
9016}
9017impl IntoID<Id> for File {
9018    fn into_id(
9019        self,
9020    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9021        Box::pin(async move { self.id().await })
9022    }
9023}
9024impl Loadable for File {
9025    fn graphql_type() -> &'static str {
9026        "File"
9027    }
9028    fn from_query(
9029        proc: Option<Arc<DaggerSessionProc>>,
9030        selection: Selection,
9031        graphql_client: DynGraphQLClient,
9032    ) -> Self {
9033        Self {
9034            proc,
9035            selection,
9036            graphql_client,
9037        }
9038    }
9039}
9040impl File {
9041    /// A unique identifier for this File.
9042    pub async fn id(&self) -> Result<Id, DaggerError> {
9043        let query = self.selection.select("id");
9044        query.execute(self.graphql_client.clone()).await
9045    }
9046    /// Force evaluation in the engine.
9047    pub async fn sync(&self) -> Result<File, DaggerError> {
9048        let query = self.selection.select("sync");
9049        let id: Id = query.execute(self.graphql_client.clone()).await?;
9050        Ok(File {
9051            proc: self.proc.clone(),
9052            selection: query
9053                .root()
9054                .select("node")
9055                .arg("id", &id.0)
9056                .inline_fragment("File"),
9057            graphql_client: self.graphql_client.clone(),
9058        })
9059    }
9060    /// Retrieves the contents of the file.
9061    ///
9062    /// # Arguments
9063    ///
9064    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9065    pub async fn contents(&self) -> Result<String, DaggerError> {
9066        let query = self.selection.select("contents");
9067        query.execute(self.graphql_client.clone()).await
9068    }
9069    /// Retrieves the contents of the file.
9070    ///
9071    /// # Arguments
9072    ///
9073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9074    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9075        let mut query = self.selection.select("contents");
9076        if let Some(offset_lines) = opts.offset_lines {
9077            query = query.arg("offsetLines", offset_lines);
9078        }
9079        if let Some(limit_lines) = opts.limit_lines {
9080            query = query.arg("limitLines", limit_lines);
9081        }
9082        query.execute(self.graphql_client.clone()).await
9083    }
9084    /// Retrieves the size of the file, in bytes.
9085    pub async fn size(&self) -> Result<isize, DaggerError> {
9086        let query = self.selection.select("size");
9087        query.execute(self.graphql_client.clone()).await
9088    }
9089    /// Retrieves the name of the file.
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    /// Return file status
9095    pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
9096        let query = self.selection.select("stat");
9097        let query = query.select("id");
9098        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9099        Ok(id.map(|id| Stat {
9100            proc: self.proc.clone(),
9101            selection: query
9102                .root()
9103                .select("node")
9104                .arg("id", &id.0)
9105                .inline_fragment("Stat"),
9106            graphql_client: self.graphql_client.clone(),
9107        }))
9108    }
9109    /// 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.
9110    ///
9111    /// # Arguments
9112    ///
9113    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9114    pub async fn digest(&self) -> Result<String, DaggerError> {
9115        let query = self.selection.select("digest");
9116        query.execute(self.graphql_client.clone()).await
9117    }
9118    /// 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.
9119    ///
9120    /// # Arguments
9121    ///
9122    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9123    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9124        let mut query = self.selection.select("digest");
9125        if let Some(exclude_metadata) = opts.exclude_metadata {
9126            query = query.arg("excludeMetadata", exclude_metadata);
9127        }
9128        query.execute(self.graphql_client.clone()).await
9129    }
9130    /// Retrieves this file with its name set to the given name.
9131    ///
9132    /// # Arguments
9133    ///
9134    /// * `name` - Name to set file to.
9135    pub fn with_name(&self, name: impl Into<String>) -> File {
9136        let mut query = self.selection.select("withName");
9137        query = query.arg("name", name.into());
9138        File {
9139            proc: self.proc.clone(),
9140            selection: query,
9141            graphql_client: self.graphql_client.clone(),
9142        }
9143    }
9144    /// Searches for content matching the given regular expression or literal string.
9145    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9146    ///
9147    /// # Arguments
9148    ///
9149    /// * `pattern` - The text to match.
9150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9151    pub async fn search(
9152        &self,
9153        pattern: impl Into<String>,
9154    ) -> Result<Vec<SearchResult>, DaggerError> {
9155        let mut query = self.selection.select("search");
9156        query = query.arg("pattern", pattern.into());
9157        let query = query.select("id");
9158        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9159        Ok(ids
9160            .into_iter()
9161            .map(|id| SearchResult {
9162                proc: self.proc.clone(),
9163                selection: crate::querybuilder::query()
9164                    .select("node")
9165                    .arg("id", &id.0)
9166                    .inline_fragment("SearchResult"),
9167                graphql_client: self.graphql_client.clone(),
9168            })
9169            .collect())
9170    }
9171    /// Searches for content matching the given regular expression or literal string.
9172    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9173    ///
9174    /// # Arguments
9175    ///
9176    /// * `pattern` - The text to match.
9177    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9178    pub async fn search_opts<'a>(
9179        &self,
9180        pattern: impl Into<String>,
9181        opts: FileSearchOpts<'a>,
9182    ) -> Result<Vec<SearchResult>, DaggerError> {
9183        let mut query = self.selection.select("search");
9184        query = query.arg("pattern", pattern.into());
9185        if let Some(literal) = opts.literal {
9186            query = query.arg("literal", literal);
9187        }
9188        if let Some(multiline) = opts.multiline {
9189            query = query.arg("multiline", multiline);
9190        }
9191        if let Some(dotall) = opts.dotall {
9192            query = query.arg("dotall", dotall);
9193        }
9194        if let Some(insensitive) = opts.insensitive {
9195            query = query.arg("insensitive", insensitive);
9196        }
9197        if let Some(skip_ignored) = opts.skip_ignored {
9198            query = query.arg("skipIgnored", skip_ignored);
9199        }
9200        if let Some(skip_hidden) = opts.skip_hidden {
9201            query = query.arg("skipHidden", skip_hidden);
9202        }
9203        if let Some(files_only) = opts.files_only {
9204            query = query.arg("filesOnly", files_only);
9205        }
9206        if let Some(limit) = opts.limit {
9207            query = query.arg("limit", limit);
9208        }
9209        if let Some(paths) = opts.paths {
9210            query = query.arg("paths", paths);
9211        }
9212        if let Some(globs) = opts.globs {
9213            query = query.arg("globs", globs);
9214        }
9215        let query = query.select("id");
9216        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9217        Ok(ids
9218            .into_iter()
9219            .map(|id| SearchResult {
9220                proc: self.proc.clone(),
9221                selection: crate::querybuilder::query()
9222                    .select("node")
9223                    .arg("id", &id.0)
9224                    .inline_fragment("SearchResult"),
9225                graphql_client: self.graphql_client.clone(),
9226            })
9227            .collect())
9228    }
9229    /// Retrieves the file with content replaced with the given text.
9230    /// If 'all' is true, all occurrences of the pattern will be replaced.
9231    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9232    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9233    /// If there are no matches for the pattern, this will error.
9234    ///
9235    /// # Arguments
9236    ///
9237    /// * `search` - The text to match.
9238    /// * `replacement` - The text to match.
9239    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9240    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9241        let mut query = self.selection.select("withReplaced");
9242        query = query.arg("search", search.into());
9243        query = query.arg("replacement", replacement.into());
9244        File {
9245            proc: self.proc.clone(),
9246            selection: query,
9247            graphql_client: self.graphql_client.clone(),
9248        }
9249    }
9250    /// Retrieves the file with content replaced with the given text.
9251    /// If 'all' is true, all occurrences of the pattern will be replaced.
9252    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9253    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9254    /// If there are no matches for the pattern, this will error.
9255    ///
9256    /// # Arguments
9257    ///
9258    /// * `search` - The text to match.
9259    /// * `replacement` - The text to match.
9260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9261    pub fn with_replaced_opts(
9262        &self,
9263        search: impl Into<String>,
9264        replacement: impl Into<String>,
9265        opts: FileWithReplacedOpts,
9266    ) -> File {
9267        let mut query = self.selection.select("withReplaced");
9268        query = query.arg("search", search.into());
9269        query = query.arg("replacement", replacement.into());
9270        if let Some(all) = opts.all {
9271            query = query.arg("all", all);
9272        }
9273        if let Some(first_from) = opts.first_from {
9274            query = query.arg("firstFrom", first_from);
9275        }
9276        File {
9277            proc: self.proc.clone(),
9278            selection: query,
9279            graphql_client: self.graphql_client.clone(),
9280        }
9281    }
9282    /// Writes the file to a file path on the host.
9283    ///
9284    /// # Arguments
9285    ///
9286    /// * `path` - Location of the written directory (e.g., "output.txt").
9287    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9288    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9289        let mut query = self.selection.select("export");
9290        query = query.arg("path", path.into());
9291        query.execute(self.graphql_client.clone()).await
9292    }
9293    /// Writes the file to a file path on the host.
9294    ///
9295    /// # Arguments
9296    ///
9297    /// * `path` - Location of the written directory (e.g., "output.txt").
9298    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9299    pub async fn export_opts(
9300        &self,
9301        path: impl Into<String>,
9302        opts: FileExportOpts,
9303    ) -> Result<String, DaggerError> {
9304        let mut query = self.selection.select("export");
9305        query = query.arg("path", path.into());
9306        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9307            query = query.arg("allowParentDirPath", allow_parent_dir_path);
9308        }
9309        query.execute(self.graphql_client.clone()).await
9310    }
9311    /// Retrieves this file with its created/modified timestamps set to the given time.
9312    ///
9313    /// # Arguments
9314    ///
9315    /// * `timestamp` - Timestamp to set dir/files in.
9316    ///
9317    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9318    pub fn with_timestamps(&self, timestamp: isize) -> File {
9319        let mut query = self.selection.select("withTimestamps");
9320        query = query.arg("timestamp", timestamp);
9321        File {
9322            proc: self.proc.clone(),
9323            selection: query,
9324            graphql_client: self.graphql_client.clone(),
9325        }
9326    }
9327    /// Change the owner of the file recursively.
9328    ///
9329    /// # Arguments
9330    ///
9331    /// * `owner` - A user:group to set for the file.
9332    ///
9333    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
9334    ///
9335    /// If the group is omitted, it defaults to the same as the user.
9336    pub fn chown(&self, owner: impl Into<String>) -> File {
9337        let mut query = self.selection.select("chown");
9338        query = query.arg("owner", owner.into());
9339        File {
9340            proc: self.proc.clone(),
9341            selection: query,
9342            graphql_client: self.graphql_client.clone(),
9343        }
9344    }
9345    /// Interpret this file as a Git bundle by lazily parsing its header.
9346    pub fn as_git_bundle(&self) -> GitBundle {
9347        let query = self.selection.select("asGitBundle");
9348        GitBundle {
9349            proc: self.proc.clone(),
9350            selection: query,
9351            graphql_client: self.graphql_client.clone(),
9352        }
9353    }
9354    /// Parse the file contents as JSON.
9355    pub fn as_json(&self) -> JsonValue {
9356        let query = self.selection.select("asJSON");
9357        JsonValue {
9358            proc: self.proc.clone(),
9359            selection: query,
9360            graphql_client: self.graphql_client.clone(),
9361        }
9362    }
9363    /// Parse as an env file
9364    ///
9365    /// # Arguments
9366    ///
9367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9368    pub fn as_env_file(&self) -> EnvFile {
9369        let query = self.selection.select("asEnvFile");
9370        EnvFile {
9371            proc: self.proc.clone(),
9372            selection: query,
9373            graphql_client: self.graphql_client.clone(),
9374        }
9375    }
9376    /// Parse as an env file
9377    ///
9378    /// # Arguments
9379    ///
9380    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9381    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9382        let mut query = self.selection.select("asEnvFile");
9383        if let Some(expand) = opts.expand {
9384            query = query.arg("expand", expand);
9385        }
9386        EnvFile {
9387            proc: self.proc.clone(),
9388            selection: query,
9389            graphql_client: self.graphql_client.clone(),
9390        }
9391    }
9392}
9393impl Exportable for File {
9394    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9395        let query = self.selection.select("id");
9396        let graphql_client = self.graphql_client.clone();
9397        async move { query.execute(graphql_client).await }
9398    }
9399    fn export(
9400        &self,
9401        path: impl Into<String>,
9402    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9403        let mut query = self.selection.select("export");
9404        query = query.arg("path", path.into());
9405        let graphql_client = self.graphql_client.clone();
9406        async move { query.execute(graphql_client).await }
9407    }
9408}
9409impl Node for File {
9410    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9411        let query = self.selection.select("id");
9412        let graphql_client = self.graphql_client.clone();
9413        async move { query.execute(graphql_client).await }
9414    }
9415}
9416impl Syncer for File {
9417    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9418        let query = self.selection.select("id");
9419        let graphql_client = self.graphql_client.clone();
9420        async move { query.execute(graphql_client).await }
9421    }
9422    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
9423        let query = self.selection.select("sync");
9424        let proc = self.proc.clone();
9425        let graphql_client = self.graphql_client.clone();
9426        async move {
9427            let id: Id = query.execute(graphql_client.clone()).await?;
9428            Ok(Self {
9429                proc,
9430                selection: query
9431                    .root()
9432                    .select("node")
9433                    .arg("id", &id.0)
9434                    .inline_fragment("File"),
9435                graphql_client,
9436            })
9437        }
9438    }
9439}
9440#[derive(Clone)]
9441pub struct Function {
9442    pub proc: Option<Arc<DaggerSessionProc>>,
9443    pub selection: Selection,
9444    pub graphql_client: DynGraphQLClient,
9445}
9446#[derive(Builder, Debug, PartialEq)]
9447pub struct FunctionWithDeprecatedOpts<'a> {
9448    /// Reason or migration path describing the deprecation.
9449    #[builder(setter(into, strip_option), default)]
9450    pub reason: Option<&'a str>,
9451}
9452#[derive(Builder, Debug, PartialEq)]
9453pub struct FunctionWithArgOpts<'a> {
9454    #[builder(setter(into, strip_option), default)]
9455    pub default_address: Option<&'a str>,
9456    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9457    #[builder(setter(into, strip_option), default)]
9458    pub default_path: Option<&'a str>,
9459    /// A default value to use for this argument if not explicitly set by the caller, if any
9460    #[builder(setter(into, strip_option), default)]
9461    pub default_value: Option<Json>,
9462    /// If deprecated, the reason or migration path.
9463    #[builder(setter(into, strip_option), default)]
9464    pub deprecated: Option<&'a str>,
9465    /// A doc string for the argument, if any
9466    #[builder(setter(into, strip_option), default)]
9467    pub description: Option<&'a str>,
9468    /// Patterns to ignore when loading the contextual argument value.
9469    #[builder(setter(into, strip_option), default)]
9470    pub ignore: Option<Vec<&'a str>>,
9471    /// The source map for the argument definition.
9472    #[builder(setter(into, strip_option), default)]
9473    pub source_map: Option<Id>,
9474}
9475#[derive(Builder, Debug, PartialEq)]
9476pub struct FunctionWithCachePolicyOpts<'a> {
9477    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9478    #[builder(setter(into, strip_option), default)]
9479    pub time_to_live: Option<&'a str>,
9480}
9481impl IntoID<Id> for Function {
9482    fn into_id(
9483        self,
9484    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9485        Box::pin(async move { self.id().await })
9486    }
9487}
9488impl Loadable for Function {
9489    fn graphql_type() -> &'static str {
9490        "Function"
9491    }
9492    fn from_query(
9493        proc: Option<Arc<DaggerSessionProc>>,
9494        selection: Selection,
9495        graphql_client: DynGraphQLClient,
9496    ) -> Self {
9497        Self {
9498            proc,
9499            selection,
9500            graphql_client,
9501        }
9502    }
9503}
9504impl Function {
9505    /// A unique identifier for this Function.
9506    pub async fn id(&self) -> Result<Id, DaggerError> {
9507        let query = self.selection.select("id");
9508        query.execute(self.graphql_client.clone()).await
9509    }
9510    /// Returns the function with the given doc string.
9511    ///
9512    /// # Arguments
9513    ///
9514    /// * `description` - The doc string to set.
9515    pub fn with_description(&self, description: impl Into<String>) -> Function {
9516        let mut query = self.selection.select("withDescription");
9517        query = query.arg("description", description.into());
9518        Function {
9519            proc: self.proc.clone(),
9520            selection: query,
9521            graphql_client: self.graphql_client.clone(),
9522        }
9523    }
9524    /// Returns the function with the provided deprecation reason.
9525    ///
9526    /// # Arguments
9527    ///
9528    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9529    pub fn with_deprecated(&self) -> Function {
9530        let query = self.selection.select("withDeprecated");
9531        Function {
9532            proc: self.proc.clone(),
9533            selection: query,
9534            graphql_client: self.graphql_client.clone(),
9535        }
9536    }
9537    /// Returns the function with the provided deprecation reason.
9538    ///
9539    /// # Arguments
9540    ///
9541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9542    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9543        let mut query = self.selection.select("withDeprecated");
9544        if let Some(reason) = opts.reason {
9545            query = query.arg("reason", reason);
9546        }
9547        Function {
9548            proc: self.proc.clone(),
9549            selection: query,
9550            graphql_client: self.graphql_client.clone(),
9551        }
9552    }
9553    /// Returns the function with a flag indicating it's a check.
9554    pub fn with_check(&self) -> Function {
9555        let query = self.selection.select("withCheck");
9556        Function {
9557            proc: self.proc.clone(),
9558            selection: query,
9559            graphql_client: self.graphql_client.clone(),
9560        }
9561    }
9562    /// Returns the function with a flag indicating it's a generator.
9563    pub fn with_generator(&self) -> Function {
9564        let query = self.selection.select("withGenerator");
9565        Function {
9566            proc: self.proc.clone(),
9567            selection: query,
9568            graphql_client: self.graphql_client.clone(),
9569        }
9570    }
9571    /// Returns the function with a flag indicating it returns a service for dagger up.
9572    pub fn with_up(&self) -> Function {
9573        let query = self.selection.select("withUp");
9574        Function {
9575            proc: self.proc.clone(),
9576            selection: query,
9577            graphql_client: self.graphql_client.clone(),
9578        }
9579    }
9580    /// Returns the function with a flag indicating it is a source of expertise.
9581    pub fn with_agent(&self) -> Function {
9582        let query = self.selection.select("withAgent");
9583        Function {
9584            proc: self.proc.clone(),
9585            selection: query,
9586            graphql_client: self.graphql_client.clone(),
9587        }
9588    }
9589    /// Returns the function with the given source map.
9590    ///
9591    /// # Arguments
9592    ///
9593    /// * `source_map` - The source map for the function definition.
9594    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9595        let mut query = self.selection.select("withSourceMap");
9596        query = query.arg_lazy(
9597            "sourceMap",
9598            Box::new(move || {
9599                let source_map = source_map.clone();
9600                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9601            }),
9602        );
9603        Function {
9604            proc: self.proc.clone(),
9605            selection: query,
9606            graphql_client: self.graphql_client.clone(),
9607        }
9608    }
9609    /// Returns the function with the provided argument
9610    ///
9611    /// # Arguments
9612    ///
9613    /// * `name` - The name of the argument
9614    /// * `type_def` - The type of the argument
9615    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9616    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9617        let mut query = self.selection.select("withArg");
9618        query = query.arg("name", name.into());
9619        query = query.arg_lazy(
9620            "typeDef",
9621            Box::new(move || {
9622                let type_def = type_def.clone();
9623                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9624            }),
9625        );
9626        Function {
9627            proc: self.proc.clone(),
9628            selection: query,
9629            graphql_client: self.graphql_client.clone(),
9630        }
9631    }
9632    /// Returns the function with the provided argument
9633    ///
9634    /// # Arguments
9635    ///
9636    /// * `name` - The name of the argument
9637    /// * `type_def` - The type of the argument
9638    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9639    pub fn with_arg_opts<'a>(
9640        &self,
9641        name: impl Into<String>,
9642        type_def: impl IntoID<Id>,
9643        opts: FunctionWithArgOpts<'a>,
9644    ) -> Function {
9645        let mut query = self.selection.select("withArg");
9646        query = query.arg("name", name.into());
9647        query = query.arg_lazy(
9648            "typeDef",
9649            Box::new(move || {
9650                let type_def = type_def.clone();
9651                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9652            }),
9653        );
9654        if let Some(description) = opts.description {
9655            query = query.arg("description", description);
9656        }
9657        if let Some(default_value) = opts.default_value {
9658            query = query.arg("defaultValue", default_value);
9659        }
9660        if let Some(default_path) = opts.default_path {
9661            query = query.arg("defaultPath", default_path);
9662        }
9663        if let Some(ignore) = opts.ignore {
9664            query = query.arg("ignore", ignore);
9665        }
9666        if let Some(source_map) = opts.source_map {
9667            query = query.arg("sourceMap", source_map);
9668        }
9669        if let Some(deprecated) = opts.deprecated {
9670            query = query.arg("deprecated", deprecated);
9671        }
9672        if let Some(default_address) = opts.default_address {
9673            query = query.arg("defaultAddress", default_address);
9674        }
9675        Function {
9676            proc: self.proc.clone(),
9677            selection: query,
9678            graphql_client: self.graphql_client.clone(),
9679        }
9680    }
9681    /// Returns the function updated to use the provided cache policy.
9682    ///
9683    /// # Arguments
9684    ///
9685    /// * `policy` - The cache policy to use.
9686    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9687    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9688        let mut query = self.selection.select("withCachePolicy");
9689        query = query.arg("policy", policy);
9690        Function {
9691            proc: self.proc.clone(),
9692            selection: query,
9693            graphql_client: self.graphql_client.clone(),
9694        }
9695    }
9696    /// Returns the function updated to use the provided cache policy.
9697    ///
9698    /// # Arguments
9699    ///
9700    /// * `policy` - The cache policy to use.
9701    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9702    pub fn with_cache_policy_opts<'a>(
9703        &self,
9704        policy: FunctionCachePolicy,
9705        opts: FunctionWithCachePolicyOpts<'a>,
9706    ) -> Function {
9707        let mut query = self.selection.select("withCachePolicy");
9708        query = query.arg("policy", policy);
9709        if let Some(time_to_live) = opts.time_to_live {
9710            query = query.arg("timeToLive", time_to_live);
9711        }
9712        Function {
9713            proc: self.proc.clone(),
9714            selection: query,
9715            graphql_client: self.graphql_client.clone(),
9716        }
9717    }
9718    /// The name of the function.
9719    pub async fn name(&self) -> Result<String, DaggerError> {
9720        let query = self.selection.select("name");
9721        query.execute(self.graphql_client.clone()).await
9722    }
9723    /// A doc string for the function, if any.
9724    pub async fn description(&self) -> Result<String, DaggerError> {
9725        let query = self.selection.select("description");
9726        query.execute(self.graphql_client.clone()).await
9727    }
9728    /// The reason this function is deprecated, if any.
9729    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9730        let query = self.selection.select("deprecated");
9731        query.execute(self.graphql_client.clone()).await
9732    }
9733    /// The location of this function declaration.
9734    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9735        let query = self.selection.select("sourceMap");
9736        let query = query.select("id");
9737        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9738        Ok(id.map(|id| SourceMap {
9739            proc: self.proc.clone(),
9740            selection: query
9741                .root()
9742                .select("node")
9743                .arg("id", &id.0)
9744                .inline_fragment("SourceMap"),
9745            graphql_client: self.graphql_client.clone(),
9746        }))
9747    }
9748    /// If this function is provided by a module, the name of the module. Unset otherwise.
9749    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9750        let query = self.selection.select("sourceModuleName");
9751        query.execute(self.graphql_client.clone()).await
9752    }
9753    /// Arguments accepted by the function, if any.
9754    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9755        let query = self.selection.select("args");
9756        let query = query.select("id");
9757        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9758        Ok(ids
9759            .into_iter()
9760            .map(|id| FunctionArg {
9761                proc: self.proc.clone(),
9762                selection: crate::querybuilder::query()
9763                    .select("node")
9764                    .arg("id", &id.0)
9765                    .inline_fragment("FunctionArg"),
9766                graphql_client: self.graphql_client.clone(),
9767            })
9768            .collect())
9769    }
9770    /// The type returned by the function.
9771    pub fn return_type(&self) -> TypeDef {
9772        let query = self.selection.select("returnType");
9773        TypeDef {
9774            proc: self.proc.clone(),
9775            selection: query,
9776            graphql_client: self.graphql_client.clone(),
9777        }
9778    }
9779}
9780impl Node for Function {
9781    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9782        let query = self.selection.select("id");
9783        let graphql_client = self.graphql_client.clone();
9784        async move { query.execute(graphql_client).await }
9785    }
9786}
9787#[derive(Clone)]
9788pub struct FunctionArg {
9789    pub proc: Option<Arc<DaggerSessionProc>>,
9790    pub selection: Selection,
9791    pub graphql_client: DynGraphQLClient,
9792}
9793impl IntoID<Id> for FunctionArg {
9794    fn into_id(
9795        self,
9796    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9797        Box::pin(async move { self.id().await })
9798    }
9799}
9800impl Loadable for FunctionArg {
9801    fn graphql_type() -> &'static str {
9802        "FunctionArg"
9803    }
9804    fn from_query(
9805        proc: Option<Arc<DaggerSessionProc>>,
9806        selection: Selection,
9807        graphql_client: DynGraphQLClient,
9808    ) -> Self {
9809        Self {
9810            proc,
9811            selection,
9812            graphql_client,
9813        }
9814    }
9815}
9816impl FunctionArg {
9817    /// A unique identifier for this FunctionArg.
9818    pub async fn id(&self) -> Result<Id, DaggerError> {
9819        let query = self.selection.select("id");
9820        query.execute(self.graphql_client.clone()).await
9821    }
9822    /// The name of the argument in lowerCamelCase format.
9823    pub async fn name(&self) -> Result<String, DaggerError> {
9824        let query = self.selection.select("name");
9825        query.execute(self.graphql_client.clone()).await
9826    }
9827    /// A doc string for the argument, if any.
9828    pub async fn description(&self) -> Result<String, DaggerError> {
9829        let query = self.selection.select("description");
9830        query.execute(self.graphql_client.clone()).await
9831    }
9832    /// The location of this arg declaration.
9833    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9834        let query = self.selection.select("sourceMap");
9835        let query = query.select("id");
9836        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9837        Ok(id.map(|id| SourceMap {
9838            proc: self.proc.clone(),
9839            selection: query
9840                .root()
9841                .select("node")
9842                .arg("id", &id.0)
9843                .inline_fragment("SourceMap"),
9844            graphql_client: self.graphql_client.clone(),
9845        }))
9846    }
9847    /// A default value to use for this argument when not explicitly set by the caller, if any.
9848    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9849        let query = self.selection.select("defaultValue");
9850        query.execute(self.graphql_client.clone()).await
9851    }
9852    /// 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
9853    pub async fn default_path(&self) -> Result<String, DaggerError> {
9854        let query = self.selection.select("defaultPath");
9855        query.execute(self.graphql_client.clone()).await
9856    }
9857    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9858    pub async fn default_address(&self) -> Result<String, DaggerError> {
9859        let query = self.selection.select("defaultAddress");
9860        query.execute(self.graphql_client.clone()).await
9861    }
9862    /// 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.
9863    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9864        let query = self.selection.select("ignore");
9865        query.execute(self.graphql_client.clone()).await
9866    }
9867    /// The reason this function is deprecated, if any.
9868    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9869        let query = self.selection.select("deprecated");
9870        query.execute(self.graphql_client.clone()).await
9871    }
9872    /// The type of the argument.
9873    pub fn type_def(&self) -> TypeDef {
9874        let query = self.selection.select("typeDef");
9875        TypeDef {
9876            proc: self.proc.clone(),
9877            selection: query,
9878            graphql_client: self.graphql_client.clone(),
9879        }
9880    }
9881}
9882impl Node for FunctionArg {
9883    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9884        let query = self.selection.select("id");
9885        let graphql_client = self.graphql_client.clone();
9886        async move { query.execute(graphql_client).await }
9887    }
9888}
9889#[derive(Clone)]
9890pub struct FunctionCall {
9891    pub proc: Option<Arc<DaggerSessionProc>>,
9892    pub selection: Selection,
9893    pub graphql_client: DynGraphQLClient,
9894}
9895impl IntoID<Id> for FunctionCall {
9896    fn into_id(
9897        self,
9898    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9899        Box::pin(async move { self.id().await })
9900    }
9901}
9902impl Loadable for FunctionCall {
9903    fn graphql_type() -> &'static str {
9904        "FunctionCall"
9905    }
9906    fn from_query(
9907        proc: Option<Arc<DaggerSessionProc>>,
9908        selection: Selection,
9909        graphql_client: DynGraphQLClient,
9910    ) -> Self {
9911        Self {
9912            proc,
9913            selection,
9914            graphql_client,
9915        }
9916    }
9917}
9918impl FunctionCall {
9919    /// A unique identifier for this FunctionCall.
9920    pub async fn id(&self) -> Result<Id, DaggerError> {
9921        let query = self.selection.select("id");
9922        query.execute(self.graphql_client.clone()).await
9923    }
9924    /// Set the return value of the function call to the provided value.
9925    ///
9926    /// # Arguments
9927    ///
9928    /// * `value` - JSON serialization of the return value.
9929    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9930        let mut query = self.selection.select("returnValue");
9931        query = query.arg("value", value);
9932        query.execute(self.graphql_client.clone()).await
9933    }
9934    /// Return an error from the function.
9935    ///
9936    /// # Arguments
9937    ///
9938    /// * `error` - The error to return.
9939    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9940        let mut query = self.selection.select("returnError");
9941        query = query.arg_lazy(
9942            "error",
9943            Box::new(move || {
9944                let error = error.clone();
9945                Box::pin(async move { error.into_id().await.unwrap().quote() })
9946            }),
9947        );
9948        query.execute(self.graphql_client.clone()).await
9949    }
9950    /// The name of the function being called.
9951    pub async fn name(&self) -> Result<String, DaggerError> {
9952        let query = self.selection.select("name");
9953        query.execute(self.graphql_client.clone()).await
9954    }
9955    /// 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.
9956    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9957        let query = self.selection.select("parentName");
9958        query.execute(self.graphql_client.clone()).await
9959    }
9960    /// 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.
9961    pub async fn parent(&self) -> Result<Json, DaggerError> {
9962        let query = self.selection.select("parent");
9963        query.execute(self.graphql_client.clone()).await
9964    }
9965    /// The argument values the function is being invoked with.
9966    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9967        let query = self.selection.select("inputArgs");
9968        let query = query.select("id");
9969        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9970        Ok(ids
9971            .into_iter()
9972            .map(|id| FunctionCallArgValue {
9973                proc: self.proc.clone(),
9974                selection: crate::querybuilder::query()
9975                    .select("node")
9976                    .arg("id", &id.0)
9977                    .inline_fragment("FunctionCallArgValue"),
9978                graphql_client: self.graphql_client.clone(),
9979            })
9980            .collect())
9981    }
9982}
9983impl Node for FunctionCall {
9984    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9985        let query = self.selection.select("id");
9986        let graphql_client = self.graphql_client.clone();
9987        async move { query.execute(graphql_client).await }
9988    }
9989}
9990#[derive(Clone)]
9991pub struct FunctionCallArgValue {
9992    pub proc: Option<Arc<DaggerSessionProc>>,
9993    pub selection: Selection,
9994    pub graphql_client: DynGraphQLClient,
9995}
9996impl IntoID<Id> for FunctionCallArgValue {
9997    fn into_id(
9998        self,
9999    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10000        Box::pin(async move { self.id().await })
10001    }
10002}
10003impl Loadable for FunctionCallArgValue {
10004    fn graphql_type() -> &'static str {
10005        "FunctionCallArgValue"
10006    }
10007    fn from_query(
10008        proc: Option<Arc<DaggerSessionProc>>,
10009        selection: Selection,
10010        graphql_client: DynGraphQLClient,
10011    ) -> Self {
10012        Self {
10013            proc,
10014            selection,
10015            graphql_client,
10016        }
10017    }
10018}
10019impl FunctionCallArgValue {
10020    /// A unique identifier for this FunctionCallArgValue.
10021    pub async fn id(&self) -> Result<Id, DaggerError> {
10022        let query = self.selection.select("id");
10023        query.execute(self.graphql_client.clone()).await
10024    }
10025    /// The name of the argument.
10026    pub async fn name(&self) -> Result<String, DaggerError> {
10027        let query = self.selection.select("name");
10028        query.execute(self.graphql_client.clone()).await
10029    }
10030    /// The value of the argument represented as a JSON serialized string.
10031    pub async fn value(&self) -> Result<Json, DaggerError> {
10032        let query = self.selection.select("value");
10033        query.execute(self.graphql_client.clone()).await
10034    }
10035}
10036impl Node for FunctionCallArgValue {
10037    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10038        let query = self.selection.select("id");
10039        let graphql_client = self.graphql_client.clone();
10040        async move { query.execute(graphql_client).await }
10041    }
10042}
10043#[derive(Clone)]
10044pub struct GeneratedCode {
10045    pub proc: Option<Arc<DaggerSessionProc>>,
10046    pub selection: Selection,
10047    pub graphql_client: DynGraphQLClient,
10048}
10049impl IntoID<Id> for GeneratedCode {
10050    fn into_id(
10051        self,
10052    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10053        Box::pin(async move { self.id().await })
10054    }
10055}
10056impl Loadable for GeneratedCode {
10057    fn graphql_type() -> &'static str {
10058        "GeneratedCode"
10059    }
10060    fn from_query(
10061        proc: Option<Arc<DaggerSessionProc>>,
10062        selection: Selection,
10063        graphql_client: DynGraphQLClient,
10064    ) -> Self {
10065        Self {
10066            proc,
10067            selection,
10068            graphql_client,
10069        }
10070    }
10071}
10072impl GeneratedCode {
10073    /// A unique identifier for this GeneratedCode.
10074    pub async fn id(&self) -> Result<Id, DaggerError> {
10075        let query = self.selection.select("id");
10076        query.execute(self.graphql_client.clone()).await
10077    }
10078    /// Set the list of paths to mark generated in version control.
10079    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10080        let mut query = self.selection.select("withVCSGeneratedPaths");
10081        query = query.arg(
10082            "paths",
10083            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10084        );
10085        GeneratedCode {
10086            proc: self.proc.clone(),
10087            selection: query,
10088            graphql_client: self.graphql_client.clone(),
10089        }
10090    }
10091    /// Set the list of paths to ignore in version control.
10092    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10093        let mut query = self.selection.select("withVCSIgnoredPaths");
10094        query = query.arg(
10095            "paths",
10096            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10097        );
10098        GeneratedCode {
10099            proc: self.proc.clone(),
10100            selection: query,
10101            graphql_client: self.graphql_client.clone(),
10102        }
10103    }
10104    /// The directory containing the generated code.
10105    pub fn code(&self) -> Directory {
10106        let query = self.selection.select("code");
10107        Directory {
10108            proc: self.proc.clone(),
10109            selection: query,
10110            graphql_client: self.graphql_client.clone(),
10111        }
10112    }
10113    /// List of paths to mark generated in version control (i.e. .gitattributes).
10114    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10115        let query = self.selection.select("vcsGeneratedPaths");
10116        query.execute(self.graphql_client.clone()).await
10117    }
10118    /// List of paths to ignore in version control (i.e. .gitignore).
10119    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10120        let query = self.selection.select("vcsIgnoredPaths");
10121        query.execute(self.graphql_client.clone()).await
10122    }
10123}
10124impl Node for GeneratedCode {
10125    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10126        let query = self.selection.select("id");
10127        let graphql_client = self.graphql_client.clone();
10128        async move { query.execute(graphql_client).await }
10129    }
10130}
10131#[derive(Clone)]
10132pub struct Generator {
10133    pub proc: Option<Arc<DaggerSessionProc>>,
10134    pub selection: Selection,
10135    pub graphql_client: DynGraphQLClient,
10136}
10137impl IntoID<Id> for Generator {
10138    fn into_id(
10139        self,
10140    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10141        Box::pin(async move { self.id().await })
10142    }
10143}
10144impl Loadable for Generator {
10145    fn graphql_type() -> &'static str {
10146        "Generator"
10147    }
10148    fn from_query(
10149        proc: Option<Arc<DaggerSessionProc>>,
10150        selection: Selection,
10151        graphql_client: DynGraphQLClient,
10152    ) -> Self {
10153        Self {
10154            proc,
10155            selection,
10156            graphql_client,
10157        }
10158    }
10159}
10160impl Generator {
10161    /// A unique identifier for this Generator.
10162    pub async fn id(&self) -> Result<Id, DaggerError> {
10163        let query = self.selection.select("id");
10164        query.execute(self.graphql_client.clone()).await
10165    }
10166    /// Run the generator and return its changes.
10167    pub fn changeset(&self) -> Changeset {
10168        let query = self.selection.select("changeset");
10169        Changeset {
10170            proc: self.proc.clone(),
10171            selection: query,
10172            graphql_client: self.graphql_client.clone(),
10173        }
10174    }
10175    /// Run the generator and retain its result.
10176    pub fn sync(&self) -> Generator {
10177        let query = self.selection.select("sync");
10178        Generator {
10179            proc: self.proc.clone(),
10180            selection: query,
10181            graphql_client: self.graphql_client.clone(),
10182        }
10183    }
10184    /// A check that passes when this generator would produce no changes.
10185    pub fn stale(&self) -> Check {
10186        let query = self.selection.select("stale");
10187        Check {
10188            proc: self.proc.clone(),
10189            selection: query,
10190            graphql_client: self.graphql_client.clone(),
10191        }
10192    }
10193}
10194impl Node for Generator {
10195    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10196        let query = self.selection.select("id");
10197        let graphql_client = self.graphql_client.clone();
10198        async move { query.execute(graphql_client).await }
10199    }
10200}
10201#[derive(Clone)]
10202pub struct GitBundle {
10203    pub proc: Option<Arc<DaggerSessionProc>>,
10204    pub selection: Selection,
10205    pub graphql_client: DynGraphQLClient,
10206}
10207impl IntoID<Id> for GitBundle {
10208    fn into_id(
10209        self,
10210    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10211        Box::pin(async move { self.id().await })
10212    }
10213}
10214impl Loadable for GitBundle {
10215    fn graphql_type() -> &'static str {
10216        "GitBundle"
10217    }
10218    fn from_query(
10219        proc: Option<Arc<DaggerSessionProc>>,
10220        selection: Selection,
10221        graphql_client: DynGraphQLClient,
10222    ) -> Self {
10223        Self {
10224            proc,
10225            selection,
10226            graphql_client,
10227        }
10228    }
10229}
10230impl GitBundle {
10231    /// A unique identifier for this GitBundle.
10232    pub async fn id(&self) -> Result<Id, DaggerError> {
10233        let query = self.selection.select("id");
10234        query.execute(self.graphql_client.clone()).await
10235    }
10236    /// Perform full structural verification of the bundle and error if it is malformed.
10237    pub fn validate(&self) -> GitBundle {
10238        let query = self.selection.select("validate");
10239        GitBundle {
10240            proc: self.proc.clone(),
10241            selection: query,
10242            graphql_client: self.graphql_client.clone(),
10243        }
10244    }
10245    /// Return the bundle bytes as a File.
10246    pub fn as_file(&self) -> File {
10247        let query = self.selection.select("asFile");
10248        File {
10249            proc: self.proc.clone(),
10250            selection: query,
10251            graphql_client: self.graphql_client.clone(),
10252        }
10253    }
10254    /// Bundle format version (2 or 3).
10255    pub async fn version(&self) -> Result<isize, DaggerError> {
10256        let query = self.selection.select("version");
10257        query.execute(self.graphql_client.clone()).await
10258    }
10259    /// Object format capability: sha1 or sha256.
10260    pub async fn object_format(&self) -> Result<String, DaggerError> {
10261        let query = self.selection.select("objectFormat");
10262        query.execute(self.graphql_client.clone()).await
10263    }
10264    /// Refs advertised by the bundle and the object IDs they resolve to.
10265    pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
10266        let query = self.selection.select("refs");
10267        let query = query.select("id");
10268        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10269        Ok(ids
10270            .into_iter()
10271            .map(|id| GitBundleRef {
10272                proc: self.proc.clone(),
10273                selection: crate::querybuilder::query()
10274                    .select("node")
10275                    .arg("id", &id.0)
10276                    .inline_fragment("GitBundleRef"),
10277                graphql_client: self.graphql_client.clone(),
10278            })
10279            .collect())
10280    }
10281    /// Commits that must already exist wherever this bundle is applied.
10282    pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
10283        let query = self.selection.select("prerequisiteSHAs");
10284        query.execute(self.graphql_client.clone()).await
10285    }
10286}
10287impl Node for GitBundle {
10288    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10289        let query = self.selection.select("id");
10290        let graphql_client = self.graphql_client.clone();
10291        async move { query.execute(graphql_client).await }
10292    }
10293}
10294#[derive(Clone)]
10295pub struct GitBundleRef {
10296    pub proc: Option<Arc<DaggerSessionProc>>,
10297    pub selection: Selection,
10298    pub graphql_client: DynGraphQLClient,
10299}
10300impl IntoID<Id> for GitBundleRef {
10301    fn into_id(
10302        self,
10303    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10304        Box::pin(async move { self.id().await })
10305    }
10306}
10307impl Loadable for GitBundleRef {
10308    fn graphql_type() -> &'static str {
10309        "GitBundleRef"
10310    }
10311    fn from_query(
10312        proc: Option<Arc<DaggerSessionProc>>,
10313        selection: Selection,
10314        graphql_client: DynGraphQLClient,
10315    ) -> Self {
10316        Self {
10317            proc,
10318            selection,
10319            graphql_client,
10320        }
10321    }
10322}
10323impl GitBundleRef {
10324    /// A unique identifier for this GitBundleRef.
10325    pub async fn id(&self) -> Result<Id, DaggerError> {
10326        let query = self.selection.select("id");
10327        query.execute(self.graphql_client.clone()).await
10328    }
10329    /// The advertised ref name.
10330    pub async fn name(&self) -> Result<String, DaggerError> {
10331        let query = self.selection.select("name");
10332        query.execute(self.graphql_client.clone()).await
10333    }
10334    /// The object ID the advertised ref resolves to.
10335    pub async fn sha(&self) -> Result<String, DaggerError> {
10336        let query = self.selection.select("sha");
10337        query.execute(self.graphql_client.clone()).await
10338    }
10339}
10340impl Node for GitBundleRef {
10341    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10342        let query = self.selection.select("id");
10343        let graphql_client = self.graphql_client.clone();
10344        async move { query.execute(graphql_client).await }
10345    }
10346}
10347#[derive(Clone)]
10348pub struct GitCommit {
10349    pub proc: Option<Arc<DaggerSessionProc>>,
10350    pub selection: Selection,
10351    pub graphql_client: DynGraphQLClient,
10352}
10353#[derive(Builder, Debug, PartialEq)]
10354pub struct GitCommitReleaseTagOpts {
10355    /// Include pre-release tags when choosing the latest tag.
10356    #[builder(setter(into, strip_option), default)]
10357    pub include_pre_release: Option<bool>,
10358}
10359#[derive(Builder, Debug, PartialEq)]
10360pub struct GitCommitAncestorReleaseTagOpts {
10361    /// Include pre-release tags when choosing the latest tag.
10362    #[builder(setter(into, strip_option), default)]
10363    pub include_pre_release: Option<bool>,
10364}
10365#[derive(Builder, Debug, PartialEq)]
10366pub struct GitCommitTreeOpts {
10367    /// The depth of the tree to fetch.
10368    #[builder(setter(into, strip_option), default)]
10369    pub depth: Option<isize>,
10370    /// Set to true to discard .git directory.
10371    #[builder(setter(into, strip_option), default)]
10372    pub discard_git_dir: Option<bool>,
10373    /// Set to true to populate tag refs in the local checkout .git.
10374    #[builder(setter(into, strip_option), default)]
10375    pub include_tags: Option<bool>,
10376}
10377#[derive(Builder, Debug, PartialEq)]
10378pub struct GitCommitChangesOpts {
10379    /// Use this commit as the comparison base instead of the first parent. The comparison commit may belong to an unrelated history or repository.
10380    #[builder(setter(into, strip_option), default)]
10381    pub against: Option<Id>,
10382}
10383impl IntoID<Id> for GitCommit {
10384    fn into_id(
10385        self,
10386    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10387        Box::pin(async move { self.id().await })
10388    }
10389}
10390impl Loadable for GitCommit {
10391    fn graphql_type() -> &'static str {
10392        "GitCommit"
10393    }
10394    fn from_query(
10395        proc: Option<Arc<DaggerSessionProc>>,
10396        selection: Selection,
10397        graphql_client: DynGraphQLClient,
10398    ) -> Self {
10399        Self {
10400            proc,
10401            selection,
10402            graphql_client,
10403        }
10404    }
10405}
10406impl GitCommit {
10407    /// A unique identifier for this GitCommit.
10408    pub async fn id(&self) -> Result<Id, DaggerError> {
10409        let query = self.selection.select("id");
10410        query.execute(self.graphql_client.clone()).await
10411    }
10412    /// The latest semver release tag that points directly at this commit.
10413    ///
10414    /// # Arguments
10415    ///
10416    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10417    pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10418        let query = self.selection.select("releaseTag");
10419        let query = query.select("id");
10420        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10421        Ok(id.map(|id| GitRef {
10422            proc: self.proc.clone(),
10423            selection: query
10424                .root()
10425                .select("node")
10426                .arg("id", &id.0)
10427                .inline_fragment("GitRef"),
10428            graphql_client: self.graphql_client.clone(),
10429        }))
10430    }
10431    /// The latest semver release tag that points directly at this commit.
10432    ///
10433    /// # Arguments
10434    ///
10435    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10436    pub async fn release_tag_opts(
10437        &self,
10438        opts: GitCommitReleaseTagOpts,
10439    ) -> Result<Option<GitRef>, DaggerError> {
10440        let mut query = self.selection.select("releaseTag");
10441        if let Some(include_pre_release) = opts.include_pre_release {
10442            query = query.arg("includePreRelease", include_pre_release);
10443        }
10444        let query = query.select("id");
10445        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10446        Ok(id.map(|id| GitRef {
10447            proc: self.proc.clone(),
10448            selection: query
10449                .root()
10450                .select("node")
10451                .arg("id", &id.0)
10452                .inline_fragment("GitRef"),
10453            graphql_client: self.graphql_client.clone(),
10454        }))
10455    }
10456    /// The latest semver release tag reachable from this commit.
10457    ///
10458    /// # Arguments
10459    ///
10460    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10461    pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10462        let query = self.selection.select("ancestorReleaseTag");
10463        let query = query.select("id");
10464        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10465        Ok(id.map(|id| GitRef {
10466            proc: self.proc.clone(),
10467            selection: query
10468                .root()
10469                .select("node")
10470                .arg("id", &id.0)
10471                .inline_fragment("GitRef"),
10472            graphql_client: self.graphql_client.clone(),
10473        }))
10474    }
10475    /// The latest semver release tag reachable from this commit.
10476    ///
10477    /// # Arguments
10478    ///
10479    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10480    pub async fn ancestor_release_tag_opts(
10481        &self,
10482        opts: GitCommitAncestorReleaseTagOpts,
10483    ) -> Result<Option<GitRef>, DaggerError> {
10484        let mut query = self.selection.select("ancestorReleaseTag");
10485        if let Some(include_pre_release) = opts.include_pre_release {
10486            query = query.arg("includePreRelease", include_pre_release);
10487        }
10488        let query = query.select("id");
10489        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10490        Ok(id.map(|id| GitRef {
10491            proc: self.proc.clone(),
10492            selection: query
10493                .root()
10494                .select("node")
10495                .arg("id", &id.0)
10496                .inline_fragment("GitRef"),
10497            graphql_client: self.graphql_client.clone(),
10498        }))
10499    }
10500    /// The filesystem tree at this commit.
10501    ///
10502    /// # Arguments
10503    ///
10504    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10505    pub fn tree(&self) -> Directory {
10506        let query = self.selection.select("tree");
10507        Directory {
10508            proc: self.proc.clone(),
10509            selection: query,
10510            graphql_client: self.graphql_client.clone(),
10511        }
10512    }
10513    /// The filesystem tree at this commit.
10514    ///
10515    /// # Arguments
10516    ///
10517    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10518    pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
10519        let mut query = self.selection.select("tree");
10520        if let Some(discard_git_dir) = opts.discard_git_dir {
10521            query = query.arg("discardGitDir", discard_git_dir);
10522        }
10523        if let Some(depth) = opts.depth {
10524            query = query.arg("depth", depth);
10525        }
10526        if let Some(include_tags) = opts.include_tags {
10527            query = query.arg("includeTags", include_tags);
10528        }
10529        Directory {
10530            proc: self.proc.clone(),
10531            selection: query,
10532            graphql_client: self.graphql_client.clone(),
10533        }
10534    }
10535    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10536    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10537    ///
10538    /// # Arguments
10539    ///
10540    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10541    pub fn changes(&self) -> Changeset {
10542        let query = self.selection.select("changes");
10543        Changeset {
10544            proc: self.proc.clone(),
10545            selection: query,
10546            graphql_client: self.graphql_client.clone(),
10547        }
10548    }
10549    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10550    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10551    ///
10552    /// # Arguments
10553    ///
10554    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10555    pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
10556        let mut query = self.selection.select("changes");
10557        if let Some(against) = opts.against {
10558            query = query.arg("against", against);
10559        }
10560        Changeset {
10561            proc: self.proc.clone(),
10562            selection: query,
10563            graphql_client: self.graphql_client.clone(),
10564        }
10565    }
10566    /// The full commit SHA.
10567    pub async fn sha(&self) -> Result<String, DaggerError> {
10568        let query = self.selection.select("sha");
10569        query.execute(self.graphql_client.clone()).await
10570    }
10571    /// The abbreviated commit SHA.
10572    pub async fn short_sha(&self) -> Result<String, DaggerError> {
10573        let query = self.selection.select("shortSha");
10574        query.execute(self.graphql_client.clone()).await
10575    }
10576    /// Git author date, in RFC3339 format.
10577    pub async fn authored_date(&self) -> Result<String, DaggerError> {
10578        let query = self.selection.select("authoredDate");
10579        query.execute(self.graphql_client.clone()).await
10580    }
10581    /// Git committer date, in RFC3339 format.
10582    pub async fn committed_date(&self) -> Result<String, DaggerError> {
10583        let query = self.selection.select("committedDate");
10584        query.execute(self.graphql_client.clone()).await
10585    }
10586    /// Git author name.
10587    pub async fn author_name(&self) -> Result<String, DaggerError> {
10588        let query = self.selection.select("authorName");
10589        query.execute(self.graphql_client.clone()).await
10590    }
10591    /// Git author email.
10592    pub async fn author_email(&self) -> Result<String, DaggerError> {
10593        let query = self.selection.select("authorEmail");
10594        query.execute(self.graphql_client.clone()).await
10595    }
10596    /// Git committer name.
10597    pub async fn committer_name(&self) -> Result<String, DaggerError> {
10598        let query = self.selection.select("committerName");
10599        query.execute(self.graphql_client.clone()).await
10600    }
10601    /// Git committer email.
10602    pub async fn committer_email(&self) -> Result<String, DaggerError> {
10603        let query = self.selection.select("committerEmail");
10604        query.execute(self.graphql_client.clone()).await
10605    }
10606    /// Full commit message.
10607    pub async fn message(&self) -> Result<String, DaggerError> {
10608        let query = self.selection.select("message");
10609        query.execute(self.graphql_client.clone()).await
10610    }
10611    /// First line of the commit message.
10612    pub async fn message_headline(&self) -> Result<String, DaggerError> {
10613        let query = self.selection.select("messageHeadline");
10614        query.execute(self.graphql_client.clone()).await
10615    }
10616    /// Commit message body, excluding the headline.
10617    pub async fn message_body(&self) -> Result<String, DaggerError> {
10618        let query = self.selection.select("messageBody");
10619        query.execute(self.graphql_client.clone()).await
10620    }
10621    /// Parent commit SHAs.
10622    pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
10623        let query = self.selection.select("parentShas");
10624        query.execute(self.graphql_client.clone()).await
10625    }
10626}
10627impl Node for GitCommit {
10628    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10629        let query = self.selection.select("id");
10630        let graphql_client = self.graphql_client.clone();
10631        async move { query.execute(graphql_client).await }
10632    }
10633}
10634#[derive(Clone)]
10635pub struct GitPushResult {
10636    pub proc: Option<Arc<DaggerSessionProc>>,
10637    pub selection: Selection,
10638    pub graphql_client: DynGraphQLClient,
10639}
10640impl IntoID<Id> for GitPushResult {
10641    fn into_id(
10642        self,
10643    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10644        Box::pin(async move { self.id().await })
10645    }
10646}
10647impl Loadable for GitPushResult {
10648    fn graphql_type() -> &'static str {
10649        "GitPushResult"
10650    }
10651    fn from_query(
10652        proc: Option<Arc<DaggerSessionProc>>,
10653        selection: Selection,
10654        graphql_client: DynGraphQLClient,
10655    ) -> Self {
10656        Self {
10657            proc,
10658            selection,
10659            graphql_client,
10660        }
10661    }
10662}
10663impl GitPushResult {
10664    /// A unique identifier for this GitPushResult.
10665    pub async fn id(&self) -> Result<Id, DaggerError> {
10666        let query = self.selection.select("id");
10667        query.execute(self.graphql_client.clone()).await
10668    }
10669    /// The fully qualified remote ref.
10670    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10671        let query = self.selection.select("ref");
10672        query.execute(self.graphql_client.clone()).await
10673    }
10674    /// The previous remote object ID; empty when the ref was created.
10675    pub async fn previous_sha(&self) -> Result<String, DaggerError> {
10676        let query = self.selection.select("previousSHA");
10677        query.execute(self.graphql_client.clone()).await
10678    }
10679    /// The object ID pushed to the remote.
10680    pub async fn sha(&self) -> Result<String, DaggerError> {
10681        let query = self.selection.select("sha");
10682        query.execute(self.graphql_client.clone()).await
10683    }
10684    /// How the remote ref was updated.
10685    pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
10686        let query = self.selection.select("disposition");
10687        query.execute(self.graphql_client.clone()).await
10688    }
10689}
10690impl Node for GitPushResult {
10691    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10692        let query = self.selection.select("id");
10693        let graphql_client = self.graphql_client.clone();
10694        async move { query.execute(graphql_client).await }
10695    }
10696}
10697#[derive(Clone)]
10698pub struct GitRef {
10699    pub proc: Option<Arc<DaggerSessionProc>>,
10700    pub selection: Selection,
10701    pub graphql_client: DynGraphQLClient,
10702}
10703#[derive(Builder, Debug, PartialEq)]
10704pub struct GitRefPushOpts<'a> {
10705    /// Destination branch; a refs/ prefix is used verbatim. Defaults to this ref's branch name. Required for detached and non-branch refs.
10706    #[builder(setter(into, strip_option), default)]
10707    pub branch: Option<&'a str>,
10708    /// 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.
10709    #[builder(setter(into, strip_option), default)]
10710    pub expected_remote_sha: Option<&'a str>,
10711    /// 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.
10712    #[builder(setter(into, strip_option), default)]
10713    pub remote: Option<&'a str>,
10714    /// 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.
10715    #[builder(setter(into, strip_option), default)]
10716    pub to: Option<Id>,
10717}
10718#[derive(Builder, Debug, PartialEq)]
10719pub struct GitRefTreeOpts {
10720    /// The depth of the tree to fetch.
10721    #[builder(setter(into, strip_option), default)]
10722    pub depth: Option<isize>,
10723    /// Set to true to discard .git directory.
10724    #[builder(setter(into, strip_option), default)]
10725    pub discard_git_dir: Option<bool>,
10726    /// Set to true to populate tag refs in the local checkout .git.
10727    #[builder(setter(into, strip_option), default)]
10728    pub include_tags: Option<bool>,
10729}
10730#[derive(Builder, Debug, PartialEq)]
10731pub struct GitRefLogOpts<'a> {
10732    /// Exclude commits reachable from this ref, i.e. only list commits added on top of it.
10733    #[builder(setter(into, strip_option), default)]
10734    pub base: Option<Id>,
10735    /// Maximum number of commits to return.
10736    #[builder(setter(into, strip_option), default)]
10737    pub limit: Option<isize>,
10738    /// Only include commits touching these paths, relative to the root of the repository.
10739    #[builder(setter(into, strip_option), default)]
10740    pub paths: Option<Vec<&'a str>>,
10741}
10742#[derive(Builder, Debug, PartialEq)]
10743pub struct GitRefWithCommitOpts<'a> {
10744    /// Allow a commit whose tree matches its parent, including when the supplied edits are already present. Defaults to false.
10745    #[builder(setter(into, strip_option), default)]
10746    pub allow_empty: Option<bool>,
10747    /// RFC3339 committer date. Defaults to date.
10748    #[builder(setter(into, strip_option), default)]
10749    pub committer_date: Option<&'a str>,
10750    /// Committer email. Defaults to authorEmail.
10751    #[builder(setter(into, strip_option), default)]
10752    pub committer_email: Option<&'a str>,
10753    /// Committer name. Defaults to authorName.
10754    #[builder(setter(into, strip_option), default)]
10755    pub committer_name: Option<&'a str>,
10756    /// Add a Signed-off-by trailer using the commit author's name and email.
10757    #[builder(setter(into, strip_option), default)]
10758    pub signoff: Option<bool>,
10759}
10760#[derive(Builder, Debug, PartialEq)]
10761pub struct GitRefAsWorkspaceOpts<'a> {
10762    /// Current working directory inside the workspace root. Defaults to the workspace root.
10763    #[builder(setter(into, strip_option), default)]
10764    pub cwd: Option<&'a str>,
10765}
10766impl IntoID<Id> for GitRef {
10767    fn into_id(
10768        self,
10769    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10770        Box::pin(async move { self.id().await })
10771    }
10772}
10773impl Loadable for GitRef {
10774    fn graphql_type() -> &'static str {
10775        "GitRef"
10776    }
10777    fn from_query(
10778        proc: Option<Arc<DaggerSessionProc>>,
10779        selection: Selection,
10780        graphql_client: DynGraphQLClient,
10781    ) -> Self {
10782        Self {
10783            proc,
10784            selection,
10785            graphql_client,
10786        }
10787    }
10788}
10789impl GitRef {
10790    /// A unique identifier for this GitRef.
10791    pub async fn id(&self) -> Result<Id, DaggerError> {
10792        let query = self.selection.select("id");
10793        query.execute(self.graphql_client.clone()).await
10794    }
10795    /// Push this ref's commit and history to a remote repository using the destination's credentials.
10796    /// 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.
10797    /// 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.
10798    ///
10799    /// # Arguments
10800    ///
10801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10802    pub fn push(&self) -> GitPushResult {
10803        let query = self.selection.select("push");
10804        GitPushResult {
10805            proc: self.proc.clone(),
10806            selection: query,
10807            graphql_client: self.graphql_client.clone(),
10808        }
10809    }
10810    /// Push this ref's commit and history to a remote repository using the destination's credentials.
10811    /// 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.
10812    /// 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.
10813    ///
10814    /// # Arguments
10815    ///
10816    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10817    pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
10818        let mut query = self.selection.select("push");
10819        if let Some(to) = opts.to {
10820            query = query.arg("to", to);
10821        }
10822        if let Some(remote) = opts.remote {
10823            query = query.arg("remote", remote);
10824        }
10825        if let Some(branch) = opts.branch {
10826            query = query.arg("branch", branch);
10827        }
10828        if let Some(expected_remote_sha) = opts.expected_remote_sha {
10829            query = query.arg("expectedRemoteSHA", expected_remote_sha);
10830        }
10831        GitPushResult {
10832            proc: self.proc.clone(),
10833            selection: query,
10834            graphql_client: self.graphql_client.clone(),
10835        }
10836    }
10837    /// The commit this ref resolves to.
10838    pub fn target_commit(&self) -> GitCommit {
10839        let query = self.selection.select("targetCommit");
10840        GitCommit {
10841            proc: self.proc.clone(),
10842            selection: query,
10843            graphql_client: self.graphql_client.clone(),
10844        }
10845    }
10846    /// The resolved commit SHA at this ref.
10847    pub async fn commit_sha(&self) -> Result<String, DaggerError> {
10848        let query = self.selection.select("commitSHA");
10849        query.execute(self.graphql_client.clone()).await
10850    }
10851    /// The filesystem tree at this ref.
10852    ///
10853    /// # Arguments
10854    ///
10855    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10856    pub fn tree(&self) -> Directory {
10857        let query = self.selection.select("tree");
10858        Directory {
10859            proc: self.proc.clone(),
10860            selection: query,
10861            graphql_client: self.graphql_client.clone(),
10862        }
10863    }
10864    /// The filesystem tree at this ref.
10865    ///
10866    /// # Arguments
10867    ///
10868    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10869    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10870        let mut query = self.selection.select("tree");
10871        if let Some(discard_git_dir) = opts.discard_git_dir {
10872            query = query.arg("discardGitDir", discard_git_dir);
10873        }
10874        if let Some(depth) = opts.depth {
10875            query = query.arg("depth", depth);
10876        }
10877        if let Some(include_tags) = opts.include_tags {
10878            query = query.arg("includeTags", include_tags);
10879        }
10880        Directory {
10881            proc: self.proc.clone(),
10882            selection: query,
10883            graphql_client: self.graphql_client.clone(),
10884        }
10885    }
10886    /// The resolved commit id at this ref.
10887    pub async fn commit(&self) -> Result<String, DaggerError> {
10888        let query = self.selection.select("commit");
10889        query.execute(self.graphql_client.clone()).await
10890    }
10891    /// The resolved name of this ref.
10892    pub async fn name(&self) -> Result<String, DaggerError> {
10893        let query = self.selection.select("name");
10894        query.execute(self.graphql_client.clone()).await
10895    }
10896    /// The resolved ref name at this ref.
10897    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10898        let query = self.selection.select("ref");
10899        query.execute(self.graphql_client.clone()).await
10900    }
10901    /// Return true when the other ref's commit equals this commit or is an ancestor of it.
10902    /// Compares commit history across branches, tags and detached refs. Incomplete or unavailable history is an error.
10903    ///
10904    /// # Arguments
10905    ///
10906    /// * `other` - The ref whose commit to look for in this ref's history.
10907    pub async fn contains(&self, other: impl IntoID<Id>) -> Result<bool, DaggerError> {
10908        let mut query = self.selection.select("contains");
10909        query = query.arg_lazy(
10910            "other",
10911            Box::new(move || {
10912                let other = other.clone();
10913                Box::pin(async move { other.into_id().await.unwrap().quote() })
10914            }),
10915        );
10916        query.execute(self.graphql_client.clone()).await
10917    }
10918    /// Find the best common ancestor between this ref and another ref.
10919    ///
10920    /// # Arguments
10921    ///
10922    /// * `other` - The other ref to compare against.
10923    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10924        let mut query = self.selection.select("commonAncestor");
10925        query = query.arg_lazy(
10926            "other",
10927            Box::new(move || {
10928                let other = other.clone();
10929                Box::pin(async move { other.into_id().await.unwrap().quote() })
10930            }),
10931        );
10932        GitRef {
10933            proc: self.proc.clone(),
10934            selection: query,
10935            graphql_client: self.graphql_client.clone(),
10936        }
10937    }
10938    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
10939    ///
10940    /// # Arguments
10941    ///
10942    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10943    pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
10944        let query = self.selection.select("log");
10945        let query = query.select("id");
10946        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10947        Ok(ids
10948            .into_iter()
10949            .map(|id| GitCommit {
10950                proc: self.proc.clone(),
10951                selection: crate::querybuilder::query()
10952                    .select("node")
10953                    .arg("id", &id.0)
10954                    .inline_fragment("GitCommit"),
10955                graphql_client: self.graphql_client.clone(),
10956            })
10957            .collect())
10958    }
10959    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
10960    ///
10961    /// # Arguments
10962    ///
10963    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10964    pub async fn log_opts<'a>(
10965        &self,
10966        opts: GitRefLogOpts<'a>,
10967    ) -> Result<Vec<GitCommit>, DaggerError> {
10968        let mut query = self.selection.select("log");
10969        if let Some(limit) = opts.limit {
10970            query = query.arg("limit", limit);
10971        }
10972        if let Some(paths) = opts.paths {
10973            query = query.arg("paths", paths);
10974        }
10975        if let Some(base) = opts.base {
10976            query = query.arg("base", base);
10977        }
10978        let query = query.select("id");
10979        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10980        Ok(ids
10981            .into_iter()
10982            .map(|id| GitCommit {
10983                proc: self.proc.clone(),
10984                selection: crate::querybuilder::query()
10985                    .select("node")
10986                    .arg("id", &id.0)
10987                    .inline_fragment("GitCommit"),
10988                graphql_client: self.graphql_client.clone(),
10989            })
10990            .collect())
10991    }
10992    /// Create a single-parent commit on this ref by applying a changeset's edits.
10993    /// 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.
10994    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
10995    ///
10996    /// # Arguments
10997    ///
10998    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
10999    /// * `message` - Commit message.
11000    /// * `date` - RFC3339 author date; also the default committer date.
11001    /// * `author_name` - Author name.
11002    /// * `author_email` - Author email.
11003    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11004    pub fn with_commit(
11005        &self,
11006        changes: impl IntoID<Id>,
11007        message: impl Into<String>,
11008        date: impl Into<String>,
11009        author_name: impl Into<String>,
11010        author_email: impl Into<String>,
11011    ) -> GitRef {
11012        let mut query = self.selection.select("withCommit");
11013        query = query.arg_lazy(
11014            "changes",
11015            Box::new(move || {
11016                let changes = changes.clone();
11017                Box::pin(async move { changes.into_id().await.unwrap().quote() })
11018            }),
11019        );
11020        query = query.arg("message", message.into());
11021        query = query.arg("date", date.into());
11022        query = query.arg("authorName", author_name.into());
11023        query = query.arg("authorEmail", author_email.into());
11024        GitRef {
11025            proc: self.proc.clone(),
11026            selection: query,
11027            graphql_client: self.graphql_client.clone(),
11028        }
11029    }
11030    /// Create a single-parent commit on this ref by applying a changeset's edits.
11031    /// 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.
11032    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
11033    ///
11034    /// # Arguments
11035    ///
11036    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
11037    /// * `message` - Commit message.
11038    /// * `date` - RFC3339 author date; also the default committer date.
11039    /// * `author_name` - Author name.
11040    /// * `author_email` - Author email.
11041    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11042    pub fn with_commit_opts<'a>(
11043        &self,
11044        changes: impl IntoID<Id>,
11045        message: impl Into<String>,
11046        date: impl Into<String>,
11047        author_name: impl Into<String>,
11048        author_email: impl Into<String>,
11049        opts: GitRefWithCommitOpts<'a>,
11050    ) -> GitRef {
11051        let mut query = self.selection.select("withCommit");
11052        query = query.arg_lazy(
11053            "changes",
11054            Box::new(move || {
11055                let changes = changes.clone();
11056                Box::pin(async move { changes.into_id().await.unwrap().quote() })
11057            }),
11058        );
11059        query = query.arg("message", message.into());
11060        query = query.arg("date", date.into());
11061        query = query.arg("authorName", author_name.into());
11062        query = query.arg("authorEmail", author_email.into());
11063        if let Some(committer_name) = opts.committer_name {
11064            query = query.arg("committerName", committer_name);
11065        }
11066        if let Some(committer_email) = opts.committer_email {
11067            query = query.arg("committerEmail", committer_email);
11068        }
11069        if let Some(committer_date) = opts.committer_date {
11070            query = query.arg("committerDate", committer_date);
11071        }
11072        if let Some(allow_empty) = opts.allow_empty {
11073            query = query.arg("allowEmpty", allow_empty);
11074        }
11075        if let Some(signoff) = opts.signoff {
11076            query = query.arg("signoff", signoff);
11077        }
11078        GitRef {
11079            proc: self.proc.clone(),
11080            selection: query,
11081            graphql_client: self.graphql_client.clone(),
11082        }
11083    }
11084    /// Return this ref's repository with HEAD pinned to the selected commit.
11085    /// Preserves the original repository backend, connection information, and other refs. Does not modify a branch or checkout, or prune history.
11086    pub fn as_repository(&self) -> GitRepository {
11087        let query = self.selection.select("asRepository");
11088        GitRepository {
11089            proc: self.proc.clone(),
11090            selection: query,
11091            graphql_client: self.graphql_client.clone(),
11092        }
11093    }
11094    /// Creates a synthetic workspace from this git ref.
11095    ///
11096    /// # Arguments
11097    ///
11098    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11099    pub fn as_workspace(&self) -> Workspace {
11100        let query = self.selection.select("asWorkspace");
11101        Workspace {
11102            proc: self.proc.clone(),
11103            selection: query,
11104            graphql_client: self.graphql_client.clone(),
11105        }
11106    }
11107    /// Creates a synthetic workspace from this git ref.
11108    ///
11109    /// # Arguments
11110    ///
11111    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11112    pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
11113        let mut query = self.selection.select("asWorkspace");
11114        if let Some(cwd) = opts.cwd {
11115            query = query.arg("cwd", cwd);
11116        }
11117        Workspace {
11118            proc: self.proc.clone(),
11119            selection: query,
11120            graphql_client: self.graphql_client.clone(),
11121        }
11122    }
11123}
11124impl Node for GitRef {
11125    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11126        let query = self.selection.select("id");
11127        let graphql_client = self.graphql_client.clone();
11128        async move { query.execute(graphql_client).await }
11129    }
11130}
11131#[derive(Clone)]
11132pub struct GitRemote {
11133    pub proc: Option<Arc<DaggerSessionProc>>,
11134    pub selection: Selection,
11135    pub graphql_client: DynGraphQLClient,
11136}
11137impl IntoID<Id> for GitRemote {
11138    fn into_id(
11139        self,
11140    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11141        Box::pin(async move { self.id().await })
11142    }
11143}
11144impl Loadable for GitRemote {
11145    fn graphql_type() -> &'static str {
11146        "GitRemote"
11147    }
11148    fn from_query(
11149        proc: Option<Arc<DaggerSessionProc>>,
11150        selection: Selection,
11151        graphql_client: DynGraphQLClient,
11152    ) -> Self {
11153        Self {
11154            proc,
11155            selection,
11156            graphql_client,
11157        }
11158    }
11159}
11160impl GitRemote {
11161    /// A unique identifier for this GitRemote.
11162    pub async fn id(&self) -> Result<Id, DaggerError> {
11163        let query = self.selection.select("id");
11164        query.execute(self.graphql_client.clone()).await
11165    }
11166    /// Access this remote's repository using its fetch URL and the caller's credentials, or the source's existing capability for this exact destination.
11167    /// HEAD is the remote's HEAD, independent of the workspace's selected commit. Remote registration alone does not grant credentials.
11168    pub fn repository(&self) -> GitRepository {
11169        let query = self.selection.select("repository");
11170        GitRepository {
11171            proc: self.proc.clone(),
11172            selection: query,
11173            graphql_client: self.graphql_client.clone(),
11174        }
11175    }
11176    /// The remote's name.
11177    pub async fn name(&self) -> Result<String, DaggerError> {
11178        let query = self.selection.select("name");
11179        query.execute(self.graphql_client.clone()).await
11180    }
11181}
11182impl Node for GitRemote {
11183    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11184        let query = self.selection.select("id");
11185        let graphql_client = self.graphql_client.clone();
11186        async move { query.execute(graphql_client).await }
11187    }
11188}
11189#[derive(Clone)]
11190pub struct GitRepository {
11191    pub proc: Option<Arc<DaggerSessionProc>>,
11192    pub selection: Selection,
11193    pub graphql_client: DynGraphQLClient,
11194}
11195#[derive(Builder, Debug, PartialEq)]
11196pub struct GitRepositoryHeadOpts {
11197    /// Ignore the workspace lockfile for this lookup.
11198    #[builder(setter(into, strip_option), default)]
11199    pub no_lock: Option<bool>,
11200}
11201#[derive(Builder, Debug, PartialEq)]
11202pub struct GitRepositoryRefOpts {
11203    /// Ignore the workspace lockfile for this lookup.
11204    #[builder(setter(into, strip_option), default)]
11205    pub no_lock: Option<bool>,
11206}
11207#[derive(Builder, Debug, PartialEq)]
11208pub struct GitRepositoryBranchOpts {
11209    /// Ignore the workspace lockfile for this lookup.
11210    #[builder(setter(into, strip_option), default)]
11211    pub no_lock: Option<bool>,
11212}
11213#[derive(Builder, Debug, PartialEq)]
11214pub struct GitRepositoryTagOpts {
11215    /// Ignore the workspace lockfile for this lookup.
11216    #[builder(setter(into, strip_option), default)]
11217    pub no_lock: Option<bool>,
11218}
11219#[derive(Builder, Debug, PartialEq)]
11220pub struct GitRepositoryLatestOpts<'a> {
11221    /// Ignore the workspace lockfile for this lookup.
11222    #[builder(setter(into, strip_option), default)]
11223    pub no_lock: Option<bool>,
11224    /// Version query used to select the greatest matching release ref.
11225    #[builder(setter(into, strip_option), default)]
11226    pub version: Option<&'a str>,
11227}
11228#[derive(Builder, Debug, PartialEq)]
11229pub struct GitRepositoryTagsOpts<'a> {
11230    /// Glob patterns (e.g., "refs/tags/v*").
11231    #[builder(setter(into, strip_option), default)]
11232    pub patterns: Option<Vec<&'a str>>,
11233}
11234#[derive(Builder, Debug, PartialEq)]
11235pub struct GitRepositoryBranchesOpts<'a> {
11236    /// Glob patterns (e.g., "refs/tags/v*").
11237    #[builder(setter(into, strip_option), default)]
11238    pub patterns: Option<Vec<&'a str>>,
11239}
11240#[derive(Builder, Debug, PartialEq)]
11241pub struct GitRepositoryBundleOpts {
11242    /// A Git ref whose reachable objects are omitted and recorded as a prerequisite.
11243    #[builder(setter(into, strip_option), default)]
11244    pub base: Option<Id>,
11245}
11246#[derive(Builder, Debug, PartialEq)]
11247pub struct GitRepositoryWithBundleOpts<'a> {
11248    /// An optional remote ref hint for fetching a prerequisite when the remote does not allow fetches by object ID.
11249    #[builder(setter(into, strip_option), default)]
11250    pub prerequisite_ref: Option<&'a str>,
11251}
11252#[derive(Builder, Debug, PartialEq)]
11253pub struct GitRepositoryWithRemoteOpts<'a> {
11254    /// Push destination, when pushes go somewhere other than url. Empty uses url.
11255    #[builder(setter(into, strip_option), default)]
11256    pub push_url: Option<&'a str>,
11257}
11258#[derive(Builder, Debug, PartialEq)]
11259pub struct GitRepositoryAsWorkspaceOpts<'a> {
11260    /// Current working directory inside the workspace root. Defaults to the workspace root.
11261    #[builder(setter(into, strip_option), default)]
11262    pub cwd: Option<&'a str>,
11263}
11264impl IntoID<Id> for GitRepository {
11265    fn into_id(
11266        self,
11267    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11268        Box::pin(async move { self.id().await })
11269    }
11270}
11271impl Loadable for GitRepository {
11272    fn graphql_type() -> &'static str {
11273        "GitRepository"
11274    }
11275    fn from_query(
11276        proc: Option<Arc<DaggerSessionProc>>,
11277        selection: Selection,
11278        graphql_client: DynGraphQLClient,
11279    ) -> Self {
11280        Self {
11281            proc,
11282            selection,
11283            graphql_client,
11284        }
11285    }
11286}
11287impl GitRepository {
11288    /// A unique identifier for this GitRepository.
11289    pub async fn id(&self) -> Result<Id, DaggerError> {
11290        let query = self.selection.select("id");
11291        query.execute(self.graphql_client.clone()).await
11292    }
11293    /// Returns details for HEAD.
11294    ///
11295    /// # Arguments
11296    ///
11297    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11298    pub fn head(&self) -> GitRef {
11299        let query = self.selection.select("head");
11300        GitRef {
11301            proc: self.proc.clone(),
11302            selection: query,
11303            graphql_client: self.graphql_client.clone(),
11304        }
11305    }
11306    /// Returns details for HEAD.
11307    ///
11308    /// # Arguments
11309    ///
11310    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11311    pub fn head_opts(&self, opts: GitRepositoryHeadOpts) -> GitRef {
11312        let mut query = self.selection.select("head");
11313        if let Some(no_lock) = opts.no_lock {
11314            query = query.arg("noLock", no_lock);
11315        }
11316        GitRef {
11317            proc: self.proc.clone(),
11318            selection: query,
11319            graphql_client: self.graphql_client.clone(),
11320        }
11321    }
11322    /// Returns details of a ref.
11323    ///
11324    /// # Arguments
11325    ///
11326    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11327    ///
11328    /// 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.
11329    ///
11330    /// The name may be followed by git revision suffixes, applied left to right: `~N` follows first parents N times and `^N` selects the Nth parent (`~` and `^` mean 1, `^0` is the commit itself), e.g. `HEAD~3`, `main^2` or `abc1234~2`. The result is a detached ref of the resulting commit; remote repositories fetch the history the walk needs. Other git revision syntax (`^{...}`, `@{...}`, `:path`, ranges) is not supported.
11331    ///
11332    /// A repository derived from a remote one (e.g. a workspace's history after a snapshot or commit) resolves names and commits it does not contain itself through that remote, with its authentication. Its branches and tags listings include the remote's.
11333    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11334    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
11335        let mut query = self.selection.select("ref");
11336        query = query.arg("name", name.into());
11337        GitRef {
11338            proc: self.proc.clone(),
11339            selection: query,
11340            graphql_client: self.graphql_client.clone(),
11341        }
11342    }
11343    /// Returns details of a ref.
11344    ///
11345    /// # Arguments
11346    ///
11347    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11348    ///
11349    /// 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.
11350    ///
11351    /// The name may be followed by git revision suffixes, applied left to right: `~N` follows first parents N times and `^N` selects the Nth parent (`~` and `^` mean 1, `^0` is the commit itself), e.g. `HEAD~3`, `main^2` or `abc1234~2`. The result is a detached ref of the resulting commit; remote repositories fetch the history the walk needs. Other git revision syntax (`^{...}`, `@{...}`, `:path`, ranges) is not supported.
11352    ///
11353    /// A repository derived from a remote one (e.g. a workspace's history after a snapshot or commit) resolves names and commits it does not contain itself through that remote, with its authentication. Its branches and tags listings include the remote's.
11354    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11355    pub fn r#ref_opts(&self, name: impl Into<String>, opts: GitRepositoryRefOpts) -> GitRef {
11356        let mut query = self.selection.select("ref");
11357        query = query.arg("name", name.into());
11358        if let Some(no_lock) = opts.no_lock {
11359            query = query.arg("noLock", no_lock);
11360        }
11361        GitRef {
11362            proc: self.proc.clone(),
11363            selection: query,
11364            graphql_client: self.graphql_client.clone(),
11365        }
11366    }
11367    /// Returns details of a branch.
11368    ///
11369    /// # Arguments
11370    ///
11371    /// * `name` - Branch's name (e.g., "main").
11372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11373    pub fn branch(&self, name: impl Into<String>) -> GitRef {
11374        let mut query = self.selection.select("branch");
11375        query = query.arg("name", name.into());
11376        GitRef {
11377            proc: self.proc.clone(),
11378            selection: query,
11379            graphql_client: self.graphql_client.clone(),
11380        }
11381    }
11382    /// Returns details of a branch.
11383    ///
11384    /// # Arguments
11385    ///
11386    /// * `name` - Branch's name (e.g., "main").
11387    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11388    pub fn branch_opts(&self, name: impl Into<String>, opts: GitRepositoryBranchOpts) -> GitRef {
11389        let mut query = self.selection.select("branch");
11390        query = query.arg("name", name.into());
11391        if let Some(no_lock) = opts.no_lock {
11392            query = query.arg("noLock", no_lock);
11393        }
11394        GitRef {
11395            proc: self.proc.clone(),
11396            selection: query,
11397            graphql_client: self.graphql_client.clone(),
11398        }
11399    }
11400    /// Returns details of a tag.
11401    ///
11402    /// # Arguments
11403    ///
11404    /// * `name` - Tag's name (e.g., "v0.3.9").
11405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11406    pub fn tag(&self, name: impl Into<String>) -> GitRef {
11407        let mut query = self.selection.select("tag");
11408        query = query.arg("name", name.into());
11409        GitRef {
11410            proc: self.proc.clone(),
11411            selection: query,
11412            graphql_client: self.graphql_client.clone(),
11413        }
11414    }
11415    /// Returns details of a tag.
11416    ///
11417    /// # Arguments
11418    ///
11419    /// * `name` - Tag's name (e.g., "v0.3.9").
11420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11421    pub fn tag_opts(&self, name: impl Into<String>, opts: GitRepositoryTagOpts) -> GitRef {
11422        let mut query = self.selection.select("tag");
11423        query = query.arg("name", name.into());
11424        if let Some(no_lock) = opts.no_lock {
11425            query = query.arg("noLock", no_lock);
11426        }
11427        GitRef {
11428            proc: self.proc.clone(),
11429            selection: query,
11430            graphql_client: self.graphql_client.clone(),
11431        }
11432    }
11433    /// Returns details of a commit.
11434    ///
11435    /// # Arguments
11436    ///
11437    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
11438    ///
11439    /// 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.
11440    pub fn commit(&self, id: impl Into<String>) -> GitCommit {
11441        let mut query = self.selection.select("commit");
11442        query = query.arg("id", id.into());
11443        GitCommit {
11444            proc: self.proc.clone(),
11445            selection: query,
11446            graphql_client: self.graphql_client.clone(),
11447        }
11448    }
11449    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11450    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11451    ///
11452    /// # Arguments
11453    ///
11454    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11455    pub fn latest(&self) -> GitRef {
11456        let query = self.selection.select("latest");
11457        GitRef {
11458            proc: self.proc.clone(),
11459            selection: query,
11460            graphql_client: self.graphql_client.clone(),
11461        }
11462    }
11463    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11464    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11465    ///
11466    /// # Arguments
11467    ///
11468    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11469    pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
11470        let mut query = self.selection.select("latest");
11471        if let Some(version) = opts.version {
11472            query = query.arg("version", version);
11473        }
11474        if let Some(no_lock) = opts.no_lock {
11475            query = query.arg("noLock", no_lock);
11476        }
11477        GitRef {
11478            proc: self.proc.clone(),
11479            selection: query,
11480            graphql_client: self.graphql_client.clone(),
11481        }
11482    }
11483    /// tags that match any of the given glob patterns.
11484    ///
11485    /// # Arguments
11486    ///
11487    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11488    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
11489        let query = self.selection.select("tags");
11490        query.execute(self.graphql_client.clone()).await
11491    }
11492    /// tags that match any of the given glob patterns.
11493    ///
11494    /// # Arguments
11495    ///
11496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11497    pub async fn tags_opts<'a>(
11498        &self,
11499        opts: GitRepositoryTagsOpts<'a>,
11500    ) -> Result<Vec<String>, DaggerError> {
11501        let mut query = self.selection.select("tags");
11502        if let Some(patterns) = opts.patterns {
11503            query = query.arg("patterns", patterns);
11504        }
11505        query.execute(self.graphql_client.clone()).await
11506    }
11507    /// branches that match any of the given glob patterns.
11508    ///
11509    /// # Arguments
11510    ///
11511    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11512    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
11513        let query = self.selection.select("branches");
11514        query.execute(self.graphql_client.clone()).await
11515    }
11516    /// branches that match any of the given glob patterns.
11517    ///
11518    /// # Arguments
11519    ///
11520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11521    pub async fn branches_opts<'a>(
11522        &self,
11523        opts: GitRepositoryBranchesOpts<'a>,
11524    ) -> Result<Vec<String>, DaggerError> {
11525        let mut query = self.selection.select("branches");
11526        if let Some(patterns) = opts.patterns {
11527            query = query.arg("patterns", patterns);
11528        }
11529        query.execute(self.graphql_client.clone()).await
11530    }
11531    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11532    ///
11533    /// # Arguments
11534    ///
11535    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11537    pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
11538        let mut query = self.selection.select("bundle");
11539        query = query.arg(
11540            "refs",
11541            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11542        );
11543        GitBundle {
11544            proc: self.proc.clone(),
11545            selection: query,
11546            graphql_client: self.graphql_client.clone(),
11547        }
11548    }
11549    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11550    ///
11551    /// # Arguments
11552    ///
11553    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11554    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11555    pub fn bundle_opts(
11556        &self,
11557        refs: Vec<impl Into<String>>,
11558        opts: GitRepositoryBundleOpts,
11559    ) -> GitBundle {
11560        let mut query = self.selection.select("bundle");
11561        query = query.arg(
11562            "refs",
11563            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11564        );
11565        if let Some(base) = opts.base {
11566            query = query.arg("base", base);
11567        }
11568        GitBundle {
11569            proc: self.proc.clone(),
11570            selection: query,
11571            graphql_client: self.graphql_client.clone(),
11572        }
11573    }
11574    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11575    ///
11576    /// # Arguments
11577    ///
11578    /// * `bundle` - The Git bundle to import.
11579    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11580    pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
11581        let mut query = self.selection.select("withBundle");
11582        query = query.arg_lazy(
11583            "bundle",
11584            Box::new(move || {
11585                let bundle = bundle.clone();
11586                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11587            }),
11588        );
11589        GitRepository {
11590            proc: self.proc.clone(),
11591            selection: query,
11592            graphql_client: self.graphql_client.clone(),
11593        }
11594    }
11595    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11596    ///
11597    /// # Arguments
11598    ///
11599    /// * `bundle` - The Git bundle to import.
11600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11601    pub fn with_bundle_opts<'a>(
11602        &self,
11603        bundle: impl IntoID<Id>,
11604        opts: GitRepositoryWithBundleOpts<'a>,
11605    ) -> GitRepository {
11606        let mut query = self.selection.select("withBundle");
11607        query = query.arg_lazy(
11608            "bundle",
11609            Box::new(move || {
11610                let bundle = bundle.clone();
11611                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11612            }),
11613        );
11614        if let Some(prerequisite_ref) = opts.prerequisite_ref {
11615            query = query.arg("prerequisiteRef", prerequisite_ref);
11616        }
11617        GitRepository {
11618            proc: self.proc.clone(),
11619            selection: query,
11620            graphql_client: self.graphql_client.clone(),
11621        }
11622    }
11623    /// Register a named remote on this repository, replacing any registered remote of the same name.
11624    /// 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.
11625    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11626    ///
11627    /// # Arguments
11628    ///
11629    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11630    /// * `url` - The remote's fetch URL.
11631    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11632    pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
11633        let mut query = self.selection.select("withRemote");
11634        query = query.arg("name", name.into());
11635        query = query.arg("url", url.into());
11636        GitRepository {
11637            proc: self.proc.clone(),
11638            selection: query,
11639            graphql_client: self.graphql_client.clone(),
11640        }
11641    }
11642    /// Register a named remote on this repository, replacing any registered remote of the same name.
11643    /// 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.
11644    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11645    ///
11646    /// # Arguments
11647    ///
11648    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11649    /// * `url` - The remote's fetch URL.
11650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11651    pub fn with_remote_opts<'a>(
11652        &self,
11653        name: impl Into<String>,
11654        url: impl Into<String>,
11655        opts: GitRepositoryWithRemoteOpts<'a>,
11656    ) -> GitRepository {
11657        let mut query = self.selection.select("withRemote");
11658        query = query.arg("name", name.into());
11659        query = query.arg("url", url.into());
11660        if let Some(push_url) = opts.push_url {
11661            query = query.arg("pushUrl", push_url);
11662        }
11663        GitRepository {
11664            proc: self.proc.clone(),
11665            selection: query,
11666            graphql_client: self.graphql_client.clone(),
11667        }
11668    }
11669    /// List this repository's named remotes, with registered remotes overriding configured ones. Does not contact remote servers.
11670    pub async fn remotes(&self) -> Result<Vec<GitRemote>, DaggerError> {
11671        let query = self.selection.select("remotes");
11672        let query = query.select("id");
11673        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11674        Ok(ids
11675            .into_iter()
11676            .map(|id| GitRemote {
11677                proc: self.proc.clone(),
11678                selection: crate::querybuilder::query()
11679                    .select("node")
11680                    .arg("id", &id.0)
11681                    .inline_fragment("GitRemote"),
11682                graphql_client: self.graphql_client.clone(),
11683            })
11684            .collect())
11685    }
11686    /// Look up a remote by name. Fails when the remote does not exist.
11687    ///
11688    /// # Arguments
11689    ///
11690    /// * `name` - The remote's name.
11691    pub fn remote(&self, name: impl Into<String>) -> GitRemote {
11692        let mut query = self.selection.select("remote");
11693        query = query.arg("name", name.into());
11694        GitRemote {
11695            proc: self.proc.clone(),
11696            selection: query,
11697            graphql_client: self.graphql_client.clone(),
11698        }
11699    }
11700    /// Return the sole remote, otherwise origin, otherwise the selected branch's upstream remote, otherwise null.
11701    /// Frozen workspaces retain their captured upstream selection. Does not contact remote servers.
11702    pub async fn default_remote(&self) -> Result<Option<GitRemote>, DaggerError> {
11703        let query = self.selection.select("defaultRemote");
11704        let query = query.select("id");
11705        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11706        Ok(id.map(|id| GitRemote {
11707            proc: self.proc.clone(),
11708            selection: query
11709                .root()
11710                .select("node")
11711                .arg("id", &id.0)
11712                .inline_fragment("GitRemote"),
11713            graphql_client: self.graphql_client.clone(),
11714        }))
11715    }
11716    /// Replace this repository's storage with the supplied self-contained Git repository, retaining its logical URL and push destinations.
11717    /// 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.
11718    /// 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.
11719    /// When the receiver is a remote repository (or was derived from one), that remote is retained with its authentication: refs the supplied storage does not contain resolve through it.
11720    ///
11721    /// # Arguments
11722    ///
11723    /// * `directory` - Existing Git storage to open. Git metadata and object dependencies must be contained in this directory.
11724    pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
11725        let mut query = self.selection.select("withContents");
11726        query = query.arg_lazy(
11727            "directory",
11728            Box::new(move || {
11729                let directory = directory.clone();
11730                Box::pin(async move { directory.into_id().await.unwrap().quote() })
11731            }),
11732        );
11733        GitRepository {
11734            proc: self.proc.clone(),
11735            selection: query,
11736            graphql_client: self.graphql_client.clone(),
11737        }
11738    }
11739    /// Returns the changeset of uncommitted changes in the git repository.
11740    pub fn uncommitted(&self) -> Changeset {
11741        let query = self.selection.select("uncommitted");
11742        Changeset {
11743            proc: self.proc.clone(),
11744            selection: query,
11745            graphql_client: self.graphql_client.clone(),
11746        }
11747    }
11748    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11749    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11750    ///
11751    /// # Arguments
11752    ///
11753    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11754    pub fn as_workspace(&self) -> Workspace {
11755        let query = self.selection.select("asWorkspace");
11756        Workspace {
11757            proc: self.proc.clone(),
11758            selection: query,
11759            graphql_client: self.graphql_client.clone(),
11760        }
11761    }
11762    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11763    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11764    ///
11765    /// # Arguments
11766    ///
11767    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11768    pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
11769        let mut query = self.selection.select("asWorkspace");
11770        if let Some(cwd) = opts.cwd {
11771            query = query.arg("cwd", cwd);
11772        }
11773        Workspace {
11774            proc: self.proc.clone(),
11775            selection: query,
11776            graphql_client: self.graphql_client.clone(),
11777        }
11778    }
11779    /// The URL of the git repository.
11780    pub async fn url(&self) -> Result<String, DaggerError> {
11781        let query = self.selection.select("url");
11782        query.execute(self.graphql_client.clone()).await
11783    }
11784}
11785impl Node for GitRepository {
11786    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11787        let query = self.selection.select("id");
11788        let graphql_client = self.graphql_client.clone();
11789        async move { query.execute(graphql_client).await }
11790    }
11791}
11792#[derive(Clone)]
11793pub struct HttpState {
11794    pub proc: Option<Arc<DaggerSessionProc>>,
11795    pub selection: Selection,
11796    pub graphql_client: DynGraphQLClient,
11797}
11798impl IntoID<Id> for HttpState {
11799    fn into_id(
11800        self,
11801    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11802        Box::pin(async move { self.id().await })
11803    }
11804}
11805impl Loadable for HttpState {
11806    fn graphql_type() -> &'static str {
11807        "HTTPState"
11808    }
11809    fn from_query(
11810        proc: Option<Arc<DaggerSessionProc>>,
11811        selection: Selection,
11812        graphql_client: DynGraphQLClient,
11813    ) -> Self {
11814        Self {
11815            proc,
11816            selection,
11817            graphql_client,
11818        }
11819    }
11820}
11821impl HttpState {
11822    /// A unique identifier for this HTTPState.
11823    pub async fn id(&self) -> Result<Id, DaggerError> {
11824        let query = self.selection.select("id");
11825        query.execute(self.graphql_client.clone()).await
11826    }
11827}
11828impl Node for HttpState {
11829    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11830        let query = self.selection.select("id");
11831        let graphql_client = self.graphql_client.clone();
11832        async move { query.execute(graphql_client).await }
11833    }
11834}
11835#[derive(Clone)]
11836pub struct HealthcheckConfig {
11837    pub proc: Option<Arc<DaggerSessionProc>>,
11838    pub selection: Selection,
11839    pub graphql_client: DynGraphQLClient,
11840}
11841impl IntoID<Id> for HealthcheckConfig {
11842    fn into_id(
11843        self,
11844    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11845        Box::pin(async move { self.id().await })
11846    }
11847}
11848impl Loadable for HealthcheckConfig {
11849    fn graphql_type() -> &'static str {
11850        "HealthcheckConfig"
11851    }
11852    fn from_query(
11853        proc: Option<Arc<DaggerSessionProc>>,
11854        selection: Selection,
11855        graphql_client: DynGraphQLClient,
11856    ) -> Self {
11857        Self {
11858            proc,
11859            selection,
11860            graphql_client,
11861        }
11862    }
11863}
11864impl HealthcheckConfig {
11865    /// A unique identifier for this HealthcheckConfig.
11866    pub async fn id(&self) -> Result<Id, DaggerError> {
11867        let query = self.selection.select("id");
11868        query.execute(self.graphql_client.clone()).await
11869    }
11870    /// Healthcheck command arguments.
11871    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
11872        let query = self.selection.select("args");
11873        query.execute(self.graphql_client.clone()).await
11874    }
11875    /// Healthcheck command is a shell command.
11876    pub async fn shell(&self) -> Result<bool, DaggerError> {
11877        let query = self.selection.select("shell");
11878        query.execute(self.graphql_client.clone()).await
11879    }
11880    /// Healthcheck timeout. Example:3s
11881    pub async fn timeout(&self) -> Result<String, DaggerError> {
11882        let query = self.selection.select("timeout");
11883        query.execute(self.graphql_client.clone()).await
11884    }
11885    /// Interval between running healthcheck. Example:30s
11886    pub async fn interval(&self) -> Result<String, DaggerError> {
11887        let query = self.selection.select("interval");
11888        query.execute(self.graphql_client.clone()).await
11889    }
11890    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
11891    pub async fn start_period(&self) -> Result<String, DaggerError> {
11892        let query = self.selection.select("startPeriod");
11893        query.execute(self.graphql_client.clone()).await
11894    }
11895    /// StartInterval configures the duration between checks during the startup phase. Example:5s
11896    pub async fn start_interval(&self) -> Result<String, DaggerError> {
11897        let query = self.selection.select("startInterval");
11898        query.execute(self.graphql_client.clone()).await
11899    }
11900    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
11901    pub async fn retries(&self) -> Result<isize, DaggerError> {
11902        let query = self.selection.select("retries");
11903        query.execute(self.graphql_client.clone()).await
11904    }
11905}
11906impl Node for HealthcheckConfig {
11907    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11908        let query = self.selection.select("id");
11909        let graphql_client = self.graphql_client.clone();
11910        async move { query.execute(graphql_client).await }
11911    }
11912}
11913#[derive(Clone)]
11914pub struct Host {
11915    pub proc: Option<Arc<DaggerSessionProc>>,
11916    pub selection: Selection,
11917    pub graphql_client: DynGraphQLClient,
11918}
11919#[derive(Builder, Debug, PartialEq)]
11920pub struct HostDirectoryOpts<'a> {
11921    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
11922    #[builder(setter(into, strip_option), default)]
11923    pub exclude: Option<Vec<&'a str>>,
11924    /// Apply .gitignore filter rules inside the directory
11925    #[builder(setter(into, strip_option), default)]
11926    pub gitignore: Option<bool>,
11927    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
11928    #[builder(setter(into, strip_option), default)]
11929    pub include: Option<Vec<&'a str>>,
11930    /// If true, the directory will always be reloaded from the host.
11931    #[builder(setter(into, strip_option), default)]
11932    pub no_cache: Option<bool>,
11933}
11934#[derive(Builder, Debug, PartialEq)]
11935pub struct HostFileOpts {
11936    /// If true, the file will always be reloaded from the host.
11937    #[builder(setter(into, strip_option), default)]
11938    pub no_cache: Option<bool>,
11939}
11940#[derive(Builder, Debug, PartialEq)]
11941pub struct HostFindUpOpts {
11942    #[builder(setter(into, strip_option), default)]
11943    pub no_cache: Option<bool>,
11944}
11945#[derive(Builder, Debug, PartialEq)]
11946pub struct HostTunnelOpts {
11947    /// Map each service port to the same port on the host, as if the service were running natively.
11948    /// Note: enabling may result in port conflicts.
11949    #[builder(setter(into, strip_option), default)]
11950    pub native: Option<bool>,
11951    /// Configure explicit port forwarding rules for the tunnel.
11952    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
11953    /// 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.
11954    /// If ports are given and native is true, the ports are additive.
11955    #[builder(setter(into, strip_option), default)]
11956    pub ports: Option<Vec<PortForward>>,
11957}
11958#[derive(Builder, Debug, PartialEq)]
11959pub struct HostServiceOpts<'a> {
11960    /// Upstream host to forward traffic to.
11961    #[builder(setter(into, strip_option), default)]
11962    pub host: Option<&'a str>,
11963}
11964impl IntoID<Id> for Host {
11965    fn into_id(
11966        self,
11967    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11968        Box::pin(async move { self.id().await })
11969    }
11970}
11971impl Loadable for Host {
11972    fn graphql_type() -> &'static str {
11973        "Host"
11974    }
11975    fn from_query(
11976        proc: Option<Arc<DaggerSessionProc>>,
11977        selection: Selection,
11978        graphql_client: DynGraphQLClient,
11979    ) -> Self {
11980        Self {
11981            proc,
11982            selection,
11983            graphql_client,
11984        }
11985    }
11986}
11987impl Host {
11988    /// A unique identifier for this Host.
11989    pub async fn id(&self) -> Result<Id, DaggerError> {
11990        let query = self.selection.select("id");
11991        query.execute(self.graphql_client.clone()).await
11992    }
11993    /// Accesses a directory on the host.
11994    ///
11995    /// # Arguments
11996    ///
11997    /// * `path` - Location of the directory to access (e.g., ".").
11998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11999    pub fn directory(&self, path: impl Into<String>) -> Directory {
12000        let mut query = self.selection.select("directory");
12001        query = query.arg("path", path.into());
12002        Directory {
12003            proc: self.proc.clone(),
12004            selection: query,
12005            graphql_client: self.graphql_client.clone(),
12006        }
12007    }
12008    /// Accesses a directory on the host.
12009    ///
12010    /// # Arguments
12011    ///
12012    /// * `path` - Location of the directory to access (e.g., ".").
12013    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12014    pub fn directory_opts<'a>(
12015        &self,
12016        path: impl Into<String>,
12017        opts: HostDirectoryOpts<'a>,
12018    ) -> Directory {
12019        let mut query = self.selection.select("directory");
12020        query = query.arg("path", path.into());
12021        if let Some(exclude) = opts.exclude {
12022            query = query.arg("exclude", exclude);
12023        }
12024        if let Some(include) = opts.include {
12025            query = query.arg("include", include);
12026        }
12027        if let Some(no_cache) = opts.no_cache {
12028            query = query.arg("noCache", no_cache);
12029        }
12030        if let Some(gitignore) = opts.gitignore {
12031            query = query.arg("gitignore", gitignore);
12032        }
12033        Directory {
12034            proc: self.proc.clone(),
12035            selection: query,
12036            graphql_client: self.graphql_client.clone(),
12037        }
12038    }
12039    /// Accesses a file on the host.
12040    ///
12041    /// # Arguments
12042    ///
12043    /// * `path` - Location of the file to retrieve (e.g., "README.md").
12044    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12045    pub fn file(&self, path: impl Into<String>) -> File {
12046        let mut query = self.selection.select("file");
12047        query = query.arg("path", path.into());
12048        File {
12049            proc: self.proc.clone(),
12050            selection: query,
12051            graphql_client: self.graphql_client.clone(),
12052        }
12053    }
12054    /// Accesses a file on the host.
12055    ///
12056    /// # Arguments
12057    ///
12058    /// * `path` - Location of the file to retrieve (e.g., "README.md").
12059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12060    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
12061        let mut query = self.selection.select("file");
12062        query = query.arg("path", path.into());
12063        if let Some(no_cache) = opts.no_cache {
12064            query = query.arg("noCache", no_cache);
12065        }
12066        File {
12067            proc: self.proc.clone(),
12068            selection: query,
12069            graphql_client: self.graphql_client.clone(),
12070        }
12071    }
12072    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12073    ///
12074    /// # Arguments
12075    ///
12076    /// * `name` - name of the file or directory to search for
12077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12078    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
12079        let mut query = self.selection.select("findUp");
12080        query = query.arg("name", name.into());
12081        query.execute(self.graphql_client.clone()).await
12082    }
12083    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12084    ///
12085    /// # Arguments
12086    ///
12087    /// * `name` - name of the file or directory to search for
12088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12089    pub async fn find_up_opts(
12090        &self,
12091        name: impl Into<String>,
12092        opts: HostFindUpOpts,
12093    ) -> Result<String, DaggerError> {
12094        let mut query = self.selection.select("findUp");
12095        query = query.arg("name", name.into());
12096        if let Some(no_cache) = opts.no_cache {
12097            query = query.arg("noCache", no_cache);
12098        }
12099        query.execute(self.graphql_client.clone()).await
12100    }
12101    /// Accesses a Unix socket on the host.
12102    ///
12103    /// # Arguments
12104    ///
12105    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
12106    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
12107        let mut query = self.selection.select("unixSocket");
12108        query = query.arg("path", path.into());
12109        Socket {
12110            proc: self.proc.clone(),
12111            selection: query,
12112            graphql_client: self.graphql_client.clone(),
12113        }
12114    }
12115    /// Creates a tunnel that forwards traffic from the host to a service.
12116    ///
12117    /// # Arguments
12118    ///
12119    /// * `service` - Service to send traffic from the tunnel.
12120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12121    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
12122        let mut query = self.selection.select("tunnel");
12123        query = query.arg_lazy(
12124            "service",
12125            Box::new(move || {
12126                let service = service.clone();
12127                Box::pin(async move { service.into_id().await.unwrap().quote() })
12128            }),
12129        );
12130        Service {
12131            proc: self.proc.clone(),
12132            selection: query,
12133            graphql_client: self.graphql_client.clone(),
12134        }
12135    }
12136    /// Creates a tunnel that forwards traffic from the host to a service.
12137    ///
12138    /// # Arguments
12139    ///
12140    /// * `service` - Service to send traffic from the tunnel.
12141    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12142    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
12143        let mut query = self.selection.select("tunnel");
12144        query = query.arg_lazy(
12145            "service",
12146            Box::new(move || {
12147                let service = service.clone();
12148                Box::pin(async move { service.into_id().await.unwrap().quote() })
12149            }),
12150        );
12151        if let Some(native) = opts.native {
12152            query = query.arg("native", native);
12153        }
12154        if let Some(ports) = opts.ports {
12155            query = query.arg("ports", ports);
12156        }
12157        Service {
12158            proc: self.proc.clone(),
12159            selection: query,
12160            graphql_client: self.graphql_client.clone(),
12161        }
12162    }
12163    /// Creates a service that forwards traffic to a specified address via the host.
12164    ///
12165    /// # Arguments
12166    ///
12167    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12168    ///
12169    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12170    ///
12171    /// An empty set of ports is not valid; an error will be returned.
12172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12173    pub fn service(&self, ports: Vec<PortForward>) -> Service {
12174        let mut query = self.selection.select("service");
12175        query = query.arg("ports", ports);
12176        Service {
12177            proc: self.proc.clone(),
12178            selection: query,
12179            graphql_client: self.graphql_client.clone(),
12180        }
12181    }
12182    /// Creates a service that forwards traffic to a specified address via the host.
12183    ///
12184    /// # Arguments
12185    ///
12186    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12187    ///
12188    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12189    ///
12190    /// An empty set of ports is not valid; an error will be returned.
12191    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12192    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
12193        let mut query = self.selection.select("service");
12194        query = query.arg("ports", ports);
12195        if let Some(host) = opts.host {
12196            query = query.arg("host", host);
12197        }
12198        Service {
12199            proc: self.proc.clone(),
12200            selection: query,
12201            graphql_client: self.graphql_client.clone(),
12202        }
12203    }
12204    /// Accesses a container image on the host.
12205    ///
12206    /// # Arguments
12207    ///
12208    /// * `name` - Name of the image to access.
12209    pub fn container_image(&self, name: impl Into<String>) -> Container {
12210        let mut query = self.selection.select("containerImage");
12211        query = query.arg("name", name.into());
12212        Container {
12213            proc: self.proc.clone(),
12214            selection: query,
12215            graphql_client: self.graphql_client.clone(),
12216        }
12217    }
12218}
12219impl Node for Host {
12220    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12221        let query = self.selection.select("id");
12222        let graphql_client = self.graphql_client.clone();
12223        async move { query.execute(graphql_client).await }
12224    }
12225}
12226#[derive(Clone)]
12227pub struct InputTypeDef {
12228    pub proc: Option<Arc<DaggerSessionProc>>,
12229    pub selection: Selection,
12230    pub graphql_client: DynGraphQLClient,
12231}
12232impl IntoID<Id> for InputTypeDef {
12233    fn into_id(
12234        self,
12235    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12236        Box::pin(async move { self.id().await })
12237    }
12238}
12239impl Loadable for InputTypeDef {
12240    fn graphql_type() -> &'static str {
12241        "InputTypeDef"
12242    }
12243    fn from_query(
12244        proc: Option<Arc<DaggerSessionProc>>,
12245        selection: Selection,
12246        graphql_client: DynGraphQLClient,
12247    ) -> Self {
12248        Self {
12249            proc,
12250            selection,
12251            graphql_client,
12252        }
12253    }
12254}
12255impl InputTypeDef {
12256    /// A unique identifier for this InputTypeDef.
12257    pub async fn id(&self) -> Result<Id, DaggerError> {
12258        let query = self.selection.select("id");
12259        query.execute(self.graphql_client.clone()).await
12260    }
12261    /// Static fields defined on this input object, if any.
12262    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12263        let query = self.selection.select("fields");
12264        let query = query.select("id");
12265        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12266        Ok(ids
12267            .into_iter()
12268            .map(|id| FieldTypeDef {
12269                proc: self.proc.clone(),
12270                selection: crate::querybuilder::query()
12271                    .select("node")
12272                    .arg("id", &id.0)
12273                    .inline_fragment("FieldTypeDef"),
12274                graphql_client: self.graphql_client.clone(),
12275            })
12276            .collect())
12277    }
12278    /// The name of the input object.
12279    pub async fn name(&self) -> Result<String, DaggerError> {
12280        let query = self.selection.select("name");
12281        query.execute(self.graphql_client.clone()).await
12282    }
12283}
12284impl Node for InputTypeDef {
12285    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12286        let query = self.selection.select("id");
12287        let graphql_client = self.graphql_client.clone();
12288        async move { query.execute(graphql_client).await }
12289    }
12290}
12291#[derive(Clone)]
12292pub struct InterfaceTypeDef {
12293    pub proc: Option<Arc<DaggerSessionProc>>,
12294    pub selection: Selection,
12295    pub graphql_client: DynGraphQLClient,
12296}
12297impl IntoID<Id> for InterfaceTypeDef {
12298    fn into_id(
12299        self,
12300    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12301        Box::pin(async move { self.id().await })
12302    }
12303}
12304impl Loadable for InterfaceTypeDef {
12305    fn graphql_type() -> &'static str {
12306        "InterfaceTypeDef"
12307    }
12308    fn from_query(
12309        proc: Option<Arc<DaggerSessionProc>>,
12310        selection: Selection,
12311        graphql_client: DynGraphQLClient,
12312    ) -> Self {
12313        Self {
12314            proc,
12315            selection,
12316            graphql_client,
12317        }
12318    }
12319}
12320impl InterfaceTypeDef {
12321    /// A unique identifier for this InterfaceTypeDef.
12322    pub async fn id(&self) -> Result<Id, DaggerError> {
12323        let query = self.selection.select("id");
12324        query.execute(self.graphql_client.clone()).await
12325    }
12326    /// Functions defined on this interface, if any.
12327    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12328        let query = self.selection.select("functions");
12329        let query = query.select("id");
12330        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12331        Ok(ids
12332            .into_iter()
12333            .map(|id| Function {
12334                proc: self.proc.clone(),
12335                selection: crate::querybuilder::query()
12336                    .select("node")
12337                    .arg("id", &id.0)
12338                    .inline_fragment("Function"),
12339                graphql_client: self.graphql_client.clone(),
12340            })
12341            .collect())
12342    }
12343    /// The name of the interface.
12344    pub async fn name(&self) -> Result<String, DaggerError> {
12345        let query = self.selection.select("name");
12346        query.execute(self.graphql_client.clone()).await
12347    }
12348    /// The doc string for the interface, if any.
12349    pub async fn description(&self) -> Result<String, DaggerError> {
12350        let query = self.selection.select("description");
12351        query.execute(self.graphql_client.clone()).await
12352    }
12353    /// The location of this interface declaration.
12354    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12355        let query = self.selection.select("sourceMap");
12356        let query = query.select("id");
12357        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12358        Ok(id.map(|id| SourceMap {
12359            proc: self.proc.clone(),
12360            selection: query
12361                .root()
12362                .select("node")
12363                .arg("id", &id.0)
12364                .inline_fragment("SourceMap"),
12365            graphql_client: self.graphql_client.clone(),
12366        }))
12367    }
12368    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
12369    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12370        let query = self.selection.select("sourceModuleName");
12371        query.execute(self.graphql_client.clone()).await
12372    }
12373}
12374impl Node for InterfaceTypeDef {
12375    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12376        let query = self.selection.select("id");
12377        let graphql_client = self.graphql_client.clone();
12378        async move { query.execute(graphql_client).await }
12379    }
12380}
12381#[derive(Clone)]
12382pub struct JsonValue {
12383    pub proc: Option<Arc<DaggerSessionProc>>,
12384    pub selection: Selection,
12385    pub graphql_client: DynGraphQLClient,
12386}
12387#[derive(Builder, Debug, PartialEq)]
12388pub struct JsonValueContentsOpts<'a> {
12389    /// Optional line prefix
12390    #[builder(setter(into, strip_option), default)]
12391    pub indent: Option<&'a str>,
12392    /// Pretty-print
12393    #[builder(setter(into, strip_option), default)]
12394    pub pretty: Option<bool>,
12395}
12396impl IntoID<Id> for JsonValue {
12397    fn into_id(
12398        self,
12399    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12400        Box::pin(async move { self.id().await })
12401    }
12402}
12403impl Loadable for JsonValue {
12404    fn graphql_type() -> &'static str {
12405        "JSONValue"
12406    }
12407    fn from_query(
12408        proc: Option<Arc<DaggerSessionProc>>,
12409        selection: Selection,
12410        graphql_client: DynGraphQLClient,
12411    ) -> Self {
12412        Self {
12413            proc,
12414            selection,
12415            graphql_client,
12416        }
12417    }
12418}
12419impl JsonValue {
12420    /// A unique identifier for this JSONValue.
12421    pub async fn id(&self) -> Result<Id, DaggerError> {
12422        let query = self.selection.select("id");
12423        query.execute(self.graphql_client.clone()).await
12424    }
12425    /// Return the value encoded as json
12426    ///
12427    /// # Arguments
12428    ///
12429    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12430    pub async fn contents(&self) -> Result<Json, DaggerError> {
12431        let query = self.selection.select("contents");
12432        query.execute(self.graphql_client.clone()).await
12433    }
12434    /// Return the value encoded as json
12435    ///
12436    /// # Arguments
12437    ///
12438    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12439    pub async fn contents_opts<'a>(
12440        &self,
12441        opts: JsonValueContentsOpts<'a>,
12442    ) -> Result<Json, DaggerError> {
12443        let mut query = self.selection.select("contents");
12444        if let Some(pretty) = opts.pretty {
12445            query = query.arg("pretty", pretty);
12446        }
12447        if let Some(indent) = opts.indent {
12448            query = query.arg("indent", indent);
12449        }
12450        query.execute(self.graphql_client.clone()).await
12451    }
12452    /// Return a new json value, decoded from the given content
12453    ///
12454    /// # Arguments
12455    ///
12456    /// * `contents` - New JSON-encoded contents
12457    pub fn with_contents(&self, contents: Json) -> JsonValue {
12458        let mut query = self.selection.select("withContents");
12459        query = query.arg("contents", contents);
12460        JsonValue {
12461            proc: self.proc.clone(),
12462            selection: query,
12463            graphql_client: self.graphql_client.clone(),
12464        }
12465    }
12466    /// Encode an integer to json
12467    ///
12468    /// # Arguments
12469    ///
12470    /// * `value` - New integer value
12471    pub fn new_integer(&self, value: isize) -> JsonValue {
12472        let mut query = self.selection.select("newInteger");
12473        query = query.arg("value", value);
12474        JsonValue {
12475            proc: self.proc.clone(),
12476            selection: query,
12477            graphql_client: self.graphql_client.clone(),
12478        }
12479    }
12480    /// Decode an integer from json
12481    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
12482        let query = self.selection.select("asInteger");
12483        query.execute(self.graphql_client.clone()).await
12484    }
12485    /// Encode a string to json
12486    ///
12487    /// # Arguments
12488    ///
12489    /// * `value` - New string value
12490    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
12491        let mut query = self.selection.select("newString");
12492        query = query.arg("value", value.into());
12493        JsonValue {
12494            proc: self.proc.clone(),
12495            selection: query,
12496            graphql_client: self.graphql_client.clone(),
12497        }
12498    }
12499    /// Decode a string from json
12500    pub async fn as_string(&self) -> Result<String, DaggerError> {
12501        let query = self.selection.select("asString");
12502        query.execute(self.graphql_client.clone()).await
12503    }
12504    /// Encode a boolean to json
12505    ///
12506    /// # Arguments
12507    ///
12508    /// * `value` - New boolean value
12509    pub fn new_boolean(&self, value: bool) -> JsonValue {
12510        let mut query = self.selection.select("newBoolean");
12511        query = query.arg("value", value);
12512        JsonValue {
12513            proc: self.proc.clone(),
12514            selection: query,
12515            graphql_client: self.graphql_client.clone(),
12516        }
12517    }
12518    /// Decode a boolean from json
12519    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
12520        let query = self.selection.select("asBoolean");
12521        query.execute(self.graphql_client.clone()).await
12522    }
12523    /// Decode an array from json
12524    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
12525        let query = self.selection.select("asArray");
12526        let query = query.select("id");
12527        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12528        Ok(ids
12529            .into_iter()
12530            .map(|id| JsonValue {
12531                proc: self.proc.clone(),
12532                selection: crate::querybuilder::query()
12533                    .select("node")
12534                    .arg("id", &id.0)
12535                    .inline_fragment("JSONValue"),
12536                graphql_client: self.graphql_client.clone(),
12537            })
12538            .collect())
12539    }
12540    /// List fields of the encoded object
12541    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
12542        let query = self.selection.select("fields");
12543        query.execute(self.graphql_client.clone()).await
12544    }
12545    /// Lookup the field at the given path, and return its value.
12546    ///
12547    /// # Arguments
12548    ///
12549    /// * `path` - Path of the field to lookup, encoded as an array of field names
12550    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
12551        let mut query = self.selection.select("field");
12552        query = query.arg(
12553            "path",
12554            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12555        );
12556        JsonValue {
12557            proc: self.proc.clone(),
12558            selection: query,
12559            graphql_client: self.graphql_client.clone(),
12560        }
12561    }
12562    /// Set a new field at the given path
12563    ///
12564    /// # Arguments
12565    ///
12566    /// * `path` - Path of the field to set, encoded as an array of field names
12567    /// * `value` - The new value of the field
12568    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
12569        let mut query = self.selection.select("withField");
12570        query = query.arg(
12571            "path",
12572            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12573        );
12574        query = query.arg_lazy(
12575            "value",
12576            Box::new(move || {
12577                let value = value.clone();
12578                Box::pin(async move { value.into_id().await.unwrap().quote() })
12579            }),
12580        );
12581        JsonValue {
12582            proc: self.proc.clone(),
12583            selection: query,
12584            graphql_client: self.graphql_client.clone(),
12585        }
12586    }
12587}
12588impl Node for JsonValue {
12589    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12590        let query = self.selection.select("id");
12591        let graphql_client = self.graphql_client.clone();
12592        async move { query.execute(graphql_client).await }
12593    }
12594}
12595#[derive(Clone)]
12596pub struct Llm {
12597    pub proc: Option<Arc<DaggerSessionProc>>,
12598    pub selection: Selection,
12599    pub graphql_client: DynGraphQLClient,
12600}
12601#[derive(Builder, Debug, PartialEq)]
12602pub struct LlmArtifactsOpts<'a> {
12603    /// Only include artifacts matching these path patterns, as with Workspace.artifacts. A path selects that path and its children.
12604    #[builder(setter(into, strip_option), default)]
12605    pub include: Option<Vec<&'a str>>,
12606}
12607#[derive(Builder, Debug, PartialEq)]
12608pub struct LlmWithModelOpts<'a> {
12609    /// 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.
12610    #[builder(setter(into, strip_option), default)]
12611    pub provider: Option<&'a str>,
12612}
12613#[derive(Builder, Debug, PartialEq)]
12614pub struct LlmWithPromptOpts {
12615    /// 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.
12616    #[builder(setter(into, strip_option), default)]
12617    pub origin: Option<LlmMessageOriginInput>,
12618}
12619#[derive(Builder, Debug, PartialEq)]
12620pub struct LlmWithContentOpts {
12621    /// The message's recorded provenance.
12622    #[builder(setter(into, strip_option), default)]
12623    pub origin: Option<LlmMessageOriginInput>,
12624}
12625#[derive(Builder, Debug, PartialEq)]
12626pub struct LlmWithContentFileOpts<'a> {
12627    /// The media MIME type; inferred from the file's contents when omitted.
12628    #[builder(setter(into, strip_option), default)]
12629    pub mime_type: Option<&'a str>,
12630}
12631#[derive(Builder, Debug, PartialEq)]
12632pub struct LlmWithResponseOpts {
12633    /// Cached input tokens read
12634    #[builder(setter(into, strip_option), default)]
12635    pub cached_token_reads: Option<isize>,
12636    /// Cached input tokens written
12637    #[builder(setter(into, strip_option), default)]
12638    pub cached_token_writes: Option<isize>,
12639    /// Uncached input tokens sent
12640    #[builder(setter(into, strip_option), default)]
12641    pub input_tokens: Option<isize>,
12642    /// Tokens received from the model, including text and tool calls
12643    #[builder(setter(into, strip_option), default)]
12644    pub output_tokens: Option<isize>,
12645    /// Total tokens consumed by this response
12646    #[builder(setter(into, strip_option), default)]
12647    pub total_tokens: Option<isize>,
12648}
12649#[derive(Builder, Debug, PartialEq)]
12650pub struct LlmWithToolResultOpts {
12651    /// Ordered text and media returned by the tool
12652    #[builder(setter(into, strip_option), default)]
12653    pub blocks: Option<Vec<LlmContentBlockInput>>,
12654}
12655#[derive(Builder, Debug, PartialEq)]
12656pub struct LlmWithToolsOpts<'a> {
12657    /// Method names to exclude from the toolset (e.g. constructors, entrypoints).
12658    #[builder(setter(into, strip_option), default)]
12659    pub except: Option<Vec<&'a str>>,
12660    /// Version of this binding's state contract. Recomposition preserves compatible state when the version is unchanged and resets to the newly bound object's defaults when it differs. Change this when the state layout changes incompatibly. Same-type tool returns retain the version. Module identity and ownership checks still apply.
12661    #[builder(setter(into, strip_option), default)]
12662    pub version: Option<isize>,
12663}
12664#[derive(Builder, Debug, PartialEq)]
12665pub struct LlmLoopOpts {
12666    /// Cap the number of steps. The loop fails if the cap is reached before the model ends its turn.
12667    #[builder(setter(into, strip_option), default)]
12668    pub max_steps: Option<isize>,
12669    /// Cap the model's output tokens on each step. Defaults to the model's maximum.
12670    #[builder(setter(into, strip_option), default)]
12671    pub max_tokens: Option<isize>,
12672}
12673#[derive(Builder, Debug, PartialEq)]
12674pub struct LlmStepOpts {
12675    /// Cap the model's output tokens for this step. Defaults to the model's maximum.
12676    #[builder(setter(into, strip_option), default)]
12677    pub max_tokens: Option<isize>,
12678}
12679#[derive(Builder, Debug, PartialEq)]
12680pub struct LlmSpawnOpts<'a> {
12681    /// The loop error to create the agent with, for state FAILED. Refused with any other state.
12682    #[builder(setter(into, strip_option), default)]
12683    pub error: Option<&'a str>,
12684    /// 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.
12685    #[builder(setter(into, strip_option), default)]
12686    pub handle: Option<&'a str>,
12687    /// Display label for the agent — telemetry and error messages; carries no identity. Defaults to a short name derived from the conversation.
12688    #[builder(setter(into, strip_option), default)]
12689    pub name: Option<&'a str>,
12690    /// Recorded parent handle when restoring an agent. Lineage does not install a notification subscription. Requires a supplied handle. The parent must already be restored in this session and cannot be the agent itself or its descendant.
12691    #[builder(setter(into, strip_option), default)]
12692    pub parent_handle: Option<&'a str>,
12693    /// 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.
12694    /// 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.
12695    #[builder(setter(into, strip_option), default)]
12696    pub state: Option<AgentState>,
12697}
12698impl IntoID<Id> for Llm {
12699    fn into_id(
12700        self,
12701    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12702        Box::pin(async move { self.id().await })
12703    }
12704}
12705impl Loadable for Llm {
12706    fn graphql_type() -> &'static str {
12707        "LLM"
12708    }
12709    fn from_query(
12710        proc: Option<Arc<DaggerSessionProc>>,
12711        selection: Selection,
12712        graphql_client: DynGraphQLClient,
12713    ) -> Self {
12714        Self {
12715            proc,
12716            selection,
12717            graphql_client,
12718        }
12719    }
12720}
12721impl Llm {
12722    /// A unique identifier for this LLM.
12723    pub async fn id(&self) -> Result<Id, DaggerError> {
12724        let query = self.selection.select("id");
12725        query.execute(self.graphql_client.clone()).await
12726    }
12727    /// Run expertise in list order, passing this conversation through each function. Retain existing contributions.
12728    ///
12729    /// # Arguments
12730    ///
12731    /// * `expertise` - The expertise to run. Each reference retains its source workspace.
12732    pub fn compose(&self, expertise: Vec<Id>) -> Llm {
12733        let mut query = self.selection.select("compose");
12734        query = query.arg("expertise", expertise);
12735        Llm {
12736            proc: self.proc.clone(),
12737            selection: query,
12738            graphql_client: self.graphql_client.clone(),
12739        }
12740    }
12741    /// Run expertise in list order, replacing their modules' contributions and preserving compatible tool state.
12742    /// Clear each selected module's contributions once before execution. Retain unowned contributions and contributions from other modules. Keep this LLM's workspace.
12743    /// A change to a tool binding's version resets its state. Removed bindings, changed identities, and incompatible state are errors.
12744    ///
12745    /// # Arguments
12746    ///
12747    /// * `expertise` - The expertise to run. Each reference retains its source workspace.
12748    pub fn recompose(&self, expertise: Vec<Id>) -> Llm {
12749        let mut query = self.selection.select("recompose");
12750        query = query.arg("expertise", expertise);
12751        Llm {
12752            proc: self.proc.clone(),
12753            selection: query,
12754            graphql_client: self.graphql_client.clone(),
12755        }
12756    }
12757    /// The model the conversation is running against, after resolving any configured default.
12758    pub async fn model(&self) -> Result<String, DaggerError> {
12759        let query = self.selection.select("model");
12760        query.execute(self.graphql_client.clone()).await
12761    }
12762    /// The provider serving the model, e.g. "anthropic", "openai", "google", or "local".
12763    pub async fn provider(&self) -> Result<String, DaggerError> {
12764        let query = self.selection.select("provider");
12765        query.execute(self.graphql_client.clone()).await
12766    }
12767    /// The model's total context window in tokens, or null if unknown (e.g. a local or uncatalogued model).
12768    pub async fn context_window(&self) -> Result<isize, DaggerError> {
12769        let query = self.selection.select("contextWindow");
12770        query.execute(self.graphql_client.clone()).await
12771    }
12772    /// The full message history, as structured messages.
12773    pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
12774        let query = self.selection.select("messages");
12775        let query = query.select("id");
12776        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12777        Ok(ids
12778            .into_iter()
12779            .map(|id| LlmMessage {
12780                proc: self.proc.clone(),
12781                selection: crate::querybuilder::query()
12782                    .select("node")
12783                    .arg("id", &id.0)
12784                    .inline_fragment("LLMMessage"),
12785                graphql_client: self.graphql_client.clone(),
12786            })
12787            .collect())
12788    }
12789    /// The message history rendered as a plain-text transcript, suitable for feeding back to an LLM (e.g. for summarization).
12790    pub async fn transcript(&self) -> Result<String, DaggerError> {
12791        let query = self.selection.select("transcript");
12792        query.execute(self.graphql_client.clone()).await
12793    }
12794    /// Clear the message history, keeping only the system prompts.
12795    pub fn without_message_history(&self) -> Llm {
12796        let query = self.selection.select("withoutMessageHistory");
12797        Llm {
12798            proc: self.proc.clone(),
12799            selection: query,
12800            graphql_client: self.graphql_client.clone(),
12801        }
12802    }
12803    /// Clear the user-added system prompts, keeping only the default system prompt.
12804    pub fn without_system_prompts(&self) -> Llm {
12805        let query = self.selection.select("withoutSystemPrompts");
12806        Llm {
12807            proc: self.proc.clone(),
12808            selection: query,
12809            graphql_client: self.graphql_client.clone(),
12810        }
12811    }
12812    /// The text of the model's most recent reply.
12813    pub async fn last_reply(&self) -> Result<String, DaggerError> {
12814        let query = self.selection.select("lastReply");
12815        query.execute(self.graphql_client.clone()).await
12816    }
12817    /// Bind the LLM to a workspace, exposing its modules as tools exactly as the Dagger CLI would serve them for that workspace.
12818    ///
12819    /// # Arguments
12820    ///
12821    /// * `workspace` - The workspace to work in.
12822    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
12823        let mut query = self.selection.select("withWorkspace");
12824        query = query.arg_lazy(
12825            "workspace",
12826            Box::new(move || {
12827                let workspace = workspace.clone();
12828                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
12829            }),
12830        );
12831        Llm {
12832            proc: self.proc.clone(),
12833            selection: query,
12834            graphql_client: self.graphql_client.clone(),
12835        }
12836    }
12837    /// Return the workspace the LLM is bound to.
12838    pub fn workspace(&self) -> Workspace {
12839        let query = self.selection.select("workspace");
12840        Workspace {
12841            proc: self.proc.clone(),
12842            selection: query,
12843            graphql_client: self.graphql_client.clone(),
12844        }
12845    }
12846    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
12847    /// Tool objects bound with withTools contribute their modules' artifacts, rooted at their current values: evaluating one reads the live state of the bound tools, not a fresh construction. If a module's main object is bound, only its tree is included; otherwise each bound object of that module contributes its own tree. Addresses start with the module name. These artifacts have no workspace of their own: they evaluate in the LLM's bound workspace, if any, whoever evaluates them.
12848    /// The workspace part is the artifacts of the workspace bound with withWorkspace, as returned by Workspace.artifacts; an LLM with no bound workspace has none. A workspace module with the same name as a module with bound tool objects is omitted: the bound tools shadow it. Unless they are only a plain construction of the module, which has no state of its own: then the workspace module's artifacts are kept instead.
12849    /// Tool arguments that take an address resolve it here: a DAG address to one object, or, for Artifacts and Artifact arguments, a selection filtered like filterUri.
12850    ///
12851    /// # Arguments
12852    ///
12853    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12854    pub fn artifacts(&self) -> Artifacts {
12855        let query = self.selection.select("artifacts");
12856        Artifacts {
12857            proc: self.proc.clone(),
12858            selection: query,
12859            graphql_client: self.graphql_client.clone(),
12860        }
12861    }
12862    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
12863    /// Tool objects bound with withTools contribute their modules' artifacts, rooted at their current values: evaluating one reads the live state of the bound tools, not a fresh construction. If a module's main object is bound, only its tree is included; otherwise each bound object of that module contributes its own tree. Addresses start with the module name. These artifacts have no workspace of their own: they evaluate in the LLM's bound workspace, if any, whoever evaluates them.
12864    /// The workspace part is the artifacts of the workspace bound with withWorkspace, as returned by Workspace.artifacts; an LLM with no bound workspace has none. A workspace module with the same name as a module with bound tool objects is omitted: the bound tools shadow it. Unless they are only a plain construction of the module, which has no state of its own: then the workspace module's artifacts are kept instead.
12865    /// Tool arguments that take an address resolve it here: a DAG address to one object, or, for Artifacts and Artifact arguments, a selection filtered like filterUri.
12866    ///
12867    /// # Arguments
12868    ///
12869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12870    pub fn artifacts_opts<'a>(&self, opts: LlmArtifactsOpts<'a>) -> Artifacts {
12871        let mut query = self.selection.select("artifacts");
12872        if let Some(include) = opts.include {
12873            query = query.arg("include", include);
12874        }
12875        Artifacts {
12876            proc: self.proc.clone(),
12877            selection: query,
12878            graphql_client: self.graphql_client.clone(),
12879        }
12880    }
12881    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
12882    ///
12883    /// # Arguments
12884    ///
12885    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
12886    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12887    pub fn with_model(&self, model: impl Into<String>) -> Llm {
12888        let mut query = self.selection.select("withModel");
12889        query = query.arg("model", model.into());
12890        Llm {
12891            proc: self.proc.clone(),
12892            selection: query,
12893            graphql_client: self.graphql_client.clone(),
12894        }
12895    }
12896    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
12897    ///
12898    /// # Arguments
12899    ///
12900    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
12901    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12902    pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
12903        let mut query = self.selection.select("withModel");
12904        query = query.arg("model", model.into());
12905        if let Some(provider) = opts.provider {
12906            query = query.arg("provider", provider);
12907        }
12908        Llm {
12909            proc: self.proc.clone(),
12910            selection: query,
12911            graphql_client: self.graphql_client.clone(),
12912        }
12913    }
12914    /// 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.
12915    pub fn with_small_model(&self) -> Llm {
12916        let query = self.selection.select("withSmallModel");
12917        Llm {
12918            proc: self.proc.clone(),
12919            selection: query,
12920            graphql_client: self.graphql_client.clone(),
12921        }
12922    }
12923    /// The reasoning effort in use, e.g. "low", "medium", or "high". Empty or "none" when reasoning is disabled.
12924    pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
12925        let query = self.selection.select("reasoningEffort");
12926        query.execute(self.graphql_client.clone()).await
12927    }
12928    /// 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.
12929    ///
12930    /// # Arguments
12931    ///
12932    /// * `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".
12933    pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
12934        let mut query = self.selection.select("withReasoningEffort");
12935        query = query.arg("effort", effort.into());
12936        Llm {
12937            proc: self.proc.clone(),
12938            selection: query,
12939            graphql_client: self.graphql_client.clone(),
12940        }
12941    }
12942    /// Queue a user prompt, to be sent to the model on the next step or loop.
12943    ///
12944    /// # Arguments
12945    ///
12946    /// * `prompt` - The prompt to send
12947    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12948    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
12949        let mut query = self.selection.select("withPrompt");
12950        query = query.arg("prompt", prompt.into());
12951        Llm {
12952            proc: self.proc.clone(),
12953            selection: query,
12954            graphql_client: self.graphql_client.clone(),
12955        }
12956    }
12957    /// Queue a user prompt, to be sent to the model on the next step or loop.
12958    ///
12959    /// # Arguments
12960    ///
12961    /// * `prompt` - The prompt to send
12962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12963    pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
12964        let mut query = self.selection.select("withPrompt");
12965        query = query.arg("prompt", prompt.into());
12966        if let Some(origin) = opts.origin {
12967            query = query.arg("origin", origin);
12968        }
12969        Llm {
12970            proc: self.proc.clone(),
12971            selection: query,
12972            graphql_client: self.graphql_client.clone(),
12973        }
12974    }
12975    /// Queue one user message containing ordered text and media blocks.
12976    ///
12977    /// # Arguments
12978    ///
12979    /// * `content` - The ordered message content.
12980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12981    pub fn with_content(&self, content: Vec<LlmContentBlockInput>) -> Llm {
12982        let mut query = self.selection.select("withContent");
12983        query = query.arg("content", content);
12984        Llm {
12985            proc: self.proc.clone(),
12986            selection: query,
12987            graphql_client: self.graphql_client.clone(),
12988        }
12989    }
12990    /// Queue one user message containing ordered text and media blocks.
12991    ///
12992    /// # Arguments
12993    ///
12994    /// * `content` - The ordered message content.
12995    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12996    pub fn with_content_opts(
12997        &self,
12998        content: Vec<LlmContentBlockInput>,
12999        opts: LlmWithContentOpts,
13000    ) -> Llm {
13001        let mut query = self.selection.select("withContent");
13002        query = query.arg("content", content);
13003        if let Some(origin) = opts.origin {
13004            query = query.arg("origin", origin);
13005        }
13006        Llm {
13007            proc: self.proc.clone(),
13008            selection: query,
13009            graphql_client: self.graphql_client.clone(),
13010        }
13011    }
13012    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
13013    ///
13014    /// # Arguments
13015    ///
13016    /// * `file` - The media file.
13017    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13018    pub fn with_content_file(&self, file: impl IntoID<Id>) -> Llm {
13019        let mut query = self.selection.select("withContentFile");
13020        query = query.arg_lazy(
13021            "file",
13022            Box::new(move || {
13023                let file = file.clone();
13024                Box::pin(async move { file.into_id().await.unwrap().quote() })
13025            }),
13026        );
13027        Llm {
13028            proc: self.proc.clone(),
13029            selection: query,
13030            graphql_client: self.graphql_client.clone(),
13031        }
13032    }
13033    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
13034    ///
13035    /// # Arguments
13036    ///
13037    /// * `file` - The media file.
13038    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13039    pub fn with_content_file_opts<'a>(
13040        &self,
13041        file: impl IntoID<Id>,
13042        opts: LlmWithContentFileOpts<'a>,
13043    ) -> Llm {
13044        let mut query = self.selection.select("withContentFile");
13045        query = query.arg_lazy(
13046            "file",
13047            Box::new(move || {
13048                let file = file.clone();
13049                Box::pin(async move { file.into_id().await.unwrap().quote() })
13050            }),
13051        );
13052        if let Some(mime_type) = opts.mime_type {
13053            query = query.arg("mimeType", mime_type);
13054        }
13055        Llm {
13056            proc: self.proc.clone(),
13057            selection: query,
13058            graphql_client: self.graphql_client.clone(),
13059        }
13060    }
13061    /// Queue a file's contents as a user prompt, like withPrompt.
13062    ///
13063    /// # Arguments
13064    ///
13065    /// * `file` - The file to read the prompt from
13066    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
13067        let mut query = self.selection.select("withPromptFile");
13068        query = query.arg_lazy(
13069            "file",
13070            Box::new(move || {
13071                let file = file.clone();
13072                Box::pin(async move { file.into_id().await.unwrap().quote() })
13073            }),
13074        );
13075        Llm {
13076            proc: self.proc.clone(),
13077            selection: query,
13078            graphql_client: self.graphql_client.clone(),
13079        }
13080    }
13081    /// Add a system prompt, instructing the model across the whole conversation.
13082    ///
13083    /// # Arguments
13084    ///
13085    /// * `prompt` - The system prompt to send
13086    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
13087        let mut query = self.selection.select("withSystemPrompt");
13088        query = query.arg("prompt", prompt.into());
13089        Llm {
13090            proc: self.proc.clone(),
13091            selection: query,
13092            graphql_client: self.graphql_client.clone(),
13093        }
13094    }
13095    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
13096    ///
13097    /// # Arguments
13098    ///
13099    /// * `content` - The response content
13100    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13101    pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13102        let mut query = self.selection.select("withResponse");
13103        query = query.arg("content", content);
13104        Llm {
13105            proc: self.proc.clone(),
13106            selection: query,
13107            graphql_client: self.graphql_client.clone(),
13108        }
13109    }
13110    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
13111    ///
13112    /// # Arguments
13113    ///
13114    /// * `content` - The response content
13115    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13116    pub fn with_response_opts(
13117        &self,
13118        content: Vec<LlmContentBlockInput>,
13119        opts: LlmWithResponseOpts,
13120    ) -> Llm {
13121        let mut query = self.selection.select("withResponse");
13122        query = query.arg("content", content);
13123        if let Some(input_tokens) = opts.input_tokens {
13124            query = query.arg("inputTokens", input_tokens);
13125        }
13126        if let Some(output_tokens) = opts.output_tokens {
13127            query = query.arg("outputTokens", output_tokens);
13128        }
13129        if let Some(cached_token_reads) = opts.cached_token_reads {
13130            query = query.arg("cachedTokenReads", cached_token_reads);
13131        }
13132        if let Some(cached_token_writes) = opts.cached_token_writes {
13133            query = query.arg("cachedTokenWrites", cached_token_writes);
13134        }
13135        if let Some(total_tokens) = opts.total_tokens {
13136            query = query.arg("totalTokens", total_tokens);
13137        }
13138        Llm {
13139            proc: self.proc.clone(),
13140            selection: query,
13141            graphql_client: self.graphql_client.clone(),
13142        }
13143    }
13144    /// Append the result of a tool call to the message history.
13145    ///
13146    /// # Arguments
13147    ///
13148    /// * `call_id` - The ID of the tool call this result responds to
13149    /// * `content` - Text returned by the tool, placed before blocks
13150    /// * `errored` - Whether the tool call resulted in an error
13151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13152    pub fn with_tool_result(
13153        &self,
13154        call_id: impl Into<String>,
13155        content: impl Into<String>,
13156        errored: bool,
13157    ) -> Llm {
13158        let mut query = self.selection.select("withToolResult");
13159        query = query.arg("callId", call_id.into());
13160        query = query.arg("content", content.into());
13161        query = query.arg("errored", errored);
13162        Llm {
13163            proc: self.proc.clone(),
13164            selection: query,
13165            graphql_client: self.graphql_client.clone(),
13166        }
13167    }
13168    /// Append the result of a tool call to the message history.
13169    ///
13170    /// # Arguments
13171    ///
13172    /// * `call_id` - The ID of the tool call this result responds to
13173    /// * `content` - Text returned by the tool, placed before blocks
13174    /// * `errored` - Whether the tool call resulted in an error
13175    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13176    pub fn with_tool_result_opts(
13177        &self,
13178        call_id: impl Into<String>,
13179        content: impl Into<String>,
13180        errored: bool,
13181        opts: LlmWithToolResultOpts,
13182    ) -> Llm {
13183        let mut query = self.selection.select("withToolResult");
13184        query = query.arg("callId", call_id.into());
13185        query = query.arg("content", content.into());
13186        query = query.arg("errored", errored);
13187        if let Some(blocks) = opts.blocks {
13188            query = query.arg("blocks", blocks);
13189        }
13190        Llm {
13191            proc: self.proc.clone(),
13192            selection: query,
13193            graphql_client: self.graphql_client.clone(),
13194        }
13195    }
13196    /// 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.
13197    ///
13198    /// # Arguments
13199    ///
13200    /// * `object` - The object whose methods become tools.
13201    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13202    pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
13203        let mut query = self.selection.select("withTools");
13204        query = query.arg_lazy(
13205            "object",
13206            Box::new(move || {
13207                let object = object.clone();
13208                Box::pin(async move { object.into_id().await.unwrap().quote() })
13209            }),
13210        );
13211        Llm {
13212            proc: self.proc.clone(),
13213            selection: query,
13214            graphql_client: self.graphql_client.clone(),
13215        }
13216    }
13217    /// 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.
13218    ///
13219    /// # Arguments
13220    ///
13221    /// * `object` - The object whose methods become tools.
13222    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13223    pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
13224        let mut query = self.selection.select("withTools");
13225        query = query.arg_lazy(
13226            "object",
13227            Box::new(move || {
13228                let object = object.clone();
13229                Box::pin(async move { object.into_id().await.unwrap().quote() })
13230            }),
13231        );
13232        if let Some(except) = opts.except {
13233            query = query.arg("except", except);
13234        }
13235        if let Some(version) = opts.version {
13236            query = query.arg("version", version);
13237        }
13238        Llm {
13239            proc: self.proc.clone(),
13240            selection: query,
13241            graphql_client: self.graphql_client.clone(),
13242        }
13243    }
13244    /// Disable the default system prompt
13245    pub fn without_default_system_prompt(&self) -> Llm {
13246        let query = self.selection.select("withoutDefaultSystemPrompt");
13247        Llm {
13248            proc: self.proc.clone(),
13249            selection: query,
13250            graphql_client: self.graphql_client.clone(),
13251        }
13252    }
13253    /// Add an external MCP server to the LLM
13254    ///
13255    /// # Arguments
13256    ///
13257    /// * `name` - The name of the MCP server
13258    /// * `service` - The MCP service to run and communicate with over stdio
13259    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
13260        let mut query = self.selection.select("withMCPServer");
13261        query = query.arg("name", name.into());
13262        query = query.arg_lazy(
13263            "service",
13264            Box::new(move || {
13265                let service = service.clone();
13266                Box::pin(async move { service.into_id().await.unwrap().quote() })
13267            }),
13268        );
13269        Llm {
13270            proc: self.proc.clone(),
13271            selection: query,
13272            graphql_client: self.graphql_client.clone(),
13273        }
13274    }
13275    /// 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.
13276    ///
13277    /// # Arguments
13278    ///
13279    /// * `directory` - A directory containing skills, each a subdirectory holding a SKILL.md.
13280    pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
13281        let mut query = self.selection.select("withSkills");
13282        query = query.arg_lazy(
13283            "directory",
13284            Box::new(move || {
13285                let directory = directory.clone();
13286                Box::pin(async move { directory.into_id().await.unwrap().quote() })
13287            }),
13288        );
13289        Llm {
13290            proc: self.proc.clone(),
13291            selection: query,
13292            graphql_client: self.graphql_client.clone(),
13293        }
13294    }
13295    /// 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.
13296    pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
13297        let query = self.selection.select("skills");
13298        let query = query.select("id");
13299        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13300        Ok(ids
13301            .into_iter()
13302            .map(|id| LlmSkill {
13303                proc: self.proc.clone(),
13304                selection: crate::querybuilder::query()
13305                    .select("node")
13306                    .arg("id", &id.0)
13307                    .inline_fragment("LLMSkill"),
13308                graphql_client: self.graphql_client.clone(),
13309            })
13310            .collect())
13311    }
13312    /// Force evaluation of the conversation's pending operations (prompts, steps, loops) in the engine.
13313    pub async fn sync(&self) -> Result<Llm, DaggerError> {
13314        let query = self.selection.select("sync");
13315        let id: Id = query.execute(self.graphql_client.clone()).await?;
13316        Ok(Llm {
13317            proc: self.proc.clone(),
13318            selection: query
13319                .root()
13320                .select("node")
13321                .arg("id", &id.0)
13322                .inline_fragment("LLM"),
13323            graphql_client: self.graphql_client.clone(),
13324        })
13325    }
13326    /// 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.
13327    ///
13328    /// # Arguments
13329    ///
13330    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13331    pub fn r#loop(&self) -> Llm {
13332        let query = self.selection.select("loop");
13333        Llm {
13334            proc: self.proc.clone(),
13335            selection: query,
13336            graphql_client: self.graphql_client.clone(),
13337        }
13338    }
13339    /// 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.
13340    ///
13341    /// # Arguments
13342    ///
13343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13344    pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
13345        let mut query = self.selection.select("loop");
13346        if let Some(max_steps) = opts.max_steps {
13347            query = query.arg("maxSteps", max_steps);
13348        }
13349        if let Some(max_tokens) = opts.max_tokens {
13350            query = query.arg("maxTokens", max_tokens);
13351        }
13352        Llm {
13353            proc: self.proc.clone(),
13354            selection: query,
13355            graphql_client: self.graphql_client.clone(),
13356        }
13357    }
13358    /// 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.
13359    ///
13360    /// # Arguments
13361    ///
13362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13363    pub fn step(&self) -> Llm {
13364        let query = self.selection.select("step");
13365        Llm {
13366            proc: self.proc.clone(),
13367            selection: query,
13368            graphql_client: self.graphql_client.clone(),
13369        }
13370    }
13371    /// 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.
13372    ///
13373    /// # Arguments
13374    ///
13375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13376    pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
13377        let mut query = self.selection.select("step");
13378        if let Some(max_tokens) = opts.max_tokens {
13379            query = query.arg("maxTokens", max_tokens);
13380        }
13381        Llm {
13382            proc: self.proc.clone(),
13383            selection: query,
13384            graphql_client: self.graphql_client.clone(),
13385        }
13386    }
13387    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13388    /// 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.
13389    /// 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.
13390    /// 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.
13391    ///
13392    /// # Arguments
13393    ///
13394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13395    pub async fn spawn(&self) -> Result<Agent, DaggerError> {
13396        let query = self.selection.select("spawn");
13397        let id: Id = query.execute(self.graphql_client.clone()).await?;
13398        Ok(Agent {
13399            proc: self.proc.clone(),
13400            selection: query
13401                .root()
13402                .select("node")
13403                .arg("id", &id.0)
13404                .inline_fragment("Agent"),
13405            graphql_client: self.graphql_client.clone(),
13406        })
13407    }
13408    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13409    /// 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.
13410    /// 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.
13411    /// 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.
13412    ///
13413    /// # Arguments
13414    ///
13415    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13416    pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
13417        let mut query = self.selection.select("spawn");
13418        if let Some(name) = opts.name {
13419            query = query.arg("name", name);
13420        }
13421        if let Some(handle) = opts.handle {
13422            query = query.arg("handle", handle);
13423        }
13424        if let Some(state) = opts.state {
13425            query = query.arg("state", state);
13426        }
13427        if let Some(parent_handle) = opts.parent_handle {
13428            query = query.arg("parentHandle", parent_handle);
13429        }
13430        if let Some(error) = opts.error {
13431            query = query.arg("error", error);
13432        }
13433        let id: Id = query.execute(self.graphql_client.clone()).await?;
13434        Ok(Agent {
13435            proc: self.proc.clone(),
13436            selection: query
13437                .root()
13438                .select("node")
13439                .arg("id", &id.0)
13440                .inline_fragment("Agent"),
13441            graphql_client: self.graphql_client.clone(),
13442        })
13443    }
13444    /// Reconstruct a spawned agent from its runtime handle.
13445    /// 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.
13446    ///
13447    /// # Arguments
13448    ///
13449    /// * `handle` - The opaque runtime handle minted by the spawn that created the agent.
13450    /// * `name` - The agent's display name, as recorded by the spawn.
13451    pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
13452        let mut query = self.selection.select("agent");
13453        query = query.arg("handle", handle.into());
13454        query = query.arg("name", name.into());
13455        Agent {
13456            proc: self.proc.clone(),
13457            selection: query,
13458            graphql_client: self.graphql_client.clone(),
13459        }
13460    }
13461    /// 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.
13462    pub async fn has_pending(&self) -> Result<bool, DaggerError> {
13463        let query = self.selection.select("hasPending");
13464        query.execute(self.graphql_client.clone()).await
13465    }
13466    /// Fork the conversation, so that otherwise-identical follow-ups evaluate independently instead of deduplicating to a single cached result.
13467    ///
13468    /// # Arguments
13469    ///
13470    /// * `label` - A label distinguishing this fork from its siblings, e.g. "attempt-2" when retrying a flaky evaluation.
13471    pub fn fork(&self, label: impl Into<String>) -> Llm {
13472        let mut query = self.selection.select("fork");
13473        query = query.arg("label", label.into());
13474        Llm {
13475            proc: self.proc.clone(),
13476            selection: query,
13477            graphql_client: self.graphql_client.clone(),
13478        }
13479    }
13480    /// Render documentation for the tools currently exposed to the model.
13481    pub async fn tools(&self) -> Result<String, DaggerError> {
13482        let query = self.selection.select("tools");
13483        query.execute(self.graphql_client.clone()).await
13484    }
13485    /// The cumulative token usage, summed across every API call in the conversation.
13486    pub fn token_usage(&self) -> LlmTokenUsage {
13487        let query = self.selection.select("tokenUsage");
13488        LlmTokenUsage {
13489            proc: self.proc.clone(),
13490            selection: query,
13491            graphql_client: self.graphql_client.clone(),
13492        }
13493    }
13494    /// estimated number of tokens currently occupying the context window; unlike tokenUsage this is not cumulative over the session
13495    pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
13496        let query = self.selection.select("contextTokens");
13497        query.execute(self.graphql_client.clone()).await
13498    }
13499}
13500impl Node for Llm {
13501    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13502        let query = self.selection.select("id");
13503        let graphql_client = self.graphql_client.clone();
13504        async move { query.execute(graphql_client).await }
13505    }
13506}
13507impl Syncer for Llm {
13508    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13509        let query = self.selection.select("id");
13510        let graphql_client = self.graphql_client.clone();
13511        async move { query.execute(graphql_client).await }
13512    }
13513    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13514        let query = self.selection.select("sync");
13515        let proc = self.proc.clone();
13516        let graphql_client = self.graphql_client.clone();
13517        async move {
13518            let id: Id = query.execute(graphql_client.clone()).await?;
13519            Ok(Self {
13520                proc,
13521                selection: query
13522                    .root()
13523                    .select("node")
13524                    .arg("id", &id.0)
13525                    .inline_fragment("LLM"),
13526                graphql_client,
13527            })
13528        }
13529    }
13530}
13531#[derive(Clone)]
13532pub struct LlmContent {
13533    pub proc: Option<Arc<DaggerSessionProc>>,
13534    pub selection: Selection,
13535    pub graphql_client: DynGraphQLClient,
13536}
13537#[derive(Builder, Debug, PartialEq)]
13538pub struct LlmContentWithFileOpts<'a> {
13539    /// The media MIME type, e.g. "image/png". Inferred from the file's contents when omitted.
13540    #[builder(setter(into, strip_option), default)]
13541    pub mime_type: Option<&'a str>,
13542}
13543impl IntoID<Id> for LlmContent {
13544    fn into_id(
13545        self,
13546    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13547        Box::pin(async move { self.id().await })
13548    }
13549}
13550impl Loadable for LlmContent {
13551    fn graphql_type() -> &'static str {
13552        "LLMContent"
13553    }
13554    fn from_query(
13555        proc: Option<Arc<DaggerSessionProc>>,
13556        selection: Selection,
13557        graphql_client: DynGraphQLClient,
13558    ) -> Self {
13559        Self {
13560            proc,
13561            selection,
13562            graphql_client,
13563        }
13564    }
13565}
13566impl LlmContent {
13567    /// A unique identifier for this LLMContent.
13568    pub async fn id(&self) -> Result<Id, DaggerError> {
13569        let query = self.selection.select("id");
13570        query.execute(self.graphql_client.clone()).await
13571    }
13572    /// Append a block of text.
13573    ///
13574    /// # Arguments
13575    ///
13576    /// * `text` - The text.
13577    pub fn with_text(&self, text: impl Into<String>) -> LlmContent {
13578        let mut query = self.selection.select("withText");
13579        query = query.arg("text", text.into());
13580        LlmContent {
13581            proc: self.proc.clone(),
13582            selection: query,
13583            graphql_client: self.graphql_client.clone(),
13584        }
13585    }
13586    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13587    ///
13588    /// # Arguments
13589    ///
13590    /// * `file` - The media file. Its contents become the block's inline bytes.
13591    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13592    pub fn with_file(&self, file: impl IntoID<Id>) -> LlmContent {
13593        let mut query = self.selection.select("withFile");
13594        query = query.arg_lazy(
13595            "file",
13596            Box::new(move || {
13597                let file = file.clone();
13598                Box::pin(async move { file.into_id().await.unwrap().quote() })
13599            }),
13600        );
13601        LlmContent {
13602            proc: self.proc.clone(),
13603            selection: query,
13604            graphql_client: self.graphql_client.clone(),
13605        }
13606    }
13607    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13608    ///
13609    /// # Arguments
13610    ///
13611    /// * `file` - The media file. Its contents become the block's inline bytes.
13612    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13613    pub fn with_file_opts<'a>(
13614        &self,
13615        file: impl IntoID<Id>,
13616        opts: LlmContentWithFileOpts<'a>,
13617    ) -> LlmContent {
13618        let mut query = self.selection.select("withFile");
13619        query = query.arg_lazy(
13620            "file",
13621            Box::new(move || {
13622                let file = file.clone();
13623                Box::pin(async move { file.into_id().await.unwrap().quote() })
13624            }),
13625        );
13626        if let Some(mime_type) = opts.mime_type {
13627            query = query.arg("mimeType", mime_type);
13628        }
13629        LlmContent {
13630            proc: self.proc.clone(),
13631            selection: query,
13632            graphql_client: self.graphql_client.clone(),
13633        }
13634    }
13635    /// Append image, audio, or PDF bytes as an inline media block. The media kind follows the MIME type.
13636    /// Prefer withFile for anything but small payloads: the bytes become part of the content's identity, so they travel with every reference to it.
13637    ///
13638    /// # Arguments
13639    ///
13640    /// * `data` - The media bytes.
13641    /// * `mime_type` - The media MIME type, e.g. "image/png".
13642    pub fn with_data(&self, data: Bytes, mime_type: impl Into<String>) -> LlmContent {
13643        let mut query = self.selection.select("withData");
13644        query = query.arg("data", data);
13645        query = query.arg("mimeType", mime_type.into());
13646        LlmContent {
13647            proc: self.proc.clone(),
13648            selection: query,
13649            graphql_client: self.graphql_client.clone(),
13650        }
13651    }
13652    /// The ordered text and media blocks.
13653    pub async fn blocks(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13654        let query = self.selection.select("blocks");
13655        let query = query.select("id");
13656        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13657        Ok(ids
13658            .into_iter()
13659            .map(|id| LlmContentBlock {
13660                proc: self.proc.clone(),
13661                selection: crate::querybuilder::query()
13662                    .select("node")
13663                    .arg("id", &id.0)
13664                    .inline_fragment("LLMContentBlock"),
13665                graphql_client: self.graphql_client.clone(),
13666            })
13667            .collect())
13668    }
13669}
13670impl Node for LlmContent {
13671    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13672        let query = self.selection.select("id");
13673        let graphql_client = self.graphql_client.clone();
13674        async move { query.execute(graphql_client).await }
13675    }
13676}
13677#[derive(Clone)]
13678pub struct LlmContentBlock {
13679    pub proc: Option<Arc<DaggerSessionProc>>,
13680    pub selection: Selection,
13681    pub graphql_client: DynGraphQLClient,
13682}
13683impl IntoID<Id> for LlmContentBlock {
13684    fn into_id(
13685        self,
13686    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13687        Box::pin(async move { self.id().await })
13688    }
13689}
13690impl Loadable for LlmContentBlock {
13691    fn graphql_type() -> &'static str {
13692        "LLMContentBlock"
13693    }
13694    fn from_query(
13695        proc: Option<Arc<DaggerSessionProc>>,
13696        selection: Selection,
13697        graphql_client: DynGraphQLClient,
13698    ) -> Self {
13699        Self {
13700            proc,
13701            selection,
13702            graphql_client,
13703        }
13704    }
13705}
13706impl LlmContentBlock {
13707    /// A unique identifier for this LLMContentBlock.
13708    pub async fn id(&self) -> Result<Id, DaggerError> {
13709        let query = self.selection.select("id");
13710        query.execute(self.graphql_client.clone()).await
13711    }
13712    /// The kind of content block, which determines the other populated fields.
13713    pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
13714        let query = self.selection.select("kind");
13715        query.execute(self.graphql_client.clone()).await
13716    }
13717    /// Text content (for TEXT, THINKING, or TOOL_RESULT kinds).
13718    pub async fn text(&self) -> Result<String, DaggerError> {
13719        let query = self.selection.select("text");
13720        query.execute(self.graphql_client.clone()).await
13721    }
13722    /// The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
13723    pub async fn call_id(&self) -> Result<String, DaggerError> {
13724        let query = self.selection.select("callId");
13725        query.execute(self.graphql_client.clone()).await
13726    }
13727    /// The name of the tool called (for TOOL_CALL kind).
13728    pub async fn tool_name(&self) -> Result<String, DaggerError> {
13729        let query = self.selection.select("toolName");
13730        query.execute(self.graphql_client.clone()).await
13731    }
13732    /// The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).
13733    pub async fn arguments(&self) -> Result<Json, DaggerError> {
13734        let query = self.selection.select("arguments");
13735        query.execute(self.graphql_client.clone()).await
13736    }
13737    /// Whether the tool call resulted in an error (for TOOL_RESULT kind).
13738    pub async fn errored(&self) -> Result<bool, DaggerError> {
13739        let query = self.selection.select("errored");
13740        query.execute(self.graphql_client.clone()).await
13741    }
13742    /// The media MIME type (for IMAGE, AUDIO, or DOCUMENT kinds).
13743    pub async fn mime_type(&self) -> Result<String, DaggerError> {
13744        let query = self.selection.select("mimeType");
13745        query.execute(self.graphql_client.clone()).await
13746    }
13747    /// The media bytes (for IMAGE, AUDIO, or DOCUMENT kinds).
13748    pub async fn data(&self) -> Result<Bytes, DaggerError> {
13749        let query = self.selection.select("data");
13750        query.execute(self.graphql_client.clone()).await
13751    }
13752    /// Ordered content returned by a tool, following any text (for TOOL_RESULT kind).
13753    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13754        let query = self.selection.select("content");
13755        let query = query.select("id");
13756        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13757        Ok(ids
13758            .into_iter()
13759            .map(|id| LlmContentBlock {
13760                proc: self.proc.clone(),
13761                selection: crate::querybuilder::query()
13762                    .select("node")
13763                    .arg("id", &id.0)
13764                    .inline_fragment("LLMContentBlock"),
13765                graphql_client: self.graphql_client.clone(),
13766            })
13767            .collect())
13768    }
13769    /// Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.
13770    pub async fn signature(&self) -> Result<String, DaggerError> {
13771        let query = self.selection.select("signature");
13772        query.execute(self.graphql_client.clone()).await
13773    }
13774}
13775impl Node for LlmContentBlock {
13776    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13777        let query = self.selection.select("id");
13778        let graphql_client = self.graphql_client.clone();
13779        async move { query.execute(graphql_client).await }
13780    }
13781}
13782#[derive(Clone)]
13783pub struct LlmMessage {
13784    pub proc: Option<Arc<DaggerSessionProc>>,
13785    pub selection: Selection,
13786    pub graphql_client: DynGraphQLClient,
13787}
13788impl IntoID<Id> for LlmMessage {
13789    fn into_id(
13790        self,
13791    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13792        Box::pin(async move { self.id().await })
13793    }
13794}
13795impl Loadable for LlmMessage {
13796    fn graphql_type() -> &'static str {
13797        "LLMMessage"
13798    }
13799    fn from_query(
13800        proc: Option<Arc<DaggerSessionProc>>,
13801        selection: Selection,
13802        graphql_client: DynGraphQLClient,
13803    ) -> Self {
13804        Self {
13805            proc,
13806            selection,
13807            graphql_client,
13808        }
13809    }
13810}
13811impl LlmMessage {
13812    /// A unique identifier for this LLMMessage.
13813    pub async fn id(&self) -> Result<Id, DaggerError> {
13814        let query = self.selection.select("id");
13815        query.execute(self.graphql_client.clone()).await
13816    }
13817    /// Who put this message on the record, when it arrived through an agent mailbox.
13818    /// Null for the user's own prompts and for everything the model or tools produced.
13819    pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
13820        let query = self.selection.select("origin");
13821        let query = query.select("id");
13822        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13823        Ok(id.map(|id| LlmMessageOrigin {
13824            proc: self.proc.clone(),
13825            selection: query
13826                .root()
13827                .select("node")
13828                .arg("id", &id.0)
13829                .inline_fragment("LLMMessageOrigin"),
13830            graphql_client: self.graphql_client.clone(),
13831        }))
13832    }
13833    /// The role that produced this message.
13834    pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
13835        let query = self.selection.select("role");
13836        query.execute(self.graphql_client.clone()).await
13837    }
13838    /// The message's content blocks, in the order the model produced them.
13839    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13840        let query = self.selection.select("content");
13841        let query = query.select("id");
13842        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13843        Ok(ids
13844            .into_iter()
13845            .map(|id| LlmContentBlock {
13846                proc: self.proc.clone(),
13847                selection: crate::querybuilder::query()
13848                    .select("node")
13849                    .arg("id", &id.0)
13850                    .inline_fragment("LLMContentBlock"),
13851                graphql_client: self.graphql_client.clone(),
13852            })
13853            .collect())
13854    }
13855    /// Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.
13856    pub fn token_usage(&self) -> LlmTokenUsage {
13857        let query = self.selection.select("tokenUsage");
13858        LlmTokenUsage {
13859            proc: self.proc.clone(),
13860            selection: query,
13861            graphql_client: self.graphql_client.clone(),
13862        }
13863    }
13864}
13865impl Node for LlmMessage {
13866    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13867        let query = self.selection.select("id");
13868        let graphql_client = self.graphql_client.clone();
13869        async move { query.execute(graphql_client).await }
13870    }
13871}
13872#[derive(Clone)]
13873pub struct LlmMessageOrigin {
13874    pub proc: Option<Arc<DaggerSessionProc>>,
13875    pub selection: Selection,
13876    pub graphql_client: DynGraphQLClient,
13877}
13878impl IntoID<Id> for LlmMessageOrigin {
13879    fn into_id(
13880        self,
13881    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13882        Box::pin(async move { self.id().await })
13883    }
13884}
13885impl Loadable for LlmMessageOrigin {
13886    fn graphql_type() -> &'static str {
13887        "LLMMessageOrigin"
13888    }
13889    fn from_query(
13890        proc: Option<Arc<DaggerSessionProc>>,
13891        selection: Selection,
13892        graphql_client: DynGraphQLClient,
13893    ) -> Self {
13894        Self {
13895            proc,
13896            selection,
13897            graphql_client,
13898        }
13899    }
13900}
13901impl LlmMessageOrigin {
13902    /// A unique identifier for this LLMMessageOrigin.
13903    pub async fn id(&self) -> Result<Id, DaggerError> {
13904        let query = self.selection.select("id");
13905        query.execute(self.graphql_client.clone()).await
13906    }
13907    /// Who put this message on the record.
13908    pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
13909        let query = self.selection.select("kind");
13910        query.execute(self.graphql_client.clone()).await
13911    }
13912    /// The display name of the sending agent (for AGENT origins) or the observed agent (for EVENT origins).
13913    pub async fn agent_name(&self) -> Result<String, DaggerError> {
13914        let query = self.selection.select("agentName");
13915        query.execute(self.graphql_client.clone()).await
13916    }
13917    /// 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.
13918    pub async fn r#ref(&self) -> Result<String, DaggerError> {
13919        let query = self.selection.select("ref");
13920        query.execute(self.graphql_client.clone()).await
13921    }
13922    /// The ref of the message this one answers, in the sender's own runtime, if any.
13923    pub async fn reply_to(&self) -> Result<String, DaggerError> {
13924        let query = self.selection.select("replyTo");
13925        query.execute(self.graphql_client.clone()).await
13926    }
13927}
13928impl Node for LlmMessageOrigin {
13929    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13930        let query = self.selection.select("id");
13931        let graphql_client = self.graphql_client.clone();
13932        async move { query.execute(graphql_client).await }
13933    }
13934}
13935#[derive(Clone)]
13936pub struct LlmSkill {
13937    pub proc: Option<Arc<DaggerSessionProc>>,
13938    pub selection: Selection,
13939    pub graphql_client: DynGraphQLClient,
13940}
13941impl IntoID<Id> for LlmSkill {
13942    fn into_id(
13943        self,
13944    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13945        Box::pin(async move { self.id().await })
13946    }
13947}
13948impl Loadable for LlmSkill {
13949    fn graphql_type() -> &'static str {
13950        "LLMSkill"
13951    }
13952    fn from_query(
13953        proc: Option<Arc<DaggerSessionProc>>,
13954        selection: Selection,
13955        graphql_client: DynGraphQLClient,
13956    ) -> Self {
13957        Self {
13958            proc,
13959            selection,
13960            graphql_client,
13961        }
13962    }
13963}
13964impl LlmSkill {
13965    /// A unique identifier for this LLMSkill.
13966    pub async fn id(&self) -> Result<Id, DaggerError> {
13967        let query = self.selection.select("id");
13968        query.execute(self.graphql_client.clone()).await
13969    }
13970    /// The skill name, as passed to ReadSkill.
13971    pub async fn name(&self) -> Result<String, DaggerError> {
13972        let query = self.selection.select("name");
13973        query.execute(self.graphql_client.clone()).await
13974    }
13975    /// The one-line description from the SKILL.md frontmatter.
13976    pub async fn description(&self) -> Result<String, DaggerError> {
13977        let query = self.selection.select("description");
13978        query.execute(self.graphql_client.clone()).await
13979    }
13980}
13981impl Node for LlmSkill {
13982    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13983        let query = self.selection.select("id");
13984        let graphql_client = self.graphql_client.clone();
13985        async move { query.execute(graphql_client).await }
13986    }
13987}
13988#[derive(Clone)]
13989pub struct LlmTokenUsage {
13990    pub proc: Option<Arc<DaggerSessionProc>>,
13991    pub selection: Selection,
13992    pub graphql_client: DynGraphQLClient,
13993}
13994impl IntoID<Id> for LlmTokenUsage {
13995    fn into_id(
13996        self,
13997    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13998        Box::pin(async move { self.id().await })
13999    }
14000}
14001impl Loadable for LlmTokenUsage {
14002    fn graphql_type() -> &'static str {
14003        "LLMTokenUsage"
14004    }
14005    fn from_query(
14006        proc: Option<Arc<DaggerSessionProc>>,
14007        selection: Selection,
14008        graphql_client: DynGraphQLClient,
14009    ) -> Self {
14010        Self {
14011            proc,
14012            selection,
14013            graphql_client,
14014        }
14015    }
14016}
14017impl LlmTokenUsage {
14018    /// A unique identifier for this LLMTokenUsage.
14019    pub async fn id(&self) -> Result<Id, DaggerError> {
14020        let query = self.selection.select("id");
14021        query.execute(self.graphql_client.clone()).await
14022    }
14023    /// Uncached input tokens sent to the model.
14024    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
14025        let query = self.selection.select("inputTokens");
14026        query.execute(self.graphql_client.clone()).await
14027    }
14028    /// Tokens received from the model, including text and tool calls.
14029    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
14030        let query = self.selection.select("outputTokens");
14031        query.execute(self.graphql_client.clone()).await
14032    }
14033    /// Input tokens served from the provider's prompt cache.
14034    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
14035        let query = self.selection.select("cachedTokenReads");
14036        query.execute(self.graphql_client.clone()).await
14037    }
14038    /// Input tokens written to the provider's prompt cache.
14039    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
14040        let query = self.selection.select("cachedTokenWrites");
14041        query.execute(self.graphql_client.clone()).await
14042    }
14043    /// Total tokens consumed, as reported by the provider.
14044    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
14045        let query = self.selection.select("totalTokens");
14046        query.execute(self.graphql_client.clone()).await
14047    }
14048}
14049impl Node for LlmTokenUsage {
14050    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14051        let query = self.selection.select("id");
14052        let graphql_client = self.graphql_client.clone();
14053        async move { query.execute(graphql_client).await }
14054    }
14055}
14056#[derive(Clone)]
14057pub struct Label {
14058    pub proc: Option<Arc<DaggerSessionProc>>,
14059    pub selection: Selection,
14060    pub graphql_client: DynGraphQLClient,
14061}
14062impl IntoID<Id> for Label {
14063    fn into_id(
14064        self,
14065    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14066        Box::pin(async move { self.id().await })
14067    }
14068}
14069impl Loadable for Label {
14070    fn graphql_type() -> &'static str {
14071        "Label"
14072    }
14073    fn from_query(
14074        proc: Option<Arc<DaggerSessionProc>>,
14075        selection: Selection,
14076        graphql_client: DynGraphQLClient,
14077    ) -> Self {
14078        Self {
14079            proc,
14080            selection,
14081            graphql_client,
14082        }
14083    }
14084}
14085impl Label {
14086    /// A unique identifier for this Label.
14087    pub async fn id(&self) -> Result<Id, DaggerError> {
14088        let query = self.selection.select("id");
14089        query.execute(self.graphql_client.clone()).await
14090    }
14091    /// The label name.
14092    pub async fn name(&self) -> Result<String, DaggerError> {
14093        let query = self.selection.select("name");
14094        query.execute(self.graphql_client.clone()).await
14095    }
14096    /// The label value.
14097    pub async fn value(&self) -> Result<String, DaggerError> {
14098        let query = self.selection.select("value");
14099        query.execute(self.graphql_client.clone()).await
14100    }
14101}
14102impl Node for Label {
14103    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14104        let query = self.selection.select("id");
14105        let graphql_client = self.graphql_client.clone();
14106        async move { query.execute(graphql_client).await }
14107    }
14108}
14109#[derive(Clone)]
14110pub struct ListTypeDef {
14111    pub proc: Option<Arc<DaggerSessionProc>>,
14112    pub selection: Selection,
14113    pub graphql_client: DynGraphQLClient,
14114}
14115impl IntoID<Id> for ListTypeDef {
14116    fn into_id(
14117        self,
14118    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14119        Box::pin(async move { self.id().await })
14120    }
14121}
14122impl Loadable for ListTypeDef {
14123    fn graphql_type() -> &'static str {
14124        "ListTypeDef"
14125    }
14126    fn from_query(
14127        proc: Option<Arc<DaggerSessionProc>>,
14128        selection: Selection,
14129        graphql_client: DynGraphQLClient,
14130    ) -> Self {
14131        Self {
14132            proc,
14133            selection,
14134            graphql_client,
14135        }
14136    }
14137}
14138impl ListTypeDef {
14139    /// A unique identifier for this ListTypeDef.
14140    pub async fn id(&self) -> Result<Id, DaggerError> {
14141        let query = self.selection.select("id");
14142        query.execute(self.graphql_client.clone()).await
14143    }
14144    /// The type of the elements in the list.
14145    pub fn element_type_def(&self) -> TypeDef {
14146        let query = self.selection.select("elementTypeDef");
14147        TypeDef {
14148            proc: self.proc.clone(),
14149            selection: query,
14150            graphql_client: self.graphql_client.clone(),
14151        }
14152    }
14153}
14154impl Node for ListTypeDef {
14155    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14156        let query = self.selection.select("id");
14157        let graphql_client = self.graphql_client.clone();
14158        async move { query.execute(graphql_client).await }
14159    }
14160}
14161#[derive(Clone)]
14162pub struct Module {
14163    pub proc: Option<Arc<DaggerSessionProc>>,
14164    pub selection: Selection,
14165    pub graphql_client: DynGraphQLClient,
14166}
14167#[derive(Builder, Debug, PartialEq)]
14168pub struct ModuleServeOpts {
14169    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
14170    #[builder(setter(into, strip_option), default)]
14171    pub entrypoint: Option<bool>,
14172    /// Expose the dependencies of this module to the client
14173    #[builder(setter(into, strip_option), default)]
14174    pub include_dependencies: Option<bool>,
14175}
14176impl IntoID<Id> for Module {
14177    fn into_id(
14178        self,
14179    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14180        Box::pin(async move { self.id().await })
14181    }
14182}
14183impl Loadable for Module {
14184    fn graphql_type() -> &'static str {
14185        "Module"
14186    }
14187    fn from_query(
14188        proc: Option<Arc<DaggerSessionProc>>,
14189        selection: Selection,
14190        graphql_client: DynGraphQLClient,
14191    ) -> Self {
14192        Self {
14193            proc,
14194            selection,
14195            graphql_client,
14196        }
14197    }
14198}
14199impl Module {
14200    /// A unique identifier for this Module.
14201    pub async fn id(&self) -> Result<Id, DaggerError> {
14202        let query = self.selection.select("id");
14203        query.execute(self.graphql_client.clone()).await
14204    }
14205    /// The source used to resolve contextual files and directories, when different from source.
14206    pub async fn context_source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14207        let query = self.selection.select("contextSource");
14208        let query = query.select("id");
14209        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14210        Ok(id.map(|id| ModuleSource {
14211            proc: self.proc.clone(),
14212            selection: query
14213                .root()
14214                .select("node")
14215                .arg("id", &id.0)
14216                .inline_fragment("ModuleSource"),
14217            graphql_client: self.graphql_client.clone(),
14218        }))
14219    }
14220    /// Forces evaluation of the module, including any loading into the engine and associated validation.
14221    pub async fn sync(&self) -> Result<Module, DaggerError> {
14222        let query = self.selection.select("sync");
14223        let id: Id = query.execute(self.graphql_client.clone()).await?;
14224        Ok(Module {
14225            proc: self.proc.clone(),
14226            selection: query
14227                .root()
14228                .select("node")
14229                .arg("id", &id.0)
14230                .inline_fragment("Module"),
14231            graphql_client: self.graphql_client.clone(),
14232        })
14233    }
14234    /// The dependencies of the module.
14235    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
14236        let query = self.selection.select("dependencies");
14237        let query = query.select("id");
14238        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14239        Ok(ids
14240            .into_iter()
14241            .map(|id| Module {
14242                proc: self.proc.clone(),
14243                selection: crate::querybuilder::query()
14244                    .select("node")
14245                    .arg("id", &id.0)
14246                    .inline_fragment("Module"),
14247                graphql_client: self.graphql_client.clone(),
14248            })
14249            .collect())
14250    }
14251    /// The introspection schema JSON file for this module.
14252    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
14253    /// Note: this is in the context of a module, so some core types may be hidden.
14254    pub fn introspection_schema_json(&self) -> File {
14255        let query = self.selection.select("introspectionSchemaJSON");
14256        File {
14257            proc: self.proc.clone(),
14258            selection: query,
14259            graphql_client: self.graphql_client.clone(),
14260        }
14261    }
14262    /// The generated files and directories made on top of the module source's context directory.
14263    pub fn generated_context_directory(&self) -> Directory {
14264        let query = self.selection.select("generatedContextDirectory");
14265        Directory {
14266            proc: self.proc.clone(),
14267            selection: query,
14268            graphql_client: self.graphql_client.clone(),
14269        }
14270    }
14271    /// User-defined default values, loaded from local .env files.
14272    pub fn user_defaults(&self) -> EnvFile {
14273        let query = self.selection.select("userDefaults");
14274        EnvFile {
14275            proc: self.proc.clone(),
14276            selection: query,
14277            graphql_client: self.graphql_client.clone(),
14278        }
14279    }
14280    /// Retrieves the module with the given description
14281    ///
14282    /// # Arguments
14283    ///
14284    /// * `description` - The description to set
14285    pub fn with_description(&self, description: impl Into<String>) -> Module {
14286        let mut query = self.selection.select("withDescription");
14287        query = query.arg("description", description.into());
14288        Module {
14289            proc: self.proc.clone(),
14290            selection: query,
14291            graphql_client: self.graphql_client.clone(),
14292        }
14293    }
14294    /// This module plus the given Object type and associated functions.
14295    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
14296        let mut query = self.selection.select("withObject");
14297        query = query.arg_lazy(
14298            "object",
14299            Box::new(move || {
14300                let object = object.clone();
14301                Box::pin(async move { object.into_id().await.unwrap().quote() })
14302            }),
14303        );
14304        Module {
14305            proc: self.proc.clone(),
14306            selection: query,
14307            graphql_client: self.graphql_client.clone(),
14308        }
14309    }
14310    /// This module plus the given Interface type and associated functions
14311    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
14312        let mut query = self.selection.select("withInterface");
14313        query = query.arg_lazy(
14314            "iface",
14315            Box::new(move || {
14316                let iface = iface.clone();
14317                Box::pin(async move { iface.into_id().await.unwrap().quote() })
14318            }),
14319        );
14320        Module {
14321            proc: self.proc.clone(),
14322            selection: query,
14323            graphql_client: self.graphql_client.clone(),
14324        }
14325    }
14326    /// This module plus the given Enum type and associated values
14327    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
14328        let mut query = self.selection.select("withEnum");
14329        query = query.arg_lazy(
14330            "enum",
14331            Box::new(move || {
14332                let r#enum = r#enum.clone();
14333                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
14334            }),
14335        );
14336        Module {
14337            proc: self.proc.clone(),
14338            selection: query,
14339            graphql_client: self.graphql_client.clone(),
14340        }
14341    }
14342    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
14343    pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
14344        let query = self.selection.select("runtime");
14345        let query = query.select("id");
14346        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14347        Ok(id.map(|id| Container {
14348            proc: self.proc.clone(),
14349            selection: query
14350                .root()
14351                .select("node")
14352                .arg("id", &id.0)
14353                .inline_fragment("Container"),
14354            graphql_client: self.graphql_client.clone(),
14355        }))
14356    }
14357    /// Serve a module's API in the current session.
14358    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14359    ///
14360    /// # Arguments
14361    ///
14362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14363    pub async fn serve(&self) -> Result<Void, DaggerError> {
14364        let query = self.selection.select("serve");
14365        query.execute(self.graphql_client.clone()).await
14366    }
14367    /// Serve a module's API in the current session.
14368    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14369    ///
14370    /// # Arguments
14371    ///
14372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14373    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
14374        let mut query = self.selection.select("serve");
14375        if let Some(include_dependencies) = opts.include_dependencies {
14376            query = query.arg("includeDependencies", include_dependencies);
14377        }
14378        if let Some(entrypoint) = opts.entrypoint {
14379            query = query.arg("entrypoint", entrypoint);
14380        }
14381        query.execute(self.graphql_client.clone()).await
14382    }
14383    /// The source for the module.
14384    pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14385        let query = self.selection.select("source");
14386        let query = query.select("id");
14387        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14388        Ok(id.map(|id| ModuleSource {
14389            proc: self.proc.clone(),
14390            selection: query
14391                .root()
14392                .select("node")
14393                .arg("id", &id.0)
14394                .inline_fragment("ModuleSource"),
14395            graphql_client: self.graphql_client.clone(),
14396        }))
14397    }
14398    /// The name of the module
14399    pub async fn name(&self) -> Result<String, DaggerError> {
14400        let query = self.selection.select("name");
14401        query.execute(self.graphql_client.clone()).await
14402    }
14403    /// The SDK config used by this module.
14404    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
14405        let query = self.selection.select("sdk");
14406        let query = query.select("id");
14407        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14408        Ok(id.map(|id| SdkConfig {
14409            proc: self.proc.clone(),
14410            selection: query
14411                .root()
14412                .select("node")
14413                .arg("id", &id.0)
14414                .inline_fragment("SDKConfig"),
14415            graphql_client: self.graphql_client.clone(),
14416        }))
14417    }
14418    /// The doc string of the module, if any
14419    pub async fn description(&self) -> Result<String, DaggerError> {
14420        let query = self.selection.select("description");
14421        query.execute(self.graphql_client.clone()).await
14422    }
14423    /// Objects served by this module.
14424    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
14425        let query = self.selection.select("objects");
14426        let query = query.select("id");
14427        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14428        Ok(ids
14429            .into_iter()
14430            .map(|id| TypeDef {
14431                proc: self.proc.clone(),
14432                selection: crate::querybuilder::query()
14433                    .select("node")
14434                    .arg("id", &id.0)
14435                    .inline_fragment("TypeDef"),
14436                graphql_client: self.graphql_client.clone(),
14437            })
14438            .collect())
14439    }
14440    /// Interfaces served by this module.
14441    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
14442        let query = self.selection.select("interfaces");
14443        let query = query.select("id");
14444        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14445        Ok(ids
14446            .into_iter()
14447            .map(|id| TypeDef {
14448                proc: self.proc.clone(),
14449                selection: crate::querybuilder::query()
14450                    .select("node")
14451                    .arg("id", &id.0)
14452                    .inline_fragment("TypeDef"),
14453                graphql_client: self.graphql_client.clone(),
14454            })
14455            .collect())
14456    }
14457    /// Enumerations served by this module.
14458    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
14459        let query = self.selection.select("enums");
14460        let query = query.select("id");
14461        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14462        Ok(ids
14463            .into_iter()
14464            .map(|id| TypeDef {
14465                proc: self.proc.clone(),
14466                selection: crate::querybuilder::query()
14467                    .select("node")
14468                    .arg("id", &id.0)
14469                    .inline_fragment("TypeDef"),
14470                graphql_client: self.graphql_client.clone(),
14471            })
14472            .collect())
14473    }
14474}
14475impl Node for Module {
14476    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14477        let query = self.selection.select("id");
14478        let graphql_client = self.graphql_client.clone();
14479        async move { query.execute(graphql_client).await }
14480    }
14481}
14482impl Syncer for Module {
14483    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14484        let query = self.selection.select("id");
14485        let graphql_client = self.graphql_client.clone();
14486        async move { query.execute(graphql_client).await }
14487    }
14488    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
14489        let query = self.selection.select("sync");
14490        let proc = self.proc.clone();
14491        let graphql_client = self.graphql_client.clone();
14492        async move {
14493            let id: Id = query.execute(graphql_client.clone()).await?;
14494            Ok(Self {
14495                proc,
14496                selection: query
14497                    .root()
14498                    .select("node")
14499                    .arg("id", &id.0)
14500                    .inline_fragment("Module"),
14501                graphql_client,
14502            })
14503        }
14504    }
14505}
14506#[derive(Clone)]
14507pub struct ModuleConfigClient {
14508    pub proc: Option<Arc<DaggerSessionProc>>,
14509    pub selection: Selection,
14510    pub graphql_client: DynGraphQLClient,
14511}
14512impl IntoID<Id> for ModuleConfigClient {
14513    fn into_id(
14514        self,
14515    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14516        Box::pin(async move { self.id().await })
14517    }
14518}
14519impl Loadable for ModuleConfigClient {
14520    fn graphql_type() -> &'static str {
14521        "ModuleConfigClient"
14522    }
14523    fn from_query(
14524        proc: Option<Arc<DaggerSessionProc>>,
14525        selection: Selection,
14526        graphql_client: DynGraphQLClient,
14527    ) -> Self {
14528        Self {
14529            proc,
14530            selection,
14531            graphql_client,
14532        }
14533    }
14534}
14535impl ModuleConfigClient {
14536    /// A unique identifier for this ModuleConfigClient.
14537    pub async fn id(&self) -> Result<Id, DaggerError> {
14538        let query = self.selection.select("id");
14539        query.execute(self.graphql_client.clone()).await
14540    }
14541    /// The generator to use
14542    pub async fn generator(&self) -> Result<String, DaggerError> {
14543        let query = self.selection.select("generator");
14544        query.execute(self.graphql_client.clone()).await
14545    }
14546    /// The directory the client is generated in.
14547    pub async fn directory(&self) -> Result<String, DaggerError> {
14548        let query = self.selection.select("directory");
14549        query.execute(self.graphql_client.clone()).await
14550    }
14551}
14552impl Node for ModuleConfigClient {
14553    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14554        let query = self.selection.select("id");
14555        let graphql_client = self.graphql_client.clone();
14556        async move { query.execute(graphql_client).await }
14557    }
14558}
14559#[derive(Clone)]
14560pub struct ModuleSource {
14561    pub proc: Option<Arc<DaggerSessionProc>>,
14562    pub selection: Selection,
14563    pub graphql_client: DynGraphQLClient,
14564}
14565impl IntoID<Id> for ModuleSource {
14566    fn into_id(
14567        self,
14568    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14569        Box::pin(async move { self.id().await })
14570    }
14571}
14572impl Loadable for ModuleSource {
14573    fn graphql_type() -> &'static str {
14574        "ModuleSource"
14575    }
14576    fn from_query(
14577        proc: Option<Arc<DaggerSessionProc>>,
14578        selection: Selection,
14579        graphql_client: DynGraphQLClient,
14580    ) -> Self {
14581        Self {
14582            proc,
14583            selection,
14584            graphql_client,
14585        }
14586    }
14587}
14588impl ModuleSource {
14589    /// A unique identifier for this ModuleSource.
14590    pub async fn id(&self) -> Result<Id, DaggerError> {
14591        let query = self.selection.select("id");
14592        query.execute(self.graphql_client.clone()).await
14593    }
14594    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
14595    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
14596        let query = self.selection.select("sync");
14597        let id: Id = query.execute(self.graphql_client.clone()).await?;
14598        Ok(ModuleSource {
14599            proc: self.proc.clone(),
14600            selection: query
14601                .root()
14602                .select("node")
14603                .arg("id", &id.0)
14604                .inline_fragment("ModuleSource"),
14605            graphql_client: self.graphql_client.clone(),
14606        })
14607    }
14608    /// The path to the directory containing the module's source code, relative to the context directory.
14609    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
14610        let query = self.selection.select("sourceSubpath");
14611        query.execute(self.graphql_client.clone()).await
14612    }
14613    /// The original subpath used when instantiating this module source, relative to the context directory.
14614    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
14615        let query = self.selection.select("originalSubpath");
14616        query.execute(self.graphql_client.clone()).await
14617    }
14618    /// 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.
14619    pub async fn digest(&self) -> Result<String, DaggerError> {
14620        let query = self.selection.select("digest");
14621        query.execute(self.graphql_client.clone()).await
14622    }
14623    /// Update the module source with a new source subpath.
14624    ///
14625    /// # Arguments
14626    ///
14627    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
14628    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
14629        let mut query = self.selection.select("withSourceSubpath");
14630        query = query.arg("path", path.into());
14631        ModuleSource {
14632            proc: self.proc.clone(),
14633            selection: query,
14634            graphql_client: self.graphql_client.clone(),
14635        }
14636    }
14637    /// Update the module source with a new name.
14638    ///
14639    /// # Arguments
14640    ///
14641    /// * `name` - The name to set.
14642    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
14643        let mut query = self.selection.select("withName");
14644        query = query.arg("name", name.into());
14645        ModuleSource {
14646            proc: self.proc.clone(),
14647            selection: query,
14648            graphql_client: self.graphql_client.clone(),
14649        }
14650    }
14651    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
14652    ///
14653    /// # Arguments
14654    ///
14655    /// * `patterns` - The new additional include patterns.
14656    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
14657        let mut query = self.selection.select("withIncludes");
14658        query = query.arg(
14659            "patterns",
14660            patterns
14661                .into_iter()
14662                .map(|i| i.into())
14663                .collect::<Vec<String>>(),
14664        );
14665        ModuleSource {
14666            proc: self.proc.clone(),
14667            selection: query,
14668            graphql_client: self.graphql_client.clone(),
14669        }
14670    }
14671    /// Update the module source with a new SDK.
14672    ///
14673    /// # Arguments
14674    ///
14675    /// * `source` - The SDK source to set.
14676    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
14677        let mut query = self.selection.select("withSDK");
14678        query = query.arg("source", source.into());
14679        ModuleSource {
14680            proc: self.proc.clone(),
14681            selection: query,
14682            graphql_client: self.graphql_client.clone(),
14683        }
14684    }
14685    /// Upgrade the engine version of the module to the given value.
14686    ///
14687    /// # Arguments
14688    ///
14689    /// * `version` - The engine version to upgrade to.
14690    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
14691        let mut query = self.selection.select("withEngineVersion");
14692        query = query.arg("version", version.into());
14693        ModuleSource {
14694            proc: self.proc.clone(),
14695            selection: query,
14696            graphql_client: self.graphql_client.clone(),
14697        }
14698    }
14699    /// Append the provided dependencies to the module source's dependency list.
14700    ///
14701    /// # Arguments
14702    ///
14703    /// * `dependencies` - The dependencies to append.
14704    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
14705        let mut query = self.selection.select("withDependencies");
14706        query = query.arg("dependencies", dependencies);
14707        ModuleSource {
14708            proc: self.proc.clone(),
14709            selection: query,
14710            graphql_client: self.graphql_client.clone(),
14711        }
14712    }
14713    /// Update one or more module dependencies.
14714    ///
14715    /// # Arguments
14716    ///
14717    /// * `dependencies` - The dependencies to update.
14718    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14719        let mut query = self.selection.select("withUpdateDependencies");
14720        query = query.arg(
14721            "dependencies",
14722            dependencies
14723                .into_iter()
14724                .map(|i| i.into())
14725                .collect::<Vec<String>>(),
14726        );
14727        ModuleSource {
14728            proc: self.proc.clone(),
14729            selection: query,
14730            graphql_client: self.graphql_client.clone(),
14731        }
14732    }
14733    /// Remove the provided dependencies from the module source's dependency list.
14734    ///
14735    /// # Arguments
14736    ///
14737    /// * `dependencies` - The dependencies to remove.
14738    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14739        let mut query = self.selection.select("withoutDependencies");
14740        query = query.arg(
14741            "dependencies",
14742            dependencies
14743                .into_iter()
14744                .map(|i| i.into())
14745                .collect::<Vec<String>>(),
14746        );
14747        ModuleSource {
14748            proc: self.proc.clone(),
14749            selection: query,
14750            graphql_client: self.graphql_client.clone(),
14751        }
14752    }
14753    /// Set a blueprint for the module source.
14754    ///
14755    /// # Arguments
14756    ///
14757    /// * `blueprint` - The blueprint module to set.
14758    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
14759        let mut query = self.selection.select("withBlueprint");
14760        query = query.arg_lazy(
14761            "blueprint",
14762            Box::new(move || {
14763                let blueprint = blueprint.clone();
14764                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
14765            }),
14766        );
14767        ModuleSource {
14768            proc: self.proc.clone(),
14769            selection: query,
14770            graphql_client: self.graphql_client.clone(),
14771        }
14772    }
14773    /// Add toolchains to the module source.
14774    ///
14775    /// # Arguments
14776    ///
14777    /// * `toolchains` - The toolchain modules to add.
14778    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
14779        let mut query = self.selection.select("withToolchains");
14780        query = query.arg("toolchains", toolchains);
14781        ModuleSource {
14782            proc: self.proc.clone(),
14783            selection: query,
14784            graphql_client: self.graphql_client.clone(),
14785        }
14786    }
14787    /// Update one or more toolchains.
14788    ///
14789    /// # Arguments
14790    ///
14791    /// * `toolchains` - The toolchains to update.
14792    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14793        let mut query = self.selection.select("withUpdateToolchains");
14794        query = query.arg(
14795            "toolchains",
14796            toolchains
14797                .into_iter()
14798                .map(|i| i.into())
14799                .collect::<Vec<String>>(),
14800        );
14801        ModuleSource {
14802            proc: self.proc.clone(),
14803            selection: query,
14804            graphql_client: self.graphql_client.clone(),
14805        }
14806    }
14807    /// Remove the provided toolchains from the module source.
14808    ///
14809    /// # Arguments
14810    ///
14811    /// * `toolchains` - The toolchains to remove.
14812    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14813        let mut query = self.selection.select("withoutToolchains");
14814        query = query.arg(
14815            "toolchains",
14816            toolchains
14817                .into_iter()
14818                .map(|i| i.into())
14819                .collect::<Vec<String>>(),
14820        );
14821        ModuleSource {
14822            proc: self.proc.clone(),
14823            selection: query,
14824            graphql_client: self.graphql_client.clone(),
14825        }
14826    }
14827    /// Update the blueprint module to the latest version.
14828    pub fn with_update_blueprint(&self) -> ModuleSource {
14829        let query = self.selection.select("withUpdateBlueprint");
14830        ModuleSource {
14831            proc: self.proc.clone(),
14832            selection: query,
14833            graphql_client: self.graphql_client.clone(),
14834        }
14835    }
14836    /// Remove the current blueprint from the module source.
14837    pub fn without_blueprint(&self) -> ModuleSource {
14838        let query = self.selection.select("withoutBlueprint");
14839        ModuleSource {
14840            proc: self.proc.clone(),
14841            selection: query,
14842            graphql_client: self.graphql_client.clone(),
14843        }
14844    }
14845    /// Enable the experimental features for the module source.
14846    ///
14847    /// # Arguments
14848    ///
14849    /// * `features` - The experimental features to enable.
14850    pub fn with_experimental_features(
14851        &self,
14852        features: Vec<ModuleSourceExperimentalFeature>,
14853    ) -> ModuleSource {
14854        let mut query = self.selection.select("withExperimentalFeatures");
14855        query = query.arg("features", features);
14856        ModuleSource {
14857            proc: self.proc.clone(),
14858            selection: query,
14859            graphql_client: self.graphql_client.clone(),
14860        }
14861    }
14862    /// Disable experimental features for the module source.
14863    ///
14864    /// # Arguments
14865    ///
14866    /// * `features` - The experimental features to disable.
14867    pub fn without_experimental_features(
14868        &self,
14869        features: Vec<ModuleSourceExperimentalFeature>,
14870    ) -> ModuleSource {
14871        let mut query = self.selection.select("withoutExperimentalFeatures");
14872        query = query.arg("features", features);
14873        ModuleSource {
14874            proc: self.proc.clone(),
14875            selection: query,
14876            graphql_client: self.graphql_client.clone(),
14877        }
14878    }
14879    /// The generated files and directories made on top of the module source's context directory.
14880    pub fn generated_context_directory(&self) -> Directory {
14881        let query = self.selection.select("generatedContextDirectory");
14882        Directory {
14883            proc: self.proc.clone(),
14884            selection: query,
14885            graphql_client: self.graphql_client.clone(),
14886        }
14887    }
14888    /// The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.
14889    /// 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.
14890    pub fn updated_config_directory(&self) -> Directory {
14891        let query = self.selection.select("updatedConfigDirectory");
14892        Directory {
14893            proc: self.proc.clone(),
14894            selection: query,
14895            graphql_client: self.graphql_client.clone(),
14896        }
14897    }
14898    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
14899    pub fn generated_context_changeset(&self) -> Changeset {
14900        let query = self.selection.select("generatedContextChangeset");
14901        Changeset {
14902            proc: self.proc.clone(),
14903            selection: query,
14904            graphql_client: self.graphql_client.clone(),
14905        }
14906    }
14907    /// Return the supplied workspace with this module's generated context applied.
14908    /// The workspace change baseline is preserved, so a later Workspace.changes call includes this generation together with any other edits made by the caller.
14909    ///
14910    /// # Arguments
14911    ///
14912    /// * `workspace` - The workspace to apply generated files to.
14913    pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
14914        let mut query = self.selection.select("generate");
14915        query = query.arg_lazy(
14916            "workspace",
14917            Box::new(move || {
14918                let workspace = workspace.clone();
14919                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
14920            }),
14921        );
14922        Workspace {
14923            proc: self.proc.clone(),
14924            selection: query,
14925            graphql_client: self.graphql_client.clone(),
14926        }
14927    }
14928    /// A human readable ref string representation of this module source.
14929    pub async fn as_string(&self) -> Result<String, DaggerError> {
14930        let query = self.selection.select("asString");
14931        query.execute(self.graphql_client.clone()).await
14932    }
14933    /// The pinned version of this module source.
14934    pub async fn pin(&self) -> Result<String, DaggerError> {
14935        let query = self.selection.select("pin");
14936        query.execute(self.graphql_client.clone()).await
14937    }
14938    /// 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.
14939    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
14940        let query = self.selection.select("localContextDirectoryPath");
14941        query.execute(self.graphql_client.clone()).await
14942    }
14943    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
14944    pub fn as_module(&self) -> Module {
14945        let query = self.selection.select("asModule");
14946        Module {
14947            proc: self.proc.clone(),
14948            selection: query,
14949            graphql_client: self.graphql_client.clone(),
14950        }
14951    }
14952    /// The introspection schema JSON file for this module source.
14953    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
14954    /// Note: this is in the context of a module, so some core types may be hidden.
14955    pub fn introspection_schema_json(&self) -> File {
14956        let query = self.selection.select("introspectionSchemaJSON");
14957        File {
14958            proc: self.proc.clone(),
14959            selection: query,
14960            graphql_client: self.graphql_client.clone(),
14961        }
14962    }
14963    /// The client-facing introspection schema JSON file for this module source.
14964    /// 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.
14965    pub fn client_schema_introspection_json(&self) -> File {
14966        let query = self.selection.select("clientSchemaIntrospectionJSON");
14967        File {
14968            proc: self.proc.clone(),
14969            selection: query,
14970            graphql_client: self.graphql_client.clone(),
14971        }
14972    }
14973    /// The directory containing the module configuration and source code (source code may be in a subdir).
14974    ///
14975    /// # Arguments
14976    ///
14977    /// * `path` - A subpath from the source directory to select.
14978    pub fn directory(&self, path: impl Into<String>) -> Directory {
14979        let mut query = self.selection.select("directory");
14980        query = query.arg("path", path.into());
14981        Directory {
14982            proc: self.proc.clone(),
14983            selection: query,
14984            graphql_client: self.graphql_client.clone(),
14985        }
14986    }
14987    /// The ref to clone the root of the git repo from. Only valid for git sources.
14988    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
14989        let query = self.selection.select("cloneRef");
14990        query.execute(self.graphql_client.clone()).await
14991    }
14992    /// The URL to the source's git repo in a web browser. Only valid for git sources.
14993    pub async fn html_url(&self) -> Result<String, DaggerError> {
14994        let query = self.selection.select("htmlURL");
14995        query.execute(self.graphql_client.clone()).await
14996    }
14997    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
14998    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
14999        let query = self.selection.select("htmlRepoURL");
15000        query.execute(self.graphql_client.clone()).await
15001    }
15002    /// The specified version of the git repo this source points to.
15003    pub async fn version(&self) -> Result<String, DaggerError> {
15004        let query = self.selection.select("version");
15005        query.execute(self.graphql_client.clone()).await
15006    }
15007    /// The resolved commit of the git repo this source points to.
15008    pub async fn commit(&self) -> Result<String, DaggerError> {
15009        let query = self.selection.select("commit");
15010        query.execute(self.graphql_client.clone()).await
15011    }
15012    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
15013    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
15014        let query = self.selection.select("repoRootPath");
15015        query.execute(self.graphql_client.clone()).await
15016    }
15017    /// Update the module source with a new client to generate.
15018    ///
15019    /// # Arguments
15020    ///
15021    /// * `generator` - The generator to use
15022    /// * `output_dir` - The output directory for the generated client.
15023    pub fn with_client(
15024        &self,
15025        generator: impl Into<String>,
15026        output_dir: impl Into<String>,
15027    ) -> ModuleSource {
15028        let mut query = self.selection.select("withClient");
15029        query = query.arg("generator", generator.into());
15030        query = query.arg("outputDir", output_dir.into());
15031        ModuleSource {
15032            proc: self.proc.clone(),
15033            selection: query,
15034            graphql_client: self.graphql_client.clone(),
15035        }
15036    }
15037    /// Update one or more clients.
15038    ///
15039    /// # Arguments
15040    ///
15041    /// * `clients` - The clients to update
15042    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
15043        let mut query = self.selection.select("withUpdatedClients");
15044        query = query.arg(
15045            "clients",
15046            clients
15047                .into_iter()
15048                .map(|i| i.into())
15049                .collect::<Vec<String>>(),
15050        );
15051        ModuleSource {
15052            proc: self.proc.clone(),
15053            selection: query,
15054            graphql_client: self.graphql_client.clone(),
15055        }
15056    }
15057    /// Remove a client from the module source.
15058    ///
15059    /// # Arguments
15060    ///
15061    /// * `path` - The path of the client to remove.
15062    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
15063        let mut query = self.selection.select("withoutClient");
15064        query = query.arg("path", path.into());
15065        ModuleSource {
15066            proc: self.proc.clone(),
15067            selection: query,
15068            graphql_client: self.graphql_client.clone(),
15069        }
15070    }
15071    /// Whether an existing module config file was found.
15072    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
15073        let query = self.selection.select("configExists");
15074        query.execute(self.graphql_client.clone()).await
15075    }
15076    /// The name of the module, including any setting via the withName API.
15077    pub async fn module_name(&self) -> Result<String, DaggerError> {
15078        let query = self.selection.select("moduleName");
15079        query.execute(self.graphql_client.clone()).await
15080    }
15081    /// The original name of the module as read from the module config file (or set for the first time with the withName API).
15082    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
15083        let query = self.selection.select("moduleOriginalName");
15084        query.execute(self.graphql_client.clone()).await
15085    }
15086    /// The engine version of the module.
15087    pub async fn engine_version(&self) -> Result<String, DaggerError> {
15088        let query = self.selection.select("engineVersion");
15089        query.execute(self.graphql_client.clone()).await
15090    }
15091    /// The SDK configuration of the module.
15092    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
15093        let query = self.selection.select("sdk");
15094        let query = query.select("id");
15095        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15096        Ok(id.map(|id| SdkConfig {
15097            proc: self.proc.clone(),
15098            selection: query
15099                .root()
15100                .select("node")
15101                .arg("id", &id.0)
15102                .inline_fragment("SDKConfig"),
15103            graphql_client: self.graphql_client.clone(),
15104        }))
15105    }
15106    /// The dependencies of the module source.
15107    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15108        let query = self.selection.select("dependencies");
15109        let query = query.select("id");
15110        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15111        Ok(ids
15112            .into_iter()
15113            .map(|id| ModuleSource {
15114                proc: self.proc.clone(),
15115                selection: crate::querybuilder::query()
15116                    .select("node")
15117                    .arg("id", &id.0)
15118                    .inline_fragment("ModuleSource"),
15119                graphql_client: self.graphql_client.clone(),
15120            })
15121            .collect())
15122    }
15123    /// The blueprint referenced by the module source.
15124    pub fn blueprint(&self) -> ModuleSource {
15125        let query = self.selection.select("blueprint");
15126        ModuleSource {
15127            proc: self.proc.clone(),
15128            selection: query,
15129            graphql_client: self.graphql_client.clone(),
15130        }
15131    }
15132    /// The toolchains referenced by the module source.
15133    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15134        let query = self.selection.select("toolchains");
15135        let query = query.select("id");
15136        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15137        Ok(ids
15138            .into_iter()
15139            .map(|id| ModuleSource {
15140                proc: self.proc.clone(),
15141                selection: crate::querybuilder::query()
15142                    .select("node")
15143                    .arg("id", &id.0)
15144                    .inline_fragment("ModuleSource"),
15145                graphql_client: self.graphql_client.clone(),
15146            })
15147            .collect())
15148    }
15149    /// User-defined defaults read from local .env files
15150    pub fn user_defaults(&self) -> EnvFile {
15151        let query = self.selection.select("userDefaults");
15152        EnvFile {
15153            proc: self.proc.clone(),
15154            selection: query,
15155            graphql_client: self.graphql_client.clone(),
15156        }
15157    }
15158    /// The clients generated for the module.
15159    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
15160        let query = self.selection.select("configClients");
15161        let query = query.select("id");
15162        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15163        Ok(ids
15164            .into_iter()
15165            .map(|id| ModuleConfigClient {
15166                proc: self.proc.clone(),
15167                selection: crate::querybuilder::query()
15168                    .select("node")
15169                    .arg("id", &id.0)
15170                    .inline_fragment("ModuleConfigClient"),
15171                graphql_client: self.graphql_client.clone(),
15172            })
15173            .collect())
15174    }
15175    /// The path, relative to the context directory, that contains the module config.
15176    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
15177        let query = self.selection.select("sourceRootSubpath");
15178        query.execute(self.graphql_client.clone()).await
15179    }
15180    /// The full directory loaded for the module source, including the source code as a subdirectory.
15181    pub fn context_directory(&self) -> Directory {
15182        let query = self.selection.select("contextDirectory");
15183        Directory {
15184            proc: self.proc.clone(),
15185            selection: query,
15186            graphql_client: self.graphql_client.clone(),
15187        }
15188    }
15189    /// The kind of module source (currently local, git or dir).
15190    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
15191        let query = self.selection.select("kind");
15192        query.execute(self.graphql_client.clone()).await
15193    }
15194}
15195impl Node for ModuleSource {
15196    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15197        let query = self.selection.select("id");
15198        let graphql_client = self.graphql_client.clone();
15199        async move { query.execute(graphql_client).await }
15200    }
15201}
15202impl Syncer for ModuleSource {
15203    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15204        let query = self.selection.select("id");
15205        let graphql_client = self.graphql_client.clone();
15206        async move { query.execute(graphql_client).await }
15207    }
15208    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15209        let query = self.selection.select("sync");
15210        let proc = self.proc.clone();
15211        let graphql_client = self.graphql_client.clone();
15212        async move {
15213            let id: Id = query.execute(graphql_client.clone()).await?;
15214            Ok(Self {
15215                proc,
15216                selection: query
15217                    .root()
15218                    .select("node")
15219                    .arg("id", &id.0)
15220                    .inline_fragment("ModuleSource"),
15221                graphql_client,
15222            })
15223        }
15224    }
15225}
15226#[derive(Clone)]
15227pub struct ObjectTypeDef {
15228    pub proc: Option<Arc<DaggerSessionProc>>,
15229    pub selection: Selection,
15230    pub graphql_client: DynGraphQLClient,
15231}
15232impl IntoID<Id> for ObjectTypeDef {
15233    fn into_id(
15234        self,
15235    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15236        Box::pin(async move { self.id().await })
15237    }
15238}
15239impl Loadable for ObjectTypeDef {
15240    fn graphql_type() -> &'static str {
15241        "ObjectTypeDef"
15242    }
15243    fn from_query(
15244        proc: Option<Arc<DaggerSessionProc>>,
15245        selection: Selection,
15246        graphql_client: DynGraphQLClient,
15247    ) -> Self {
15248        Self {
15249            proc,
15250            selection,
15251            graphql_client,
15252        }
15253    }
15254}
15255impl ObjectTypeDef {
15256    /// A unique identifier for this ObjectTypeDef.
15257    pub async fn id(&self) -> Result<Id, DaggerError> {
15258        let query = self.selection.select("id");
15259        query.execute(self.graphql_client.clone()).await
15260    }
15261    /// The name of the object.
15262    pub async fn name(&self) -> Result<String, DaggerError> {
15263        let query = self.selection.select("name");
15264        query.execute(self.graphql_client.clone()).await
15265    }
15266    /// The doc string for the object, if any.
15267    pub async fn description(&self) -> Result<String, DaggerError> {
15268        let query = self.selection.select("description");
15269        query.execute(self.graphql_client.clone()).await
15270    }
15271    /// The location of this object declaration.
15272    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
15273        let query = self.selection.select("sourceMap");
15274        let query = query.select("id");
15275        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15276        Ok(id.map(|id| SourceMap {
15277            proc: self.proc.clone(),
15278            selection: query
15279                .root()
15280                .select("node")
15281                .arg("id", &id.0)
15282                .inline_fragment("SourceMap"),
15283            graphql_client: self.graphql_client.clone(),
15284        }))
15285    }
15286    /// The reason this enum member is deprecated, if any.
15287    pub async fn deprecated(&self) -> Result<String, DaggerError> {
15288        let query = self.selection.select("deprecated");
15289        query.execute(self.graphql_client.clone()).await
15290    }
15291    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
15292    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15293        let query = self.selection.select("sourceModuleName");
15294        query.execute(self.graphql_client.clone()).await
15295    }
15296    /// Static fields defined on this object, if any.
15297    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
15298        let query = self.selection.select("fields");
15299        let query = query.select("id");
15300        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15301        Ok(ids
15302            .into_iter()
15303            .map(|id| FieldTypeDef {
15304                proc: self.proc.clone(),
15305                selection: crate::querybuilder::query()
15306                    .select("node")
15307                    .arg("id", &id.0)
15308                    .inline_fragment("FieldTypeDef"),
15309                graphql_client: self.graphql_client.clone(),
15310            })
15311            .collect())
15312    }
15313    /// Functions defined on this object, if any.
15314    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
15315        let query = self.selection.select("functions");
15316        let query = query.select("id");
15317        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15318        Ok(ids
15319            .into_iter()
15320            .map(|id| Function {
15321                proc: self.proc.clone(),
15322                selection: crate::querybuilder::query()
15323                    .select("node")
15324                    .arg("id", &id.0)
15325                    .inline_fragment("Function"),
15326                graphql_client: self.graphql_client.clone(),
15327            })
15328            .collect())
15329    }
15330    /// The function used to construct new instances of this object, if any.
15331    pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
15332        let query = self.selection.select("constructor");
15333        let query = query.select("id");
15334        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15335        Ok(id.map(|id| Function {
15336            proc: self.proc.clone(),
15337            selection: query
15338                .root()
15339                .select("node")
15340                .arg("id", &id.0)
15341                .inline_fragment("Function"),
15342            graphql_client: self.graphql_client.clone(),
15343        }))
15344    }
15345}
15346impl Node for ObjectTypeDef {
15347    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15348        let query = self.selection.select("id");
15349        let graphql_client = self.graphql_client.clone();
15350        async move { query.execute(graphql_client).await }
15351    }
15352}
15353#[derive(Clone)]
15354pub struct Port {
15355    pub proc: Option<Arc<DaggerSessionProc>>,
15356    pub selection: Selection,
15357    pub graphql_client: DynGraphQLClient,
15358}
15359impl IntoID<Id> for Port {
15360    fn into_id(
15361        self,
15362    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15363        Box::pin(async move { self.id().await })
15364    }
15365}
15366impl Loadable for Port {
15367    fn graphql_type() -> &'static str {
15368        "Port"
15369    }
15370    fn from_query(
15371        proc: Option<Arc<DaggerSessionProc>>,
15372        selection: Selection,
15373        graphql_client: DynGraphQLClient,
15374    ) -> Self {
15375        Self {
15376            proc,
15377            selection,
15378            graphql_client,
15379        }
15380    }
15381}
15382impl Port {
15383    /// A unique identifier for this Port.
15384    pub async fn id(&self) -> Result<Id, DaggerError> {
15385        let query = self.selection.select("id");
15386        query.execute(self.graphql_client.clone()).await
15387    }
15388    /// The port number.
15389    pub async fn port(&self) -> Result<isize, DaggerError> {
15390        let query = self.selection.select("port");
15391        query.execute(self.graphql_client.clone()).await
15392    }
15393    /// The transport layer protocol.
15394    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
15395        let query = self.selection.select("protocol");
15396        query.execute(self.graphql_client.clone()).await
15397    }
15398    /// The port description.
15399    pub async fn description(&self) -> Result<String, DaggerError> {
15400        let query = self.selection.select("description");
15401        query.execute(self.graphql_client.clone()).await
15402    }
15403    /// Skip the health check when run as a service.
15404    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
15405        let query = self.selection.select("experimentalSkipHealthcheck");
15406        query.execute(self.graphql_client.clone()).await
15407    }
15408}
15409impl Node for Port {
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}
15416#[derive(Clone)]
15417pub struct Query {
15418    pub proc: Option<Arc<DaggerSessionProc>>,
15419    pub selection: Selection,
15420    pub graphql_client: DynGraphQLClient,
15421}
15422#[derive(Builder, Debug, PartialEq)]
15423pub struct QueryFileOpts {
15424    /// Permissions of the new file. Example: 0600
15425    #[builder(setter(into, strip_option), default)]
15426    pub permissions: Option<isize>,
15427}
15428#[derive(Builder, Debug, PartialEq)]
15429pub struct QueryBlobOpts {
15430    /// Permissions of the new file. Example: 0600
15431    #[builder(setter(into, strip_option), default)]
15432    pub permissions: Option<isize>,
15433}
15434#[derive(Builder, Debug, PartialEq)]
15435pub struct QueryGitOpts<'a> {
15436    /// A service which must be started before the repo is fetched.
15437    #[builder(setter(into, strip_option), default)]
15438    pub experimental_service_host: Option<Id>,
15439    /// Secret used to populate the Authorization HTTP header
15440    #[builder(setter(into, strip_option), default)]
15441    pub http_auth_header: Option<Id>,
15442    /// Secret used to populate the password during basic HTTP Authorization
15443    #[builder(setter(into, strip_option), default)]
15444    pub http_auth_token: Option<Id>,
15445    /// Username used to populate the password during basic HTTP Authorization
15446    #[builder(setter(into, strip_option), default)]
15447    pub http_auth_username: Option<&'a str>,
15448    /// DEPRECATED: Set to true to keep .git directory.
15449    #[builder(setter(into, strip_option), default)]
15450    pub keep_git_dir: Option<bool>,
15451    /// Set SSH auth socket
15452    #[builder(setter(into, strip_option), default)]
15453    pub ssh_auth_socket: Option<Id>,
15454    /// Set SSH known hosts
15455    #[builder(setter(into, strip_option), default)]
15456    pub ssh_known_hosts: Option<&'a str>,
15457}
15458#[derive(Builder, Debug, PartialEq)]
15459pub struct QueryContainerOpts {
15460    /// Platform to initialize the container with. Defaults to the native platform of the current engine
15461    #[builder(setter(into, strip_option), default)]
15462    pub platform: Option<Platform>,
15463}
15464#[derive(Builder, Debug, PartialEq)]
15465pub struct QueryCacheVolumeOpts<'a> {
15466    /// A user:group to set for the cache volume root.
15467    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
15468    /// If the group is omitted, it defaults to the same as the user.
15469    #[builder(setter(into, strip_option), default)]
15470    pub owner: Option<&'a str>,
15471    /// Sharing mode of the cache volume.
15472    #[builder(setter(into, strip_option), default)]
15473    pub sharing: Option<CacheSharingMode>,
15474    /// Identifier of the directory to use as the cache volume's root.
15475    #[builder(setter(into, strip_option), default)]
15476    pub source: Option<Id>,
15477}
15478#[derive(Builder, Debug, PartialEq)]
15479pub struct QueryEngineVolumeOpts<'a> {
15480    /// Optional existing subdirectory within the volume payload to mount.
15481    #[builder(setter(into, strip_option), default)]
15482    pub subdir: Option<&'a str>,
15483}
15484#[derive(Builder, Debug, PartialEq)]
15485pub struct QuerySshfsVolumeOpts<'a> {
15486    /// Optional cache equivalence key. If set, volumes with the same cacheKey may be considered equivalent for cache lookups, still subject to their resource dependencies.
15487    #[builder(setter(into, strip_option), default)]
15488    pub cache_key: Option<&'a str>,
15489    /// Service to use as the SSHFS network endpoint while verifying the original host key.
15490    #[builder(setter(into, strip_option), default)]
15491    pub experimental_service_host: Option<Id>,
15492    /// Disable SSH host key verification. This is insecure and must be explicitly opted into.
15493    #[builder(setter(into, strip_option), default)]
15494    pub insecure_skip_host_key_check: Option<bool>,
15495    /// known_hosts material used to verify the remote host key. Required unless insecureSkipHostKeyCheck is true.
15496    #[builder(setter(into, strip_option), default)]
15497    pub known_hosts: Option<Id>,
15498}
15499#[derive(Builder, Debug, PartialEq)]
15500pub struct QuerySecretOpts<'a> {
15501    /// 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.
15502    /// 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.
15503    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
15504    #[builder(setter(into, strip_option), default)]
15505    pub cache_key: Option<&'a str>,
15506}
15507#[derive(Builder, Debug, PartialEq)]
15508pub struct QueryHttpOpts<'a> {
15509    /// Secret used to populate the Authorization HTTP header
15510    #[builder(setter(into, strip_option), default)]
15511    pub auth_header: Option<Id>,
15512    /// Expected digest of the downloaded content (e.g., "sha256:...").
15513    #[builder(setter(into, strip_option), default)]
15514    pub checksum: Option<&'a str>,
15515    /// A service which must be started before the URL is fetched.
15516    #[builder(setter(into, strip_option), default)]
15517    pub experimental_service_host: Option<Id>,
15518    /// File name to use for the file. Defaults to the last part of the URL.
15519    #[builder(setter(into, strip_option), default)]
15520    pub name: Option<&'a str>,
15521    /// Permissions to set on the file.
15522    #[builder(setter(into, strip_option), default)]
15523    pub permissions: Option<isize>,
15524}
15525#[derive(Builder, Debug, PartialEq)]
15526pub struct QueryModuleSourceOpts<'a> {
15527    /// 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.
15528    #[builder(setter(into, strip_option), default)]
15529    pub allow_not_exists: Option<bool>,
15530    /// 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.
15531    #[builder(setter(into, strip_option), default)]
15532    pub disable_find_up: Option<bool>,
15533    /// The pinned version of the module source
15534    #[builder(setter(into, strip_option), default)]
15535    pub ref_pin: Option<&'a str>,
15536    /// If set, error out if the ref string is not of the provided requireKind.
15537    #[builder(setter(into, strip_option), default)]
15538    pub require_kind: Option<ModuleSourceKind>,
15539    /// Version query for a Git module source.
15540    #[builder(setter(into, strip_option), default)]
15541    pub version: Option<&'a str>,
15542}
15543#[derive(Builder, Debug, PartialEq)]
15544pub struct QueryCurrentTypeDefsOpts {
15545    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
15546    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
15547    #[builder(setter(into, strip_option), default)]
15548    pub hide_core: Option<bool>,
15549    /// Return the full referenced typedef closure instead of only top-level served typedefs.
15550    #[builder(setter(into, strip_option), default)]
15551    pub return_all_types: Option<bool>,
15552}
15553#[derive(Builder, Debug, PartialEq)]
15554pub struct QueryServeModuleOpts<'a> {
15555    /// The pinned version of a remote module address.
15556    #[builder(setter(into, strip_option), default)]
15557    pub ref_pin: Option<&'a str>,
15558}
15559#[derive(Builder, Debug, PartialEq)]
15560pub struct QueryLlmOpts<'a> {
15561    /// The model to converse with, e.g. "claude-sonnet-4-5" or "gpt-5.4". Defaults to the configured default model.
15562    #[builder(setter(into, strip_option), default)]
15563    pub model: Option<&'a str>,
15564    /// 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.
15565    #[builder(setter(into, strip_option), default)]
15566    pub provider: Option<&'a str>,
15567}
15568#[derive(Builder, Debug, PartialEq)]
15569pub struct QueryEnvFileOpts {
15570    /// Replace "${VAR}" or "$VAR" with the value of other vars
15571    #[builder(setter(into, strip_option), default)]
15572    pub expand: Option<bool>,
15573}
15574impl IntoID<Id> for Query {
15575    fn into_id(
15576        self,
15577    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15578        Box::pin(async move { self.id().await })
15579    }
15580}
15581impl Loadable for Query {
15582    fn graphql_type() -> &'static str {
15583        "Query"
15584    }
15585    fn from_query(
15586        proc: Option<Arc<DaggerSessionProc>>,
15587        selection: Selection,
15588        graphql_client: DynGraphQLClient,
15589    ) -> Self {
15590        Self {
15591            proc,
15592            selection,
15593            graphql_client,
15594        }
15595    }
15596}
15597impl Query {
15598    /// A unique identifier for this Query.
15599    pub async fn id(&self) -> Result<Id, DaggerError> {
15600        let query = self.selection.select("id");
15601        query.execute(self.graphql_client.clone()).await
15602    }
15603    /// Load any object by its ID.
15604    pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
15605        let mut query = self.selection.select("node");
15606        query = query.arg_lazy(
15607            "id",
15608            Box::new(move || {
15609                let id = id.clone();
15610                Box::pin(async move { id.into_id().await.unwrap().quote() })
15611            }),
15612        );
15613        let query = query.select("id");
15614        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15615        Ok(id.map(|id| NodeClient {
15616            proc: self.proc.clone(),
15617            selection: query
15618                .root()
15619                .select("node")
15620                .arg("id", &id.0)
15621                .inline_fragment("Node"),
15622            graphql_client: self.graphql_client.clone(),
15623        }))
15624    }
15625    /// Get the current Dagger Engine version.
15626    pub async fn version(&self) -> Result<String, DaggerError> {
15627        let query = self.selection.select("version");
15628        query.execute(self.graphql_client.clone()).await
15629    }
15630    /// The current UTC time in RFC3339 format. Never cached.
15631    pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
15632        let query = self.selection.select("currentTimestamp");
15633        query.execute(self.graphql_client.clone()).await
15634    }
15635    /// Name the current session.
15636    /// The title renames the session wherever its telemetry is shown (the calling client's primary span, e.g. the CLI's command span) and labels its engine archive, as listed by dagger agent --resume. The latest title wins. Only the session's main client may set it.
15637    ///
15638    /// # Arguments
15639    ///
15640    /// * `title` - The title, sanitized to a single printable line.
15641    pub async fn set_session_title(&self, title: impl Into<String>) -> Result<Void, DaggerError> {
15642        let mut query = self.selection.select("setSessionTitle");
15643        query = query.arg("title", title.into());
15644        query.execute(self.graphql_client.clone()).await
15645    }
15646    /// Creates an empty directory.
15647    pub fn directory(&self) -> Directory {
15648        let query = self.selection.select("directory");
15649        Directory {
15650            proc: self.proc.clone(),
15651            selection: query,
15652            graphql_client: self.graphql_client.clone(),
15653        }
15654    }
15655    /// Creates an empty changeset
15656    pub fn changeset(&self) -> Changeset {
15657        let query = self.selection.select("changeset");
15658        Changeset {
15659            proc: self.proc.clone(),
15660            selection: query,
15661            graphql_client: self.graphql_client.clone(),
15662        }
15663    }
15664    /// Creates a file with the specified contents.
15665    ///
15666    /// # Arguments
15667    ///
15668    /// * `name` - Name of the new file. Example: "foo.txt"
15669    /// * `contents` - Contents of the new file. Example: "Hello world!"
15670    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15671    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
15672        let mut query = self.selection.select("file");
15673        query = query.arg("name", name.into());
15674        query = query.arg("contents", contents.into());
15675        File {
15676            proc: self.proc.clone(),
15677            selection: query,
15678            graphql_client: self.graphql_client.clone(),
15679        }
15680    }
15681    /// Creates a file with the specified contents.
15682    ///
15683    /// # Arguments
15684    ///
15685    /// * `name` - Name of the new file. Example: "foo.txt"
15686    /// * `contents` - Contents of the new file. Example: "Hello world!"
15687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15688    pub fn file_opts(
15689        &self,
15690        name: impl Into<String>,
15691        contents: impl Into<String>,
15692        opts: QueryFileOpts,
15693    ) -> File {
15694        let mut query = self.selection.select("file");
15695        query = query.arg("name", name.into());
15696        query = query.arg("contents", contents.into());
15697        if let Some(permissions) = opts.permissions {
15698            query = query.arg("permissions", permissions);
15699        }
15700        File {
15701            proc: self.proc.clone(),
15702            selection: query,
15703            graphql_client: self.graphql_client.clone(),
15704        }
15705    }
15706    /// Creates a file from arbitrary binary contents.
15707    ///
15708    /// # Arguments
15709    ///
15710    /// * `name` - Name of the new file. Example: "archive.tar"
15711    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
15712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15713    pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
15714        let mut query = self.selection.select("blob");
15715        query = query.arg("name", name.into());
15716        query = query.arg("contents", contents);
15717        File {
15718            proc: self.proc.clone(),
15719            selection: query,
15720            graphql_client: self.graphql_client.clone(),
15721        }
15722    }
15723    /// Creates a file from arbitrary binary contents.
15724    ///
15725    /// # Arguments
15726    ///
15727    /// * `name` - Name of the new file. Example: "archive.tar"
15728    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
15729    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15730    pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
15731        let mut query = self.selection.select("blob");
15732        query = query.arg("name", name.into());
15733        query = query.arg("contents", contents);
15734        if let Some(permissions) = opts.permissions {
15735            query = query.arg("permissions", permissions);
15736        }
15737        File {
15738            proc: self.proc.clone(),
15739            selection: query,
15740            graphql_client: self.graphql_client.clone(),
15741        }
15742    }
15743    /// Queries a Git repository.
15744    ///
15745    /// # Arguments
15746    ///
15747    /// * `url` - URL of the git repository.
15748    ///
15749    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
15750    ///
15751    /// Suffix ".git" is optional.
15752    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15753    pub fn git(&self, url: impl Into<String>) -> GitRepository {
15754        let mut query = self.selection.select("git");
15755        query = query.arg("url", url.into());
15756        GitRepository {
15757            proc: self.proc.clone(),
15758            selection: query,
15759            graphql_client: self.graphql_client.clone(),
15760        }
15761    }
15762    /// Queries a Git repository.
15763    ///
15764    /// # Arguments
15765    ///
15766    /// * `url` - URL of the git repository.
15767    ///
15768    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
15769    ///
15770    /// Suffix ".git" is optional.
15771    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15772    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
15773        let mut query = self.selection.select("git");
15774        query = query.arg("url", url.into());
15775        if let Some(keep_git_dir) = opts.keep_git_dir {
15776            query = query.arg("keepGitDir", keep_git_dir);
15777        }
15778        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
15779            query = query.arg("sshKnownHosts", ssh_known_hosts);
15780        }
15781        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
15782            query = query.arg("sshAuthSocket", ssh_auth_socket);
15783        }
15784        if let Some(http_auth_username) = opts.http_auth_username {
15785            query = query.arg("httpAuthUsername", http_auth_username);
15786        }
15787        if let Some(http_auth_token) = opts.http_auth_token {
15788            query = query.arg("httpAuthToken", http_auth_token);
15789        }
15790        if let Some(http_auth_header) = opts.http_auth_header {
15791            query = query.arg("httpAuthHeader", http_auth_header);
15792        }
15793        if let Some(experimental_service_host) = opts.experimental_service_host {
15794            query = query.arg("experimentalServiceHost", experimental_service_host);
15795        }
15796        GitRepository {
15797            proc: self.proc.clone(),
15798            selection: query,
15799            graphql_client: self.graphql_client.clone(),
15800        }
15801    }
15802    /// Creates a scratch container, with no image or metadata.
15803    /// To pull an image, follow up with the "from" function.
15804    ///
15805    /// # Arguments
15806    ///
15807    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15808    pub fn container(&self) -> Container {
15809        let query = self.selection.select("container");
15810        Container {
15811            proc: self.proc.clone(),
15812            selection: query,
15813            graphql_client: self.graphql_client.clone(),
15814        }
15815    }
15816    /// Creates a scratch container, with no image or metadata.
15817    /// To pull an image, follow up with the "from" function.
15818    ///
15819    /// # Arguments
15820    ///
15821    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15822    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
15823        let mut query = self.selection.select("container");
15824        if let Some(platform) = opts.platform {
15825            query = query.arg("platform", platform);
15826        }
15827        Container {
15828            proc: self.proc.clone(),
15829            selection: query,
15830            graphql_client: self.graphql_client.clone(),
15831        }
15832    }
15833    /// Constructs a cache volume for a given cache key.
15834    ///
15835    /// # Arguments
15836    ///
15837    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
15838    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15839    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
15840        let mut query = self.selection.select("cacheVolume");
15841        query = query.arg("key", key.into());
15842        CacheVolume {
15843            proc: self.proc.clone(),
15844            selection: query,
15845            graphql_client: self.graphql_client.clone(),
15846        }
15847    }
15848    /// Constructs a cache volume for a given cache key.
15849    ///
15850    /// # Arguments
15851    ///
15852    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
15853    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15854    pub fn cache_volume_opts<'a>(
15855        &self,
15856        key: impl Into<String>,
15857        opts: QueryCacheVolumeOpts<'a>,
15858    ) -> CacheVolume {
15859        let mut query = self.selection.select("cacheVolume");
15860        query = query.arg("key", key.into());
15861        if let Some(source) = opts.source {
15862            query = query.arg("source", source);
15863        }
15864        if let Some(sharing) = opts.sharing {
15865            query = query.arg("sharing", sharing);
15866        }
15867        if let Some(owner) = opts.owner {
15868            query = query.arg("owner", owner);
15869        }
15870        CacheVolume {
15871            proc: self.proc.clone(),
15872            selection: query,
15873            graphql_client: self.graphql_client.clone(),
15874        }
15875    }
15876    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
15877    ///
15878    /// # Arguments
15879    ///
15880    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
15881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15882    pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
15883        let mut query = self.selection.select("engineVolume");
15884        query = query.arg("name", name.into());
15885        Volume {
15886            proc: self.proc.clone(),
15887            selection: query,
15888            graphql_client: self.graphql_client.clone(),
15889        }
15890    }
15891    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
15892    ///
15893    /// # Arguments
15894    ///
15895    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
15896    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15897    pub fn engine_volume_opts<'a>(
15898        &self,
15899        name: impl Into<String>,
15900        opts: QueryEngineVolumeOpts<'a>,
15901    ) -> Volume {
15902        let mut query = self.selection.select("engineVolume");
15903        query = query.arg("name", name.into());
15904        if let Some(subdir) = opts.subdir {
15905            query = query.arg("subdir", subdir);
15906        }
15907        Volume {
15908            proc: self.proc.clone(),
15909            selection: query,
15910            graphql_client: self.graphql_client.clone(),
15911        }
15912    }
15913    /// Constructs an SSHFS volume.
15914    ///
15915    /// # Arguments
15916    ///
15917    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
15918    /// * `private_key` - Private key secret used to authenticate to the remote host.
15919    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15920    pub fn sshfs_volume(
15921        &self,
15922        endpoint: impl Into<String>,
15923        private_key: impl IntoID<Id>,
15924    ) -> Volume {
15925        let mut query = self.selection.select("sshfsVolume");
15926        query = query.arg("endpoint", endpoint.into());
15927        query = query.arg_lazy(
15928            "privateKey",
15929            Box::new(move || {
15930                let private_key = private_key.clone();
15931                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15932            }),
15933        );
15934        Volume {
15935            proc: self.proc.clone(),
15936            selection: query,
15937            graphql_client: self.graphql_client.clone(),
15938        }
15939    }
15940    /// Constructs an SSHFS volume.
15941    ///
15942    /// # Arguments
15943    ///
15944    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
15945    /// * `private_key` - Private key secret used to authenticate to the remote host.
15946    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15947    pub fn sshfs_volume_opts<'a>(
15948        &self,
15949        endpoint: impl Into<String>,
15950        private_key: impl IntoID<Id>,
15951        opts: QuerySshfsVolumeOpts<'a>,
15952    ) -> Volume {
15953        let mut query = self.selection.select("sshfsVolume");
15954        query = query.arg("endpoint", endpoint.into());
15955        query = query.arg_lazy(
15956            "privateKey",
15957            Box::new(move || {
15958                let private_key = private_key.clone();
15959                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15960            }),
15961        );
15962        if let Some(known_hosts) = opts.known_hosts {
15963            query = query.arg("knownHosts", known_hosts);
15964        }
15965        if let Some(cache_key) = opts.cache_key {
15966            query = query.arg("cacheKey", cache_key);
15967        }
15968        if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
15969            query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
15970        }
15971        if let Some(experimental_service_host) = opts.experimental_service_host {
15972            query = query.arg("experimentalServiceHost", experimental_service_host);
15973        }
15974        Volume {
15975            proc: self.proc.clone(),
15976            selection: query,
15977            graphql_client: self.graphql_client.clone(),
15978        }
15979    }
15980    /// Creates a new secret.
15981    ///
15982    /// # Arguments
15983    ///
15984    /// * `uri` - The URI of the secret store
15985    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15986    pub fn secret(&self, uri: impl Into<String>) -> Secret {
15987        let mut query = self.selection.select("secret");
15988        query = query.arg("uri", uri.into());
15989        Secret {
15990            proc: self.proc.clone(),
15991            selection: query,
15992            graphql_client: self.graphql_client.clone(),
15993        }
15994    }
15995    /// Creates a new secret.
15996    ///
15997    /// # Arguments
15998    ///
15999    /// * `uri` - The URI of the secret store
16000    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16001    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
16002        let mut query = self.selection.select("secret");
16003        query = query.arg("uri", uri.into());
16004        if let Some(cache_key) = opts.cache_key {
16005            query = query.arg("cacheKey", cache_key);
16006        }
16007        Secret {
16008            proc: self.proc.clone(),
16009            selection: query,
16010            graphql_client: self.graphql_client.clone(),
16011        }
16012    }
16013    /// Sets a secret given a user defined name to its plaintext and returns the secret.
16014    /// The plaintext value is limited to a size of 128000 bytes.
16015    ///
16016    /// # Arguments
16017    ///
16018    /// * `name` - The user defined name for this secret
16019    /// * `plaintext` - The plaintext of the secret
16020    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
16021        let mut query = self.selection.select("setSecret");
16022        query = query.arg("name", name.into());
16023        query = query.arg("plaintext", plaintext.into());
16024        Secret {
16025            proc: self.proc.clone(),
16026            selection: query,
16027            graphql_client: self.graphql_client.clone(),
16028        }
16029    }
16030    /// Queries the host environment.
16031    pub fn host(&self) -> Host {
16032        let query = self.selection.select("host");
16033        Host {
16034            proc: self.proc.clone(),
16035            selection: query,
16036            graphql_client: self.graphql_client.clone(),
16037        }
16038    }
16039    /// Returns a file containing an http remote url content.
16040    ///
16041    /// # Arguments
16042    ///
16043    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
16044    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16045    pub fn http(&self, url: impl Into<String>) -> File {
16046        let mut query = self.selection.select("http");
16047        query = query.arg("url", url.into());
16048        File {
16049            proc: self.proc.clone(),
16050            selection: query,
16051            graphql_client: self.graphql_client.clone(),
16052        }
16053    }
16054    /// Returns a file containing an http remote url content.
16055    ///
16056    /// # Arguments
16057    ///
16058    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
16059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16060    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
16061        let mut query = self.selection.select("http");
16062        query = query.arg("url", url.into());
16063        if let Some(name) = opts.name {
16064            query = query.arg("name", name);
16065        }
16066        if let Some(permissions) = opts.permissions {
16067            query = query.arg("permissions", permissions);
16068        }
16069        if let Some(checksum) = opts.checksum {
16070            query = query.arg("checksum", checksum);
16071        }
16072        if let Some(auth_header) = opts.auth_header {
16073            query = query.arg("authHeader", auth_header);
16074        }
16075        if let Some(experimental_service_host) = opts.experimental_service_host {
16076            query = query.arg("experimentalServiceHost", experimental_service_host);
16077        }
16078        File {
16079            proc: self.proc.clone(),
16080            selection: query,
16081            graphql_client: self.graphql_client.clone(),
16082        }
16083    }
16084    /// The default platform of the engine.
16085    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
16086        let query = self.selection.select("defaultPlatform");
16087        query.execute(self.graphql_client.clone()).await
16088    }
16089    /// Create a new module source instance from a source ref string
16090    ///
16091    /// # Arguments
16092    ///
16093    /// * `ref_string` - The string ref representation of the module source
16094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16095    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
16096        let mut query = self.selection.select("moduleSource");
16097        query = query.arg("refString", ref_string.into());
16098        ModuleSource {
16099            proc: self.proc.clone(),
16100            selection: query,
16101            graphql_client: self.graphql_client.clone(),
16102        }
16103    }
16104    /// Create a new module source instance from a source ref string
16105    ///
16106    /// # Arguments
16107    ///
16108    /// * `ref_string` - The string ref representation of the module source
16109    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16110    pub fn module_source_opts<'a>(
16111        &self,
16112        ref_string: impl Into<String>,
16113        opts: QueryModuleSourceOpts<'a>,
16114    ) -> ModuleSource {
16115        let mut query = self.selection.select("moduleSource");
16116        query = query.arg("refString", ref_string.into());
16117        if let Some(version) = opts.version {
16118            query = query.arg("version", version);
16119        }
16120        if let Some(ref_pin) = opts.ref_pin {
16121            query = query.arg("refPin", ref_pin);
16122        }
16123        if let Some(disable_find_up) = opts.disable_find_up {
16124            query = query.arg("disableFindUp", disable_find_up);
16125        }
16126        if let Some(allow_not_exists) = opts.allow_not_exists {
16127            query = query.arg("allowNotExists", allow_not_exists);
16128        }
16129        if let Some(require_kind) = opts.require_kind {
16130            query = query.arg("requireKind", require_kind);
16131        }
16132        ModuleSource {
16133            proc: self.proc.clone(),
16134            selection: query,
16135            graphql_client: self.graphql_client.clone(),
16136        }
16137    }
16138    /// Create a new module.
16139    pub fn module(&self) -> Module {
16140        let query = self.selection.select("module");
16141        Module {
16142            proc: self.proc.clone(),
16143            selection: query,
16144            graphql_client: self.graphql_client.clone(),
16145        }
16146    }
16147    /// Create a new TypeDef.
16148    pub fn type_def(&self) -> TypeDef {
16149        let query = self.selection.select("typeDef");
16150        TypeDef {
16151            proc: self.proc.clone(),
16152            selection: query,
16153            graphql_client: self.graphql_client.clone(),
16154        }
16155    }
16156    /// Create a code generation result, given a directory containing the generated code.
16157    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
16158        let mut query = self.selection.select("generatedCode");
16159        query = query.arg_lazy(
16160            "code",
16161            Box::new(move || {
16162                let code = code.clone();
16163                Box::pin(async move { code.into_id().await.unwrap().quote() })
16164            }),
16165        );
16166        GeneratedCode {
16167            proc: self.proc.clone(),
16168            selection: query,
16169            graphql_client: self.graphql_client.clone(),
16170        }
16171    }
16172    /// Creates a function.
16173    ///
16174    /// # Arguments
16175    ///
16176    /// * `name` - Name of the function, in its original format from the implementation language.
16177    /// * `return_type` - Return type of the function.
16178    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
16179        let mut query = self.selection.select("function");
16180        query = query.arg("name", name.into());
16181        query = query.arg_lazy(
16182            "returnType",
16183            Box::new(move || {
16184                let return_type = return_type.clone();
16185                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
16186            }),
16187        );
16188        Function {
16189            proc: self.proc.clone(),
16190            selection: query,
16191            graphql_client: self.graphql_client.clone(),
16192        }
16193    }
16194    /// Creates source map metadata.
16195    ///
16196    /// # Arguments
16197    ///
16198    /// * `filename` - The filename from the module source.
16199    /// * `line` - The line number within the filename.
16200    /// * `column` - The column number within the line.
16201    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
16202        let mut query = self.selection.select("sourceMap");
16203        query = query.arg("filename", filename.into());
16204        query = query.arg("line", line);
16205        query = query.arg("column", column);
16206        SourceMap {
16207            proc: self.proc.clone(),
16208            selection: query,
16209            graphql_client: self.graphql_client.clone(),
16210        }
16211    }
16212    /// The module currently being served in the session, if any.
16213    pub fn current_module(&self) -> CurrentModule {
16214        let query = self.selection.select("currentModule");
16215        CurrentModule {
16216            proc: self.proc.clone(),
16217            selection: query,
16218            graphql_client: self.graphql_client.clone(),
16219        }
16220    }
16221    /// The TypeDef representations of the objects currently being served in the session.
16222    ///
16223    /// # Arguments
16224    ///
16225    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16226    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
16227        let query = self.selection.select("currentTypeDefs");
16228        let query = query.select("id");
16229        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16230        Ok(ids
16231            .into_iter()
16232            .map(|id| TypeDef {
16233                proc: self.proc.clone(),
16234                selection: crate::querybuilder::query()
16235                    .select("node")
16236                    .arg("id", &id.0)
16237                    .inline_fragment("TypeDef"),
16238                graphql_client: self.graphql_client.clone(),
16239            })
16240            .collect())
16241    }
16242    /// The TypeDef representations of the objects currently being served in the session.
16243    ///
16244    /// # Arguments
16245    ///
16246    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16247    pub async fn current_type_defs_opts(
16248        &self,
16249        opts: QueryCurrentTypeDefsOpts,
16250    ) -> Result<Vec<TypeDef>, DaggerError> {
16251        let mut query = self.selection.select("currentTypeDefs");
16252        if let Some(return_all_types) = opts.return_all_types {
16253            query = query.arg("returnAllTypes", return_all_types);
16254        }
16255        if let Some(hide_core) = opts.hide_core {
16256            query = query.arg("hideCore", hide_core);
16257        }
16258        let query = query.select("id");
16259        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16260        Ok(ids
16261            .into_iter()
16262            .map(|id| TypeDef {
16263                proc: self.proc.clone(),
16264                selection: crate::querybuilder::query()
16265                    .select("node")
16266                    .arg("id", &id.0)
16267                    .inline_fragment("TypeDef"),
16268                graphql_client: self.graphql_client.clone(),
16269            })
16270            .collect())
16271    }
16272    /// The FunctionCall context that the SDK caller is currently executing in.
16273    /// If the caller is not currently executing in a function, this will return an error.
16274    pub fn current_function_call(&self) -> FunctionCall {
16275        let query = self.selection.select("currentFunctionCall");
16276        FunctionCall {
16277            proc: self.proc.clone(),
16278            selection: query,
16279            graphql_client: self.graphql_client.clone(),
16280        }
16281    }
16282    /// Load the module at the given address and serve its API in the current session.
16283    /// 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.
16284    ///
16285    /// # Arguments
16286    ///
16287    /// * `address` - A module address, or an explicit path into the caller's workspace.
16288    ///
16289    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16290    ///
16291    /// Installed module names are not accepted.
16292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16293    pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
16294        let mut query = self.selection.select("serveModule");
16295        query = query.arg("address", address.into());
16296        query.execute(self.graphql_client.clone()).await
16297    }
16298    /// Load the module at the given address and serve its API in the current session.
16299    /// 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.
16300    ///
16301    /// # Arguments
16302    ///
16303    /// * `address` - A module address, or an explicit path into the caller's workspace.
16304    ///
16305    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16306    ///
16307    /// Installed module names are not accepted.
16308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16309    pub async fn serve_module_opts<'a>(
16310        &self,
16311        address: impl Into<String>,
16312        opts: QueryServeModuleOpts<'a>,
16313    ) -> Result<Void, DaggerError> {
16314        let mut query = self.selection.select("serveModule");
16315        query = query.arg("address", address.into());
16316        if let Some(ref_pin) = opts.ref_pin {
16317            query = query.arg("refPin", ref_pin);
16318        }
16319        query.execute(self.graphql_client.clone()).await
16320    }
16321    /// 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).
16322    pub fn current_node(&self) -> NodeClient {
16323        let query = self.selection.select("currentNode");
16324        NodeClient {
16325            proc: self.proc.clone(),
16326            selection: query,
16327            graphql_client: self.graphql_client.clone(),
16328        }
16329    }
16330    /// Create a new error.
16331    ///
16332    /// # Arguments
16333    ///
16334    /// * `message` - A brief description of the error.
16335    pub fn error(&self, message: impl Into<String>) -> Error {
16336        let mut query = self.selection.select("error");
16337        query = query.arg("message", message.into());
16338        Error {
16339            proc: self.proc.clone(),
16340            selection: query,
16341            graphql_client: self.graphql_client.clone(),
16342        }
16343    }
16344    /// The Dagger engine container configuration and state
16345    pub fn engine(&self) -> Engine {
16346        let query = self.selection.select("engine");
16347        Engine {
16348            proc: self.proc.clone(),
16349            selection: query,
16350            graphql_client: self.graphql_client.clone(),
16351        }
16352    }
16353    /// Dagger Cloud configuration and state
16354    pub fn cloud(&self) -> Cloud {
16355        let query = self.selection.select("cloud");
16356        Cloud {
16357            proc: self.proc.clone(),
16358            selection: query,
16359            graphql_client: self.graphql_client.clone(),
16360        }
16361    }
16362    /// Initialize a new LLM conversation.
16363    ///
16364    /// # Arguments
16365    ///
16366    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16367    pub fn llm(&self) -> Llm {
16368        let query = self.selection.select("llm");
16369        Llm {
16370            proc: self.proc.clone(),
16371            selection: query,
16372            graphql_client: self.graphql_client.clone(),
16373        }
16374    }
16375    /// Initialize a new LLM conversation.
16376    ///
16377    /// # Arguments
16378    ///
16379    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16380    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
16381        let mut query = self.selection.select("llm");
16382        if let Some(model) = opts.model {
16383            query = query.arg("model", model);
16384        }
16385        if let Some(provider) = opts.provider {
16386            query = query.arg("provider", provider);
16387        }
16388        Llm {
16389            proc: self.proc.clone(),
16390            selection: query,
16391            graphql_client: self.graphql_client.clone(),
16392        }
16393    }
16394    /// Start an empty run of text and media content, independent of any conversation.
16395    /// Add blocks with withText, withFile, and withData. A function exposed as an LLM tool can return the content to give the model text and media as the tool's result, e.g. a caption and a screenshot for the model to look at.
16396    pub fn llm_content(&self) -> LlmContent {
16397        let query = self.selection.select("llmContent");
16398        LlmContent {
16399            proc: self.proc.clone(),
16400            selection: query,
16401            graphql_client: self.graphql_client.clone(),
16402        }
16403    }
16404    /// Initialize a JSON value
16405    pub fn json(&self) -> JsonValue {
16406        let query = self.selection.select("json");
16407        JsonValue {
16408            proc: self.proc.clone(),
16409            selection: query,
16410            graphql_client: self.graphql_client.clone(),
16411        }
16412    }
16413    /// Load a GraphQL introspection schema for merging.
16414    ///
16415    /// # Arguments
16416    ///
16417    /// * `json` - The introspection schema JSON to load.
16418    pub fn schema(&self, json: Json) -> Schema {
16419        let mut query = self.selection.select("schema");
16420        query = query.arg("json", json);
16421        Schema {
16422            proc: self.proc.clone(),
16423            selection: query,
16424            graphql_client: self.graphql_client.clone(),
16425        }
16426    }
16427    /// Initialize an environment file
16428    ///
16429    /// # Arguments
16430    ///
16431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16432    pub fn env_file(&self) -> EnvFile {
16433        let query = self.selection.select("envFile");
16434        EnvFile {
16435            proc: self.proc.clone(),
16436            selection: query,
16437            graphql_client: self.graphql_client.clone(),
16438        }
16439    }
16440    /// Initialize an environment file
16441    ///
16442    /// # Arguments
16443    ///
16444    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16445    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
16446        let mut query = self.selection.select("envFile");
16447        if let Some(expand) = opts.expand {
16448            query = query.arg("expand", expand);
16449        }
16450        EnvFile {
16451            proc: self.proc.clone(),
16452            selection: query,
16453            graphql_client: self.graphql_client.clone(),
16454        }
16455    }
16456    /// Resolve external references only.
16457    pub fn address(&self, value: impl Into<String>) -> Address {
16458        let mut query = self.selection.select("address");
16459        query = query.arg("value", value.into());
16460        Address {
16461            proc: self.proc.clone(),
16462            selection: query,
16463            graphql_client: self.graphql_client.clone(),
16464        }
16465    }
16466    /// Detect and return the current workspace.
16467    pub fn current_workspace(&self) -> Workspace {
16468        let query = self.selection.select("currentWorkspace");
16469        Workspace {
16470            proc: self.proc.clone(),
16471            selection: query,
16472            graphql_client: self.graphql_client.clone(),
16473        }
16474    }
16475}
16476impl Node for Query {
16477    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16478        let query = self.selection.select("id");
16479        let graphql_client = self.graphql_client.clone();
16480        async move { query.execute(graphql_client).await }
16481    }
16482}
16483#[derive(Clone)]
16484pub struct RemoteGitMirror {
16485    pub proc: Option<Arc<DaggerSessionProc>>,
16486    pub selection: Selection,
16487    pub graphql_client: DynGraphQLClient,
16488}
16489impl IntoID<Id> for RemoteGitMirror {
16490    fn into_id(
16491        self,
16492    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16493        Box::pin(async move { self.id().await })
16494    }
16495}
16496impl Loadable for RemoteGitMirror {
16497    fn graphql_type() -> &'static str {
16498        "RemoteGitMirror"
16499    }
16500    fn from_query(
16501        proc: Option<Arc<DaggerSessionProc>>,
16502        selection: Selection,
16503        graphql_client: DynGraphQLClient,
16504    ) -> Self {
16505        Self {
16506            proc,
16507            selection,
16508            graphql_client,
16509        }
16510    }
16511}
16512impl RemoteGitMirror {
16513    /// A unique identifier for this RemoteGitMirror.
16514    pub async fn id(&self) -> Result<Id, DaggerError> {
16515        let query = self.selection.select("id");
16516        query.execute(self.graphql_client.clone()).await
16517    }
16518}
16519impl Node for RemoteGitMirror {
16520    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16521        let query = self.selection.select("id");
16522        let graphql_client = self.graphql_client.clone();
16523        async move { query.execute(graphql_client).await }
16524    }
16525}
16526#[derive(Clone)]
16527pub struct SdkConfig {
16528    pub proc: Option<Arc<DaggerSessionProc>>,
16529    pub selection: Selection,
16530    pub graphql_client: DynGraphQLClient,
16531}
16532impl IntoID<Id> for SdkConfig {
16533    fn into_id(
16534        self,
16535    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16536        Box::pin(async move { self.id().await })
16537    }
16538}
16539impl Loadable for SdkConfig {
16540    fn graphql_type() -> &'static str {
16541        "SDKConfig"
16542    }
16543    fn from_query(
16544        proc: Option<Arc<DaggerSessionProc>>,
16545        selection: Selection,
16546        graphql_client: DynGraphQLClient,
16547    ) -> Self {
16548        Self {
16549            proc,
16550            selection,
16551            graphql_client,
16552        }
16553    }
16554}
16555impl SdkConfig {
16556    /// A unique identifier for this SDKConfig.
16557    pub async fn id(&self) -> Result<Id, DaggerError> {
16558        let query = self.selection.select("id");
16559        query.execute(self.graphql_client.clone()).await
16560    }
16561    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
16562    pub async fn source(&self) -> Result<String, DaggerError> {
16563        let query = self.selection.select("source");
16564        query.execute(self.graphql_client.clone()).await
16565    }
16566    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
16567    pub async fn debug(&self) -> Result<bool, DaggerError> {
16568        let query = self.selection.select("debug");
16569        query.execute(self.graphql_client.clone()).await
16570    }
16571}
16572impl Node for SdkConfig {
16573    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16574        let query = self.selection.select("id");
16575        let graphql_client = self.graphql_client.clone();
16576        async move { query.execute(graphql_client).await }
16577    }
16578}
16579#[derive(Clone)]
16580pub struct ScalarTypeDef {
16581    pub proc: Option<Arc<DaggerSessionProc>>,
16582    pub selection: Selection,
16583    pub graphql_client: DynGraphQLClient,
16584}
16585impl IntoID<Id> for ScalarTypeDef {
16586    fn into_id(
16587        self,
16588    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16589        Box::pin(async move { self.id().await })
16590    }
16591}
16592impl Loadable for ScalarTypeDef {
16593    fn graphql_type() -> &'static str {
16594        "ScalarTypeDef"
16595    }
16596    fn from_query(
16597        proc: Option<Arc<DaggerSessionProc>>,
16598        selection: Selection,
16599        graphql_client: DynGraphQLClient,
16600    ) -> Self {
16601        Self {
16602            proc,
16603            selection,
16604            graphql_client,
16605        }
16606    }
16607}
16608impl ScalarTypeDef {
16609    /// A unique identifier for this ScalarTypeDef.
16610    pub async fn id(&self) -> Result<Id, DaggerError> {
16611        let query = self.selection.select("id");
16612        query.execute(self.graphql_client.clone()).await
16613    }
16614    /// The name of the scalar.
16615    pub async fn name(&self) -> Result<String, DaggerError> {
16616        let query = self.selection.select("name");
16617        query.execute(self.graphql_client.clone()).await
16618    }
16619    /// A doc string for the scalar, if any.
16620    pub async fn description(&self) -> Result<String, DaggerError> {
16621        let query = self.selection.select("description");
16622        query.execute(self.graphql_client.clone()).await
16623    }
16624    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
16625    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
16626        let query = self.selection.select("sourceModuleName");
16627        query.execute(self.graphql_client.clone()).await
16628    }
16629}
16630impl Node for ScalarTypeDef {
16631    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16632        let query = self.selection.select("id");
16633        let graphql_client = self.graphql_client.clone();
16634        async move { query.execute(graphql_client).await }
16635    }
16636}
16637#[derive(Clone)]
16638pub struct Schema {
16639    pub proc: Option<Arc<DaggerSessionProc>>,
16640    pub selection: Selection,
16641    pub graphql_client: DynGraphQLClient,
16642}
16643impl IntoID<Id> for Schema {
16644    fn into_id(
16645        self,
16646    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16647        Box::pin(async move { self.id().await })
16648    }
16649}
16650impl Loadable for Schema {
16651    fn graphql_type() -> &'static str {
16652        "Schema"
16653    }
16654    fn from_query(
16655        proc: Option<Arc<DaggerSessionProc>>,
16656        selection: Selection,
16657        graphql_client: DynGraphQLClient,
16658    ) -> Self {
16659        Self {
16660            proc,
16661            selection,
16662            graphql_client,
16663        }
16664    }
16665}
16666impl Schema {
16667    /// A unique identifier for this Schema.
16668    pub async fn id(&self) -> Result<Id, DaggerError> {
16669        let query = self.selection.select("id");
16670        query.execute(self.graphql_client.clone()).await
16671    }
16672    /// Serialize the schema back to introspection JSON.
16673    pub async fn contents(&self) -> Result<Json, DaggerError> {
16674        let query = self.selection.select("contents");
16675        query.execute(self.graphql_client.clone()).await
16676    }
16677    /// Merge a module's introspection-shaped type definitions into the schema, returning the combined schema.
16678    ///
16679    /// # Arguments
16680    ///
16681    /// * `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.
16682    /// * `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.
16683    pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
16684        let mut query = self.selection.select("merge");
16685        query = query.arg("moduleTypes", module_types);
16686        query = query.arg("moduleName", module_name.into());
16687        Schema {
16688            proc: self.proc.clone(),
16689            selection: query,
16690            graphql_client: self.graphql_client.clone(),
16691        }
16692    }
16693}
16694impl Node for Schema {
16695    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16696        let query = self.selection.select("id");
16697        let graphql_client = self.graphql_client.clone();
16698        async move { query.execute(graphql_client).await }
16699    }
16700}
16701#[derive(Clone)]
16702pub struct SearchResult {
16703    pub proc: Option<Arc<DaggerSessionProc>>,
16704    pub selection: Selection,
16705    pub graphql_client: DynGraphQLClient,
16706}
16707impl IntoID<Id> for SearchResult {
16708    fn into_id(
16709        self,
16710    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16711        Box::pin(async move { self.id().await })
16712    }
16713}
16714impl Loadable for SearchResult {
16715    fn graphql_type() -> &'static str {
16716        "SearchResult"
16717    }
16718    fn from_query(
16719        proc: Option<Arc<DaggerSessionProc>>,
16720        selection: Selection,
16721        graphql_client: DynGraphQLClient,
16722    ) -> Self {
16723        Self {
16724            proc,
16725            selection,
16726            graphql_client,
16727        }
16728    }
16729}
16730impl SearchResult {
16731    /// A unique identifier for this SearchResult.
16732    pub async fn id(&self) -> Result<Id, DaggerError> {
16733        let query = self.selection.select("id");
16734        query.execute(self.graphql_client.clone()).await
16735    }
16736    /// The path to the file that matched.
16737    pub async fn file_path(&self) -> Result<String, DaggerError> {
16738        let query = self.selection.select("filePath");
16739        query.execute(self.graphql_client.clone()).await
16740    }
16741    /// The first line that matched.
16742    pub async fn line_number(&self) -> Result<isize, DaggerError> {
16743        let query = self.selection.select("lineNumber");
16744        query.execute(self.graphql_client.clone()).await
16745    }
16746    /// The byte offset of this line within the file.
16747    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
16748        let query = self.selection.select("absoluteOffset");
16749        query.execute(self.graphql_client.clone()).await
16750    }
16751    /// The line content that matched.
16752    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
16753        let query = self.selection.select("matchedLines");
16754        query.execute(self.graphql_client.clone()).await
16755    }
16756    /// Sub-match positions and content within the matched lines.
16757    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
16758        let query = self.selection.select("submatches");
16759        let query = query.select("id");
16760        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16761        Ok(ids
16762            .into_iter()
16763            .map(|id| SearchSubmatch {
16764                proc: self.proc.clone(),
16765                selection: crate::querybuilder::query()
16766                    .select("node")
16767                    .arg("id", &id.0)
16768                    .inline_fragment("SearchSubmatch"),
16769                graphql_client: self.graphql_client.clone(),
16770            })
16771            .collect())
16772    }
16773}
16774impl Node for SearchResult {
16775    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16776        let query = self.selection.select("id");
16777        let graphql_client = self.graphql_client.clone();
16778        async move { query.execute(graphql_client).await }
16779    }
16780}
16781#[derive(Clone)]
16782pub struct SearchSubmatch {
16783    pub proc: Option<Arc<DaggerSessionProc>>,
16784    pub selection: Selection,
16785    pub graphql_client: DynGraphQLClient,
16786}
16787impl IntoID<Id> for SearchSubmatch {
16788    fn into_id(
16789        self,
16790    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16791        Box::pin(async move { self.id().await })
16792    }
16793}
16794impl Loadable for SearchSubmatch {
16795    fn graphql_type() -> &'static str {
16796        "SearchSubmatch"
16797    }
16798    fn from_query(
16799        proc: Option<Arc<DaggerSessionProc>>,
16800        selection: Selection,
16801        graphql_client: DynGraphQLClient,
16802    ) -> Self {
16803        Self {
16804            proc,
16805            selection,
16806            graphql_client,
16807        }
16808    }
16809}
16810impl SearchSubmatch {
16811    /// A unique identifier for this SearchSubmatch.
16812    pub async fn id(&self) -> Result<Id, DaggerError> {
16813        let query = self.selection.select("id");
16814        query.execute(self.graphql_client.clone()).await
16815    }
16816    /// The matched text.
16817    pub async fn text(&self) -> Result<String, DaggerError> {
16818        let query = self.selection.select("text");
16819        query.execute(self.graphql_client.clone()).await
16820    }
16821    /// The match's start offset within the matched lines.
16822    pub async fn start(&self) -> Result<isize, DaggerError> {
16823        let query = self.selection.select("start");
16824        query.execute(self.graphql_client.clone()).await
16825    }
16826    /// The match's end offset within the matched lines.
16827    pub async fn end(&self) -> Result<isize, DaggerError> {
16828        let query = self.selection.select("end");
16829        query.execute(self.graphql_client.clone()).await
16830    }
16831}
16832impl Node for SearchSubmatch {
16833    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16834        let query = self.selection.select("id");
16835        let graphql_client = self.graphql_client.clone();
16836        async move { query.execute(graphql_client).await }
16837    }
16838}
16839#[derive(Clone)]
16840pub struct Secret {
16841    pub proc: Option<Arc<DaggerSessionProc>>,
16842    pub selection: Selection,
16843    pub graphql_client: DynGraphQLClient,
16844}
16845impl IntoID<Id> for Secret {
16846    fn into_id(
16847        self,
16848    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16849        Box::pin(async move { self.id().await })
16850    }
16851}
16852impl Loadable for Secret {
16853    fn graphql_type() -> &'static str {
16854        "Secret"
16855    }
16856    fn from_query(
16857        proc: Option<Arc<DaggerSessionProc>>,
16858        selection: Selection,
16859        graphql_client: DynGraphQLClient,
16860    ) -> Self {
16861        Self {
16862            proc,
16863            selection,
16864            graphql_client,
16865        }
16866    }
16867}
16868impl Secret {
16869    /// A unique identifier for this Secret.
16870    pub async fn id(&self) -> Result<Id, DaggerError> {
16871        let query = self.selection.select("id");
16872        query.execute(self.graphql_client.clone()).await
16873    }
16874    /// The name of this secret.
16875    pub async fn name(&self) -> Result<String, DaggerError> {
16876        let query = self.selection.select("name");
16877        query.execute(self.graphql_client.clone()).await
16878    }
16879    /// The URI of this secret.
16880    pub async fn uri(&self) -> Result<String, DaggerError> {
16881        let query = self.selection.select("uri");
16882        query.execute(self.graphql_client.clone()).await
16883    }
16884    /// The value of this secret.
16885    pub async fn plaintext(&self) -> Result<String, DaggerError> {
16886        let query = self.selection.select("plaintext");
16887        query.execute(self.graphql_client.clone()).await
16888    }
16889}
16890impl Node for Secret {
16891    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16892        let query = self.selection.select("id");
16893        let graphql_client = self.graphql_client.clone();
16894        async move { query.execute(graphql_client).await }
16895    }
16896}
16897#[derive(Clone)]
16898pub struct Service {
16899    pub proc: Option<Arc<DaggerSessionProc>>,
16900    pub selection: Selection,
16901    pub graphql_client: DynGraphQLClient,
16902}
16903#[derive(Builder, Debug, PartialEq)]
16904pub struct ServicePortsOpts {
16905    /// Return only container ports declared before startup. Other service types return an empty list.
16906    #[builder(setter(into, strip_option), default)]
16907    pub declared: Option<bool>,
16908}
16909#[derive(Builder, Debug, PartialEq)]
16910pub struct ServiceEndpointOpts<'a> {
16911    /// The exposed port number for the endpoint
16912    #[builder(setter(into, strip_option), default)]
16913    pub port: Option<isize>,
16914    /// Return a URL with the given scheme, eg. http for http://
16915    #[builder(setter(into, strip_option), default)]
16916    pub scheme: Option<&'a str>,
16917}
16918#[derive(Builder, Debug, PartialEq)]
16919pub struct ServiceUpOpts {
16920    /// List of frontend/backend port mappings to forward.
16921    /// Frontend is the port accepting traffic on the host, backend is the service port.
16922    #[builder(setter(into, strip_option), default)]
16923    pub ports: Option<Vec<PortForward>>,
16924    /// Bind each tunnel port to a random port on the host.
16925    #[builder(setter(into, strip_option), default)]
16926    pub random: Option<bool>,
16927}
16928#[derive(Builder, Debug, PartialEq)]
16929pub struct ServiceStopOpts {
16930    /// Immediately kill the service without waiting for a graceful exit
16931    #[builder(setter(into, strip_option), default)]
16932    pub kill: Option<bool>,
16933}
16934#[derive(Builder, Debug, PartialEq)]
16935pub struct ServiceTerminalOpts<'a> {
16936    #[builder(setter(into, strip_option), default)]
16937    pub cmd: Option<Vec<&'a str>>,
16938}
16939impl IntoID<Id> for Service {
16940    fn into_id(
16941        self,
16942    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16943        Box::pin(async move { self.id().await })
16944    }
16945}
16946impl Loadable for Service {
16947    fn graphql_type() -> &'static str {
16948        "Service"
16949    }
16950    fn from_query(
16951        proc: Option<Arc<DaggerSessionProc>>,
16952        selection: Selection,
16953        graphql_client: DynGraphQLClient,
16954    ) -> Self {
16955        Self {
16956            proc,
16957            selection,
16958            graphql_client,
16959        }
16960    }
16961}
16962impl Service {
16963    /// A unique identifier for this Service.
16964    pub async fn id(&self) -> Result<Id, DaggerError> {
16965        let query = self.selection.select("id");
16966        query.execute(self.graphql_client.clone()).await
16967    }
16968    /// Forces evaluation of the pipeline in the engine.
16969    pub async fn sync(&self) -> Result<Service, DaggerError> {
16970        let query = self.selection.select("sync");
16971        let id: Id = query.execute(self.graphql_client.clone()).await?;
16972        Ok(Service {
16973            proc: self.proc.clone(),
16974            selection: query
16975                .root()
16976                .select("node")
16977                .arg("id", &id.0)
16978                .inline_fragment("Service"),
16979            graphql_client: self.graphql_client.clone(),
16980        })
16981    }
16982    /// Retrieves a hostname which can be used by clients to reach this container.
16983    pub async fn hostname(&self) -> Result<String, DaggerError> {
16984        let query = self.selection.select("hostname");
16985        query.execute(self.graphql_client.clone()).await
16986    }
16987    /// Configures a hostname which can be used by clients within the session to reach this container.
16988    ///
16989    /// # Arguments
16990    ///
16991    /// * `hostname` - The hostname to use.
16992    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
16993        let mut query = self.selection.select("withHostname");
16994        query = query.arg("hostname", hostname.into());
16995        Service {
16996            proc: self.proc.clone(),
16997            selection: query,
16998            graphql_client: self.graphql_client.clone(),
16999        }
17000    }
17001    /// Retrieves the list of ports provided by the service.
17002    ///
17003    /// # Arguments
17004    ///
17005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17006    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
17007        let query = self.selection.select("ports");
17008        let query = query.select("id");
17009        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17010        Ok(ids
17011            .into_iter()
17012            .map(|id| Port {
17013                proc: self.proc.clone(),
17014                selection: crate::querybuilder::query()
17015                    .select("node")
17016                    .arg("id", &id.0)
17017                    .inline_fragment("Port"),
17018                graphql_client: self.graphql_client.clone(),
17019            })
17020            .collect())
17021    }
17022    /// Retrieves the list of ports provided by the service.
17023    ///
17024    /// # Arguments
17025    ///
17026    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17027    pub async fn ports_opts(&self, opts: ServicePortsOpts) -> Result<Vec<Port>, DaggerError> {
17028        let mut query = self.selection.select("ports");
17029        if let Some(declared) = opts.declared {
17030            query = query.arg("declared", declared);
17031        }
17032        let query = query.select("id");
17033        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17034        Ok(ids
17035            .into_iter()
17036            .map(|id| Port {
17037                proc: self.proc.clone(),
17038                selection: crate::querybuilder::query()
17039                    .select("node")
17040                    .arg("id", &id.0)
17041                    .inline_fragment("Port"),
17042                graphql_client: self.graphql_client.clone(),
17043            })
17044            .collect())
17045    }
17046    /// Retrieves an endpoint that clients can use to reach this container.
17047    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17048    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17049    ///
17050    /// # Arguments
17051    ///
17052    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17053    pub async fn endpoint(&self) -> Result<String, DaggerError> {
17054        let query = self.selection.select("endpoint");
17055        query.execute(self.graphql_client.clone()).await
17056    }
17057    /// Retrieves an endpoint that clients can use to reach this container.
17058    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17059    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17060    ///
17061    /// # Arguments
17062    ///
17063    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17064    pub async fn endpoint_opts<'a>(
17065        &self,
17066        opts: ServiceEndpointOpts<'a>,
17067    ) -> Result<String, DaggerError> {
17068        let mut query = self.selection.select("endpoint");
17069        if let Some(port) = opts.port {
17070            query = query.arg("port", port);
17071        }
17072        if let Some(scheme) = opts.scheme {
17073            query = query.arg("scheme", scheme);
17074        }
17075        query.execute(self.graphql_client.clone()).await
17076    }
17077    /// Start the service and wait for its health checks to succeed.
17078    /// Services bound to a Container do not need to be manually started.
17079    pub async fn start(&self) -> Result<Service, DaggerError> {
17080        let query = self.selection.select("start");
17081        let id: Id = query.execute(self.graphql_client.clone()).await?;
17082        Ok(Service {
17083            proc: self.proc.clone(),
17084            selection: query
17085                .root()
17086                .select("node")
17087                .arg("id", &id.0)
17088                .inline_fragment("Service"),
17089            graphql_client: self.graphql_client.clone(),
17090        })
17091    }
17092    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17093    ///
17094    /// # Arguments
17095    ///
17096    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17097    pub async fn up(&self) -> Result<Void, DaggerError> {
17098        let query = self.selection.select("up");
17099        query.execute(self.graphql_client.clone()).await
17100    }
17101    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17102    ///
17103    /// # Arguments
17104    ///
17105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17106    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
17107        let mut query = self.selection.select("up");
17108        if let Some(ports) = opts.ports {
17109            query = query.arg("ports", ports);
17110        }
17111        if let Some(random) = opts.random {
17112            query = query.arg("random", random);
17113        }
17114        query.execute(self.graphql_client.clone()).await
17115    }
17116    /// Stop the service.
17117    ///
17118    /// # Arguments
17119    ///
17120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17121    pub async fn stop(&self) -> Result<Service, DaggerError> {
17122        let query = self.selection.select("stop");
17123        let id: Id = query.execute(self.graphql_client.clone()).await?;
17124        Ok(Service {
17125            proc: self.proc.clone(),
17126            selection: query
17127                .root()
17128                .select("node")
17129                .arg("id", &id.0)
17130                .inline_fragment("Service"),
17131            graphql_client: self.graphql_client.clone(),
17132        })
17133    }
17134    /// Stop the service.
17135    ///
17136    /// # Arguments
17137    ///
17138    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17139    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
17140        let mut query = self.selection.select("stop");
17141        if let Some(kill) = opts.kill {
17142            query = query.arg("kill", kill);
17143        }
17144        let id: Id = query.execute(self.graphql_client.clone()).await?;
17145        Ok(Service {
17146            proc: self.proc.clone(),
17147            selection: query
17148                .root()
17149                .select("node")
17150                .arg("id", &id.0)
17151                .inline_fragment("Service"),
17152            graphql_client: self.graphql_client.clone(),
17153        })
17154    }
17155    ///
17156    /// # Arguments
17157    ///
17158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17159    pub fn terminal(&self) -> Service {
17160        let query = self.selection.select("terminal");
17161        Service {
17162            proc: self.proc.clone(),
17163            selection: query,
17164            graphql_client: self.graphql_client.clone(),
17165        }
17166    }
17167    ///
17168    /// # Arguments
17169    ///
17170    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17171    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
17172        let mut query = self.selection.select("terminal");
17173        if let Some(cmd) = opts.cmd {
17174            query = query.arg("cmd", cmd);
17175        }
17176        Service {
17177            proc: self.proc.clone(),
17178            selection: query,
17179            graphql_client: self.graphql_client.clone(),
17180        }
17181    }
17182}
17183impl Node for Service {
17184    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17185        let query = self.selection.select("id");
17186        let graphql_client = self.graphql_client.clone();
17187        async move { query.execute(graphql_client).await }
17188    }
17189}
17190impl Syncer for Service {
17191    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17192        let query = self.selection.select("id");
17193        let graphql_client = self.graphql_client.clone();
17194        async move { query.execute(graphql_client).await }
17195    }
17196    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17197        let query = self.selection.select("sync");
17198        let proc = self.proc.clone();
17199        let graphql_client = self.graphql_client.clone();
17200        async move {
17201            let id: Id = query.execute(graphql_client.clone()).await?;
17202            Ok(Self {
17203                proc,
17204                selection: query
17205                    .root()
17206                    .select("node")
17207                    .arg("id", &id.0)
17208                    .inline_fragment("Service"),
17209                graphql_client,
17210            })
17211        }
17212    }
17213}
17214#[derive(Clone)]
17215pub struct Socket {
17216    pub proc: Option<Arc<DaggerSessionProc>>,
17217    pub selection: Selection,
17218    pub graphql_client: DynGraphQLClient,
17219}
17220impl IntoID<Id> for Socket {
17221    fn into_id(
17222        self,
17223    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17224        Box::pin(async move { self.id().await })
17225    }
17226}
17227impl Loadable for Socket {
17228    fn graphql_type() -> &'static str {
17229        "Socket"
17230    }
17231    fn from_query(
17232        proc: Option<Arc<DaggerSessionProc>>,
17233        selection: Selection,
17234        graphql_client: DynGraphQLClient,
17235    ) -> Self {
17236        Self {
17237            proc,
17238            selection,
17239            graphql_client,
17240        }
17241    }
17242}
17243impl Socket {
17244    /// A unique identifier for this Socket.
17245    pub async fn id(&self) -> Result<Id, DaggerError> {
17246        let query = self.selection.select("id");
17247        query.execute(self.graphql_client.clone()).await
17248    }
17249}
17250impl Node for Socket {
17251    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17252        let query = self.selection.select("id");
17253        let graphql_client = self.graphql_client.clone();
17254        async move { query.execute(graphql_client).await }
17255    }
17256}
17257#[derive(Clone)]
17258pub struct SourceMap {
17259    pub proc: Option<Arc<DaggerSessionProc>>,
17260    pub selection: Selection,
17261    pub graphql_client: DynGraphQLClient,
17262}
17263impl IntoID<Id> for SourceMap {
17264    fn into_id(
17265        self,
17266    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17267        Box::pin(async move { self.id().await })
17268    }
17269}
17270impl Loadable for SourceMap {
17271    fn graphql_type() -> &'static str {
17272        "SourceMap"
17273    }
17274    fn from_query(
17275        proc: Option<Arc<DaggerSessionProc>>,
17276        selection: Selection,
17277        graphql_client: DynGraphQLClient,
17278    ) -> Self {
17279        Self {
17280            proc,
17281            selection,
17282            graphql_client,
17283        }
17284    }
17285}
17286impl SourceMap {
17287    /// A unique identifier for this SourceMap.
17288    pub async fn id(&self) -> Result<Id, DaggerError> {
17289        let query = self.selection.select("id");
17290        query.execute(self.graphql_client.clone()).await
17291    }
17292    /// The module dependency this was declared in.
17293    pub async fn module(&self) -> Result<String, DaggerError> {
17294        let query = self.selection.select("module");
17295        query.execute(self.graphql_client.clone()).await
17296    }
17297    /// The filename from the module source.
17298    pub async fn filename(&self) -> Result<String, DaggerError> {
17299        let query = self.selection.select("filename");
17300        query.execute(self.graphql_client.clone()).await
17301    }
17302    /// The line number within the filename.
17303    pub async fn line(&self) -> Result<isize, DaggerError> {
17304        let query = self.selection.select("line");
17305        query.execute(self.graphql_client.clone()).await
17306    }
17307    /// The column number within the line.
17308    pub async fn column(&self) -> Result<isize, DaggerError> {
17309        let query = self.selection.select("column");
17310        query.execute(self.graphql_client.clone()).await
17311    }
17312    /// The URL to the file, if any. This can be used to link to the source map in the browser.
17313    pub async fn url(&self) -> Result<String, DaggerError> {
17314        let query = self.selection.select("url");
17315        query.execute(self.graphql_client.clone()).await
17316    }
17317}
17318impl Node for SourceMap {
17319    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17320        let query = self.selection.select("id");
17321        let graphql_client = self.graphql_client.clone();
17322        async move { query.execute(graphql_client).await }
17323    }
17324}
17325#[derive(Clone)]
17326pub struct Stat {
17327    pub proc: Option<Arc<DaggerSessionProc>>,
17328    pub selection: Selection,
17329    pub graphql_client: DynGraphQLClient,
17330}
17331impl IntoID<Id> for Stat {
17332    fn into_id(
17333        self,
17334    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17335        Box::pin(async move { self.id().await })
17336    }
17337}
17338impl Loadable for Stat {
17339    fn graphql_type() -> &'static str {
17340        "Stat"
17341    }
17342    fn from_query(
17343        proc: Option<Arc<DaggerSessionProc>>,
17344        selection: Selection,
17345        graphql_client: DynGraphQLClient,
17346    ) -> Self {
17347        Self {
17348            proc,
17349            selection,
17350            graphql_client,
17351        }
17352    }
17353}
17354impl Stat {
17355    /// A unique identifier for this Stat.
17356    pub async fn id(&self) -> Result<Id, DaggerError> {
17357        let query = self.selection.select("id");
17358        query.execute(self.graphql_client.clone()).await
17359    }
17360    /// file size
17361    pub async fn size(&self) -> Result<isize, DaggerError> {
17362        let query = self.selection.select("size");
17363        query.execute(self.graphql_client.clone()).await
17364    }
17365    /// file name
17366    pub async fn name(&self) -> Result<String, DaggerError> {
17367        let query = self.selection.select("name");
17368        query.execute(self.graphql_client.clone()).await
17369    }
17370    /// file type
17371    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
17372        let query = self.selection.select("fileType");
17373        query.execute(self.graphql_client.clone()).await
17374    }
17375    /// permission bits
17376    pub async fn permissions(&self) -> Result<isize, DaggerError> {
17377        let query = self.selection.select("permissions");
17378        query.execute(self.graphql_client.clone()).await
17379    }
17380}
17381impl Node for Stat {
17382    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17383        let query = self.selection.select("id");
17384        let graphql_client = self.graphql_client.clone();
17385        async move { query.execute(graphql_client).await }
17386    }
17387}
17388#[derive(Clone)]
17389pub struct Terminal {
17390    pub proc: Option<Arc<DaggerSessionProc>>,
17391    pub selection: Selection,
17392    pub graphql_client: DynGraphQLClient,
17393}
17394impl IntoID<Id> for Terminal {
17395    fn into_id(
17396        self,
17397    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17398        Box::pin(async move { self.id().await })
17399    }
17400}
17401impl Loadable for Terminal {
17402    fn graphql_type() -> &'static str {
17403        "Terminal"
17404    }
17405    fn from_query(
17406        proc: Option<Arc<DaggerSessionProc>>,
17407        selection: Selection,
17408        graphql_client: DynGraphQLClient,
17409    ) -> Self {
17410        Self {
17411            proc,
17412            selection,
17413            graphql_client,
17414        }
17415    }
17416}
17417impl Terminal {
17418    /// A unique identifier for this Terminal.
17419    pub async fn id(&self) -> Result<Id, DaggerError> {
17420        let query = self.selection.select("id");
17421        query.execute(self.graphql_client.clone()).await
17422    }
17423    /// Forces evaluation of the pipeline in the engine.
17424    /// It doesn't run the default command if no exec has been set.
17425    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
17426        let query = self.selection.select("sync");
17427        let id: Id = query.execute(self.graphql_client.clone()).await?;
17428        Ok(Terminal {
17429            proc: self.proc.clone(),
17430            selection: query
17431                .root()
17432                .select("node")
17433                .arg("id", &id.0)
17434                .inline_fragment("Terminal"),
17435            graphql_client: self.graphql_client.clone(),
17436        })
17437    }
17438}
17439impl Node for Terminal {
17440    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17441        let query = self.selection.select("id");
17442        let graphql_client = self.graphql_client.clone();
17443        async move { query.execute(graphql_client).await }
17444    }
17445}
17446impl Syncer for Terminal {
17447    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17448        let query = self.selection.select("id");
17449        let graphql_client = self.graphql_client.clone();
17450        async move { query.execute(graphql_client).await }
17451    }
17452    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17453        let query = self.selection.select("sync");
17454        let proc = self.proc.clone();
17455        let graphql_client = self.graphql_client.clone();
17456        async move {
17457            let id: Id = query.execute(graphql_client.clone()).await?;
17458            Ok(Self {
17459                proc,
17460                selection: query
17461                    .root()
17462                    .select("node")
17463                    .arg("id", &id.0)
17464                    .inline_fragment("Terminal"),
17465                graphql_client,
17466            })
17467        }
17468    }
17469}
17470#[derive(Clone)]
17471pub struct TypeDef {
17472    pub proc: Option<Arc<DaggerSessionProc>>,
17473    pub selection: Selection,
17474    pub graphql_client: DynGraphQLClient,
17475}
17476#[derive(Builder, Debug, PartialEq)]
17477pub struct TypeDefWithScalarOpts<'a> {
17478    #[builder(setter(into, strip_option), default)]
17479    pub description: Option<&'a str>,
17480}
17481#[derive(Builder, Debug, PartialEq)]
17482pub struct TypeDefWithObjectOpts<'a> {
17483    #[builder(setter(into, strip_option), default)]
17484    pub deprecated: Option<&'a str>,
17485    #[builder(setter(into, strip_option), default)]
17486    pub description: Option<&'a str>,
17487    #[builder(setter(into, strip_option), default)]
17488    pub source_map: Option<Id>,
17489}
17490#[derive(Builder, Debug, PartialEq)]
17491pub struct TypeDefWithInterfaceOpts<'a> {
17492    #[builder(setter(into, strip_option), default)]
17493    pub description: Option<&'a str>,
17494    #[builder(setter(into, strip_option), default)]
17495    pub source_map: Option<Id>,
17496}
17497#[derive(Builder, Debug, PartialEq)]
17498pub struct TypeDefWithFieldOpts<'a> {
17499    /// If deprecated, the reason or migration path.
17500    #[builder(setter(into, strip_option), default)]
17501    pub deprecated: Option<&'a str>,
17502    /// A doc string for the field, if any
17503    #[builder(setter(into, strip_option), default)]
17504    pub description: Option<&'a str>,
17505    /// The source map for the field definition.
17506    #[builder(setter(into, strip_option), default)]
17507    pub source_map: Option<Id>,
17508}
17509#[derive(Builder, Debug, PartialEq)]
17510pub struct TypeDefWithEnumOpts<'a> {
17511    /// A doc string for the enum, if any
17512    #[builder(setter(into, strip_option), default)]
17513    pub description: Option<&'a str>,
17514    /// The source map for the enum definition.
17515    #[builder(setter(into, strip_option), default)]
17516    pub source_map: Option<Id>,
17517}
17518#[derive(Builder, Debug, PartialEq)]
17519pub struct TypeDefWithEnumValueOpts<'a> {
17520    /// If deprecated, the reason or migration path.
17521    #[builder(setter(into, strip_option), default)]
17522    pub deprecated: Option<&'a str>,
17523    /// A doc string for the value, if any
17524    #[builder(setter(into, strip_option), default)]
17525    pub description: Option<&'a str>,
17526    /// The source map for the enum value definition.
17527    #[builder(setter(into, strip_option), default)]
17528    pub source_map: Option<Id>,
17529}
17530#[derive(Builder, Debug, PartialEq)]
17531pub struct TypeDefWithEnumMemberOpts<'a> {
17532    /// If deprecated, the reason or migration path.
17533    #[builder(setter(into, strip_option), default)]
17534    pub deprecated: Option<&'a str>,
17535    /// A doc string for the member, if any
17536    #[builder(setter(into, strip_option), default)]
17537    pub description: Option<&'a str>,
17538    /// The source map for the enum member definition.
17539    #[builder(setter(into, strip_option), default)]
17540    pub source_map: Option<Id>,
17541    /// The value of the member in the enum
17542    #[builder(setter(into, strip_option), default)]
17543    pub value: Option<&'a str>,
17544}
17545impl IntoID<Id> for TypeDef {
17546    fn into_id(
17547        self,
17548    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17549        Box::pin(async move { self.id().await })
17550    }
17551}
17552impl Loadable for TypeDef {
17553    fn graphql_type() -> &'static str {
17554        "TypeDef"
17555    }
17556    fn from_query(
17557        proc: Option<Arc<DaggerSessionProc>>,
17558        selection: Selection,
17559        graphql_client: DynGraphQLClient,
17560    ) -> Self {
17561        Self {
17562            proc,
17563            selection,
17564            graphql_client,
17565        }
17566    }
17567}
17568impl TypeDef {
17569    /// A unique identifier for this TypeDef.
17570    pub async fn id(&self) -> Result<Id, DaggerError> {
17571        let query = self.selection.select("id");
17572        query.execute(self.graphql_client.clone()).await
17573    }
17574    /// Mark this object as a collection.
17575    pub fn with_collection(&self) -> TypeDef {
17576        let query = self.selection.select("withCollection");
17577        TypeDef {
17578            proc: self.proc.clone(),
17579            selection: query,
17580            graphql_client: self.graphql_client.clone(),
17581        }
17582    }
17583    /// Select the stored keys field for this collection.
17584    pub fn with_collection_keys(&self, name: impl Into<String>) -> TypeDef {
17585        let mut query = self.selection.select("withCollectionKeys");
17586        query = query.arg("name", name.into());
17587        TypeDef {
17588            proc: self.proc.clone(),
17589            selection: query,
17590            graphql_client: self.graphql_client.clone(),
17591        }
17592    }
17593    /// Select the item lookup function for this collection.
17594    pub fn with_collection_get(&self, name: impl Into<String>) -> TypeDef {
17595        let mut query = self.selection.select("withCollectionGet");
17596        query = query.arg("name", name.into());
17597        TypeDef {
17598            proc: self.proc.clone(),
17599            selection: query,
17600            graphql_client: self.graphql_client.clone(),
17601        }
17602    }
17603    /// Select the field that receives changes from the original collection.
17604    pub fn with_collection_delta(&self, name: impl Into<String>) -> TypeDef {
17605        let mut query = self.selection.select("withCollectionDelta");
17606        query = query.arg("name", name.into());
17607        TypeDef {
17608            proc: self.proc.clone(),
17609            selection: query,
17610            graphql_client: self.graphql_client.clone(),
17611        }
17612    }
17613    /// Collection metadata, or null if this object is not a collection.
17614    pub async fn as_collection(&self) -> Result<Option<CollectionTypeDef>, DaggerError> {
17615        let query = self.selection.select("asCollection");
17616        let query = query.select("id");
17617        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
17618        Ok(id.map(|id| CollectionTypeDef {
17619            proc: self.proc.clone(),
17620            selection: query
17621                .root()
17622                .select("node")
17623                .arg("id", &id.0)
17624                .inline_fragment("CollectionTypeDef"),
17625            graphql_client: self.graphql_client.clone(),
17626        }))
17627    }
17628    /// The canonical non-optional name of the type.
17629    pub async fn name(&self) -> Result<String, DaggerError> {
17630        let query = self.selection.select("name");
17631        query.execute(self.graphql_client.clone()).await
17632    }
17633    /// The kind of type this is (e.g. primitive, list, object).
17634    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
17635        let query = self.selection.select("kind");
17636        query.execute(self.graphql_client.clone()).await
17637    }
17638    /// Whether this type can be set to null. Defaults to false.
17639    pub async fn optional(&self) -> Result<bool, DaggerError> {
17640        let query = self.selection.select("optional");
17641        query.execute(self.graphql_client.clone()).await
17642    }
17643    /// Sets whether this type can be set to null.
17644    pub fn with_optional(&self, optional: bool) -> TypeDef {
17645        let mut query = self.selection.select("withOptional");
17646        query = query.arg("optional", optional);
17647        TypeDef {
17648            proc: self.proc.clone(),
17649            selection: query,
17650            graphql_client: self.graphql_client.clone(),
17651        }
17652    }
17653    /// Sets the kind of the type.
17654    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
17655        let mut query = self.selection.select("withKind");
17656        query = query.arg("kind", kind);
17657        TypeDef {
17658            proc: self.proc.clone(),
17659            selection: query,
17660            graphql_client: self.graphql_client.clone(),
17661        }
17662    }
17663    /// Returns a TypeDef of kind Scalar with the provided name.
17664    ///
17665    /// # Arguments
17666    ///
17667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17668    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
17669        let mut query = self.selection.select("withScalar");
17670        query = query.arg("name", name.into());
17671        TypeDef {
17672            proc: self.proc.clone(),
17673            selection: query,
17674            graphql_client: self.graphql_client.clone(),
17675        }
17676    }
17677    /// Returns a TypeDef of kind Scalar with the provided name.
17678    ///
17679    /// # Arguments
17680    ///
17681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17682    pub fn with_scalar_opts<'a>(
17683        &self,
17684        name: impl Into<String>,
17685        opts: TypeDefWithScalarOpts<'a>,
17686    ) -> TypeDef {
17687        let mut query = self.selection.select("withScalar");
17688        query = query.arg("name", name.into());
17689        if let Some(description) = opts.description {
17690            query = query.arg("description", description);
17691        }
17692        TypeDef {
17693            proc: self.proc.clone(),
17694            selection: query,
17695            graphql_client: self.graphql_client.clone(),
17696        }
17697    }
17698    /// Returns a TypeDef of kind List with the provided type for its elements.
17699    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
17700        let mut query = self.selection.select("withListOf");
17701        query = query.arg_lazy(
17702            "elementType",
17703            Box::new(move || {
17704                let element_type = element_type.clone();
17705                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
17706            }),
17707        );
17708        TypeDef {
17709            proc: self.proc.clone(),
17710            selection: query,
17711            graphql_client: self.graphql_client.clone(),
17712        }
17713    }
17714    /// Returns a TypeDef of kind Object with the provided name.
17715    /// 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.
17716    ///
17717    /// # Arguments
17718    ///
17719    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17720    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
17721        let mut query = self.selection.select("withObject");
17722        query = query.arg("name", name.into());
17723        TypeDef {
17724            proc: self.proc.clone(),
17725            selection: query,
17726            graphql_client: self.graphql_client.clone(),
17727        }
17728    }
17729    /// Returns a TypeDef of kind Object with the provided name.
17730    /// 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.
17731    ///
17732    /// # Arguments
17733    ///
17734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17735    pub fn with_object_opts<'a>(
17736        &self,
17737        name: impl Into<String>,
17738        opts: TypeDefWithObjectOpts<'a>,
17739    ) -> TypeDef {
17740        let mut query = self.selection.select("withObject");
17741        query = query.arg("name", name.into());
17742        if let Some(description) = opts.description {
17743            query = query.arg("description", description);
17744        }
17745        if let Some(source_map) = opts.source_map {
17746            query = query.arg("sourceMap", source_map);
17747        }
17748        if let Some(deprecated) = opts.deprecated {
17749            query = query.arg("deprecated", deprecated);
17750        }
17751        TypeDef {
17752            proc: self.proc.clone(),
17753            selection: query,
17754            graphql_client: self.graphql_client.clone(),
17755        }
17756    }
17757    /// Returns a TypeDef of kind Interface with the provided name.
17758    ///
17759    /// # Arguments
17760    ///
17761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17762    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
17763        let mut query = self.selection.select("withInterface");
17764        query = query.arg("name", name.into());
17765        TypeDef {
17766            proc: self.proc.clone(),
17767            selection: query,
17768            graphql_client: self.graphql_client.clone(),
17769        }
17770    }
17771    /// Returns a TypeDef of kind Interface with the provided name.
17772    ///
17773    /// # Arguments
17774    ///
17775    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17776    pub fn with_interface_opts<'a>(
17777        &self,
17778        name: impl Into<String>,
17779        opts: TypeDefWithInterfaceOpts<'a>,
17780    ) -> TypeDef {
17781        let mut query = self.selection.select("withInterface");
17782        query = query.arg("name", name.into());
17783        if let Some(description) = opts.description {
17784            query = query.arg("description", description);
17785        }
17786        if let Some(source_map) = opts.source_map {
17787            query = query.arg("sourceMap", source_map);
17788        }
17789        TypeDef {
17790            proc: self.proc.clone(),
17791            selection: query,
17792            graphql_client: self.graphql_client.clone(),
17793        }
17794    }
17795    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
17796    ///
17797    /// # Arguments
17798    ///
17799    /// * `name` - The name of the field in the object
17800    /// * `type_def` - The type of the field
17801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17802    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
17803        let mut query = self.selection.select("withField");
17804        query = query.arg("name", name.into());
17805        query = query.arg_lazy(
17806            "typeDef",
17807            Box::new(move || {
17808                let type_def = type_def.clone();
17809                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17810            }),
17811        );
17812        TypeDef {
17813            proc: self.proc.clone(),
17814            selection: query,
17815            graphql_client: self.graphql_client.clone(),
17816        }
17817    }
17818    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
17819    ///
17820    /// # Arguments
17821    ///
17822    /// * `name` - The name of the field in the object
17823    /// * `type_def` - The type of the field
17824    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17825    pub fn with_field_opts<'a>(
17826        &self,
17827        name: impl Into<String>,
17828        type_def: impl IntoID<Id>,
17829        opts: TypeDefWithFieldOpts<'a>,
17830    ) -> TypeDef {
17831        let mut query = self.selection.select("withField");
17832        query = query.arg("name", name.into());
17833        query = query.arg_lazy(
17834            "typeDef",
17835            Box::new(move || {
17836                let type_def = type_def.clone();
17837                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17838            }),
17839        );
17840        if let Some(description) = opts.description {
17841            query = query.arg("description", description);
17842        }
17843        if let Some(source_map) = opts.source_map {
17844            query = query.arg("sourceMap", source_map);
17845        }
17846        if let Some(deprecated) = opts.deprecated {
17847            query = query.arg("deprecated", deprecated);
17848        }
17849        TypeDef {
17850            proc: self.proc.clone(),
17851            selection: query,
17852            graphql_client: self.graphql_client.clone(),
17853        }
17854    }
17855    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
17856    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
17857        let mut query = self.selection.select("withFunction");
17858        query = query.arg_lazy(
17859            "function",
17860            Box::new(move || {
17861                let function = function.clone();
17862                Box::pin(async move { function.into_id().await.unwrap().quote() })
17863            }),
17864        );
17865        TypeDef {
17866            proc: self.proc.clone(),
17867            selection: query,
17868            graphql_client: self.graphql_client.clone(),
17869        }
17870    }
17871    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
17872    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
17873        let mut query = self.selection.select("withConstructor");
17874        query = query.arg_lazy(
17875            "function",
17876            Box::new(move || {
17877                let function = function.clone();
17878                Box::pin(async move { function.into_id().await.unwrap().quote() })
17879            }),
17880        );
17881        TypeDef {
17882            proc: self.proc.clone(),
17883            selection: query,
17884            graphql_client: self.graphql_client.clone(),
17885        }
17886    }
17887    /// Returns a TypeDef of kind Enum with the provided name.
17888    /// 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.
17889    ///
17890    /// # Arguments
17891    ///
17892    /// * `name` - The name of the enum
17893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17894    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
17895        let mut query = self.selection.select("withEnum");
17896        query = query.arg("name", name.into());
17897        TypeDef {
17898            proc: self.proc.clone(),
17899            selection: query,
17900            graphql_client: self.graphql_client.clone(),
17901        }
17902    }
17903    /// Returns a TypeDef of kind Enum with the provided name.
17904    /// 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.
17905    ///
17906    /// # Arguments
17907    ///
17908    /// * `name` - The name of the enum
17909    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17910    pub fn with_enum_opts<'a>(
17911        &self,
17912        name: impl Into<String>,
17913        opts: TypeDefWithEnumOpts<'a>,
17914    ) -> TypeDef {
17915        let mut query = self.selection.select("withEnum");
17916        query = query.arg("name", name.into());
17917        if let Some(description) = opts.description {
17918            query = query.arg("description", description);
17919        }
17920        if let Some(source_map) = opts.source_map {
17921            query = query.arg("sourceMap", source_map);
17922        }
17923        TypeDef {
17924            proc: self.proc.clone(),
17925            selection: query,
17926            graphql_client: self.graphql_client.clone(),
17927        }
17928    }
17929    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17930    ///
17931    /// # Arguments
17932    ///
17933    /// * `value` - The name of the value in the enum
17934    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17935    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
17936        let mut query = self.selection.select("withEnumValue");
17937        query = query.arg("value", value.into());
17938        TypeDef {
17939            proc: self.proc.clone(),
17940            selection: query,
17941            graphql_client: self.graphql_client.clone(),
17942        }
17943    }
17944    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17945    ///
17946    /// # Arguments
17947    ///
17948    /// * `value` - The name of the value in the enum
17949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17950    pub fn with_enum_value_opts<'a>(
17951        &self,
17952        value: impl Into<String>,
17953        opts: TypeDefWithEnumValueOpts<'a>,
17954    ) -> TypeDef {
17955        let mut query = self.selection.select("withEnumValue");
17956        query = query.arg("value", value.into());
17957        if let Some(description) = opts.description {
17958            query = query.arg("description", description);
17959        }
17960        if let Some(source_map) = opts.source_map {
17961            query = query.arg("sourceMap", source_map);
17962        }
17963        if let Some(deprecated) = opts.deprecated {
17964            query = query.arg("deprecated", deprecated);
17965        }
17966        TypeDef {
17967            proc: self.proc.clone(),
17968            selection: query,
17969            graphql_client: self.graphql_client.clone(),
17970        }
17971    }
17972    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17973    ///
17974    /// # Arguments
17975    ///
17976    /// * `name` - The name of the member in the enum
17977    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17978    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
17979        let mut query = self.selection.select("withEnumMember");
17980        query = query.arg("name", name.into());
17981        TypeDef {
17982            proc: self.proc.clone(),
17983            selection: query,
17984            graphql_client: self.graphql_client.clone(),
17985        }
17986    }
17987    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17988    ///
17989    /// # Arguments
17990    ///
17991    /// * `name` - The name of the member in the enum
17992    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17993    pub fn with_enum_member_opts<'a>(
17994        &self,
17995        name: impl Into<String>,
17996        opts: TypeDefWithEnumMemberOpts<'a>,
17997    ) -> TypeDef {
17998        let mut query = self.selection.select("withEnumMember");
17999        query = query.arg("name", name.into());
18000        if let Some(value) = opts.value {
18001            query = query.arg("value", value);
18002        }
18003        if let Some(description) = opts.description {
18004            query = query.arg("description", description);
18005        }
18006        if let Some(source_map) = opts.source_map {
18007            query = query.arg("sourceMap", source_map);
18008        }
18009        if let Some(deprecated) = opts.deprecated {
18010            query = query.arg("deprecated", deprecated);
18011        }
18012        TypeDef {
18013            proc: self.proc.clone(),
18014            selection: query,
18015            graphql_client: self.graphql_client.clone(),
18016        }
18017    }
18018    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
18019    pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
18020        let query = self.selection.select("asList");
18021        let query = query.select("id");
18022        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18023        Ok(id.map(|id| ListTypeDef {
18024            proc: self.proc.clone(),
18025            selection: query
18026                .root()
18027                .select("node")
18028                .arg("id", &id.0)
18029                .inline_fragment("ListTypeDef"),
18030            graphql_client: self.graphql_client.clone(),
18031        }))
18032    }
18033    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
18034    pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
18035        let query = self.selection.select("asObject");
18036        let query = query.select("id");
18037        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18038        Ok(id.map(|id| ObjectTypeDef {
18039            proc: self.proc.clone(),
18040            selection: query
18041                .root()
18042                .select("node")
18043                .arg("id", &id.0)
18044                .inline_fragment("ObjectTypeDef"),
18045            graphql_client: self.graphql_client.clone(),
18046        }))
18047    }
18048    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
18049    pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
18050        let query = self.selection.select("asInterface");
18051        let query = query.select("id");
18052        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18053        Ok(id.map(|id| InterfaceTypeDef {
18054            proc: self.proc.clone(),
18055            selection: query
18056                .root()
18057                .select("node")
18058                .arg("id", &id.0)
18059                .inline_fragment("InterfaceTypeDef"),
18060            graphql_client: self.graphql_client.clone(),
18061        }))
18062    }
18063    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
18064    pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
18065        let query = self.selection.select("asInput");
18066        let query = query.select("id");
18067        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18068        Ok(id.map(|id| InputTypeDef {
18069            proc: self.proc.clone(),
18070            selection: query
18071                .root()
18072                .select("node")
18073                .arg("id", &id.0)
18074                .inline_fragment("InputTypeDef"),
18075            graphql_client: self.graphql_client.clone(),
18076        }))
18077    }
18078    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
18079    pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
18080        let query = self.selection.select("asScalar");
18081        let query = query.select("id");
18082        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18083        Ok(id.map(|id| ScalarTypeDef {
18084            proc: self.proc.clone(),
18085            selection: query
18086                .root()
18087                .select("node")
18088                .arg("id", &id.0)
18089                .inline_fragment("ScalarTypeDef"),
18090            graphql_client: self.graphql_client.clone(),
18091        }))
18092    }
18093    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
18094    pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
18095        let query = self.selection.select("asEnum");
18096        let query = query.select("id");
18097        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18098        Ok(id.map(|id| EnumTypeDef {
18099            proc: self.proc.clone(),
18100            selection: query
18101                .root()
18102                .select("node")
18103                .arg("id", &id.0)
18104                .inline_fragment("EnumTypeDef"),
18105            graphql_client: self.graphql_client.clone(),
18106        }))
18107    }
18108}
18109impl Node for TypeDef {
18110    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18111        let query = self.selection.select("id");
18112        let graphql_client = self.graphql_client.clone();
18113        async move { query.execute(graphql_client).await }
18114    }
18115}
18116#[derive(Clone)]
18117pub struct Volume {
18118    pub proc: Option<Arc<DaggerSessionProc>>,
18119    pub selection: Selection,
18120    pub graphql_client: DynGraphQLClient,
18121}
18122impl IntoID<Id> for Volume {
18123    fn into_id(
18124        self,
18125    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18126        Box::pin(async move { self.id().await })
18127    }
18128}
18129impl Loadable for Volume {
18130    fn graphql_type() -> &'static str {
18131        "Volume"
18132    }
18133    fn from_query(
18134        proc: Option<Arc<DaggerSessionProc>>,
18135        selection: Selection,
18136        graphql_client: DynGraphQLClient,
18137    ) -> Self {
18138        Self {
18139            proc,
18140            selection,
18141            graphql_client,
18142        }
18143    }
18144}
18145impl Volume {
18146    /// A unique identifier for this Volume.
18147    pub async fn id(&self) -> Result<Id, DaggerError> {
18148        let query = self.selection.select("id");
18149        query.execute(self.graphql_client.clone()).await
18150    }
18151}
18152impl Node for Volume {
18153    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18154        let query = self.selection.select("id");
18155        let graphql_client = self.graphql_client.clone();
18156        async move { query.execute(graphql_client).await }
18157    }
18158}
18159#[derive(Clone)]
18160pub struct Workspace {
18161    pub proc: Option<Arc<DaggerSessionProc>>,
18162    pub selection: Selection,
18163    pub graphql_client: DynGraphQLClient,
18164}
18165#[derive(Builder, Debug, PartialEq)]
18166pub struct WorkspaceMigrateModuleOpts<'a> {
18167    /// Module directory. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18168    #[builder(setter(into, strip_option), default)]
18169    pub path: Option<&'a str>,
18170}
18171#[derive(Builder, Debug, PartialEq)]
18172pub struct WorkspaceCompareCommitsFromOpts<'a> {
18173    /// 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.
18174    #[builder(setter(into, strip_option), default)]
18175    pub commits: Option<Vec<&'a str>>,
18176    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18177    #[builder(setter(into, strip_option), default)]
18178    pub max_commits: Option<isize>,
18179}
18180#[derive(Builder, Debug, PartialEq)]
18181pub struct WorkspaceWithCommitsFromOpts<'a> {
18182    /// 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.
18183    #[builder(setter(into, strip_option), default)]
18184    pub commits: Option<Vec<&'a str>>,
18185    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18186    #[builder(setter(into, strip_option), default)]
18187    pub max_commits: Option<isize>,
18188}
18189#[derive(Builder, Debug, PartialEq)]
18190pub struct WorkspaceWithCommitOpts<'a> {
18191    /// Author and committer email. Defaults to git config user.email in the calling client's working directory, otherwise dagger@localhost.
18192    #[builder(setter(into, strip_option), default)]
18193    pub author_email: Option<&'a str>,
18194    /// Author and committer name. Defaults to git config user.name in the calling client's working directory, otherwise Dagger.
18195    #[builder(setter(into, strip_option), default)]
18196    pub author_name: Option<&'a str>,
18197    /// Add a Signed-off-by trailer using the commit author's name and email.
18198    #[builder(setter(into, strip_option), default)]
18199    pub signoff: Option<bool>,
18200}
18201#[derive(Builder, Debug, PartialEq)]
18202pub struct WorkspaceWithResetOpts {
18203    /// Discard uncommitted changes, resetting the working tree to the commit.
18204    #[builder(setter(into, strip_option), default)]
18205    pub hard: Option<bool>,
18206}
18207#[derive(Builder, Debug, PartialEq)]
18208pub struct WorkspaceDirectoryOpts<'a> {
18209    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
18210    #[builder(setter(into, strip_option), default)]
18211    pub exclude: Option<Vec<&'a str>>,
18212    /// Apply .gitignore filter rules inside the directory.
18213    #[builder(setter(into, strip_option), default)]
18214    pub gitignore: Option<bool>,
18215    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
18216    #[builder(setter(into, strip_option), default)]
18217    pub include: Option<Vec<&'a str>>,
18218}
18219#[derive(Builder, Debug, PartialEq)]
18220pub struct WorkspaceSearchOpts<'a> {
18221    /// Allow the . pattern to match newlines in multiline mode.
18222    #[builder(setter(into, strip_option), default)]
18223    pub dotall: Option<bool>,
18224    /// Only return matching files, not lines and content
18225    #[builder(setter(into, strip_option), default)]
18226    pub files_only: Option<bool>,
18227    /// Glob patterns to match (e.g., "*.md")
18228    #[builder(setter(into, strip_option), default)]
18229    pub globs: Option<Vec<&'a str>>,
18230    /// Enable case-insensitive matching.
18231    #[builder(setter(into, strip_option), default)]
18232    pub insensitive: Option<bool>,
18233    /// Limit the number of results to return
18234    #[builder(setter(into, strip_option), default)]
18235    pub limit: Option<isize>,
18236    /// Interpret the pattern as a literal string instead of a regular expression.
18237    #[builder(setter(into, strip_option), default)]
18238    pub literal: Option<bool>,
18239    /// Enable searching across multiple lines.
18240    #[builder(setter(into, strip_option), default)]
18241    pub multiline: Option<bool>,
18242    /// Directory or file paths to search
18243    #[builder(setter(into, strip_option), default)]
18244    pub paths: Option<Vec<&'a str>>,
18245    /// Skip hidden files (files starting with .).
18246    #[builder(setter(into, strip_option), default)]
18247    pub skip_hidden: Option<bool>,
18248    /// Honor .gitignore, .ignore, and .rgignore files.
18249    #[builder(setter(into, strip_option), default)]
18250    pub skip_ignored: Option<bool>,
18251}
18252#[derive(Builder, Debug, PartialEq)]
18253pub struct WorkspaceFindUpOpts<'a> {
18254    /// Path to start the search from. Relative paths resolve from the workspace cwd; absolute paths resolve from the workspace root.
18255    #[builder(setter(into, strip_option), default)]
18256    pub from: Option<&'a str>,
18257}
18258#[derive(Builder, Debug, PartialEq)]
18259pub struct WorkspaceFindRootsOpts<'a> {
18260    /// Glob patterns pruning the walk below start (e.g. ["**/node_modules/**"]).
18261    #[builder(setter(into, strip_option), default)]
18262    pub exclude: Option<Vec<&'a str>>,
18263    /// Directory to start from. Relative paths resolve from the workspace cwd.
18264    #[builder(setter(into, strip_option), default)]
18265    pub start: Option<&'a str>,
18266}
18267#[derive(Builder, Debug, PartialEq)]
18268pub struct WorkspaceWithNewFileOpts {
18269    /// Permissions of the new file.
18270    #[builder(setter(into, strip_option), default)]
18271    pub permissions: Option<isize>,
18272}
18273#[derive(Builder, Debug, PartialEq)]
18274pub struct WorkspaceWithFileOpts {
18275    /// Permissions of the added file. Defaults to the source file permissions.
18276    #[builder(setter(into, strip_option), default)]
18277    pub permissions: Option<isize>,
18278}
18279#[derive(Builder, Debug, PartialEq)]
18280pub struct WorkspaceWithPatchFileOpts {
18281    /// 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.
18282    #[builder(setter(into, strip_option), default)]
18283    pub on_conflict: Option<PatchConflict>,
18284}
18285#[derive(Builder, Debug, PartialEq)]
18286pub struct WorkspaceWithModuleOpts<'a> {
18287    /// Write to the workspace config directory at the workspace cwd.
18288    #[builder(setter(into, strip_option), default)]
18289    pub here: Option<bool>,
18290    /// Override name for the installed module entry.
18291    #[builder(setter(into, strip_option), default)]
18292    pub name: Option<&'a str>,
18293}
18294#[derive(Builder, Debug, PartialEq)]
18295pub struct WorkspaceWithoutModuleOpts {
18296    /// Write to the workspace config directory at the workspace cwd.
18297    #[builder(setter(into, strip_option), default)]
18298    pub here: Option<bool>,
18299}
18300#[derive(Builder, Debug, PartialEq)]
18301pub struct WorkspaceWithSdkOpts<'a> {
18302    /// Optional override for the SDK name conventionally derived from the installed module name.
18303    #[builder(setter(into, strip_option), default)]
18304    pub as_sdk_name: Option<&'a str>,
18305    /// Write to the workspace config directory at the workspace cwd.
18306    #[builder(setter(into, strip_option), default)]
18307    pub here: Option<bool>,
18308    /// Override name for the installed SDK entry.
18309    #[builder(setter(into, strip_option), default)]
18310    pub name: Option<&'a str>,
18311}
18312#[derive(Builder, Debug, PartialEq)]
18313pub struct WorkspaceWithoutSdkOpts {
18314    /// Write to the workspace config directory at the workspace cwd.
18315    #[builder(setter(into, strip_option), default)]
18316    pub here: Option<bool>,
18317}
18318#[derive(Builder, Debug, PartialEq)]
18319pub struct WorkspaceWithInitModuleOpts<'a> {
18320    /// 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.
18321    #[builder(setter(into, strip_option), default)]
18322    pub entrypoint: Option<bool>,
18323    /// Install the module. When omitted, install only if path is omitted.
18324    #[builder(setter(into, strip_option), default)]
18325    pub install: Option<bool>,
18326    /// Module name. The engine infers it from path, the active config file, or the workspace root when omitted.
18327    #[builder(setter(into, strip_option), default)]
18328    pub name: Option<&'a str>,
18329    /// Module path relative to the workspace cwd, or an absolute workspace path. Defaults to .dagger/modules/<name> beside the active workspace config.
18330    #[builder(setter(into, strip_option), default)]
18331    pub path: Option<&'a str>,
18332    /// Explicit SDK-module constructor setting overrides for this scope.
18333    #[builder(setter(into, strip_option), default)]
18334    pub settings: Option<Json>,
18335}
18336#[derive(Builder, Debug, PartialEq)]
18337pub struct WorkspaceWithClientOpts<'a> {
18338    /// Optional SDK name. Inspect all installed SDKs when omitted.
18339    #[builder(setter(into, strip_option), default)]
18340    pub sdk: Option<&'a str>,
18341    /// Explicit SDK-module constructor setting overrides for this scope. Requires an explicit SDK name.
18342    #[builder(setter(into, strip_option), default)]
18343    pub settings: Option<Json>,
18344}
18345#[derive(Builder, Debug, PartialEq)]
18346pub struct WorkspaceWithoutClientOpts<'a> {
18347    /// Optional SDK name. Search all installed SDKs when omitted.
18348    #[builder(setter(into, strip_option), default)]
18349    pub sdk: Option<&'a str>,
18350}
18351#[derive(Builder, Debug, PartialEq)]
18352pub struct WorkspaceWithUpdatedClientsOpts<'a> {
18353    /// Select clients in every scope instead of only the scopes containing the workspace cwd.
18354    #[builder(setter(into, strip_option), default)]
18355    pub all: Option<bool>,
18356    /// Recorded client targets to update. All targets in the selected scopes are updated when omitted.
18357    #[builder(setter(into, strip_option), default)]
18358    pub modules: Option<Vec<&'a str>>,
18359    /// Optional SDK name. All installed SDK modules are selected when omitted.
18360    #[builder(setter(into, strip_option), default)]
18361    pub sdk: Option<&'a str>,
18362}
18363#[derive(Builder, Debug, PartialEq)]
18364pub struct WorkspaceWithConfigValueOpts<'a> {
18365    /// Write to the workspace config directory at the workspace cwd.
18366    #[builder(setter(into, strip_option), default)]
18367    pub here: Option<bool>,
18368    /// List value to set. Elements are stored verbatim, with no auto-detection. Mutually exclusive with value.
18369    #[builder(setter(into, strip_option), default)]
18370    pub values: Option<Vec<&'a str>>,
18371}
18372#[derive(Builder, Debug, PartialEq)]
18373pub struct WorkspaceWithoutConfigValueOpts {
18374    /// Write to the workspace config directory at the workspace cwd.
18375    #[builder(setter(into, strip_option), default)]
18376    pub here: Option<bool>,
18377}
18378#[derive(Builder, Debug, PartialEq)]
18379pub struct WorkspaceWithConfigEnvOpts {
18380    /// Write to the workspace config directory at the workspace cwd.
18381    #[builder(setter(into, strip_option), default)]
18382    pub here: Option<bool>,
18383}
18384#[derive(Builder, Debug, PartialEq)]
18385pub struct WorkspaceWithoutConfigEnvOpts {
18386    /// Write to the workspace config directory at the workspace cwd.
18387    #[builder(setter(into, strip_option), default)]
18388    pub here: Option<bool>,
18389}
18390#[derive(Builder, Debug, PartialEq)]
18391pub struct WorkspaceWithUpdatedLockOpts {
18392    /// Do not regenerate SDK client scopes.
18393    #[builder(setter(into, strip_option), default)]
18394    pub no_generate: Option<bool>,
18395}
18396#[derive(Builder, Debug, PartialEq)]
18397pub struct WorkspaceWithUpdatedModulesOpts<'a> {
18398    /// Installed module names or sources. A version suffix sets a new request. An empty list refreshes all installed modules.
18399    #[builder(setter(into, strip_option), default)]
18400    pub names: Option<Vec<&'a str>>,
18401    /// New source for exactly one selected module. Resolved like an install source. Cannot be combined with a version or a version suffix.
18402    #[builder(setter(into, strip_option), default)]
18403    pub source: Option<&'a str>,
18404    /// New version request for exactly one selected module. Cannot be combined with a version suffix.
18405    #[builder(setter(into, strip_option), default)]
18406    pub version: Option<&'a str>,
18407}
18408#[derive(Builder, Debug, PartialEq)]
18409pub struct WorkspaceChangesOpts {
18410    /// An earlier workspace state to compare against.
18411    #[builder(setter(into, strip_option), default)]
18412    pub from: Option<Id>,
18413}
18414#[derive(Builder, Debug, PartialEq)]
18415pub struct WorkspaceExportOpts<'a> {
18416    /// Earlier workspace state to compare against. For Git integration, live inputs are snapshotted at export time; use a snapshot to retain the baseline of a previous export.
18417    #[builder(setter(into, strip_option), default)]
18418    pub from: Option<Id>,
18419    /// Destination checkout path on the calling client. Relative paths start at the client's working directory. Omit to use the calling client's current local workspace root.
18420    #[builder(setter(into, strip_option), default)]
18421    pub path: Option<&'a str>,
18422}
18423#[derive(Builder, Debug, PartialEq)]
18424pub struct WorkspaceConfigReadOpts<'a> {
18425    /// Include the selected environment, user overrides, and legacy workspace settings.
18426    #[builder(setter(into, strip_option), default)]
18427    pub effective: Option<bool>,
18428    /// Dotted key path (e.g. modules.greeter.source). Empty for full config.
18429    #[builder(setter(into, strip_option), default)]
18430    pub key: Option<&'a str>,
18431}
18432#[derive(Builder, Debug, PartialEq)]
18433pub struct WorkspaceArtifactsOpts<'a> {
18434    /// Only include artifacts matching these path patterns, as with checks and services. A path selects that path and its children.
18435    #[builder(setter(into, strip_option), default)]
18436    pub include: Option<Vec<&'a str>>,
18437}
18438#[derive(Builder, Debug, PartialEq)]
18439pub struct WorkspaceMigrateOpts<'a> {
18440    /// Additional local modules to migrate. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18441    #[builder(setter(into, strip_option), default)]
18442    pub modules: Option<Vec<&'a str>>,
18443}
18444impl IntoID<Id> for Workspace {
18445    fn into_id(
18446        self,
18447    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18448        Box::pin(async move { self.id().await })
18449    }
18450}
18451impl Loadable for Workspace {
18452    fn graphql_type() -> &'static str {
18453        "Workspace"
18454    }
18455    fn from_query(
18456        proc: Option<Arc<DaggerSessionProc>>,
18457        selection: Selection,
18458        graphql_client: DynGraphQLClient,
18459    ) -> Self {
18460        Self {
18461            proc,
18462            selection,
18463            graphql_client,
18464        }
18465    }
18466}
18467impl Workspace {
18468    /// A unique identifier for this Workspace.
18469    pub async fn id(&self) -> Result<Id, DaggerError> {
18470        let query = self.selection.select("id");
18471        query.execute(self.graphql_client.clone()).await
18472    }
18473    /// Resolve an address in this workspace.
18474    /// A DAG address (dag://<path>) selects exactly one workspace artifact: artifacts.filterUri(value).one(). Its typed loaders use that artifact and never fall back to external resolution.
18475    /// A value without the dag:// scheme keeps its external meaning, such as a container image reference.
18476    /// The Address retains this workspace across module calls and ID reloads.
18477    ///
18478    /// # Arguments
18479    ///
18480    /// * `value` - A DAG address, or an external reference.
18481    pub fn resolve(&self, value: impl Into<String>) -> Address {
18482        let mut query = self.selection.select("resolve");
18483        query = query.arg("value", value.into());
18484        Address {
18485            proc: self.proc.clone(),
18486            selection: query,
18487            graphql_client: self.graphql_client.clone(),
18488        }
18489    }
18490    /// Return this workspace with a native configuration, without changing an existing configuration.
18491    /// Fail if legacy configuration needs workspace migration.
18492    pub fn with_initialized(&self) -> Workspace {
18493        let query = self.selection.select("withInitialized");
18494        Workspace {
18495            proc: self.proc.clone(),
18496            selection: query,
18497            graphql_client: self.graphql_client.clone(),
18498        }
18499    }
18500    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18501    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18502    ///
18503    /// # Arguments
18504    ///
18505    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18506    pub fn migrate_module(&self) -> WorkspaceMigration {
18507        let query = self.selection.select("migrateModule");
18508        WorkspaceMigration {
18509            proc: self.proc.clone(),
18510            selection: query,
18511            graphql_client: self.graphql_client.clone(),
18512        }
18513    }
18514    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18515    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18516    ///
18517    /// # Arguments
18518    ///
18519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18520    pub fn migrate_module_opts<'a>(
18521        &self,
18522        opts: WorkspaceMigrateModuleOpts<'a>,
18523    ) -> WorkspaceMigration {
18524        let mut query = self.selection.select("migrateModule");
18525        if let Some(path) = opts.path {
18526            query = query.arg("path", path);
18527        }
18528        WorkspaceMigration {
18529            proc: self.proc.clone(),
18530            selection: query,
18531            graphql_client: self.graphql_client.clone(),
18532        }
18533    }
18534    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18535    /// 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.
18536    /// 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.
18537    ///
18538    /// # Arguments
18539    ///
18540    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18542    pub async fn compare_commits_from(
18543        &self,
18544        source: impl IntoID<Id>,
18545    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18546        let mut query = self.selection.select("compareCommitsFrom");
18547        query = query.arg_lazy(
18548            "source",
18549            Box::new(move || {
18550                let source = source.clone();
18551                Box::pin(async move { source.into_id().await.unwrap().quote() })
18552            }),
18553        );
18554        let query = query.select("id");
18555        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18556        Ok(ids
18557            .into_iter()
18558            .map(|id| WorkspaceCommitPick {
18559                proc: self.proc.clone(),
18560                selection: crate::querybuilder::query()
18561                    .select("node")
18562                    .arg("id", &id.0)
18563                    .inline_fragment("WorkspaceCommitPick"),
18564                graphql_client: self.graphql_client.clone(),
18565            })
18566            .collect())
18567    }
18568    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18569    /// 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.
18570    /// 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.
18571    ///
18572    /// # Arguments
18573    ///
18574    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18575    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18576    pub async fn compare_commits_from_opts<'a>(
18577        &self,
18578        source: impl IntoID<Id>,
18579        opts: WorkspaceCompareCommitsFromOpts<'a>,
18580    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18581        let mut query = self.selection.select("compareCommitsFrom");
18582        query = query.arg_lazy(
18583            "source",
18584            Box::new(move || {
18585                let source = source.clone();
18586                Box::pin(async move { source.into_id().await.unwrap().quote() })
18587            }),
18588        );
18589        if let Some(commits) = opts.commits {
18590            query = query.arg("commits", commits);
18591        }
18592        if let Some(max_commits) = opts.max_commits {
18593            query = query.arg("maxCommits", max_commits);
18594        }
18595        let query = query.select("id");
18596        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18597        Ok(ids
18598            .into_iter()
18599            .map(|id| WorkspaceCommitPick {
18600                proc: self.proc.clone(),
18601                selection: crate::querybuilder::query()
18602                    .select("node")
18603                    .arg("id", &id.0)
18604                    .inline_fragment("WorkspaceCommitPick"),
18605                graphql_client: self.graphql_client.clone(),
18606            })
18607            .collect())
18608    }
18609    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
18610    /// 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.
18611    /// 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.
18612    /// 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.
18613    ///
18614    /// # Arguments
18615    ///
18616    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18618    pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
18619        let mut query = self.selection.select("withCommitsFrom");
18620        query = query.arg_lazy(
18621            "source",
18622            Box::new(move || {
18623                let source = source.clone();
18624                Box::pin(async move { source.into_id().await.unwrap().quote() })
18625            }),
18626        );
18627        Workspace {
18628            proc: self.proc.clone(),
18629            selection: query,
18630            graphql_client: self.graphql_client.clone(),
18631        }
18632    }
18633    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
18634    /// 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.
18635    /// 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.
18636    /// 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.
18637    ///
18638    /// # Arguments
18639    ///
18640    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18642    pub fn with_commits_from_opts<'a>(
18643        &self,
18644        source: impl IntoID<Id>,
18645        opts: WorkspaceWithCommitsFromOpts<'a>,
18646    ) -> Workspace {
18647        let mut query = self.selection.select("withCommitsFrom");
18648        query = query.arg_lazy(
18649            "source",
18650            Box::new(move || {
18651                let source = source.clone();
18652                Box::pin(async move { source.into_id().await.unwrap().quote() })
18653            }),
18654        );
18655        if let Some(commits) = opts.commits {
18656            query = query.arg("commits", commits);
18657        }
18658        if let Some(max_commits) = opts.max_commits {
18659            query = query.arg("maxCommits", max_commits);
18660        }
18661        Workspace {
18662            proc: self.proc.clone(),
18663            selection: query,
18664            graphql_client: self.graphql_client.clone(),
18665        }
18666    }
18667    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
18668    /// 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.
18669    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
18670    /// 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.
18671    ///
18672    /// # Arguments
18673    ///
18674    /// * `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.
18675    /// * `message` - Commit message.
18676    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
18677    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18678    pub fn with_commit(
18679        &self,
18680        changes: impl IntoID<Id>,
18681        message: impl Into<String>,
18682        date: impl Into<String>,
18683    ) -> Workspace {
18684        let mut query = self.selection.select("withCommit");
18685        query = query.arg_lazy(
18686            "changes",
18687            Box::new(move || {
18688                let changes = changes.clone();
18689                Box::pin(async move { changes.into_id().await.unwrap().quote() })
18690            }),
18691        );
18692        query = query.arg("message", message.into());
18693        query = query.arg("date", date.into());
18694        Workspace {
18695            proc: self.proc.clone(),
18696            selection: query,
18697            graphql_client: self.graphql_client.clone(),
18698        }
18699    }
18700    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
18701    /// 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.
18702    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
18703    /// 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.
18704    ///
18705    /// # Arguments
18706    ///
18707    /// * `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.
18708    /// * `message` - Commit message.
18709    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
18710    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18711    pub fn with_commit_opts<'a>(
18712        &self,
18713        changes: impl IntoID<Id>,
18714        message: impl Into<String>,
18715        date: impl Into<String>,
18716        opts: WorkspaceWithCommitOpts<'a>,
18717    ) -> Workspace {
18718        let mut query = self.selection.select("withCommit");
18719        query = query.arg_lazy(
18720            "changes",
18721            Box::new(move || {
18722                let changes = changes.clone();
18723                Box::pin(async move { changes.into_id().await.unwrap().quote() })
18724            }),
18725        );
18726        query = query.arg("message", message.into());
18727        query = query.arg("date", date.into());
18728        if let Some(author_name) = opts.author_name {
18729            query = query.arg("authorName", author_name);
18730        }
18731        if let Some(author_email) = opts.author_email {
18732            query = query.arg("authorEmail", author_email);
18733        }
18734        if let Some(signoff) = opts.signoff {
18735            query = query.arg("signoff", signoff);
18736        }
18737        Workspace {
18738            proc: self.proc.clone(),
18739            selection: query,
18740            graphql_client: self.graphql_client.clone(),
18741        }
18742    }
18743    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18744    /// 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.
18745    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18746    /// 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.
18747    ///
18748    /// # Arguments
18749    ///
18750    /// * `commit` - Commit to reset HEAD to, resolved against this workspace's repository like GitRepository.ref: a full commit hash, an unambiguous hex prefix (4-40 characters), or a ref name, optionally followed by revision suffixes such as HEAD~1, main^2 or abc1234~2. Only the commit it resolves to is used: a ref name selects its commit, it does not check out that ref.
18751    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18752    pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
18753        let mut query = self.selection.select("withReset");
18754        query = query.arg("commit", commit.into());
18755        Workspace {
18756            proc: self.proc.clone(),
18757            selection: query,
18758            graphql_client: self.graphql_client.clone(),
18759        }
18760    }
18761    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18762    /// 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.
18763    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18764    /// 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.
18765    ///
18766    /// # Arguments
18767    ///
18768    /// * `commit` - Commit to reset HEAD to, resolved against this workspace's repository like GitRepository.ref: a full commit hash, an unambiguous hex prefix (4-40 characters), or a ref name, optionally followed by revision suffixes such as HEAD~1, main^2 or abc1234~2. Only the commit it resolves to is used: a ref name selects its commit, it does not check out that ref.
18769    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18770    pub fn with_reset_opts(
18771        &self,
18772        commit: impl Into<String>,
18773        opts: WorkspaceWithResetOpts,
18774    ) -> Workspace {
18775        let mut query = self.selection.select("withReset");
18776        query = query.arg("commit", commit.into());
18777        if let Some(hard) = opts.hard {
18778            query = query.arg("hard", hard);
18779        }
18780        Workspace {
18781            proc: self.proc.clone(),
18782            selection: query,
18783            graphql_client: self.graphql_client.clone(),
18784        }
18785    }
18786    /// Return a snapshot of this workspace as a stable value.
18787    /// 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.
18788    /// 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.
18789    /// 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.
18790    /// The recipe is portable when a remote can serve its base; otherwise it is frozen for this session only.
18791    pub fn snapshot(&self) -> Workspace {
18792        let query = self.selection.select("snapshot");
18793        Workspace {
18794            proc: self.proc.clone(),
18795            selection: query,
18796            graphql_client: self.graphql_client.clone(),
18797        }
18798    }
18799    /// Select workspace-root-relative config and lockfile paths. Empty paths clear the selection.
18800    ///
18801    /// # Arguments
18802    ///
18803    /// * `config_file` - Config file path.
18804    /// * `lock_file` - Lockfile path.
18805    pub fn with_config_paths(
18806        &self,
18807        config_file: impl Into<String>,
18808        lock_file: impl Into<String>,
18809    ) -> Workspace {
18810        let mut query = self.selection.select("withConfigPaths");
18811        query = query.arg("configFile", config_file.into());
18812        query = query.arg("lockFile", lock_file.into());
18813        Workspace {
18814            proc: self.proc.clone(),
18815            selection: query,
18816            graphql_client: self.graphql_client.clone(),
18817        }
18818    }
18819    /// Select the config environment carried by this workspace.
18820    ///
18821    /// # Arguments
18822    ///
18823    /// * `name` - Environment name, or empty to clear the selection.
18824    pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
18825        let mut query = self.selection.select("withConfigEnvironment");
18826        query = query.arg("name", name.into());
18827        Workspace {
18828            proc: self.proc.clone(),
18829            selection: query,
18830            graphql_client: self.graphql_client.clone(),
18831        }
18832    }
18833    /// Return this workspace with the calling client's user-level config re-read and applied.
18834    /// User-level config (the [workspaces.*] section of the Dagger config file) is read when a session loads its workspace, and snapshots keep that configuration. Call this to pick up edits made since, for example when an agent reloads its modules.
18835    /// The entry is matched by the workspace's git origin remote. A workspace without one, or without a matching entry, gets no user-level config.
18836    pub fn with_user_config(&self) -> Workspace {
18837        let query = self.selection.select("withUserConfig");
18838        Workspace {
18839            proc: self.proc.clone(),
18840            selection: query,
18841            graphql_client: self.graphql_client.clone(),
18842        }
18843    }
18844    /// Selected native workspace config file relative to the workspace cwd, if any.
18845    pub async fn config_file(&self) -> Result<String, DaggerError> {
18846        let query = self.selection.select("configFile");
18847        query.execute(self.graphql_client.clone()).await
18848    }
18849    /// Returns a Directory from the workspace.
18850    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18851    ///
18852    /// # Arguments
18853    ///
18854    /// * `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.
18855    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18856    pub fn directory(&self, path: impl Into<String>) -> Directory {
18857        let mut query = self.selection.select("directory");
18858        query = query.arg("path", path.into());
18859        Directory {
18860            proc: self.proc.clone(),
18861            selection: query,
18862            graphql_client: self.graphql_client.clone(),
18863        }
18864    }
18865    /// Returns a Directory from the workspace.
18866    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18867    ///
18868    /// # Arguments
18869    ///
18870    /// * `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.
18871    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18872    pub fn directory_opts<'a>(
18873        &self,
18874        path: impl Into<String>,
18875        opts: WorkspaceDirectoryOpts<'a>,
18876    ) -> Directory {
18877        let mut query = self.selection.select("directory");
18878        query = query.arg("path", path.into());
18879        if let Some(exclude) = opts.exclude {
18880            query = query.arg("exclude", exclude);
18881        }
18882        if let Some(include) = opts.include {
18883            query = query.arg("include", include);
18884        }
18885        if let Some(gitignore) = opts.gitignore {
18886            query = query.arg("gitignore", gitignore);
18887        }
18888        Directory {
18889            proc: self.proc.clone(),
18890            selection: query,
18891            graphql_client: self.graphql_client.clone(),
18892        }
18893    }
18894    /// Returns a File from the workspace.
18895    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18896    ///
18897    /// # Arguments
18898    ///
18899    /// * `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.
18900    pub fn file(&self, path: impl Into<String>) -> File {
18901        let mut query = self.selection.select("file");
18902        query = query.arg("path", path.into());
18903        File {
18904            proc: self.proc.clone(),
18905            selection: query,
18906            graphql_client: self.graphql_client.clone(),
18907        }
18908    }
18909    /// Returns a list of files and directories that match the given pattern.
18910    /// Patterns match paths relative to the workspace root.
18911    ///
18912    /// # Arguments
18913    ///
18914    /// * `pattern` - Pattern to match (e.g., "*.md").
18915    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
18916        let mut query = self.selection.select("glob");
18917        query = query.arg("pattern", pattern.into());
18918        query.execute(self.graphql_client.clone()).await
18919    }
18920    /// Searches for content matching the given regular expression or literal string.
18921    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
18922    /// Runs ripgrep on the client host, falling back to grep if unavailable.
18923    ///
18924    /// # Arguments
18925    ///
18926    /// * `pattern` - The text to match.
18927    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18928    pub async fn search(
18929        &self,
18930        pattern: impl Into<String>,
18931    ) -> Result<Vec<SearchResult>, DaggerError> {
18932        let mut query = self.selection.select("search");
18933        query = query.arg("pattern", pattern.into());
18934        let query = query.select("id");
18935        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18936        Ok(ids
18937            .into_iter()
18938            .map(|id| SearchResult {
18939                proc: self.proc.clone(),
18940                selection: crate::querybuilder::query()
18941                    .select("node")
18942                    .arg("id", &id.0)
18943                    .inline_fragment("SearchResult"),
18944                graphql_client: self.graphql_client.clone(),
18945            })
18946            .collect())
18947    }
18948    /// Searches for content matching the given regular expression or literal string.
18949    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
18950    /// Runs ripgrep on the client host, falling back to grep if unavailable.
18951    ///
18952    /// # Arguments
18953    ///
18954    /// * `pattern` - The text to match.
18955    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18956    pub async fn search_opts<'a>(
18957        &self,
18958        pattern: impl Into<String>,
18959        opts: WorkspaceSearchOpts<'a>,
18960    ) -> Result<Vec<SearchResult>, DaggerError> {
18961        let mut query = self.selection.select("search");
18962        query = query.arg("pattern", pattern.into());
18963        if let Some(paths) = opts.paths {
18964            query = query.arg("paths", paths);
18965        }
18966        if let Some(globs) = opts.globs {
18967            query = query.arg("globs", globs);
18968        }
18969        if let Some(literal) = opts.literal {
18970            query = query.arg("literal", literal);
18971        }
18972        if let Some(multiline) = opts.multiline {
18973            query = query.arg("multiline", multiline);
18974        }
18975        if let Some(dotall) = opts.dotall {
18976            query = query.arg("dotall", dotall);
18977        }
18978        if let Some(insensitive) = opts.insensitive {
18979            query = query.arg("insensitive", insensitive);
18980        }
18981        if let Some(skip_ignored) = opts.skip_ignored {
18982            query = query.arg("skipIgnored", skip_ignored);
18983        }
18984        if let Some(skip_hidden) = opts.skip_hidden {
18985            query = query.arg("skipHidden", skip_hidden);
18986        }
18987        if let Some(files_only) = opts.files_only {
18988            query = query.arg("filesOnly", files_only);
18989        }
18990        if let Some(limit) = opts.limit {
18991            query = query.arg("limit", limit);
18992        }
18993        let query = query.select("id");
18994        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18995        Ok(ids
18996            .into_iter()
18997            .map(|id| SearchResult {
18998                proc: self.proc.clone(),
18999                selection: crate::querybuilder::query()
19000                    .select("node")
19001                    .arg("id", &id.0)
19002                    .inline_fragment("SearchResult"),
19003                graphql_client: self.graphql_client.clone(),
19004            })
19005            .collect())
19006    }
19007    /// Search for a file or directory by walking up from the start path within the workspace.
19008    /// Returns the absolute workspace path if found, or null if not found.
19009    /// Relative start paths resolve from the workspace cwd.
19010    /// The search stops at the workspace root and will not traverse above it.
19011    ///
19012    /// # Arguments
19013    ///
19014    /// * `name` - The name of the file or directory to search for.
19015    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19016    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
19017        let mut query = self.selection.select("findUp");
19018        query = query.arg("name", name.into());
19019        query.execute(self.graphql_client.clone()).await
19020    }
19021    /// Search for a file or directory by walking up from the start path within the workspace.
19022    /// Returns the absolute workspace path if found, or null if not found.
19023    /// Relative start paths resolve from the workspace cwd.
19024    /// The search stops at the workspace root and will not traverse above it.
19025    ///
19026    /// # Arguments
19027    ///
19028    /// * `name` - The name of the file or directory to search for.
19029    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19030    pub async fn find_up_opts<'a>(
19031        &self,
19032        name: impl Into<String>,
19033        opts: WorkspaceFindUpOpts<'a>,
19034    ) -> Result<String, DaggerError> {
19035        let mut query = self.selection.select("findUp");
19036        query = query.arg("name", name.into());
19037        if let Some(from) = opts.from {
19038            query = query.arg("from", from);
19039        }
19040        query.execute(self.graphql_client.clone()).await
19041    }
19042    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19043    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19044    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19045    ///
19046    /// # Arguments
19047    ///
19048    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19050    pub async fn find_roots(
19051        &self,
19052        markers: Vec<impl Into<String>>,
19053    ) -> Result<Vec<String>, DaggerError> {
19054        let mut query = self.selection.select("findRoots");
19055        query = query.arg(
19056            "markers",
19057            markers
19058                .into_iter()
19059                .map(|i| i.into())
19060                .collect::<Vec<String>>(),
19061        );
19062        query.execute(self.graphql_client.clone()).await
19063    }
19064    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19065    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19066    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19067    ///
19068    /// # Arguments
19069    ///
19070    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19072    pub async fn find_roots_opts<'a>(
19073        &self,
19074        markers: Vec<impl Into<String>>,
19075        opts: WorkspaceFindRootsOpts<'a>,
19076    ) -> Result<Vec<String>, DaggerError> {
19077        let mut query = self.selection.select("findRoots");
19078        query = query.arg(
19079            "markers",
19080            markers
19081                .into_iter()
19082                .map(|i| i.into())
19083                .collect::<Vec<String>>(),
19084        );
19085        if let Some(start) = opts.start {
19086            query = query.arg("start", start);
19087        }
19088        if let Some(exclude) = opts.exclude {
19089            query = query.arg("exclude", exclude);
19090        }
19091        query.execute(self.graphql_client.clone()).await
19092    }
19093    /// Git state for this workspace. Errors if the workspace is not in a git repository.
19094    pub fn git(&self) -> WorkspaceGit {
19095        let query = self.selection.select("git");
19096        WorkspaceGit {
19097            proc: self.proc.clone(),
19098            selection: query,
19099            graphql_client: self.graphql_client.clone(),
19100        }
19101    }
19102    /// Return this workspace with a new or replaced file, without mutating the source.
19103    ///
19104    /// # Arguments
19105    ///
19106    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19107    /// * `contents` - Contents of the new file.
19108    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19109    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
19110        let mut query = self.selection.select("withNewFile");
19111        query = query.arg("path", path.into());
19112        query = query.arg("contents", contents.into());
19113        Workspace {
19114            proc: self.proc.clone(),
19115            selection: query,
19116            graphql_client: self.graphql_client.clone(),
19117        }
19118    }
19119    /// Return this workspace with a new or replaced file, without mutating the source.
19120    ///
19121    /// # Arguments
19122    ///
19123    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19124    /// * `contents` - Contents of the new file.
19125    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19126    pub fn with_new_file_opts(
19127        &self,
19128        path: impl Into<String>,
19129        contents: impl Into<String>,
19130        opts: WorkspaceWithNewFileOpts,
19131    ) -> Workspace {
19132        let mut query = self.selection.select("withNewFile");
19133        query = query.arg("path", path.into());
19134        query = query.arg("contents", contents.into());
19135        if let Some(permissions) = opts.permissions {
19136            query = query.arg("permissions", permissions);
19137        }
19138        Workspace {
19139            proc: self.proc.clone(),
19140            selection: query,
19141            graphql_client: self.graphql_client.clone(),
19142        }
19143    }
19144    /// Return this workspace with a file added or replaced, without mutating the source.
19145    ///
19146    /// # Arguments
19147    ///
19148    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19149    /// * `source` - File to add.
19150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19151    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19152        let mut query = self.selection.select("withFile");
19153        query = query.arg("path", path.into());
19154        query = query.arg_lazy(
19155            "source",
19156            Box::new(move || {
19157                let source = source.clone();
19158                Box::pin(async move { source.into_id().await.unwrap().quote() })
19159            }),
19160        );
19161        Workspace {
19162            proc: self.proc.clone(),
19163            selection: query,
19164            graphql_client: self.graphql_client.clone(),
19165        }
19166    }
19167    /// Return this workspace with a file added or replaced, without mutating the source.
19168    ///
19169    /// # Arguments
19170    ///
19171    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19172    /// * `source` - File to add.
19173    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19174    pub fn with_file_opts(
19175        &self,
19176        path: impl Into<String>,
19177        source: impl IntoID<Id>,
19178        opts: WorkspaceWithFileOpts,
19179    ) -> Workspace {
19180        let mut query = self.selection.select("withFile");
19181        query = query.arg("path", path.into());
19182        query = query.arg_lazy(
19183            "source",
19184            Box::new(move || {
19185                let source = source.clone();
19186                Box::pin(async move { source.into_id().await.unwrap().quote() })
19187            }),
19188        );
19189        if let Some(permissions) = opts.permissions {
19190            query = query.arg("permissions", permissions);
19191        }
19192        Workspace {
19193            proc: self.proc.clone(),
19194            selection: query,
19195            graphql_client: self.graphql_client.clone(),
19196        }
19197    }
19198    /// Return this workspace with the given path replaced by a directory, without mutating the source.
19199    /// 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.
19200    ///
19201    /// # Arguments
19202    ///
19203    /// * `path` - Path to replace. Relative paths resolve from the workspace cwd.
19204    /// * `source` - Directory to write there.
19205    pub fn with_new_directory(
19206        &self,
19207        path: impl Into<String>,
19208        source: impl IntoID<Id>,
19209    ) -> Workspace {
19210        let mut query = self.selection.select("withNewDirectory");
19211        query = query.arg("path", path.into());
19212        query = query.arg_lazy(
19213            "source",
19214            Box::new(move || {
19215                let source = source.clone();
19216                Box::pin(async move { source.into_id().await.unwrap().quote() })
19217            }),
19218        );
19219        Workspace {
19220            proc: self.proc.clone(),
19221            selection: query,
19222            graphql_client: self.graphql_client.clone(),
19223        }
19224    }
19225    /// Return this workspace with a directory merged into the given path, without mutating the source.
19226    /// Anything already at the path stays, and files the source carries win, as with Directory.withDirectory. Use withNewDirectory to replace the path instead.
19227    ///
19228    /// # Arguments
19229    ///
19230    /// * `path` - Path to merge into. Relative paths resolve from the workspace cwd.
19231    /// * `source` - Directory to merge there.
19232    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19233        let mut query = self.selection.select("withDirectory");
19234        query = query.arg("path", path.into());
19235        query = query.arg_lazy(
19236            "source",
19237            Box::new(move || {
19238                let source = source.clone();
19239                Box::pin(async move { source.into_id().await.unwrap().quote() })
19240            }),
19241        );
19242        Workspace {
19243            proc: self.proc.clone(),
19244            selection: query,
19245            graphql_client: self.graphql_client.clone(),
19246        }
19247    }
19248    /// Return this workspace with a file removed, without mutating the source.
19249    ///
19250    /// # Arguments
19251    ///
19252    /// * `path` - Path of the file to remove. Relative paths resolve from the workspace cwd.
19253    pub fn without_file(&self, path: impl Into<String>) -> Workspace {
19254        let mut query = self.selection.select("withoutFile");
19255        query = query.arg("path", path.into());
19256        Workspace {
19257            proc: self.proc.clone(),
19258            selection: query,
19259            graphql_client: self.graphql_client.clone(),
19260        }
19261    }
19262    /// Return this workspace with files removed, without mutating the source.
19263    ///
19264    /// # Arguments
19265    ///
19266    /// * `paths` - Paths of the files to remove. Relative paths resolve from the workspace cwd.
19267    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Workspace {
19268        let mut query = self.selection.select("withoutFiles");
19269        query = query.arg(
19270            "paths",
19271            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
19272        );
19273        Workspace {
19274            proc: self.proc.clone(),
19275            selection: query,
19276            graphql_client: self.graphql_client.clone(),
19277        }
19278    }
19279    /// Return this workspace with a directory removed, without mutating the source.
19280    ///
19281    /// # Arguments
19282    ///
19283    /// * `path` - Path of the directory to remove. Relative paths resolve from the workspace cwd.
19284    pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
19285        let mut query = self.selection.select("withoutDirectory");
19286        query = query.arg("path", path.into());
19287        Workspace {
19288            proc: self.proc.clone(),
19289            selection: query,
19290            graphql_client: self.graphql_client.clone(),
19291        }
19292    }
19293    /// Return this workspace with a changeset applied, without mutating the source.
19294    ///
19295    /// # Arguments
19296    ///
19297    /// * `changes` - Changes to apply.
19298    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
19299        let mut query = self.selection.select("withChanges");
19300        query = query.arg_lazy(
19301            "changes",
19302            Box::new(move || {
19303                let changes = changes.clone();
19304                Box::pin(async move { changes.into_id().await.unwrap().quote() })
19305            }),
19306        );
19307        Workspace {
19308            proc: self.proc.clone(),
19309            selection: query,
19310            graphql_client: self.graphql_client.clone(),
19311        }
19312    }
19313    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19314    /// Paths in the patch are relative to the workspace root, whatever its cwd, as `git diff` writes them. Patching a path at or under a mount is an error.
19315    ///
19316    /// # Arguments
19317    ///
19318    /// * `patch` - File containing the patch to apply
19319    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19320    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Workspace {
19321        let mut query = self.selection.select("withPatchFile");
19322        query = query.arg_lazy(
19323            "patch",
19324            Box::new(move || {
19325                let patch = patch.clone();
19326                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19327            }),
19328        );
19329        Workspace {
19330            proc: self.proc.clone(),
19331            selection: query,
19332            graphql_client: self.graphql_client.clone(),
19333        }
19334    }
19335    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19336    /// Paths in the patch are relative to the workspace root, whatever its cwd, as `git diff` writes them. Patching a path at or under a mount is an error.
19337    ///
19338    /// # Arguments
19339    ///
19340    /// * `patch` - File containing the patch to apply
19341    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19342    pub fn with_patch_file_opts(
19343        &self,
19344        patch: impl IntoID<Id>,
19345        opts: WorkspaceWithPatchFileOpts,
19346    ) -> Workspace {
19347        let mut query = self.selection.select("withPatchFile");
19348        query = query.arg_lazy(
19349            "patch",
19350            Box::new(move || {
19351                let patch = patch.clone();
19352                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19353            }),
19354        );
19355        if let Some(on_conflict) = opts.on_conflict {
19356            query = query.arg("onConflict", on_conflict);
19357        }
19358        Workspace {
19359            proc: self.proc.clone(),
19360            selection: query,
19361            graphql_client: self.graphql_client.clone(),
19362        }
19363    }
19364    /// Return this workspace with its working directory pointed at the given workspace-relative path.
19365    ///
19366    /// # Arguments
19367    ///
19368    /// * `path` - Workspace-relative path to use as the working directory.
19369    pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
19370        let mut query = self.selection.select("withWorkdir");
19371        query = query.arg("path", path.into());
19372        Workspace {
19373            proc: self.proc.clone(),
19374            selection: query,
19375            graphql_client: self.graphql_client.clone(),
19376        }
19377    }
19378    /// Return this workspace with a directory mounted read-only at the given path, without mutating the source.
19379    /// 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.
19380    ///
19381    /// # Arguments
19382    ///
19383    /// * `path` - Location of the mounted directory. Relative paths resolve from the workspace cwd.
19384    /// * `source` - Directory to mount.
19385    pub fn with_mounted_directory(
19386        &self,
19387        path: impl Into<String>,
19388        source: impl IntoID<Id>,
19389    ) -> Workspace {
19390        let mut query = self.selection.select("withMountedDirectory");
19391        query = query.arg("path", path.into());
19392        query = query.arg_lazy(
19393            "source",
19394            Box::new(move || {
19395                let source = source.clone();
19396                Box::pin(async move { source.into_id().await.unwrap().quote() })
19397            }),
19398        );
19399        Workspace {
19400            proc: self.proc.clone(),
19401            selection: query,
19402            graphql_client: self.graphql_client.clone(),
19403        }
19404    }
19405    /// Return this workspace with a file mounted read-only at the given path, without mutating the source.
19406    /// 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.
19407    ///
19408    /// # Arguments
19409    ///
19410    /// * `path` - Location of the mounted file. Relative paths resolve from the workspace cwd.
19411    /// * `source` - File to mount.
19412    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19413        let mut query = self.selection.select("withMountedFile");
19414        query = query.arg("path", path.into());
19415        query = query.arg_lazy(
19416            "source",
19417            Box::new(move || {
19418                let source = source.clone();
19419                Box::pin(async move { source.into_id().await.unwrap().quote() })
19420            }),
19421        );
19422        Workspace {
19423            proc: self.proc.clone(),
19424            selection: query,
19425            graphql_client: self.graphql_client.clone(),
19426        }
19427    }
19428    /// Return this workspace with the content mounted at the given path unmounted.
19429    /// Removes directory and file mounts at or below the path, revealing the underlying workspace content. Other mounts and pending changes are preserved.
19430    ///
19431    /// # Arguments
19432    ///
19433    /// * `path` - Location of the mount to remove. Relative paths resolve from the workspace cwd. Use / to remove all mounts.
19434    pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
19435        let mut query = self.selection.select("withoutMount");
19436        query = query.arg("path", path.into());
19437        Workspace {
19438            proc: self.proc.clone(),
19439            selection: query,
19440            graphql_client: self.graphql_client.clone(),
19441        }
19442    }
19443    /// Return this workspace with a module installed in its config.
19444    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19445    ///
19446    /// # Arguments
19447    ///
19448    /// * `r#ref` - Module reference to install.
19449    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19450    pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
19451        let mut query = self.selection.select("withModule");
19452        query = query.arg("ref", r#ref.into());
19453        Workspace {
19454            proc: self.proc.clone(),
19455            selection: query,
19456            graphql_client: self.graphql_client.clone(),
19457        }
19458    }
19459    /// Return this workspace with a module installed in its config.
19460    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19461    ///
19462    /// # Arguments
19463    ///
19464    /// * `r#ref` - Module reference to install.
19465    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19466    pub fn with_module_opts<'a>(
19467        &self,
19468        r#ref: impl Into<String>,
19469        opts: WorkspaceWithModuleOpts<'a>,
19470    ) -> Workspace {
19471        let mut query = self.selection.select("withModule");
19472        query = query.arg("ref", r#ref.into());
19473        if let Some(name) = opts.name {
19474            query = query.arg("name", name);
19475        }
19476        if let Some(here) = opts.here {
19477            query = query.arg("here", here);
19478        }
19479        Workspace {
19480            proc: self.proc.clone(),
19481            selection: query,
19482            graphql_client: self.graphql_client.clone(),
19483        }
19484    }
19485    /// Return this workspace with a module removed from its config.
19486    /// When the session selects an env, only that env's overlay entry is removed.
19487    ///
19488    /// # Arguments
19489    ///
19490    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19491    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19492    pub fn without_module(&self, name: impl Into<String>) -> Workspace {
19493        let mut query = self.selection.select("withoutModule");
19494        query = query.arg("name", name.into());
19495        Workspace {
19496            proc: self.proc.clone(),
19497            selection: query,
19498            graphql_client: self.graphql_client.clone(),
19499        }
19500    }
19501    /// Return this workspace with a module removed from its config.
19502    /// When the session selects an env, only that env's overlay entry is removed.
19503    ///
19504    /// # Arguments
19505    ///
19506    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19507    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19508    pub fn without_module_opts(
19509        &self,
19510        name: impl Into<String>,
19511        opts: WorkspaceWithoutModuleOpts,
19512    ) -> Workspace {
19513        let mut query = self.selection.select("withoutModule");
19514        query = query.arg("name", name.into());
19515        if let Some(here) = opts.here {
19516            query = query.arg("here", here);
19517        }
19518        Workspace {
19519            proc: self.proc.clone(),
19520            selection: query,
19521            graphql_client: self.graphql_client.clone(),
19522        }
19523    }
19524    /// Return this workspace with an SDK installed in its config.
19525    ///
19526    /// # Arguments
19527    ///
19528    /// * `r#ref` - SDK module reference to install.
19529    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19530    pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
19531        let mut query = self.selection.select("withSDK");
19532        query = query.arg("ref", r#ref.into());
19533        Workspace {
19534            proc: self.proc.clone(),
19535            selection: query,
19536            graphql_client: self.graphql_client.clone(),
19537        }
19538    }
19539    /// Return this workspace with an SDK installed in its config.
19540    ///
19541    /// # Arguments
19542    ///
19543    /// * `r#ref` - SDK module reference to install.
19544    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19545    pub fn with_sdk_opts<'a>(
19546        &self,
19547        r#ref: impl Into<String>,
19548        opts: WorkspaceWithSdkOpts<'a>,
19549    ) -> Workspace {
19550        let mut query = self.selection.select("withSDK");
19551        query = query.arg("ref", r#ref.into());
19552        if let Some(name) = opts.name {
19553            query = query.arg("name", name);
19554        }
19555        if let Some(here) = opts.here {
19556            query = query.arg("here", here);
19557        }
19558        if let Some(as_sdk_name) = opts.as_sdk_name {
19559            query = query.arg("asSdkName", as_sdk_name);
19560        }
19561        Workspace {
19562            proc: self.proc.clone(),
19563            selection: query,
19564            graphql_client: self.graphql_client.clone(),
19565        }
19566    }
19567    /// Return this workspace with an SDK removed from its config.
19568    ///
19569    /// # Arguments
19570    ///
19571    /// * `name` - Name of the installed SDK entry to remove.
19572    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19573    pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
19574        let mut query = self.selection.select("withoutSDK");
19575        query = query.arg("name", name.into());
19576        Workspace {
19577            proc: self.proc.clone(),
19578            selection: query,
19579            graphql_client: self.graphql_client.clone(),
19580        }
19581    }
19582    /// Return this workspace with an SDK removed from its config.
19583    ///
19584    /// # Arguments
19585    ///
19586    /// * `name` - Name of the installed SDK entry to remove.
19587    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19588    pub fn without_sdk_opts(
19589        &self,
19590        name: impl Into<String>,
19591        opts: WorkspaceWithoutSdkOpts,
19592    ) -> Workspace {
19593        let mut query = self.selection.select("withoutSDK");
19594        query = query.arg("name", name.into());
19595        if let Some(here) = opts.here {
19596            query = query.arg("here", here);
19597        }
19598        Workspace {
19599            proc: self.proc.clone(),
19600            selection: query,
19601            graphql_client: self.graphql_client.clone(),
19602        }
19603    }
19604    /// Return this workspace with an installed module selected as its entrypoint.
19605    /// Every other entrypoint selection is cleared. Entrypoints live in the base workspace config.
19606    ///
19607    /// # Arguments
19608    ///
19609    /// * `name` - Exact installed module name.
19610    pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
19611        let mut query = self.selection.select("withEntrypoint");
19612        query = query.arg("name", name.into());
19613        Workspace {
19614            proc: self.proc.clone(),
19615            selection: query,
19616            graphql_client: self.graphql_client.clone(),
19617        }
19618    }
19619    /// Return this workspace with no module selected as its entrypoint.
19620    pub fn without_entrypoint(&self) -> Workspace {
19621        let query = self.selection.select("withoutEntrypoint");
19622        Workspace {
19623            proc: self.proc.clone(),
19624            selection: query,
19625            graphql_client: self.graphql_client.clone(),
19626        }
19627    }
19628    /// Return this workspace with a location initialized as a module scope.
19629    /// The selected SDK module records the scope and generates the module source.
19630    ///
19631    /// # Arguments
19632    ///
19633    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
19634    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19635    pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
19636        let mut query = self.selection.select("withInitModule");
19637        query = query.arg("sdk", sdk.into());
19638        Workspace {
19639            proc: self.proc.clone(),
19640            selection: query,
19641            graphql_client: self.graphql_client.clone(),
19642        }
19643    }
19644    /// Return this workspace with a location initialized as a module scope.
19645    /// The selected SDK module records the scope and generates the module source.
19646    ///
19647    /// # Arguments
19648    ///
19649    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
19650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19651    pub fn with_init_module_opts<'a>(
19652        &self,
19653        sdk: impl Into<String>,
19654        opts: WorkspaceWithInitModuleOpts<'a>,
19655    ) -> Workspace {
19656        let mut query = self.selection.select("withInitModule");
19657        query = query.arg("sdk", sdk.into());
19658        if let Some(name) = opts.name {
19659            query = query.arg("name", name);
19660        }
19661        if let Some(path) = opts.path {
19662            query = query.arg("path", path);
19663        }
19664        if let Some(install) = opts.install {
19665            query = query.arg("install", install);
19666        }
19667        if let Some(entrypoint) = opts.entrypoint {
19668            query = query.arg("entrypoint", entrypoint);
19669        }
19670        if let Some(settings) = opts.settings {
19671            query = query.arg("settings", settings);
19672        }
19673        Workspace {
19674            proc: self.proc.clone(),
19675            selection: query,
19676            graphql_client: self.graphql_client.clone(),
19677        }
19678    }
19679    /// Return the selected SDK module's current scope at this workspace location.
19680    ///
19681    /// # Arguments
19682    ///
19683    /// * `sdk` - SDK name to probe. Required.
19684    pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
19685        let mut query = self.selection.select("detectScope");
19686        query = query.arg("sdk", sdk.into());
19687        query.execute(self.graphql_client.clone()).await
19688    }
19689    /// Return this workspace with a generated module client added to one SDK scope.
19690    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
19691    ///
19692    /// # Arguments
19693    ///
19694    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
19695    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19696    pub fn with_client(&self, module: impl Into<String>) -> Workspace {
19697        let mut query = self.selection.select("withClient");
19698        query = query.arg("module", module.into());
19699        Workspace {
19700            proc: self.proc.clone(),
19701            selection: query,
19702            graphql_client: self.graphql_client.clone(),
19703        }
19704    }
19705    /// Return this workspace with a generated module client added to one SDK scope.
19706    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
19707    ///
19708    /// # Arguments
19709    ///
19710    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
19711    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19712    pub fn with_client_opts<'a>(
19713        &self,
19714        module: impl Into<String>,
19715        opts: WorkspaceWithClientOpts<'a>,
19716    ) -> Workspace {
19717        let mut query = self.selection.select("withClient");
19718        query = query.arg("module", module.into());
19719        if let Some(sdk) = opts.sdk {
19720            query = query.arg("sdk", sdk);
19721        }
19722        if let Some(settings) = opts.settings {
19723            query = query.arg("settings", settings);
19724        }
19725        Workspace {
19726            proc: self.proc.clone(),
19727            selection: query,
19728            graphql_client: self.graphql_client.clone(),
19729        }
19730    }
19731    /// Return this workspace with a module client removed from the deepest matching recorded scope.
19732    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
19733    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
19734    ///
19735    /// # Arguments
19736    ///
19737    /// * `module` - The recorded target to remove.
19738    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19739    pub fn without_client(&self, module: impl Into<String>) -> Workspace {
19740        let mut query = self.selection.select("withoutClient");
19741        query = query.arg("module", module.into());
19742        Workspace {
19743            proc: self.proc.clone(),
19744            selection: query,
19745            graphql_client: self.graphql_client.clone(),
19746        }
19747    }
19748    /// Return this workspace with a module client removed from the deepest matching recorded scope.
19749    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
19750    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
19751    ///
19752    /// # Arguments
19753    ///
19754    /// * `module` - The recorded target to remove.
19755    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19756    pub fn without_client_opts<'a>(
19757        &self,
19758        module: impl Into<String>,
19759        opts: WorkspaceWithoutClientOpts<'a>,
19760    ) -> Workspace {
19761        let mut query = self.selection.select("withoutClient");
19762        query = query.arg("module", module.into());
19763        if let Some(sdk) = opts.sdk {
19764            query = query.arg("sdk", sdk);
19765        }
19766        Workspace {
19767            proc: self.proc.clone(),
19768            selection: query,
19769            graphql_client: self.graphql_client.clone(),
19770        }
19771    }
19772    /// Return this workspace with the selected module clients updated.
19773    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
19774    /// The selected SDK module then regenerates every scope that owns one of the targets.
19775    ///
19776    /// # Arguments
19777    ///
19778    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19779    pub fn with_updated_clients(&self) -> Workspace {
19780        let query = self.selection.select("withUpdatedClients");
19781        Workspace {
19782            proc: self.proc.clone(),
19783            selection: query,
19784            graphql_client: self.graphql_client.clone(),
19785        }
19786    }
19787    /// Return this workspace with the selected module clients updated.
19788    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
19789    /// The selected SDK module then regenerates every scope that owns one of the targets.
19790    ///
19791    /// # Arguments
19792    ///
19793    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19794    pub fn with_updated_clients_opts<'a>(
19795        &self,
19796        opts: WorkspaceWithUpdatedClientsOpts<'a>,
19797    ) -> Workspace {
19798        let mut query = self.selection.select("withUpdatedClients");
19799        if let Some(modules) = opts.modules {
19800            query = query.arg("modules", modules);
19801        }
19802        if let Some(all) = opts.all {
19803            query = query.arg("all", all);
19804        }
19805        if let Some(sdk) = opts.sdk {
19806            query = query.arg("sdk", sdk);
19807        }
19808        Workspace {
19809            proc: self.proc.clone(),
19810            selection: query,
19811            graphql_client: self.graphql_client.clone(),
19812        }
19813    }
19814    /// Return this workspace with a configuration value written.
19815    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
19816    ///
19817    /// # Arguments
19818    ///
19819    /// * `key` - Dotted key path.
19820    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
19821    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19822    pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
19823        let mut query = self.selection.select("withConfigValue");
19824        query = query.arg("key", key.into());
19825        query = query.arg("value", value.into());
19826        Workspace {
19827            proc: self.proc.clone(),
19828            selection: query,
19829            graphql_client: self.graphql_client.clone(),
19830        }
19831    }
19832    /// Return this workspace with a configuration value written.
19833    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
19834    ///
19835    /// # Arguments
19836    ///
19837    /// * `key` - Dotted key path.
19838    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
19839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19840    pub fn with_config_value_opts<'a>(
19841        &self,
19842        key: impl Into<String>,
19843        value: impl Into<String>,
19844        opts: WorkspaceWithConfigValueOpts<'a>,
19845    ) -> Workspace {
19846        let mut query = self.selection.select("withConfigValue");
19847        query = query.arg("key", key.into());
19848        query = query.arg("value", value.into());
19849        if let Some(values) = opts.values {
19850            query = query.arg("values", values);
19851        }
19852        if let Some(here) = opts.here {
19853            query = query.arg("here", here);
19854        }
19855        Workspace {
19856            proc: self.proc.clone(),
19857            selection: query,
19858            graphql_client: self.graphql_client.clone(),
19859        }
19860    }
19861    /// Return this workspace with a configuration value removed.
19862    /// Errors when the key is not currently set.
19863    /// When the session selects an env, the key is scoped to that env's overlay.
19864    ///
19865    /// # Arguments
19866    ///
19867    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
19868    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19869    pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
19870        let mut query = self.selection.select("withoutConfigValue");
19871        query = query.arg("key", key.into());
19872        Workspace {
19873            proc: self.proc.clone(),
19874            selection: query,
19875            graphql_client: self.graphql_client.clone(),
19876        }
19877    }
19878    /// Return this workspace with a configuration value removed.
19879    /// Errors when the key is not currently set.
19880    /// When the session selects an env, the key is scoped to that env's overlay.
19881    ///
19882    /// # Arguments
19883    ///
19884    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
19885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19886    pub fn without_config_value_opts(
19887        &self,
19888        key: impl Into<String>,
19889        opts: WorkspaceWithoutConfigValueOpts,
19890    ) -> Workspace {
19891        let mut query = self.selection.select("withoutConfigValue");
19892        query = query.arg("key", key.into());
19893        if let Some(here) = opts.here {
19894            query = query.arg("here", here);
19895        }
19896        Workspace {
19897            proc: self.proc.clone(),
19898            selection: query,
19899            graphql_client: self.graphql_client.clone(),
19900        }
19901    }
19902    /// Return this workspace with a named config environment created.
19903    ///
19904    /// # Arguments
19905    ///
19906    /// * `name` - Environment name.
19907    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19908    pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
19909        let mut query = self.selection.select("withConfigEnv");
19910        query = query.arg("name", name.into());
19911        Workspace {
19912            proc: self.proc.clone(),
19913            selection: query,
19914            graphql_client: self.graphql_client.clone(),
19915        }
19916    }
19917    /// Return this workspace with a named config environment created.
19918    ///
19919    /// # Arguments
19920    ///
19921    /// * `name` - Environment name.
19922    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19923    pub fn with_config_env_opts(
19924        &self,
19925        name: impl Into<String>,
19926        opts: WorkspaceWithConfigEnvOpts,
19927    ) -> Workspace {
19928        let mut query = self.selection.select("withConfigEnv");
19929        query = query.arg("name", name.into());
19930        if let Some(here) = opts.here {
19931            query = query.arg("here", here);
19932        }
19933        Workspace {
19934            proc: self.proc.clone(),
19935            selection: query,
19936            graphql_client: self.graphql_client.clone(),
19937        }
19938    }
19939    /// Return this workspace with a named config environment removed.
19940    ///
19941    /// # Arguments
19942    ///
19943    /// * `name` - Environment name.
19944    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19945    pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
19946        let mut query = self.selection.select("withoutConfigEnv");
19947        query = query.arg("name", name.into());
19948        Workspace {
19949            proc: self.proc.clone(),
19950            selection: query,
19951            graphql_client: self.graphql_client.clone(),
19952        }
19953    }
19954    /// Return this workspace with a named config environment removed.
19955    ///
19956    /// # Arguments
19957    ///
19958    /// * `name` - Environment name.
19959    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19960    pub fn without_config_env_opts(
19961        &self,
19962        name: impl Into<String>,
19963        opts: WorkspaceWithoutConfigEnvOpts,
19964    ) -> Workspace {
19965        let mut query = self.selection.select("withoutConfigEnv");
19966        query = query.arg("name", name.into());
19967        if let Some(here) = opts.here {
19968            query = query.arg("here", here);
19969        }
19970        Workspace {
19971            proc: self.proc.clone(),
19972            selection: query,
19973            graphql_client: self.graphql_client.clone(),
19974        }
19975    }
19976    /// Return this workspace with refreshed lockfile state.
19977    /// SDK client scopes are regenerated unless noGenerate is true.
19978    ///
19979    /// # Arguments
19980    ///
19981    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19982    pub fn with_updated_lock(&self) -> Workspace {
19983        let query = self.selection.select("withUpdatedLock");
19984        Workspace {
19985            proc: self.proc.clone(),
19986            selection: query,
19987            graphql_client: self.graphql_client.clone(),
19988        }
19989    }
19990    /// Return this workspace with refreshed lockfile state.
19991    /// SDK client scopes are regenerated unless noGenerate is true.
19992    ///
19993    /// # Arguments
19994    ///
19995    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19996    pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
19997        let mut query = self.selection.select("withUpdatedLock");
19998        if let Some(no_generate) = opts.no_generate {
19999            query = query.arg("noGenerate", no_generate);
20000        }
20001        Workspace {
20002            proc: self.proc.clone(),
20003            selection: query,
20004            graphql_client: self.graphql_client.clone(),
20005        }
20006    }
20007    /// Return this workspace with updated module sources, versions and lockfile state.
20008    /// An SDK client scope is regenerated when it targets an updated module.
20009    ///
20010    /// # Arguments
20011    ///
20012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20013    pub fn with_updated_modules(&self) -> Workspace {
20014        let query = self.selection.select("withUpdatedModules");
20015        Workspace {
20016            proc: self.proc.clone(),
20017            selection: query,
20018            graphql_client: self.graphql_client.clone(),
20019        }
20020    }
20021    /// Return this workspace with updated module sources, versions and lockfile state.
20022    /// An SDK client scope is regenerated when it targets an updated module.
20023    ///
20024    /// # Arguments
20025    ///
20026    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20027    pub fn with_updated_modules_opts<'a>(
20028        &self,
20029        opts: WorkspaceWithUpdatedModulesOpts<'a>,
20030    ) -> Workspace {
20031        let mut query = self.selection.select("withUpdatedModules");
20032        if let Some(names) = opts.names {
20033            query = query.arg("names", names);
20034        }
20035        if let Some(version) = opts.version {
20036            query = query.arg("version", version);
20037        }
20038        if let Some(source) = opts.source {
20039            query = query.arg("source", source);
20040        }
20041        Workspace {
20042            proc: self.proc.clone(),
20043            selection: query,
20044            graphql_client: self.graphql_client.clone(),
20045        }
20046    }
20047    /// Installed SDKs.
20048    pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
20049        let query = self.selection.select("sdks");
20050        let query = query.select("id");
20051        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20052        Ok(ids
20053            .into_iter()
20054            .map(|id| WorkspaceSdk {
20055                proc: self.proc.clone(),
20056                selection: crate::querybuilder::query()
20057                    .select("node")
20058                    .arg("id", &id.0)
20059                    .inline_fragment("WorkspaceSDK"),
20060                graphql_client: self.graphql_client.clone(),
20061            })
20062            .collect())
20063    }
20064    /// An installed SDK, by name.
20065    ///
20066    /// # Arguments
20067    ///
20068    /// * `name` - SDK name to look up.
20069    pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
20070        let mut query = self.selection.select("sdk");
20071        query = query.arg("name", name.into());
20072        WorkspaceSdk {
20073            proc: self.proc.clone(),
20074            selection: query,
20075            graphql_client: self.graphql_client.clone(),
20076        }
20077    }
20078    /// Return this workspace's changes, with paths relative to its working directory.
20079    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20080    ///
20081    /// # Arguments
20082    ///
20083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20084    pub fn changes(&self) -> Changeset {
20085        let query = self.selection.select("changes");
20086        Changeset {
20087            proc: self.proc.clone(),
20088            selection: query,
20089            graphql_client: self.graphql_client.clone(),
20090        }
20091    }
20092    /// Return this workspace's changes, with paths relative to its working directory.
20093    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20094    ///
20095    /// # Arguments
20096    ///
20097    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20098    pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
20099        let mut query = self.selection.select("changes");
20100        if let Some(from) = opts.from {
20101            query = query.arg("from", from);
20102        }
20103        Changeset {
20104            proc: self.proc.clone(),
20105            selection: query,
20106            graphql_client: self.graphql_client.clone(),
20107        }
20108    }
20109    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20110    /// Path selects the destination; omitting it uses the calling client's current local workspace root, including when exporting a snapshot or committed workspace. Exported file paths are relative to the workspace root regardless of its working directory. This writes only to the client making the call, never the source's client.
20111    /// A live workspace exported to its own checkout applies only its overlay edits, without capturing the whole checkout. This also applies with an explicit path. Pass from with the same live base to apply only changes since that overlay state.
20112    /// Other exports integrate divergent commits by cherry-picking, preserve unrelated checkout edits, and refuse conflicts. Live inputs are snapshotted automatically; capturing untracked source files requires interactive approval. Stable inputs retain their baseline. Pass from to save only work since an earlier source value, including previously saved pending edits that are now committed.
20113    ///
20114    /// # Arguments
20115    ///
20116    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20117    pub async fn export(&self) -> Result<Void, DaggerError> {
20118        let query = self.selection.select("export");
20119        query.execute(self.graphql_client.clone()).await
20120    }
20121    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20122    /// Path selects the destination; omitting it uses the calling client's current local workspace root, including when exporting a snapshot or committed workspace. Exported file paths are relative to the workspace root regardless of its working directory. This writes only to the client making the call, never the source's client.
20123    /// A live workspace exported to its own checkout applies only its overlay edits, without capturing the whole checkout. This also applies with an explicit path. Pass from with the same live base to apply only changes since that overlay state.
20124    /// Other exports integrate divergent commits by cherry-picking, preserve unrelated checkout edits, and refuse conflicts. Live inputs are snapshotted automatically; capturing untracked source files requires interactive approval. Stable inputs retain their baseline. Pass from to save only work since an earlier source value, including previously saved pending edits that are now committed.
20125    ///
20126    /// # Arguments
20127    ///
20128    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20129    pub async fn export_opts<'a>(
20130        &self,
20131        opts: WorkspaceExportOpts<'a>,
20132    ) -> Result<Void, DaggerError> {
20133        let mut query = self.selection.select("export");
20134        if let Some(path) = opts.path {
20135            query = query.arg("path", path);
20136        }
20137        if let Some(from) = opts.from {
20138            query = query.arg("from", from);
20139        }
20140        query.execute(self.graphql_client.clone()).await
20141    }
20142    /// Read a configuration value from dagger.toml.
20143    /// If key is empty, returns the full config.
20144    /// If key points to a scalar, returns the value.
20145    /// If key points to a table, returns flattened dotted-key output.
20146    ///
20147    /// # Arguments
20148    ///
20149    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20150    pub async fn config_read(&self) -> Result<String, DaggerError> {
20151        let query = self.selection.select("configRead");
20152        query.execute(self.graphql_client.clone()).await
20153    }
20154    /// Read a configuration value from dagger.toml.
20155    /// If key is empty, returns the full config.
20156    /// If key points to a scalar, returns the value.
20157    /// If key points to a table, returns flattened dotted-key output.
20158    ///
20159    /// # Arguments
20160    ///
20161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20162    pub async fn config_read_opts<'a>(
20163        &self,
20164        opts: WorkspaceConfigReadOpts<'a>,
20165    ) -> Result<String, DaggerError> {
20166        let mut query = self.selection.select("configRead");
20167        if let Some(key) = opts.key {
20168            query = query.arg("key", key);
20169        }
20170        if let Some(effective) = opts.effective {
20171            query = query.arg("effective", effective);
20172        }
20173        query.execute(self.graphql_client.clone()).await
20174    }
20175    /// Installed name of the module selected as the workspace entrypoint, or an empty string when none is selected.
20176    /// Reflects the selected env's effective view. Fails if several modules are selected.
20177    pub async fn entrypoint(&self) -> Result<String, DaggerError> {
20178        let query = self.selection.select("entrypoint");
20179        query.execute(self.graphql_client.clone()).await
20180    }
20181    /// List named environments defined in the workspace configuration.
20182    pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
20183        let query = self.selection.select("envList");
20184        query.execute(self.graphql_client.clone()).await
20185    }
20186    /// List modules defined in the workspace configuration.
20187    /// Reflects the selected env's effective view.
20188    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20189        let query = self.selection.select("modules");
20190        let query = query.select("id");
20191        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20192        Ok(ids
20193            .into_iter()
20194            .map(|id| WorkspaceModule {
20195                proc: self.proc.clone(),
20196                selection: crate::querybuilder::query()
20197                    .select("node")
20198                    .arg("id", &id.0)
20199                    .inline_fragment("WorkspaceModule"),
20200                graphql_client: self.graphql_client.clone(),
20201            })
20202            .collect())
20203    }
20204    /// Return a module defined in the workspace configuration.
20205    /// Reflects the selected env's effective view.
20206    ///
20207    /// # Arguments
20208    ///
20209    /// * `name` - Module name to inspect.
20210    pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
20211        let mut query = self.selection.select("module");
20212        query = query.arg("name", name.into());
20213        WorkspaceModule {
20214            proc: self.proc.clone(),
20215            selection: query,
20216            graphql_client: self.graphql_client.clone(),
20217        }
20218    }
20219    /// Load a module source from a path within the workspace.
20220    /// Relative paths (e.g., "foo") resolve from the workspace cwd; absolute paths (e.g., "/foo") resolve from the workspace root.
20221    /// Fails if the path does not point to an initialized module.
20222    ///
20223    /// # Arguments
20224    ///
20225    /// * `path` - Location of the module source to load, relative to the workspace cwd or absolute from the workspace root.
20226    pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
20227        let mut query = self.selection.select("moduleSource");
20228        query = query.arg("path", path.into());
20229        ModuleSource {
20230            proc: self.proc.clone(),
20231            selection: query,
20232            graphql_client: self.graphql_client.clone(),
20233        }
20234    }
20235    /// Current location within the workspace root.
20236    /// The workspace root is returned as "/".
20237    /// Relative paths in workspace APIs resolve from here.
20238    pub async fn cwd(&self) -> Result<String, DaggerError> {
20239        let query = self.selection.select("cwd");
20240        query.execute(self.graphql_client.clone()).await
20241    }
20242    /// Discover static object artifacts from workspace modules without evaluating their values.
20243    ///
20244    /// # Arguments
20245    ///
20246    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20247    pub fn artifacts(&self) -> Artifacts {
20248        let query = self.selection.select("artifacts");
20249        Artifacts {
20250            proc: self.proc.clone(),
20251            selection: query,
20252            graphql_client: self.graphql_client.clone(),
20253        }
20254    }
20255    /// Discover static object artifacts from workspace modules without evaluating their values.
20256    ///
20257    /// # Arguments
20258    ///
20259    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20260    pub fn artifacts_opts<'a>(&self, opts: WorkspaceArtifactsOpts<'a>) -> Artifacts {
20261        let mut query = self.selection.select("artifacts");
20262        if let Some(include) = opts.include {
20263            query = query.arg("include", include);
20264        }
20265        Artifacts {
20266            proc: self.proc.clone(),
20267            selection: query,
20268            graphql_client: self.graphql_client.clone(),
20269        }
20270    }
20271    /// Plan the explicit migration needed for the current workspace.
20272    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
20273    /// The returned plan has an empty changeset and no steps when no migration is needed.
20274    ///
20275    /// # Arguments
20276    ///
20277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20278    pub fn migrate(&self) -> WorkspaceMigration {
20279        let query = self.selection.select("migrate");
20280        WorkspaceMigration {
20281            proc: self.proc.clone(),
20282            selection: query,
20283            graphql_client: self.graphql_client.clone(),
20284        }
20285    }
20286    /// Plan the explicit migration needed for the current workspace.
20287    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
20288    /// The returned plan has an empty changeset and no steps when no migration is needed.
20289    ///
20290    /// # Arguments
20291    ///
20292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20293    pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
20294        let mut query = self.selection.select("migrate");
20295        if let Some(modules) = opts.modules {
20296            query = query.arg("modules", modules);
20297        }
20298        WorkspaceMigration {
20299            proc: self.proc.clone(),
20300            selection: query,
20301            graphql_client: self.graphql_client.clone(),
20302        }
20303    }
20304    /// Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
20305    pub async fn address(&self) -> Result<String, DaggerError> {
20306        let query = self.selection.select("address");
20307        query.execute(self.graphql_client.clone()).await
20308    }
20309}
20310impl Node for Workspace {
20311    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20312        let query = self.selection.select("id");
20313        let graphql_client = self.graphql_client.clone();
20314        async move { query.execute(graphql_client).await }
20315    }
20316}
20317#[derive(Clone)]
20318pub struct WorkspaceCommitPick {
20319    pub proc: Option<Arc<DaggerSessionProc>>,
20320    pub selection: Selection,
20321    pub graphql_client: DynGraphQLClient,
20322}
20323impl IntoID<Id> for WorkspaceCommitPick {
20324    fn into_id(
20325        self,
20326    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20327        Box::pin(async move { self.id().await })
20328    }
20329}
20330impl Loadable for WorkspaceCommitPick {
20331    fn graphql_type() -> &'static str {
20332        "WorkspaceCommitPick"
20333    }
20334    fn from_query(
20335        proc: Option<Arc<DaggerSessionProc>>,
20336        selection: Selection,
20337        graphql_client: DynGraphQLClient,
20338    ) -> Self {
20339        Self {
20340            proc,
20341            selection,
20342            graphql_client,
20343        }
20344    }
20345}
20346impl WorkspaceCommitPick {
20347    /// A unique identifier for this WorkspaceCommitPick.
20348    pub async fn id(&self) -> Result<Id, DaggerError> {
20349        let query = self.selection.select("id");
20350        query.execute(self.graphql_client.clone()).await
20351    }
20352    /// The commit in the source workspace.
20353    pub fn commit(&self) -> GitCommit {
20354        let query = self.selection.select("commit");
20355        GitCommit {
20356            proc: self.proc.clone(),
20357            selection: query,
20358            graphql_client: self.graphql_client.clone(),
20359        }
20360    }
20361    /// Whether this commit can be applied.
20362    pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
20363        let query = self.selection.select("status");
20364        query.execute(self.graphql_client.clone()).await
20365    }
20366    /// Why the commit conflicts, or NONE.
20367    pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
20368        let query = self.selection.select("reason");
20369        query.execute(self.graphql_client.clone()).await
20370    }
20371    /// Workspace-root-relative conflicting paths. Empty unless the status is CONFLICT.
20372    pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
20373        let query = self.selection.select("conflictPaths");
20374        query.execute(self.graphql_client.clone()).await
20375    }
20376}
20377impl Node for WorkspaceCommitPick {
20378    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20379        let query = self.selection.select("id");
20380        let graphql_client = self.graphql_client.clone();
20381        async move { query.execute(graphql_client).await }
20382    }
20383}
20384#[derive(Clone)]
20385pub struct WorkspaceGit {
20386    pub proc: Option<Arc<DaggerSessionProc>>,
20387    pub selection: Selection,
20388    pub graphql_client: DynGraphQLClient,
20389}
20390impl IntoID<Id> for WorkspaceGit {
20391    fn into_id(
20392        self,
20393    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20394        Box::pin(async move { self.id().await })
20395    }
20396}
20397impl Loadable for WorkspaceGit {
20398    fn graphql_type() -> &'static str {
20399        "WorkspaceGit"
20400    }
20401    fn from_query(
20402        proc: Option<Arc<DaggerSessionProc>>,
20403        selection: Selection,
20404        graphql_client: DynGraphQLClient,
20405    ) -> Self {
20406        Self {
20407            proc,
20408            selection,
20409            graphql_client,
20410        }
20411    }
20412}
20413impl WorkspaceGit {
20414    /// A unique identifier for this WorkspaceGit.
20415    pub async fn id(&self) -> Result<Id, DaggerError> {
20416        let query = self.selection.select("id");
20417        query.execute(self.graphql_client.clone()).await
20418    }
20419    /// The checked-out HEAD of this workspace.
20420    pub fn head(&self) -> GitRef {
20421        let query = self.selection.select("head");
20422        GitRef {
20423            proc: self.proc.clone(),
20424            selection: query,
20425            graphql_client: self.graphql_client.clone(),
20426        }
20427    }
20428    /// Return a self-contained Git metadata directory for this workspace's HEAD, including its full reachable history and an index matching HEAD.
20429    /// 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.
20430    /// 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.
20431    pub fn directory(&self) -> Directory {
20432        let query = self.selection.select("directory");
20433        Directory {
20434            proc: self.proc.clone(),
20435            selection: query,
20436            graphql_client: self.graphql_client.clone(),
20437        }
20438    }
20439    /// Uncommitted changes in this workspace, using the same rules as GitRepository.uncommitted.
20440    pub fn uncommitted(&self) -> Changeset {
20441        let query = self.selection.select("uncommitted");
20442        Changeset {
20443            proc: self.proc.clone(),
20444            selection: query,
20445            graphql_client: self.graphql_client.clone(),
20446        }
20447    }
20448}
20449impl Node for WorkspaceGit {
20450    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20451        let query = self.selection.select("id");
20452        let graphql_client = self.graphql_client.clone();
20453        async move { query.execute(graphql_client).await }
20454    }
20455}
20456#[derive(Clone)]
20457pub struct WorkspaceMigration {
20458    pub proc: Option<Arc<DaggerSessionProc>>,
20459    pub selection: Selection,
20460    pub graphql_client: DynGraphQLClient,
20461}
20462impl IntoID<Id> for WorkspaceMigration {
20463    fn into_id(
20464        self,
20465    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20466        Box::pin(async move { self.id().await })
20467    }
20468}
20469impl Loadable for WorkspaceMigration {
20470    fn graphql_type() -> &'static str {
20471        "WorkspaceMigration"
20472    }
20473    fn from_query(
20474        proc: Option<Arc<DaggerSessionProc>>,
20475        selection: Selection,
20476        graphql_client: DynGraphQLClient,
20477    ) -> Self {
20478        Self {
20479            proc,
20480            selection,
20481            graphql_client,
20482        }
20483    }
20484}
20485impl WorkspaceMigration {
20486    /// A unique identifier for this WorkspaceMigration.
20487    pub async fn id(&self) -> Result<Id, DaggerError> {
20488        let query = self.selection.select("id");
20489        query.execute(self.graphql_client.clone()).await
20490    }
20491    /// Filesystem changes for the full migration plan.
20492    pub fn changes(&self) -> Changeset {
20493        let query = self.selection.select("changes");
20494        Changeset {
20495            proc: self.proc.clone(),
20496            selection: query,
20497            graphql_client: self.graphql_client.clone(),
20498        }
20499    }
20500    /// Logical migration steps, each identified by a stable code.
20501    pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
20502        let query = self.selection.select("steps");
20503        let query = query.select("id");
20504        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20505        Ok(ids
20506            .into_iter()
20507            .map(|id| WorkspaceMigrationStep {
20508                proc: self.proc.clone(),
20509                selection: crate::querybuilder::query()
20510                    .select("node")
20511                    .arg("id", &id.0)
20512                    .inline_fragment("WorkspaceMigrationStep"),
20513                graphql_client: self.graphql_client.clone(),
20514            })
20515            .collect())
20516    }
20517    /// Unselected legacy module directories relative to the workspace root. Candidates can include fixtures.
20518    pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
20519        let query = self.selection.select("moduleCandidates");
20520        query.execute(self.graphql_client.clone()).await
20521    }
20522    /// Native workspace config path after migration, relative to the workspace root. Empty if no workspace config exists.
20523    pub async fn config_file(&self) -> Result<String, DaggerError> {
20524        let query = self.selection.select("configFile");
20525        query.execute(self.graphql_client.clone()).await
20526    }
20527}
20528impl Node for WorkspaceMigration {
20529    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20530        let query = self.selection.select("id");
20531        let graphql_client = self.graphql_client.clone();
20532        async move { query.execute(graphql_client).await }
20533    }
20534}
20535#[derive(Clone)]
20536pub struct WorkspaceMigrationStep {
20537    pub proc: Option<Arc<DaggerSessionProc>>,
20538    pub selection: Selection,
20539    pub graphql_client: DynGraphQLClient,
20540}
20541impl IntoID<Id> for WorkspaceMigrationStep {
20542    fn into_id(
20543        self,
20544    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20545        Box::pin(async move { self.id().await })
20546    }
20547}
20548impl Loadable for WorkspaceMigrationStep {
20549    fn graphql_type() -> &'static str {
20550        "WorkspaceMigrationStep"
20551    }
20552    fn from_query(
20553        proc: Option<Arc<DaggerSessionProc>>,
20554        selection: Selection,
20555        graphql_client: DynGraphQLClient,
20556    ) -> Self {
20557        Self {
20558            proc,
20559            selection,
20560            graphql_client,
20561        }
20562    }
20563}
20564impl WorkspaceMigrationStep {
20565    /// A unique identifier for this WorkspaceMigrationStep.
20566    pub async fn id(&self) -> Result<Id, DaggerError> {
20567        let query = self.selection.select("id");
20568        query.execute(self.graphql_client.clone()).await
20569    }
20570    /// Stable code identifying this logical migration step.
20571    pub async fn code(&self) -> Result<String, DaggerError> {
20572        let query = self.selection.select("code");
20573        query.execute(self.graphql_client.clone()).await
20574    }
20575    /// Generic summary of this step's purpose and impact.
20576    pub async fn description(&self) -> Result<String, DaggerError> {
20577        let query = self.selection.select("description");
20578        query.execute(self.graphql_client.clone()).await
20579    }
20580    /// Non-fatal warnings raised while planning this step.
20581    pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
20582        let query = self.selection.select("warnings");
20583        query.execute(self.graphql_client.clone()).await
20584    }
20585    /// Filesystem changes for this step.
20586    pub fn changes(&self) -> Changeset {
20587        let query = self.selection.select("changes");
20588        Changeset {
20589            proc: self.proc.clone(),
20590            selection: query,
20591            graphql_client: self.graphql_client.clone(),
20592        }
20593    }
20594}
20595impl Node for WorkspaceMigrationStep {
20596    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20597        let query = self.selection.select("id");
20598        let graphql_client = self.graphql_client.clone();
20599        async move { query.execute(graphql_client).await }
20600    }
20601}
20602#[derive(Clone)]
20603pub struct WorkspaceModule {
20604    pub proc: Option<Arc<DaggerSessionProc>>,
20605    pub selection: Selection,
20606    pub graphql_client: DynGraphQLClient,
20607}
20608impl IntoID<Id> for WorkspaceModule {
20609    fn into_id(
20610        self,
20611    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20612        Box::pin(async move { self.id().await })
20613    }
20614}
20615impl Loadable for WorkspaceModule {
20616    fn graphql_type() -> &'static str {
20617        "WorkspaceModule"
20618    }
20619    fn from_query(
20620        proc: Option<Arc<DaggerSessionProc>>,
20621        selection: Selection,
20622        graphql_client: DynGraphQLClient,
20623    ) -> Self {
20624        Self {
20625            proc,
20626            selection,
20627            graphql_client,
20628        }
20629    }
20630}
20631impl WorkspaceModule {
20632    /// A unique identifier for this WorkspaceModule.
20633    pub async fn id(&self) -> Result<Id, DaggerError> {
20634        let query = self.selection.select("id");
20635        query.execute(self.graphql_client.clone()).await
20636    }
20637    /// List constructor-backed settings for this module.
20638    pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
20639        let query = self.selection.select("settings");
20640        let query = query.select("id");
20641        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20642        Ok(ids
20643            .into_iter()
20644            .map(|id| WorkspaceModuleSetting {
20645                proc: self.proc.clone(),
20646                selection: crate::querybuilder::query()
20647                    .select("node")
20648                    .arg("id", &id.0)
20649                    .inline_fragment("WorkspaceModuleSetting"),
20650                graphql_client: self.graphql_client.clone(),
20651            })
20652            .collect())
20653    }
20654    /// List the functions of this module's main object, in GraphQL field form.
20655    pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
20656        let query = self.selection.select("functions");
20657        query.execute(self.graphql_client.clone()).await
20658    }
20659    /// The module name.
20660    pub async fn name(&self) -> Result<String, DaggerError> {
20661        let query = self.selection.select("name");
20662        query.execute(self.graphql_client.clone()).await
20663    }
20664    /// Whether the module is the workspace entrypoint (functions aliased to Query root).
20665    pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
20666        let query = self.selection.select("entrypoint");
20667        query.execute(self.graphql_client.clone()).await
20668    }
20669    /// The module source path.
20670    pub async fn source(&self) -> Result<String, DaggerError> {
20671        let query = self.selection.select("source");
20672        query.execute(self.graphql_client.clone()).await
20673    }
20674}
20675impl Node for WorkspaceModule {
20676    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20677        let query = self.selection.select("id");
20678        let graphql_client = self.graphql_client.clone();
20679        async move { query.execute(graphql_client).await }
20680    }
20681}
20682#[derive(Clone)]
20683pub struct WorkspaceModuleSetting {
20684    pub proc: Option<Arc<DaggerSessionProc>>,
20685    pub selection: Selection,
20686    pub graphql_client: DynGraphQLClient,
20687}
20688impl IntoID<Id> for WorkspaceModuleSetting {
20689    fn into_id(
20690        self,
20691    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20692        Box::pin(async move { self.id().await })
20693    }
20694}
20695impl Loadable for WorkspaceModuleSetting {
20696    fn graphql_type() -> &'static str {
20697        "WorkspaceModuleSetting"
20698    }
20699    fn from_query(
20700        proc: Option<Arc<DaggerSessionProc>>,
20701        selection: Selection,
20702        graphql_client: DynGraphQLClient,
20703    ) -> Self {
20704        Self {
20705            proc,
20706            selection,
20707            graphql_client,
20708        }
20709    }
20710}
20711impl WorkspaceModuleSetting {
20712    /// A unique identifier for this WorkspaceModuleSetting.
20713    pub async fn id(&self) -> Result<Id, DaggerError> {
20714        let query = self.selection.select("id");
20715        query.execute(self.graphql_client.clone()).await
20716    }
20717    /// The setting key.
20718    pub async fn key(&self) -> Result<String, DaggerError> {
20719        let query = self.selection.select("key");
20720        query.execute(self.graphql_client.clone()).await
20721    }
20722    /// The value stored in workspace config after applying the selected workspace environment, or empty when unset.
20723    pub async fn value(&self) -> Result<String, DaggerError> {
20724        let query = self.selection.select("value");
20725        query.execute(self.graphql_client.clone()).await
20726    }
20727    /// The constructor argument description.
20728    pub async fn description(&self) -> Result<String, DaggerError> {
20729        let query = self.selection.select("description");
20730        query.execute(self.graphql_client.clone()).await
20731    }
20732    /// The constructor argument's declared default, formatted like value, or empty when the argument has no default.
20733    pub async fn default_value(&self) -> Result<String, DaggerError> {
20734        let query = self.selection.select("defaultValue");
20735        query.execute(self.graphql_client.clone()).await
20736    }
20737    /// Whether the setting is a string argument, stored as a TOML string even when the value reads as a number or boolean.
20738    pub async fn is_string(&self) -> Result<bool, DaggerError> {
20739        let query = self.selection.select("isString");
20740        query.execute(self.graphql_client.clone()).await
20741    }
20742    /// Whether the setting accepts a list of values.
20743    pub async fn is_list(&self) -> Result<bool, DaggerError> {
20744        let query = self.selection.select("isList");
20745        query.execute(self.graphql_client.clone()).await
20746    }
20747    /// Whether the setting is an object type resolved from an address string (Container, Directory, File, Secret, Service, ...), which may be a module reference.
20748    pub async fn is_object(&self) -> Result<bool, DaggerError> {
20749        let query = self.selection.select("isObject");
20750        query.execute(self.graphql_client.clone()).await
20751    }
20752}
20753impl Node for WorkspaceModuleSetting {
20754    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20755        let query = self.selection.select("id");
20756        let graphql_client = self.graphql_client.clone();
20757        async move { query.execute(graphql_client).await }
20758    }
20759}
20760#[derive(Clone)]
20761pub struct WorkspaceSdk {
20762    pub proc: Option<Arc<DaggerSessionProc>>,
20763    pub selection: Selection,
20764    pub graphql_client: DynGraphQLClient,
20765}
20766impl IntoID<Id> for WorkspaceSdk {
20767    fn into_id(
20768        self,
20769    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20770        Box::pin(async move { self.id().await })
20771    }
20772}
20773impl Loadable for WorkspaceSdk {
20774    fn graphql_type() -> &'static str {
20775        "WorkspaceSDK"
20776    }
20777    fn from_query(
20778        proc: Option<Arc<DaggerSessionProc>>,
20779        selection: Selection,
20780        graphql_client: DynGraphQLClient,
20781    ) -> Self {
20782        Self {
20783            proc,
20784            selection,
20785            graphql_client,
20786        }
20787    }
20788}
20789impl WorkspaceSdk {
20790    /// A unique identifier for this WorkspaceSDK.
20791    pub async fn id(&self) -> Result<Id, DaggerError> {
20792        let query = self.selection.select("id");
20793        query.execute(self.graphql_client.clone()).await
20794    }
20795    /// Generate the modules and clients managed by this SDK.
20796    pub fn generate(&self) -> Changeset {
20797        let query = self.selection.select("generate");
20798        Changeset {
20799            proc: self.proc.clone(),
20800            selection: query,
20801            graphql_client: self.graphql_client.clone(),
20802        }
20803    }
20804    /// The user-facing SDK name.
20805    pub async fn name(&self) -> Result<String, DaggerError> {
20806        let query = self.selection.select("name");
20807        query.execute(self.graphql_client.clone()).await
20808    }
20809    /// The module reference this SDK was installed from.
20810    pub async fn r#ref(&self) -> Result<String, DaggerError> {
20811        let query = self.selection.select("ref");
20812        query.execute(self.graphql_client.clone()).await
20813    }
20814    /// Modules authored with this SDK.
20815    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20816        let query = self.selection.select("modules");
20817        let query = query.select("id");
20818        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20819        Ok(ids
20820            .into_iter()
20821            .map(|id| WorkspaceModule {
20822                proc: self.proc.clone(),
20823                selection: crate::querybuilder::query()
20824                    .select("node")
20825                    .arg("id", &id.0)
20826                    .inline_fragment("WorkspaceModule"),
20827                graphql_client: self.graphql_client.clone(),
20828            })
20829            .collect())
20830    }
20831    /// Clients generated with this SDK.
20832    pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20833        let query = self.selection.select("clients");
20834        let query = query.select("id");
20835        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20836        Ok(ids
20837            .into_iter()
20838            .map(|id| WorkspaceModule {
20839                proc: self.proc.clone(),
20840                selection: crate::querybuilder::query()
20841                    .select("node")
20842                    .arg("id", &id.0)
20843                    .inline_fragment("WorkspaceModule"),
20844                graphql_client: self.graphql_client.clone(),
20845            })
20846            .collect())
20847    }
20848}
20849impl Node for WorkspaceSdk {
20850    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20851        let query = self.selection.select("id");
20852        let graphql_client = self.graphql_client.clone();
20853        async move { query.execute(graphql_client).await }
20854    }
20855}
20856#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20857pub enum AgentMessageDelivery {
20858    #[serde(rename = "QUEUED")]
20859    Queued,
20860    #[serde(rename = "STARTED")]
20861    Started,
20862    #[serde(rename = "STEERED")]
20863    Steered,
20864}
20865#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20866pub enum AgentState {
20867    #[serde(rename = "FAILED")]
20868    Failed,
20869    #[serde(rename = "IDLE")]
20870    Idle,
20871    #[serde(rename = "PAUSED")]
20872    Paused,
20873    #[serde(rename = "RUNNING")]
20874    Running,
20875    #[serde(rename = "STOPPED")]
20876    Stopped,
20877    #[serde(rename = "WAITING_INPUT")]
20878    WaitingInput,
20879}
20880#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20881pub enum ArtifactDimensionKind {
20882    #[serde(rename = "COLLECTION")]
20883    Collection,
20884    #[serde(rename = "MODULE")]
20885    Module,
20886    #[serde(rename = "TYPE")]
20887    Type,
20888}
20889#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20890pub enum CacheSharingMode {
20891    #[serde(rename = "LOCKED")]
20892    Locked,
20893    #[serde(rename = "PRIVATE")]
20894    Private,
20895    #[serde(rename = "SHARED")]
20896    Shared,
20897}
20898#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20899pub enum ChangesetMergeConflict {
20900    #[serde(rename = "FAIL")]
20901    Fail,
20902    #[serde(rename = "FAIL_EARLY")]
20903    FailEarly,
20904    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
20905    LeaveConflictMarkers,
20906    #[serde(rename = "PREFER_OURS")]
20907    PreferOurs,
20908    #[serde(rename = "PREFER_THEIRS")]
20909    PreferTheirs,
20910}
20911#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20912pub enum ChangesetsMergeConflict {
20913    #[serde(rename = "FAIL")]
20914    Fail,
20915    #[serde(rename = "FAIL_EARLY")]
20916    FailEarly,
20917}
20918#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20919pub enum DiffStatKind {
20920    #[serde(rename = "ADDED")]
20921    Added,
20922    #[serde(rename = "MODIFIED")]
20923    Modified,
20924    #[serde(rename = "REMOVED")]
20925    Removed,
20926    #[serde(rename = "RENAMED")]
20927    Renamed,
20928}
20929#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20930pub enum ExistsType {
20931    #[serde(rename = "DIRECTORY_TYPE")]
20932    DirectoryType,
20933    #[serde(rename = "REGULAR_TYPE")]
20934    RegularType,
20935    #[serde(rename = "SYMLINK_TYPE")]
20936    SymlinkType,
20937}
20938#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20939pub enum FileType {
20940    #[serde(rename = "DIRECTORY")]
20941    Directory,
20942    #[serde(rename = "DIRECTORY_TYPE")]
20943    DirectoryType,
20944    #[serde(rename = "REGULAR")]
20945    Regular,
20946    #[serde(rename = "REGULAR_TYPE")]
20947    RegularType,
20948    #[serde(rename = "SYMLINK")]
20949    Symlink,
20950    #[serde(rename = "SYMLINK_TYPE")]
20951    SymlinkType,
20952    #[serde(rename = "UNKNOWN")]
20953    Unknown,
20954}
20955#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20956pub enum FunctionCachePolicy {
20957    #[serde(rename = "Default")]
20958    Default,
20959    #[serde(rename = "Never")]
20960    Never,
20961    #[serde(rename = "PerSession")]
20962    PerSession,
20963}
20964#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20965pub enum GitPushDisposition {
20966    #[serde(rename = "CREATED")]
20967    Created,
20968    #[serde(rename = "FAST_FORWARD")]
20969    FastForward,
20970    #[serde(rename = "FORCED")]
20971    Forced,
20972    #[serde(rename = "UP_TO_DATE")]
20973    UpToDate,
20974}
20975#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20976pub enum ImageLayerCompression {
20977    #[serde(rename = "EStarGZ")]
20978    EStarGz,
20979    #[serde(rename = "ESTARGZ")]
20980    Estargz,
20981    #[serde(rename = "Gzip")]
20982    Gzip,
20983    #[serde(rename = "Uncompressed")]
20984    Uncompressed,
20985    #[serde(rename = "Zstd")]
20986    Zstd,
20987}
20988#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20989pub enum ImageMediaTypes {
20990    #[serde(rename = "DOCKER")]
20991    Docker,
20992    #[serde(rename = "DockerMediaTypes")]
20993    DockerMediaTypes,
20994    #[serde(rename = "OCI")]
20995    Oci,
20996    #[serde(rename = "OCIMediaTypes")]
20997    OciMediaTypes,
20998}
20999#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21000pub enum LlmContentBlockKind {
21001    #[serde(rename = "AUDIO")]
21002    Audio,
21003    #[serde(rename = "DOCUMENT")]
21004    Document,
21005    #[serde(rename = "IMAGE")]
21006    Image,
21007    #[serde(rename = "TEXT")]
21008    Text,
21009    #[serde(rename = "THINKING")]
21010    Thinking,
21011    #[serde(rename = "TOOL_CALL")]
21012    ToolCall,
21013    #[serde(rename = "TOOL_RESULT")]
21014    ToolResult,
21015}
21016#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21017pub enum LlmMessageOriginKind {
21018    #[serde(rename = "AGENT")]
21019    Agent,
21020    #[serde(rename = "EVENT")]
21021    Event,
21022    #[serde(rename = "USER")]
21023    User,
21024}
21025#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21026pub enum LlmMessageRole {
21027    #[serde(rename = "ASSISTANT")]
21028    Assistant,
21029    #[serde(rename = "SYSTEM")]
21030    System,
21031    #[serde(rename = "USER")]
21032    User,
21033}
21034#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21035pub enum ModuleSourceExperimentalFeature {
21036    #[serde(rename = "SELF_CALLS")]
21037    SelfCalls,
21038}
21039#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21040pub enum ModuleSourceKind {
21041    #[serde(rename = "DIR")]
21042    Dir,
21043    #[serde(rename = "DIR_SOURCE")]
21044    DirSource,
21045    #[serde(rename = "GIT")]
21046    Git,
21047    #[serde(rename = "GIT_SOURCE")]
21048    GitSource,
21049    #[serde(rename = "LOCAL")]
21050    Local,
21051    #[serde(rename = "LOCAL_SOURCE")]
21052    LocalSource,
21053}
21054#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21055pub enum NetworkProtocol {
21056    #[serde(rename = "TCP")]
21057    Tcp,
21058    #[serde(rename = "UDP")]
21059    Udp,
21060}
21061#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21062pub enum PatchConflict {
21063    #[serde(rename = "FAIL")]
21064    Fail,
21065    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21066    LeaveConflictMarkers,
21067}
21068#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21069pub enum RegistryProtocol {
21070    #[serde(rename = "HTTP")]
21071    Http,
21072    #[serde(rename = "HTTPS")]
21073    Https,
21074}
21075#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21076pub enum ReturnType {
21077    #[serde(rename = "ANY")]
21078    Any,
21079    #[serde(rename = "FAILURE")]
21080    Failure,
21081    #[serde(rename = "SUCCESS")]
21082    Success,
21083}
21084#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21085pub enum TypeDefKind {
21086    #[serde(rename = "BOOLEAN")]
21087    Boolean,
21088    #[serde(rename = "BOOLEAN_KIND")]
21089    BooleanKind,
21090    #[serde(rename = "ENUM")]
21091    Enum,
21092    #[serde(rename = "ENUM_KIND")]
21093    EnumKind,
21094    #[serde(rename = "FLOAT")]
21095    Float,
21096    #[serde(rename = "FLOAT_KIND")]
21097    FloatKind,
21098    #[serde(rename = "INPUT")]
21099    Input,
21100    #[serde(rename = "INPUT_KIND")]
21101    InputKind,
21102    #[serde(rename = "INTEGER")]
21103    Integer,
21104    #[serde(rename = "INTEGER_KIND")]
21105    IntegerKind,
21106    #[serde(rename = "INTERFACE")]
21107    Interface,
21108    #[serde(rename = "INTERFACE_KIND")]
21109    InterfaceKind,
21110    #[serde(rename = "LIST")]
21111    List,
21112    #[serde(rename = "LIST_KIND")]
21113    ListKind,
21114    #[serde(rename = "OBJECT")]
21115    Object,
21116    #[serde(rename = "OBJECT_KIND")]
21117    ObjectKind,
21118    #[serde(rename = "SCALAR")]
21119    Scalar,
21120    #[serde(rename = "SCALAR_KIND")]
21121    ScalarKind,
21122    #[serde(rename = "STRING")]
21123    String,
21124    #[serde(rename = "STRING_KIND")]
21125    StringKind,
21126    #[serde(rename = "VOID")]
21127    Void,
21128    #[serde(rename = "VOID_KIND")]
21129    VoidKind,
21130}
21131#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21132pub enum WorkspaceCommitPickReason {
21133    #[serde(rename = "CONTENT")]
21134    Content,
21135    #[serde(rename = "DIRTY")]
21136    Dirty,
21137    #[serde(rename = "NONE")]
21138    None,
21139}
21140#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21141pub enum WorkspaceCommitPickStatus {
21142    #[serde(rename = "CONFLICT")]
21143    Conflict,
21144    #[serde(rename = "PICKABLE")]
21145    Pickable,
21146    #[serde(rename = "PICKED")]
21147    Picked,
21148    #[serde(rename = "REDUNDANT")]
21149    Redundant,
21150}