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    /// The agent that spawned this agent, or null for a root agent.
682    pub async fn parent(&self) -> Result<Option<Agent>, DaggerError> {
683        let query = self.selection.select("parent");
684        let query = query.select("id");
685        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
686        Ok(id.map(|id| Agent {
687            proc: self.proc.clone(),
688            selection: query
689                .root()
690                .select("node")
691                .arg("id", &id.0)
692                .inline_fragment("Agent"),
693            graphql_client: self.graphql_client.clone(),
694        }))
695    }
696    /// Display label for the agent; carries no identity.
697    pub async fn name(&self) -> Result<String, DaggerError> {
698        let query = self.selection.select("name");
699        query.execute(self.graphql_client.clone()).await
700    }
701    /// The opaque runtime handle minted by the spawn that created this agent.
702    /// 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.
703    pub async fn handle(&self) -> Result<String, DaggerError> {
704        let query = self.selection.select("handle");
705        query.execute(self.graphql_client.clone()).await
706    }
707    /// Computed lifecycle state; never stored.
708    /// An agent that was never started reports IDLE: its mailbox is empty and no turn is open.
709    pub async fn state(&self) -> Result<AgentState, DaggerError> {
710        let query = self.selection.select("state");
711        query.execute(self.graphql_client.clone()).await
712    }
713    /// Why the loop failed, for a FAILED agent; empty otherwise.
714    /// The snapshot holds the completed prefix — send or resume retries from it.
715    pub async fn error(&self) -> Result<String, DaggerError> {
716        let query = self.selection.select("error");
717        query.execute(self.graphql_client.clone()).await
718    }
719    /// The conversation the agent was spawned from: the tools, workspace and message history its loop started with.
720    /// 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.
721    /// For an agent restored under a handle, this is the conversation it was restored from.
722    pub fn seed(&self) -> Llm {
723        let query = self.selection.select("seed");
724        Llm {
725            proc: self.proc.clone(),
726            selection: query,
727            graphql_client: self.graphql_client.clone(),
728        }
729    }
730    /// The conversation as of the last committed step: immutable, branchable, persistable.
731    /// The seed conversation if the agent never stepped.
732    /// Branching from it does not affect the agent.
733    pub fn snapshot(&self) -> Llm {
734        let query = self.selection.select("snapshot");
735        Llm {
736            proc: self.proc.clone(),
737            selection: query,
738            graphql_client: self.graphql_client.clone(),
739        }
740    }
741    /// 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.
742    /// Never blocks, never drops; concurrent sends queue in order.
743    /// 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.
744    /// 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.
745    ///
746    /// # Arguments
747    ///
748    /// * `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.
749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
750    pub async fn send(&self, message: impl Into<String>) -> Result<AgentMessage, DaggerError> {
751        let mut query = self.selection.select("send");
752        query = query.arg("message", message.into());
753        let id: Id = query.execute(self.graphql_client.clone()).await?;
754        Ok(AgentMessage {
755            proc: self.proc.clone(),
756            selection: query
757                .root()
758                .select("node")
759                .arg("id", &id.0)
760                .inline_fragment("AgentMessage"),
761            graphql_client: self.graphql_client.clone(),
762        })
763    }
764    /// 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.
765    /// Never blocks, never drops; concurrent sends queue in order.
766    /// 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.
767    /// 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.
768    ///
769    /// # Arguments
770    ///
771    /// * `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.
772    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
773    pub async fn send_opts<'a>(
774        &self,
775        message: impl Into<String>,
776        opts: AgentSendOpts<'a>,
777    ) -> Result<AgentMessage, DaggerError> {
778        let mut query = self.selection.select("send");
779        query = query.arg("message", message.into());
780        if let Some(reply_to) = opts.reply_to {
781            query = query.arg("replyTo", reply_to);
782        }
783        if let Some(content) = opts.content {
784            query = query.arg("content", content);
785        }
786        let id: Id = query.execute(self.graphql_client.clone()).await?;
787        Ok(AgentMessage {
788            proc: self.proc.clone(),
789            selection: query
790                .root()
791                .select("node")
792                .arg("id", &id.0)
793                .inline_fragment("AgentMessage"),
794            graphql_client: self.graphql_client.clone(),
795        })
796    }
797    /// Look up a previously sent message by its ref.
798    /// 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).
799    /// Fails if the agent has no runtime entry in this session, or no record of the given ref.
800    ///
801    /// # Arguments
802    ///
803    /// * `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.
804    pub fn message(&self, r#ref: impl Into<String>) -> AgentMessage {
805        let mut query = self.selection.select("message");
806        query = query.arg("ref", r#ref.into());
807        AgentMessage {
808            proc: self.proc.clone(),
809            selection: query,
810            graphql_client: self.graphql_client.clone(),
811        }
812    }
813    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
814    /// 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.
815    /// 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.
816    ///
817    /// # Arguments
818    ///
819    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
820    pub async fn pause(&self) -> Result<Agent, DaggerError> {
821        let query = self.selection.select("pause");
822        let id: Id = query.execute(self.graphql_client.clone()).await?;
823        Ok(Agent {
824            proc: self.proc.clone(),
825            selection: query
826                .root()
827                .select("node")
828                .arg("id", &id.0)
829                .inline_fragment("Agent"),
830            graphql_client: self.graphql_client.clone(),
831        })
832    }
833    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
834    /// 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.
835    /// 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.
836    ///
837    /// # Arguments
838    ///
839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
840    pub async fn pause_opts(&self, opts: AgentPauseOpts) -> Result<Agent, DaggerError> {
841        let mut query = self.selection.select("pause");
842        if let Some(interrupt) = opts.interrupt {
843            query = query.arg("interrupt", interrupt);
844        }
845        let id: Id = query.execute(self.graphql_client.clone()).await?;
846        Ok(Agent {
847            proc: self.proc.clone(),
848            selection: query
849                .root()
850                .select("node")
851                .arg("id", &id.0)
852                .inline_fragment("Agent"),
853            graphql_client: self.graphql_client.clone(),
854        })
855    }
856    /// Resume draining the mailbox: a suspended turn continues from the last committed step, and queued messages drain.
857    /// 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.
858    /// No-op on a running or idle agent.
859    pub async fn resume(&self) -> Result<Agent, DaggerError> {
860        let query = self.selection.select("resume");
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    /// Block until the agent settles: IDLE, FAILED, or STOPPED. Read which from state afterwards.
873    /// Unlike waiting for one exact state, this cannot hang merely because the agent settled in a different outcome.
874    pub async fn wait(&self) -> Result<Agent, DaggerError> {
875        let query = self.selection.select("wait");
876        let id: Id = query.execute(self.graphql_client.clone()).await?;
877        Ok(Agent {
878            proc: self.proc.clone(),
879            selection: query
880                .root()
881                .select("node")
882                .arg("id", &id.0)
883                .inline_fragment("Agent"),
884            graphql_client: self.graphql_client.clone(),
885        })
886    }
887    /// 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.
888    /// 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.
889    /// 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.
890    /// 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.
891    /// Idempotent per subscriber; re-subscribing replaces the state set.
892    ///
893    /// # Arguments
894    ///
895    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
896    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
897    pub async fn notify(&self, subscriber: impl IntoID<Id>) -> Result<Agent, DaggerError> {
898        let mut query = self.selection.select("notify");
899        query = query.arg_lazy(
900            "subscriber",
901            Box::new(move || {
902                let subscriber = subscriber.clone();
903                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
904            }),
905        );
906        let id: Id = query.execute(self.graphql_client.clone()).await?;
907        Ok(Agent {
908            proc: self.proc.clone(),
909            selection: query
910                .root()
911                .select("node")
912                .arg("id", &id.0)
913                .inline_fragment("Agent"),
914            graphql_client: self.graphql_client.clone(),
915        })
916    }
917    /// 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.
918    /// 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.
919    /// 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.
920    /// 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.
921    /// Idempotent per subscriber; re-subscribing replaces the state set.
922    ///
923    /// # Arguments
924    ///
925    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
926    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
927    pub async fn notify_opts(
928        &self,
929        subscriber: impl IntoID<Id>,
930        opts: AgentNotifyOpts,
931    ) -> Result<Agent, DaggerError> {
932        let mut query = self.selection.select("notify");
933        query = query.arg_lazy(
934            "subscriber",
935            Box::new(move || {
936                let subscriber = subscriber.clone();
937                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
938            }),
939        );
940        if let Some(on) = opts.on {
941            query = query.arg("on", on);
942        }
943        let id: Id = query.execute(self.graphql_client.clone()).await?;
944        Ok(Agent {
945            proc: self.proc.clone(),
946            selection: query
947                .root()
948                .select("node")
949                .arg("id", &id.0)
950                .inline_fragment("Agent"),
951            graphql_client: self.graphql_client.clone(),
952        })
953    }
954    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
955    ///
956    /// # Arguments
957    ///
958    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
959    pub async fn stop(&self) -> Result<Agent, DaggerError> {
960        let query = self.selection.select("stop");
961        let id: Id = query.execute(self.graphql_client.clone()).await?;
962        Ok(Agent {
963            proc: self.proc.clone(),
964            selection: query
965                .root()
966                .select("node")
967                .arg("id", &id.0)
968                .inline_fragment("Agent"),
969            graphql_client: self.graphql_client.clone(),
970        })
971    }
972    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
973    ///
974    /// # Arguments
975    ///
976    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
977    pub async fn stop_opts(&self, opts: AgentStopOpts) -> Result<Agent, DaggerError> {
978        let mut query = self.selection.select("stop");
979        if let Some(kill) = opts.kill {
980            query = query.arg("kill", kill);
981        }
982        let id: Id = query.execute(self.graphql_client.clone()).await?;
983        Ok(Agent {
984            proc: self.proc.clone(),
985            selection: query
986                .root()
987                .select("node")
988                .arg("id", &id.0)
989                .inline_fragment("Agent"),
990            graphql_client: self.graphql_client.clone(),
991        })
992    }
993    /// 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.
994    /// 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.
995    /// 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.
996    /// 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.
997    ///
998    /// # Arguments
999    ///
1000    /// * `conversation` - The conversation that becomes the agent's committed history, replacing the current one.
1001    pub async fn reseed(&self, conversation: impl IntoID<Id>) -> Result<Agent, DaggerError> {
1002        let mut query = self.selection.select("reseed");
1003        query = query.arg_lazy(
1004            "conversation",
1005            Box::new(move || {
1006                let conversation = conversation.clone();
1007                Box::pin(async move { conversation.into_id().await.unwrap().quote() })
1008            }),
1009        );
1010        let id: Id = query.execute(self.graphql_client.clone()).await?;
1011        Ok(Agent {
1012            proc: self.proc.clone(),
1013            selection: query
1014                .root()
1015                .select("node")
1016                .arg("id", &id.0)
1017                .inline_fragment("Agent"),
1018            graphql_client: self.graphql_client.clone(),
1019        })
1020    }
1021}
1022impl Node for Agent {
1023    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1024        let query = self.selection.select("id");
1025        let graphql_client = self.graphql_client.clone();
1026        async move { query.execute(graphql_client).await }
1027    }
1028}
1029#[derive(Clone)]
1030pub struct AgentMessage {
1031    pub proc: Option<Arc<DaggerSessionProc>>,
1032    pub selection: Selection,
1033    pub graphql_client: DynGraphQLClient,
1034}
1035impl IntoID<Id> for AgentMessage {
1036    fn into_id(
1037        self,
1038    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1039        Box::pin(async move { self.id().await })
1040    }
1041}
1042impl Loadable for AgentMessage {
1043    fn graphql_type() -> &'static str {
1044        "AgentMessage"
1045    }
1046    fn from_query(
1047        proc: Option<Arc<DaggerSessionProc>>,
1048        selection: Selection,
1049        graphql_client: DynGraphQLClient,
1050    ) -> Self {
1051        Self {
1052            proc,
1053            selection,
1054            graphql_client,
1055        }
1056    }
1057}
1058impl AgentMessage {
1059    /// A unique identifier for this AgentMessage.
1060    pub async fn id(&self) -> Result<Id, DaggerError> {
1061        let query = self.selection.select("id");
1062        query.execute(self.graphql_client.clone()).await
1063    }
1064    /// 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).
1065    /// Blocks until provider or native lifecycle evidence is conclusive. Once recorded, the result or cancellation error is immutable.
1066    pub async fn delivery(&self) -> Result<AgentMessageDelivery, DaggerError> {
1067        let query = self.selection.select("delivery");
1068        query.execute(self.graphql_client.clone()).await
1069    }
1070    /// The message's short ref within the receiving agent's runtime, e.g. "#3".
1071    /// 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.
1072    pub async fn r#ref(&self) -> Result<String, DaggerError> {
1073        let query = self.selection.select("ref");
1074        query.execute(self.graphql_client.clone()).await
1075    }
1076    /// 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.
1077    /// Idempotent: cancel and request the response again freely; concurrent waiters share the result.
1078    /// 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.
1079    /// 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.
1080    pub async fn response(&self) -> Result<String, DaggerError> {
1081        let query = self.selection.select("response");
1082        query.execute(self.graphql_client.clone()).await
1083    }
1084}
1085impl Node for AgentMessage {
1086    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1087        let query = self.selection.select("id");
1088        let graphql_client = self.graphql_client.clone();
1089        async move { query.execute(graphql_client).await }
1090    }
1091}
1092#[derive(Clone)]
1093pub struct Artifact {
1094    pub proc: Option<Arc<DaggerSessionProc>>,
1095    pub selection: Selection,
1096    pub graphql_client: DynGraphQLClient,
1097}
1098#[derive(Builder, Debug, PartialEq)]
1099pub struct ArtifactUriOpts {
1100    /// 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.
1101    #[builder(setter(into, strip_option), default)]
1102    pub absolute: Option<bool>,
1103    /// Include the dimension keys as a query. Without them, the address is a path selector.
1104    #[builder(setter(into, strip_option), default)]
1105    pub dimension_keys: Option<bool>,
1106    /// Include the artifact type in the scheme: dag+container://.
1107    #[builder(setter(into, strip_option), default)]
1108    pub type_assertion: Option<bool>,
1109}
1110impl IntoID<Id> for Artifact {
1111    fn into_id(
1112        self,
1113    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1114        Box::pin(async move { self.id().await })
1115    }
1116}
1117impl Loadable for Artifact {
1118    fn graphql_type() -> &'static str {
1119        "Artifact"
1120    }
1121    fn from_query(
1122        proc: Option<Arc<DaggerSessionProc>>,
1123        selection: Selection,
1124        graphql_client: DynGraphQLClient,
1125    ) -> Self {
1126        Self {
1127            proc,
1128            selection,
1129            graphql_client,
1130        }
1131    }
1132}
1133impl Artifact {
1134    /// A unique identifier for this Artifact.
1135    pub async fn id(&self) -> Result<Id, DaggerError> {
1136        let query = self.selection.select("id");
1137        query.execute(self.graphql_client.clone()).await
1138    }
1139    /// A module load failure, or an empty string if discovery succeeded.
1140    pub async fn load_error(&self) -> Result<String, DaggerError> {
1141        let query = self.selection.select("loadError");
1142        query.execute(self.graphql_client.clone()).await
1143    }
1144    /// The arguments accepted by the artifact field.
1145    pub async fn arguments(&self) -> Result<Vec<FunctionArg>, DaggerError> {
1146        let query = self.selection.select("arguments");
1147        let query = query.select("id");
1148        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1149        Ok(ids
1150            .into_iter()
1151            .map(|id| FunctionArg {
1152                proc: self.proc.clone(),
1153                selection: crate::querybuilder::query()
1154                    .select("node")
1155                    .arg("id", &id.0)
1156                    .inline_fragment("FunctionArg"),
1157                graphql_client: self.graphql_client.clone(),
1158            })
1159            .collect())
1160    }
1161    /// The description of the field that supplies this artifact.
1162    pub async fn description(&self) -> Result<String, DaggerError> {
1163        let query = self.selection.select("description");
1164        query.execute(self.graphql_client.clone()).await
1165    }
1166    /// The workspace this artifact was discovered in; its address is relative to it. Null for an artifact without a workspace, such as one of an LLM's bound tool objects (see LLM.artifacts).
1167    pub async fn workspace(&self) -> Result<Option<Workspace>, DaggerError> {
1168        let query = self.selection.select("workspace");
1169        let query = query.select("id");
1170        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1171        Ok(id.map(|id| Workspace {
1172            proc: self.proc.clone(),
1173            selection: query
1174                .root()
1175                .select("node")
1176                .arg("id", &id.0)
1177                .inline_fragment("Workspace"),
1178            graphql_client: self.graphql_client.clone(),
1179        }))
1180    }
1181    /// The artifact's DAG address, such as dag://engine-dev/playground.
1182    ///
1183    /// # Arguments
1184    ///
1185    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1186    pub async fn uri(&self) -> Result<String, DaggerError> {
1187        let query = self.selection.select("uri");
1188        query.execute(self.graphql_client.clone()).await
1189    }
1190    /// The artifact's DAG address, such as dag://engine-dev/playground.
1191    ///
1192    /// # Arguments
1193    ///
1194    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1195    pub async fn uri_opts(&self, opts: ArtifactUriOpts) -> Result<String, DaggerError> {
1196        let mut query = self.selection.select("uri");
1197        if let Some(absolute) = opts.absolute {
1198            query = query.arg("absolute", absolute);
1199        }
1200        if let Some(dimension_keys) = opts.dimension_keys {
1201            query = query.arg("dimensionKeys", dimension_keys);
1202        }
1203        if let Some(type_assertion) = opts.type_assertion {
1204            query = query.arg("typeAssertion", type_assertion);
1205        }
1206        query.execute(self.graphql_client.clone()).await
1207    }
1208    /// The installed module name.
1209    pub async fn module_name(&self) -> Result<String, DaggerError> {
1210        let query = self.selection.select("moduleName");
1211        query.execute(self.graphql_client.clone()).await
1212    }
1213    /// Ordered, literal fields to follow. Workspace main targets use their shorthand.
1214    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1215        let query = self.selection.select("path");
1216        query.execute(self.graphql_client.clone()).await
1217    }
1218    /// The module name, collection keys, and full path key in the artifact type dimension.
1219    pub async fn dimension_keys(&self) -> Result<Vec<ArtifactDimensionKey>, DaggerError> {
1220        let query = self.selection.select("dimensionKeys");
1221        let query = query.select("id");
1222        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1223        Ok(ids
1224            .into_iter()
1225            .map(|id| ArtifactDimensionKey {
1226                proc: self.proc.clone(),
1227                selection: crate::querybuilder::query()
1228                    .select("node")
1229                    .arg("id", &id.0)
1230                    .inline_fragment("ArtifactDimensionKey"),
1231                graphql_client: self.graphql_client.clone(),
1232            })
1233            .collect())
1234    }
1235    /// The directives carried by this artifact.
1236    pub async fn directives(&self) -> Result<Vec<String>, DaggerError> {
1237        let query = self.selection.select("directives");
1238        query.execute(self.graphql_client.clone()).await
1239    }
1240    /// Evaluate the target in the workspace that supplied this artifact.
1241    ///
1242    /// # Arguments
1243    ///
1244    /// * `arguments` - Field arguments as a JSON object.
1245    pub fn value(&self, arguments: Json) -> NodeClient {
1246        let mut query = self.selection.select("value");
1247        query = query.arg("arguments", arguments);
1248        NodeClient {
1249            proc: self.proc.clone(),
1250            selection: query,
1251            graphql_client: self.graphql_client.clone(),
1252        }
1253    }
1254}
1255impl Node for Artifact {
1256    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1257        let query = self.selection.select("id");
1258        let graphql_client = self.graphql_client.clone();
1259        async move { query.execute(graphql_client).await }
1260    }
1261}
1262#[derive(Clone)]
1263pub struct ArtifactDimension {
1264    pub proc: Option<Arc<DaggerSessionProc>>,
1265    pub selection: Selection,
1266    pub graphql_client: DynGraphQLClient,
1267}
1268impl IntoID<Id> for ArtifactDimension {
1269    fn into_id(
1270        self,
1271    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1272        Box::pin(async move { self.id().await })
1273    }
1274}
1275impl Loadable for ArtifactDimension {
1276    fn graphql_type() -> &'static str {
1277        "ArtifactDimension"
1278    }
1279    fn from_query(
1280        proc: Option<Arc<DaggerSessionProc>>,
1281        selection: Selection,
1282        graphql_client: DynGraphQLClient,
1283    ) -> Self {
1284        Self {
1285            proc,
1286            selection,
1287            graphql_client,
1288        }
1289    }
1290}
1291impl ArtifactDimension {
1292    /// A unique identifier for this ArtifactDimension.
1293    pub async fn id(&self) -> Result<Id, DaggerError> {
1294        let query = self.selection.select("id");
1295        query.execute(self.graphql_client.clone()).await
1296    }
1297    /// How this dimension gets its keys.
1298    pub async fn kind(&self) -> Result<ArtifactDimensionKind, DaggerError> {
1299        let query = self.selection.select("kind");
1300        query.execute(self.graphql_client.clone()).await
1301    }
1302    /// The collection type, or null for a static dimension.
1303    pub async fn collection_type(&self) -> Result<String, DaggerError> {
1304        let query = self.selection.select("collectionType");
1305        query.execute(self.graphql_client.clone()).await
1306    }
1307    /// Stable identifier: collection schema path, type:TypeName for an artifact type, or module.
1308    pub async fn identifier(&self) -> Result<String, DaggerError> {
1309        let query = self.selection.select("identifier");
1310        query.execute(self.graphql_client.clone()).await
1311    }
1312    /// Short name used to select this dimension.
1313    pub async fn name(&self) -> Result<String, DaggerError> {
1314        let query = self.selection.select("name");
1315        query.execute(self.graphql_client.clone()).await
1316    }
1317    /// Qualified name used when the short name is ambiguous.
1318    pub async fn qualified_name(&self) -> Result<String, DaggerError> {
1319        let query = self.selection.select("qualifiedName");
1320        query.execute(self.graphql_client.clone()).await
1321    }
1322    /// The collection item or artifact type name, or empty for the module dimension.
1323    pub async fn item_type(&self) -> Result<String, DaggerError> {
1324        let query = self.selection.select("itemType");
1325        query.execute(self.graphql_client.clone()).await
1326    }
1327    /// The collection key argument name, or name for a static dimension.
1328    pub async fn key_name(&self) -> Result<String, DaggerError> {
1329        let query = self.selection.select("keyName");
1330        query.execute(self.graphql_client.clone()).await
1331    }
1332    /// The collection key argument description, or empty for a static dimension.
1333    pub async fn key_description(&self) -> Result<String, DaggerError> {
1334        let query = self.selection.select("keyDescription");
1335        query.execute(self.graphql_client.clone()).await
1336    }
1337}
1338impl Node for ArtifactDimension {
1339    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1340        let query = self.selection.select("id");
1341        let graphql_client = self.graphql_client.clone();
1342        async move { query.execute(graphql_client).await }
1343    }
1344}
1345#[derive(Clone)]
1346pub struct ArtifactDimensionKey {
1347    pub proc: Option<Arc<DaggerSessionProc>>,
1348    pub selection: Selection,
1349    pub graphql_client: DynGraphQLClient,
1350}
1351impl IntoID<Id> for ArtifactDimensionKey {
1352    fn into_id(
1353        self,
1354    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1355        Box::pin(async move { self.id().await })
1356    }
1357}
1358impl Loadable for ArtifactDimensionKey {
1359    fn graphql_type() -> &'static str {
1360        "ArtifactDimensionKey"
1361    }
1362    fn from_query(
1363        proc: Option<Arc<DaggerSessionProc>>,
1364        selection: Selection,
1365        graphql_client: DynGraphQLClient,
1366    ) -> Self {
1367        Self {
1368            proc,
1369            selection,
1370            graphql_client,
1371        }
1372    }
1373}
1374impl ArtifactDimensionKey {
1375    /// A unique identifier for this ArtifactDimensionKey.
1376    pub async fn id(&self) -> Result<Id, DaggerError> {
1377        let query = self.selection.select("id");
1378        query.execute(self.graphql_client.clone()).await
1379    }
1380    /// The dimension identifier, fixed across the workspace schema.
1381    pub async fn dimension(&self) -> Result<String, DaggerError> {
1382        let query = self.selection.select("dimension");
1383        query.execute(self.graphql_client.clone()).await
1384    }
1385    /// The dimension item's key.
1386    pub async fn key(&self) -> Result<String, DaggerError> {
1387        let query = self.selection.select("key");
1388        query.execute(self.graphql_client.clone()).await
1389    }
1390}
1391impl Node for ArtifactDimensionKey {
1392    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1393        let query = self.selection.select("id");
1394        let graphql_client = self.graphql_client.clone();
1395        async move { query.execute(graphql_client).await }
1396    }
1397}
1398#[derive(Clone)]
1399pub struct ArtifactPath {
1400    pub proc: Option<Arc<DaggerSessionProc>>,
1401    pub selection: Selection,
1402    pub graphql_client: DynGraphQLClient,
1403}
1404impl IntoID<Id> for ArtifactPath {
1405    fn into_id(
1406        self,
1407    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1408        Box::pin(async move { self.id().await })
1409    }
1410}
1411impl Loadable for ArtifactPath {
1412    fn graphql_type() -> &'static str {
1413        "ArtifactPath"
1414    }
1415    fn from_query(
1416        proc: Option<Arc<DaggerSessionProc>>,
1417        selection: Selection,
1418        graphql_client: DynGraphQLClient,
1419    ) -> Self {
1420        Self {
1421            proc,
1422            selection,
1423            graphql_client,
1424        }
1425    }
1426}
1427impl ArtifactPath {
1428    /// A unique identifier for this ArtifactPath.
1429    pub async fn id(&self) -> Result<Id, DaggerError> {
1430        let query = self.selection.select("id");
1431        query.execute(self.graphql_client.clone()).await
1432    }
1433    /// The installed module name.
1434    pub async fn module_name(&self) -> Result<String, DaggerError> {
1435        let query = self.selection.select("moduleName");
1436        query.execute(self.graphql_client.clone()).await
1437    }
1438    /// The DAG address of this path, without dimension keys.
1439    pub async fn uri(&self) -> Result<String, DaggerError> {
1440        let query = self.selection.select("uri");
1441        query.execute(self.graphql_client.clone()).await
1442    }
1443    /// The description of the field at this path.
1444    pub async fn description(&self) -> Result<String, DaggerError> {
1445        let query = self.selection.select("description");
1446        query.execute(self.graphql_client.clone()).await
1447    }
1448    /// A module load failure for this path, or an empty string.
1449    pub async fn load_error(&self) -> Result<String, DaggerError> {
1450        let query = self.selection.select("loadError");
1451        query.execute(self.graphql_client.clone()).await
1452    }
1453    /// The dimension identifiers required by this path.
1454    pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
1455        let query = self.selection.select("dimensions");
1456        query.execute(self.graphql_client.clone()).await
1457    }
1458}
1459impl Node for ArtifactPath {
1460    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1461        let query = self.selection.select("id");
1462        let graphql_client = self.graphql_client.clone();
1463        async move { query.execute(graphql_client).await }
1464    }
1465}
1466#[derive(Clone)]
1467pub struct ArtifactResult {
1468    pub proc: Option<Arc<DaggerSessionProc>>,
1469    pub selection: Selection,
1470    pub graphql_client: DynGraphQLClient,
1471}
1472impl IntoID<Id> for ArtifactResult {
1473    fn into_id(
1474        self,
1475    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1476        Box::pin(async move { self.id().await })
1477    }
1478}
1479impl Loadable for ArtifactResult {
1480    fn graphql_type() -> &'static str {
1481        "ArtifactResult"
1482    }
1483    fn from_query(
1484        proc: Option<Arc<DaggerSessionProc>>,
1485        selection: Selection,
1486        graphql_client: DynGraphQLClient,
1487    ) -> Self {
1488        Self {
1489            proc,
1490            selection,
1491            graphql_client,
1492        }
1493    }
1494}
1495impl ArtifactResult {
1496    /// A unique identifier for this ArtifactResult.
1497    pub async fn id(&self) -> Result<Id, DaggerError> {
1498        let query = self.selection.select("id");
1499        query.execute(self.graphql_client.clone()).await
1500    }
1501    /// The artifact that was evaluated.
1502    pub fn artifact(&self) -> Artifact {
1503        let query = self.selection.select("artifact");
1504        Artifact {
1505            proc: self.proc.clone(),
1506            selection: query,
1507            graphql_client: self.graphql_client.clone(),
1508        }
1509    }
1510    /// The evaluation failure, if any.
1511    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1512        let query = self.selection.select("error");
1513        let query = query.select("id");
1514        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1515        Ok(id.map(|id| Error {
1516            proc: self.proc.clone(),
1517            selection: query
1518                .root()
1519                .select("node")
1520                .arg("id", &id.0)
1521                .inline_fragment("Error"),
1522            graphql_client: self.graphql_client.clone(),
1523        }))
1524    }
1525    /// The evaluated value, or null when evaluation failed.
1526    pub async fn value(&self) -> Result<Option<NodeClient>, DaggerError> {
1527        let query = self.selection.select("value");
1528        let query = query.select("id");
1529        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1530        Ok(id.map(|id| NodeClient {
1531            proc: self.proc.clone(),
1532            selection: query
1533                .root()
1534                .select("node")
1535                .arg("id", &id.0)
1536                .inline_fragment("Node"),
1537            graphql_client: self.graphql_client.clone(),
1538        }))
1539    }
1540}
1541impl Node for ArtifactResult {
1542    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1543        let query = self.selection.select("id");
1544        let graphql_client = self.graphql_client.clone();
1545        async move { query.execute(graphql_client).await }
1546    }
1547}
1548#[derive(Clone)]
1549pub struct Artifacts {
1550    pub proc: Option<Arc<DaggerSessionProc>>,
1551    pub selection: Selection,
1552    pub graphql_client: DynGraphQLClient,
1553}
1554#[derive(Builder, Debug, PartialEq)]
1555pub struct ArtifactsPathDefinitionsOpts<'a> {
1556    /// Prefix each address with the workspace's Git address and commit.
1557    #[builder(setter(into, strip_option), default)]
1558    pub absolute: Option<bool>,
1559    /// Project paths to the items of this collection dimension. Preserve parent dimensions and remove descendant dimensions.
1560    #[builder(setter(into, strip_option), default)]
1561    pub dimension: Option<&'a str>,
1562    /// Include the artifact type in each address scheme.
1563    #[builder(setter(into, strip_option), default)]
1564    pub type_assertion: Option<bool>,
1565}
1566#[derive(Builder, Debug, PartialEq)]
1567pub struct ArtifactsValuesOpts {
1568    /// Field arguments applied to each artifact, as a JSON object.
1569    #[builder(setter(into, strip_option), default)]
1570    pub arguments: Option<Json>,
1571    /// Cancel remaining work after the first failure.
1572    #[builder(setter(into, strip_option), default)]
1573    pub fail_fast: Option<bool>,
1574    /// 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.
1575    #[builder(setter(into, strip_option), default)]
1576    pub max_concurrency: Option<isize>,
1577}
1578#[derive(Builder, Debug, PartialEq)]
1579pub struct ArtifactsFilterDirectivesOpts {
1580    /// Remove the matching artifacts instead.
1581    #[builder(setter(into, strip_option), default)]
1582    pub exclude: Option<bool>,
1583}
1584#[derive(Builder, Debug, PartialEq)]
1585pub struct ArtifactsFilterParentTypesOpts {
1586    /// Remove the matching artifacts instead.
1587    #[builder(setter(into, strip_option), default)]
1588    pub exclude: Option<bool>,
1589}
1590#[derive(Builder, Debug, PartialEq)]
1591pub struct ArtifactsFilterParentDirectivesOpts {
1592    /// Remove the matching artifacts instead.
1593    #[builder(setter(into, strip_option), default)]
1594    pub exclude: Option<bool>,
1595}
1596#[derive(Builder, Debug, PartialEq)]
1597pub struct ArtifactsFilterTypesOpts {
1598    /// Remove the matching artifacts instead.
1599    #[builder(setter(into, strip_option), default)]
1600    pub exclude: Option<bool>,
1601}
1602impl IntoID<Id> for Artifacts {
1603    fn into_id(
1604        self,
1605    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1606        Box::pin(async move { self.id().await })
1607    }
1608}
1609impl Loadable for Artifacts {
1610    fn graphql_type() -> &'static str {
1611        "Artifacts"
1612    }
1613    fn from_query(
1614        proc: Option<Arc<DaggerSessionProc>>,
1615        selection: Selection,
1616        graphql_client: DynGraphQLClient,
1617    ) -> Self {
1618        Self {
1619            proc,
1620            selection,
1621            graphql_client,
1622        }
1623    }
1624}
1625impl Artifacts {
1626    /// A unique identifier for this Artifacts.
1627    pub async fn id(&self) -> Result<Id, DaggerError> {
1628        let query = self.selection.select("id");
1629        query.execute(self.graphql_client.clone()).await
1630    }
1631    /// Convert the selection to expertise without running the functions. Each must take one LLM! argument and return LLM!; any other arguments must be optional or auto-filled. Agent arguments receive the agent that owns the conversation. A module load failure fails with its load error.
1632    pub async fn as_expertise(&self) -> Result<Vec<Expertise>, DaggerError> {
1633        let query = self.selection.select("asExpertise");
1634        let query = query.select("id");
1635        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1636        Ok(ids
1637            .into_iter()
1638            .map(|id| Expertise {
1639                proc: self.proc.clone(),
1640                selection: crate::querybuilder::query()
1641                    .select("node")
1642                    .arg("id", &id.0)
1643                    .inline_fragment("Expertise"),
1644                graphql_client: self.graphql_client.clone(),
1645            })
1646            .collect())
1647    }
1648    /// Convert the selection to Generators without running them. Fail if any artifact is not a Generator. Module load failures are skipped: generating can repair them.
1649    pub async fn as_generators(&self) -> Result<Vec<Generator>, DaggerError> {
1650        let query = self.selection.select("asGenerators");
1651        let query = query.select("id");
1652        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1653        Ok(ids
1654            .into_iter()
1655            .map(|id| Generator {
1656                proc: self.proc.clone(),
1657                selection: crate::querybuilder::query()
1658                    .select("node")
1659                    .arg("id", &id.0)
1660                    .inline_fragment("Generator"),
1661                graphql_client: self.graphql_client.clone(),
1662            })
1663            .collect())
1664    }
1665    /// Convert the selection to Checks. Fail if any artifact is not a Check. A module load failure is a Check that fails with its load error. Does not apply command filters or run the checks.
1666    pub async fn as_checks(&self) -> Result<Vec<Check>, DaggerError> {
1667        let query = self.selection.select("asChecks");
1668        let query = query.select("id");
1669        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1670        Ok(ids
1671            .into_iter()
1672            .map(|id| Check {
1673                proc: self.proc.clone(),
1674                selection: crate::querybuilder::query()
1675                    .select("node")
1676                    .arg("id", &id.0)
1677                    .inline_fragment("Check"),
1678                graphql_client: self.graphql_client.clone(),
1679            })
1680            .collect())
1681    }
1682    /// Convert the selection to Changesets. Fail if any artifact is not a Changeset; a module load failure fails with its load error. Does not apply command filters.
1683    pub async fn as_changesets(&self) -> Result<Vec<Changeset>, DaggerError> {
1684        let query = self.selection.select("asChangesets");
1685        let query = query.select("id");
1686        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1687        Ok(ids
1688            .into_iter()
1689            .map(|id| Changeset {
1690                proc: self.proc.clone(),
1691                selection: crate::querybuilder::query()
1692                    .select("node")
1693                    .arg("id", &id.0)
1694                    .inline_fragment("Changeset"),
1695                graphql_client: self.graphql_client.clone(),
1696            })
1697            .collect())
1698    }
1699    /// Convert the selection to Services. Fail if any artifact is not a Service; a module load failure fails with its load error. Does not apply command filters or start the services.
1700    pub async fn as_services(&self) -> Result<Vec<Service>, DaggerError> {
1701        let query = self.selection.select("asServices");
1702        let query = query.select("id");
1703        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1704        Ok(ids
1705            .into_iter()
1706            .map(|id| Service {
1707                proc: self.proc.clone(),
1708                selection: crate::querybuilder::query()
1709                    .select("node")
1710                    .arg("id", &id.0)
1711                    .inline_fragment("Service"),
1712                graphql_client: self.graphql_client.clone(),
1713            })
1714            .collect())
1715    }
1716    /// List selected schema paths, including empty collections. Does not read runtime values. Applies type keys and collection presence; collection key values require items.
1717    ///
1718    /// # Arguments
1719    ///
1720    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1721    pub async fn path_definitions(&self) -> Result<Vec<ArtifactPath>, DaggerError> {
1722        let query = self.selection.select("pathDefinitions");
1723        let query = query.select("id");
1724        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1725        Ok(ids
1726            .into_iter()
1727            .map(|id| ArtifactPath {
1728                proc: self.proc.clone(),
1729                selection: crate::querybuilder::query()
1730                    .select("node")
1731                    .arg("id", &id.0)
1732                    .inline_fragment("ArtifactPath"),
1733                graphql_client: self.graphql_client.clone(),
1734            })
1735            .collect())
1736    }
1737    /// List selected schema paths, including empty collections. Does not read runtime values. Applies type keys and collection presence; collection key values require items.
1738    ///
1739    /// # Arguments
1740    ///
1741    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1742    pub async fn path_definitions_opts<'a>(
1743        &self,
1744        opts: ArtifactsPathDefinitionsOpts<'a>,
1745    ) -> Result<Vec<ArtifactPath>, DaggerError> {
1746        let mut query = self.selection.select("pathDefinitions");
1747        if let Some(absolute) = opts.absolute {
1748            query = query.arg("absolute", absolute);
1749        }
1750        if let Some(type_assertion) = opts.type_assertion {
1751            query = query.arg("typeAssertion", type_assertion);
1752        }
1753        if let Some(dimension) = opts.dimension {
1754            query = query.arg("dimension", dimension);
1755        }
1756        let query = query.select("id");
1757        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1758        Ok(ids
1759            .into_iter()
1760            .map(|id| ArtifactPath {
1761                proc: self.proc.clone(),
1762                selection: crate::querybuilder::query()
1763                    .select("node")
1764                    .arg("id", &id.0)
1765                    .inline_fragment("ArtifactPath"),
1766                graphql_client: self.graphql_client.clone(),
1767            })
1768            .collect())
1769    }
1770    /// List dimensions on the selected schema paths, including empty collections. Does not read runtime values.
1771    pub async fn dimension_definitions(&self) -> Result<Vec<ArtifactDimension>, DaggerError> {
1772        let query = self.selection.select("dimensionDefinitions");
1773        let query = query.select("id");
1774        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1775        Ok(ids
1776            .into_iter()
1777            .map(|id| ArtifactDimension {
1778                proc: self.proc.clone(),
1779                selection: crate::querybuilder::query()
1780                    .select("node")
1781                    .arg("id", &id.0)
1782                    .inline_fragment("ArtifactDimension"),
1783                graphql_client: self.graphql_client.clone(),
1784            })
1785            .collect())
1786    }
1787    /// Evaluate the selection in parallel, retaining each result and error.
1788    ///
1789    /// # Arguments
1790    ///
1791    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1792    pub async fn values(&self) -> Result<Vec<ArtifactResult>, DaggerError> {
1793        let query = self.selection.select("values");
1794        let query = query.select("id");
1795        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1796        Ok(ids
1797            .into_iter()
1798            .map(|id| ArtifactResult {
1799                proc: self.proc.clone(),
1800                selection: crate::querybuilder::query()
1801                    .select("node")
1802                    .arg("id", &id.0)
1803                    .inline_fragment("ArtifactResult"),
1804                graphql_client: self.graphql_client.clone(),
1805            })
1806            .collect())
1807    }
1808    /// Evaluate the selection in parallel, retaining each result and error.
1809    ///
1810    /// # Arguments
1811    ///
1812    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1813    pub async fn values_opts(
1814        &self,
1815        opts: ArtifactsValuesOpts,
1816    ) -> Result<Vec<ArtifactResult>, DaggerError> {
1817        let mut query = self.selection.select("values");
1818        if let Some(fail_fast) = opts.fail_fast {
1819            query = query.arg("failFast", fail_fast);
1820        }
1821        if let Some(arguments) = opts.arguments {
1822            query = query.arg("arguments", arguments);
1823        }
1824        if let Some(max_concurrency) = opts.max_concurrency {
1825            query = query.arg("maxConcurrency", max_concurrency);
1826        }
1827        let query = query.select("id");
1828        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1829        Ok(ids
1830            .into_iter()
1831            .map(|id| ArtifactResult {
1832                proc: self.proc.clone(),
1833                selection: crate::querybuilder::query()
1834                    .select("node")
1835                    .arg("id", &id.0)
1836                    .inline_fragment("ArtifactResult"),
1837                graphql_client: self.graphql_client.clone(),
1838            })
1839            .collect())
1840    }
1841    /// List the modules represented in this selection without evaluating artifact values.
1842    pub async fn modules(&self) -> Result<Vec<Module>, DaggerError> {
1843        let query = self.selection.select("modules");
1844        let query = query.select("id");
1845        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1846        Ok(ids
1847            .into_iter()
1848            .map(|id| Module {
1849                proc: self.proc.clone(),
1850                selection: crate::querybuilder::query()
1851                    .select("node")
1852                    .arg("id", &id.0)
1853                    .inline_fragment("Module"),
1854                graphql_client: self.graphql_client.clone(),
1855            })
1856            .collect())
1857    }
1858    /// List concrete type definitions represented in this selection, sorted by name with no duplicates.
1859    pub async fn types(&self) -> Result<Vec<TypeDef>, DaggerError> {
1860        let query = self.selection.select("types");
1861        let query = query.select("id");
1862        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1863        Ok(ids
1864            .into_iter()
1865            .map(|id| TypeDef {
1866                proc: self.proc.clone(),
1867                selection: crate::querybuilder::query()
1868                    .select("node")
1869                    .arg("id", &id.0)
1870                    .inline_fragment("TypeDef"),
1871                graphql_client: self.graphql_client.clone(),
1872            })
1873            .collect())
1874    }
1875    /// Keep artifacts with any listed directive. Does not filter by type or workspace settings.
1876    ///
1877    /// # Arguments
1878    ///
1879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1880    pub fn filter_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1881        let mut query = self.selection.select("filterDirectives");
1882        query = query.arg(
1883            "directives",
1884            directives
1885                .into_iter()
1886                .map(|i| i.into())
1887                .collect::<Vec<String>>(),
1888        );
1889        Artifacts {
1890            proc: self.proc.clone(),
1891            selection: query,
1892            graphql_client: self.graphql_client.clone(),
1893        }
1894    }
1895    /// Keep artifacts with any listed directive. Does not filter by type or workspace settings.
1896    ///
1897    /// # Arguments
1898    ///
1899    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1900    pub fn filter_directives_opts(
1901        &self,
1902        directives: Vec<impl Into<String>>,
1903        opts: ArtifactsFilterDirectivesOpts,
1904    ) -> Artifacts {
1905        let mut query = self.selection.select("filterDirectives");
1906        query = query.arg(
1907            "directives",
1908            directives
1909                .into_iter()
1910                .map(|i| i.into())
1911                .collect::<Vec<String>>(),
1912        );
1913        if let Some(exclude) = opts.exclude {
1914            query = query.arg("exclude", exclude);
1915        }
1916        Artifacts {
1917            proc: self.proc.clone(),
1918            selection: query,
1919            graphql_client: self.graphql_client.clone(),
1920        }
1921    }
1922    /// Keep artifacts whose immediate parent has any listed object type. Artifacts without a typed parent do not match.
1923    ///
1924    /// # Arguments
1925    ///
1926    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1927    pub fn filter_parent_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
1928        let mut query = self.selection.select("filterParentTypes");
1929        query = query.arg(
1930            "types",
1931            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1932        );
1933        Artifacts {
1934            proc: self.proc.clone(),
1935            selection: query,
1936            graphql_client: self.graphql_client.clone(),
1937        }
1938    }
1939    /// Keep artifacts whose immediate parent has any listed object type. Artifacts without a typed parent do not match.
1940    ///
1941    /// # Arguments
1942    ///
1943    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1944    pub fn filter_parent_types_opts(
1945        &self,
1946        types: Vec<impl Into<String>>,
1947        opts: ArtifactsFilterParentTypesOpts,
1948    ) -> Artifacts {
1949        let mut query = self.selection.select("filterParentTypes");
1950        query = query.arg(
1951            "types",
1952            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1953        );
1954        if let Some(exclude) = opts.exclude {
1955            query = query.arg("exclude", exclude);
1956        }
1957        Artifacts {
1958            proc: self.proc.clone(),
1959            selection: query,
1960            graphql_client: self.graphql_client.clone(),
1961        }
1962    }
1963    /// Keep artifacts whose immediate parent has any listed directive. Artifacts without a parent do not match.
1964    ///
1965    /// # Arguments
1966    ///
1967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1968    pub fn filter_parent_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1969        let mut query = self.selection.select("filterParentDirectives");
1970        query = query.arg(
1971            "directives",
1972            directives
1973                .into_iter()
1974                .map(|i| i.into())
1975                .collect::<Vec<String>>(),
1976        );
1977        Artifacts {
1978            proc: self.proc.clone(),
1979            selection: query,
1980            graphql_client: self.graphql_client.clone(),
1981        }
1982    }
1983    /// Keep artifacts whose immediate parent has any listed directive. Artifacts without a parent do not match.
1984    ///
1985    /// # Arguments
1986    ///
1987    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1988    pub fn filter_parent_directives_opts(
1989        &self,
1990        directives: Vec<impl Into<String>>,
1991        opts: ArtifactsFilterParentDirectivesOpts,
1992    ) -> Artifacts {
1993        let mut query = self.selection.select("filterParentDirectives");
1994        query = query.arg(
1995            "directives",
1996            directives
1997                .into_iter()
1998                .map(|i| i.into())
1999                .collect::<Vec<String>>(),
2000        );
2001        if let Some(exclude) = opts.exclude {
2002            query = query.arg("exclude", exclude);
2003        }
2004        Artifacts {
2005            proc: self.proc.clone(),
2006            selection: query,
2007            graphql_client: self.graphql_client.clone(),
2008        }
2009    }
2010    /// Combine two selections, keeping each workspace address once. Different addresses remain distinct even if they return the same object.
2011    pub fn with_artifacts(&self, artifacts: impl IntoID<Id>) -> Artifacts {
2012        let mut query = self.selection.select("withArtifacts");
2013        query = query.arg_lazy(
2014            "artifacts",
2015            Box::new(move || {
2016                let artifacts = artifacts.clone();
2017                Box::pin(async move { artifacts.into_id().await.unwrap().quote() })
2018            }),
2019        );
2020        Artifacts {
2021            proc: self.proc.clone(),
2022            selection: query,
2023            graphql_client: self.graphql_client.clone(),
2024        }
2025    }
2026    /// Remove artifacts selected by a DAG address.
2027    pub fn without_uri(&self, uri: impl Into<String>) -> Artifacts {
2028        let mut query = self.selection.select("withoutUri");
2029        query = query.arg("uri", uri.into());
2030        Artifacts {
2031            proc: self.proc.clone(),
2032            selection: query,
2033            graphql_client: self.graphql_client.clone(),
2034        }
2035    }
2036    /// Keep artifacts of any listed concrete GraphQL type.
2037    ///
2038    /// # Arguments
2039    ///
2040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2041    pub fn filter_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
2042        let mut query = self.selection.select("filterTypes");
2043        query = query.arg(
2044            "types",
2045            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2046        );
2047        Artifacts {
2048            proc: self.proc.clone(),
2049            selection: query,
2050            graphql_client: self.graphql_client.clone(),
2051        }
2052    }
2053    /// Keep artifacts of any listed concrete GraphQL type.
2054    ///
2055    /// # Arguments
2056    ///
2057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2058    pub fn filter_types_opts(
2059        &self,
2060        types: Vec<impl Into<String>>,
2061        opts: ArtifactsFilterTypesOpts,
2062    ) -> Artifacts {
2063        let mut query = self.selection.select("filterTypes");
2064        query = query.arg(
2065            "types",
2066            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2067        );
2068        if let Some(exclude) = opts.exclude {
2069            query = query.arg("exclude", exclude);
2070        }
2071        Artifacts {
2072            proc: self.proc.clone(),
2073            selection: query,
2074            graphql_client: self.graphql_client.clone(),
2075        }
2076    }
2077    /// Match one complete, ordered field sequence exactly.
2078    pub fn filter_path(&self, path: Vec<impl Into<String>>) -> Artifacts {
2079        let mut query = self.selection.select("filterPath");
2080        query = query.arg(
2081            "path",
2082            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2083        );
2084        Artifacts {
2085            proc: self.proc.clone(),
2086            selection: query,
2087            graphql_client: self.graphql_client.clone(),
2088        }
2089    }
2090    /// Keep paths that match a glob pattern. A literal path matches exactly. Both module-qualified and workspace main paths match.
2091    pub fn filter_path_pattern(&self, pattern: impl Into<String>) -> Artifacts {
2092        let mut query = self.selection.select("filterPathPattern");
2093        query = query.arg("pattern", pattern.into());
2094        Artifacts {
2095            proc: self.proc.clone(),
2096            selection: query,
2097            graphql_client: self.graphql_client.clone(),
2098        }
2099    }
2100    /// Keep artifacts selected through any listed dimension.
2101    pub fn filter_dimensions(&self, dimensions: Vec<impl Into<String>>) -> Artifacts {
2102        let mut query = self.selection.select("filterDimensions");
2103        query = query.arg(
2104            "dimensions",
2105            dimensions
2106                .into_iter()
2107                .map(|i| i.into())
2108                .collect::<Vec<String>>(),
2109        );
2110        Artifacts {
2111            proc: self.proc.clone(),
2112            selection: query,
2113            graphql_client: self.graphql_client.clone(),
2114        }
2115    }
2116    /// Keep artifacts with any listed key in this dimension.
2117    pub fn filter_dimension_keys(
2118        &self,
2119        dimension: impl Into<String>,
2120        keys: Vec<impl Into<String>>,
2121    ) -> Artifacts {
2122        let mut query = self.selection.select("filterDimensionKeys");
2123        query = query.arg("dimension", dimension.into());
2124        query = query.arg(
2125            "keys",
2126            keys.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2127        );
2128        Artifacts {
2129            proc: self.proc.clone(),
2130            selection: query,
2131            graphql_client: self.graphql_client.clone(),
2132        }
2133    }
2134    /// Apply a DAG address as one filter: the chain of path, type, and dimension-key filters it encodes.
2135    /// The scheme is optional. The path may be a pattern; an empty path selects all artifacts.
2136    /// A module that failed to load keeps its load failure when the module could hold what the address selects, as with every filter (see Artifacts).
2137    ///
2138    /// # Arguments
2139    ///
2140    /// * `uri` - A DAG address: [dag[+<type>]://][<path>][?<dimension>=<key>&...]
2141    pub fn filter_uri(&self, uri: impl Into<String>) -> Artifacts {
2142        let mut query = self.selection.select("filterUri");
2143        query = query.arg("uri", uri.into());
2144        Artifacts {
2145            proc: self.proc.clone(),
2146            selection: query,
2147            graphql_client: self.graphql_client.clone(),
2148        }
2149    }
2150    /// List dimension identifiers represented in this selection, sorted with no duplicates.
2151    pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
2152        let query = self.selection.select("dimensions");
2153        query.execute(self.graphql_client.clone()).await
2154    }
2155    /// List keys represented in this selection for the given dimension, sorted with no duplicates.
2156    pub async fn dimension_keys(
2157        &self,
2158        dimension: impl Into<String>,
2159    ) -> Result<Vec<String>, DaggerError> {
2160        let mut query = self.selection.select("dimensionKeys");
2161        query = query.arg("dimension", dimension.into());
2162        query.execute(self.graphql_client.clone()).await
2163    }
2164    /// List collection items represented in this selection for the given dimension. Preserve parent keys and remove duplicate item addresses. Does not evaluate item values.
2165    pub async fn dimension_items(
2166        &self,
2167        dimension: impl Into<String>,
2168    ) -> Result<Vec<Artifact>, DaggerError> {
2169        let mut query = self.selection.select("dimensionItems");
2170        query = query.arg("dimension", dimension.into());
2171        let query = query.select("id");
2172        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2173        Ok(ids
2174            .into_iter()
2175            .map(|id| Artifact {
2176                proc: self.proc.clone(),
2177                selection: crate::querybuilder::query()
2178                    .select("node")
2179                    .arg("id", &id.0)
2180                    .inline_fragment("Artifact"),
2181                graphql_client: self.graphql_client.clone(),
2182            })
2183            .collect())
2184    }
2185    /// Enumerate complete artifacts without evaluating their values.
2186    pub async fn items(&self) -> Result<Vec<Artifact>, DaggerError> {
2187        let query = self.selection.select("items");
2188        let query = query.select("id");
2189        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2190        Ok(ids
2191            .into_iter()
2192            .map(|id| Artifact {
2193                proc: self.proc.clone(),
2194                selection: crate::querybuilder::query()
2195                    .select("node")
2196                    .arg("id", &id.0)
2197                    .inline_fragment("Artifact"),
2198                graphql_client: self.graphql_client.clone(),
2199            })
2200            .collect())
2201    }
2202    /// Require exactly one artifact; fail if there are zero or multiple matches. Several matches are listed, one address per line.
2203    pub fn one(&self) -> Artifact {
2204        let query = self.selection.select("one");
2205        Artifact {
2206            proc: self.proc.clone(),
2207            selection: query,
2208            graphql_client: self.graphql_client.clone(),
2209        }
2210    }
2211    /// The DAG address that selects this whole selection: filterUri(uri) selects the same set.
2212    pub async fn uri(&self) -> Result<String, DaggerError> {
2213        let query = self.selection.select("uri");
2214        query.execute(self.graphql_client.clone()).await
2215    }
2216}
2217impl Node for Artifacts {
2218    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2219        let query = self.selection.select("id");
2220        let graphql_client = self.graphql_client.clone();
2221        async move { query.execute(graphql_client).await }
2222    }
2223}
2224#[derive(Clone)]
2225pub struct CacheVolume {
2226    pub proc: Option<Arc<DaggerSessionProc>>,
2227    pub selection: Selection,
2228    pub graphql_client: DynGraphQLClient,
2229}
2230impl IntoID<Id> for CacheVolume {
2231    fn into_id(
2232        self,
2233    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2234        Box::pin(async move { self.id().await })
2235    }
2236}
2237impl Loadable for CacheVolume {
2238    fn graphql_type() -> &'static str {
2239        "CacheVolume"
2240    }
2241    fn from_query(
2242        proc: Option<Arc<DaggerSessionProc>>,
2243        selection: Selection,
2244        graphql_client: DynGraphQLClient,
2245    ) -> Self {
2246        Self {
2247            proc,
2248            selection,
2249            graphql_client,
2250        }
2251    }
2252}
2253impl CacheVolume {
2254    /// A unique identifier for this CacheVolume.
2255    pub async fn id(&self) -> Result<Id, DaggerError> {
2256        let query = self.selection.select("id");
2257        query.execute(self.graphql_client.clone()).await
2258    }
2259}
2260impl Node for CacheVolume {
2261    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2262        let query = self.selection.select("id");
2263        let graphql_client = self.graphql_client.clone();
2264        async move { query.execute(graphql_client).await }
2265    }
2266}
2267#[derive(Clone)]
2268pub struct Changeset {
2269    pub proc: Option<Arc<DaggerSessionProc>>,
2270    pub selection: Selection,
2271    pub graphql_client: DynGraphQLClient,
2272}
2273#[derive(Builder, Debug, PartialEq)]
2274pub struct ChangesetFilterOpts<'a> {
2275    /// Exclude changes at paths matching these patterns.
2276    #[builder(setter(into, strip_option), default)]
2277    pub exclude: Option<Vec<&'a str>>,
2278    /// Only include changes at paths matching these patterns. Empty includes all paths.
2279    #[builder(setter(into, strip_option), default)]
2280    pub include: Option<Vec<&'a str>>,
2281}
2282#[derive(Builder, Debug, PartialEq)]
2283pub struct ChangesetWithChangesetOpts {
2284    /// What to do on a merge conflict
2285    #[builder(setter(into, strip_option), default)]
2286    pub on_conflict: Option<ChangesetMergeConflict>,
2287}
2288#[derive(Builder, Debug, PartialEq)]
2289pub struct ChangesetWithChangesetsOpts {
2290    /// What to do on a merge conflict
2291    #[builder(setter(into, strip_option), default)]
2292    pub on_conflict: Option<ChangesetsMergeConflict>,
2293}
2294impl IntoID<Id> for Changeset {
2295    fn into_id(
2296        self,
2297    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2298        Box::pin(async move { self.id().await })
2299    }
2300}
2301impl Loadable for Changeset {
2302    fn graphql_type() -> &'static str {
2303        "Changeset"
2304    }
2305    fn from_query(
2306        proc: Option<Arc<DaggerSessionProc>>,
2307        selection: Selection,
2308        graphql_client: DynGraphQLClient,
2309    ) -> Self {
2310        Self {
2311            proc,
2312            selection,
2313            graphql_client,
2314        }
2315    }
2316}
2317impl Changeset {
2318    /// A unique identifier for this Changeset.
2319    pub async fn id(&self) -> Result<Id, DaggerError> {
2320        let query = self.selection.select("id");
2321        query.execute(self.graphql_client.clone()).await
2322    }
2323    /// Force evaluation in the engine.
2324    pub async fn sync(&self) -> Result<Changeset, DaggerError> {
2325        let query = self.selection.select("sync");
2326        let id: Id = query.execute(self.graphql_client.clone()).await?;
2327        Ok(Changeset {
2328            proc: self.proc.clone(),
2329            selection: query
2330                .root()
2331                .select("node")
2332                .arg("id", &id.0)
2333                .inline_fragment("Changeset"),
2334            graphql_client: self.graphql_client.clone(),
2335        })
2336    }
2337    /// Select changes matching the supplied glob patterns, preserving their original baseline.
2338    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
2339    ///
2340    /// # Arguments
2341    ///
2342    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2343    pub fn filter(&self) -> Changeset {
2344        let query = self.selection.select("filter");
2345        Changeset {
2346            proc: self.proc.clone(),
2347            selection: query,
2348            graphql_client: self.graphql_client.clone(),
2349        }
2350    }
2351    /// Select changes matching the supplied glob patterns, preserving their original baseline.
2352    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
2353    ///
2354    /// # Arguments
2355    ///
2356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2357    pub fn filter_opts<'a>(&self, opts: ChangesetFilterOpts<'a>) -> Changeset {
2358        let mut query = self.selection.select("filter");
2359        if let Some(include) = opts.include {
2360            query = query.arg("include", include);
2361        }
2362        if let Some(exclude) = opts.exclude {
2363            query = query.arg("exclude", exclude);
2364        }
2365        Changeset {
2366            proc: self.proc.clone(),
2367            selection: query,
2368            graphql_client: self.graphql_client.clone(),
2369        }
2370    }
2371    /// Return a snapshot containing only the created and modified files
2372    pub fn layer(&self) -> Directory {
2373        let query = self.selection.select("layer");
2374        Directory {
2375            proc: self.proc.clone(),
2376            selection: query,
2377            graphql_client: self.graphql_client.clone(),
2378        }
2379    }
2380    /// Return a Git-compatible patch of the changes
2381    pub fn as_patch(&self) -> File {
2382        let query = self.selection.select("asPatch");
2383        File {
2384            proc: self.proc.clone(),
2385            selection: query,
2386            graphql_client: self.graphql_client.clone(),
2387        }
2388    }
2389    /// Applies the diff represented by this changeset to a path on the host.
2390    ///
2391    /// # Arguments
2392    ///
2393    /// * `path` - Location of the copied directory (e.g., "logs/").
2394    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2395        let mut query = self.selection.select("export");
2396        query = query.arg("path", path.into());
2397        query.execute(self.graphql_client.clone()).await
2398    }
2399    /// Returns true if the changeset is empty (i.e. there are no changes).
2400    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2401        let query = self.selection.select("isEmpty");
2402        query.execute(self.graphql_client.clone()).await
2403    }
2404    /// Files and directories that were added in the newer directory.
2405    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2406        let query = self.selection.select("addedPaths");
2407        query.execute(self.graphql_client.clone()).await
2408    }
2409    /// Files and directories that existed before and were updated in the newer directory.
2410    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2411        let query = self.selection.select("modifiedPaths");
2412        query.execute(self.graphql_client.clone()).await
2413    }
2414    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2415    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2416        let query = self.selection.select("removedPaths");
2417        query.execute(self.graphql_client.clone()).await
2418    }
2419    /// Structured per-path diff statistics (kind and line counts) for this changeset.
2420    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
2421        let query = self.selection.select("diffStats");
2422        let query = query.select("id");
2423        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2424        Ok(ids
2425            .into_iter()
2426            .map(|id| DiffStat {
2427                proc: self.proc.clone(),
2428                selection: crate::querybuilder::query()
2429                    .select("node")
2430                    .arg("id", &id.0)
2431                    .inline_fragment("DiffStat"),
2432                graphql_client: self.graphql_client.clone(),
2433            })
2434            .collect())
2435    }
2436    /// Add changes to an existing changeset
2437    /// 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
2438    ///
2439    /// # Arguments
2440    ///
2441    /// * `changes` - Changes to merge into the actual changeset
2442    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2443    pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
2444        let mut query = self.selection.select("withChangeset");
2445        query = query.arg_lazy(
2446            "changes",
2447            Box::new(move || {
2448                let changes = changes.clone();
2449                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2450            }),
2451        );
2452        Changeset {
2453            proc: self.proc.clone(),
2454            selection: query,
2455            graphql_client: self.graphql_client.clone(),
2456        }
2457    }
2458    /// Add changes to an existing changeset
2459    /// 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
2460    ///
2461    /// # Arguments
2462    ///
2463    /// * `changes` - Changes to merge into the actual changeset
2464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2465    pub fn with_changeset_opts(
2466        &self,
2467        changes: impl IntoID<Id>,
2468        opts: ChangesetWithChangesetOpts,
2469    ) -> Changeset {
2470        let mut query = self.selection.select("withChangeset");
2471        query = query.arg_lazy(
2472            "changes",
2473            Box::new(move || {
2474                let changes = changes.clone();
2475                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2476            }),
2477        );
2478        if let Some(on_conflict) = opts.on_conflict {
2479            query = query.arg("onConflict", on_conflict);
2480        }
2481        Changeset {
2482            proc: self.proc.clone(),
2483            selection: query,
2484            graphql_client: self.graphql_client.clone(),
2485        }
2486    }
2487    /// Add changes from multiple changesets using git octopus merge strategy
2488    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2489    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2490    ///
2491    /// # Arguments
2492    ///
2493    /// * `changes` - List of changesets to merge into the actual changeset
2494    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2495    pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
2496        let mut query = self.selection.select("withChangesets");
2497        query = query.arg("changes", changes);
2498        Changeset {
2499            proc: self.proc.clone(),
2500            selection: query,
2501            graphql_client: self.graphql_client.clone(),
2502        }
2503    }
2504    /// Add changes from multiple changesets using git octopus merge strategy
2505    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2506    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2507    ///
2508    /// # Arguments
2509    ///
2510    /// * `changes` - List of changesets to merge into the actual changeset
2511    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2512    pub fn with_changesets_opts(
2513        &self,
2514        changes: Vec<Id>,
2515        opts: ChangesetWithChangesetsOpts,
2516    ) -> Changeset {
2517        let mut query = self.selection.select("withChangesets");
2518        query = query.arg("changes", changes);
2519        if let Some(on_conflict) = opts.on_conflict {
2520            query = query.arg("onConflict", on_conflict);
2521        }
2522        Changeset {
2523            proc: self.proc.clone(),
2524            selection: query,
2525            graphql_client: self.graphql_client.clone(),
2526        }
2527    }
2528    /// The older/lower snapshot to compare against.
2529    pub fn before(&self) -> Directory {
2530        let query = self.selection.select("before");
2531        Directory {
2532            proc: self.proc.clone(),
2533            selection: query,
2534            graphql_client: self.graphql_client.clone(),
2535        }
2536    }
2537    /// The newer/upper snapshot.
2538    pub fn after(&self) -> Directory {
2539        let query = self.selection.select("after");
2540        Directory {
2541            proc: self.proc.clone(),
2542            selection: query,
2543            graphql_client: self.graphql_client.clone(),
2544        }
2545    }
2546}
2547impl Exportable for Changeset {
2548    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2549        let query = self.selection.select("id");
2550        let graphql_client = self.graphql_client.clone();
2551        async move { query.execute(graphql_client).await }
2552    }
2553    fn export(
2554        &self,
2555        path: impl Into<String>,
2556    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
2557        let mut query = self.selection.select("export");
2558        query = query.arg("path", path.into());
2559        let graphql_client = self.graphql_client.clone();
2560        async move { query.execute(graphql_client).await }
2561    }
2562}
2563impl Node for Changeset {
2564    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2565        let query = self.selection.select("id");
2566        let graphql_client = self.graphql_client.clone();
2567        async move { query.execute(graphql_client).await }
2568    }
2569}
2570impl Syncer for Changeset {
2571    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2572        let query = self.selection.select("id");
2573        let graphql_client = self.graphql_client.clone();
2574        async move { query.execute(graphql_client).await }
2575    }
2576    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
2577        let query = self.selection.select("sync");
2578        let proc = self.proc.clone();
2579        let graphql_client = self.graphql_client.clone();
2580        async move {
2581            let id: Id = query.execute(graphql_client.clone()).await?;
2582            Ok(Self {
2583                proc,
2584                selection: query
2585                    .root()
2586                    .select("node")
2587                    .arg("id", &id.0)
2588                    .inline_fragment("Changeset"),
2589                graphql_client,
2590            })
2591        }
2592    }
2593}
2594#[derive(Clone)]
2595pub struct Check {
2596    pub proc: Option<Arc<DaggerSessionProc>>,
2597    pub selection: Selection,
2598    pub graphql_client: DynGraphQLClient,
2599}
2600impl IntoID<Id> for Check {
2601    fn into_id(
2602        self,
2603    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2604        Box::pin(async move { self.id().await })
2605    }
2606}
2607impl Loadable for Check {
2608    fn graphql_type() -> &'static str {
2609        "Check"
2610    }
2611    fn from_query(
2612        proc: Option<Arc<DaggerSessionProc>>,
2613        selection: Selection,
2614        graphql_client: DynGraphQLClient,
2615    ) -> Self {
2616        Self {
2617            proc,
2618            selection,
2619            graphql_client,
2620        }
2621    }
2622}
2623impl Check {
2624    /// A unique identifier for this Check.
2625    pub async fn id(&self) -> Result<Id, DaggerError> {
2626        let query = self.selection.select("id");
2627        query.execute(self.graphql_client.clone()).await
2628    }
2629    /// Run the check and retain its result.
2630    pub fn sync(&self) -> Check {
2631        let query = self.selection.select("sync");
2632        Check {
2633            proc: self.proc.clone(),
2634            selection: query,
2635            graphql_client: self.graphql_client.clone(),
2636        }
2637    }
2638    /// Run the check and return whether it passes.
2639    pub async fn pass(&self) -> Result<bool, DaggerError> {
2640        let query = self.selection.select("pass");
2641        query.execute(self.graphql_client.clone()).await
2642    }
2643    /// Run the check and return its failure, if any.
2644    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
2645        let query = self.selection.select("error");
2646        let query = query.select("id");
2647        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2648        Ok(id.map(|id| Error {
2649            proc: self.proc.clone(),
2650            selection: query
2651                .root()
2652                .select("node")
2653                .arg("id", &id.0)
2654                .inline_fragment("Error"),
2655            graphql_client: self.graphql_client.clone(),
2656        }))
2657    }
2658    /// The assertion that is false when this check fails.
2659    pub async fn assertion(&self) -> Result<String, DaggerError> {
2660        let query = self.selection.select("assertion");
2661        query.execute(self.graphql_client.clone()).await
2662    }
2663    /// An optional report produced by the check.
2664    pub async fn report(&self) -> Result<Option<Directory>, DaggerError> {
2665        let query = self.selection.select("report");
2666        let query = query.select("id");
2667        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2668        Ok(id.map(|id| Directory {
2669            proc: self.proc.clone(),
2670            selection: query
2671                .root()
2672                .select("node")
2673                .arg("id", &id.0)
2674                .inline_fragment("Directory"),
2675            graphql_client: self.graphql_client.clone(),
2676        }))
2677    }
2678}
2679impl Node for Check {
2680    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2681        let query = self.selection.select("id");
2682        let graphql_client = self.graphql_client.clone();
2683        async move { query.execute(graphql_client).await }
2684    }
2685}
2686#[derive(Clone)]
2687pub struct ClientFilesyncMirror {
2688    pub proc: Option<Arc<DaggerSessionProc>>,
2689    pub selection: Selection,
2690    pub graphql_client: DynGraphQLClient,
2691}
2692impl IntoID<Id> for ClientFilesyncMirror {
2693    fn into_id(
2694        self,
2695    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2696        Box::pin(async move { self.id().await })
2697    }
2698}
2699impl Loadable for ClientFilesyncMirror {
2700    fn graphql_type() -> &'static str {
2701        "ClientFilesyncMirror"
2702    }
2703    fn from_query(
2704        proc: Option<Arc<DaggerSessionProc>>,
2705        selection: Selection,
2706        graphql_client: DynGraphQLClient,
2707    ) -> Self {
2708        Self {
2709            proc,
2710            selection,
2711            graphql_client,
2712        }
2713    }
2714}
2715impl ClientFilesyncMirror {
2716    /// A unique identifier for this ClientFilesyncMirror.
2717    pub async fn id(&self) -> Result<Id, DaggerError> {
2718        let query = self.selection.select("id");
2719        query.execute(self.graphql_client.clone()).await
2720    }
2721}
2722impl Node for ClientFilesyncMirror {
2723    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2724        let query = self.selection.select("id");
2725        let graphql_client = self.graphql_client.clone();
2726        async move { query.execute(graphql_client).await }
2727    }
2728}
2729#[derive(Clone)]
2730pub struct Cloud {
2731    pub proc: Option<Arc<DaggerSessionProc>>,
2732    pub selection: Selection,
2733    pub graphql_client: DynGraphQLClient,
2734}
2735impl IntoID<Id> for Cloud {
2736    fn into_id(
2737        self,
2738    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2739        Box::pin(async move { self.id().await })
2740    }
2741}
2742impl Loadable for Cloud {
2743    fn graphql_type() -> &'static str {
2744        "Cloud"
2745    }
2746    fn from_query(
2747        proc: Option<Arc<DaggerSessionProc>>,
2748        selection: Selection,
2749        graphql_client: DynGraphQLClient,
2750    ) -> Self {
2751        Self {
2752            proc,
2753            selection,
2754            graphql_client,
2755        }
2756    }
2757}
2758impl Cloud {
2759    /// A unique identifier for this Cloud.
2760    pub async fn id(&self) -> Result<Id, DaggerError> {
2761        let query = self.selection.select("id");
2762        query.execute(self.graphql_client.clone()).await
2763    }
2764    /// The trace URL for the current session
2765    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2766        let query = self.selection.select("traceURL");
2767        query.execute(self.graphql_client.clone()).await
2768    }
2769}
2770impl Node for Cloud {
2771    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2772        let query = self.selection.select("id");
2773        let graphql_client = self.graphql_client.clone();
2774        async move { query.execute(graphql_client).await }
2775    }
2776}
2777#[derive(Clone)]
2778pub struct CollectionDelta {
2779    pub proc: Option<Arc<DaggerSessionProc>>,
2780    pub selection: Selection,
2781    pub graphql_client: DynGraphQLClient,
2782}
2783impl IntoID<Id> for CollectionDelta {
2784    fn into_id(
2785        self,
2786    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2787        Box::pin(async move { self.id().await })
2788    }
2789}
2790impl Loadable for CollectionDelta {
2791    fn graphql_type() -> &'static str {
2792        "CollectionDelta"
2793    }
2794    fn from_query(
2795        proc: Option<Arc<DaggerSessionProc>>,
2796        selection: Selection,
2797        graphql_client: DynGraphQLClient,
2798    ) -> Self {
2799        Self {
2800            proc,
2801            selection,
2802            graphql_client,
2803        }
2804    }
2805}
2806impl CollectionDelta {
2807    /// A unique identifier for this CollectionDelta.
2808    pub async fn id(&self) -> Result<Id, DaggerError> {
2809        let query = self.selection.select("id");
2810        query.execute(self.graphql_client.clone()).await
2811    }
2812    /// Current keys absent from the original collection, in current order.
2813    pub async fn added_keys(&self) -> Result<Vec<String>, DaggerError> {
2814        let query = self.selection.select("addedKeys");
2815        query.execute(self.graphql_client.clone()).await
2816    }
2817    /// Original keys absent from the current collection, in original order.
2818    pub async fn removed_keys(&self) -> Result<Vec<String>, DaggerError> {
2819        let query = self.selection.select("removedKeys");
2820        query.execute(self.graphql_client.clone()).await
2821    }
2822}
2823impl Node for CollectionDelta {
2824    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2825        let query = self.selection.select("id");
2826        let graphql_client = self.graphql_client.clone();
2827        async move { query.execute(graphql_client).await }
2828    }
2829}
2830#[derive(Clone)]
2831pub struct CollectionTypeDef {
2832    pub proc: Option<Arc<DaggerSessionProc>>,
2833    pub selection: Selection,
2834    pub graphql_client: DynGraphQLClient,
2835}
2836impl IntoID<Id> for CollectionTypeDef {
2837    fn into_id(
2838        self,
2839    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2840        Box::pin(async move { self.id().await })
2841    }
2842}
2843impl Loadable for CollectionTypeDef {
2844    fn graphql_type() -> &'static str {
2845        "CollectionTypeDef"
2846    }
2847    fn from_query(
2848        proc: Option<Arc<DaggerSessionProc>>,
2849        selection: Selection,
2850        graphql_client: DynGraphQLClient,
2851    ) -> Self {
2852        Self {
2853            proc,
2854            selection,
2855            graphql_client,
2856        }
2857    }
2858}
2859impl CollectionTypeDef {
2860    /// A unique identifier for this CollectionTypeDef.
2861    pub async fn id(&self) -> Result<Id, DaggerError> {
2862        let query = self.selection.select("id");
2863        query.execute(self.graphql_client.clone()).await
2864    }
2865    /// The type of collection keys.
2866    pub fn key_type(&self) -> TypeDef {
2867        let query = self.selection.select("keyType");
2868        TypeDef {
2869            proc: self.proc.clone(),
2870            selection: query,
2871            graphql_client: self.graphql_client.clone(),
2872        }
2873    }
2874    /// The object type returned by get.
2875    pub fn value_type(&self) -> TypeDef {
2876        let query = self.selection.select("valueType");
2877        TypeDef {
2878            proc: self.proc.clone(),
2879            selection: query,
2880            graphql_client: self.graphql_client.clone(),
2881        }
2882    }
2883    /// The type of batch operations, or null when there are none.
2884    pub async fn batch_type(&self) -> Result<Option<TypeDef>, DaggerError> {
2885        let query = self.selection.select("batchType");
2886        let query = query.select("id");
2887        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2888        Ok(id.map(|id| TypeDef {
2889            proc: self.proc.clone(),
2890            selection: query
2891                .root()
2892                .select("node")
2893                .arg("id", &id.0)
2894                .inline_fragment("TypeDef"),
2895            graphql_client: self.graphql_client.clone(),
2896        }))
2897    }
2898}
2899impl Node for CollectionTypeDef {
2900    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2901        let query = self.selection.select("id");
2902        let graphql_client = self.graphql_client.clone();
2903        async move { query.execute(graphql_client).await }
2904    }
2905}
2906#[derive(Clone)]
2907pub struct Command {
2908    pub proc: Option<Arc<DaggerSessionProc>>,
2909    pub selection: Selection,
2910    pub graphql_client: DynGraphQLClient,
2911}
2912impl IntoID<Id> for Command {
2913    fn into_id(
2914        self,
2915    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2916        Box::pin(async move { self.id().await })
2917    }
2918}
2919impl Loadable for Command {
2920    fn graphql_type() -> &'static str {
2921        "Command"
2922    }
2923    fn from_query(
2924        proc: Option<Arc<DaggerSessionProc>>,
2925        selection: Selection,
2926        graphql_client: DynGraphQLClient,
2927    ) -> Self {
2928        Self {
2929            proc,
2930            selection,
2931            graphql_client,
2932        }
2933    }
2934}
2935impl Command {
2936    /// A unique identifier for this Command.
2937    pub async fn id(&self) -> Result<Id, DaggerError> {
2938        let query = self.selection.select("id");
2939        query.execute(self.graphql_client.clone()).await
2940    }
2941    /// The command arguments.
2942    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
2943        let query = self.selection.select("args");
2944        query.execute(self.graphql_client.clone()).await
2945    }
2946    /// Environment variable overrides. Other variables come from the container.
2947    pub async fn env(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2948        let query = self.selection.select("env");
2949        let query = query.select("id");
2950        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2951        Ok(ids
2952            .into_iter()
2953            .map(|id| EnvVariable {
2954                proc: self.proc.clone(),
2955                selection: crate::querybuilder::query()
2956                    .select("node")
2957                    .arg("id", &id.0)
2958                    .inline_fragment("EnvVariable"),
2959                graphql_client: self.graphql_client.clone(),
2960            })
2961            .collect())
2962    }
2963    /// Working directory override. If unset, use the container's working directory.
2964    pub async fn workdir(&self) -> Result<String, DaggerError> {
2965        let query = self.selection.select("workdir");
2966        query.execute(self.graphql_client.clone()).await
2967    }
2968    /// Whether the command has access to Dagger.
2969    pub async fn privileged_nesting(&self) -> Result<bool, DaggerError> {
2970        let query = self.selection.select("privilegedNesting");
2971        query.execute(self.graphql_client.clone()).await
2972    }
2973    /// Whether the command has all root capabilities.
2974    pub async fn insecure_root_capabilities(&self) -> Result<bool, DaggerError> {
2975        let query = self.selection.select("insecureRootCapabilities");
2976        query.execute(self.graphql_client.clone()).await
2977    }
2978}
2979impl Node for Command {
2980    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2981        let query = self.selection.select("id");
2982        let graphql_client = self.graphql_client.clone();
2983        async move { query.execute(graphql_client).await }
2984    }
2985}
2986#[derive(Clone)]
2987pub struct Container {
2988    pub proc: Option<Arc<DaggerSessionProc>>,
2989    pub selection: Selection,
2990    pub graphql_client: DynGraphQLClient,
2991}
2992#[derive(Builder, Debug, PartialEq)]
2993pub struct ContainerFromOpts<'a> {
2994    /// Allow HTTPS registry communication without verifying the server certificate.
2995    #[builder(setter(into, strip_option), default)]
2996    pub insecure_skip_tls_verify: Option<bool>,
2997    /// Ignore the workspace lockfile for this lookup.
2998    #[builder(setter(into, strip_option), default)]
2999    pub no_lock: Option<bool>,
3000    /// Protocol to use for registry communication.
3001    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
3002    #[builder(setter(into, strip_option), default)]
3003    pub protocol: Option<RegistryProtocol>,
3004    /// Service to use as the registry endpoint for the image address.
3005    /// The service will be started only for this pull.
3006    #[builder(setter(into, strip_option), default)]
3007    pub registry_service: Option<Id>,
3008    /// Version query used to select an image tag. The address must not contain a tag or digest.
3009    #[builder(setter(into, strip_option), default)]
3010    pub version: Option<&'a str>,
3011}
3012#[derive(Builder, Debug, PartialEq)]
3013pub struct ContainerDirectoryOpts {
3014    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3015    #[builder(setter(into, strip_option), default)]
3016    pub expand: Option<bool>,
3017}
3018#[derive(Builder, Debug, PartialEq)]
3019pub struct ContainerFileOpts {
3020    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3021    #[builder(setter(into, strip_option), default)]
3022    pub expand: Option<bool>,
3023}
3024#[derive(Builder, Debug, PartialEq)]
3025pub struct ContainerWithWorkdirOpts {
3026    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3027    #[builder(setter(into, strip_option), default)]
3028    pub expand: Option<bool>,
3029}
3030#[derive(Builder, Debug, PartialEq)]
3031pub struct ContainerWithEnvVariableOpts {
3032    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
3033    #[builder(setter(into, strip_option), default)]
3034    pub expand: Option<bool>,
3035}
3036#[derive(Builder, Debug, PartialEq)]
3037pub struct ContainerWithDockerHealthcheckOpts<'a> {
3038    /// Interval between running healthcheck. Example: "30s"
3039    #[builder(setter(into, strip_option), default)]
3040    pub interval: Option<&'a str>,
3041    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
3042    #[builder(setter(into, strip_option), default)]
3043    pub retries: Option<isize>,
3044    /// When true, command must be a single element, which is run using the container's shell
3045    #[builder(setter(into, strip_option), default)]
3046    pub shell: Option<bool>,
3047    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
3048    #[builder(setter(into, strip_option), default)]
3049    pub start_interval: Option<&'a str>,
3050    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
3051    #[builder(setter(into, strip_option), default)]
3052    pub start_period: Option<&'a str>,
3053    /// Healthcheck timeout. Example: "3s"
3054    #[builder(setter(into, strip_option), default)]
3055    pub timeout: Option<&'a str>,
3056}
3057#[derive(Builder, Debug, PartialEq)]
3058pub struct ContainerWithEntrypointOpts {
3059    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
3060    #[builder(setter(into, strip_option), default)]
3061    pub keep_default_args: Option<bool>,
3062}
3063#[derive(Builder, Debug, PartialEq)]
3064pub struct ContainerWithoutEntrypointOpts {
3065    /// Don't remove the default arguments when unsetting the entrypoint.
3066    #[builder(setter(into, strip_option), default)]
3067    pub keep_default_args: Option<bool>,
3068}
3069#[derive(Builder, Debug, PartialEq)]
3070pub struct ContainerWithMountedDirectoryOpts<'a> {
3071    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3072    #[builder(setter(into, strip_option), default)]
3073    pub expand: Option<bool>,
3074    /// Set the owner to the container's current user.
3075    #[builder(setter(into, strip_option), default)]
3076    pub inherit_owner: Option<bool>,
3077    /// A user:group to set for the mounted directory and its contents.
3078    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3079    /// If the group is omitted, it defaults to the same as the user.
3080    #[builder(setter(into, strip_option), default)]
3081    pub owner: Option<&'a str>,
3082    /// Mount the directory read-only.
3083    #[builder(setter(into, strip_option), default)]
3084    pub read_only: Option<bool>,
3085}
3086#[derive(Builder, Debug, PartialEq)]
3087pub struct ContainerWithMountedFileOpts<'a> {
3088    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3089    #[builder(setter(into, strip_option), default)]
3090    pub expand: Option<bool>,
3091    /// Set the owner to the container's current user.
3092    #[builder(setter(into, strip_option), default)]
3093    pub inherit_owner: Option<bool>,
3094    /// A user or user:group to set for the mounted file.
3095    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3096    /// If the group is omitted, it defaults to the same as the user.
3097    #[builder(setter(into, strip_option), default)]
3098    pub owner: Option<&'a str>,
3099    /// Mount the file read-only.
3100    #[builder(setter(into, strip_option), default)]
3101    pub read_only: Option<bool>,
3102}
3103#[derive(Builder, Debug, PartialEq)]
3104pub struct ContainerWithMountedTempOpts {
3105    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3106    #[builder(setter(into, strip_option), default)]
3107    pub expand: Option<bool>,
3108    /// Size of the temporary directory in bytes.
3109    #[builder(setter(into, strip_option), default)]
3110    pub size: Option<isize>,
3111}
3112#[derive(Builder, Debug, PartialEq)]
3113pub struct ContainerWithMountedCacheOpts<'a> {
3114    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3115    #[builder(setter(into, strip_option), default)]
3116    pub expand: Option<bool>,
3117    /// Set the owner to the container's current user.
3118    #[builder(setter(into, strip_option), default)]
3119    pub inherit_owner: Option<bool>,
3120    /// A user:group to set for the mounted cache directory.
3121    /// 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.
3122    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3123    /// If the group is omitted, it defaults to the same as the user.
3124    #[builder(setter(into, strip_option), default)]
3125    pub owner: Option<&'a str>,
3126    /// Sharing mode of the cache volume.
3127    #[builder(setter(into, strip_option), default)]
3128    pub sharing: Option<CacheSharingMode>,
3129    /// Identifier of the directory to use as the cache volume's root.
3130    #[builder(setter(into, strip_option), default)]
3131    pub source: Option<Id>,
3132}
3133#[derive(Builder, Debug, PartialEq)]
3134pub struct ContainerWithMountedVolumeOpts {
3135    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3136    #[builder(setter(into, strip_option), default)]
3137    pub expand: Option<bool>,
3138    /// Mount the volume read-only.
3139    #[builder(setter(into, strip_option), default)]
3140    pub read_only: Option<bool>,
3141}
3142#[derive(Builder, Debug, PartialEq)]
3143pub struct ContainerWithMountedSecretOpts<'a> {
3144    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3145    #[builder(setter(into, strip_option), default)]
3146    pub expand: Option<bool>,
3147    /// Set the owner to the container's current user.
3148    #[builder(setter(into, strip_option), default)]
3149    pub inherit_owner: Option<bool>,
3150    /// Permission given to the mounted secret (e.g., 0600).
3151    /// This option requires an owner to be set to be active.
3152    #[builder(setter(into, strip_option), default)]
3153    pub mode: Option<isize>,
3154    /// A user:group to set for the mounted secret.
3155    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3156    /// If the group is omitted, it defaults to the same as the user.
3157    #[builder(setter(into, strip_option), default)]
3158    pub owner: Option<&'a str>,
3159}
3160#[derive(Builder, Debug, PartialEq)]
3161pub struct ContainerWithUnixSocketOpts<'a> {
3162    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3163    #[builder(setter(into, strip_option), default)]
3164    pub expand: Option<bool>,
3165    /// Set the owner to the container's current user.
3166    #[builder(setter(into, strip_option), default)]
3167    pub inherit_owner: Option<bool>,
3168    /// A user:group to set for the mounted socket.
3169    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3170    /// If the group is omitted, it defaults to the same as the user.
3171    #[builder(setter(into, strip_option), default)]
3172    pub owner: Option<&'a str>,
3173}
3174#[derive(Builder, Debug, PartialEq)]
3175pub struct ContainerWithoutUnixSocketOpts {
3176    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3177    #[builder(setter(into, strip_option), default)]
3178    pub expand: Option<bool>,
3179}
3180#[derive(Builder, Debug, PartialEq)]
3181pub struct ContainerWithoutMountOpts {
3182    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3183    #[builder(setter(into, strip_option), default)]
3184    pub expand: Option<bool>,
3185}
3186#[derive(Builder, Debug, PartialEq)]
3187pub struct ContainerWithFileOpts<'a> {
3188    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3189    #[builder(setter(into, strip_option), default)]
3190    pub expand: Option<bool>,
3191    /// Set the owner to the container's current user.
3192    #[builder(setter(into, strip_option), default)]
3193    pub inherit_owner: Option<bool>,
3194    /// A user:group to set for the file.
3195    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3196    /// If the group is omitted, it defaults to the same as the user.
3197    #[builder(setter(into, strip_option), default)]
3198    pub owner: Option<&'a str>,
3199    /// Permissions of the new file. Example: 0600
3200    #[builder(setter(into, strip_option), default)]
3201    pub permissions: Option<isize>,
3202}
3203#[derive(Builder, Debug, PartialEq)]
3204pub struct ContainerWithoutFileOpts {
3205    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3206    #[builder(setter(into, strip_option), default)]
3207    pub expand: Option<bool>,
3208}
3209#[derive(Builder, Debug, PartialEq)]
3210pub struct ContainerWithoutFilesOpts {
3211    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3212    #[builder(setter(into, strip_option), default)]
3213    pub expand: Option<bool>,
3214}
3215#[derive(Builder, Debug, PartialEq)]
3216pub struct ContainerWithFilesOpts<'a> {
3217    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3218    #[builder(setter(into, strip_option), default)]
3219    pub expand: Option<bool>,
3220    /// Set the owner to the container's current user.
3221    #[builder(setter(into, strip_option), default)]
3222    pub inherit_owner: Option<bool>,
3223    /// A user:group to set for the files.
3224    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3225    /// If the group is omitted, it defaults to the same as the user.
3226    #[builder(setter(into, strip_option), default)]
3227    pub owner: Option<&'a str>,
3228    /// Permission given to the copied files (e.g., 0600).
3229    #[builder(setter(into, strip_option), default)]
3230    pub permissions: Option<isize>,
3231}
3232#[derive(Builder, Debug, PartialEq)]
3233pub struct ContainerWithNewFileOpts<'a> {
3234    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3235    #[builder(setter(into, strip_option), default)]
3236    pub expand: Option<bool>,
3237    /// Set the owner to the container's current user.
3238    #[builder(setter(into, strip_option), default)]
3239    pub inherit_owner: Option<bool>,
3240    /// A user:group to set for the file.
3241    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3242    /// If the group is omitted, it defaults to the same as the user.
3243    #[builder(setter(into, strip_option), default)]
3244    pub owner: Option<&'a str>,
3245    /// Permissions of the new file. Example: 0600
3246    #[builder(setter(into, strip_option), default)]
3247    pub permissions: Option<isize>,
3248}
3249#[derive(Builder, Debug, PartialEq)]
3250pub struct ContainerWithDirectoryOpts<'a> {
3251    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
3252    #[builder(setter(into, strip_option), default)]
3253    pub exclude: Option<Vec<&'a str>>,
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    /// Apply .gitignore rules when writing the directory.
3258    #[builder(setter(into, strip_option), default)]
3259    pub gitignore: Option<bool>,
3260    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
3261    #[builder(setter(into, strip_option), default)]
3262    pub include: Option<Vec<&'a str>>,
3263    /// Set the owner to the container's current user.
3264    #[builder(setter(into, strip_option), default)]
3265    pub inherit_owner: Option<bool>,
3266    /// A user:group to set for the directory and its contents.
3267    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3268    /// If the group is omitted, it defaults to the same as the user.
3269    #[builder(setter(into, strip_option), default)]
3270    pub owner: Option<&'a str>,
3271    #[builder(setter(into, strip_option), default)]
3272    pub permissions: Option<isize>,
3273}
3274#[derive(Builder, Debug, PartialEq)]
3275pub struct ContainerWithoutDirectoryOpts {
3276    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3277    #[builder(setter(into, strip_option), default)]
3278    pub expand: Option<bool>,
3279}
3280#[derive(Builder, Debug, PartialEq)]
3281pub struct ContainerExistsOpts {
3282    /// If specified, do not follow symlinks.
3283    #[builder(setter(into, strip_option), default)]
3284    pub do_not_follow_symlinks: Option<bool>,
3285    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3286    #[builder(setter(into, strip_option), default)]
3287    pub expand: Option<bool>,
3288    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
3289    #[builder(setter(into, strip_option), default)]
3290    pub expected_type: Option<ExistsType>,
3291}
3292#[derive(Builder, Debug, PartialEq)]
3293pub struct ContainerStatOpts {
3294    /// If specified, do not follow symlinks.
3295    #[builder(setter(into, strip_option), default)]
3296    pub do_not_follow_symlinks: Option<bool>,
3297}
3298#[derive(Builder, Debug, PartialEq)]
3299pub struct ContainerWithExecOpts<'a> {
3300    /// 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.
3301    /// 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.
3302    /// Cannot be combined with "disableDaggerInDagger".
3303    #[builder(setter(into, strip_option), default)]
3304    pub dagger_in_dagger_new_session: Option<bool>,
3305    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3306    #[builder(setter(into, strip_option), default)]
3307    pub disable_dagger_in_dagger: Option<bool>,
3308    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3309    #[builder(setter(into, strip_option), default)]
3310    pub expand: Option<bool>,
3311    /// Exit codes this command is allowed to exit with without error
3312    #[builder(setter(into, strip_option), default)]
3313    pub expect: Option<ReturnType>,
3314    #[builder(setter(into, strip_option), default)]
3315    pub experimental_privileged_nesting: Option<bool>,
3316    /// Execute the command with all root capabilities. Like --privileged in Docker
3317    /// 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.
3318    #[builder(setter(into, strip_option), default)]
3319    pub insecure_root_capabilities: Option<bool>,
3320    /// Skip the automatic init process injected into containers by default.
3321    /// 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.
3322    #[builder(setter(into, strip_option), default)]
3323    pub no_init: Option<bool>,
3324    /// Redirect the command's standard error to a file in the container. The redirected output is not logged. Example: "./stderr.txt"
3325    #[builder(setter(into, strip_option), default)]
3326    pub redirect_stderr: Option<&'a str>,
3327    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
3328    #[builder(setter(into, strip_option), default)]
3329    pub redirect_stdin: Option<&'a str>,
3330    /// Redirect the command's standard output to a file in the container. The redirected output is not logged. Example: "./stdout.txt"
3331    #[builder(setter(into, strip_option), default)]
3332    pub redirect_stdout: Option<&'a str>,
3333    /// Content to write to the command's standard input. Example: "Hello world")
3334    #[builder(setter(into, strip_option), default)]
3335    pub stdin: Option<&'a str>,
3336    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
3337    #[builder(setter(into, strip_option), default)]
3338    pub use_entrypoint: Option<bool>,
3339}
3340#[derive(Builder, Debug, PartialEq)]
3341pub struct ContainerWithSymlinkOpts {
3342    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3343    #[builder(setter(into, strip_option), default)]
3344    pub expand: Option<bool>,
3345}
3346#[derive(Builder, Debug, PartialEq)]
3347pub struct ContainerPublishOpts {
3348    /// Force each layer of the published image to use the specified compression algorithm.
3349    /// 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.
3350    #[builder(setter(into, strip_option), default)]
3351    pub forced_compression: Option<ImageLayerCompression>,
3352    /// Allow HTTPS registry communication without verifying the server certificate.
3353    #[builder(setter(into, strip_option), default)]
3354    pub insecure_skip_tls_verify: Option<bool>,
3355    /// Use the specified media types for the published image's layers.
3356    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
3357    #[builder(setter(into, strip_option), default)]
3358    pub media_types: Option<ImageMediaTypes>,
3359    /// Identifiers for other platform specific containers.
3360    /// Used for multi-platform image.
3361    #[builder(setter(into, strip_option), default)]
3362    pub platform_variants: Option<Vec<Id>>,
3363    /// Protocol to use for registry communication.
3364    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
3365    #[builder(setter(into, strip_option), default)]
3366    pub protocol: Option<RegistryProtocol>,
3367    /// Service to use as the registry endpoint for the image address.
3368    /// The service will be started only for this push.
3369    #[builder(setter(into, strip_option), default)]
3370    pub registry_service: Option<Id>,
3371}
3372#[derive(Builder, Debug, PartialEq)]
3373pub struct ContainerExportOpts {
3374    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3375    #[builder(setter(into, strip_option), default)]
3376    pub expand: Option<bool>,
3377    /// Force each layer of the exported image to use the specified compression algorithm.
3378    /// 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.
3379    #[builder(setter(into, strip_option), default)]
3380    pub forced_compression: Option<ImageLayerCompression>,
3381    /// Use the specified media types for the exported image's layers.
3382    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3383    #[builder(setter(into, strip_option), default)]
3384    pub media_types: Option<ImageMediaTypes>,
3385    /// Identifiers for other platform specific containers.
3386    /// Used for multi-platform image.
3387    #[builder(setter(into, strip_option), default)]
3388    pub platform_variants: Option<Vec<Id>>,
3389}
3390#[derive(Builder, Debug, PartialEq)]
3391pub struct ContainerExportImageOpts {
3392    /// Force each layer of the exported image to use the specified compression algorithm.
3393    /// 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.
3394    #[builder(setter(into, strip_option), default)]
3395    pub forced_compression: Option<ImageLayerCompression>,
3396    /// Use the specified media types for the exported image's layers.
3397    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3398    #[builder(setter(into, strip_option), default)]
3399    pub media_types: Option<ImageMediaTypes>,
3400    /// Identifiers for other platform specific containers.
3401    /// Used for multi-platform image.
3402    #[builder(setter(into, strip_option), default)]
3403    pub platform_variants: Option<Vec<Id>>,
3404}
3405#[derive(Builder, Debug, PartialEq)]
3406pub struct ContainerAsTarballOpts {
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    /// Use the specified media types for the image's layers.
3412    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3413    #[builder(setter(into, strip_option), default)]
3414    pub media_types: Option<ImageMediaTypes>,
3415    /// Identifiers for other platform specific containers.
3416    /// Used for multi-platform images.
3417    #[builder(setter(into, strip_option), default)]
3418    pub platform_variants: Option<Vec<Id>>,
3419}
3420#[derive(Builder, Debug, PartialEq)]
3421pub struct ContainerImportOpts<'a> {
3422    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
3423    #[builder(setter(into, strip_option), default)]
3424    pub tag: Option<&'a str>,
3425}
3426#[derive(Builder, Debug, PartialEq)]
3427pub struct ContainerManifestOpts {
3428    /// Force each layer of the image to use the specified compression algorithm.
3429    /// 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.
3430    #[builder(setter(into, strip_option), default)]
3431    pub forced_compression: Option<ImageLayerCompression>,
3432    /// Media types to use for image layers. Defaults to OCI.
3433    #[builder(setter(into, strip_option), default)]
3434    pub media_types: Option<ImageMediaTypes>,
3435}
3436#[derive(Builder, Debug, PartialEq)]
3437pub struct ContainerLayerOpts {
3438    /// Force each layer of the image to use the specified compression algorithm.
3439    /// 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.
3440    #[builder(setter(into, strip_option), default)]
3441    pub forced_compression: Option<ImageLayerCompression>,
3442    /// Media types to use for image layers. Defaults to OCI.
3443    #[builder(setter(into, strip_option), default)]
3444    pub media_types: Option<ImageMediaTypes>,
3445}
3446#[derive(Builder, Debug, PartialEq)]
3447pub struct ContainerWithExposedPortOpts<'a> {
3448    /// Port description. Example: "payment API endpoint"
3449    #[builder(setter(into, strip_option), default)]
3450    pub description: Option<&'a str>,
3451    /// Skip the health check when run as a service.
3452    #[builder(setter(into, strip_option), default)]
3453    pub experimental_skip_healthcheck: Option<bool>,
3454    /// Network protocol. Example: "tcp"
3455    #[builder(setter(into, strip_option), default)]
3456    pub protocol: Option<NetworkProtocol>,
3457}
3458#[derive(Builder, Debug, PartialEq)]
3459pub struct ContainerWithoutExposedPortOpts {
3460    /// Port protocol to unexpose
3461    #[builder(setter(into, strip_option), default)]
3462    pub protocol: Option<NetworkProtocol>,
3463}
3464#[derive(Builder, Debug, PartialEq)]
3465pub struct ContainerWithDefaultTerminalCmdOpts {
3466    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
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    /// 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.
3472    #[builder(setter(into, strip_option), default)]
3473    pub insecure_root_capabilities: Option<bool>,
3474}
3475#[derive(Builder, Debug, PartialEq)]
3476pub struct ContainerWithShellOpts<'a> {
3477    /// Command arguments for batch use. The script is appended as one argument. Defaults to interactive followed by "-c".
3478    #[builder(setter(into, strip_option), default)]
3479    pub batch: Option<Vec<&'a str>>,
3480    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3481    #[builder(setter(into, strip_option), default)]
3482    pub disable_dagger_in_dagger: Option<bool>,
3483    #[builder(setter(into, strip_option), default)]
3484    pub experimental_privileged_nesting: Option<bool>,
3485    /// Give the shell all root capabilities. Use only with trusted commands.
3486    #[builder(setter(into, strip_option), default)]
3487    pub insecure_root_capabilities: Option<bool>,
3488}
3489#[derive(Builder, Debug, PartialEq)]
3490pub struct ContainerShellOpts {
3491    /// Return the batch command instead of the interactive command.
3492    #[builder(setter(into, strip_option), default)]
3493    pub batch: Option<bool>,
3494}
3495#[derive(Builder, Debug, PartialEq)]
3496pub struct ContainerWithRunOpts<'a> {
3497    /// Override whether the shell is denied Dagger API access. Omit to use the configured shell setting.
3498    #[builder(setter(into, strip_option), default)]
3499    pub disable_dagger_in_dagger: Option<bool>,
3500    #[builder(setter(into, strip_option), default)]
3501    pub experimental_privileged_nesting: Option<bool>,
3502    /// Override whether the shell has all root capabilities.
3503    #[builder(setter(into, strip_option), default)]
3504    pub insecure_root_capabilities: Option<bool>,
3505    /// Override the batch shell arguments. Example: ["bash", "-c"].
3506    #[builder(setter(into, strip_option), default)]
3507    pub shell: Option<Vec<&'a str>>,
3508}
3509#[derive(Builder, Debug, PartialEq)]
3510pub struct ContainerTerminalOpts<'a> {
3511    /// If set, override the container's default terminal command and invoke these command arguments instead.
3512    #[builder(setter(into, strip_option), default)]
3513    pub cmd: Option<Vec<&'a str>>,
3514    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3515    #[builder(setter(into, strip_option), default)]
3516    pub disable_dagger_in_dagger: Option<bool>,
3517    #[builder(setter(into, strip_option), default)]
3518    pub experimental_privileged_nesting: Option<bool>,
3519    /// 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.
3520    #[builder(setter(into, strip_option), default)]
3521    pub insecure_root_capabilities: Option<bool>,
3522}
3523#[derive(Builder, Debug, PartialEq)]
3524pub struct ContainerAsServiceOpts<'a> {
3525    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3526    /// If empty, the container's default command is used.
3527    #[builder(setter(into, strip_option), default)]
3528    pub args: Option<Vec<&'a str>>,
3529    /// 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.
3530    /// 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.
3531    /// Cannot be combined with "disableDaggerInDagger".
3532    #[builder(setter(into, strip_option), default)]
3533    pub dagger_in_dagger_new_session: Option<bool>,
3534    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3535    #[builder(setter(into, strip_option), default)]
3536    pub disable_dagger_in_dagger: Option<bool>,
3537    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3538    #[builder(setter(into, strip_option), default)]
3539    pub expand: Option<bool>,
3540    #[builder(setter(into, strip_option), default)]
3541    pub experimental_privileged_nesting: Option<bool>,
3542    /// 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.
3543    #[builder(setter(into, strip_option), default)]
3544    pub insecure_root_capabilities: Option<bool>,
3545    /// If set, skip the automatic init process injected into containers by default.
3546    /// 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.
3547    #[builder(setter(into, strip_option), default)]
3548    pub no_init: Option<bool>,
3549    /// If the container has an entrypoint, prepend it to the args.
3550    #[builder(setter(into, strip_option), default)]
3551    pub use_entrypoint: Option<bool>,
3552}
3553#[derive(Builder, Debug, PartialEq)]
3554pub struct ContainerUpOpts<'a> {
3555    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3556    /// If empty, the container's default command is used.
3557    #[builder(setter(into, strip_option), default)]
3558    pub args: Option<Vec<&'a str>>,
3559    /// 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.
3560    /// 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.
3561    /// Cannot be combined with "disableDaggerInDagger".
3562    #[builder(setter(into, strip_option), default)]
3563    pub dagger_in_dagger_new_session: Option<bool>,
3564    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3565    #[builder(setter(into, strip_option), default)]
3566    pub disable_dagger_in_dagger: Option<bool>,
3567    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3568    #[builder(setter(into, strip_option), default)]
3569    pub expand: Option<bool>,
3570    #[builder(setter(into, strip_option), default)]
3571    pub experimental_privileged_nesting: Option<bool>,
3572    /// 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.
3573    #[builder(setter(into, strip_option), default)]
3574    pub insecure_root_capabilities: Option<bool>,
3575    /// If set, skip the automatic init process injected into containers by default.
3576    /// 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.
3577    #[builder(setter(into, strip_option), default)]
3578    pub no_init: Option<bool>,
3579    /// List of frontend/backend port mappings to forward.
3580    /// Frontend is the port accepting traffic on the host, backend is the service port.
3581    #[builder(setter(into, strip_option), default)]
3582    pub ports: Option<Vec<PortForward>>,
3583    /// Bind each tunnel port to a random port on the host.
3584    #[builder(setter(into, strip_option), default)]
3585    pub random: Option<bool>,
3586    /// If the container has an entrypoint, prepend it to the args.
3587    #[builder(setter(into, strip_option), default)]
3588    pub use_entrypoint: Option<bool>,
3589}
3590impl IntoID<Id> for Container {
3591    fn into_id(
3592        self,
3593    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
3594        Box::pin(async move { self.id().await })
3595    }
3596}
3597impl Loadable for Container {
3598    fn graphql_type() -> &'static str {
3599        "Container"
3600    }
3601    fn from_query(
3602        proc: Option<Arc<DaggerSessionProc>>,
3603        selection: Selection,
3604        graphql_client: DynGraphQLClient,
3605    ) -> Self {
3606        Self {
3607            proc,
3608            selection,
3609            graphql_client,
3610        }
3611    }
3612}
3613impl Container {
3614    /// A unique identifier for this Container.
3615    pub async fn id(&self) -> Result<Id, DaggerError> {
3616        let query = self.selection.select("id");
3617        query.execute(self.graphql_client.clone()).await
3618    }
3619    /// Forces evaluation of the pipeline in the engine.
3620    /// It doesn't run the default command if no exec has been set.
3621    pub async fn sync(&self) -> Result<Container, DaggerError> {
3622        let query = self.selection.select("sync");
3623        let id: Id = query.execute(self.graphql_client.clone()).await?;
3624        Ok(Container {
3625            proc: self.proc.clone(),
3626            selection: query
3627                .root()
3628                .select("node")
3629                .arg("id", &id.0)
3630                .inline_fragment("Container"),
3631            graphql_client: self.graphql_client.clone(),
3632        })
3633    }
3634    /// Download a container image, and apply it to the container state. All previous state will be lost.
3635    ///
3636    /// # Arguments
3637    ///
3638    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
3639    ///
3640    /// 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.
3641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3642    pub fn from(&self, address: impl Into<String>) -> Container {
3643        let mut query = self.selection.select("from");
3644        query = query.arg("address", address.into());
3645        Container {
3646            proc: self.proc.clone(),
3647            selection: query,
3648            graphql_client: self.graphql_client.clone(),
3649        }
3650    }
3651    /// Download a container image, and apply it to the container state. All previous state will be lost.
3652    ///
3653    /// # Arguments
3654    ///
3655    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
3656    ///
3657    /// 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.
3658    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3659    pub fn from_opts<'a>(
3660        &self,
3661        address: impl Into<String>,
3662        opts: ContainerFromOpts<'a>,
3663    ) -> Container {
3664        let mut query = self.selection.select("from");
3665        query = query.arg("address", address.into());
3666        if let Some(version) = opts.version {
3667            query = query.arg("version", version);
3668        }
3669        if let Some(registry_service) = opts.registry_service {
3670            query = query.arg("registryService", registry_service);
3671        }
3672        if let Some(protocol) = opts.protocol {
3673            query = query.arg("protocol", protocol);
3674        }
3675        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
3676            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
3677        }
3678        if let Some(no_lock) = opts.no_lock {
3679            query = query.arg("noLock", no_lock);
3680        }
3681        Container {
3682            proc: self.proc.clone(),
3683            selection: query,
3684            graphql_client: self.graphql_client.clone(),
3685        }
3686    }
3687    /// 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.
3688    pub fn rootfs(&self) -> Directory {
3689        let query = self.selection.select("rootfs");
3690        Directory {
3691            proc: self.proc.clone(),
3692            selection: query,
3693            graphql_client: self.graphql_client.clone(),
3694        }
3695    }
3696    /// Change the container's root filesystem. The previous root filesystem will be lost.
3697    ///
3698    /// # Arguments
3699    ///
3700    /// * `directory` - The new root filesystem.
3701    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3702        let mut query = self.selection.select("withRootfs");
3703        query = query.arg_lazy(
3704            "directory",
3705            Box::new(move || {
3706                let directory = directory.clone();
3707                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3708            }),
3709        );
3710        Container {
3711            proc: self.proc.clone(),
3712            selection: query,
3713            graphql_client: self.graphql_client.clone(),
3714        }
3715    }
3716    /// Retrieve a directory from the container's root filesystem
3717    /// Mounts are included.
3718    ///
3719    /// # Arguments
3720    ///
3721    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3722    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3723    pub fn directory(&self, path: impl Into<String>) -> Directory {
3724        let mut query = self.selection.select("directory");
3725        query = query.arg("path", path.into());
3726        Directory {
3727            proc: self.proc.clone(),
3728            selection: query,
3729            graphql_client: self.graphql_client.clone(),
3730        }
3731    }
3732    /// Retrieve a directory from the container's root filesystem
3733    /// Mounts are included.
3734    ///
3735    /// # Arguments
3736    ///
3737    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3738    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3739    pub fn directory_opts(
3740        &self,
3741        path: impl Into<String>,
3742        opts: ContainerDirectoryOpts,
3743    ) -> Directory {
3744        let mut query = self.selection.select("directory");
3745        query = query.arg("path", path.into());
3746        if let Some(expand) = opts.expand {
3747            query = query.arg("expand", expand);
3748        }
3749        Directory {
3750            proc: self.proc.clone(),
3751            selection: query,
3752            graphql_client: self.graphql_client.clone(),
3753        }
3754    }
3755    /// Retrieves a file at the given path.
3756    /// Mounts are included.
3757    ///
3758    /// # Arguments
3759    ///
3760    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3762    pub fn file(&self, path: impl Into<String>) -> File {
3763        let mut query = self.selection.select("file");
3764        query = query.arg("path", path.into());
3765        File {
3766            proc: self.proc.clone(),
3767            selection: query,
3768            graphql_client: self.graphql_client.clone(),
3769        }
3770    }
3771    /// Retrieves a file at the given path.
3772    /// Mounts are included.
3773    ///
3774    /// # Arguments
3775    ///
3776    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3778    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3779        let mut query = self.selection.select("file");
3780        query = query.arg("path", path.into());
3781        if let Some(expand) = opts.expand {
3782            query = query.arg("expand", expand);
3783        }
3784        File {
3785            proc: self.proc.clone(),
3786            selection: query,
3787            graphql_client: self.graphql_client.clone(),
3788        }
3789    }
3790    /// Retrieves the user to be set for all commands.
3791    pub async fn user(&self) -> Result<String, DaggerError> {
3792        let query = self.selection.select("user");
3793        query.execute(self.graphql_client.clone()).await
3794    }
3795    /// Retrieves this container with a different command user.
3796    ///
3797    /// # Arguments
3798    ///
3799    /// * `name` - The user to set (e.g., "root").
3800    pub fn with_user(&self, name: impl Into<String>) -> Container {
3801        let mut query = self.selection.select("withUser");
3802        query = query.arg("name", name.into());
3803        Container {
3804            proc: self.proc.clone(),
3805            selection: query,
3806            graphql_client: self.graphql_client.clone(),
3807        }
3808    }
3809    /// Retrieves this container with an unset command user.
3810    /// Should default to root.
3811    pub fn without_user(&self) -> Container {
3812        let query = self.selection.select("withoutUser");
3813        Container {
3814            proc: self.proc.clone(),
3815            selection: query,
3816            graphql_client: self.graphql_client.clone(),
3817        }
3818    }
3819    /// Retrieves the working directory for all commands.
3820    pub async fn workdir(&self) -> Result<String, DaggerError> {
3821        let query = self.selection.select("workdir");
3822        query.execute(self.graphql_client.clone()).await
3823    }
3824    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3825    ///
3826    /// # Arguments
3827    ///
3828    /// * `path` - The path to set as the working directory (e.g., "/app").
3829    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3830    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3831        let mut query = self.selection.select("withWorkdir");
3832        query = query.arg("path", path.into());
3833        Container {
3834            proc: self.proc.clone(),
3835            selection: query,
3836            graphql_client: self.graphql_client.clone(),
3837        }
3838    }
3839    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3840    ///
3841    /// # Arguments
3842    ///
3843    /// * `path` - The path to set as the working directory (e.g., "/app").
3844    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3845    pub fn with_workdir_opts(
3846        &self,
3847        path: impl Into<String>,
3848        opts: ContainerWithWorkdirOpts,
3849    ) -> Container {
3850        let mut query = self.selection.select("withWorkdir");
3851        query = query.arg("path", path.into());
3852        if let Some(expand) = opts.expand {
3853            query = query.arg("expand", expand);
3854        }
3855        Container {
3856            proc: self.proc.clone(),
3857            selection: query,
3858            graphql_client: self.graphql_client.clone(),
3859        }
3860    }
3861    /// Unset the container's working directory.
3862    /// Should default to "/".
3863    pub fn without_workdir(&self) -> Container {
3864        let query = self.selection.select("withoutWorkdir");
3865        Container {
3866            proc: self.proc.clone(),
3867            selection: query,
3868            graphql_client: self.graphql_client.clone(),
3869        }
3870    }
3871    /// Retrieves the list of persistent environment variables configured on the container.
3872    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
3873        let query = self.selection.select("envVariables");
3874        let query = query.select("id");
3875        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
3876        Ok(ids
3877            .into_iter()
3878            .map(|id| EnvVariable {
3879                proc: self.proc.clone(),
3880                selection: crate::querybuilder::query()
3881                    .select("node")
3882                    .arg("id", &id.0)
3883                    .inline_fragment("EnvVariable"),
3884                graphql_client: self.graphql_client.clone(),
3885            })
3886            .collect())
3887    }
3888    /// Retrieves the value of the specified persistent environment variable.
3889    ///
3890    /// # Arguments
3891    ///
3892    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3893    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3894        let mut query = self.selection.select("envVariable");
3895        query = query.arg("name", name.into());
3896        query.execute(self.graphql_client.clone()).await
3897    }
3898    /// Set a new environment variable in the container.
3899    ///
3900    /// # Arguments
3901    ///
3902    /// * `name` - Name of the environment variable (e.g., "HOST").
3903    /// * `value` - Value of the environment variable. (e.g., "localhost").
3904    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3905    pub fn with_env_variable(
3906        &self,
3907        name: impl Into<String>,
3908        value: impl Into<String>,
3909    ) -> Container {
3910        let mut query = self.selection.select("withEnvVariable");
3911        query = query.arg("name", name.into());
3912        query = query.arg("value", value.into());
3913        Container {
3914            proc: self.proc.clone(),
3915            selection: query,
3916            graphql_client: self.graphql_client.clone(),
3917        }
3918    }
3919    /// Set a new environment variable in the container.
3920    ///
3921    /// # Arguments
3922    ///
3923    /// * `name` - Name of the environment variable (e.g., "HOST").
3924    /// * `value` - Value of the environment variable. (e.g., "localhost").
3925    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3926    pub fn with_env_variable_opts(
3927        &self,
3928        name: impl Into<String>,
3929        value: impl Into<String>,
3930        opts: ContainerWithEnvVariableOpts,
3931    ) -> Container {
3932        let mut query = self.selection.select("withEnvVariable");
3933        query = query.arg("name", name.into());
3934        query = query.arg("value", value.into());
3935        if let Some(expand) = opts.expand {
3936            query = query.arg("expand", expand);
3937        }
3938        Container {
3939            proc: self.proc.clone(),
3940            selection: query,
3941            graphql_client: self.graphql_client.clone(),
3942        }
3943    }
3944    /// Export environment variables from an env-file to the container.
3945    ///
3946    /// # Arguments
3947    ///
3948    /// * `source` - Identifier of the envfile
3949    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
3950        let mut query = self.selection.select("withEnvFileVariables");
3951        query = query.arg_lazy(
3952            "source",
3953            Box::new(move || {
3954                let source = source.clone();
3955                Box::pin(async move { source.into_id().await.unwrap().quote() })
3956            }),
3957        );
3958        Container {
3959            proc: self.proc.clone(),
3960            selection: query,
3961            graphql_client: self.graphql_client.clone(),
3962        }
3963    }
3964    /// Set a new environment variable, using a secret value
3965    ///
3966    /// # Arguments
3967    ///
3968    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3969    /// * `secret` - Identifier of the secret value.
3970    pub fn with_secret_variable(
3971        &self,
3972        name: impl Into<String>,
3973        secret: impl IntoID<Id>,
3974    ) -> Container {
3975        let mut query = self.selection.select("withSecretVariable");
3976        query = query.arg("name", name.into());
3977        query = query.arg_lazy(
3978            "secret",
3979            Box::new(move || {
3980                let secret = secret.clone();
3981                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3982            }),
3983        );
3984        Container {
3985            proc: self.proc.clone(),
3986            selection: query,
3987            graphql_client: self.graphql_client.clone(),
3988        }
3989    }
3990    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
3991    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
3992    ///
3993    /// # Arguments
3994    ///
3995    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
3996    /// * `value` - Value of the volatile variable.
3997    pub fn with_volatile_variable(
3998        &self,
3999        name: impl Into<String>,
4000        value: impl Into<String>,
4001    ) -> Container {
4002        let mut query = self.selection.select("withVolatileVariable");
4003        query = query.arg("name", name.into());
4004        query = query.arg("value", value.into());
4005        Container {
4006            proc: self.proc.clone(),
4007            selection: query,
4008            graphql_client: self.graphql_client.clone(),
4009        }
4010    }
4011    /// Retrieves this container minus the given environment variable.
4012    ///
4013    /// # Arguments
4014    ///
4015    /// * `name` - The name of the environment variable (e.g., "HOST").
4016    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4017        let mut query = self.selection.select("withoutEnvVariable");
4018        query = query.arg("name", name.into());
4019        Container {
4020            proc: self.proc.clone(),
4021            selection: query,
4022            graphql_client: self.graphql_client.clone(),
4023        }
4024    }
4025    /// Retrieves this container minus the given environment variable containing the secret.
4026    ///
4027    /// # Arguments
4028    ///
4029    /// * `name` - The name of the environment variable (e.g., "HOST").
4030    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4031        let mut query = self.selection.select("withoutSecretVariable");
4032        query = query.arg("name", name.into());
4033        Container {
4034            proc: self.proc.clone(),
4035            selection: query,
4036            graphql_client: self.graphql_client.clone(),
4037        }
4038    }
4039    /// Retrieves this container minus the given volatile environment variable.
4040    ///
4041    /// # Arguments
4042    ///
4043    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4044    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4045        let mut query = self.selection.select("withoutVolatileVariable");
4046        query = query.arg("name", name.into());
4047        Container {
4048            proc: self.proc.clone(),
4049            selection: query,
4050            graphql_client: self.graphql_client.clone(),
4051        }
4052    }
4053    /// Retrieves this container plus the given label.
4054    ///
4055    /// # Arguments
4056    ///
4057    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4058    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4059    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4060        let mut query = self.selection.select("withLabel");
4061        query = query.arg("name", name.into());
4062        query = query.arg("value", value.into());
4063        Container {
4064            proc: self.proc.clone(),
4065            selection: query,
4066            graphql_client: self.graphql_client.clone(),
4067        }
4068    }
4069    /// Retrieves the value of the specified label.
4070    ///
4071    /// # Arguments
4072    ///
4073    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4074    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
4075        let mut query = self.selection.select("label");
4076        query = query.arg("name", name.into());
4077        query.execute(self.graphql_client.clone()).await
4078    }
4079    /// Retrieves the list of labels passed to container.
4080    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
4081        let query = self.selection.select("labels");
4082        let query = query.select("id");
4083        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4084        Ok(ids
4085            .into_iter()
4086            .map(|id| Label {
4087                proc: self.proc.clone(),
4088                selection: crate::querybuilder::query()
4089                    .select("node")
4090                    .arg("id", &id.0)
4091                    .inline_fragment("Label"),
4092                graphql_client: self.graphql_client.clone(),
4093            })
4094            .collect())
4095    }
4096    /// Retrieves this container minus the given environment label.
4097    ///
4098    /// # Arguments
4099    ///
4100    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4101    pub fn without_label(&self, name: impl Into<String>) -> Container {
4102        let mut query = self.selection.select("withoutLabel");
4103        query = query.arg("name", name.into());
4104        Container {
4105            proc: self.proc.clone(),
4106            selection: query,
4107            graphql_client: self.graphql_client.clone(),
4108        }
4109    }
4110    /// Retrieves this container with the specificed docker healtcheck command set.
4111    ///
4112    /// # Arguments
4113    ///
4114    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4115    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4116    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4117        let mut query = self.selection.select("withDockerHealthcheck");
4118        query = query.arg(
4119            "args",
4120            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4121        );
4122        Container {
4123            proc: self.proc.clone(),
4124            selection: query,
4125            graphql_client: self.graphql_client.clone(),
4126        }
4127    }
4128    /// Retrieves this container with the specificed docker healtcheck command set.
4129    ///
4130    /// # Arguments
4131    ///
4132    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4133    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4134    pub fn with_docker_healthcheck_opts<'a>(
4135        &self,
4136        args: Vec<impl Into<String>>,
4137        opts: ContainerWithDockerHealthcheckOpts<'a>,
4138    ) -> Container {
4139        let mut query = self.selection.select("withDockerHealthcheck");
4140        query = query.arg(
4141            "args",
4142            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4143        );
4144        if let Some(shell) = opts.shell {
4145            query = query.arg("shell", shell);
4146        }
4147        if let Some(interval) = opts.interval {
4148            query = query.arg("interval", interval);
4149        }
4150        if let Some(timeout) = opts.timeout {
4151            query = query.arg("timeout", timeout);
4152        }
4153        if let Some(start_period) = opts.start_period {
4154            query = query.arg("startPeriod", start_period);
4155        }
4156        if let Some(start_interval) = opts.start_interval {
4157            query = query.arg("startInterval", start_interval);
4158        }
4159        if let Some(retries) = opts.retries {
4160            query = query.arg("retries", retries);
4161        }
4162        Container {
4163            proc: self.proc.clone(),
4164            selection: query,
4165            graphql_client: self.graphql_client.clone(),
4166        }
4167    }
4168    /// Retrieves this container without a configured docker healtcheck command.
4169    pub fn without_docker_healthcheck(&self) -> Container {
4170        let query = self.selection.select("withoutDockerHealthcheck");
4171        Container {
4172            proc: self.proc.clone(),
4173            selection: query,
4174            graphql_client: self.graphql_client.clone(),
4175        }
4176    }
4177    /// Retrieves this container's configured docker healthcheck.
4178    pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
4179        let query = self.selection.select("dockerHealthcheck");
4180        let query = query.select("id");
4181        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
4182        Ok(id.map(|id| HealthcheckConfig {
4183            proc: self.proc.clone(),
4184            selection: query
4185                .root()
4186                .select("node")
4187                .arg("id", &id.0)
4188                .inline_fragment("HealthcheckConfig"),
4189            graphql_client: self.graphql_client.clone(),
4190        }))
4191    }
4192    /// Return the container's OCI entrypoint.
4193    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
4194        let query = self.selection.select("entrypoint");
4195        query.execute(self.graphql_client.clone()).await
4196    }
4197    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4198    ///
4199    /// # Arguments
4200    ///
4201    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4202    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4203    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4204        let mut query = self.selection.select("withEntrypoint");
4205        query = query.arg(
4206            "args",
4207            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4208        );
4209        Container {
4210            proc: self.proc.clone(),
4211            selection: query,
4212            graphql_client: self.graphql_client.clone(),
4213        }
4214    }
4215    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4216    ///
4217    /// # Arguments
4218    ///
4219    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4220    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4221    pub fn with_entrypoint_opts(
4222        &self,
4223        args: Vec<impl Into<String>>,
4224        opts: ContainerWithEntrypointOpts,
4225    ) -> Container {
4226        let mut query = self.selection.select("withEntrypoint");
4227        query = query.arg(
4228            "args",
4229            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4230        );
4231        if let Some(keep_default_args) = opts.keep_default_args {
4232            query = query.arg("keepDefaultArgs", keep_default_args);
4233        }
4234        Container {
4235            proc: self.proc.clone(),
4236            selection: query,
4237            graphql_client: self.graphql_client.clone(),
4238        }
4239    }
4240    /// Reset the container's OCI entrypoint.
4241    ///
4242    /// # Arguments
4243    ///
4244    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4245    pub fn without_entrypoint(&self) -> Container {
4246        let query = self.selection.select("withoutEntrypoint");
4247        Container {
4248            proc: self.proc.clone(),
4249            selection: query,
4250            graphql_client: self.graphql_client.clone(),
4251        }
4252    }
4253    /// Reset the container's OCI entrypoint.
4254    ///
4255    /// # Arguments
4256    ///
4257    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4258    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4259        let mut query = self.selection.select("withoutEntrypoint");
4260        if let Some(keep_default_args) = opts.keep_default_args {
4261            query = query.arg("keepDefaultArgs", keep_default_args);
4262        }
4263        Container {
4264            proc: self.proc.clone(),
4265            selection: query,
4266            graphql_client: self.graphql_client.clone(),
4267        }
4268    }
4269    /// Return the container's default arguments.
4270    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
4271        let query = self.selection.select("defaultArgs");
4272        query.execute(self.graphql_client.clone()).await
4273    }
4274    /// Configures default arguments for future commands. Like CMD in Dockerfile.
4275    ///
4276    /// # Arguments
4277    ///
4278    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
4279    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4280        let mut query = self.selection.select("withDefaultArgs");
4281        query = query.arg(
4282            "args",
4283            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4284        );
4285        Container {
4286            proc: self.proc.clone(),
4287            selection: query,
4288            graphql_client: self.graphql_client.clone(),
4289        }
4290    }
4291    /// Remove the container's default arguments.
4292    pub fn without_default_args(&self) -> Container {
4293        let query = self.selection.select("withoutDefaultArgs");
4294        Container {
4295            proc: self.proc.clone(),
4296            selection: query,
4297            graphql_client: self.graphql_client.clone(),
4298        }
4299    }
4300    /// Retrieves the list of paths where a directory is mounted.
4301    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
4302        let query = self.selection.select("mounts");
4303        query.execute(self.graphql_client.clone()).await
4304    }
4305    /// Retrieves this container plus a directory mounted at the given path.
4306    ///
4307    /// # Arguments
4308    ///
4309    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4310    /// * `source` - Identifier of the mounted directory.
4311    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4312    pub fn with_mounted_directory(
4313        &self,
4314        path: impl Into<String>,
4315        source: impl IntoID<Id>,
4316    ) -> Container {
4317        let mut query = self.selection.select("withMountedDirectory");
4318        query = query.arg("path", path.into());
4319        query = query.arg_lazy(
4320            "source",
4321            Box::new(move || {
4322                let source = source.clone();
4323                Box::pin(async move { source.into_id().await.unwrap().quote() })
4324            }),
4325        );
4326        Container {
4327            proc: self.proc.clone(),
4328            selection: query,
4329            graphql_client: self.graphql_client.clone(),
4330        }
4331    }
4332    /// Retrieves this container plus a directory mounted at the given path.
4333    ///
4334    /// # Arguments
4335    ///
4336    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4337    /// * `source` - Identifier of the mounted directory.
4338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4339    pub fn with_mounted_directory_opts<'a>(
4340        &self,
4341        path: impl Into<String>,
4342        source: impl IntoID<Id>,
4343        opts: ContainerWithMountedDirectoryOpts<'a>,
4344    ) -> Container {
4345        let mut query = self.selection.select("withMountedDirectory");
4346        query = query.arg("path", path.into());
4347        query = query.arg_lazy(
4348            "source",
4349            Box::new(move || {
4350                let source = source.clone();
4351                Box::pin(async move { source.into_id().await.unwrap().quote() })
4352            }),
4353        );
4354        if let Some(owner) = opts.owner {
4355            query = query.arg("owner", owner);
4356        }
4357        if let Some(inherit_owner) = opts.inherit_owner {
4358            query = query.arg("inheritOwner", inherit_owner);
4359        }
4360        if let Some(read_only) = opts.read_only {
4361            query = query.arg("readOnly", read_only);
4362        }
4363        if let Some(expand) = opts.expand {
4364            query = query.arg("expand", expand);
4365        }
4366        Container {
4367            proc: self.proc.clone(),
4368            selection: query,
4369            graphql_client: self.graphql_client.clone(),
4370        }
4371    }
4372    /// Retrieves this container plus a file mounted at the given path.
4373    ///
4374    /// # Arguments
4375    ///
4376    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4377    /// * `source` - Identifier of the mounted file.
4378    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4379    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4380        let mut query = self.selection.select("withMountedFile");
4381        query = query.arg("path", path.into());
4382        query = query.arg_lazy(
4383            "source",
4384            Box::new(move || {
4385                let source = source.clone();
4386                Box::pin(async move { source.into_id().await.unwrap().quote() })
4387            }),
4388        );
4389        Container {
4390            proc: self.proc.clone(),
4391            selection: query,
4392            graphql_client: self.graphql_client.clone(),
4393        }
4394    }
4395    /// Retrieves this container plus a file mounted at the given path.
4396    ///
4397    /// # Arguments
4398    ///
4399    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4400    /// * `source` - Identifier of the mounted file.
4401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4402    pub fn with_mounted_file_opts<'a>(
4403        &self,
4404        path: impl Into<String>,
4405        source: impl IntoID<Id>,
4406        opts: ContainerWithMountedFileOpts<'a>,
4407    ) -> Container {
4408        let mut query = self.selection.select("withMountedFile");
4409        query = query.arg("path", path.into());
4410        query = query.arg_lazy(
4411            "source",
4412            Box::new(move || {
4413                let source = source.clone();
4414                Box::pin(async move { source.into_id().await.unwrap().quote() })
4415            }),
4416        );
4417        if let Some(owner) = opts.owner {
4418            query = query.arg("owner", owner);
4419        }
4420        if let Some(inherit_owner) = opts.inherit_owner {
4421            query = query.arg("inheritOwner", inherit_owner);
4422        }
4423        if let Some(expand) = opts.expand {
4424            query = query.arg("expand", expand);
4425        }
4426        if let Some(read_only) = opts.read_only {
4427            query = query.arg("readOnly", read_only);
4428        }
4429        Container {
4430            proc: self.proc.clone(),
4431            selection: query,
4432            graphql_client: self.graphql_client.clone(),
4433        }
4434    }
4435    /// 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.
4436    ///
4437    /// # Arguments
4438    ///
4439    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4440    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4441    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4442        let mut query = self.selection.select("withMountedTemp");
4443        query = query.arg("path", path.into());
4444        Container {
4445            proc: self.proc.clone(),
4446            selection: query,
4447            graphql_client: self.graphql_client.clone(),
4448        }
4449    }
4450    /// 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.
4451    ///
4452    /// # Arguments
4453    ///
4454    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4455    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4456    pub fn with_mounted_temp_opts(
4457        &self,
4458        path: impl Into<String>,
4459        opts: ContainerWithMountedTempOpts,
4460    ) -> Container {
4461        let mut query = self.selection.select("withMountedTemp");
4462        query = query.arg("path", path.into());
4463        if let Some(size) = opts.size {
4464            query = query.arg("size", size);
4465        }
4466        if let Some(expand) = opts.expand {
4467            query = query.arg("expand", expand);
4468        }
4469        Container {
4470            proc: self.proc.clone(),
4471            selection: query,
4472            graphql_client: self.graphql_client.clone(),
4473        }
4474    }
4475    /// Retrieves this container plus a cache volume mounted at the given path.
4476    ///
4477    /// # Arguments
4478    ///
4479    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4480    /// * `cache` - Identifier of the cache volume to mount.
4481    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4482    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
4483        let mut query = self.selection.select("withMountedCache");
4484        query = query.arg("path", path.into());
4485        query = query.arg_lazy(
4486            "cache",
4487            Box::new(move || {
4488                let cache = cache.clone();
4489                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4490            }),
4491        );
4492        Container {
4493            proc: self.proc.clone(),
4494            selection: query,
4495            graphql_client: self.graphql_client.clone(),
4496        }
4497    }
4498    /// Retrieves this container plus a cache volume mounted at the given path.
4499    ///
4500    /// # Arguments
4501    ///
4502    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4503    /// * `cache` - Identifier of the cache volume to mount.
4504    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4505    pub fn with_mounted_cache_opts<'a>(
4506        &self,
4507        path: impl Into<String>,
4508        cache: impl IntoID<Id>,
4509        opts: ContainerWithMountedCacheOpts<'a>,
4510    ) -> Container {
4511        let mut query = self.selection.select("withMountedCache");
4512        query = query.arg("path", path.into());
4513        query = query.arg_lazy(
4514            "cache",
4515            Box::new(move || {
4516                let cache = cache.clone();
4517                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4518            }),
4519        );
4520        if let Some(source) = opts.source {
4521            query = query.arg("source", source);
4522        }
4523        if let Some(sharing) = opts.sharing {
4524            query = query.arg("sharing", sharing);
4525        }
4526        if let Some(owner) = opts.owner {
4527            query = query.arg("owner", owner);
4528        }
4529        if let Some(inherit_owner) = opts.inherit_owner {
4530            query = query.arg("inheritOwner", inherit_owner);
4531        }
4532        if let Some(expand) = opts.expand {
4533            query = query.arg("expand", expand);
4534        }
4535        Container {
4536            proc: self.proc.clone(),
4537            selection: query,
4538            graphql_client: self.graphql_client.clone(),
4539        }
4540    }
4541    /// Retrieves this container plus a volume mounted at the given path.
4542    ///
4543    /// # Arguments
4544    ///
4545    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4546    /// * `volume` - Identifier of the volume to mount.
4547    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4548    pub fn with_mounted_volume(
4549        &self,
4550        path: impl Into<String>,
4551        volume: impl IntoID<Id>,
4552    ) -> Container {
4553        let mut query = self.selection.select("withMountedVolume");
4554        query = query.arg("path", path.into());
4555        query = query.arg_lazy(
4556            "volume",
4557            Box::new(move || {
4558                let volume = volume.clone();
4559                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4560            }),
4561        );
4562        Container {
4563            proc: self.proc.clone(),
4564            selection: query,
4565            graphql_client: self.graphql_client.clone(),
4566        }
4567    }
4568    /// Retrieves this container plus a volume mounted at the given path.
4569    ///
4570    /// # Arguments
4571    ///
4572    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4573    /// * `volume` - Identifier of the volume to mount.
4574    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4575    pub fn with_mounted_volume_opts(
4576        &self,
4577        path: impl Into<String>,
4578        volume: impl IntoID<Id>,
4579        opts: ContainerWithMountedVolumeOpts,
4580    ) -> Container {
4581        let mut query = self.selection.select("withMountedVolume");
4582        query = query.arg("path", path.into());
4583        query = query.arg_lazy(
4584            "volume",
4585            Box::new(move || {
4586                let volume = volume.clone();
4587                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4588            }),
4589        );
4590        if let Some(read_only) = opts.read_only {
4591            query = query.arg("readOnly", read_only);
4592        }
4593        if let Some(expand) = opts.expand {
4594            query = query.arg("expand", expand);
4595        }
4596        Container {
4597            proc: self.proc.clone(),
4598            selection: query,
4599            graphql_client: self.graphql_client.clone(),
4600        }
4601    }
4602    /// Retrieves this container plus a secret mounted into a file at the given path.
4603    ///
4604    /// # Arguments
4605    ///
4606    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4607    /// * `source` - Identifier of the secret to mount.
4608    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4609    pub fn with_mounted_secret(
4610        &self,
4611        path: impl Into<String>,
4612        source: impl IntoID<Id>,
4613    ) -> Container {
4614        let mut query = self.selection.select("withMountedSecret");
4615        query = query.arg("path", path.into());
4616        query = query.arg_lazy(
4617            "source",
4618            Box::new(move || {
4619                let source = source.clone();
4620                Box::pin(async move { source.into_id().await.unwrap().quote() })
4621            }),
4622        );
4623        Container {
4624            proc: self.proc.clone(),
4625            selection: query,
4626            graphql_client: self.graphql_client.clone(),
4627        }
4628    }
4629    /// Retrieves this container plus a secret mounted into a file at the given path.
4630    ///
4631    /// # Arguments
4632    ///
4633    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4634    /// * `source` - Identifier of the secret to mount.
4635    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4636    pub fn with_mounted_secret_opts<'a>(
4637        &self,
4638        path: impl Into<String>,
4639        source: impl IntoID<Id>,
4640        opts: ContainerWithMountedSecretOpts<'a>,
4641    ) -> Container {
4642        let mut query = self.selection.select("withMountedSecret");
4643        query = query.arg("path", path.into());
4644        query = query.arg_lazy(
4645            "source",
4646            Box::new(move || {
4647                let source = source.clone();
4648                Box::pin(async move { source.into_id().await.unwrap().quote() })
4649            }),
4650        );
4651        if let Some(owner) = opts.owner {
4652            query = query.arg("owner", owner);
4653        }
4654        if let Some(inherit_owner) = opts.inherit_owner {
4655            query = query.arg("inheritOwner", inherit_owner);
4656        }
4657        if let Some(mode) = opts.mode {
4658            query = query.arg("mode", mode);
4659        }
4660        if let Some(expand) = opts.expand {
4661            query = query.arg("expand", expand);
4662        }
4663        Container {
4664            proc: self.proc.clone(),
4665            selection: query,
4666            graphql_client: self.graphql_client.clone(),
4667        }
4668    }
4669    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4670    ///
4671    /// # Arguments
4672    ///
4673    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4674    /// * `source` - Identifier of the socket to forward.
4675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4676    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4677        let mut query = self.selection.select("withUnixSocket");
4678        query = query.arg("path", path.into());
4679        query = query.arg_lazy(
4680            "source",
4681            Box::new(move || {
4682                let source = source.clone();
4683                Box::pin(async move { source.into_id().await.unwrap().quote() })
4684            }),
4685        );
4686        Container {
4687            proc: self.proc.clone(),
4688            selection: query,
4689            graphql_client: self.graphql_client.clone(),
4690        }
4691    }
4692    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4693    ///
4694    /// # Arguments
4695    ///
4696    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4697    /// * `source` - Identifier of the socket to forward.
4698    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4699    pub fn with_unix_socket_opts<'a>(
4700        &self,
4701        path: impl Into<String>,
4702        source: impl IntoID<Id>,
4703        opts: ContainerWithUnixSocketOpts<'a>,
4704    ) -> Container {
4705        let mut query = self.selection.select("withUnixSocket");
4706        query = query.arg("path", path.into());
4707        query = query.arg_lazy(
4708            "source",
4709            Box::new(move || {
4710                let source = source.clone();
4711                Box::pin(async move { source.into_id().await.unwrap().quote() })
4712            }),
4713        );
4714        if let Some(owner) = opts.owner {
4715            query = query.arg("owner", owner);
4716        }
4717        if let Some(inherit_owner) = opts.inherit_owner {
4718            query = query.arg("inheritOwner", inherit_owner);
4719        }
4720        if let Some(expand) = opts.expand {
4721            query = query.arg("expand", expand);
4722        }
4723        Container {
4724            proc: self.proc.clone(),
4725            selection: query,
4726            graphql_client: self.graphql_client.clone(),
4727        }
4728    }
4729    /// Retrieves this container with a previously added Unix socket removed.
4730    ///
4731    /// # Arguments
4732    ///
4733    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4735    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4736        let mut query = self.selection.select("withoutUnixSocket");
4737        query = query.arg("path", path.into());
4738        Container {
4739            proc: self.proc.clone(),
4740            selection: query,
4741            graphql_client: self.graphql_client.clone(),
4742        }
4743    }
4744    /// Retrieves this container with a previously added Unix socket removed.
4745    ///
4746    /// # Arguments
4747    ///
4748    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4750    pub fn without_unix_socket_opts(
4751        &self,
4752        path: impl Into<String>,
4753        opts: ContainerWithoutUnixSocketOpts,
4754    ) -> Container {
4755        let mut query = self.selection.select("withoutUnixSocket");
4756        query = query.arg("path", path.into());
4757        if let Some(expand) = opts.expand {
4758            query = query.arg("expand", expand);
4759        }
4760        Container {
4761            proc: self.proc.clone(),
4762            selection: query,
4763            graphql_client: self.graphql_client.clone(),
4764        }
4765    }
4766    /// Retrieves this container after unmounting everything at the given path.
4767    ///
4768    /// # Arguments
4769    ///
4770    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4771    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4772    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4773        let mut query = self.selection.select("withoutMount");
4774        query = query.arg("path", path.into());
4775        Container {
4776            proc: self.proc.clone(),
4777            selection: query,
4778            graphql_client: self.graphql_client.clone(),
4779        }
4780    }
4781    /// Retrieves this container after unmounting everything at the given path.
4782    ///
4783    /// # Arguments
4784    ///
4785    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4786    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4787    pub fn without_mount_opts(
4788        &self,
4789        path: impl Into<String>,
4790        opts: ContainerWithoutMountOpts,
4791    ) -> Container {
4792        let mut query = self.selection.select("withoutMount");
4793        query = query.arg("path", path.into());
4794        if let Some(expand) = opts.expand {
4795            query = query.arg("expand", expand);
4796        }
4797        Container {
4798            proc: self.proc.clone(),
4799            selection: query,
4800            graphql_client: self.graphql_client.clone(),
4801        }
4802    }
4803    /// Return a container snapshot with a file added
4804    ///
4805    /// # Arguments
4806    ///
4807    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4808    /// * `source` - File to add
4809    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4810    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4811        let mut query = self.selection.select("withFile");
4812        query = query.arg("path", path.into());
4813        query = query.arg_lazy(
4814            "source",
4815            Box::new(move || {
4816                let source = source.clone();
4817                Box::pin(async move { source.into_id().await.unwrap().quote() })
4818            }),
4819        );
4820        Container {
4821            proc: self.proc.clone(),
4822            selection: query,
4823            graphql_client: self.graphql_client.clone(),
4824        }
4825    }
4826    /// Return a container snapshot with a file added
4827    ///
4828    /// # Arguments
4829    ///
4830    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4831    /// * `source` - File to add
4832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4833    pub fn with_file_opts<'a>(
4834        &self,
4835        path: impl Into<String>,
4836        source: impl IntoID<Id>,
4837        opts: ContainerWithFileOpts<'a>,
4838    ) -> Container {
4839        let mut query = self.selection.select("withFile");
4840        query = query.arg("path", path.into());
4841        query = query.arg_lazy(
4842            "source",
4843            Box::new(move || {
4844                let source = source.clone();
4845                Box::pin(async move { source.into_id().await.unwrap().quote() })
4846            }),
4847        );
4848        if let Some(permissions) = opts.permissions {
4849            query = query.arg("permissions", permissions);
4850        }
4851        if let Some(owner) = opts.owner {
4852            query = query.arg("owner", owner);
4853        }
4854        if let Some(inherit_owner) = opts.inherit_owner {
4855            query = query.arg("inheritOwner", inherit_owner);
4856        }
4857        if let Some(expand) = opts.expand {
4858            query = query.arg("expand", expand);
4859        }
4860        Container {
4861            proc: self.proc.clone(),
4862            selection: query,
4863            graphql_client: self.graphql_client.clone(),
4864        }
4865    }
4866    /// Retrieves this container with the file at the given path removed.
4867    ///
4868    /// # Arguments
4869    ///
4870    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4871    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4872    pub fn without_file(&self, path: impl Into<String>) -> Container {
4873        let mut query = self.selection.select("withoutFile");
4874        query = query.arg("path", path.into());
4875        Container {
4876            proc: self.proc.clone(),
4877            selection: query,
4878            graphql_client: self.graphql_client.clone(),
4879        }
4880    }
4881    /// Retrieves this container with the file at the given path removed.
4882    ///
4883    /// # Arguments
4884    ///
4885    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4886    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4887    pub fn without_file_opts(
4888        &self,
4889        path: impl Into<String>,
4890        opts: ContainerWithoutFileOpts,
4891    ) -> Container {
4892        let mut query = self.selection.select("withoutFile");
4893        query = query.arg("path", path.into());
4894        if let Some(expand) = opts.expand {
4895            query = query.arg("expand", expand);
4896        }
4897        Container {
4898            proc: self.proc.clone(),
4899            selection: query,
4900            graphql_client: self.graphql_client.clone(),
4901        }
4902    }
4903    /// Return a new container spanshot with specified files removed
4904    ///
4905    /// # Arguments
4906    ///
4907    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4908    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4909    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4910        let mut query = self.selection.select("withoutFiles");
4911        query = query.arg(
4912            "paths",
4913            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4914        );
4915        Container {
4916            proc: self.proc.clone(),
4917            selection: query,
4918            graphql_client: self.graphql_client.clone(),
4919        }
4920    }
4921    /// Return a new container spanshot with specified files removed
4922    ///
4923    /// # Arguments
4924    ///
4925    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4926    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4927    pub fn without_files_opts(
4928        &self,
4929        paths: Vec<impl Into<String>>,
4930        opts: ContainerWithoutFilesOpts,
4931    ) -> Container {
4932        let mut query = self.selection.select("withoutFiles");
4933        query = query.arg(
4934            "paths",
4935            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4936        );
4937        if let Some(expand) = opts.expand {
4938            query = query.arg("expand", expand);
4939        }
4940        Container {
4941            proc: self.proc.clone(),
4942            selection: query,
4943            graphql_client: self.graphql_client.clone(),
4944        }
4945    }
4946    /// Retrieves this container plus the contents of the given files copied to the given path.
4947    ///
4948    /// # Arguments
4949    ///
4950    /// * `path` - Location where copied files should be placed (e.g., "/src").
4951    /// * `sources` - Identifiers of the files to copy.
4952    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4953    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
4954        let mut query = self.selection.select("withFiles");
4955        query = query.arg("path", path.into());
4956        query = query.arg("sources", sources);
4957        Container {
4958            proc: self.proc.clone(),
4959            selection: query,
4960            graphql_client: self.graphql_client.clone(),
4961        }
4962    }
4963    /// Retrieves this container plus the contents of the given files copied to the given path.
4964    ///
4965    /// # Arguments
4966    ///
4967    /// * `path` - Location where copied files should be placed (e.g., "/src").
4968    /// * `sources` - Identifiers of the files to copy.
4969    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4970    pub fn with_files_opts<'a>(
4971        &self,
4972        path: impl Into<String>,
4973        sources: Vec<Id>,
4974        opts: ContainerWithFilesOpts<'a>,
4975    ) -> Container {
4976        let mut query = self.selection.select("withFiles");
4977        query = query.arg("path", path.into());
4978        query = query.arg("sources", sources);
4979        if let Some(permissions) = opts.permissions {
4980            query = query.arg("permissions", permissions);
4981        }
4982        if let Some(owner) = opts.owner {
4983            query = query.arg("owner", owner);
4984        }
4985        if let Some(inherit_owner) = opts.inherit_owner {
4986            query = query.arg("inheritOwner", inherit_owner);
4987        }
4988        if let Some(expand) = opts.expand {
4989            query = query.arg("expand", expand);
4990        }
4991        Container {
4992            proc: self.proc.clone(),
4993            selection: query,
4994            graphql_client: self.graphql_client.clone(),
4995        }
4996    }
4997    /// Return a new container snapshot, with a file added to its filesystem with text content
4998    ///
4999    /// # Arguments
5000    ///
5001    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
5002    /// * `contents` - Contents of the new file. Example: "Hello world!"
5003    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5004    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
5005        let mut query = self.selection.select("withNewFile");
5006        query = query.arg("path", path.into());
5007        query = query.arg("contents", contents.into());
5008        Container {
5009            proc: self.proc.clone(),
5010            selection: query,
5011            graphql_client: self.graphql_client.clone(),
5012        }
5013    }
5014    /// Return a new container snapshot, with a file added to its filesystem with text content
5015    ///
5016    /// # Arguments
5017    ///
5018    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
5019    /// * `contents` - Contents of the new file. Example: "Hello world!"
5020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5021    pub fn with_new_file_opts<'a>(
5022        &self,
5023        path: impl Into<String>,
5024        contents: impl Into<String>,
5025        opts: ContainerWithNewFileOpts<'a>,
5026    ) -> Container {
5027        let mut query = self.selection.select("withNewFile");
5028        query = query.arg("path", path.into());
5029        query = query.arg("contents", contents.into());
5030        if let Some(permissions) = opts.permissions {
5031            query = query.arg("permissions", permissions);
5032        }
5033        if let Some(owner) = opts.owner {
5034            query = query.arg("owner", owner);
5035        }
5036        if let Some(inherit_owner) = opts.inherit_owner {
5037            query = query.arg("inheritOwner", inherit_owner);
5038        }
5039        if let Some(expand) = opts.expand {
5040            query = query.arg("expand", expand);
5041        }
5042        Container {
5043            proc: self.proc.clone(),
5044            selection: query,
5045            graphql_client: self.graphql_client.clone(),
5046        }
5047    }
5048    /// Return a new container snapshot, with a directory added to its filesystem
5049    ///
5050    /// # Arguments
5051    ///
5052    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
5053    /// * `source` - Identifier of the directory to write
5054    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5055    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
5056        let mut query = self.selection.select("withDirectory");
5057        query = query.arg("path", path.into());
5058        query = query.arg_lazy(
5059            "source",
5060            Box::new(move || {
5061                let source = source.clone();
5062                Box::pin(async move { source.into_id().await.unwrap().quote() })
5063            }),
5064        );
5065        Container {
5066            proc: self.proc.clone(),
5067            selection: query,
5068            graphql_client: self.graphql_client.clone(),
5069        }
5070    }
5071    /// Return a new container snapshot, with a directory added to its filesystem
5072    ///
5073    /// # Arguments
5074    ///
5075    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
5076    /// * `source` - Identifier of the directory to write
5077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5078    pub fn with_directory_opts<'a>(
5079        &self,
5080        path: impl Into<String>,
5081        source: impl IntoID<Id>,
5082        opts: ContainerWithDirectoryOpts<'a>,
5083    ) -> Container {
5084        let mut query = self.selection.select("withDirectory");
5085        query = query.arg("path", path.into());
5086        query = query.arg_lazy(
5087            "source",
5088            Box::new(move || {
5089                let source = source.clone();
5090                Box::pin(async move { source.into_id().await.unwrap().quote() })
5091            }),
5092        );
5093        if let Some(exclude) = opts.exclude {
5094            query = query.arg("exclude", exclude);
5095        }
5096        if let Some(include) = opts.include {
5097            query = query.arg("include", include);
5098        }
5099        if let Some(gitignore) = opts.gitignore {
5100            query = query.arg("gitignore", gitignore);
5101        }
5102        if let Some(owner) = opts.owner {
5103            query = query.arg("owner", owner);
5104        }
5105        if let Some(inherit_owner) = opts.inherit_owner {
5106            query = query.arg("inheritOwner", inherit_owner);
5107        }
5108        if let Some(expand) = opts.expand {
5109            query = query.arg("expand", expand);
5110        }
5111        if let Some(permissions) = opts.permissions {
5112            query = query.arg("permissions", permissions);
5113        }
5114        Container {
5115            proc: self.proc.clone(),
5116            selection: query,
5117            graphql_client: self.graphql_client.clone(),
5118        }
5119    }
5120    /// Return a new container snapshot, with a directory removed from its filesystem
5121    ///
5122    /// # Arguments
5123    ///
5124    /// * `path` - Location of the directory to remove (e.g., ".github/").
5125    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5126    pub fn without_directory(&self, path: impl Into<String>) -> Container {
5127        let mut query = self.selection.select("withoutDirectory");
5128        query = query.arg("path", path.into());
5129        Container {
5130            proc: self.proc.clone(),
5131            selection: query,
5132            graphql_client: self.graphql_client.clone(),
5133        }
5134    }
5135    /// Return a new container snapshot, with a directory removed from its filesystem
5136    ///
5137    /// # Arguments
5138    ///
5139    /// * `path` - Location of the directory to remove (e.g., ".github/").
5140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5141    pub fn without_directory_opts(
5142        &self,
5143        path: impl Into<String>,
5144        opts: ContainerWithoutDirectoryOpts,
5145    ) -> Container {
5146        let mut query = self.selection.select("withoutDirectory");
5147        query = query.arg("path", path.into());
5148        if let Some(expand) = opts.expand {
5149            query = query.arg("expand", expand);
5150        }
5151        Container {
5152            proc: self.proc.clone(),
5153            selection: query,
5154            graphql_client: self.graphql_client.clone(),
5155        }
5156    }
5157    /// check if a file or directory exists
5158    ///
5159    /// # Arguments
5160    ///
5161    /// * `path` - Path to check (e.g., "/file.txt").
5162    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5163    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5164        let mut query = self.selection.select("exists");
5165        query = query.arg("path", path.into());
5166        query.execute(self.graphql_client.clone()).await
5167    }
5168    /// check if a file or directory exists
5169    ///
5170    /// # Arguments
5171    ///
5172    /// * `path` - Path to check (e.g., "/file.txt").
5173    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5174    pub async fn exists_opts(
5175        &self,
5176        path: impl Into<String>,
5177        opts: ContainerExistsOpts,
5178    ) -> Result<bool, DaggerError> {
5179        let mut query = self.selection.select("exists");
5180        query = query.arg("path", path.into());
5181        if let Some(expected_type) = opts.expected_type {
5182            query = query.arg("expectedType", expected_type);
5183        }
5184        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5185            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5186        }
5187        if let Some(expand) = opts.expand {
5188            query = query.arg("expand", expand);
5189        }
5190        query.execute(self.graphql_client.clone()).await
5191    }
5192    /// Return file status
5193    ///
5194    /// # Arguments
5195    ///
5196    /// * `path` - Path to check (e.g., "/file.txt").
5197    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5198    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5199        let mut query = self.selection.select("stat");
5200        query = query.arg("path", path.into());
5201        let query = query.select("id");
5202        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5203        Ok(id.map(|id| Stat {
5204            proc: self.proc.clone(),
5205            selection: query
5206                .root()
5207                .select("node")
5208                .arg("id", &id.0)
5209                .inline_fragment("Stat"),
5210            graphql_client: self.graphql_client.clone(),
5211        }))
5212    }
5213    /// Return file status
5214    ///
5215    /// # Arguments
5216    ///
5217    /// * `path` - Path to check (e.g., "/file.txt").
5218    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5219    pub async fn stat_opts(
5220        &self,
5221        path: impl Into<String>,
5222        opts: ContainerStatOpts,
5223    ) -> Result<Option<Stat>, DaggerError> {
5224        let mut query = self.selection.select("stat");
5225        query = query.arg("path", path.into());
5226        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5227            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5228        }
5229        let query = query.select("id");
5230        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5231        Ok(id.map(|id| Stat {
5232            proc: self.proc.clone(),
5233            selection: query
5234                .root()
5235                .select("node")
5236                .arg("id", &id.0)
5237                .inline_fragment("Stat"),
5238            graphql_client: self.graphql_client.clone(),
5239        }))
5240    }
5241    /// Raise an error.
5242    ///
5243    /// # Arguments
5244    ///
5245    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5246    pub fn with_error(&self, err: impl Into<String>) -> Container {
5247        let mut query = self.selection.select("withError");
5248        query = query.arg("err", err.into());
5249        Container {
5250            proc: self.proc.clone(),
5251            selection: query,
5252            graphql_client: self.graphql_client.clone(),
5253        }
5254    }
5255    /// Execute a command in the container, and return a new snapshot of the container state after execution.
5256    ///
5257    /// # Arguments
5258    ///
5259    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
5260    ///
5261    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
5262    ///
5263    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
5264    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5265    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
5266        let mut query = self.selection.select("withExec");
5267        query = query.arg(
5268            "args",
5269            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5270        );
5271        Container {
5272            proc: self.proc.clone(),
5273            selection: query,
5274            graphql_client: self.graphql_client.clone(),
5275        }
5276    }
5277    /// Execute a command in the container, and return a new snapshot of the container state after execution.
5278    ///
5279    /// # Arguments
5280    ///
5281    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
5282    ///
5283    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
5284    ///
5285    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
5286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5287    pub fn with_exec_opts<'a>(
5288        &self,
5289        args: Vec<impl Into<String>>,
5290        opts: ContainerWithExecOpts<'a>,
5291    ) -> Container {
5292        let mut query = self.selection.select("withExec");
5293        query = query.arg(
5294            "args",
5295            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5296        );
5297        if let Some(use_entrypoint) = opts.use_entrypoint {
5298            query = query.arg("useEntrypoint", use_entrypoint);
5299        }
5300        if let Some(stdin) = opts.stdin {
5301            query = query.arg("stdin", stdin);
5302        }
5303        if let Some(redirect_stdin) = opts.redirect_stdin {
5304            query = query.arg("redirectStdin", redirect_stdin);
5305        }
5306        if let Some(redirect_stdout) = opts.redirect_stdout {
5307            query = query.arg("redirectStdout", redirect_stdout);
5308        }
5309        if let Some(redirect_stderr) = opts.redirect_stderr {
5310            query = query.arg("redirectStderr", redirect_stderr);
5311        }
5312        if let Some(expect) = opts.expect {
5313            query = query.arg("expect", expect);
5314        }
5315        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5316            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5317        }
5318        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5319            query = query.arg(
5320                "experimentalPrivilegedNesting",
5321                experimental_privileged_nesting,
5322            );
5323        }
5324        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
5325            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
5326        }
5327        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5328            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5329        }
5330        if let Some(expand) = opts.expand {
5331            query = query.arg("expand", expand);
5332        }
5333        if let Some(no_init) = opts.no_init {
5334            query = query.arg("noInit", no_init);
5335        }
5336        Container {
5337            proc: self.proc.clone(),
5338            selection: query,
5339            graphql_client: self.graphql_client.clone(),
5340        }
5341    }
5342    /// The buffered standard output stream of the last executed command
5343    /// Returns an error if no command was executed
5344    pub async fn stdout(&self) -> Result<String, DaggerError> {
5345        let query = self.selection.select("stdout");
5346        query.execute(self.graphql_client.clone()).await
5347    }
5348    /// The buffered standard error stream of the last executed command
5349    /// Returns an error if no command was executed
5350    pub async fn stderr(&self) -> Result<String, DaggerError> {
5351        let query = self.selection.select("stderr");
5352        query.execute(self.graphql_client.clone()).await
5353    }
5354    /// The combined buffered standard output and standard error stream of the last executed command
5355    /// Returns an error if no command was executed
5356    pub async fn combined_output(&self) -> Result<String, DaggerError> {
5357        let query = self.selection.select("combinedOutput");
5358        query.execute(self.graphql_client.clone()).await
5359    }
5360    /// The exit code of the last executed command
5361    /// Returns an error if no command was executed
5362    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
5363        let query = self.selection.select("exitCode");
5364        query.execute(self.graphql_client.clone()).await
5365    }
5366    /// Return a snapshot with a symlink
5367    ///
5368    /// # Arguments
5369    ///
5370    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5371    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5373    pub fn with_symlink(
5374        &self,
5375        target: impl Into<String>,
5376        link_name: impl Into<String>,
5377    ) -> Container {
5378        let mut query = self.selection.select("withSymlink");
5379        query = query.arg("target", target.into());
5380        query = query.arg("linkName", link_name.into());
5381        Container {
5382            proc: self.proc.clone(),
5383            selection: query,
5384            graphql_client: self.graphql_client.clone(),
5385        }
5386    }
5387    /// Return a snapshot with a symlink
5388    ///
5389    /// # Arguments
5390    ///
5391    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5392    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5393    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5394    pub fn with_symlink_opts(
5395        &self,
5396        target: impl Into<String>,
5397        link_name: impl Into<String>,
5398        opts: ContainerWithSymlinkOpts,
5399    ) -> Container {
5400        let mut query = self.selection.select("withSymlink");
5401        query = query.arg("target", target.into());
5402        query = query.arg("linkName", link_name.into());
5403        if let Some(expand) = opts.expand {
5404            query = query.arg("expand", expand);
5405        }
5406        Container {
5407            proc: self.proc.clone(),
5408            selection: query,
5409            graphql_client: self.graphql_client.clone(),
5410        }
5411    }
5412    /// Retrieves this container plus the given OCI annotation.
5413    ///
5414    /// # Arguments
5415    ///
5416    /// * `name` - The name of the annotation.
5417    /// * `value` - The value of the annotation.
5418    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
5419        let mut query = self.selection.select("withAnnotation");
5420        query = query.arg("name", name.into());
5421        query = query.arg("value", value.into());
5422        Container {
5423            proc: self.proc.clone(),
5424            selection: query,
5425            graphql_client: self.graphql_client.clone(),
5426        }
5427    }
5428    /// Retrieves this container minus the given OCI annotation.
5429    ///
5430    /// # Arguments
5431    ///
5432    /// * `name` - The name of the annotation.
5433    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5434        let mut query = self.selection.select("withoutAnnotation");
5435        query = query.arg("name", name.into());
5436        Container {
5437            proc: self.proc.clone(),
5438            selection: query,
5439            graphql_client: self.graphql_client.clone(),
5440        }
5441    }
5442    /// Package the container state as an OCI image, and publish it to a registry
5443    /// Returns the fully qualified address of the published image, with digest
5444    ///
5445    /// # Arguments
5446    ///
5447    /// * `address` - The OCI address to publish to
5448    ///
5449    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
5450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5451    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
5452        let mut query = self.selection.select("publish");
5453        query = query.arg("address", address.into());
5454        query.execute(self.graphql_client.clone()).await
5455    }
5456    /// Package the container state as an OCI image, and publish it to a registry
5457    /// Returns the fully qualified address of the published image, with digest
5458    ///
5459    /// # Arguments
5460    ///
5461    /// * `address` - The OCI address to publish to
5462    ///
5463    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
5464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5465    pub async fn publish_opts(
5466        &self,
5467        address: impl Into<String>,
5468        opts: ContainerPublishOpts,
5469    ) -> Result<String, DaggerError> {
5470        let mut query = self.selection.select("publish");
5471        query = query.arg("address", address.into());
5472        if let Some(platform_variants) = opts.platform_variants {
5473            query = query.arg("platformVariants", platform_variants);
5474        }
5475        if let Some(forced_compression) = opts.forced_compression {
5476            query = query.arg("forcedCompression", forced_compression);
5477        }
5478        if let Some(media_types) = opts.media_types {
5479            query = query.arg("mediaTypes", media_types);
5480        }
5481        if let Some(registry_service) = opts.registry_service {
5482            query = query.arg("registryService", registry_service);
5483        }
5484        if let Some(protocol) = opts.protocol {
5485            query = query.arg("protocol", protocol);
5486        }
5487        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
5488            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
5489        }
5490        query.execute(self.graphql_client.clone()).await
5491    }
5492    /// The platform this container executes and publishes as.
5493    pub async fn platform(&self) -> Result<Platform, DaggerError> {
5494        let query = self.selection.select("platform");
5495        query.execute(self.graphql_client.clone()).await
5496    }
5497    /// Writes the container as an OCI tarball to the destination file path on the host.
5498    /// It can also export platform variants.
5499    ///
5500    /// # Arguments
5501    ///
5502    /// * `path` - Host's destination path (e.g., "./tarball").
5503    ///
5504    /// Path can be relative to the engine's workdir or absolute.
5505    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5506    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5507        let mut query = self.selection.select("export");
5508        query = query.arg("path", path.into());
5509        query.execute(self.graphql_client.clone()).await
5510    }
5511    /// Writes the container as an OCI tarball to the destination file path on the host.
5512    /// It can also export platform variants.
5513    ///
5514    /// # Arguments
5515    ///
5516    /// * `path` - Host's destination path (e.g., "./tarball").
5517    ///
5518    /// Path can be relative to the engine's workdir or absolute.
5519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5520    pub async fn export_opts(
5521        &self,
5522        path: impl Into<String>,
5523        opts: ContainerExportOpts,
5524    ) -> Result<String, DaggerError> {
5525        let mut query = self.selection.select("export");
5526        query = query.arg("path", path.into());
5527        if let Some(platform_variants) = opts.platform_variants {
5528            query = query.arg("platformVariants", platform_variants);
5529        }
5530        if let Some(forced_compression) = opts.forced_compression {
5531            query = query.arg("forcedCompression", forced_compression);
5532        }
5533        if let Some(media_types) = opts.media_types {
5534            query = query.arg("mediaTypes", media_types);
5535        }
5536        if let Some(expand) = opts.expand {
5537            query = query.arg("expand", expand);
5538        }
5539        query.execute(self.graphql_client.clone()).await
5540    }
5541    /// Exports the container as an image to the host's container image store.
5542    ///
5543    /// # Arguments
5544    ///
5545    /// * `name` - Name of image to export to in the host's store
5546    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5547    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
5548        let mut query = self.selection.select("exportImage");
5549        query = query.arg("name", name.into());
5550        query.execute(self.graphql_client.clone()).await
5551    }
5552    /// Exports the container as an image to the host's container image store.
5553    ///
5554    /// # Arguments
5555    ///
5556    /// * `name` - Name of image to export to in the host's store
5557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5558    pub async fn export_image_opts(
5559        &self,
5560        name: impl Into<String>,
5561        opts: ContainerExportImageOpts,
5562    ) -> Result<Void, DaggerError> {
5563        let mut query = self.selection.select("exportImage");
5564        query = query.arg("name", name.into());
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        query.execute(self.graphql_client.clone()).await
5575    }
5576    /// Package the container state as an OCI image, and return it as a tar archive
5577    ///
5578    /// # Arguments
5579    ///
5580    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5581    pub fn as_tarball(&self) -> File {
5582        let query = self.selection.select("asTarball");
5583        File {
5584            proc: self.proc.clone(),
5585            selection: query,
5586            graphql_client: self.graphql_client.clone(),
5587        }
5588    }
5589    /// Package the container state as an OCI image, and return it as a tar archive
5590    ///
5591    /// # Arguments
5592    ///
5593    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5594    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
5595        let mut query = self.selection.select("asTarball");
5596        if let Some(platform_variants) = opts.platform_variants {
5597            query = query.arg("platformVariants", platform_variants);
5598        }
5599        if let Some(forced_compression) = opts.forced_compression {
5600            query = query.arg("forcedCompression", forced_compression);
5601        }
5602        if let Some(media_types) = opts.media_types {
5603            query = query.arg("mediaTypes", media_types);
5604        }
5605        File {
5606            proc: self.proc.clone(),
5607            selection: query,
5608            graphql_client: self.graphql_client.clone(),
5609        }
5610    }
5611    /// Reads the container from an OCI tarball.
5612    ///
5613    /// # Arguments
5614    ///
5615    /// * `source` - File to read the container from.
5616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5617    pub fn import(&self, source: impl IntoID<Id>) -> Container {
5618        let mut query = self.selection.select("import");
5619        query = query.arg_lazy(
5620            "source",
5621            Box::new(move || {
5622                let source = source.clone();
5623                Box::pin(async move { source.into_id().await.unwrap().quote() })
5624            }),
5625        );
5626        Container {
5627            proc: self.proc.clone(),
5628            selection: query,
5629            graphql_client: self.graphql_client.clone(),
5630        }
5631    }
5632    /// Reads the container from an OCI tarball.
5633    ///
5634    /// # Arguments
5635    ///
5636    /// * `source` - File to read the container from.
5637    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5638    pub fn import_opts<'a>(
5639        &self,
5640        source: impl IntoID<Id>,
5641        opts: ContainerImportOpts<'a>,
5642    ) -> Container {
5643        let mut query = self.selection.select("import");
5644        query = query.arg_lazy(
5645            "source",
5646            Box::new(move || {
5647                let source = source.clone();
5648                Box::pin(async move { source.into_id().await.unwrap().quote() })
5649            }),
5650        );
5651        if let Some(tag) = opts.tag {
5652            query = query.arg("tag", tag);
5653        }
5654        Container {
5655            proc: self.proc.clone(),
5656            selection: query,
5657            graphql_client: self.graphql_client.clone(),
5658        }
5659    }
5660    /// Attach credentials for future publishing to a registry. Use in combination with publish
5661    ///
5662    /// # Arguments
5663    ///
5664    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
5665    /// * `username` - The username to authenticate with. Example: "alice"
5666    /// * `secret` - The API key, password or token to authenticate to this registry
5667    pub fn with_registry_auth(
5668        &self,
5669        address: impl Into<String>,
5670        username: impl Into<String>,
5671        secret: impl IntoID<Id>,
5672    ) -> Container {
5673        let mut query = self.selection.select("withRegistryAuth");
5674        query = query.arg("address", address.into());
5675        query = query.arg("username", username.into());
5676        query = query.arg_lazy(
5677            "secret",
5678            Box::new(move || {
5679                let secret = secret.clone();
5680                Box::pin(async move { secret.into_id().await.unwrap().quote() })
5681            }),
5682        );
5683        Container {
5684            proc: self.proc.clone(),
5685            selection: query,
5686            graphql_client: self.graphql_client.clone(),
5687        }
5688    }
5689    /// Retrieves this container without the registry authentication of a given address.
5690    ///
5691    /// # Arguments
5692    ///
5693    /// * `address` - Registry's address to remove the authentication from.
5694    ///
5695    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5696    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5697        let mut query = self.selection.select("withoutRegistryAuth");
5698        query = query.arg("address", address.into());
5699        Container {
5700            proc: self.proc.clone(),
5701            selection: query,
5702            graphql_client: self.graphql_client.clone(),
5703        }
5704    }
5705    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
5706    pub async fn image_ref(&self) -> Result<String, DaggerError> {
5707        let query = self.selection.select("imageRef");
5708        query.execute(self.graphql_client.clone()).await
5709    }
5710    /// Computes and returns the manifest for this container as a File.
5711    ///
5712    /// # Arguments
5713    ///
5714    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5715    pub fn manifest(&self) -> File {
5716        let query = self.selection.select("manifest");
5717        File {
5718            proc: self.proc.clone(),
5719            selection: query,
5720            graphql_client: self.graphql_client.clone(),
5721        }
5722    }
5723    /// Computes and returns the manifest for this container as a File.
5724    ///
5725    /// # Arguments
5726    ///
5727    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5728    pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
5729        let mut query = self.selection.select("manifest");
5730        if let Some(forced_compression) = opts.forced_compression {
5731            query = query.arg("forcedCompression", forced_compression);
5732        }
5733        if let Some(media_types) = opts.media_types {
5734            query = query.arg("mediaTypes", media_types);
5735        }
5736        File {
5737            proc: self.proc.clone(),
5738            selection: query,
5739            graphql_client: self.graphql_client.clone(),
5740        }
5741    }
5742    /// Returns the image layer or configuration blob with the given digest as a File.
5743    ///
5744    /// # Arguments
5745    ///
5746    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
5747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5748    pub fn layer(&self, id: impl Into<String>) -> File {
5749        let mut query = self.selection.select("layer");
5750        query = query.arg("id", id.into());
5751        File {
5752            proc: self.proc.clone(),
5753            selection: query,
5754            graphql_client: self.graphql_client.clone(),
5755        }
5756    }
5757    /// Returns the image layer or configuration blob with the given digest as a File.
5758    ///
5759    /// # Arguments
5760    ///
5761    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
5762    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5763    pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
5764        let mut query = self.selection.select("layer");
5765        query = query.arg("id", id.into());
5766        if let Some(forced_compression) = opts.forced_compression {
5767            query = query.arg("forcedCompression", forced_compression);
5768        }
5769        if let Some(media_types) = opts.media_types {
5770            query = query.arg("mediaTypes", media_types);
5771        }
5772        File {
5773            proc: self.proc.clone(),
5774            selection: query,
5775            graphql_client: self.graphql_client.clone(),
5776        }
5777    }
5778    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
5779    /// Exposed ports serve two purposes:
5780    /// - For health checks and introspection, when running services
5781    /// - For setting the EXPOSE OCI field when publishing the container
5782    ///
5783    /// # Arguments
5784    ///
5785    /// * `port` - Port number to expose. Example: 8080
5786    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5787    pub fn with_exposed_port(&self, port: isize) -> Container {
5788        let mut query = self.selection.select("withExposedPort");
5789        query = query.arg("port", port);
5790        Container {
5791            proc: self.proc.clone(),
5792            selection: query,
5793            graphql_client: self.graphql_client.clone(),
5794        }
5795    }
5796    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
5797    /// Exposed ports serve two purposes:
5798    /// - For health checks and introspection, when running services
5799    /// - For setting the EXPOSE OCI field when publishing the container
5800    ///
5801    /// # Arguments
5802    ///
5803    /// * `port` - Port number to expose. Example: 8080
5804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5805    pub fn with_exposed_port_opts<'a>(
5806        &self,
5807        port: isize,
5808        opts: ContainerWithExposedPortOpts<'a>,
5809    ) -> Container {
5810        let mut query = self.selection.select("withExposedPort");
5811        query = query.arg("port", port);
5812        if let Some(protocol) = opts.protocol {
5813            query = query.arg("protocol", protocol);
5814        }
5815        if let Some(description) = opts.description {
5816            query = query.arg("description", description);
5817        }
5818        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
5819            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
5820        }
5821        Container {
5822            proc: self.proc.clone(),
5823            selection: query,
5824            graphql_client: self.graphql_client.clone(),
5825        }
5826    }
5827    /// Unexpose a previously exposed port.
5828    ///
5829    /// # Arguments
5830    ///
5831    /// * `port` - Port number to unexpose
5832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5833    pub fn without_exposed_port(&self, port: isize) -> Container {
5834        let mut query = self.selection.select("withoutExposedPort");
5835        query = query.arg("port", port);
5836        Container {
5837            proc: self.proc.clone(),
5838            selection: query,
5839            graphql_client: self.graphql_client.clone(),
5840        }
5841    }
5842    /// Unexpose a previously exposed port.
5843    ///
5844    /// # Arguments
5845    ///
5846    /// * `port` - Port number to unexpose
5847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5848    pub fn without_exposed_port_opts(
5849        &self,
5850        port: isize,
5851        opts: ContainerWithoutExposedPortOpts,
5852    ) -> Container {
5853        let mut query = self.selection.select("withoutExposedPort");
5854        query = query.arg("port", port);
5855        if let Some(protocol) = opts.protocol {
5856            query = query.arg("protocol", protocol);
5857        }
5858        Container {
5859            proc: self.proc.clone(),
5860            selection: query,
5861            graphql_client: self.graphql_client.clone(),
5862        }
5863    }
5864    /// Retrieves the list of exposed ports.
5865    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
5866    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
5867        let query = self.selection.select("exposedPorts");
5868        let query = query.select("id");
5869        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5870        Ok(ids
5871            .into_iter()
5872            .map(|id| Port {
5873                proc: self.proc.clone(),
5874                selection: crate::querybuilder::query()
5875                    .select("node")
5876                    .arg("id", &id.0)
5877                    .inline_fragment("Port"),
5878                graphql_client: self.graphql_client.clone(),
5879            })
5880            .collect())
5881    }
5882    /// Establish a runtime dependency from a container to a network service.
5883    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
5884    /// The service will be reachable from the container via the provided hostname alias.
5885    /// The service dependency will also convey to any files or directories produced by the container.
5886    ///
5887    /// # Arguments
5888    ///
5889    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
5890    /// * `service` - The target service
5891    pub fn with_service_binding(
5892        &self,
5893        alias: impl Into<String>,
5894        service: impl IntoID<Id>,
5895    ) -> Container {
5896        let mut query = self.selection.select("withServiceBinding");
5897        query = query.arg("alias", alias.into());
5898        query = query.arg_lazy(
5899            "service",
5900            Box::new(move || {
5901                let service = service.clone();
5902                Box::pin(async move { service.into_id().await.unwrap().quote() })
5903            }),
5904        );
5905        Container {
5906            proc: self.proc.clone(),
5907            selection: query,
5908            graphql_client: self.graphql_client.clone(),
5909        }
5910    }
5911    /// Set the default command to invoke for the container's terminal API.
5912    ///
5913    /// # Arguments
5914    ///
5915    /// * `args` - The args of the command.
5916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5917    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
5918        let mut query = self.selection.select("withDefaultTerminalCmd");
5919        query = query.arg(
5920            "args",
5921            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5922        );
5923        Container {
5924            proc: self.proc.clone(),
5925            selection: query,
5926            graphql_client: self.graphql_client.clone(),
5927        }
5928    }
5929    /// Set the default command to invoke for the container's terminal API.
5930    ///
5931    /// # Arguments
5932    ///
5933    /// * `args` - The args of the command.
5934    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5935    pub fn with_default_terminal_cmd_opts(
5936        &self,
5937        args: Vec<impl Into<String>>,
5938        opts: ContainerWithDefaultTerminalCmdOpts,
5939    ) -> Container {
5940        let mut query = self.selection.select("withDefaultTerminalCmd");
5941        query = query.arg(
5942            "args",
5943            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5944        );
5945        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5946            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5947        }
5948        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5949            query = query.arg(
5950                "experimentalPrivilegedNesting",
5951                experimental_privileged_nesting,
5952            );
5953        }
5954        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5955            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5956        }
5957        Container {
5958            proc: self.proc.clone(),
5959            selection: query,
5960            graphql_client: self.graphql_client.clone(),
5961        }
5962    }
5963    /// Set the shell used by terminal() and withRun().
5964    ///
5965    /// # Arguments
5966    ///
5967    /// * `interactive` - Command arguments for interactive use. Example: ["sh"].
5968    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5969    pub fn with_shell(&self, interactive: Vec<impl Into<String>>) -> Container {
5970        let mut query = self.selection.select("withShell");
5971        query = query.arg(
5972            "interactive",
5973            interactive
5974                .into_iter()
5975                .map(|i| i.into())
5976                .collect::<Vec<String>>(),
5977        );
5978        Container {
5979            proc: self.proc.clone(),
5980            selection: query,
5981            graphql_client: self.graphql_client.clone(),
5982        }
5983    }
5984    /// Set the shell used by terminal() and withRun().
5985    ///
5986    /// # Arguments
5987    ///
5988    /// * `interactive` - Command arguments for interactive use. Example: ["sh"].
5989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5990    pub fn with_shell_opts<'a>(
5991        &self,
5992        interactive: Vec<impl Into<String>>,
5993        opts: ContainerWithShellOpts<'a>,
5994    ) -> Container {
5995        let mut query = self.selection.select("withShell");
5996        query = query.arg(
5997            "interactive",
5998            interactive
5999                .into_iter()
6000                .map(|i| i.into())
6001                .collect::<Vec<String>>(),
6002        );
6003        if let Some(batch) = opts.batch {
6004            query = query.arg("batch", batch);
6005        }
6006        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6007            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6008        }
6009        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6010            query = query.arg(
6011                "experimentalPrivilegedNesting",
6012                experimental_privileged_nesting,
6013            );
6014        }
6015        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6016            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6017        }
6018        Container {
6019            proc: self.proc.clone(),
6020            selection: query,
6021            graphql_client: self.graphql_client.clone(),
6022        }
6023    }
6024    /// Return the configured shell command. Defaults to ["sh"].
6025    ///
6026    /// # Arguments
6027    ///
6028    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6029    pub fn shell(&self) -> Command {
6030        let query = self.selection.select("shell");
6031        Command {
6032            proc: self.proc.clone(),
6033            selection: query,
6034            graphql_client: self.graphql_client.clone(),
6035        }
6036    }
6037    /// Return the configured shell command. Defaults to ["sh"].
6038    ///
6039    /// # Arguments
6040    ///
6041    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6042    pub fn shell_opts(&self, opts: ContainerShellOpts) -> Command {
6043        let mut query = self.selection.select("shell");
6044        if let Some(batch) = opts.batch {
6045            query = query.arg("batch", batch);
6046        }
6047        Command {
6048            proc: self.proc.clone(),
6049            selection: query,
6050            graphql_client: self.graphql_client.clone(),
6051        }
6052    }
6053    /// Execute a script with the configured batch shell and return the modified container.
6054    ///
6055    /// # Arguments
6056    ///
6057    /// * `command` - Script to append to the shell command as one argument.
6058    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6059    pub fn with_run(&self, command: impl Into<String>) -> Container {
6060        let mut query = self.selection.select("withRun");
6061        query = query.arg("command", command.into());
6062        Container {
6063            proc: self.proc.clone(),
6064            selection: query,
6065            graphql_client: self.graphql_client.clone(),
6066        }
6067    }
6068    /// Execute a script with the configured batch shell and return the modified container.
6069    ///
6070    /// # Arguments
6071    ///
6072    /// * `command` - Script to append to the shell command as one argument.
6073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6074    pub fn with_run_opts<'a>(
6075        &self,
6076        command: impl Into<String>,
6077        opts: ContainerWithRunOpts<'a>,
6078    ) -> Container {
6079        let mut query = self.selection.select("withRun");
6080        query = query.arg("command", command.into());
6081        if let Some(shell) = opts.shell {
6082            query = query.arg("shell", shell);
6083        }
6084        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6085            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6086        }
6087        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6088            query = query.arg(
6089                "experimentalPrivilegedNesting",
6090                experimental_privileged_nesting,
6091            );
6092        }
6093        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6094            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6095        }
6096        Container {
6097            proc: self.proc.clone(),
6098            selection: query,
6099            graphql_client: self.graphql_client.clone(),
6100        }
6101    }
6102    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
6103    ///
6104    /// # Arguments
6105    ///
6106    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6107    pub fn terminal(&self) -> Container {
6108        let query = self.selection.select("terminal");
6109        Container {
6110            proc: self.proc.clone(),
6111            selection: query,
6112            graphql_client: self.graphql_client.clone(),
6113        }
6114    }
6115    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
6116    ///
6117    /// # Arguments
6118    ///
6119    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6120    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
6121        let mut query = self.selection.select("terminal");
6122        if let Some(cmd) = opts.cmd {
6123            query = query.arg("cmd", cmd);
6124        }
6125        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6126            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6127        }
6128        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6129            query = query.arg(
6130                "experimentalPrivilegedNesting",
6131                experimental_privileged_nesting,
6132            );
6133        }
6134        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6135            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6136        }
6137        Container {
6138            proc: self.proc.clone(),
6139            selection: query,
6140            graphql_client: self.graphql_client.clone(),
6141        }
6142    }
6143    /// Configures all GPUs available on the host to be accessible to this container.
6144    /// This currently works with NVIDIA devices only, and requires the engine to run with GPU support enabled.
6145    pub fn with_gpu(&self) -> Container {
6146        let query = self.selection.select("withGPU");
6147        Container {
6148            proc: self.proc.clone(),
6149            selection: query,
6150            graphql_client: self.graphql_client.clone(),
6151        }
6152    }
6153    /// Configures the provided list of devices to be accessible to this container.
6154    /// This currently works for Nvidia devices only.
6155    ///
6156    /// # Arguments
6157    ///
6158    /// * `devices` - List of devices to be accessible to this container.
6159    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
6160        let mut query = self.selection.select("experimentalWithGPU");
6161        query = query.arg(
6162            "devices",
6163            devices
6164                .into_iter()
6165                .map(|i| i.into())
6166                .collect::<Vec<String>>(),
6167        );
6168        Container {
6169            proc: self.proc.clone(),
6170            selection: query,
6171            graphql_client: self.graphql_client.clone(),
6172        }
6173    }
6174    /// Configures all available GPUs on the host to be accessible to this container.
6175    /// This currently works for Nvidia devices only.
6176    pub fn experimental_with_all_gp_us(&self) -> Container {
6177        let query = self.selection.select("experimentalWithAllGPUs");
6178        Container {
6179            proc: self.proc.clone(),
6180            selection: query,
6181            graphql_client: self.graphql_client.clone(),
6182        }
6183    }
6184    /// Turn the container into a Service.
6185    /// Be sure to set any exposed ports before this conversion.
6186    ///
6187    /// # Arguments
6188    ///
6189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6190    pub fn as_service(&self) -> Service {
6191        let query = self.selection.select("asService");
6192        Service {
6193            proc: self.proc.clone(),
6194            selection: query,
6195            graphql_client: self.graphql_client.clone(),
6196        }
6197    }
6198    /// Turn the container into a Service.
6199    /// Be sure to set any exposed ports before this conversion.
6200    ///
6201    /// # Arguments
6202    ///
6203    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6204    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
6205        let mut query = self.selection.select("asService");
6206        if let Some(args) = opts.args {
6207            query = query.arg("args", args);
6208        }
6209        if let Some(use_entrypoint) = opts.use_entrypoint {
6210            query = query.arg("useEntrypoint", use_entrypoint);
6211        }
6212        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6213            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6214        }
6215        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6216            query = query.arg(
6217                "experimentalPrivilegedNesting",
6218                experimental_privileged_nesting,
6219            );
6220        }
6221        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6222            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6223        }
6224        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6225            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6226        }
6227        if let Some(expand) = opts.expand {
6228            query = query.arg("expand", expand);
6229        }
6230        if let Some(no_init) = opts.no_init {
6231            query = query.arg("noInit", no_init);
6232        }
6233        Service {
6234            proc: self.proc.clone(),
6235            selection: query,
6236            graphql_client: self.graphql_client.clone(),
6237        }
6238    }
6239    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
6240    /// Be sure to set any exposed ports before calling this api.
6241    ///
6242    /// # Arguments
6243    ///
6244    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6245    pub async fn up(&self) -> Result<Void, DaggerError> {
6246        let query = self.selection.select("up");
6247        query.execute(self.graphql_client.clone()).await
6248    }
6249    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
6250    /// Be sure to set any exposed ports before calling this api.
6251    ///
6252    /// # Arguments
6253    ///
6254    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6255    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
6256        let mut query = self.selection.select("up");
6257        if let Some(random) = opts.random {
6258            query = query.arg("random", random);
6259        }
6260        if let Some(ports) = opts.ports {
6261            query = query.arg("ports", ports);
6262        }
6263        if let Some(args) = opts.args {
6264            query = query.arg("args", args);
6265        }
6266        if let Some(use_entrypoint) = opts.use_entrypoint {
6267            query = query.arg("useEntrypoint", use_entrypoint);
6268        }
6269        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6270            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6271        }
6272        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6273            query = query.arg(
6274                "experimentalPrivilegedNesting",
6275                experimental_privileged_nesting,
6276            );
6277        }
6278        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6279            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6280        }
6281        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6282            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6283        }
6284        if let Some(expand) = opts.expand {
6285            query = query.arg("expand", expand);
6286        }
6287        if let Some(no_init) = opts.no_init {
6288            query = query.arg("noInit", no_init);
6289        }
6290        query.execute(self.graphql_client.clone()).await
6291    }
6292}
6293impl Exportable for Container {
6294    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6295        let query = self.selection.select("id");
6296        let graphql_client = self.graphql_client.clone();
6297        async move { query.execute(graphql_client).await }
6298    }
6299    fn export(
6300        &self,
6301        path: impl Into<String>,
6302    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
6303        let mut query = self.selection.select("export");
6304        query = query.arg("path", path.into());
6305        let graphql_client = self.graphql_client.clone();
6306        async move { query.execute(graphql_client).await }
6307    }
6308}
6309impl Node for Container {
6310    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6311        let query = self.selection.select("id");
6312        let graphql_client = self.graphql_client.clone();
6313        async move { query.execute(graphql_client).await }
6314    }
6315}
6316impl Syncer for Container {
6317    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6318        let query = self.selection.select("id");
6319        let graphql_client = self.graphql_client.clone();
6320        async move { query.execute(graphql_client).await }
6321    }
6322    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
6323        let query = self.selection.select("sync");
6324        let proc = self.proc.clone();
6325        let graphql_client = self.graphql_client.clone();
6326        async move {
6327            let id: Id = query.execute(graphql_client.clone()).await?;
6328            Ok(Self {
6329                proc,
6330                selection: query
6331                    .root()
6332                    .select("node")
6333                    .arg("id", &id.0)
6334                    .inline_fragment("Container"),
6335                graphql_client,
6336            })
6337        }
6338    }
6339}
6340#[derive(Clone)]
6341pub struct CurrentModule {
6342    pub proc: Option<Arc<DaggerSessionProc>>,
6343    pub selection: Selection,
6344    pub graphql_client: DynGraphQLClient,
6345}
6346#[derive(Builder, Debug, PartialEq)]
6347pub struct CurrentModuleWorkdirOpts<'a> {
6348    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6349    #[builder(setter(into, strip_option), default)]
6350    pub exclude: Option<Vec<&'a str>>,
6351    /// Apply .gitignore filter rules inside the directory
6352    #[builder(setter(into, strip_option), default)]
6353    pub gitignore: Option<bool>,
6354    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6355    #[builder(setter(into, strip_option), default)]
6356    pub include: Option<Vec<&'a str>>,
6357}
6358impl IntoID<Id> for CurrentModule {
6359    fn into_id(
6360        self,
6361    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6362        Box::pin(async move { self.id().await })
6363    }
6364}
6365impl Loadable for CurrentModule {
6366    fn graphql_type() -> &'static str {
6367        "CurrentModule"
6368    }
6369    fn from_query(
6370        proc: Option<Arc<DaggerSessionProc>>,
6371        selection: Selection,
6372        graphql_client: DynGraphQLClient,
6373    ) -> Self {
6374        Self {
6375            proc,
6376            selection,
6377            graphql_client,
6378        }
6379    }
6380}
6381impl CurrentModule {
6382    /// A unique identifier for this CurrentModule.
6383    pub async fn id(&self) -> Result<Id, DaggerError> {
6384        let query = self.selection.select("id");
6385        query.execute(self.graphql_client.clone()).await
6386    }
6387    /// The module's context directory loaded into the engine (plus any generated code that may have been created).
6388    /// 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.
6389    pub fn context_directory(&self) -> Directory {
6390        let query = self.selection.select("contextDirectory");
6391        Directory {
6392            proc: self.proc.clone(),
6393            selection: query,
6394            graphql_client: self.graphql_client.clone(),
6395        }
6396    }
6397    /// The dependencies of the module.
6398    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
6399        let query = self.selection.select("dependencies");
6400        let query = query.select("id");
6401        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6402        Ok(ids
6403            .into_iter()
6404            .map(|id| Module {
6405                proc: self.proc.clone(),
6406                selection: crate::querybuilder::query()
6407                    .select("node")
6408                    .arg("id", &id.0)
6409                    .inline_fragment("Module"),
6410                graphql_client: self.graphql_client.clone(),
6411            })
6412            .collect())
6413    }
6414    /// The generated files and directories made on top of the module source's context directory.
6415    pub fn generated_context_directory(&self) -> Directory {
6416        let query = self.selection.select("generatedContextDirectory");
6417        Directory {
6418            proc: self.proc.clone(),
6419            selection: query,
6420            graphql_client: self.graphql_client.clone(),
6421        }
6422    }
6423    /// The name of the module being executed in
6424    pub async fn name(&self) -> Result<String, DaggerError> {
6425        let query = self.selection.select("name");
6426        query.execute(self.graphql_client.clone()).await
6427    }
6428    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
6429    pub fn source(&self) -> Directory {
6430        let query = self.selection.select("source");
6431        Directory {
6432            proc: self.proc.clone(),
6433            selection: query,
6434            graphql_client: self.graphql_client.clone(),
6435        }
6436    }
6437    /// The path to the directory containing the module's source code, relative to the context directory.
6438    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6439        let query = self.selection.select("sourceSubpath");
6440        query.execute(self.graphql_client.clone()).await
6441    }
6442    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
6443    ///
6444    /// # Arguments
6445    ///
6446    /// * `path` - Location of the directory to access (e.g., ".").
6447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6448    pub fn workdir(&self, path: impl Into<String>) -> Directory {
6449        let mut query = self.selection.select("workdir");
6450        query = query.arg("path", path.into());
6451        Directory {
6452            proc: self.proc.clone(),
6453            selection: query,
6454            graphql_client: self.graphql_client.clone(),
6455        }
6456    }
6457    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
6458    ///
6459    /// # Arguments
6460    ///
6461    /// * `path` - Location of the directory to access (e.g., ".").
6462    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6463    pub fn workdir_opts<'a>(
6464        &self,
6465        path: impl Into<String>,
6466        opts: CurrentModuleWorkdirOpts<'a>,
6467    ) -> Directory {
6468        let mut query = self.selection.select("workdir");
6469        query = query.arg("path", path.into());
6470        if let Some(exclude) = opts.exclude {
6471            query = query.arg("exclude", exclude);
6472        }
6473        if let Some(include) = opts.include {
6474            query = query.arg("include", include);
6475        }
6476        if let Some(gitignore) = opts.gitignore {
6477            query = query.arg("gitignore", gitignore);
6478        }
6479        Directory {
6480            proc: self.proc.clone(),
6481            selection: query,
6482            graphql_client: self.graphql_client.clone(),
6483        }
6484    }
6485    /// 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.
6486    ///
6487    /// # Arguments
6488    ///
6489    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6490    pub fn workdir_file(&self, path: impl Into<String>) -> File {
6491        let mut query = self.selection.select("workdirFile");
6492        query = query.arg("path", path.into());
6493        File {
6494            proc: self.proc.clone(),
6495            selection: query,
6496            graphql_client: self.graphql_client.clone(),
6497        }
6498    }
6499}
6500impl Node for CurrentModule {
6501    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6502        let query = self.selection.select("id");
6503        let graphql_client = self.graphql_client.clone();
6504        async move { query.execute(graphql_client).await }
6505    }
6506}
6507#[derive(Clone)]
6508pub struct DiffStat {
6509    pub proc: Option<Arc<DaggerSessionProc>>,
6510    pub selection: Selection,
6511    pub graphql_client: DynGraphQLClient,
6512}
6513impl IntoID<Id> for DiffStat {
6514    fn into_id(
6515        self,
6516    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6517        Box::pin(async move { self.id().await })
6518    }
6519}
6520impl Loadable for DiffStat {
6521    fn graphql_type() -> &'static str {
6522        "DiffStat"
6523    }
6524    fn from_query(
6525        proc: Option<Arc<DaggerSessionProc>>,
6526        selection: Selection,
6527        graphql_client: DynGraphQLClient,
6528    ) -> Self {
6529        Self {
6530            proc,
6531            selection,
6532            graphql_client,
6533        }
6534    }
6535}
6536impl DiffStat {
6537    /// A unique identifier for this DiffStat.
6538    pub async fn id(&self) -> Result<Id, DaggerError> {
6539        let query = self.selection.select("id");
6540        query.execute(self.graphql_client.clone()).await
6541    }
6542    /// Path of the changed file or directory.
6543    pub async fn path(&self) -> Result<String, DaggerError> {
6544        let query = self.selection.select("path");
6545        query.execute(self.graphql_client.clone()).await
6546    }
6547    /// Previous path of the file, set only for renames.
6548    pub async fn old_path(&self) -> Result<String, DaggerError> {
6549        let query = self.selection.select("oldPath");
6550        query.execute(self.graphql_client.clone()).await
6551    }
6552    /// Type of change.
6553    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6554        let query = self.selection.select("kind");
6555        query.execute(self.graphql_client.clone()).await
6556    }
6557    /// Number of added lines for this path.
6558    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6559        let query = self.selection.select("addedLines");
6560        query.execute(self.graphql_client.clone()).await
6561    }
6562    /// Number of removed lines for this path.
6563    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6564        let query = self.selection.select("removedLines");
6565        query.execute(self.graphql_client.clone()).await
6566    }
6567}
6568impl Node for DiffStat {
6569    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6570        let query = self.selection.select("id");
6571        let graphql_client = self.graphql_client.clone();
6572        async move { query.execute(graphql_client).await }
6573    }
6574}
6575#[derive(Clone)]
6576pub struct Directory {
6577    pub proc: Option<Arc<DaggerSessionProc>>,
6578    pub selection: Selection,
6579    pub graphql_client: DynGraphQLClient,
6580}
6581#[derive(Builder, Debug, PartialEq)]
6582pub struct DirectoryEntriesOpts<'a> {
6583    /// Location of the directory to look at (e.g., "/src").
6584    #[builder(setter(into, strip_option), default)]
6585    pub path: Option<&'a str>,
6586}
6587#[derive(Builder, Debug, PartialEq)]
6588pub struct DirectorySearchOpts<'a> {
6589    /// Allow the . pattern to match newlines in multiline mode.
6590    #[builder(setter(into, strip_option), default)]
6591    pub dotall: Option<bool>,
6592    /// Only return matching files, not lines and content
6593    #[builder(setter(into, strip_option), default)]
6594    pub files_only: Option<bool>,
6595    /// Glob patterns to match (e.g., "*.md")
6596    #[builder(setter(into, strip_option), default)]
6597    pub globs: Option<Vec<&'a str>>,
6598    /// Enable case-insensitive matching.
6599    #[builder(setter(into, strip_option), default)]
6600    pub insensitive: Option<bool>,
6601    /// Limit the number of results to return
6602    #[builder(setter(into, strip_option), default)]
6603    pub limit: Option<isize>,
6604    /// Interpret the pattern as a literal string instead of a regular expression.
6605    #[builder(setter(into, strip_option), default)]
6606    pub literal: Option<bool>,
6607    /// Enable searching across multiple lines.
6608    #[builder(setter(into, strip_option), default)]
6609    pub multiline: Option<bool>,
6610    /// Directory or file paths to search
6611    #[builder(setter(into, strip_option), default)]
6612    pub paths: Option<Vec<&'a str>>,
6613    /// Skip hidden files (files starting with .).
6614    #[builder(setter(into, strip_option), default)]
6615    pub skip_hidden: Option<bool>,
6616    /// Honor .gitignore, .ignore, and .rgignore files.
6617    #[builder(setter(into, strip_option), default)]
6618    pub skip_ignored: Option<bool>,
6619}
6620#[derive(Builder, Debug, PartialEq)]
6621pub struct DirectoryWithFileOpts<'a> {
6622    /// A user:group to set for the copied directory and its contents.
6623    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6624    /// If the group is omitted, it defaults to the same as the user.
6625    #[builder(setter(into, strip_option), default)]
6626    pub owner: Option<&'a str>,
6627    /// Permission given to the copied file (e.g., 0600).
6628    #[builder(setter(into, strip_option), default)]
6629    pub permissions: Option<isize>,
6630}
6631#[derive(Builder, Debug, PartialEq)]
6632pub struct DirectoryWithFilesOpts {
6633    /// Permission given to the copied files (e.g., 0600).
6634    #[builder(setter(into, strip_option), default)]
6635    pub permissions: Option<isize>,
6636}
6637#[derive(Builder, Debug, PartialEq)]
6638pub struct DirectoryWithNewFileOpts {
6639    /// Permissions of the new file. Example: 0600
6640    #[builder(setter(into, strip_option), default)]
6641    pub permissions: Option<isize>,
6642}
6643#[derive(Builder, Debug, PartialEq)]
6644pub struct DirectoryExistsOpts {
6645    /// If specified, do not follow symlinks.
6646    #[builder(setter(into, strip_option), default)]
6647    pub do_not_follow_symlinks: Option<bool>,
6648    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
6649    #[builder(setter(into, strip_option), default)]
6650    pub expected_type: Option<ExistsType>,
6651}
6652#[derive(Builder, Debug, PartialEq)]
6653pub struct DirectoryStatOpts {
6654    /// If specified, do not follow symlinks.
6655    #[builder(setter(into, strip_option), default)]
6656    pub do_not_follow_symlinks: Option<bool>,
6657}
6658#[derive(Builder, Debug, PartialEq)]
6659pub struct DirectoryWithDirectoryOpts<'a> {
6660    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6661    #[builder(setter(into, strip_option), default)]
6662    pub exclude: Option<Vec<&'a str>>,
6663    /// Apply .gitignore filter rules inside the directory
6664    #[builder(setter(into, strip_option), default)]
6665    pub gitignore: Option<bool>,
6666    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6667    #[builder(setter(into, strip_option), default)]
6668    pub include: Option<Vec<&'a str>>,
6669    /// A user:group to set for the copied directory and its contents.
6670    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6671    /// If the group is omitted, it defaults to the same as the user.
6672    #[builder(setter(into, strip_option), default)]
6673    pub owner: Option<&'a str>,
6674    /// Permission given to the copied directory and contents (e.g., 0755).
6675    #[builder(setter(into, strip_option), default)]
6676    pub permissions: Option<isize>,
6677}
6678#[derive(Builder, Debug, PartialEq)]
6679pub struct DirectoryFilterOpts<'a> {
6680    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
6681    #[builder(setter(into, strip_option), default)]
6682    pub exclude: Option<Vec<&'a str>>,
6683    /// If set, apply .gitignore rules when filtering the directory.
6684    #[builder(setter(into, strip_option), default)]
6685    pub gitignore: Option<bool>,
6686    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
6687    #[builder(setter(into, strip_option), default)]
6688    pub include: Option<Vec<&'a str>>,
6689}
6690#[derive(Builder, Debug, PartialEq)]
6691pub struct DirectoryWithNewDirectoryOpts {
6692    /// Permission granted to the created directory (e.g., 0777).
6693    #[builder(setter(into, strip_option), default)]
6694    pub permissions: Option<isize>,
6695}
6696#[derive(Builder, Debug, PartialEq)]
6697pub struct DirectoryExportOpts {
6698    /// 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.
6699    #[builder(setter(into, strip_option), default)]
6700    pub wipe: Option<bool>,
6701}
6702#[derive(Builder, Debug, PartialEq)]
6703pub struct DirectoryDockerBuildOpts<'a> {
6704    /// Build arguments to use in the build.
6705    #[builder(setter(into, strip_option), default)]
6706    pub build_args: Option<Vec<BuildArg>>,
6707    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
6708    #[builder(setter(into, strip_option), default)]
6709    pub dockerfile: Option<&'a str>,
6710    /// If set, skip the automatic init process injected into containers created by RUN statements.
6711    /// 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.
6712    #[builder(setter(into, strip_option), default)]
6713    pub no_init: Option<bool>,
6714    /// The platform to build.
6715    #[builder(setter(into, strip_option), default)]
6716    pub platform: Option<Platform>,
6717    /// Secrets to pass to the build.
6718    /// They will be mounted at /run/secrets/[secret-name].
6719    #[builder(setter(into, strip_option), default)]
6720    pub secrets: Option<Vec<Id>>,
6721    /// A socket to use for SSH authentication during the build
6722    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
6723    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
6724    #[builder(setter(into, strip_option), default)]
6725    pub ssh: Option<Id>,
6726    /// Target build stage to build.
6727    #[builder(setter(into, strip_option), default)]
6728    pub target: Option<&'a str>,
6729}
6730#[derive(Builder, Debug, PartialEq)]
6731pub struct DirectoryWithPatchOpts {
6732    /// 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.
6733    #[builder(setter(into, strip_option), default)]
6734    pub on_conflict: Option<PatchConflict>,
6735}
6736#[derive(Builder, Debug, PartialEq)]
6737pub struct DirectoryWithPatchFileOpts {
6738    /// 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.
6739    #[builder(setter(into, strip_option), default)]
6740    pub on_conflict: Option<PatchConflict>,
6741}
6742#[derive(Builder, Debug, PartialEq)]
6743pub struct DirectoryAsWorkspaceOpts<'a> {
6744    /// Current working directory inside the workspace root. Defaults to the workspace root.
6745    #[builder(setter(into, strip_option), default)]
6746    pub cwd: Option<&'a str>,
6747}
6748#[derive(Builder, Debug, PartialEq)]
6749pub struct DirectoryTerminalOpts<'a> {
6750    /// If set, override the container's default terminal command and invoke these command arguments instead.
6751    #[builder(setter(into, strip_option), default)]
6752    pub cmd: Option<Vec<&'a str>>,
6753    /// If set, override the default container used for the terminal.
6754    #[builder(setter(into, strip_option), default)]
6755    pub container: Option<Id>,
6756    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
6757    #[builder(setter(into, strip_option), default)]
6758    pub disable_dagger_in_dagger: Option<bool>,
6759    #[builder(setter(into, strip_option), default)]
6760    pub experimental_privileged_nesting: Option<bool>,
6761    /// 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.
6762    #[builder(setter(into, strip_option), default)]
6763    pub insecure_root_capabilities: Option<bool>,
6764}
6765#[derive(Builder, Debug, PartialEq)]
6766pub struct DirectoryAsModuleOpts<'a> {
6767    /// An optional subpath of the directory which contains the module's configuration file.
6768    /// If not set, the module source code is loaded from the root of the directory.
6769    #[builder(setter(into, strip_option), default)]
6770    pub source_root_path: Option<&'a str>,
6771}
6772#[derive(Builder, Debug, PartialEq)]
6773pub struct DirectoryAsModuleSourceOpts<'a> {
6774    /// An optional subpath of the directory which contains the module's configuration file.
6775    /// If not set, the module source code is loaded from the root of the directory.
6776    #[builder(setter(into, strip_option), default)]
6777    pub source_root_path: Option<&'a str>,
6778}
6779impl IntoID<Id> for Directory {
6780    fn into_id(
6781        self,
6782    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6783        Box::pin(async move { self.id().await })
6784    }
6785}
6786impl Loadable for Directory {
6787    fn graphql_type() -> &'static str {
6788        "Directory"
6789    }
6790    fn from_query(
6791        proc: Option<Arc<DaggerSessionProc>>,
6792        selection: Selection,
6793        graphql_client: DynGraphQLClient,
6794    ) -> Self {
6795        Self {
6796            proc,
6797            selection,
6798            graphql_client,
6799        }
6800    }
6801}
6802impl Directory {
6803    /// A unique identifier for this Directory.
6804    pub async fn id(&self) -> Result<Id, DaggerError> {
6805        let query = self.selection.select("id");
6806        query.execute(self.graphql_client.clone()).await
6807    }
6808    /// Force evaluation in the engine.
6809    pub async fn sync(&self) -> Result<Directory, DaggerError> {
6810        let query = self.selection.select("sync");
6811        let id: Id = query.execute(self.graphql_client.clone()).await?;
6812        Ok(Directory {
6813            proc: self.proc.clone(),
6814            selection: query
6815                .root()
6816                .select("node")
6817                .arg("id", &id.0)
6818                .inline_fragment("Directory"),
6819            graphql_client: self.graphql_client.clone(),
6820        })
6821    }
6822    /// Returns the name of the directory.
6823    pub async fn name(&self) -> Result<String, DaggerError> {
6824        let query = self.selection.select("name");
6825        query.execute(self.graphql_client.clone()).await
6826    }
6827    /// Returns a list of files and directories at the given path.
6828    ///
6829    /// # Arguments
6830    ///
6831    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6832    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6833        let query = self.selection.select("entries");
6834        query.execute(self.graphql_client.clone()).await
6835    }
6836    /// Returns a list of files and directories at the given path.
6837    ///
6838    /// # Arguments
6839    ///
6840    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6841    pub async fn entries_opts<'a>(
6842        &self,
6843        opts: DirectoryEntriesOpts<'a>,
6844    ) -> Result<Vec<String>, DaggerError> {
6845        let mut query = self.selection.select("entries");
6846        if let Some(path) = opts.path {
6847            query = query.arg("path", path);
6848        }
6849        query.execute(self.graphql_client.clone()).await
6850    }
6851    /// Returns a list of files and directories that matche the given pattern.
6852    ///
6853    /// # Arguments
6854    ///
6855    /// * `pattern` - Pattern to match (e.g., "*.md").
6856    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6857        let mut query = self.selection.select("glob");
6858        query = query.arg("pattern", pattern.into());
6859        query.execute(self.graphql_client.clone()).await
6860    }
6861    /// Searches for content matching the given regular expression or literal string.
6862    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6863    ///
6864    /// # Arguments
6865    ///
6866    /// * `pattern` - The text to match.
6867    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6868    pub async fn search(
6869        &self,
6870        pattern: impl Into<String>,
6871    ) -> Result<Vec<SearchResult>, DaggerError> {
6872        let mut query = self.selection.select("search");
6873        query = query.arg("pattern", pattern.into());
6874        let query = query.select("id");
6875        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6876        Ok(ids
6877            .into_iter()
6878            .map(|id| SearchResult {
6879                proc: self.proc.clone(),
6880                selection: crate::querybuilder::query()
6881                    .select("node")
6882                    .arg("id", &id.0)
6883                    .inline_fragment("SearchResult"),
6884                graphql_client: self.graphql_client.clone(),
6885            })
6886            .collect())
6887    }
6888    /// Searches for content matching the given regular expression or literal string.
6889    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6890    ///
6891    /// # Arguments
6892    ///
6893    /// * `pattern` - The text to match.
6894    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6895    pub async fn search_opts<'a>(
6896        &self,
6897        pattern: impl Into<String>,
6898        opts: DirectorySearchOpts<'a>,
6899    ) -> Result<Vec<SearchResult>, DaggerError> {
6900        let mut query = self.selection.select("search");
6901        query = query.arg("pattern", pattern.into());
6902        if let Some(paths) = opts.paths {
6903            query = query.arg("paths", paths);
6904        }
6905        if let Some(globs) = opts.globs {
6906            query = query.arg("globs", globs);
6907        }
6908        if let Some(literal) = opts.literal {
6909            query = query.arg("literal", literal);
6910        }
6911        if let Some(multiline) = opts.multiline {
6912            query = query.arg("multiline", multiline);
6913        }
6914        if let Some(dotall) = opts.dotall {
6915            query = query.arg("dotall", dotall);
6916        }
6917        if let Some(insensitive) = opts.insensitive {
6918            query = query.arg("insensitive", insensitive);
6919        }
6920        if let Some(skip_ignored) = opts.skip_ignored {
6921            query = query.arg("skipIgnored", skip_ignored);
6922        }
6923        if let Some(skip_hidden) = opts.skip_hidden {
6924            query = query.arg("skipHidden", skip_hidden);
6925        }
6926        if let Some(files_only) = opts.files_only {
6927            query = query.arg("filesOnly", files_only);
6928        }
6929        if let Some(limit) = opts.limit {
6930            query = query.arg("limit", limit);
6931        }
6932        let query = query.select("id");
6933        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6934        Ok(ids
6935            .into_iter()
6936            .map(|id| SearchResult {
6937                proc: self.proc.clone(),
6938                selection: crate::querybuilder::query()
6939                    .select("node")
6940                    .arg("id", &id.0)
6941                    .inline_fragment("SearchResult"),
6942                graphql_client: self.graphql_client.clone(),
6943            })
6944            .collect())
6945    }
6946    /// 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.
6947    pub async fn digest(&self) -> Result<String, DaggerError> {
6948        let query = self.selection.select("digest");
6949        query.execute(self.graphql_client.clone()).await
6950    }
6951    /// Retrieve a file at the given path.
6952    ///
6953    /// # Arguments
6954    ///
6955    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6956    pub fn file(&self, path: impl Into<String>) -> File {
6957        let mut query = self.selection.select("file");
6958        query = query.arg("path", path.into());
6959        File {
6960            proc: self.proc.clone(),
6961            selection: query,
6962            graphql_client: self.graphql_client.clone(),
6963        }
6964    }
6965    /// Retrieves this directory plus the contents of the given file copied to the given path.
6966    ///
6967    /// # Arguments
6968    ///
6969    /// * `path` - Location of the copied file (e.g., "/file.txt").
6970    /// * `source` - Identifier of the file to copy.
6971    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6972    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6973        let mut query = self.selection.select("withFile");
6974        query = query.arg("path", path.into());
6975        query = query.arg_lazy(
6976            "source",
6977            Box::new(move || {
6978                let source = source.clone();
6979                Box::pin(async move { source.into_id().await.unwrap().quote() })
6980            }),
6981        );
6982        Directory {
6983            proc: self.proc.clone(),
6984            selection: query,
6985            graphql_client: self.graphql_client.clone(),
6986        }
6987    }
6988    /// Retrieves this directory plus the contents of the given file copied to the given path.
6989    ///
6990    /// # Arguments
6991    ///
6992    /// * `path` - Location of the copied file (e.g., "/file.txt").
6993    /// * `source` - Identifier of the file to copy.
6994    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6995    pub fn with_file_opts<'a>(
6996        &self,
6997        path: impl Into<String>,
6998        source: impl IntoID<Id>,
6999        opts: DirectoryWithFileOpts<'a>,
7000    ) -> Directory {
7001        let mut query = self.selection.select("withFile");
7002        query = query.arg("path", path.into());
7003        query = query.arg_lazy(
7004            "source",
7005            Box::new(move || {
7006                let source = source.clone();
7007                Box::pin(async move { source.into_id().await.unwrap().quote() })
7008            }),
7009        );
7010        if let Some(permissions) = opts.permissions {
7011            query = query.arg("permissions", permissions);
7012        }
7013        if let Some(owner) = opts.owner {
7014            query = query.arg("owner", owner);
7015        }
7016        Directory {
7017            proc: self.proc.clone(),
7018            selection: query,
7019            graphql_client: self.graphql_client.clone(),
7020        }
7021    }
7022    /// Retrieves this directory plus the contents of the given files copied to the given path.
7023    ///
7024    /// # Arguments
7025    ///
7026    /// * `path` - Location where copied files should be placed (e.g., "/src").
7027    /// * `sources` - Identifiers of the files to copy.
7028    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7029    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
7030        let mut query = self.selection.select("withFiles");
7031        query = query.arg("path", path.into());
7032        query = query.arg("sources", sources);
7033        Directory {
7034            proc: self.proc.clone(),
7035            selection: query,
7036            graphql_client: self.graphql_client.clone(),
7037        }
7038    }
7039    /// Retrieves this directory plus the contents of the given files copied to the given path.
7040    ///
7041    /// # Arguments
7042    ///
7043    /// * `path` - Location where copied files should be placed (e.g., "/src").
7044    /// * `sources` - Identifiers of the files to copy.
7045    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7046    pub fn with_files_opts(
7047        &self,
7048        path: impl Into<String>,
7049        sources: Vec<Id>,
7050        opts: DirectoryWithFilesOpts,
7051    ) -> Directory {
7052        let mut query = self.selection.select("withFiles");
7053        query = query.arg("path", path.into());
7054        query = query.arg("sources", sources);
7055        if let Some(permissions) = opts.permissions {
7056            query = query.arg("permissions", permissions);
7057        }
7058        Directory {
7059            proc: self.proc.clone(),
7060            selection: query,
7061            graphql_client: self.graphql_client.clone(),
7062        }
7063    }
7064    /// Return a snapshot with a new file added
7065    ///
7066    /// # Arguments
7067    ///
7068    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7069    /// * `contents` - Contents of the new file. Example: "Hello world!"
7070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7071    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7072        let mut query = self.selection.select("withNewFile");
7073        query = query.arg("path", path.into());
7074        query = query.arg("contents", contents.into());
7075        Directory {
7076            proc: self.proc.clone(),
7077            selection: query,
7078            graphql_client: self.graphql_client.clone(),
7079        }
7080    }
7081    /// Return a snapshot with a new file added
7082    ///
7083    /// # Arguments
7084    ///
7085    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7086    /// * `contents` - Contents of the new file. Example: "Hello world!"
7087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7088    pub fn with_new_file_opts(
7089        &self,
7090        path: impl Into<String>,
7091        contents: impl Into<String>,
7092        opts: DirectoryWithNewFileOpts,
7093    ) -> Directory {
7094        let mut query = self.selection.select("withNewFile");
7095        query = query.arg("path", path.into());
7096        query = query.arg("contents", contents.into());
7097        if let Some(permissions) = opts.permissions {
7098            query = query.arg("permissions", permissions);
7099        }
7100        Directory {
7101            proc: self.proc.clone(),
7102            selection: query,
7103            graphql_client: self.graphql_client.clone(),
7104        }
7105    }
7106    /// Return a snapshot with a file removed
7107    ///
7108    /// # Arguments
7109    ///
7110    /// * `path` - Path of the file to remove (e.g., "/file.txt").
7111    pub fn without_file(&self, path: impl Into<String>) -> Directory {
7112        let mut query = self.selection.select("withoutFile");
7113        query = query.arg("path", path.into());
7114        Directory {
7115            proc: self.proc.clone(),
7116            selection: query,
7117            graphql_client: self.graphql_client.clone(),
7118        }
7119    }
7120    /// Return a snapshot with files removed
7121    ///
7122    /// # Arguments
7123    ///
7124    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
7125    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7126        let mut query = self.selection.select("withoutFiles");
7127        query = query.arg(
7128            "paths",
7129            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7130        );
7131        Directory {
7132            proc: self.proc.clone(),
7133            selection: query,
7134            graphql_client: self.graphql_client.clone(),
7135        }
7136    }
7137    /// check if a file or directory exists
7138    ///
7139    /// # Arguments
7140    ///
7141    /// * `path` - Path to check (e.g., "/file.txt").
7142    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7143    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
7144        let mut query = self.selection.select("exists");
7145        query = query.arg("path", path.into());
7146        query.execute(self.graphql_client.clone()).await
7147    }
7148    /// check if a file or directory exists
7149    ///
7150    /// # Arguments
7151    ///
7152    /// * `path` - Path to check (e.g., "/file.txt").
7153    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7154    pub async fn exists_opts(
7155        &self,
7156        path: impl Into<String>,
7157        opts: DirectoryExistsOpts,
7158    ) -> Result<bool, DaggerError> {
7159        let mut query = self.selection.select("exists");
7160        query = query.arg("path", path.into());
7161        if let Some(expected_type) = opts.expected_type {
7162            query = query.arg("expectedType", expected_type);
7163        }
7164        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7165            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7166        }
7167        query.execute(self.graphql_client.clone()).await
7168    }
7169    /// Return file status
7170    ///
7171    /// # Arguments
7172    ///
7173    /// * `path` - Path to stat (e.g., "/file.txt").
7174    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7175    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
7176        let mut query = self.selection.select("stat");
7177        query = query.arg("path", path.into());
7178        let query = query.select("id");
7179        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7180        Ok(id.map(|id| Stat {
7181            proc: self.proc.clone(),
7182            selection: query
7183                .root()
7184                .select("node")
7185                .arg("id", &id.0)
7186                .inline_fragment("Stat"),
7187            graphql_client: self.graphql_client.clone(),
7188        }))
7189    }
7190    /// Return file status
7191    ///
7192    /// # Arguments
7193    ///
7194    /// * `path` - Path to stat (e.g., "/file.txt").
7195    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7196    pub async fn stat_opts(
7197        &self,
7198        path: impl Into<String>,
7199        opts: DirectoryStatOpts,
7200    ) -> Result<Option<Stat>, DaggerError> {
7201        let mut query = self.selection.select("stat");
7202        query = query.arg("path", path.into());
7203        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7204            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7205        }
7206        let query = query.select("id");
7207        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7208        Ok(id.map(|id| Stat {
7209            proc: self.proc.clone(),
7210            selection: query
7211                .root()
7212                .select("node")
7213                .arg("id", &id.0)
7214                .inline_fragment("Stat"),
7215            graphql_client: self.graphql_client.clone(),
7216        }))
7217    }
7218    /// Retrieves a directory at the given path.
7219    ///
7220    /// # Arguments
7221    ///
7222    /// * `path` - Location of the directory to retrieve. Example: "/src"
7223    pub fn directory(&self, path: impl Into<String>) -> Directory {
7224        let mut query = self.selection.select("directory");
7225        query = query.arg("path", path.into());
7226        Directory {
7227            proc: self.proc.clone(),
7228            selection: query,
7229            graphql_client: self.graphql_client.clone(),
7230        }
7231    }
7232    /// Return a snapshot with a directory added
7233    ///
7234    /// # Arguments
7235    ///
7236    /// * `path` - Location of the written directory (e.g., "/src/").
7237    /// * `source` - Identifier of the directory to copy.
7238    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7239    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
7240        let mut query = self.selection.select("withDirectory");
7241        query = query.arg("path", path.into());
7242        query = query.arg_lazy(
7243            "source",
7244            Box::new(move || {
7245                let source = source.clone();
7246                Box::pin(async move { source.into_id().await.unwrap().quote() })
7247            }),
7248        );
7249        Directory {
7250            proc: self.proc.clone(),
7251            selection: query,
7252            graphql_client: self.graphql_client.clone(),
7253        }
7254    }
7255    /// Return a snapshot with a directory added
7256    ///
7257    /// # Arguments
7258    ///
7259    /// * `path` - Location of the written directory (e.g., "/src/").
7260    /// * `source` - Identifier of the directory to copy.
7261    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7262    pub fn with_directory_opts<'a>(
7263        &self,
7264        path: impl Into<String>,
7265        source: impl IntoID<Id>,
7266        opts: DirectoryWithDirectoryOpts<'a>,
7267    ) -> Directory {
7268        let mut query = self.selection.select("withDirectory");
7269        query = query.arg("path", path.into());
7270        query = query.arg_lazy(
7271            "source",
7272            Box::new(move || {
7273                let source = source.clone();
7274                Box::pin(async move { source.into_id().await.unwrap().quote() })
7275            }),
7276        );
7277        if let Some(exclude) = opts.exclude {
7278            query = query.arg("exclude", exclude);
7279        }
7280        if let Some(include) = opts.include {
7281            query = query.arg("include", include);
7282        }
7283        if let Some(gitignore) = opts.gitignore {
7284            query = query.arg("gitignore", gitignore);
7285        }
7286        if let Some(owner) = opts.owner {
7287            query = query.arg("owner", owner);
7288        }
7289        if let Some(permissions) = opts.permissions {
7290            query = query.arg("permissions", permissions);
7291        }
7292        Directory {
7293            proc: self.proc.clone(),
7294            selection: query,
7295            graphql_client: self.graphql_client.clone(),
7296        }
7297    }
7298    /// Return a snapshot with some paths included or excluded
7299    ///
7300    /// # Arguments
7301    ///
7302    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7303    pub fn filter(&self) -> Directory {
7304        let query = self.selection.select("filter");
7305        Directory {
7306            proc: self.proc.clone(),
7307            selection: query,
7308            graphql_client: self.graphql_client.clone(),
7309        }
7310    }
7311    /// Return a snapshot with some paths included or excluded
7312    ///
7313    /// # Arguments
7314    ///
7315    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7316    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
7317        let mut query = self.selection.select("filter");
7318        if let Some(exclude) = opts.exclude {
7319            query = query.arg("exclude", exclude);
7320        }
7321        if let Some(include) = opts.include {
7322            query = query.arg("include", include);
7323        }
7324        if let Some(gitignore) = opts.gitignore {
7325            query = query.arg("gitignore", gitignore);
7326        }
7327        Directory {
7328            proc: self.proc.clone(),
7329            selection: query,
7330            graphql_client: self.graphql_client.clone(),
7331        }
7332    }
7333    /// Retrieves this directory plus a new directory created at the given path.
7334    ///
7335    /// # Arguments
7336    ///
7337    /// * `path` - Location of the directory created (e.g., "/logs").
7338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7339    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
7340        let mut query = self.selection.select("withNewDirectory");
7341        query = query.arg("path", path.into());
7342        Directory {
7343            proc: self.proc.clone(),
7344            selection: query,
7345            graphql_client: self.graphql_client.clone(),
7346        }
7347    }
7348    /// Retrieves this directory plus a new directory created at the given path.
7349    ///
7350    /// # Arguments
7351    ///
7352    /// * `path` - Location of the directory created (e.g., "/logs").
7353    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7354    pub fn with_new_directory_opts(
7355        &self,
7356        path: impl Into<String>,
7357        opts: DirectoryWithNewDirectoryOpts,
7358    ) -> Directory {
7359        let mut query = self.selection.select("withNewDirectory");
7360        query = query.arg("path", path.into());
7361        if let Some(permissions) = opts.permissions {
7362            query = query.arg("permissions", permissions);
7363        }
7364        Directory {
7365            proc: self.proc.clone(),
7366            selection: query,
7367            graphql_client: self.graphql_client.clone(),
7368        }
7369    }
7370    /// Return a snapshot with a subdirectory removed
7371    ///
7372    /// # Arguments
7373    ///
7374    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
7375    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7376        let mut query = self.selection.select("withoutDirectory");
7377        query = query.arg("path", path.into());
7378        Directory {
7379            proc: self.proc.clone(),
7380            selection: query,
7381            graphql_client: self.graphql_client.clone(),
7382        }
7383    }
7384    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
7385    ///
7386    /// # Arguments
7387    ///
7388    /// * `other` - The directory to compare against
7389    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
7390        let mut query = self.selection.select("diff");
7391        query = query.arg_lazy(
7392            "other",
7393            Box::new(move || {
7394                let other = other.clone();
7395                Box::pin(async move { other.into_id().await.unwrap().quote() })
7396            }),
7397        );
7398        Directory {
7399            proc: self.proc.clone(),
7400            selection: query,
7401            graphql_client: self.graphql_client.clone(),
7402        }
7403    }
7404    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
7405    ///
7406    /// # Arguments
7407    ///
7408    /// * `name` - The name of the file or directory to search for
7409    /// * `start` - The path to start the search from
7410    pub async fn find_up(
7411        &self,
7412        name: impl Into<String>,
7413        start: impl Into<String>,
7414    ) -> Result<String, DaggerError> {
7415        let mut query = self.selection.select("findUp");
7416        query = query.arg("name", name.into());
7417        query = query.arg("start", start.into());
7418        query.execute(self.graphql_client.clone()).await
7419    }
7420    /// Return the difference between this directory and another directory, typically an older snapshot.
7421    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
7422    ///
7423    /// # Arguments
7424    ///
7425    /// * `from` - The base directory snapshot to compare against
7426    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
7427        let mut query = self.selection.select("changes");
7428        query = query.arg_lazy(
7429            "from",
7430            Box::new(move || {
7431                let from = from.clone();
7432                Box::pin(async move { from.into_id().await.unwrap().quote() })
7433            }),
7434        );
7435        Changeset {
7436            proc: self.proc.clone(),
7437            selection: query,
7438            graphql_client: self.graphql_client.clone(),
7439        }
7440    }
7441    /// Return a directory with changes from another directory applied to it.
7442    ///
7443    /// # Arguments
7444    ///
7445    /// * `changes` - Changes to apply to the directory
7446    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
7447        let mut query = self.selection.select("withChanges");
7448        query = query.arg_lazy(
7449            "changes",
7450            Box::new(move || {
7451                let changes = changes.clone();
7452                Box::pin(async move { changes.into_id().await.unwrap().quote() })
7453            }),
7454        );
7455        Directory {
7456            proc: self.proc.clone(),
7457            selection: query,
7458            graphql_client: self.graphql_client.clone(),
7459        }
7460    }
7461    /// Writes the contents of the directory to a path on the host.
7462    ///
7463    /// # Arguments
7464    ///
7465    /// * `path` - Location of the copied directory (e.g., "logs/").
7466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7467    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7468        let mut query = self.selection.select("export");
7469        query = query.arg("path", path.into());
7470        query.execute(self.graphql_client.clone()).await
7471    }
7472    /// Writes the contents of the directory to a path on the host.
7473    ///
7474    /// # Arguments
7475    ///
7476    /// * `path` - Location of the copied directory (e.g., "logs/").
7477    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7478    pub async fn export_opts(
7479        &self,
7480        path: impl Into<String>,
7481        opts: DirectoryExportOpts,
7482    ) -> Result<String, DaggerError> {
7483        let mut query = self.selection.select("export");
7484        query = query.arg("path", path.into());
7485        if let Some(wipe) = opts.wipe {
7486            query = query.arg("wipe", wipe);
7487        }
7488        query.execute(self.graphql_client.clone()).await
7489    }
7490    /// 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.
7491    ///
7492    /// # Arguments
7493    ///
7494    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7495    pub fn docker_build(&self) -> Container {
7496        let query = self.selection.select("dockerBuild");
7497        Container {
7498            proc: self.proc.clone(),
7499            selection: query,
7500            graphql_client: self.graphql_client.clone(),
7501        }
7502    }
7503    /// 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.
7504    ///
7505    /// # Arguments
7506    ///
7507    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7508    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
7509        let mut query = self.selection.select("dockerBuild");
7510        if let Some(dockerfile) = opts.dockerfile {
7511            query = query.arg("dockerfile", dockerfile);
7512        }
7513        if let Some(platform) = opts.platform {
7514            query = query.arg("platform", platform);
7515        }
7516        if let Some(build_args) = opts.build_args {
7517            query = query.arg("buildArgs", build_args);
7518        }
7519        if let Some(target) = opts.target {
7520            query = query.arg("target", target);
7521        }
7522        if let Some(secrets) = opts.secrets {
7523            query = query.arg("secrets", secrets);
7524        }
7525        if let Some(no_init) = opts.no_init {
7526            query = query.arg("noInit", no_init);
7527        }
7528        if let Some(ssh) = opts.ssh {
7529            query = query.arg("ssh", ssh);
7530        }
7531        Container {
7532            proc: self.proc.clone(),
7533            selection: query,
7534            graphql_client: self.graphql_client.clone(),
7535        }
7536    }
7537    /// Retrieves this directory with all file/dir timestamps set to the given time.
7538    ///
7539    /// # Arguments
7540    ///
7541    /// * `timestamp` - Timestamp to set dir/files in.
7542    ///
7543    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7544    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7545        let mut query = self.selection.select("withTimestamps");
7546        query = query.arg("timestamp", timestamp);
7547        Directory {
7548            proc: self.proc.clone(),
7549            selection: query,
7550            graphql_client: self.graphql_client.clone(),
7551        }
7552    }
7553    /// Retrieves this directory with the given Git-compatible patch applied.
7554    ///
7555    /// # Arguments
7556    ///
7557    /// * `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").
7558    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7559    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
7560        let mut query = self.selection.select("withPatch");
7561        query = query.arg("patch", patch.into());
7562        Directory {
7563            proc: self.proc.clone(),
7564            selection: query,
7565            graphql_client: self.graphql_client.clone(),
7566        }
7567    }
7568    /// Retrieves this directory with the given Git-compatible patch applied.
7569    ///
7570    /// # Arguments
7571    ///
7572    /// * `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").
7573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7574    pub fn with_patch_opts(
7575        &self,
7576        patch: impl Into<String>,
7577        opts: DirectoryWithPatchOpts,
7578    ) -> Directory {
7579        let mut query = self.selection.select("withPatch");
7580        query = query.arg("patch", patch.into());
7581        if let Some(on_conflict) = opts.on_conflict {
7582            query = query.arg("onConflict", on_conflict);
7583        }
7584        Directory {
7585            proc: self.proc.clone(),
7586            selection: query,
7587            graphql_client: self.graphql_client.clone(),
7588        }
7589    }
7590    /// Retrieves this directory with the given Git-compatible patch file applied.
7591    ///
7592    /// # Arguments
7593    ///
7594    /// * `patch` - File containing the patch to apply
7595    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7596    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
7597        let mut query = self.selection.select("withPatchFile");
7598        query = query.arg_lazy(
7599            "patch",
7600            Box::new(move || {
7601                let patch = patch.clone();
7602                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7603            }),
7604        );
7605        Directory {
7606            proc: self.proc.clone(),
7607            selection: query,
7608            graphql_client: self.graphql_client.clone(),
7609        }
7610    }
7611    /// Retrieves this directory with the given Git-compatible patch file applied.
7612    ///
7613    /// # Arguments
7614    ///
7615    /// * `patch` - File containing the patch to apply
7616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7617    pub fn with_patch_file_opts(
7618        &self,
7619        patch: impl IntoID<Id>,
7620        opts: DirectoryWithPatchFileOpts,
7621    ) -> Directory {
7622        let mut query = self.selection.select("withPatchFile");
7623        query = query.arg_lazy(
7624            "patch",
7625            Box::new(move || {
7626                let patch = patch.clone();
7627                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7628            }),
7629        );
7630        if let Some(on_conflict) = opts.on_conflict {
7631            query = query.arg("onConflict", on_conflict);
7632        }
7633        Directory {
7634            proc: self.proc.clone(),
7635            selection: query,
7636            graphql_client: self.graphql_client.clone(),
7637        }
7638    }
7639    /// Converts this directory to a local git repository
7640    pub fn as_git(&self) -> GitRepository {
7641        let query = self.selection.select("asGit");
7642        GitRepository {
7643            proc: self.proc.clone(),
7644            selection: query,
7645            graphql_client: self.graphql_client.clone(),
7646        }
7647    }
7648    /// Creates a synthetic workspace from this directory.
7649    ///
7650    /// # Arguments
7651    ///
7652    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7653    pub fn as_workspace(&self) -> Workspace {
7654        let query = self.selection.select("asWorkspace");
7655        Workspace {
7656            proc: self.proc.clone(),
7657            selection: query,
7658            graphql_client: self.graphql_client.clone(),
7659        }
7660    }
7661    /// Creates a synthetic workspace from this directory.
7662    ///
7663    /// # Arguments
7664    ///
7665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7666    pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
7667        let mut query = self.selection.select("asWorkspace");
7668        if let Some(cwd) = opts.cwd {
7669            query = query.arg("cwd", cwd);
7670        }
7671        Workspace {
7672            proc: self.proc.clone(),
7673            selection: query,
7674            graphql_client: self.graphql_client.clone(),
7675        }
7676    }
7677    /// Opens an interactive terminal in new container with this directory mounted inside.
7678    ///
7679    /// # Arguments
7680    ///
7681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7682    pub fn terminal(&self) -> Directory {
7683        let query = self.selection.select("terminal");
7684        Directory {
7685            proc: self.proc.clone(),
7686            selection: query,
7687            graphql_client: self.graphql_client.clone(),
7688        }
7689    }
7690    /// Opens an interactive terminal in new container with this directory mounted inside.
7691    ///
7692    /// # Arguments
7693    ///
7694    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7695    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
7696        let mut query = self.selection.select("terminal");
7697        if let Some(container) = opts.container {
7698            query = query.arg("container", container);
7699        }
7700        if let Some(cmd) = opts.cmd {
7701            query = query.arg("cmd", cmd);
7702        }
7703        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
7704            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
7705        }
7706        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
7707            query = query.arg(
7708                "experimentalPrivilegedNesting",
7709                experimental_privileged_nesting,
7710            );
7711        }
7712        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
7713            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
7714        }
7715        Directory {
7716            proc: self.proc.clone(),
7717            selection: query,
7718            graphql_client: self.graphql_client.clone(),
7719        }
7720    }
7721    /// Return a snapshot with a symlink
7722    ///
7723    /// # Arguments
7724    ///
7725    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
7726    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
7727    pub fn with_symlink(
7728        &self,
7729        target: impl Into<String>,
7730        link_name: impl Into<String>,
7731    ) -> Directory {
7732        let mut query = self.selection.select("withSymlink");
7733        query = query.arg("target", target.into());
7734        query = query.arg("linkName", link_name.into());
7735        Directory {
7736            proc: self.proc.clone(),
7737            selection: query,
7738            graphql_client: self.graphql_client.clone(),
7739        }
7740    }
7741    /// Change the owner of the directory contents recursively.
7742    ///
7743    /// # Arguments
7744    ///
7745    /// * `path` - Path of the directory to change ownership of (e.g., "/").
7746    /// * `owner` - A user:group to set for the mounted directory and its contents.
7747    ///
7748    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
7749    ///
7750    /// If the group is omitted, it defaults to the same as the user.
7751    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
7752        let mut query = self.selection.select("chown");
7753        query = query.arg("path", path.into());
7754        query = query.arg("owner", owner.into());
7755        Directory {
7756            proc: self.proc.clone(),
7757            selection: query,
7758            graphql_client: self.graphql_client.clone(),
7759        }
7760    }
7761    /// Raise an error.
7762    ///
7763    /// # Arguments
7764    ///
7765    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
7766    pub fn with_error(&self, err: impl Into<String>) -> Directory {
7767        let mut query = self.selection.select("withError");
7768        query = query.arg("err", err.into());
7769        Directory {
7770            proc: self.proc.clone(),
7771            selection: query,
7772            graphql_client: self.graphql_client.clone(),
7773        }
7774    }
7775    /// Load the directory as a Dagger module source
7776    ///
7777    /// # Arguments
7778    ///
7779    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7780    pub fn as_module(&self) -> Module {
7781        let query = self.selection.select("asModule");
7782        Module {
7783            proc: self.proc.clone(),
7784            selection: query,
7785            graphql_client: self.graphql_client.clone(),
7786        }
7787    }
7788    /// Load the directory as a Dagger module source
7789    ///
7790    /// # Arguments
7791    ///
7792    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7793    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
7794        let mut query = self.selection.select("asModule");
7795        if let Some(source_root_path) = opts.source_root_path {
7796            query = query.arg("sourceRootPath", source_root_path);
7797        }
7798        Module {
7799            proc: self.proc.clone(),
7800            selection: query,
7801            graphql_client: self.graphql_client.clone(),
7802        }
7803    }
7804    /// Load the directory as a Dagger module source
7805    ///
7806    /// # Arguments
7807    ///
7808    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7809    pub fn as_module_source(&self) -> ModuleSource {
7810        let query = self.selection.select("asModuleSource");
7811        ModuleSource {
7812            proc: self.proc.clone(),
7813            selection: query,
7814            graphql_client: self.graphql_client.clone(),
7815        }
7816    }
7817    /// Load the directory as a Dagger module source
7818    ///
7819    /// # Arguments
7820    ///
7821    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7822    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
7823        let mut query = self.selection.select("asModuleSource");
7824        if let Some(source_root_path) = opts.source_root_path {
7825            query = query.arg("sourceRootPath", source_root_path);
7826        }
7827        ModuleSource {
7828            proc: self.proc.clone(),
7829            selection: query,
7830            graphql_client: self.graphql_client.clone(),
7831        }
7832    }
7833}
7834impl Exportable for Directory {
7835    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7836        let query = self.selection.select("id");
7837        let graphql_client = self.graphql_client.clone();
7838        async move { query.execute(graphql_client).await }
7839    }
7840    fn export(
7841        &self,
7842        path: impl Into<String>,
7843    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7844        let mut query = self.selection.select("export");
7845        query = query.arg("path", path.into());
7846        let graphql_client = self.graphql_client.clone();
7847        async move { query.execute(graphql_client).await }
7848    }
7849}
7850impl Node for Directory {
7851    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7852        let query = self.selection.select("id");
7853        let graphql_client = self.graphql_client.clone();
7854        async move { query.execute(graphql_client).await }
7855    }
7856}
7857impl Syncer for Directory {
7858    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7859        let query = self.selection.select("id");
7860        let graphql_client = self.graphql_client.clone();
7861        async move { query.execute(graphql_client).await }
7862    }
7863    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7864        let query = self.selection.select("sync");
7865        let proc = self.proc.clone();
7866        let graphql_client = self.graphql_client.clone();
7867        async move {
7868            let id: Id = query.execute(graphql_client.clone()).await?;
7869            Ok(Self {
7870                proc,
7871                selection: query
7872                    .root()
7873                    .select("node")
7874                    .arg("id", &id.0)
7875                    .inline_fragment("Directory"),
7876                graphql_client,
7877            })
7878        }
7879    }
7880}
7881#[derive(Clone)]
7882pub struct Engine {
7883    pub proc: Option<Arc<DaggerSessionProc>>,
7884    pub selection: Selection,
7885    pub graphql_client: DynGraphQLClient,
7886}
7887impl IntoID<Id> for Engine {
7888    fn into_id(
7889        self,
7890    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7891        Box::pin(async move { self.id().await })
7892    }
7893}
7894impl Loadable for Engine {
7895    fn graphql_type() -> &'static str {
7896        "Engine"
7897    }
7898    fn from_query(
7899        proc: Option<Arc<DaggerSessionProc>>,
7900        selection: Selection,
7901        graphql_client: DynGraphQLClient,
7902    ) -> Self {
7903        Self {
7904            proc,
7905            selection,
7906            graphql_client,
7907        }
7908    }
7909}
7910impl Engine {
7911    /// A unique identifier for this Engine.
7912    pub async fn id(&self) -> Result<Id, DaggerError> {
7913        let query = self.selection.select("id");
7914        query.execute(self.graphql_client.clone()).await
7915    }
7916    /// The list of connected client IDs
7917    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7918        let query = self.selection.select("clients");
7919        query.execute(self.graphql_client.clone()).await
7920    }
7921    /// The name of the engine instance.
7922    pub async fn name(&self) -> Result<String, DaggerError> {
7923        let query = self.selection.select("name");
7924        query.execute(self.graphql_client.clone()).await
7925    }
7926    /// The local engine cache state tracked by dagql
7927    pub fn local_cache(&self) -> EngineCache {
7928        let query = self.selection.select("localCache");
7929        EngineCache {
7930            proc: self.proc.clone(),
7931            selection: query,
7932            graphql_client: self.graphql_client.clone(),
7933        }
7934    }
7935}
7936impl Node for Engine {
7937    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7938        let query = self.selection.select("id");
7939        let graphql_client = self.graphql_client.clone();
7940        async move { query.execute(graphql_client).await }
7941    }
7942}
7943#[derive(Clone)]
7944pub struct EngineCache {
7945    pub proc: Option<Arc<DaggerSessionProc>>,
7946    pub selection: Selection,
7947    pub graphql_client: DynGraphQLClient,
7948}
7949#[derive(Builder, Debug, PartialEq)]
7950pub struct EngineCacheEntrySetOpts<'a> {
7951    #[builder(setter(into, strip_option), default)]
7952    pub key: Option<&'a str>,
7953}
7954#[derive(Builder, Debug, PartialEq)]
7955pub struct EngineCachePruneOpts<'a> {
7956    /// Override the maximum structural metadata estimate in absolute bytes. Explicit values must be positive; the configured/default value is used when omitted.
7957    #[builder(setter(into, strip_option), default)]
7958    pub max_estimated_bytes: Option<isize>,
7959    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
7960    #[builder(setter(into, strip_option), default)]
7961    pub max_used_space: Option<&'a str>,
7962    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
7963    #[builder(setter(into, strip_option), default)]
7964    pub min_free_space: Option<&'a str>,
7965    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
7966    #[builder(setter(into, strip_option), default)]
7967    pub reserved_space: Option<&'a str>,
7968    /// 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.
7969    #[builder(setter(into, strip_option), default)]
7970    pub target_estimated_bytes: Option<isize>,
7971    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
7972    #[builder(setter(into, strip_option), default)]
7973    pub target_space: Option<&'a str>,
7974    /// 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.
7975    #[builder(setter(into, strip_option), default)]
7976    pub use_default_policy: Option<bool>,
7977}
7978impl IntoID<Id> for EngineCache {
7979    fn into_id(
7980        self,
7981    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7982        Box::pin(async move { self.id().await })
7983    }
7984}
7985impl Loadable for EngineCache {
7986    fn graphql_type() -> &'static str {
7987        "EngineCache"
7988    }
7989    fn from_query(
7990        proc: Option<Arc<DaggerSessionProc>>,
7991        selection: Selection,
7992        graphql_client: DynGraphQLClient,
7993    ) -> Self {
7994        Self {
7995            proc,
7996            selection,
7997            graphql_client,
7998        }
7999    }
8000}
8001impl EngineCache {
8002    /// A unique identifier for this EngineCache.
8003    pub async fn id(&self) -> Result<Id, DaggerError> {
8004        let query = self.selection.select("id");
8005        query.execute(self.graphql_client.clone()).await
8006    }
8007    /// The current set of entries in the cache
8008    ///
8009    /// # Arguments
8010    ///
8011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8012    pub fn entry_set(&self) -> EngineCacheEntrySet {
8013        let query = self.selection.select("entrySet");
8014        EngineCacheEntrySet {
8015            proc: self.proc.clone(),
8016            selection: query,
8017            graphql_client: self.graphql_client.clone(),
8018        }
8019    }
8020    /// The current set of entries in the cache
8021    ///
8022    /// # Arguments
8023    ///
8024    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8025    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
8026        let mut query = self.selection.select("entrySet");
8027        if let Some(key) = opts.key {
8028            query = query.arg("key", key);
8029        }
8030        EngineCacheEntrySet {
8031            proc: self.proc.clone(),
8032            selection: query,
8033            graphql_client: self.graphql_client.clone(),
8034        }
8035    }
8036    /// Prune the cache of releaseable entries
8037    ///
8038    /// # Arguments
8039    ///
8040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8041    pub async fn prune(&self) -> Result<Void, DaggerError> {
8042        let query = self.selection.select("prune");
8043        query.execute(self.graphql_client.clone()).await
8044    }
8045    /// Prune the cache of releaseable entries
8046    ///
8047    /// # Arguments
8048    ///
8049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8050    pub async fn prune_opts<'a>(
8051        &self,
8052        opts: EngineCachePruneOpts<'a>,
8053    ) -> Result<Void, DaggerError> {
8054        let mut query = self.selection.select("prune");
8055        if let Some(use_default_policy) = opts.use_default_policy {
8056            query = query.arg("useDefaultPolicy", use_default_policy);
8057        }
8058        if let Some(max_used_space) = opts.max_used_space {
8059            query = query.arg("maxUsedSpace", max_used_space);
8060        }
8061        if let Some(reserved_space) = opts.reserved_space {
8062            query = query.arg("reservedSpace", reserved_space);
8063        }
8064        if let Some(min_free_space) = opts.min_free_space {
8065            query = query.arg("minFreeSpace", min_free_space);
8066        }
8067        if let Some(target_space) = opts.target_space {
8068            query = query.arg("targetSpace", target_space);
8069        }
8070        if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
8071            query = query.arg("maxEstimatedBytes", max_estimated_bytes);
8072        }
8073        if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
8074            query = query.arg("targetEstimatedBytes", target_estimated_bytes);
8075        }
8076        query.execute(self.graphql_client.clone()).await
8077    }
8078    /// The maximum bytes to keep in the cache without pruning.
8079    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
8080        let query = self.selection.select("maxUsedSpace");
8081        query.execute(self.graphql_client.clone()).await
8082    }
8083    /// The target number of bytes to keep when pruning.
8084    pub async fn target_space(&self) -> Result<isize, DaggerError> {
8085        let query = self.selection.select("targetSpace");
8086        query.execute(self.graphql_client.clone()).await
8087    }
8088    /// The minimum amount of disk space this policy is guaranteed to retain.
8089    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
8090        let query = self.selection.select("reservedSpace");
8091        query.execute(self.graphql_client.clone()).await
8092    }
8093    /// The target amount of free disk space the garbage collector will attempt to leave.
8094    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
8095        let query = self.selection.select("minFreeSpace");
8096        query.execute(self.graphql_client.clone()).await
8097    }
8098}
8099impl Node for EngineCache {
8100    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8101        let query = self.selection.select("id");
8102        let graphql_client = self.graphql_client.clone();
8103        async move { query.execute(graphql_client).await }
8104    }
8105}
8106#[derive(Clone)]
8107pub struct EngineCacheEntry {
8108    pub proc: Option<Arc<DaggerSessionProc>>,
8109    pub selection: Selection,
8110    pub graphql_client: DynGraphQLClient,
8111}
8112impl IntoID<Id> for EngineCacheEntry {
8113    fn into_id(
8114        self,
8115    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8116        Box::pin(async move { self.id().await })
8117    }
8118}
8119impl Loadable for EngineCacheEntry {
8120    fn graphql_type() -> &'static str {
8121        "EngineCacheEntry"
8122    }
8123    fn from_query(
8124        proc: Option<Arc<DaggerSessionProc>>,
8125        selection: Selection,
8126        graphql_client: DynGraphQLClient,
8127    ) -> Self {
8128        Self {
8129            proc,
8130            selection,
8131            graphql_client,
8132        }
8133    }
8134}
8135impl EngineCacheEntry {
8136    /// A unique identifier for this EngineCacheEntry.
8137    pub async fn id(&self) -> Result<Id, DaggerError> {
8138        let query = self.selection.select("id");
8139        query.execute(self.graphql_client.clone()).await
8140    }
8141    /// The description of the cache entry.
8142    pub async fn description(&self) -> Result<String, DaggerError> {
8143        let query = self.selection.select("description");
8144        query.execute(self.graphql_client.clone()).await
8145    }
8146    /// The disk space used by the cache entry.
8147    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8148        let query = self.selection.select("diskSpaceBytes");
8149        query.execute(self.graphql_client.clone()).await
8150    }
8151    /// The time the cache entry was created, in Unix nanoseconds.
8152    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
8153        let query = self.selection.select("createdTimeUnixNano");
8154        query.execute(self.graphql_client.clone()).await
8155    }
8156    /// The most recent time the cache entry was used, in Unix nanoseconds.
8157    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
8158        let query = self.selection.select("mostRecentUseTimeUnixNano");
8159        query.execute(self.graphql_client.clone()).await
8160    }
8161    /// Whether the cache entry is actively being used.
8162    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
8163        let query = self.selection.select("activelyUsed");
8164        query.execute(self.graphql_client.clone()).await
8165    }
8166    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
8167    pub async fn record_type(&self) -> Result<String, DaggerError> {
8168        let query = self.selection.select("recordType");
8169        query.execute(self.graphql_client.clone()).await
8170    }
8171    /// The storage record types represented by this cache entry.
8172    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
8173        let query = self.selection.select("recordTypes");
8174        query.execute(self.graphql_client.clone()).await
8175    }
8176    /// The DagQL call that produced this cache entry.
8177    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
8178        let query = self.selection.select("dagqlCall");
8179        query.execute(self.graphql_client.clone()).await
8180    }
8181}
8182impl Node for EngineCacheEntry {
8183    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8184        let query = self.selection.select("id");
8185        let graphql_client = self.graphql_client.clone();
8186        async move { query.execute(graphql_client).await }
8187    }
8188}
8189#[derive(Clone)]
8190pub struct EngineCacheEntrySet {
8191    pub proc: Option<Arc<DaggerSessionProc>>,
8192    pub selection: Selection,
8193    pub graphql_client: DynGraphQLClient,
8194}
8195impl IntoID<Id> for EngineCacheEntrySet {
8196    fn into_id(
8197        self,
8198    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8199        Box::pin(async move { self.id().await })
8200    }
8201}
8202impl Loadable for EngineCacheEntrySet {
8203    fn graphql_type() -> &'static str {
8204        "EngineCacheEntrySet"
8205    }
8206    fn from_query(
8207        proc: Option<Arc<DaggerSessionProc>>,
8208        selection: Selection,
8209        graphql_client: DynGraphQLClient,
8210    ) -> Self {
8211        Self {
8212            proc,
8213            selection,
8214            graphql_client,
8215        }
8216    }
8217}
8218impl EngineCacheEntrySet {
8219    /// A unique identifier for this EngineCacheEntrySet.
8220    pub async fn id(&self) -> Result<Id, DaggerError> {
8221        let query = self.selection.select("id");
8222        query.execute(self.graphql_client.clone()).await
8223    }
8224    /// The list of individual cache entries in the set
8225    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
8226        let query = self.selection.select("entries");
8227        let query = query.select("id");
8228        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8229        Ok(ids
8230            .into_iter()
8231            .map(|id| EngineCacheEntry {
8232                proc: self.proc.clone(),
8233                selection: crate::querybuilder::query()
8234                    .select("node")
8235                    .arg("id", &id.0)
8236                    .inline_fragment("EngineCacheEntry"),
8237                graphql_client: self.graphql_client.clone(),
8238            })
8239            .collect())
8240    }
8241    /// The number of cache entries in this set.
8242    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
8243        let query = self.selection.select("entryCount");
8244        query.execute(self.graphql_client.clone()).await
8245    }
8246    /// The total disk space used by the cache entries in this set.
8247    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8248        let query = self.selection.select("diskSpaceBytes");
8249        query.execute(self.graphql_client.clone()).await
8250    }
8251}
8252impl Node for EngineCacheEntrySet {
8253    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8254        let query = self.selection.select("id");
8255        let graphql_client = self.graphql_client.clone();
8256        async move { query.execute(graphql_client).await }
8257    }
8258}
8259#[derive(Clone)]
8260pub struct EnumTypeDef {
8261    pub proc: Option<Arc<DaggerSessionProc>>,
8262    pub selection: Selection,
8263    pub graphql_client: DynGraphQLClient,
8264}
8265impl IntoID<Id> for EnumTypeDef {
8266    fn into_id(
8267        self,
8268    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8269        Box::pin(async move { self.id().await })
8270    }
8271}
8272impl Loadable for EnumTypeDef {
8273    fn graphql_type() -> &'static str {
8274        "EnumTypeDef"
8275    }
8276    fn from_query(
8277        proc: Option<Arc<DaggerSessionProc>>,
8278        selection: Selection,
8279        graphql_client: DynGraphQLClient,
8280    ) -> Self {
8281        Self {
8282            proc,
8283            selection,
8284            graphql_client,
8285        }
8286    }
8287}
8288impl EnumTypeDef {
8289    /// A unique identifier for this EnumTypeDef.
8290    pub async fn id(&self) -> Result<Id, DaggerError> {
8291        let query = self.selection.select("id");
8292        query.execute(self.graphql_client.clone()).await
8293    }
8294    /// The members of the enum.
8295    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8296        let query = self.selection.select("values");
8297        let query = query.select("id");
8298        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8299        Ok(ids
8300            .into_iter()
8301            .map(|id| EnumValueTypeDef {
8302                proc: self.proc.clone(),
8303                selection: crate::querybuilder::query()
8304                    .select("node")
8305                    .arg("id", &id.0)
8306                    .inline_fragment("EnumValueTypeDef"),
8307                graphql_client: self.graphql_client.clone(),
8308            })
8309            .collect())
8310    }
8311    /// The members of the enum.
8312    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8313        let query = self.selection.select("members");
8314        let query = query.select("id");
8315        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8316        Ok(ids
8317            .into_iter()
8318            .map(|id| EnumValueTypeDef {
8319                proc: self.proc.clone(),
8320                selection: crate::querybuilder::query()
8321                    .select("node")
8322                    .arg("id", &id.0)
8323                    .inline_fragment("EnumValueTypeDef"),
8324                graphql_client: self.graphql_client.clone(),
8325            })
8326            .collect())
8327    }
8328    /// The name of the enum.
8329    pub async fn name(&self) -> Result<String, DaggerError> {
8330        let query = self.selection.select("name");
8331        query.execute(self.graphql_client.clone()).await
8332    }
8333    /// A doc string for the enum, if any.
8334    pub async fn description(&self) -> Result<String, DaggerError> {
8335        let query = self.selection.select("description");
8336        query.execute(self.graphql_client.clone()).await
8337    }
8338    /// The location of this enum declaration.
8339    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8340        let query = self.selection.select("sourceMap");
8341        let query = query.select("id");
8342        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8343        Ok(id.map(|id| SourceMap {
8344            proc: self.proc.clone(),
8345            selection: query
8346                .root()
8347                .select("node")
8348                .arg("id", &id.0)
8349                .inline_fragment("SourceMap"),
8350            graphql_client: self.graphql_client.clone(),
8351        }))
8352    }
8353    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
8354    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8355        let query = self.selection.select("sourceModuleName");
8356        query.execute(self.graphql_client.clone()).await
8357    }
8358}
8359impl Node for EnumTypeDef {
8360    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8361        let query = self.selection.select("id");
8362        let graphql_client = self.graphql_client.clone();
8363        async move { query.execute(graphql_client).await }
8364    }
8365}
8366#[derive(Clone)]
8367pub struct EnumValueTypeDef {
8368    pub proc: Option<Arc<DaggerSessionProc>>,
8369    pub selection: Selection,
8370    pub graphql_client: DynGraphQLClient,
8371}
8372impl IntoID<Id> for EnumValueTypeDef {
8373    fn into_id(
8374        self,
8375    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8376        Box::pin(async move { self.id().await })
8377    }
8378}
8379impl Loadable for EnumValueTypeDef {
8380    fn graphql_type() -> &'static str {
8381        "EnumValueTypeDef"
8382    }
8383    fn from_query(
8384        proc: Option<Arc<DaggerSessionProc>>,
8385        selection: Selection,
8386        graphql_client: DynGraphQLClient,
8387    ) -> Self {
8388        Self {
8389            proc,
8390            selection,
8391            graphql_client,
8392        }
8393    }
8394}
8395impl EnumValueTypeDef {
8396    /// A unique identifier for this EnumValueTypeDef.
8397    pub async fn id(&self) -> Result<Id, DaggerError> {
8398        let query = self.selection.select("id");
8399        query.execute(self.graphql_client.clone()).await
8400    }
8401    /// The name of the enum member.
8402    pub async fn name(&self) -> Result<String, DaggerError> {
8403        let query = self.selection.select("name");
8404        query.execute(self.graphql_client.clone()).await
8405    }
8406    /// The value of the enum member
8407    pub async fn value(&self) -> Result<String, DaggerError> {
8408        let query = self.selection.select("value");
8409        query.execute(self.graphql_client.clone()).await
8410    }
8411    /// A doc string for the enum member, if any.
8412    pub async fn description(&self) -> Result<String, DaggerError> {
8413        let query = self.selection.select("description");
8414        query.execute(self.graphql_client.clone()).await
8415    }
8416    /// The location of this enum member declaration.
8417    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8418        let query = self.selection.select("sourceMap");
8419        let query = query.select("id");
8420        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8421        Ok(id.map(|id| SourceMap {
8422            proc: self.proc.clone(),
8423            selection: query
8424                .root()
8425                .select("node")
8426                .arg("id", &id.0)
8427                .inline_fragment("SourceMap"),
8428            graphql_client: self.graphql_client.clone(),
8429        }))
8430    }
8431    /// The reason this enum member is deprecated, if any.
8432    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8433        let query = self.selection.select("deprecated");
8434        query.execute(self.graphql_client.clone()).await
8435    }
8436}
8437impl Node for EnumValueTypeDef {
8438    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8439        let query = self.selection.select("id");
8440        let graphql_client = self.graphql_client.clone();
8441        async move { query.execute(graphql_client).await }
8442    }
8443}
8444#[derive(Clone)]
8445pub struct EnvFile {
8446    pub proc: Option<Arc<DaggerSessionProc>>,
8447    pub selection: Selection,
8448    pub graphql_client: DynGraphQLClient,
8449}
8450#[derive(Builder, Debug, PartialEq)]
8451pub struct EnvFileVariablesOpts {
8452    /// Return values exactly as written to the file. No quote removal or variable expansion
8453    #[builder(setter(into, strip_option), default)]
8454    pub raw: Option<bool>,
8455}
8456#[derive(Builder, Debug, PartialEq)]
8457pub struct EnvFileGetOpts {
8458    /// Return the value exactly as written to the file. No quote removal or variable expansion
8459    #[builder(setter(into, strip_option), default)]
8460    pub raw: Option<bool>,
8461}
8462impl IntoID<Id> for EnvFile {
8463    fn into_id(
8464        self,
8465    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8466        Box::pin(async move { self.id().await })
8467    }
8468}
8469impl Loadable for EnvFile {
8470    fn graphql_type() -> &'static str {
8471        "EnvFile"
8472    }
8473    fn from_query(
8474        proc: Option<Arc<DaggerSessionProc>>,
8475        selection: Selection,
8476        graphql_client: DynGraphQLClient,
8477    ) -> Self {
8478        Self {
8479            proc,
8480            selection,
8481            graphql_client,
8482        }
8483    }
8484}
8485impl EnvFile {
8486    /// A unique identifier for this EnvFile.
8487    pub async fn id(&self) -> Result<Id, DaggerError> {
8488        let query = self.selection.select("id");
8489        query.execute(self.graphql_client.clone()).await
8490    }
8491    /// Return all variables
8492    ///
8493    /// # Arguments
8494    ///
8495    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8496    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8497        let query = self.selection.select("variables");
8498        let query = query.select("id");
8499        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8500        Ok(ids
8501            .into_iter()
8502            .map(|id| EnvVariable {
8503                proc: self.proc.clone(),
8504                selection: crate::querybuilder::query()
8505                    .select("node")
8506                    .arg("id", &id.0)
8507                    .inline_fragment("EnvVariable"),
8508                graphql_client: self.graphql_client.clone(),
8509            })
8510            .collect())
8511    }
8512    /// Return all variables
8513    ///
8514    /// # Arguments
8515    ///
8516    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8517    pub async fn variables_opts(
8518        &self,
8519        opts: EnvFileVariablesOpts,
8520    ) -> Result<Vec<EnvVariable>, DaggerError> {
8521        let mut query = self.selection.select("variables");
8522        if let Some(raw) = opts.raw {
8523            query = query.arg("raw", raw);
8524        }
8525        let query = query.select("id");
8526        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8527        Ok(ids
8528            .into_iter()
8529            .map(|id| EnvVariable {
8530                proc: self.proc.clone(),
8531                selection: crate::querybuilder::query()
8532                    .select("node")
8533                    .arg("id", &id.0)
8534                    .inline_fragment("EnvVariable"),
8535                graphql_client: self.graphql_client.clone(),
8536            })
8537            .collect())
8538    }
8539    /// Add a variable
8540    ///
8541    /// # Arguments
8542    ///
8543    /// * `name` - Variable name
8544    /// * `value` - Variable value
8545    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8546        let mut query = self.selection.select("withVariable");
8547        query = query.arg("name", name.into());
8548        query = query.arg("value", value.into());
8549        EnvFile {
8550            proc: self.proc.clone(),
8551            selection: query,
8552            graphql_client: self.graphql_client.clone(),
8553        }
8554    }
8555    /// Remove all occurrences of the named variable
8556    ///
8557    /// # Arguments
8558    ///
8559    /// * `name` - Variable name
8560    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8561        let mut query = self.selection.select("withoutVariable");
8562        query = query.arg("name", name.into());
8563        EnvFile {
8564            proc: self.proc.clone(),
8565            selection: query,
8566            graphql_client: self.graphql_client.clone(),
8567        }
8568    }
8569    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8570    ///
8571    /// # Arguments
8572    ///
8573    /// * `name` - Variable name
8574    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8575    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8576        let mut query = self.selection.select("get");
8577        query = query.arg("name", name.into());
8578        query.execute(self.graphql_client.clone()).await
8579    }
8580    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8581    ///
8582    /// # Arguments
8583    ///
8584    /// * `name` - Variable name
8585    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8586    pub async fn get_opts(
8587        &self,
8588        name: impl Into<String>,
8589        opts: EnvFileGetOpts,
8590    ) -> Result<String, DaggerError> {
8591        let mut query = self.selection.select("get");
8592        query = query.arg("name", name.into());
8593        if let Some(raw) = opts.raw {
8594            query = query.arg("raw", raw);
8595        }
8596        query.execute(self.graphql_client.clone()).await
8597    }
8598    /// Check if a variable exists
8599    ///
8600    /// # Arguments
8601    ///
8602    /// * `name` - Variable name
8603    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8604        let mut query = self.selection.select("exists");
8605        query = query.arg("name", name.into());
8606        query.execute(self.graphql_client.clone()).await
8607    }
8608    /// Return as a file
8609    pub fn as_file(&self) -> File {
8610        let query = self.selection.select("asFile");
8611        File {
8612            proc: self.proc.clone(),
8613            selection: query,
8614            graphql_client: self.graphql_client.clone(),
8615        }
8616    }
8617    /// 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
8618    ///
8619    /// # Arguments
8620    ///
8621    /// * `prefix` - The prefix to filter by
8622    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8623        let mut query = self.selection.select("namespace");
8624        query = query.arg("prefix", prefix.into());
8625        EnvFile {
8626            proc: self.proc.clone(),
8627            selection: query,
8628            graphql_client: self.graphql_client.clone(),
8629        }
8630    }
8631}
8632impl Node for EnvFile {
8633    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8634        let query = self.selection.select("id");
8635        let graphql_client = self.graphql_client.clone();
8636        async move { query.execute(graphql_client).await }
8637    }
8638}
8639#[derive(Clone)]
8640pub struct EnvVariable {
8641    pub proc: Option<Arc<DaggerSessionProc>>,
8642    pub selection: Selection,
8643    pub graphql_client: DynGraphQLClient,
8644}
8645impl IntoID<Id> for EnvVariable {
8646    fn into_id(
8647        self,
8648    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8649        Box::pin(async move { self.id().await })
8650    }
8651}
8652impl Loadable for EnvVariable {
8653    fn graphql_type() -> &'static str {
8654        "EnvVariable"
8655    }
8656    fn from_query(
8657        proc: Option<Arc<DaggerSessionProc>>,
8658        selection: Selection,
8659        graphql_client: DynGraphQLClient,
8660    ) -> Self {
8661        Self {
8662            proc,
8663            selection,
8664            graphql_client,
8665        }
8666    }
8667}
8668impl EnvVariable {
8669    /// A unique identifier for this EnvVariable.
8670    pub async fn id(&self) -> Result<Id, DaggerError> {
8671        let query = self.selection.select("id");
8672        query.execute(self.graphql_client.clone()).await
8673    }
8674    /// The environment variable name.
8675    pub async fn name(&self) -> Result<String, DaggerError> {
8676        let query = self.selection.select("name");
8677        query.execute(self.graphql_client.clone()).await
8678    }
8679    /// The environment variable value.
8680    pub async fn value(&self) -> Result<String, DaggerError> {
8681        let query = self.selection.select("value");
8682        query.execute(self.graphql_client.clone()).await
8683    }
8684}
8685impl Node for EnvVariable {
8686    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8687        let query = self.selection.select("id");
8688        let graphql_client = self.graphql_client.clone();
8689        async move { query.execute(graphql_client).await }
8690    }
8691}
8692#[derive(Clone)]
8693pub struct Error {
8694    pub proc: Option<Arc<DaggerSessionProc>>,
8695    pub selection: Selection,
8696    pub graphql_client: DynGraphQLClient,
8697}
8698impl IntoID<Id> for Error {
8699    fn into_id(
8700        self,
8701    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8702        Box::pin(async move { self.id().await })
8703    }
8704}
8705impl Loadable for Error {
8706    fn graphql_type() -> &'static str {
8707        "Error"
8708    }
8709    fn from_query(
8710        proc: Option<Arc<DaggerSessionProc>>,
8711        selection: Selection,
8712        graphql_client: DynGraphQLClient,
8713    ) -> Self {
8714        Self {
8715            proc,
8716            selection,
8717            graphql_client,
8718        }
8719    }
8720}
8721impl Error {
8722    /// A unique identifier for this Error.
8723    pub async fn id(&self) -> Result<Id, DaggerError> {
8724        let query = self.selection.select("id");
8725        query.execute(self.graphql_client.clone()).await
8726    }
8727    /// Add a value to the error.
8728    ///
8729    /// # Arguments
8730    ///
8731    /// * `name` - The name of the value.
8732    /// * `value` - The value to store on the error.
8733    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8734        let mut query = self.selection.select("withValue");
8735        query = query.arg("name", name.into());
8736        query = query.arg("value", value);
8737        Error {
8738            proc: self.proc.clone(),
8739            selection: query,
8740            graphql_client: self.graphql_client.clone(),
8741        }
8742    }
8743    /// A description of the error.
8744    pub async fn message(&self) -> Result<String, DaggerError> {
8745        let query = self.selection.select("message");
8746        query.execute(self.graphql_client.clone()).await
8747    }
8748    /// The extensions of the error.
8749    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8750        let query = self.selection.select("values");
8751        let query = query.select("id");
8752        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8753        Ok(ids
8754            .into_iter()
8755            .map(|id| ErrorValue {
8756                proc: self.proc.clone(),
8757                selection: crate::querybuilder::query()
8758                    .select("node")
8759                    .arg("id", &id.0)
8760                    .inline_fragment("ErrorValue"),
8761                graphql_client: self.graphql_client.clone(),
8762            })
8763            .collect())
8764    }
8765}
8766impl Node for Error {
8767    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8768        let query = self.selection.select("id");
8769        let graphql_client = self.graphql_client.clone();
8770        async move { query.execute(graphql_client).await }
8771    }
8772}
8773#[derive(Clone)]
8774pub struct ErrorValue {
8775    pub proc: Option<Arc<DaggerSessionProc>>,
8776    pub selection: Selection,
8777    pub graphql_client: DynGraphQLClient,
8778}
8779impl IntoID<Id> for ErrorValue {
8780    fn into_id(
8781        self,
8782    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8783        Box::pin(async move { self.id().await })
8784    }
8785}
8786impl Loadable for ErrorValue {
8787    fn graphql_type() -> &'static str {
8788        "ErrorValue"
8789    }
8790    fn from_query(
8791        proc: Option<Arc<DaggerSessionProc>>,
8792        selection: Selection,
8793        graphql_client: DynGraphQLClient,
8794    ) -> Self {
8795        Self {
8796            proc,
8797            selection,
8798            graphql_client,
8799        }
8800    }
8801}
8802impl ErrorValue {
8803    /// A unique identifier for this ErrorValue.
8804    pub async fn id(&self) -> Result<Id, DaggerError> {
8805        let query = self.selection.select("id");
8806        query.execute(self.graphql_client.clone()).await
8807    }
8808    /// The name of the value.
8809    pub async fn name(&self) -> Result<String, DaggerError> {
8810        let query = self.selection.select("name");
8811        query.execute(self.graphql_client.clone()).await
8812    }
8813    /// The value.
8814    pub async fn value(&self) -> Result<Json, DaggerError> {
8815        let query = self.selection.select("value");
8816        query.execute(self.graphql_client.clone()).await
8817    }
8818}
8819impl Node for ErrorValue {
8820    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8821        let query = self.selection.select("id");
8822        let graphql_client = self.graphql_client.clone();
8823        async move { query.execute(graphql_client).await }
8824    }
8825}
8826#[derive(Clone)]
8827pub struct Expertise {
8828    pub proc: Option<Arc<DaggerSessionProc>>,
8829    pub selection: Selection,
8830    pub graphql_client: DynGraphQLClient,
8831}
8832impl IntoID<Id> for Expertise {
8833    fn into_id(
8834        self,
8835    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8836        Box::pin(async move { self.id().await })
8837    }
8838}
8839impl Loadable for Expertise {
8840    fn graphql_type() -> &'static str {
8841        "Expertise"
8842    }
8843    fn from_query(
8844        proc: Option<Arc<DaggerSessionProc>>,
8845        selection: Selection,
8846        graphql_client: DynGraphQLClient,
8847    ) -> Self {
8848        Self {
8849            proc,
8850            selection,
8851            graphql_client,
8852        }
8853    }
8854}
8855impl Expertise {
8856    /// A unique identifier for this Expertise.
8857    pub async fn id(&self) -> Result<Id, DaggerError> {
8858        let query = self.selection.select("id");
8859        query.execute(self.graphql_client.clone()).await
8860    }
8861    /// The artifact this expertise runs. Look it up again by URI to pick up module changes.
8862    pub fn artifact(&self) -> Artifact {
8863        let query = self.selection.select("artifact");
8864        Artifact {
8865            proc: self.proc.clone(),
8866            selection: query,
8867            graphql_client: self.graphql_client.clone(),
8868        }
8869    }
8870    /// The function's name.
8871    pub async fn name(&self) -> Result<String, DaggerError> {
8872        let query = self.selection.select("name");
8873        query.execute(self.graphql_client.clone()).await
8874    }
8875    /// The function's description.
8876    pub async fn description(&self) -> Result<String, DaggerError> {
8877        let query = self.selection.select("description");
8878        query.execute(self.graphql_client.clone()).await
8879    }
8880    /// The function's path within its module.
8881    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8882        let query = self.selection.select("path");
8883        query.execute(self.graphql_client.clone()).await
8884    }
8885    /// The module that defines the function.
8886    pub fn original_module(&self) -> Module {
8887        let query = self.selection.select("originalModule");
8888        Module {
8889            proc: self.proc.clone(),
8890            selection: query,
8891            graphql_client: self.graphql_client.clone(),
8892        }
8893    }
8894}
8895impl Node for Expertise {
8896    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8897        let query = self.selection.select("id");
8898        let graphql_client = self.graphql_client.clone();
8899        async move { query.execute(graphql_client).await }
8900    }
8901}
8902#[derive(Clone)]
8903pub struct FieldTypeDef {
8904    pub proc: Option<Arc<DaggerSessionProc>>,
8905    pub selection: Selection,
8906    pub graphql_client: DynGraphQLClient,
8907}
8908impl IntoID<Id> for FieldTypeDef {
8909    fn into_id(
8910        self,
8911    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8912        Box::pin(async move { self.id().await })
8913    }
8914}
8915impl Loadable for FieldTypeDef {
8916    fn graphql_type() -> &'static str {
8917        "FieldTypeDef"
8918    }
8919    fn from_query(
8920        proc: Option<Arc<DaggerSessionProc>>,
8921        selection: Selection,
8922        graphql_client: DynGraphQLClient,
8923    ) -> Self {
8924        Self {
8925            proc,
8926            selection,
8927            graphql_client,
8928        }
8929    }
8930}
8931impl FieldTypeDef {
8932    /// A unique identifier for this FieldTypeDef.
8933    pub async fn id(&self) -> Result<Id, DaggerError> {
8934        let query = self.selection.select("id");
8935        query.execute(self.graphql_client.clone()).await
8936    }
8937    /// The type of the field.
8938    pub fn type_def(&self) -> TypeDef {
8939        let query = self.selection.select("typeDef");
8940        TypeDef {
8941            proc: self.proc.clone(),
8942            selection: query,
8943            graphql_client: self.graphql_client.clone(),
8944        }
8945    }
8946    /// The name of the field in lowerCamelCase format.
8947    pub async fn name(&self) -> Result<String, DaggerError> {
8948        let query = self.selection.select("name");
8949        query.execute(self.graphql_client.clone()).await
8950    }
8951    /// A doc string for the field, if any.
8952    pub async fn description(&self) -> Result<String, DaggerError> {
8953        let query = self.selection.select("description");
8954        query.execute(self.graphql_client.clone()).await
8955    }
8956    /// The location of this field declaration.
8957    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8958        let query = self.selection.select("sourceMap");
8959        let query = query.select("id");
8960        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8961        Ok(id.map(|id| SourceMap {
8962            proc: self.proc.clone(),
8963            selection: query
8964                .root()
8965                .select("node")
8966                .arg("id", &id.0)
8967                .inline_fragment("SourceMap"),
8968            graphql_client: self.graphql_client.clone(),
8969        }))
8970    }
8971    /// The reason this enum member is deprecated, if any.
8972    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8973        let query = self.selection.select("deprecated");
8974        query.execute(self.graphql_client.clone()).await
8975    }
8976}
8977impl Node for FieldTypeDef {
8978    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8979        let query = self.selection.select("id");
8980        let graphql_client = self.graphql_client.clone();
8981        async move { query.execute(graphql_client).await }
8982    }
8983}
8984#[derive(Clone)]
8985pub struct File {
8986    pub proc: Option<Arc<DaggerSessionProc>>,
8987    pub selection: Selection,
8988    pub graphql_client: DynGraphQLClient,
8989}
8990#[derive(Builder, Debug, PartialEq)]
8991pub struct FileContentsOpts {
8992    /// Maximum number of lines to read
8993    #[builder(setter(into, strip_option), default)]
8994    pub limit_lines: Option<isize>,
8995    /// Start reading after this line
8996    #[builder(setter(into, strip_option), default)]
8997    pub offset_lines: Option<isize>,
8998}
8999#[derive(Builder, Debug, PartialEq)]
9000pub struct FileDigestOpts {
9001    /// If true, exclude metadata from the digest.
9002    #[builder(setter(into, strip_option), default)]
9003    pub exclude_metadata: Option<bool>,
9004}
9005#[derive(Builder, Debug, PartialEq)]
9006pub struct FileSearchOpts<'a> {
9007    /// Allow the . pattern to match newlines in multiline mode.
9008    #[builder(setter(into, strip_option), default)]
9009    pub dotall: Option<bool>,
9010    /// Only return matching files, not lines and content
9011    #[builder(setter(into, strip_option), default)]
9012    pub files_only: Option<bool>,
9013    #[builder(setter(into, strip_option), default)]
9014    pub globs: Option<Vec<&'a str>>,
9015    /// Enable case-insensitive matching.
9016    #[builder(setter(into, strip_option), default)]
9017    pub insensitive: Option<bool>,
9018    /// Limit the number of results to return
9019    #[builder(setter(into, strip_option), default)]
9020    pub limit: Option<isize>,
9021    /// Interpret the pattern as a literal string instead of a regular expression.
9022    #[builder(setter(into, strip_option), default)]
9023    pub literal: Option<bool>,
9024    /// Enable searching across multiple lines.
9025    #[builder(setter(into, strip_option), default)]
9026    pub multiline: Option<bool>,
9027    #[builder(setter(into, strip_option), default)]
9028    pub paths: Option<Vec<&'a str>>,
9029    /// Skip hidden files (files starting with .).
9030    #[builder(setter(into, strip_option), default)]
9031    pub skip_hidden: Option<bool>,
9032    /// Honor .gitignore, .ignore, and .rgignore files.
9033    #[builder(setter(into, strip_option), default)]
9034    pub skip_ignored: Option<bool>,
9035}
9036#[derive(Builder, Debug, PartialEq)]
9037pub struct FileWithReplacedOpts {
9038    /// Replace all occurrences of the pattern.
9039    #[builder(setter(into, strip_option), default)]
9040    pub all: Option<bool>,
9041    /// Replace the first match starting from the specified line.
9042    #[builder(setter(into, strip_option), default)]
9043    pub first_from: Option<isize>,
9044}
9045#[derive(Builder, Debug, PartialEq)]
9046pub struct FileExportOpts {
9047    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
9048    #[builder(setter(into, strip_option), default)]
9049    pub allow_parent_dir_path: Option<bool>,
9050}
9051#[derive(Builder, Debug, PartialEq)]
9052pub struct FileAsEnvFileOpts {
9053    /// Replace "${VAR}" or "$VAR" with the value of other vars
9054    #[builder(setter(into, strip_option), default)]
9055    pub expand: Option<bool>,
9056}
9057impl IntoID<Id> for File {
9058    fn into_id(
9059        self,
9060    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9061        Box::pin(async move { self.id().await })
9062    }
9063}
9064impl Loadable for File {
9065    fn graphql_type() -> &'static str {
9066        "File"
9067    }
9068    fn from_query(
9069        proc: Option<Arc<DaggerSessionProc>>,
9070        selection: Selection,
9071        graphql_client: DynGraphQLClient,
9072    ) -> Self {
9073        Self {
9074            proc,
9075            selection,
9076            graphql_client,
9077        }
9078    }
9079}
9080impl File {
9081    /// A unique identifier for this File.
9082    pub async fn id(&self) -> Result<Id, DaggerError> {
9083        let query = self.selection.select("id");
9084        query.execute(self.graphql_client.clone()).await
9085    }
9086    /// Force evaluation in the engine.
9087    pub async fn sync(&self) -> Result<File, DaggerError> {
9088        let query = self.selection.select("sync");
9089        let id: Id = query.execute(self.graphql_client.clone()).await?;
9090        Ok(File {
9091            proc: self.proc.clone(),
9092            selection: query
9093                .root()
9094                .select("node")
9095                .arg("id", &id.0)
9096                .inline_fragment("File"),
9097            graphql_client: self.graphql_client.clone(),
9098        })
9099    }
9100    /// Retrieves the contents of the file.
9101    ///
9102    /// # Arguments
9103    ///
9104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9105    pub async fn contents(&self) -> Result<String, DaggerError> {
9106        let query = self.selection.select("contents");
9107        query.execute(self.graphql_client.clone()).await
9108    }
9109    /// Retrieves the contents of the file.
9110    ///
9111    /// # Arguments
9112    ///
9113    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9114    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9115        let mut query = self.selection.select("contents");
9116        if let Some(offset_lines) = opts.offset_lines {
9117            query = query.arg("offsetLines", offset_lines);
9118        }
9119        if let Some(limit_lines) = opts.limit_lines {
9120            query = query.arg("limitLines", limit_lines);
9121        }
9122        query.execute(self.graphql_client.clone()).await
9123    }
9124    /// Retrieves the size of the file, in bytes.
9125    pub async fn size(&self) -> Result<isize, DaggerError> {
9126        let query = self.selection.select("size");
9127        query.execute(self.graphql_client.clone()).await
9128    }
9129    /// Retrieves the name of the file.
9130    pub async fn name(&self) -> Result<String, DaggerError> {
9131        let query = self.selection.select("name");
9132        query.execute(self.graphql_client.clone()).await
9133    }
9134    /// Return file status
9135    pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
9136        let query = self.selection.select("stat");
9137        let query = query.select("id");
9138        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9139        Ok(id.map(|id| Stat {
9140            proc: self.proc.clone(),
9141            selection: query
9142                .root()
9143                .select("node")
9144                .arg("id", &id.0)
9145                .inline_fragment("Stat"),
9146            graphql_client: self.graphql_client.clone(),
9147        }))
9148    }
9149    /// 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.
9150    ///
9151    /// # Arguments
9152    ///
9153    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9154    pub async fn digest(&self) -> Result<String, DaggerError> {
9155        let query = self.selection.select("digest");
9156        query.execute(self.graphql_client.clone()).await
9157    }
9158    /// 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.
9159    ///
9160    /// # Arguments
9161    ///
9162    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9163    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9164        let mut query = self.selection.select("digest");
9165        if let Some(exclude_metadata) = opts.exclude_metadata {
9166            query = query.arg("excludeMetadata", exclude_metadata);
9167        }
9168        query.execute(self.graphql_client.clone()).await
9169    }
9170    /// Retrieves this file with its name set to the given name.
9171    ///
9172    /// # Arguments
9173    ///
9174    /// * `name` - Name to set file to.
9175    pub fn with_name(&self, name: impl Into<String>) -> File {
9176        let mut query = self.selection.select("withName");
9177        query = query.arg("name", name.into());
9178        File {
9179            proc: self.proc.clone(),
9180            selection: query,
9181            graphql_client: self.graphql_client.clone(),
9182        }
9183    }
9184    /// Searches for content matching the given regular expression or literal string.
9185    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9186    ///
9187    /// # Arguments
9188    ///
9189    /// * `pattern` - The text to match.
9190    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9191    pub async fn search(
9192        &self,
9193        pattern: impl Into<String>,
9194    ) -> Result<Vec<SearchResult>, DaggerError> {
9195        let mut query = self.selection.select("search");
9196        query = query.arg("pattern", pattern.into());
9197        let query = query.select("id");
9198        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9199        Ok(ids
9200            .into_iter()
9201            .map(|id| SearchResult {
9202                proc: self.proc.clone(),
9203                selection: crate::querybuilder::query()
9204                    .select("node")
9205                    .arg("id", &id.0)
9206                    .inline_fragment("SearchResult"),
9207                graphql_client: self.graphql_client.clone(),
9208            })
9209            .collect())
9210    }
9211    /// Searches for content matching the given regular expression or literal string.
9212    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9213    ///
9214    /// # Arguments
9215    ///
9216    /// * `pattern` - The text to match.
9217    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9218    pub async fn search_opts<'a>(
9219        &self,
9220        pattern: impl Into<String>,
9221        opts: FileSearchOpts<'a>,
9222    ) -> Result<Vec<SearchResult>, DaggerError> {
9223        let mut query = self.selection.select("search");
9224        query = query.arg("pattern", pattern.into());
9225        if let Some(literal) = opts.literal {
9226            query = query.arg("literal", literal);
9227        }
9228        if let Some(multiline) = opts.multiline {
9229            query = query.arg("multiline", multiline);
9230        }
9231        if let Some(dotall) = opts.dotall {
9232            query = query.arg("dotall", dotall);
9233        }
9234        if let Some(insensitive) = opts.insensitive {
9235            query = query.arg("insensitive", insensitive);
9236        }
9237        if let Some(skip_ignored) = opts.skip_ignored {
9238            query = query.arg("skipIgnored", skip_ignored);
9239        }
9240        if let Some(skip_hidden) = opts.skip_hidden {
9241            query = query.arg("skipHidden", skip_hidden);
9242        }
9243        if let Some(files_only) = opts.files_only {
9244            query = query.arg("filesOnly", files_only);
9245        }
9246        if let Some(limit) = opts.limit {
9247            query = query.arg("limit", limit);
9248        }
9249        if let Some(paths) = opts.paths {
9250            query = query.arg("paths", paths);
9251        }
9252        if let Some(globs) = opts.globs {
9253            query = query.arg("globs", globs);
9254        }
9255        let query = query.select("id");
9256        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9257        Ok(ids
9258            .into_iter()
9259            .map(|id| SearchResult {
9260                proc: self.proc.clone(),
9261                selection: crate::querybuilder::query()
9262                    .select("node")
9263                    .arg("id", &id.0)
9264                    .inline_fragment("SearchResult"),
9265                graphql_client: self.graphql_client.clone(),
9266            })
9267            .collect())
9268    }
9269    /// Retrieves the file with content replaced with the given text.
9270    /// If 'all' is true, all occurrences of the pattern will be replaced.
9271    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9272    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9273    /// If there are no matches for the pattern, this will error.
9274    ///
9275    /// # Arguments
9276    ///
9277    /// * `search` - The text to match.
9278    /// * `replacement` - The text to match.
9279    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9280    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9281        let mut query = self.selection.select("withReplaced");
9282        query = query.arg("search", search.into());
9283        query = query.arg("replacement", replacement.into());
9284        File {
9285            proc: self.proc.clone(),
9286            selection: query,
9287            graphql_client: self.graphql_client.clone(),
9288        }
9289    }
9290    /// Retrieves the file with content replaced with the given text.
9291    /// If 'all' is true, all occurrences of the pattern will be replaced.
9292    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9293    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9294    /// If there are no matches for the pattern, this will error.
9295    ///
9296    /// # Arguments
9297    ///
9298    /// * `search` - The text to match.
9299    /// * `replacement` - The text to match.
9300    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9301    pub fn with_replaced_opts(
9302        &self,
9303        search: impl Into<String>,
9304        replacement: impl Into<String>,
9305        opts: FileWithReplacedOpts,
9306    ) -> File {
9307        let mut query = self.selection.select("withReplaced");
9308        query = query.arg("search", search.into());
9309        query = query.arg("replacement", replacement.into());
9310        if let Some(all) = opts.all {
9311            query = query.arg("all", all);
9312        }
9313        if let Some(first_from) = opts.first_from {
9314            query = query.arg("firstFrom", first_from);
9315        }
9316        File {
9317            proc: self.proc.clone(),
9318            selection: query,
9319            graphql_client: self.graphql_client.clone(),
9320        }
9321    }
9322    /// Writes the file to a file path on the host.
9323    ///
9324    /// # Arguments
9325    ///
9326    /// * `path` - Location of the written directory (e.g., "output.txt").
9327    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9328    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9329        let mut query = self.selection.select("export");
9330        query = query.arg("path", path.into());
9331        query.execute(self.graphql_client.clone()).await
9332    }
9333    /// Writes the file to a file path on the host.
9334    ///
9335    /// # Arguments
9336    ///
9337    /// * `path` - Location of the written directory (e.g., "output.txt").
9338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9339    pub async fn export_opts(
9340        &self,
9341        path: impl Into<String>,
9342        opts: FileExportOpts,
9343    ) -> Result<String, DaggerError> {
9344        let mut query = self.selection.select("export");
9345        query = query.arg("path", path.into());
9346        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9347            query = query.arg("allowParentDirPath", allow_parent_dir_path);
9348        }
9349        query.execute(self.graphql_client.clone()).await
9350    }
9351    /// Retrieves this file with its created/modified timestamps set to the given time.
9352    ///
9353    /// # Arguments
9354    ///
9355    /// * `timestamp` - Timestamp to set dir/files in.
9356    ///
9357    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9358    pub fn with_timestamps(&self, timestamp: isize) -> File {
9359        let mut query = self.selection.select("withTimestamps");
9360        query = query.arg("timestamp", timestamp);
9361        File {
9362            proc: self.proc.clone(),
9363            selection: query,
9364            graphql_client: self.graphql_client.clone(),
9365        }
9366    }
9367    /// Change the owner of the file recursively.
9368    ///
9369    /// # Arguments
9370    ///
9371    /// * `owner` - A user:group to set for the file.
9372    ///
9373    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
9374    ///
9375    /// If the group is omitted, it defaults to the same as the user.
9376    pub fn chown(&self, owner: impl Into<String>) -> File {
9377        let mut query = self.selection.select("chown");
9378        query = query.arg("owner", owner.into());
9379        File {
9380            proc: self.proc.clone(),
9381            selection: query,
9382            graphql_client: self.graphql_client.clone(),
9383        }
9384    }
9385    /// Interpret this file as a Git bundle by lazily parsing its header.
9386    pub fn as_git_bundle(&self) -> GitBundle {
9387        let query = self.selection.select("asGitBundle");
9388        GitBundle {
9389            proc: self.proc.clone(),
9390            selection: query,
9391            graphql_client: self.graphql_client.clone(),
9392        }
9393    }
9394    /// Parse the file contents as JSON.
9395    pub fn as_json(&self) -> JsonValue {
9396        let query = self.selection.select("asJSON");
9397        JsonValue {
9398            proc: self.proc.clone(),
9399            selection: query,
9400            graphql_client: self.graphql_client.clone(),
9401        }
9402    }
9403    /// Parse as an env file
9404    ///
9405    /// # Arguments
9406    ///
9407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9408    pub fn as_env_file(&self) -> EnvFile {
9409        let query = self.selection.select("asEnvFile");
9410        EnvFile {
9411            proc: self.proc.clone(),
9412            selection: query,
9413            graphql_client: self.graphql_client.clone(),
9414        }
9415    }
9416    /// Parse as an env file
9417    ///
9418    /// # Arguments
9419    ///
9420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9421    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9422        let mut query = self.selection.select("asEnvFile");
9423        if let Some(expand) = opts.expand {
9424            query = query.arg("expand", expand);
9425        }
9426        EnvFile {
9427            proc: self.proc.clone(),
9428            selection: query,
9429            graphql_client: self.graphql_client.clone(),
9430        }
9431    }
9432}
9433impl Exportable for File {
9434    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9435        let query = self.selection.select("id");
9436        let graphql_client = self.graphql_client.clone();
9437        async move { query.execute(graphql_client).await }
9438    }
9439    fn export(
9440        &self,
9441        path: impl Into<String>,
9442    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9443        let mut query = self.selection.select("export");
9444        query = query.arg("path", path.into());
9445        let graphql_client = self.graphql_client.clone();
9446        async move { query.execute(graphql_client).await }
9447    }
9448}
9449impl Node for File {
9450    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9451        let query = self.selection.select("id");
9452        let graphql_client = self.graphql_client.clone();
9453        async move { query.execute(graphql_client).await }
9454    }
9455}
9456impl Syncer for File {
9457    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9458        let query = self.selection.select("id");
9459        let graphql_client = self.graphql_client.clone();
9460        async move { query.execute(graphql_client).await }
9461    }
9462    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
9463        let query = self.selection.select("sync");
9464        let proc = self.proc.clone();
9465        let graphql_client = self.graphql_client.clone();
9466        async move {
9467            let id: Id = query.execute(graphql_client.clone()).await?;
9468            Ok(Self {
9469                proc,
9470                selection: query
9471                    .root()
9472                    .select("node")
9473                    .arg("id", &id.0)
9474                    .inline_fragment("File"),
9475                graphql_client,
9476            })
9477        }
9478    }
9479}
9480#[derive(Clone)]
9481pub struct Function {
9482    pub proc: Option<Arc<DaggerSessionProc>>,
9483    pub selection: Selection,
9484    pub graphql_client: DynGraphQLClient,
9485}
9486#[derive(Builder, Debug, PartialEq)]
9487pub struct FunctionWithDeprecatedOpts<'a> {
9488    /// Reason or migration path describing the deprecation.
9489    #[builder(setter(into, strip_option), default)]
9490    pub reason: Option<&'a str>,
9491}
9492#[derive(Builder, Debug, PartialEq)]
9493pub struct FunctionWithArgOpts<'a> {
9494    #[builder(setter(into, strip_option), default)]
9495    pub default_address: Option<&'a str>,
9496    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9497    #[builder(setter(into, strip_option), default)]
9498    pub default_path: Option<&'a str>,
9499    /// A default value to use for this argument if not explicitly set by the caller, if any
9500    #[builder(setter(into, strip_option), default)]
9501    pub default_value: Option<Json>,
9502    /// If deprecated, the reason or migration path.
9503    #[builder(setter(into, strip_option), default)]
9504    pub deprecated: Option<&'a str>,
9505    /// A doc string for the argument, if any
9506    #[builder(setter(into, strip_option), default)]
9507    pub description: Option<&'a str>,
9508    /// Patterns to ignore when loading the contextual argument value.
9509    #[builder(setter(into, strip_option), default)]
9510    pub ignore: Option<Vec<&'a str>>,
9511    /// The source map for the argument definition.
9512    #[builder(setter(into, strip_option), default)]
9513    pub source_map: Option<Id>,
9514}
9515#[derive(Builder, Debug, PartialEq)]
9516pub struct FunctionWithCachePolicyOpts<'a> {
9517    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9518    #[builder(setter(into, strip_option), default)]
9519    pub time_to_live: Option<&'a str>,
9520}
9521impl IntoID<Id> for Function {
9522    fn into_id(
9523        self,
9524    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9525        Box::pin(async move { self.id().await })
9526    }
9527}
9528impl Loadable for Function {
9529    fn graphql_type() -> &'static str {
9530        "Function"
9531    }
9532    fn from_query(
9533        proc: Option<Arc<DaggerSessionProc>>,
9534        selection: Selection,
9535        graphql_client: DynGraphQLClient,
9536    ) -> Self {
9537        Self {
9538            proc,
9539            selection,
9540            graphql_client,
9541        }
9542    }
9543}
9544impl Function {
9545    /// A unique identifier for this Function.
9546    pub async fn id(&self) -> Result<Id, DaggerError> {
9547        let query = self.selection.select("id");
9548        query.execute(self.graphql_client.clone()).await
9549    }
9550    /// Returns the function with the given doc string.
9551    ///
9552    /// # Arguments
9553    ///
9554    /// * `description` - The doc string to set.
9555    pub fn with_description(&self, description: impl Into<String>) -> Function {
9556        let mut query = self.selection.select("withDescription");
9557        query = query.arg("description", description.into());
9558        Function {
9559            proc: self.proc.clone(),
9560            selection: query,
9561            graphql_client: self.graphql_client.clone(),
9562        }
9563    }
9564    /// Returns the function with the provided deprecation reason.
9565    ///
9566    /// # Arguments
9567    ///
9568    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9569    pub fn with_deprecated(&self) -> Function {
9570        let query = self.selection.select("withDeprecated");
9571        Function {
9572            proc: self.proc.clone(),
9573            selection: query,
9574            graphql_client: self.graphql_client.clone(),
9575        }
9576    }
9577    /// Returns the function with the provided deprecation reason.
9578    ///
9579    /// # Arguments
9580    ///
9581    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9582    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9583        let mut query = self.selection.select("withDeprecated");
9584        if let Some(reason) = opts.reason {
9585            query = query.arg("reason", reason);
9586        }
9587        Function {
9588            proc: self.proc.clone(),
9589            selection: query,
9590            graphql_client: self.graphql_client.clone(),
9591        }
9592    }
9593    /// Returns the function with a flag indicating it's a check.
9594    pub fn with_check(&self) -> Function {
9595        let query = self.selection.select("withCheck");
9596        Function {
9597            proc: self.proc.clone(),
9598            selection: query,
9599            graphql_client: self.graphql_client.clone(),
9600        }
9601    }
9602    /// Returns the function with a flag indicating it's a generator.
9603    pub fn with_generator(&self) -> Function {
9604        let query = self.selection.select("withGenerator");
9605        Function {
9606            proc: self.proc.clone(),
9607            selection: query,
9608            graphql_client: self.graphql_client.clone(),
9609        }
9610    }
9611    /// Returns the function with a flag indicating it returns a service for dagger up.
9612    pub fn with_up(&self) -> Function {
9613        let query = self.selection.select("withUp");
9614        Function {
9615            proc: self.proc.clone(),
9616            selection: query,
9617            graphql_client: self.graphql_client.clone(),
9618        }
9619    }
9620    /// Returns the function with a flag indicating it is a source of expertise.
9621    pub fn with_agent(&self) -> Function {
9622        let query = self.selection.select("withAgent");
9623        Function {
9624            proc: self.proc.clone(),
9625            selection: query,
9626            graphql_client: self.graphql_client.clone(),
9627        }
9628    }
9629    /// Returns the function with the given source map.
9630    ///
9631    /// # Arguments
9632    ///
9633    /// * `source_map` - The source map for the function definition.
9634    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9635        let mut query = self.selection.select("withSourceMap");
9636        query = query.arg_lazy(
9637            "sourceMap",
9638            Box::new(move || {
9639                let source_map = source_map.clone();
9640                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9641            }),
9642        );
9643        Function {
9644            proc: self.proc.clone(),
9645            selection: query,
9646            graphql_client: self.graphql_client.clone(),
9647        }
9648    }
9649    /// Returns the function with the provided argument
9650    ///
9651    /// # Arguments
9652    ///
9653    /// * `name` - The name of the argument
9654    /// * `type_def` - The type of the argument
9655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9656    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9657        let mut query = self.selection.select("withArg");
9658        query = query.arg("name", name.into());
9659        query = query.arg_lazy(
9660            "typeDef",
9661            Box::new(move || {
9662                let type_def = type_def.clone();
9663                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9664            }),
9665        );
9666        Function {
9667            proc: self.proc.clone(),
9668            selection: query,
9669            graphql_client: self.graphql_client.clone(),
9670        }
9671    }
9672    /// Returns the function with the provided argument
9673    ///
9674    /// # Arguments
9675    ///
9676    /// * `name` - The name of the argument
9677    /// * `type_def` - The type of the argument
9678    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9679    pub fn with_arg_opts<'a>(
9680        &self,
9681        name: impl Into<String>,
9682        type_def: impl IntoID<Id>,
9683        opts: FunctionWithArgOpts<'a>,
9684    ) -> Function {
9685        let mut query = self.selection.select("withArg");
9686        query = query.arg("name", name.into());
9687        query = query.arg_lazy(
9688            "typeDef",
9689            Box::new(move || {
9690                let type_def = type_def.clone();
9691                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9692            }),
9693        );
9694        if let Some(description) = opts.description {
9695            query = query.arg("description", description);
9696        }
9697        if let Some(default_value) = opts.default_value {
9698            query = query.arg("defaultValue", default_value);
9699        }
9700        if let Some(default_path) = opts.default_path {
9701            query = query.arg("defaultPath", default_path);
9702        }
9703        if let Some(ignore) = opts.ignore {
9704            query = query.arg("ignore", ignore);
9705        }
9706        if let Some(source_map) = opts.source_map {
9707            query = query.arg("sourceMap", source_map);
9708        }
9709        if let Some(deprecated) = opts.deprecated {
9710            query = query.arg("deprecated", deprecated);
9711        }
9712        if let Some(default_address) = opts.default_address {
9713            query = query.arg("defaultAddress", default_address);
9714        }
9715        Function {
9716            proc: self.proc.clone(),
9717            selection: query,
9718            graphql_client: self.graphql_client.clone(),
9719        }
9720    }
9721    /// Returns the function updated to use the provided cache policy.
9722    ///
9723    /// # Arguments
9724    ///
9725    /// * `policy` - The cache policy to use.
9726    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9727    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9728        let mut query = self.selection.select("withCachePolicy");
9729        query = query.arg("policy", policy);
9730        Function {
9731            proc: self.proc.clone(),
9732            selection: query,
9733            graphql_client: self.graphql_client.clone(),
9734        }
9735    }
9736    /// Returns the function updated to use the provided cache policy.
9737    ///
9738    /// # Arguments
9739    ///
9740    /// * `policy` - The cache policy to use.
9741    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9742    pub fn with_cache_policy_opts<'a>(
9743        &self,
9744        policy: FunctionCachePolicy,
9745        opts: FunctionWithCachePolicyOpts<'a>,
9746    ) -> Function {
9747        let mut query = self.selection.select("withCachePolicy");
9748        query = query.arg("policy", policy);
9749        if let Some(time_to_live) = opts.time_to_live {
9750            query = query.arg("timeToLive", time_to_live);
9751        }
9752        Function {
9753            proc: self.proc.clone(),
9754            selection: query,
9755            graphql_client: self.graphql_client.clone(),
9756        }
9757    }
9758    /// The name of the function.
9759    pub async fn name(&self) -> Result<String, DaggerError> {
9760        let query = self.selection.select("name");
9761        query.execute(self.graphql_client.clone()).await
9762    }
9763    /// A doc string for the function, if any.
9764    pub async fn description(&self) -> Result<String, DaggerError> {
9765        let query = self.selection.select("description");
9766        query.execute(self.graphql_client.clone()).await
9767    }
9768    /// The reason this function is deprecated, if any.
9769    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9770        let query = self.selection.select("deprecated");
9771        query.execute(self.graphql_client.clone()).await
9772    }
9773    /// The location of this function declaration.
9774    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9775        let query = self.selection.select("sourceMap");
9776        let query = query.select("id");
9777        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9778        Ok(id.map(|id| SourceMap {
9779            proc: self.proc.clone(),
9780            selection: query
9781                .root()
9782                .select("node")
9783                .arg("id", &id.0)
9784                .inline_fragment("SourceMap"),
9785            graphql_client: self.graphql_client.clone(),
9786        }))
9787    }
9788    /// If this function is provided by a module, the name of the module. Unset otherwise.
9789    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9790        let query = self.selection.select("sourceModuleName");
9791        query.execute(self.graphql_client.clone()).await
9792    }
9793    /// Arguments accepted by the function, if any.
9794    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9795        let query = self.selection.select("args");
9796        let query = query.select("id");
9797        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9798        Ok(ids
9799            .into_iter()
9800            .map(|id| FunctionArg {
9801                proc: self.proc.clone(),
9802                selection: crate::querybuilder::query()
9803                    .select("node")
9804                    .arg("id", &id.0)
9805                    .inline_fragment("FunctionArg"),
9806                graphql_client: self.graphql_client.clone(),
9807            })
9808            .collect())
9809    }
9810    /// The type returned by the function.
9811    pub fn return_type(&self) -> TypeDef {
9812        let query = self.selection.select("returnType");
9813        TypeDef {
9814            proc: self.proc.clone(),
9815            selection: query,
9816            graphql_client: self.graphql_client.clone(),
9817        }
9818    }
9819}
9820impl Node for Function {
9821    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9822        let query = self.selection.select("id");
9823        let graphql_client = self.graphql_client.clone();
9824        async move { query.execute(graphql_client).await }
9825    }
9826}
9827#[derive(Clone)]
9828pub struct FunctionArg {
9829    pub proc: Option<Arc<DaggerSessionProc>>,
9830    pub selection: Selection,
9831    pub graphql_client: DynGraphQLClient,
9832}
9833impl IntoID<Id> for FunctionArg {
9834    fn into_id(
9835        self,
9836    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9837        Box::pin(async move { self.id().await })
9838    }
9839}
9840impl Loadable for FunctionArg {
9841    fn graphql_type() -> &'static str {
9842        "FunctionArg"
9843    }
9844    fn from_query(
9845        proc: Option<Arc<DaggerSessionProc>>,
9846        selection: Selection,
9847        graphql_client: DynGraphQLClient,
9848    ) -> Self {
9849        Self {
9850            proc,
9851            selection,
9852            graphql_client,
9853        }
9854    }
9855}
9856impl FunctionArg {
9857    /// A unique identifier for this FunctionArg.
9858    pub async fn id(&self) -> Result<Id, DaggerError> {
9859        let query = self.selection.select("id");
9860        query.execute(self.graphql_client.clone()).await
9861    }
9862    /// The name of the argument in lowerCamelCase format.
9863    pub async fn name(&self) -> Result<String, DaggerError> {
9864        let query = self.selection.select("name");
9865        query.execute(self.graphql_client.clone()).await
9866    }
9867    /// A doc string for the argument, if any.
9868    pub async fn description(&self) -> Result<String, DaggerError> {
9869        let query = self.selection.select("description");
9870        query.execute(self.graphql_client.clone()).await
9871    }
9872    /// The location of this arg declaration.
9873    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9874        let query = self.selection.select("sourceMap");
9875        let query = query.select("id");
9876        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9877        Ok(id.map(|id| SourceMap {
9878            proc: self.proc.clone(),
9879            selection: query
9880                .root()
9881                .select("node")
9882                .arg("id", &id.0)
9883                .inline_fragment("SourceMap"),
9884            graphql_client: self.graphql_client.clone(),
9885        }))
9886    }
9887    /// A default value to use for this argument when not explicitly set by the caller, if any.
9888    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9889        let query = self.selection.select("defaultValue");
9890        query.execute(self.graphql_client.clone()).await
9891    }
9892    /// 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
9893    pub async fn default_path(&self) -> Result<String, DaggerError> {
9894        let query = self.selection.select("defaultPath");
9895        query.execute(self.graphql_client.clone()).await
9896    }
9897    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9898    pub async fn default_address(&self) -> Result<String, DaggerError> {
9899        let query = self.selection.select("defaultAddress");
9900        query.execute(self.graphql_client.clone()).await
9901    }
9902    /// 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.
9903    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9904        let query = self.selection.select("ignore");
9905        query.execute(self.graphql_client.clone()).await
9906    }
9907    /// The reason this function is deprecated, if any.
9908    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9909        let query = self.selection.select("deprecated");
9910        query.execute(self.graphql_client.clone()).await
9911    }
9912    /// The type of the argument.
9913    pub fn type_def(&self) -> TypeDef {
9914        let query = self.selection.select("typeDef");
9915        TypeDef {
9916            proc: self.proc.clone(),
9917            selection: query,
9918            graphql_client: self.graphql_client.clone(),
9919        }
9920    }
9921}
9922impl Node for FunctionArg {
9923    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9924        let query = self.selection.select("id");
9925        let graphql_client = self.graphql_client.clone();
9926        async move { query.execute(graphql_client).await }
9927    }
9928}
9929#[derive(Clone)]
9930pub struct FunctionCall {
9931    pub proc: Option<Arc<DaggerSessionProc>>,
9932    pub selection: Selection,
9933    pub graphql_client: DynGraphQLClient,
9934}
9935impl IntoID<Id> for FunctionCall {
9936    fn into_id(
9937        self,
9938    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9939        Box::pin(async move { self.id().await })
9940    }
9941}
9942impl Loadable for FunctionCall {
9943    fn graphql_type() -> &'static str {
9944        "FunctionCall"
9945    }
9946    fn from_query(
9947        proc: Option<Arc<DaggerSessionProc>>,
9948        selection: Selection,
9949        graphql_client: DynGraphQLClient,
9950    ) -> Self {
9951        Self {
9952            proc,
9953            selection,
9954            graphql_client,
9955        }
9956    }
9957}
9958impl FunctionCall {
9959    /// A unique identifier for this FunctionCall.
9960    pub async fn id(&self) -> Result<Id, DaggerError> {
9961        let query = self.selection.select("id");
9962        query.execute(self.graphql_client.clone()).await
9963    }
9964    /// Set the return value of the function call to the provided value.
9965    ///
9966    /// # Arguments
9967    ///
9968    /// * `value` - JSON serialization of the return value.
9969    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9970        let mut query = self.selection.select("returnValue");
9971        query = query.arg("value", value);
9972        query.execute(self.graphql_client.clone()).await
9973    }
9974    /// Return an error from the function.
9975    ///
9976    /// # Arguments
9977    ///
9978    /// * `error` - The error to return.
9979    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9980        let mut query = self.selection.select("returnError");
9981        query = query.arg_lazy(
9982            "error",
9983            Box::new(move || {
9984                let error = error.clone();
9985                Box::pin(async move { error.into_id().await.unwrap().quote() })
9986            }),
9987        );
9988        query.execute(self.graphql_client.clone()).await
9989    }
9990    /// The name of the function being called.
9991    pub async fn name(&self) -> Result<String, DaggerError> {
9992        let query = self.selection.select("name");
9993        query.execute(self.graphql_client.clone()).await
9994    }
9995    /// 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.
9996    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9997        let query = self.selection.select("parentName");
9998        query.execute(self.graphql_client.clone()).await
9999    }
10000    /// 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.
10001    pub async fn parent(&self) -> Result<Json, DaggerError> {
10002        let query = self.selection.select("parent");
10003        query.execute(self.graphql_client.clone()).await
10004    }
10005    /// The argument values the function is being invoked with.
10006    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
10007        let query = self.selection.select("inputArgs");
10008        let query = query.select("id");
10009        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10010        Ok(ids
10011            .into_iter()
10012            .map(|id| FunctionCallArgValue {
10013                proc: self.proc.clone(),
10014                selection: crate::querybuilder::query()
10015                    .select("node")
10016                    .arg("id", &id.0)
10017                    .inline_fragment("FunctionCallArgValue"),
10018                graphql_client: self.graphql_client.clone(),
10019            })
10020            .collect())
10021    }
10022}
10023impl Node for FunctionCall {
10024    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10025        let query = self.selection.select("id");
10026        let graphql_client = self.graphql_client.clone();
10027        async move { query.execute(graphql_client).await }
10028    }
10029}
10030#[derive(Clone)]
10031pub struct FunctionCallArgValue {
10032    pub proc: Option<Arc<DaggerSessionProc>>,
10033    pub selection: Selection,
10034    pub graphql_client: DynGraphQLClient,
10035}
10036impl IntoID<Id> for FunctionCallArgValue {
10037    fn into_id(
10038        self,
10039    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10040        Box::pin(async move { self.id().await })
10041    }
10042}
10043impl Loadable for FunctionCallArgValue {
10044    fn graphql_type() -> &'static str {
10045        "FunctionCallArgValue"
10046    }
10047    fn from_query(
10048        proc: Option<Arc<DaggerSessionProc>>,
10049        selection: Selection,
10050        graphql_client: DynGraphQLClient,
10051    ) -> Self {
10052        Self {
10053            proc,
10054            selection,
10055            graphql_client,
10056        }
10057    }
10058}
10059impl FunctionCallArgValue {
10060    /// A unique identifier for this FunctionCallArgValue.
10061    pub async fn id(&self) -> Result<Id, DaggerError> {
10062        let query = self.selection.select("id");
10063        query.execute(self.graphql_client.clone()).await
10064    }
10065    /// The name of the argument.
10066    pub async fn name(&self) -> Result<String, DaggerError> {
10067        let query = self.selection.select("name");
10068        query.execute(self.graphql_client.clone()).await
10069    }
10070    /// The value of the argument represented as a JSON serialized string.
10071    pub async fn value(&self) -> Result<Json, DaggerError> {
10072        let query = self.selection.select("value");
10073        query.execute(self.graphql_client.clone()).await
10074    }
10075}
10076impl Node for FunctionCallArgValue {
10077    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10078        let query = self.selection.select("id");
10079        let graphql_client = self.graphql_client.clone();
10080        async move { query.execute(graphql_client).await }
10081    }
10082}
10083#[derive(Clone)]
10084pub struct GeneratedCode {
10085    pub proc: Option<Arc<DaggerSessionProc>>,
10086    pub selection: Selection,
10087    pub graphql_client: DynGraphQLClient,
10088}
10089impl IntoID<Id> for GeneratedCode {
10090    fn into_id(
10091        self,
10092    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10093        Box::pin(async move { self.id().await })
10094    }
10095}
10096impl Loadable for GeneratedCode {
10097    fn graphql_type() -> &'static str {
10098        "GeneratedCode"
10099    }
10100    fn from_query(
10101        proc: Option<Arc<DaggerSessionProc>>,
10102        selection: Selection,
10103        graphql_client: DynGraphQLClient,
10104    ) -> Self {
10105        Self {
10106            proc,
10107            selection,
10108            graphql_client,
10109        }
10110    }
10111}
10112impl GeneratedCode {
10113    /// A unique identifier for this GeneratedCode.
10114    pub async fn id(&self) -> Result<Id, DaggerError> {
10115        let query = self.selection.select("id");
10116        query.execute(self.graphql_client.clone()).await
10117    }
10118    /// Set the list of paths to mark generated in version control.
10119    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10120        let mut query = self.selection.select("withVCSGeneratedPaths");
10121        query = query.arg(
10122            "paths",
10123            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10124        );
10125        GeneratedCode {
10126            proc: self.proc.clone(),
10127            selection: query,
10128            graphql_client: self.graphql_client.clone(),
10129        }
10130    }
10131    /// Set the list of paths to ignore in version control.
10132    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10133        let mut query = self.selection.select("withVCSIgnoredPaths");
10134        query = query.arg(
10135            "paths",
10136            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10137        );
10138        GeneratedCode {
10139            proc: self.proc.clone(),
10140            selection: query,
10141            graphql_client: self.graphql_client.clone(),
10142        }
10143    }
10144    /// The directory containing the generated code.
10145    pub fn code(&self) -> Directory {
10146        let query = self.selection.select("code");
10147        Directory {
10148            proc: self.proc.clone(),
10149            selection: query,
10150            graphql_client: self.graphql_client.clone(),
10151        }
10152    }
10153    /// List of paths to mark generated in version control (i.e. .gitattributes).
10154    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10155        let query = self.selection.select("vcsGeneratedPaths");
10156        query.execute(self.graphql_client.clone()).await
10157    }
10158    /// List of paths to ignore in version control (i.e. .gitignore).
10159    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10160        let query = self.selection.select("vcsIgnoredPaths");
10161        query.execute(self.graphql_client.clone()).await
10162    }
10163}
10164impl Node for GeneratedCode {
10165    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10166        let query = self.selection.select("id");
10167        let graphql_client = self.graphql_client.clone();
10168        async move { query.execute(graphql_client).await }
10169    }
10170}
10171#[derive(Clone)]
10172pub struct Generator {
10173    pub proc: Option<Arc<DaggerSessionProc>>,
10174    pub selection: Selection,
10175    pub graphql_client: DynGraphQLClient,
10176}
10177impl IntoID<Id> for Generator {
10178    fn into_id(
10179        self,
10180    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10181        Box::pin(async move { self.id().await })
10182    }
10183}
10184impl Loadable for Generator {
10185    fn graphql_type() -> &'static str {
10186        "Generator"
10187    }
10188    fn from_query(
10189        proc: Option<Arc<DaggerSessionProc>>,
10190        selection: Selection,
10191        graphql_client: DynGraphQLClient,
10192    ) -> Self {
10193        Self {
10194            proc,
10195            selection,
10196            graphql_client,
10197        }
10198    }
10199}
10200impl Generator {
10201    /// A unique identifier for this Generator.
10202    pub async fn id(&self) -> Result<Id, DaggerError> {
10203        let query = self.selection.select("id");
10204        query.execute(self.graphql_client.clone()).await
10205    }
10206    /// Run the generator and return its changes.
10207    pub fn changeset(&self) -> Changeset {
10208        let query = self.selection.select("changeset");
10209        Changeset {
10210            proc: self.proc.clone(),
10211            selection: query,
10212            graphql_client: self.graphql_client.clone(),
10213        }
10214    }
10215    /// Run the generator and retain its result.
10216    pub fn sync(&self) -> Generator {
10217        let query = self.selection.select("sync");
10218        Generator {
10219            proc: self.proc.clone(),
10220            selection: query,
10221            graphql_client: self.graphql_client.clone(),
10222        }
10223    }
10224    /// A check that passes when this generator would produce no changes.
10225    pub fn stale(&self) -> Check {
10226        let query = self.selection.select("stale");
10227        Check {
10228            proc: self.proc.clone(),
10229            selection: query,
10230            graphql_client: self.graphql_client.clone(),
10231        }
10232    }
10233}
10234impl Node for Generator {
10235    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10236        let query = self.selection.select("id");
10237        let graphql_client = self.graphql_client.clone();
10238        async move { query.execute(graphql_client).await }
10239    }
10240}
10241#[derive(Clone)]
10242pub struct GitBundle {
10243    pub proc: Option<Arc<DaggerSessionProc>>,
10244    pub selection: Selection,
10245    pub graphql_client: DynGraphQLClient,
10246}
10247impl IntoID<Id> for GitBundle {
10248    fn into_id(
10249        self,
10250    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10251        Box::pin(async move { self.id().await })
10252    }
10253}
10254impl Loadable for GitBundle {
10255    fn graphql_type() -> &'static str {
10256        "GitBundle"
10257    }
10258    fn from_query(
10259        proc: Option<Arc<DaggerSessionProc>>,
10260        selection: Selection,
10261        graphql_client: DynGraphQLClient,
10262    ) -> Self {
10263        Self {
10264            proc,
10265            selection,
10266            graphql_client,
10267        }
10268    }
10269}
10270impl GitBundle {
10271    /// A unique identifier for this GitBundle.
10272    pub async fn id(&self) -> Result<Id, DaggerError> {
10273        let query = self.selection.select("id");
10274        query.execute(self.graphql_client.clone()).await
10275    }
10276    /// Perform full structural verification of the bundle and error if it is malformed.
10277    pub fn validate(&self) -> GitBundle {
10278        let query = self.selection.select("validate");
10279        GitBundle {
10280            proc: self.proc.clone(),
10281            selection: query,
10282            graphql_client: self.graphql_client.clone(),
10283        }
10284    }
10285    /// Return the bundle bytes as a File.
10286    pub fn as_file(&self) -> File {
10287        let query = self.selection.select("asFile");
10288        File {
10289            proc: self.proc.clone(),
10290            selection: query,
10291            graphql_client: self.graphql_client.clone(),
10292        }
10293    }
10294    /// Bundle format version (2 or 3).
10295    pub async fn version(&self) -> Result<isize, DaggerError> {
10296        let query = self.selection.select("version");
10297        query.execute(self.graphql_client.clone()).await
10298    }
10299    /// Object format capability: sha1 or sha256.
10300    pub async fn object_format(&self) -> Result<String, DaggerError> {
10301        let query = self.selection.select("objectFormat");
10302        query.execute(self.graphql_client.clone()).await
10303    }
10304    /// Refs advertised by the bundle and the object IDs they resolve to.
10305    pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
10306        let query = self.selection.select("refs");
10307        let query = query.select("id");
10308        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10309        Ok(ids
10310            .into_iter()
10311            .map(|id| GitBundleRef {
10312                proc: self.proc.clone(),
10313                selection: crate::querybuilder::query()
10314                    .select("node")
10315                    .arg("id", &id.0)
10316                    .inline_fragment("GitBundleRef"),
10317                graphql_client: self.graphql_client.clone(),
10318            })
10319            .collect())
10320    }
10321    /// Commits that must already exist wherever this bundle is applied.
10322    pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
10323        let query = self.selection.select("prerequisiteSHAs");
10324        query.execute(self.graphql_client.clone()).await
10325    }
10326}
10327impl Node for GitBundle {
10328    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10329        let query = self.selection.select("id");
10330        let graphql_client = self.graphql_client.clone();
10331        async move { query.execute(graphql_client).await }
10332    }
10333}
10334#[derive(Clone)]
10335pub struct GitBundleRef {
10336    pub proc: Option<Arc<DaggerSessionProc>>,
10337    pub selection: Selection,
10338    pub graphql_client: DynGraphQLClient,
10339}
10340impl IntoID<Id> for GitBundleRef {
10341    fn into_id(
10342        self,
10343    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10344        Box::pin(async move { self.id().await })
10345    }
10346}
10347impl Loadable for GitBundleRef {
10348    fn graphql_type() -> &'static str {
10349        "GitBundleRef"
10350    }
10351    fn from_query(
10352        proc: Option<Arc<DaggerSessionProc>>,
10353        selection: Selection,
10354        graphql_client: DynGraphQLClient,
10355    ) -> Self {
10356        Self {
10357            proc,
10358            selection,
10359            graphql_client,
10360        }
10361    }
10362}
10363impl GitBundleRef {
10364    /// A unique identifier for this GitBundleRef.
10365    pub async fn id(&self) -> Result<Id, DaggerError> {
10366        let query = self.selection.select("id");
10367        query.execute(self.graphql_client.clone()).await
10368    }
10369    /// The advertised ref name.
10370    pub async fn name(&self) -> Result<String, DaggerError> {
10371        let query = self.selection.select("name");
10372        query.execute(self.graphql_client.clone()).await
10373    }
10374    /// The object ID the advertised ref resolves to.
10375    pub async fn sha(&self) -> Result<String, DaggerError> {
10376        let query = self.selection.select("sha");
10377        query.execute(self.graphql_client.clone()).await
10378    }
10379}
10380impl Node for GitBundleRef {
10381    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10382        let query = self.selection.select("id");
10383        let graphql_client = self.graphql_client.clone();
10384        async move { query.execute(graphql_client).await }
10385    }
10386}
10387#[derive(Clone)]
10388pub struct GitCommit {
10389    pub proc: Option<Arc<DaggerSessionProc>>,
10390    pub selection: Selection,
10391    pub graphql_client: DynGraphQLClient,
10392}
10393#[derive(Builder, Debug, PartialEq)]
10394pub struct GitCommitReleaseTagOpts {
10395    /// Include pre-release tags when choosing the latest tag.
10396    #[builder(setter(into, strip_option), default)]
10397    pub include_pre_release: Option<bool>,
10398}
10399#[derive(Builder, Debug, PartialEq)]
10400pub struct GitCommitAncestorReleaseTagOpts {
10401    /// Include pre-release tags when choosing the latest tag.
10402    #[builder(setter(into, strip_option), default)]
10403    pub include_pre_release: Option<bool>,
10404}
10405#[derive(Builder, Debug, PartialEq)]
10406pub struct GitCommitTreeOpts {
10407    /// The depth of the tree to fetch.
10408    #[builder(setter(into, strip_option), default)]
10409    pub depth: Option<isize>,
10410    /// Set to true to discard .git directory.
10411    #[builder(setter(into, strip_option), default)]
10412    pub discard_git_dir: Option<bool>,
10413    /// Set to true to populate tag refs in the local checkout .git.
10414    #[builder(setter(into, strip_option), default)]
10415    pub include_tags: Option<bool>,
10416}
10417#[derive(Builder, Debug, PartialEq)]
10418pub struct GitCommitChangesOpts {
10419    /// Use this commit as the comparison base instead of the first parent. The comparison commit may belong to an unrelated history or repository.
10420    #[builder(setter(into, strip_option), default)]
10421    pub against: Option<Id>,
10422}
10423impl IntoID<Id> for GitCommit {
10424    fn into_id(
10425        self,
10426    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10427        Box::pin(async move { self.id().await })
10428    }
10429}
10430impl Loadable for GitCommit {
10431    fn graphql_type() -> &'static str {
10432        "GitCommit"
10433    }
10434    fn from_query(
10435        proc: Option<Arc<DaggerSessionProc>>,
10436        selection: Selection,
10437        graphql_client: DynGraphQLClient,
10438    ) -> Self {
10439        Self {
10440            proc,
10441            selection,
10442            graphql_client,
10443        }
10444    }
10445}
10446impl GitCommit {
10447    /// A unique identifier for this GitCommit.
10448    pub async fn id(&self) -> Result<Id, DaggerError> {
10449        let query = self.selection.select("id");
10450        query.execute(self.graphql_client.clone()).await
10451    }
10452    /// The latest semver release tag that points directly at this commit.
10453    ///
10454    /// # Arguments
10455    ///
10456    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10457    pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10458        let query = self.selection.select("releaseTag");
10459        let query = query.select("id");
10460        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10461        Ok(id.map(|id| GitRef {
10462            proc: self.proc.clone(),
10463            selection: query
10464                .root()
10465                .select("node")
10466                .arg("id", &id.0)
10467                .inline_fragment("GitRef"),
10468            graphql_client: self.graphql_client.clone(),
10469        }))
10470    }
10471    /// The latest semver release tag that points directly at this commit.
10472    ///
10473    /// # Arguments
10474    ///
10475    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10476    pub async fn release_tag_opts(
10477        &self,
10478        opts: GitCommitReleaseTagOpts,
10479    ) -> Result<Option<GitRef>, DaggerError> {
10480        let mut query = self.selection.select("releaseTag");
10481        if let Some(include_pre_release) = opts.include_pre_release {
10482            query = query.arg("includePreRelease", include_pre_release);
10483        }
10484        let query = query.select("id");
10485        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10486        Ok(id.map(|id| GitRef {
10487            proc: self.proc.clone(),
10488            selection: query
10489                .root()
10490                .select("node")
10491                .arg("id", &id.0)
10492                .inline_fragment("GitRef"),
10493            graphql_client: self.graphql_client.clone(),
10494        }))
10495    }
10496    /// The latest semver release tag reachable from this commit.
10497    ///
10498    /// # Arguments
10499    ///
10500    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10501    pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10502        let query = self.selection.select("ancestorReleaseTag");
10503        let query = query.select("id");
10504        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10505        Ok(id.map(|id| GitRef {
10506            proc: self.proc.clone(),
10507            selection: query
10508                .root()
10509                .select("node")
10510                .arg("id", &id.0)
10511                .inline_fragment("GitRef"),
10512            graphql_client: self.graphql_client.clone(),
10513        }))
10514    }
10515    /// The latest semver release tag reachable from this commit.
10516    ///
10517    /// # Arguments
10518    ///
10519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10520    pub async fn ancestor_release_tag_opts(
10521        &self,
10522        opts: GitCommitAncestorReleaseTagOpts,
10523    ) -> Result<Option<GitRef>, DaggerError> {
10524        let mut query = self.selection.select("ancestorReleaseTag");
10525        if let Some(include_pre_release) = opts.include_pre_release {
10526            query = query.arg("includePreRelease", include_pre_release);
10527        }
10528        let query = query.select("id");
10529        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10530        Ok(id.map(|id| GitRef {
10531            proc: self.proc.clone(),
10532            selection: query
10533                .root()
10534                .select("node")
10535                .arg("id", &id.0)
10536                .inline_fragment("GitRef"),
10537            graphql_client: self.graphql_client.clone(),
10538        }))
10539    }
10540    /// The filesystem tree at this commit.
10541    ///
10542    /// # Arguments
10543    ///
10544    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10545    pub fn tree(&self) -> Directory {
10546        let query = self.selection.select("tree");
10547        Directory {
10548            proc: self.proc.clone(),
10549            selection: query,
10550            graphql_client: self.graphql_client.clone(),
10551        }
10552    }
10553    /// The filesystem tree at this commit.
10554    ///
10555    /// # Arguments
10556    ///
10557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10558    pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
10559        let mut query = self.selection.select("tree");
10560        if let Some(discard_git_dir) = opts.discard_git_dir {
10561            query = query.arg("discardGitDir", discard_git_dir);
10562        }
10563        if let Some(depth) = opts.depth {
10564            query = query.arg("depth", depth);
10565        }
10566        if let Some(include_tags) = opts.include_tags {
10567            query = query.arg("includeTags", include_tags);
10568        }
10569        Directory {
10570            proc: self.proc.clone(),
10571            selection: query,
10572            graphql_client: self.graphql_client.clone(),
10573        }
10574    }
10575    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10576    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10577    ///
10578    /// # Arguments
10579    ///
10580    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10581    pub fn changes(&self) -> Changeset {
10582        let query = self.selection.select("changes");
10583        Changeset {
10584            proc: self.proc.clone(),
10585            selection: query,
10586            graphql_client: self.graphql_client.clone(),
10587        }
10588    }
10589    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10590    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10591    ///
10592    /// # Arguments
10593    ///
10594    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10595    pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
10596        let mut query = self.selection.select("changes");
10597        if let Some(against) = opts.against {
10598            query = query.arg("against", against);
10599        }
10600        Changeset {
10601            proc: self.proc.clone(),
10602            selection: query,
10603            graphql_client: self.graphql_client.clone(),
10604        }
10605    }
10606    /// The full commit SHA.
10607    pub async fn sha(&self) -> Result<String, DaggerError> {
10608        let query = self.selection.select("sha");
10609        query.execute(self.graphql_client.clone()).await
10610    }
10611    /// The abbreviated commit SHA.
10612    pub async fn short_sha(&self) -> Result<String, DaggerError> {
10613        let query = self.selection.select("shortSha");
10614        query.execute(self.graphql_client.clone()).await
10615    }
10616    /// The ID of the commit's Git tree object.
10617    /// Commits with identical trees have identical contents and file modes.
10618    pub async fn tree_sha(&self) -> Result<String, DaggerError> {
10619        let query = self.selection.select("treeSHA");
10620        query.execute(self.graphql_client.clone()).await
10621    }
10622    /// Git author date, in RFC3339 format.
10623    pub async fn authored_date(&self) -> Result<String, DaggerError> {
10624        let query = self.selection.select("authoredDate");
10625        query.execute(self.graphql_client.clone()).await
10626    }
10627    /// Git committer date, in RFC3339 format.
10628    pub async fn committed_date(&self) -> Result<String, DaggerError> {
10629        let query = self.selection.select("committedDate");
10630        query.execute(self.graphql_client.clone()).await
10631    }
10632    /// Git author name.
10633    pub async fn author_name(&self) -> Result<String, DaggerError> {
10634        let query = self.selection.select("authorName");
10635        query.execute(self.graphql_client.clone()).await
10636    }
10637    /// Git author email.
10638    pub async fn author_email(&self) -> Result<String, DaggerError> {
10639        let query = self.selection.select("authorEmail");
10640        query.execute(self.graphql_client.clone()).await
10641    }
10642    /// Git committer name.
10643    pub async fn committer_name(&self) -> Result<String, DaggerError> {
10644        let query = self.selection.select("committerName");
10645        query.execute(self.graphql_client.clone()).await
10646    }
10647    /// Git committer email.
10648    pub async fn committer_email(&self) -> Result<String, DaggerError> {
10649        let query = self.selection.select("committerEmail");
10650        query.execute(self.graphql_client.clone()).await
10651    }
10652    /// Full commit message.
10653    pub async fn message(&self) -> Result<String, DaggerError> {
10654        let query = self.selection.select("message");
10655        query.execute(self.graphql_client.clone()).await
10656    }
10657    /// First line of the commit message.
10658    pub async fn message_headline(&self) -> Result<String, DaggerError> {
10659        let query = self.selection.select("messageHeadline");
10660        query.execute(self.graphql_client.clone()).await
10661    }
10662    /// Commit message body, excluding the headline.
10663    pub async fn message_body(&self) -> Result<String, DaggerError> {
10664        let query = self.selection.select("messageBody");
10665        query.execute(self.graphql_client.clone()).await
10666    }
10667    /// Parent commit SHAs.
10668    pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
10669        let query = self.selection.select("parentShas");
10670        query.execute(self.graphql_client.clone()).await
10671    }
10672}
10673impl Node for GitCommit {
10674    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10675        let query = self.selection.select("id");
10676        let graphql_client = self.graphql_client.clone();
10677        async move { query.execute(graphql_client).await }
10678    }
10679}
10680#[derive(Clone)]
10681pub struct GitPushResult {
10682    pub proc: Option<Arc<DaggerSessionProc>>,
10683    pub selection: Selection,
10684    pub graphql_client: DynGraphQLClient,
10685}
10686impl IntoID<Id> for GitPushResult {
10687    fn into_id(
10688        self,
10689    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10690        Box::pin(async move { self.id().await })
10691    }
10692}
10693impl Loadable for GitPushResult {
10694    fn graphql_type() -> &'static str {
10695        "GitPushResult"
10696    }
10697    fn from_query(
10698        proc: Option<Arc<DaggerSessionProc>>,
10699        selection: Selection,
10700        graphql_client: DynGraphQLClient,
10701    ) -> Self {
10702        Self {
10703            proc,
10704            selection,
10705            graphql_client,
10706        }
10707    }
10708}
10709impl GitPushResult {
10710    /// A unique identifier for this GitPushResult.
10711    pub async fn id(&self) -> Result<Id, DaggerError> {
10712        let query = self.selection.select("id");
10713        query.execute(self.graphql_client.clone()).await
10714    }
10715    /// The fully qualified remote ref.
10716    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10717        let query = self.selection.select("ref");
10718        query.execute(self.graphql_client.clone()).await
10719    }
10720    /// The previous remote object ID; empty when the ref was created.
10721    pub async fn previous_sha(&self) -> Result<String, DaggerError> {
10722        let query = self.selection.select("previousSHA");
10723        query.execute(self.graphql_client.clone()).await
10724    }
10725    /// The object ID pushed to the remote.
10726    pub async fn sha(&self) -> Result<String, DaggerError> {
10727        let query = self.selection.select("sha");
10728        query.execute(self.graphql_client.clone()).await
10729    }
10730    /// How the remote ref was updated.
10731    pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
10732        let query = self.selection.select("disposition");
10733        query.execute(self.graphql_client.clone()).await
10734    }
10735}
10736impl Node for GitPushResult {
10737    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10738        let query = self.selection.select("id");
10739        let graphql_client = self.graphql_client.clone();
10740        async move { query.execute(graphql_client).await }
10741    }
10742}
10743#[derive(Clone)]
10744pub struct GitRef {
10745    pub proc: Option<Arc<DaggerSessionProc>>,
10746    pub selection: Selection,
10747    pub graphql_client: DynGraphQLClient,
10748}
10749#[derive(Builder, Debug, PartialEq)]
10750pub struct GitRefPushOpts<'a> {
10751    /// Destination branch; a refs/ prefix is used verbatim. Defaults to this ref's branch name. Required for detached and non-branch refs.
10752    #[builder(setter(into, strip_option), default)]
10753    pub branch: Option<&'a str>,
10754    /// 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.
10755    #[builder(setter(into, strip_option), default)]
10756    pub expected_remote_sha: Option<&'a str>,
10757    /// 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.
10758    #[builder(setter(into, strip_option), default)]
10759    pub remote: Option<&'a str>,
10760    /// 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.
10761    #[builder(setter(into, strip_option), default)]
10762    pub to: Option<Id>,
10763}
10764#[derive(Builder, Debug, PartialEq)]
10765pub struct GitRefTreeOpts {
10766    /// The depth of the tree to fetch.
10767    #[builder(setter(into, strip_option), default)]
10768    pub depth: Option<isize>,
10769    /// Set to true to discard .git directory.
10770    #[builder(setter(into, strip_option), default)]
10771    pub discard_git_dir: Option<bool>,
10772    /// Set to true to populate tag refs in the local checkout .git.
10773    #[builder(setter(into, strip_option), default)]
10774    pub include_tags: Option<bool>,
10775}
10776#[derive(Builder, Debug, PartialEq)]
10777pub struct GitRefLogOpts<'a> {
10778    /// Exclude commits reachable from this ref, i.e. only list commits added on top of it.
10779    #[builder(setter(into, strip_option), default)]
10780    pub base: Option<Id>,
10781    /// Maximum number of commits to return.
10782    #[builder(setter(into, strip_option), default)]
10783    pub limit: Option<isize>,
10784    /// Only include commits touching these paths, relative to the root of the repository.
10785    #[builder(setter(into, strip_option), default)]
10786    pub paths: Option<Vec<&'a str>>,
10787}
10788#[derive(Builder, Debug, PartialEq)]
10789pub struct GitRefWithCommitOpts<'a> {
10790    /// Allow a commit whose tree matches its parent, including when the supplied edits are already present. Defaults to false.
10791    #[builder(setter(into, strip_option), default)]
10792    pub allow_empty: Option<bool>,
10793    /// RFC3339 committer date. Defaults to date.
10794    #[builder(setter(into, strip_option), default)]
10795    pub committer_date: Option<&'a str>,
10796    /// Committer email. Defaults to authorEmail.
10797    #[builder(setter(into, strip_option), default)]
10798    pub committer_email: Option<&'a str>,
10799    /// Committer name. Defaults to authorName.
10800    #[builder(setter(into, strip_option), default)]
10801    pub committer_name: Option<&'a str>,
10802    /// Add a Signed-off-by trailer using the commit author's name and email.
10803    #[builder(setter(into, strip_option), default)]
10804    pub signoff: Option<bool>,
10805}
10806#[derive(Builder, Debug, PartialEq)]
10807pub struct GitRefAsWorkspaceOpts<'a> {
10808    /// Current working directory inside the workspace root. Defaults to the workspace root.
10809    #[builder(setter(into, strip_option), default)]
10810    pub cwd: Option<&'a str>,
10811}
10812impl IntoID<Id> for GitRef {
10813    fn into_id(
10814        self,
10815    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10816        Box::pin(async move { self.id().await })
10817    }
10818}
10819impl Loadable for GitRef {
10820    fn graphql_type() -> &'static str {
10821        "GitRef"
10822    }
10823    fn from_query(
10824        proc: Option<Arc<DaggerSessionProc>>,
10825        selection: Selection,
10826        graphql_client: DynGraphQLClient,
10827    ) -> Self {
10828        Self {
10829            proc,
10830            selection,
10831            graphql_client,
10832        }
10833    }
10834}
10835impl GitRef {
10836    /// A unique identifier for this GitRef.
10837    pub async fn id(&self) -> Result<Id, DaggerError> {
10838        let query = self.selection.select("id");
10839        query.execute(self.graphql_client.clone()).await
10840    }
10841    /// Push this ref's commit and history to a remote repository using the destination's credentials.
10842    /// 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.
10843    /// 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.
10844    ///
10845    /// # Arguments
10846    ///
10847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10848    pub fn push(&self) -> GitPushResult {
10849        let query = self.selection.select("push");
10850        GitPushResult {
10851            proc: self.proc.clone(),
10852            selection: query,
10853            graphql_client: self.graphql_client.clone(),
10854        }
10855    }
10856    /// Push this ref's commit and history to a remote repository using the destination's credentials.
10857    /// 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.
10858    /// 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.
10859    ///
10860    /// # Arguments
10861    ///
10862    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10863    pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
10864        let mut query = self.selection.select("push");
10865        if let Some(to) = opts.to {
10866            query = query.arg("to", to);
10867        }
10868        if let Some(remote) = opts.remote {
10869            query = query.arg("remote", remote);
10870        }
10871        if let Some(branch) = opts.branch {
10872            query = query.arg("branch", branch);
10873        }
10874        if let Some(expected_remote_sha) = opts.expected_remote_sha {
10875            query = query.arg("expectedRemoteSHA", expected_remote_sha);
10876        }
10877        GitPushResult {
10878            proc: self.proc.clone(),
10879            selection: query,
10880            graphql_client: self.graphql_client.clone(),
10881        }
10882    }
10883    /// The commit this ref resolves to.
10884    pub fn target_commit(&self) -> GitCommit {
10885        let query = self.selection.select("targetCommit");
10886        GitCommit {
10887            proc: self.proc.clone(),
10888            selection: query,
10889            graphql_client: self.graphql_client.clone(),
10890        }
10891    }
10892    /// The resolved commit SHA at this ref.
10893    pub async fn commit_sha(&self) -> Result<String, DaggerError> {
10894        let query = self.selection.select("commitSHA");
10895        query.execute(self.graphql_client.clone()).await
10896    }
10897    /// The filesystem tree at this ref.
10898    ///
10899    /// # Arguments
10900    ///
10901    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10902    pub fn tree(&self) -> Directory {
10903        let query = self.selection.select("tree");
10904        Directory {
10905            proc: self.proc.clone(),
10906            selection: query,
10907            graphql_client: self.graphql_client.clone(),
10908        }
10909    }
10910    /// The filesystem tree at this ref.
10911    ///
10912    /// # Arguments
10913    ///
10914    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10915    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10916        let mut query = self.selection.select("tree");
10917        if let Some(discard_git_dir) = opts.discard_git_dir {
10918            query = query.arg("discardGitDir", discard_git_dir);
10919        }
10920        if let Some(depth) = opts.depth {
10921            query = query.arg("depth", depth);
10922        }
10923        if let Some(include_tags) = opts.include_tags {
10924            query = query.arg("includeTags", include_tags);
10925        }
10926        Directory {
10927            proc: self.proc.clone(),
10928            selection: query,
10929            graphql_client: self.graphql_client.clone(),
10930        }
10931    }
10932    /// The resolved commit id at this ref.
10933    pub async fn commit(&self) -> Result<String, DaggerError> {
10934        let query = self.selection.select("commit");
10935        query.execute(self.graphql_client.clone()).await
10936    }
10937    /// The resolved name of this ref.
10938    pub async fn name(&self) -> Result<String, DaggerError> {
10939        let query = self.selection.select("name");
10940        query.execute(self.graphql_client.clone()).await
10941    }
10942    /// The resolved ref name at this ref.
10943    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10944        let query = self.selection.select("ref");
10945        query.execute(self.graphql_client.clone()).await
10946    }
10947    /// Return true when the other ref's commit equals this commit or is an ancestor of it.
10948    /// Compares commit history across branches, tags and detached refs. Incomplete or unavailable history is an error.
10949    ///
10950    /// # Arguments
10951    ///
10952    /// * `other` - The ref whose commit to look for in this ref's history.
10953    pub async fn contains(&self, other: impl IntoID<Id>) -> Result<bool, DaggerError> {
10954        let mut query = self.selection.select("contains");
10955        query = query.arg_lazy(
10956            "other",
10957            Box::new(move || {
10958                let other = other.clone();
10959                Box::pin(async move { other.into_id().await.unwrap().quote() })
10960            }),
10961        );
10962        query.execute(self.graphql_client.clone()).await
10963    }
10964    /// Find the best common ancestor between this ref and another ref.
10965    ///
10966    /// # Arguments
10967    ///
10968    /// * `other` - The other ref to compare against.
10969    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10970        let mut query = self.selection.select("commonAncestor");
10971        query = query.arg_lazy(
10972            "other",
10973            Box::new(move || {
10974                let other = other.clone();
10975                Box::pin(async move { other.into_id().await.unwrap().quote() })
10976            }),
10977        );
10978        GitRef {
10979            proc: self.proc.clone(),
10980            selection: query,
10981            graphql_client: self.graphql_client.clone(),
10982        }
10983    }
10984    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
10985    ///
10986    /// # Arguments
10987    ///
10988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10989    pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
10990        let query = self.selection.select("log");
10991        let query = query.select("id");
10992        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10993        Ok(ids
10994            .into_iter()
10995            .map(|id| GitCommit {
10996                proc: self.proc.clone(),
10997                selection: crate::querybuilder::query()
10998                    .select("node")
10999                    .arg("id", &id.0)
11000                    .inline_fragment("GitCommit"),
11001                graphql_client: self.graphql_client.clone(),
11002            })
11003            .collect())
11004    }
11005    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
11006    ///
11007    /// # Arguments
11008    ///
11009    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11010    pub async fn log_opts<'a>(
11011        &self,
11012        opts: GitRefLogOpts<'a>,
11013    ) -> Result<Vec<GitCommit>, DaggerError> {
11014        let mut query = self.selection.select("log");
11015        if let Some(limit) = opts.limit {
11016            query = query.arg("limit", limit);
11017        }
11018        if let Some(paths) = opts.paths {
11019            query = query.arg("paths", paths);
11020        }
11021        if let Some(base) = opts.base {
11022            query = query.arg("base", base);
11023        }
11024        let query = query.select("id");
11025        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11026        Ok(ids
11027            .into_iter()
11028            .map(|id| GitCommit {
11029                proc: self.proc.clone(),
11030                selection: crate::querybuilder::query()
11031                    .select("node")
11032                    .arg("id", &id.0)
11033                    .inline_fragment("GitCommit"),
11034                graphql_client: self.graphql_client.clone(),
11035            })
11036            .collect())
11037    }
11038    /// Create a single-parent commit on this ref by applying a changeset's edits.
11039    /// 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.
11040    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
11041    ///
11042    /// # Arguments
11043    ///
11044    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
11045    /// * `message` - Commit message.
11046    /// * `date` - RFC3339 author date; also the default committer date.
11047    /// * `author_name` - Author name.
11048    /// * `author_email` - Author email.
11049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11050    pub fn with_commit(
11051        &self,
11052        changes: impl IntoID<Id>,
11053        message: impl Into<String>,
11054        date: impl Into<String>,
11055        author_name: impl Into<String>,
11056        author_email: impl Into<String>,
11057    ) -> GitRef {
11058        let mut query = self.selection.select("withCommit");
11059        query = query.arg_lazy(
11060            "changes",
11061            Box::new(move || {
11062                let changes = changes.clone();
11063                Box::pin(async move { changes.into_id().await.unwrap().quote() })
11064            }),
11065        );
11066        query = query.arg("message", message.into());
11067        query = query.arg("date", date.into());
11068        query = query.arg("authorName", author_name.into());
11069        query = query.arg("authorEmail", author_email.into());
11070        GitRef {
11071            proc: self.proc.clone(),
11072            selection: query,
11073            graphql_client: self.graphql_client.clone(),
11074        }
11075    }
11076    /// Create a single-parent commit on this ref by applying a changeset's edits.
11077    /// 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.
11078    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
11079    ///
11080    /// # Arguments
11081    ///
11082    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
11083    /// * `message` - Commit message.
11084    /// * `date` - RFC3339 author date; also the default committer date.
11085    /// * `author_name` - Author name.
11086    /// * `author_email` - Author email.
11087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11088    pub fn with_commit_opts<'a>(
11089        &self,
11090        changes: impl IntoID<Id>,
11091        message: impl Into<String>,
11092        date: impl Into<String>,
11093        author_name: impl Into<String>,
11094        author_email: impl Into<String>,
11095        opts: GitRefWithCommitOpts<'a>,
11096    ) -> GitRef {
11097        let mut query = self.selection.select("withCommit");
11098        query = query.arg_lazy(
11099            "changes",
11100            Box::new(move || {
11101                let changes = changes.clone();
11102                Box::pin(async move { changes.into_id().await.unwrap().quote() })
11103            }),
11104        );
11105        query = query.arg("message", message.into());
11106        query = query.arg("date", date.into());
11107        query = query.arg("authorName", author_name.into());
11108        query = query.arg("authorEmail", author_email.into());
11109        if let Some(committer_name) = opts.committer_name {
11110            query = query.arg("committerName", committer_name);
11111        }
11112        if let Some(committer_email) = opts.committer_email {
11113            query = query.arg("committerEmail", committer_email);
11114        }
11115        if let Some(committer_date) = opts.committer_date {
11116            query = query.arg("committerDate", committer_date);
11117        }
11118        if let Some(allow_empty) = opts.allow_empty {
11119            query = query.arg("allowEmpty", allow_empty);
11120        }
11121        if let Some(signoff) = opts.signoff {
11122            query = query.arg("signoff", signoff);
11123        }
11124        GitRef {
11125            proc: self.proc.clone(),
11126            selection: query,
11127            graphql_client: self.graphql_client.clone(),
11128        }
11129    }
11130    /// Return this ref's repository with HEAD pinned to the selected commit.
11131    /// Preserves the original repository backend, connection information, and other refs. Does not modify a branch or checkout, or prune history.
11132    pub fn as_repository(&self) -> GitRepository {
11133        let query = self.selection.select("asRepository");
11134        GitRepository {
11135            proc: self.proc.clone(),
11136            selection: query,
11137            graphql_client: self.graphql_client.clone(),
11138        }
11139    }
11140    /// Creates a synthetic workspace from this git ref.
11141    ///
11142    /// # Arguments
11143    ///
11144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11145    pub fn as_workspace(&self) -> Workspace {
11146        let query = self.selection.select("asWorkspace");
11147        Workspace {
11148            proc: self.proc.clone(),
11149            selection: query,
11150            graphql_client: self.graphql_client.clone(),
11151        }
11152    }
11153    /// Creates a synthetic workspace from this git ref.
11154    ///
11155    /// # Arguments
11156    ///
11157    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11158    pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
11159        let mut query = self.selection.select("asWorkspace");
11160        if let Some(cwd) = opts.cwd {
11161            query = query.arg("cwd", cwd);
11162        }
11163        Workspace {
11164            proc: self.proc.clone(),
11165            selection: query,
11166            graphql_client: self.graphql_client.clone(),
11167        }
11168    }
11169}
11170impl Node for GitRef {
11171    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11172        let query = self.selection.select("id");
11173        let graphql_client = self.graphql_client.clone();
11174        async move { query.execute(graphql_client).await }
11175    }
11176}
11177#[derive(Clone)]
11178pub struct GitRemote {
11179    pub proc: Option<Arc<DaggerSessionProc>>,
11180    pub selection: Selection,
11181    pub graphql_client: DynGraphQLClient,
11182}
11183impl IntoID<Id> for GitRemote {
11184    fn into_id(
11185        self,
11186    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11187        Box::pin(async move { self.id().await })
11188    }
11189}
11190impl Loadable for GitRemote {
11191    fn graphql_type() -> &'static str {
11192        "GitRemote"
11193    }
11194    fn from_query(
11195        proc: Option<Arc<DaggerSessionProc>>,
11196        selection: Selection,
11197        graphql_client: DynGraphQLClient,
11198    ) -> Self {
11199        Self {
11200            proc,
11201            selection,
11202            graphql_client,
11203        }
11204    }
11205}
11206impl GitRemote {
11207    /// A unique identifier for this GitRemote.
11208    pub async fn id(&self) -> Result<Id, DaggerError> {
11209        let query = self.selection.select("id");
11210        query.execute(self.graphql_client.clone()).await
11211    }
11212    /// Access this remote's repository using its fetch URL and the caller's credentials, or the source's existing capability for this exact destination.
11213    /// HEAD is the remote's HEAD, independent of the workspace's selected commit. Remote registration alone does not grant credentials.
11214    pub fn repository(&self) -> GitRepository {
11215        let query = self.selection.select("repository");
11216        GitRepository {
11217            proc: self.proc.clone(),
11218            selection: query,
11219            graphql_client: self.graphql_client.clone(),
11220        }
11221    }
11222    /// The remote's name.
11223    pub async fn name(&self) -> Result<String, DaggerError> {
11224        let query = self.selection.select("name");
11225        query.execute(self.graphql_client.clone()).await
11226    }
11227}
11228impl Node for GitRemote {
11229    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11230        let query = self.selection.select("id");
11231        let graphql_client = self.graphql_client.clone();
11232        async move { query.execute(graphql_client).await }
11233    }
11234}
11235#[derive(Clone)]
11236pub struct GitRepository {
11237    pub proc: Option<Arc<DaggerSessionProc>>,
11238    pub selection: Selection,
11239    pub graphql_client: DynGraphQLClient,
11240}
11241#[derive(Builder, Debug, PartialEq)]
11242pub struct GitRepositoryHeadOpts {
11243    /// Ignore the workspace lockfile for this lookup.
11244    #[builder(setter(into, strip_option), default)]
11245    pub no_lock: Option<bool>,
11246}
11247#[derive(Builder, Debug, PartialEq)]
11248pub struct GitRepositoryRefOpts {
11249    /// Ignore the workspace lockfile for this lookup.
11250    #[builder(setter(into, strip_option), default)]
11251    pub no_lock: Option<bool>,
11252}
11253#[derive(Builder, Debug, PartialEq)]
11254pub struct GitRepositoryBranchOpts {
11255    /// Ignore the workspace lockfile for this lookup.
11256    #[builder(setter(into, strip_option), default)]
11257    pub no_lock: Option<bool>,
11258}
11259#[derive(Builder, Debug, PartialEq)]
11260pub struct GitRepositoryTagOpts {
11261    /// Ignore the workspace lockfile for this lookup.
11262    #[builder(setter(into, strip_option), default)]
11263    pub no_lock: Option<bool>,
11264}
11265#[derive(Builder, Debug, PartialEq)]
11266pub struct GitRepositoryLatestOpts<'a> {
11267    /// Ignore the workspace lockfile for this lookup.
11268    #[builder(setter(into, strip_option), default)]
11269    pub no_lock: Option<bool>,
11270    /// Version query used to select the greatest matching release ref.
11271    #[builder(setter(into, strip_option), default)]
11272    pub version: Option<&'a str>,
11273}
11274#[derive(Builder, Debug, PartialEq)]
11275pub struct GitRepositoryTagsOpts<'a> {
11276    /// Glob patterns (e.g., "refs/tags/v*").
11277    #[builder(setter(into, strip_option), default)]
11278    pub patterns: Option<Vec<&'a str>>,
11279}
11280#[derive(Builder, Debug, PartialEq)]
11281pub struct GitRepositoryBranchesOpts<'a> {
11282    /// Glob patterns (e.g., "refs/tags/v*").
11283    #[builder(setter(into, strip_option), default)]
11284    pub patterns: Option<Vec<&'a str>>,
11285}
11286#[derive(Builder, Debug, PartialEq)]
11287pub struct GitRepositoryBundleOpts {
11288    /// A Git ref whose reachable objects are omitted and recorded as a prerequisite.
11289    #[builder(setter(into, strip_option), default)]
11290    pub base: Option<Id>,
11291}
11292#[derive(Builder, Debug, PartialEq)]
11293pub struct GitRepositoryWithBundleOpts<'a> {
11294    /// An optional remote ref hint for fetching a prerequisite when the remote does not allow fetches by object ID.
11295    #[builder(setter(into, strip_option), default)]
11296    pub prerequisite_ref: Option<&'a str>,
11297}
11298#[derive(Builder, Debug, PartialEq)]
11299pub struct GitRepositoryWithRemoteOpts<'a> {
11300    /// Push destination, when pushes go somewhere other than url. Empty uses url.
11301    #[builder(setter(into, strip_option), default)]
11302    pub push_url: Option<&'a str>,
11303}
11304#[derive(Builder, Debug, PartialEq)]
11305pub struct GitRepositoryAsWorkspaceOpts<'a> {
11306    /// Current working directory inside the workspace root. Defaults to the workspace root.
11307    #[builder(setter(into, strip_option), default)]
11308    pub cwd: Option<&'a str>,
11309}
11310impl IntoID<Id> for GitRepository {
11311    fn into_id(
11312        self,
11313    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11314        Box::pin(async move { self.id().await })
11315    }
11316}
11317impl Loadable for GitRepository {
11318    fn graphql_type() -> &'static str {
11319        "GitRepository"
11320    }
11321    fn from_query(
11322        proc: Option<Arc<DaggerSessionProc>>,
11323        selection: Selection,
11324        graphql_client: DynGraphQLClient,
11325    ) -> Self {
11326        Self {
11327            proc,
11328            selection,
11329            graphql_client,
11330        }
11331    }
11332}
11333impl GitRepository {
11334    /// A unique identifier for this GitRepository.
11335    pub async fn id(&self) -> Result<Id, DaggerError> {
11336        let query = self.selection.select("id");
11337        query.execute(self.graphql_client.clone()).await
11338    }
11339    /// Returns details for HEAD.
11340    ///
11341    /// # Arguments
11342    ///
11343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11344    pub fn head(&self) -> GitRef {
11345        let query = self.selection.select("head");
11346        GitRef {
11347            proc: self.proc.clone(),
11348            selection: query,
11349            graphql_client: self.graphql_client.clone(),
11350        }
11351    }
11352    /// Returns details for HEAD.
11353    ///
11354    /// # Arguments
11355    ///
11356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11357    pub fn head_opts(&self, opts: GitRepositoryHeadOpts) -> GitRef {
11358        let mut query = self.selection.select("head");
11359        if let Some(no_lock) = opts.no_lock {
11360            query = query.arg("noLock", no_lock);
11361        }
11362        GitRef {
11363            proc: self.proc.clone(),
11364            selection: query,
11365            graphql_client: self.graphql_client.clone(),
11366        }
11367    }
11368    /// Returns details of a ref.
11369    ///
11370    /// # Arguments
11371    ///
11372    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11373    ///
11374    /// 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.
11375    ///
11376    /// 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.
11377    ///
11378    /// 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.
11379    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11380    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
11381        let mut query = self.selection.select("ref");
11382        query = query.arg("name", name.into());
11383        GitRef {
11384            proc: self.proc.clone(),
11385            selection: query,
11386            graphql_client: self.graphql_client.clone(),
11387        }
11388    }
11389    /// Returns details of a ref.
11390    ///
11391    /// # Arguments
11392    ///
11393    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11394    ///
11395    /// 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.
11396    ///
11397    /// 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.
11398    ///
11399    /// 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.
11400    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11401    pub fn r#ref_opts(&self, name: impl Into<String>, opts: GitRepositoryRefOpts) -> GitRef {
11402        let mut query = self.selection.select("ref");
11403        query = query.arg("name", name.into());
11404        if let Some(no_lock) = opts.no_lock {
11405            query = query.arg("noLock", no_lock);
11406        }
11407        GitRef {
11408            proc: self.proc.clone(),
11409            selection: query,
11410            graphql_client: self.graphql_client.clone(),
11411        }
11412    }
11413    /// Returns details of a branch.
11414    ///
11415    /// # Arguments
11416    ///
11417    /// * `name` - Branch's name (e.g., "main").
11418    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11419    pub fn branch(&self, name: impl Into<String>) -> GitRef {
11420        let mut query = self.selection.select("branch");
11421        query = query.arg("name", name.into());
11422        GitRef {
11423            proc: self.proc.clone(),
11424            selection: query,
11425            graphql_client: self.graphql_client.clone(),
11426        }
11427    }
11428    /// Returns details of a branch.
11429    ///
11430    /// # Arguments
11431    ///
11432    /// * `name` - Branch's name (e.g., "main").
11433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11434    pub fn branch_opts(&self, name: impl Into<String>, opts: GitRepositoryBranchOpts) -> GitRef {
11435        let mut query = self.selection.select("branch");
11436        query = query.arg("name", name.into());
11437        if let Some(no_lock) = opts.no_lock {
11438            query = query.arg("noLock", no_lock);
11439        }
11440        GitRef {
11441            proc: self.proc.clone(),
11442            selection: query,
11443            graphql_client: self.graphql_client.clone(),
11444        }
11445    }
11446    /// Returns details of a tag.
11447    ///
11448    /// # Arguments
11449    ///
11450    /// * `name` - Tag's name (e.g., "v0.3.9").
11451    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11452    pub fn tag(&self, name: impl Into<String>) -> GitRef {
11453        let mut query = self.selection.select("tag");
11454        query = query.arg("name", name.into());
11455        GitRef {
11456            proc: self.proc.clone(),
11457            selection: query,
11458            graphql_client: self.graphql_client.clone(),
11459        }
11460    }
11461    /// Returns details of a tag.
11462    ///
11463    /// # Arguments
11464    ///
11465    /// * `name` - Tag's name (e.g., "v0.3.9").
11466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11467    pub fn tag_opts(&self, name: impl Into<String>, opts: GitRepositoryTagOpts) -> GitRef {
11468        let mut query = self.selection.select("tag");
11469        query = query.arg("name", name.into());
11470        if let Some(no_lock) = opts.no_lock {
11471            query = query.arg("noLock", no_lock);
11472        }
11473        GitRef {
11474            proc: self.proc.clone(),
11475            selection: query,
11476            graphql_client: self.graphql_client.clone(),
11477        }
11478    }
11479    /// Returns details of a commit.
11480    ///
11481    /// # Arguments
11482    ///
11483    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
11484    ///
11485    /// 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.
11486    pub fn commit(&self, id: impl Into<String>) -> GitCommit {
11487        let mut query = self.selection.select("commit");
11488        query = query.arg("id", id.into());
11489        GitCommit {
11490            proc: self.proc.clone(),
11491            selection: query,
11492            graphql_client: self.graphql_client.clone(),
11493        }
11494    }
11495    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11496    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11497    ///
11498    /// # Arguments
11499    ///
11500    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11501    pub fn latest(&self) -> GitRef {
11502        let query = self.selection.select("latest");
11503        GitRef {
11504            proc: self.proc.clone(),
11505            selection: query,
11506            graphql_client: self.graphql_client.clone(),
11507        }
11508    }
11509    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11510    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11511    ///
11512    /// # Arguments
11513    ///
11514    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11515    pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
11516        let mut query = self.selection.select("latest");
11517        if let Some(version) = opts.version {
11518            query = query.arg("version", version);
11519        }
11520        if let Some(no_lock) = opts.no_lock {
11521            query = query.arg("noLock", no_lock);
11522        }
11523        GitRef {
11524            proc: self.proc.clone(),
11525            selection: query,
11526            graphql_client: self.graphql_client.clone(),
11527        }
11528    }
11529    /// tags that match any of the given glob patterns.
11530    ///
11531    /// # Arguments
11532    ///
11533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11534    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
11535        let query = self.selection.select("tags");
11536        query.execute(self.graphql_client.clone()).await
11537    }
11538    /// tags that match any of the given glob patterns.
11539    ///
11540    /// # Arguments
11541    ///
11542    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11543    pub async fn tags_opts<'a>(
11544        &self,
11545        opts: GitRepositoryTagsOpts<'a>,
11546    ) -> Result<Vec<String>, DaggerError> {
11547        let mut query = self.selection.select("tags");
11548        if let Some(patterns) = opts.patterns {
11549            query = query.arg("patterns", patterns);
11550        }
11551        query.execute(self.graphql_client.clone()).await
11552    }
11553    /// branches that match any of the given glob patterns.
11554    ///
11555    /// # Arguments
11556    ///
11557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11558    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
11559        let query = self.selection.select("branches");
11560        query.execute(self.graphql_client.clone()).await
11561    }
11562    /// branches that match any of the given glob patterns.
11563    ///
11564    /// # Arguments
11565    ///
11566    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11567    pub async fn branches_opts<'a>(
11568        &self,
11569        opts: GitRepositoryBranchesOpts<'a>,
11570    ) -> Result<Vec<String>, DaggerError> {
11571        let mut query = self.selection.select("branches");
11572        if let Some(patterns) = opts.patterns {
11573            query = query.arg("patterns", patterns);
11574        }
11575        query.execute(self.graphql_client.clone()).await
11576    }
11577    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11578    ///
11579    /// # Arguments
11580    ///
11581    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11583    pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
11584        let mut query = self.selection.select("bundle");
11585        query = query.arg(
11586            "refs",
11587            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11588        );
11589        GitBundle {
11590            proc: self.proc.clone(),
11591            selection: query,
11592            graphql_client: self.graphql_client.clone(),
11593        }
11594    }
11595    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11596    ///
11597    /// # Arguments
11598    ///
11599    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11601    pub fn bundle_opts(
11602        &self,
11603        refs: Vec<impl Into<String>>,
11604        opts: GitRepositoryBundleOpts,
11605    ) -> GitBundle {
11606        let mut query = self.selection.select("bundle");
11607        query = query.arg(
11608            "refs",
11609            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11610        );
11611        if let Some(base) = opts.base {
11612            query = query.arg("base", base);
11613        }
11614        GitBundle {
11615            proc: self.proc.clone(),
11616            selection: query,
11617            graphql_client: self.graphql_client.clone(),
11618        }
11619    }
11620    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11621    ///
11622    /// # Arguments
11623    ///
11624    /// * `bundle` - The Git bundle to import.
11625    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11626    pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
11627        let mut query = self.selection.select("withBundle");
11628        query = query.arg_lazy(
11629            "bundle",
11630            Box::new(move || {
11631                let bundle = bundle.clone();
11632                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11633            }),
11634        );
11635        GitRepository {
11636            proc: self.proc.clone(),
11637            selection: query,
11638            graphql_client: self.graphql_client.clone(),
11639        }
11640    }
11641    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11642    ///
11643    /// # Arguments
11644    ///
11645    /// * `bundle` - The Git bundle to import.
11646    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11647    pub fn with_bundle_opts<'a>(
11648        &self,
11649        bundle: impl IntoID<Id>,
11650        opts: GitRepositoryWithBundleOpts<'a>,
11651    ) -> GitRepository {
11652        let mut query = self.selection.select("withBundle");
11653        query = query.arg_lazy(
11654            "bundle",
11655            Box::new(move || {
11656                let bundle = bundle.clone();
11657                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11658            }),
11659        );
11660        if let Some(prerequisite_ref) = opts.prerequisite_ref {
11661            query = query.arg("prerequisiteRef", prerequisite_ref);
11662        }
11663        GitRepository {
11664            proc: self.proc.clone(),
11665            selection: query,
11666            graphql_client: self.graphql_client.clone(),
11667        }
11668    }
11669    /// Register a named remote on this repository, replacing any registered remote of the same name.
11670    /// 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.
11671    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11672    ///
11673    /// # Arguments
11674    ///
11675    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11676    /// * `url` - The remote's fetch URL.
11677    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11678    pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
11679        let mut query = self.selection.select("withRemote");
11680        query = query.arg("name", name.into());
11681        query = query.arg("url", url.into());
11682        GitRepository {
11683            proc: self.proc.clone(),
11684            selection: query,
11685            graphql_client: self.graphql_client.clone(),
11686        }
11687    }
11688    /// Register a named remote on this repository, replacing any registered remote of the same name.
11689    /// 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.
11690    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11691    ///
11692    /// # Arguments
11693    ///
11694    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11695    /// * `url` - The remote's fetch URL.
11696    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11697    pub fn with_remote_opts<'a>(
11698        &self,
11699        name: impl Into<String>,
11700        url: impl Into<String>,
11701        opts: GitRepositoryWithRemoteOpts<'a>,
11702    ) -> GitRepository {
11703        let mut query = self.selection.select("withRemote");
11704        query = query.arg("name", name.into());
11705        query = query.arg("url", url.into());
11706        if let Some(push_url) = opts.push_url {
11707            query = query.arg("pushUrl", push_url);
11708        }
11709        GitRepository {
11710            proc: self.proc.clone(),
11711            selection: query,
11712            graphql_client: self.graphql_client.clone(),
11713        }
11714    }
11715    /// List this repository's named remotes, with registered remotes overriding configured ones. Does not contact remote servers.
11716    pub async fn remotes(&self) -> Result<Vec<GitRemote>, DaggerError> {
11717        let query = self.selection.select("remotes");
11718        let query = query.select("id");
11719        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11720        Ok(ids
11721            .into_iter()
11722            .map(|id| GitRemote {
11723                proc: self.proc.clone(),
11724                selection: crate::querybuilder::query()
11725                    .select("node")
11726                    .arg("id", &id.0)
11727                    .inline_fragment("GitRemote"),
11728                graphql_client: self.graphql_client.clone(),
11729            })
11730            .collect())
11731    }
11732    /// Look up a remote by name. Fails when the remote does not exist.
11733    ///
11734    /// # Arguments
11735    ///
11736    /// * `name` - The remote's name.
11737    pub fn remote(&self, name: impl Into<String>) -> GitRemote {
11738        let mut query = self.selection.select("remote");
11739        query = query.arg("name", name.into());
11740        GitRemote {
11741            proc: self.proc.clone(),
11742            selection: query,
11743            graphql_client: self.graphql_client.clone(),
11744        }
11745    }
11746    /// Return the sole remote, otherwise origin, otherwise the selected branch's upstream remote, otherwise null.
11747    /// Frozen workspaces retain their captured upstream selection. Does not contact remote servers.
11748    pub async fn default_remote(&self) -> Result<Option<GitRemote>, DaggerError> {
11749        let query = self.selection.select("defaultRemote");
11750        let query = query.select("id");
11751        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11752        Ok(id.map(|id| GitRemote {
11753            proc: self.proc.clone(),
11754            selection: query
11755                .root()
11756                .select("node")
11757                .arg("id", &id.0)
11758                .inline_fragment("GitRemote"),
11759            graphql_client: self.graphql_client.clone(),
11760        }))
11761    }
11762    /// Replace this repository's storage with the supplied self-contained Git repository, retaining its logical URL and push destinations.
11763    /// 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.
11764    /// 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.
11765    /// 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.
11766    ///
11767    /// # Arguments
11768    ///
11769    /// * `directory` - Existing Git storage to open. Git metadata and object dependencies must be contained in this directory.
11770    pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
11771        let mut query = self.selection.select("withContents");
11772        query = query.arg_lazy(
11773            "directory",
11774            Box::new(move || {
11775                let directory = directory.clone();
11776                Box::pin(async move { directory.into_id().await.unwrap().quote() })
11777            }),
11778        );
11779        GitRepository {
11780            proc: self.proc.clone(),
11781            selection: query,
11782            graphql_client: self.graphql_client.clone(),
11783        }
11784    }
11785    /// Returns the changeset of uncommitted changes in the git repository.
11786    pub fn uncommitted(&self) -> Changeset {
11787        let query = self.selection.select("uncommitted");
11788        Changeset {
11789            proc: self.proc.clone(),
11790            selection: query,
11791            graphql_client: self.graphql_client.clone(),
11792        }
11793    }
11794    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11795    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11796    ///
11797    /// # Arguments
11798    ///
11799    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11800    pub fn as_workspace(&self) -> Workspace {
11801        let query = self.selection.select("asWorkspace");
11802        Workspace {
11803            proc: self.proc.clone(),
11804            selection: query,
11805            graphql_client: self.graphql_client.clone(),
11806        }
11807    }
11808    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11809    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11810    ///
11811    /// # Arguments
11812    ///
11813    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11814    pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
11815        let mut query = self.selection.select("asWorkspace");
11816        if let Some(cwd) = opts.cwd {
11817            query = query.arg("cwd", cwd);
11818        }
11819        Workspace {
11820            proc: self.proc.clone(),
11821            selection: query,
11822            graphql_client: self.graphql_client.clone(),
11823        }
11824    }
11825    /// The URL of the git repository.
11826    pub async fn url(&self) -> Result<String, DaggerError> {
11827        let query = self.selection.select("url");
11828        query.execute(self.graphql_client.clone()).await
11829    }
11830}
11831impl Node for GitRepository {
11832    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11833        let query = self.selection.select("id");
11834        let graphql_client = self.graphql_client.clone();
11835        async move { query.execute(graphql_client).await }
11836    }
11837}
11838#[derive(Clone)]
11839pub struct HttpState {
11840    pub proc: Option<Arc<DaggerSessionProc>>,
11841    pub selection: Selection,
11842    pub graphql_client: DynGraphQLClient,
11843}
11844impl IntoID<Id> for HttpState {
11845    fn into_id(
11846        self,
11847    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11848        Box::pin(async move { self.id().await })
11849    }
11850}
11851impl Loadable for HttpState {
11852    fn graphql_type() -> &'static str {
11853        "HTTPState"
11854    }
11855    fn from_query(
11856        proc: Option<Arc<DaggerSessionProc>>,
11857        selection: Selection,
11858        graphql_client: DynGraphQLClient,
11859    ) -> Self {
11860        Self {
11861            proc,
11862            selection,
11863            graphql_client,
11864        }
11865    }
11866}
11867impl HttpState {
11868    /// A unique identifier for this HTTPState.
11869    pub async fn id(&self) -> Result<Id, DaggerError> {
11870        let query = self.selection.select("id");
11871        query.execute(self.graphql_client.clone()).await
11872    }
11873}
11874impl Node for HttpState {
11875    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11876        let query = self.selection.select("id");
11877        let graphql_client = self.graphql_client.clone();
11878        async move { query.execute(graphql_client).await }
11879    }
11880}
11881#[derive(Clone)]
11882pub struct HealthcheckConfig {
11883    pub proc: Option<Arc<DaggerSessionProc>>,
11884    pub selection: Selection,
11885    pub graphql_client: DynGraphQLClient,
11886}
11887impl IntoID<Id> for HealthcheckConfig {
11888    fn into_id(
11889        self,
11890    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11891        Box::pin(async move { self.id().await })
11892    }
11893}
11894impl Loadable for HealthcheckConfig {
11895    fn graphql_type() -> &'static str {
11896        "HealthcheckConfig"
11897    }
11898    fn from_query(
11899        proc: Option<Arc<DaggerSessionProc>>,
11900        selection: Selection,
11901        graphql_client: DynGraphQLClient,
11902    ) -> Self {
11903        Self {
11904            proc,
11905            selection,
11906            graphql_client,
11907        }
11908    }
11909}
11910impl HealthcheckConfig {
11911    /// A unique identifier for this HealthcheckConfig.
11912    pub async fn id(&self) -> Result<Id, DaggerError> {
11913        let query = self.selection.select("id");
11914        query.execute(self.graphql_client.clone()).await
11915    }
11916    /// Healthcheck command arguments.
11917    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
11918        let query = self.selection.select("args");
11919        query.execute(self.graphql_client.clone()).await
11920    }
11921    /// Healthcheck command is a shell command.
11922    pub async fn shell(&self) -> Result<bool, DaggerError> {
11923        let query = self.selection.select("shell");
11924        query.execute(self.graphql_client.clone()).await
11925    }
11926    /// Healthcheck timeout. Example:3s
11927    pub async fn timeout(&self) -> Result<String, DaggerError> {
11928        let query = self.selection.select("timeout");
11929        query.execute(self.graphql_client.clone()).await
11930    }
11931    /// Interval between running healthcheck. Example:30s
11932    pub async fn interval(&self) -> Result<String, DaggerError> {
11933        let query = self.selection.select("interval");
11934        query.execute(self.graphql_client.clone()).await
11935    }
11936    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
11937    pub async fn start_period(&self) -> Result<String, DaggerError> {
11938        let query = self.selection.select("startPeriod");
11939        query.execute(self.graphql_client.clone()).await
11940    }
11941    /// StartInterval configures the duration between checks during the startup phase. Example:5s
11942    pub async fn start_interval(&self) -> Result<String, DaggerError> {
11943        let query = self.selection.select("startInterval");
11944        query.execute(self.graphql_client.clone()).await
11945    }
11946    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
11947    pub async fn retries(&self) -> Result<isize, DaggerError> {
11948        let query = self.selection.select("retries");
11949        query.execute(self.graphql_client.clone()).await
11950    }
11951}
11952impl Node for HealthcheckConfig {
11953    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11954        let query = self.selection.select("id");
11955        let graphql_client = self.graphql_client.clone();
11956        async move { query.execute(graphql_client).await }
11957    }
11958}
11959#[derive(Clone)]
11960pub struct Host {
11961    pub proc: Option<Arc<DaggerSessionProc>>,
11962    pub selection: Selection,
11963    pub graphql_client: DynGraphQLClient,
11964}
11965#[derive(Builder, Debug, PartialEq)]
11966pub struct HostDirectoryOpts<'a> {
11967    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
11968    #[builder(setter(into, strip_option), default)]
11969    pub exclude: Option<Vec<&'a str>>,
11970    /// Apply .gitignore filter rules inside the directory
11971    #[builder(setter(into, strip_option), default)]
11972    pub gitignore: Option<bool>,
11973    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
11974    #[builder(setter(into, strip_option), default)]
11975    pub include: Option<Vec<&'a str>>,
11976    /// If true, the directory will always be reloaded from the host.
11977    #[builder(setter(into, strip_option), default)]
11978    pub no_cache: Option<bool>,
11979}
11980#[derive(Builder, Debug, PartialEq)]
11981pub struct HostFileOpts {
11982    /// If true, the file will always be reloaded from the host.
11983    #[builder(setter(into, strip_option), default)]
11984    pub no_cache: Option<bool>,
11985}
11986#[derive(Builder, Debug, PartialEq)]
11987pub struct HostFindUpOpts {
11988    #[builder(setter(into, strip_option), default)]
11989    pub no_cache: Option<bool>,
11990}
11991#[derive(Builder, Debug, PartialEq)]
11992pub struct HostTunnelOpts {
11993    /// Map each service port to the same port on the host, as if the service were running natively.
11994    /// Note: enabling may result in port conflicts.
11995    #[builder(setter(into, strip_option), default)]
11996    pub native: Option<bool>,
11997    /// Configure explicit port forwarding rules for the tunnel.
11998    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
11999    /// 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.
12000    /// If ports are given and native is true, the ports are additive.
12001    #[builder(setter(into, strip_option), default)]
12002    pub ports: Option<Vec<PortForward>>,
12003}
12004#[derive(Builder, Debug, PartialEq)]
12005pub struct HostServiceOpts<'a> {
12006    /// Upstream host to forward traffic to.
12007    #[builder(setter(into, strip_option), default)]
12008    pub host: Option<&'a str>,
12009}
12010impl IntoID<Id> for Host {
12011    fn into_id(
12012        self,
12013    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12014        Box::pin(async move { self.id().await })
12015    }
12016}
12017impl Loadable for Host {
12018    fn graphql_type() -> &'static str {
12019        "Host"
12020    }
12021    fn from_query(
12022        proc: Option<Arc<DaggerSessionProc>>,
12023        selection: Selection,
12024        graphql_client: DynGraphQLClient,
12025    ) -> Self {
12026        Self {
12027            proc,
12028            selection,
12029            graphql_client,
12030        }
12031    }
12032}
12033impl Host {
12034    /// A unique identifier for this Host.
12035    pub async fn id(&self) -> Result<Id, DaggerError> {
12036        let query = self.selection.select("id");
12037        query.execute(self.graphql_client.clone()).await
12038    }
12039    /// Accesses a directory on the host.
12040    ///
12041    /// # Arguments
12042    ///
12043    /// * `path` - Location of the directory to access (e.g., ".").
12044    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12045    pub fn directory(&self, path: impl Into<String>) -> Directory {
12046        let mut query = self.selection.select("directory");
12047        query = query.arg("path", path.into());
12048        Directory {
12049            proc: self.proc.clone(),
12050            selection: query,
12051            graphql_client: self.graphql_client.clone(),
12052        }
12053    }
12054    /// Accesses a directory on the host.
12055    ///
12056    /// # Arguments
12057    ///
12058    /// * `path` - Location of the directory to access (e.g., ".").
12059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12060    pub fn directory_opts<'a>(
12061        &self,
12062        path: impl Into<String>,
12063        opts: HostDirectoryOpts<'a>,
12064    ) -> Directory {
12065        let mut query = self.selection.select("directory");
12066        query = query.arg("path", path.into());
12067        if let Some(exclude) = opts.exclude {
12068            query = query.arg("exclude", exclude);
12069        }
12070        if let Some(include) = opts.include {
12071            query = query.arg("include", include);
12072        }
12073        if let Some(no_cache) = opts.no_cache {
12074            query = query.arg("noCache", no_cache);
12075        }
12076        if let Some(gitignore) = opts.gitignore {
12077            query = query.arg("gitignore", gitignore);
12078        }
12079        Directory {
12080            proc: self.proc.clone(),
12081            selection: query,
12082            graphql_client: self.graphql_client.clone(),
12083        }
12084    }
12085    /// Accesses a file on the host.
12086    ///
12087    /// # Arguments
12088    ///
12089    /// * `path` - Location of the file to retrieve (e.g., "README.md").
12090    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12091    pub fn file(&self, path: impl Into<String>) -> File {
12092        let mut query = self.selection.select("file");
12093        query = query.arg("path", path.into());
12094        File {
12095            proc: self.proc.clone(),
12096            selection: query,
12097            graphql_client: self.graphql_client.clone(),
12098        }
12099    }
12100    /// Accesses a file on the host.
12101    ///
12102    /// # Arguments
12103    ///
12104    /// * `path` - Location of the file to retrieve (e.g., "README.md").
12105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12106    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
12107        let mut query = self.selection.select("file");
12108        query = query.arg("path", path.into());
12109        if let Some(no_cache) = opts.no_cache {
12110            query = query.arg("noCache", no_cache);
12111        }
12112        File {
12113            proc: self.proc.clone(),
12114            selection: query,
12115            graphql_client: self.graphql_client.clone(),
12116        }
12117    }
12118    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12119    ///
12120    /// # Arguments
12121    ///
12122    /// * `name` - name of the file or directory to search for
12123    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12124    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
12125        let mut query = self.selection.select("findUp");
12126        query = query.arg("name", name.into());
12127        query.execute(self.graphql_client.clone()).await
12128    }
12129    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12130    ///
12131    /// # Arguments
12132    ///
12133    /// * `name` - name of the file or directory to search for
12134    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12135    pub async fn find_up_opts(
12136        &self,
12137        name: impl Into<String>,
12138        opts: HostFindUpOpts,
12139    ) -> Result<String, DaggerError> {
12140        let mut query = self.selection.select("findUp");
12141        query = query.arg("name", name.into());
12142        if let Some(no_cache) = opts.no_cache {
12143            query = query.arg("noCache", no_cache);
12144        }
12145        query.execute(self.graphql_client.clone()).await
12146    }
12147    /// Accesses a Unix socket on the host.
12148    ///
12149    /// # Arguments
12150    ///
12151    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
12152    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
12153        let mut query = self.selection.select("unixSocket");
12154        query = query.arg("path", path.into());
12155        Socket {
12156            proc: self.proc.clone(),
12157            selection: query,
12158            graphql_client: self.graphql_client.clone(),
12159        }
12160    }
12161    /// Creates a tunnel that forwards traffic from the host to a service.
12162    ///
12163    /// # Arguments
12164    ///
12165    /// * `service` - Service to send traffic from the tunnel.
12166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12167    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
12168        let mut query = self.selection.select("tunnel");
12169        query = query.arg_lazy(
12170            "service",
12171            Box::new(move || {
12172                let service = service.clone();
12173                Box::pin(async move { service.into_id().await.unwrap().quote() })
12174            }),
12175        );
12176        Service {
12177            proc: self.proc.clone(),
12178            selection: query,
12179            graphql_client: self.graphql_client.clone(),
12180        }
12181    }
12182    /// Creates a tunnel that forwards traffic from the host to a service.
12183    ///
12184    /// # Arguments
12185    ///
12186    /// * `service` - Service to send traffic from the tunnel.
12187    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12188    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
12189        let mut query = self.selection.select("tunnel");
12190        query = query.arg_lazy(
12191            "service",
12192            Box::new(move || {
12193                let service = service.clone();
12194                Box::pin(async move { service.into_id().await.unwrap().quote() })
12195            }),
12196        );
12197        if let Some(native) = opts.native {
12198            query = query.arg("native", native);
12199        }
12200        if let Some(ports) = opts.ports {
12201            query = query.arg("ports", ports);
12202        }
12203        Service {
12204            proc: self.proc.clone(),
12205            selection: query,
12206            graphql_client: self.graphql_client.clone(),
12207        }
12208    }
12209    /// Creates a service that forwards traffic to a specified address via the host.
12210    ///
12211    /// # Arguments
12212    ///
12213    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12214    ///
12215    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12216    ///
12217    /// An empty set of ports is not valid; an error will be returned.
12218    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12219    pub fn service(&self, ports: Vec<PortForward>) -> Service {
12220        let mut query = self.selection.select("service");
12221        query = query.arg("ports", ports);
12222        Service {
12223            proc: self.proc.clone(),
12224            selection: query,
12225            graphql_client: self.graphql_client.clone(),
12226        }
12227    }
12228    /// Creates a service that forwards traffic to a specified address via the host.
12229    ///
12230    /// # Arguments
12231    ///
12232    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12233    ///
12234    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12235    ///
12236    /// An empty set of ports is not valid; an error will be returned.
12237    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12238    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
12239        let mut query = self.selection.select("service");
12240        query = query.arg("ports", ports);
12241        if let Some(host) = opts.host {
12242            query = query.arg("host", host);
12243        }
12244        Service {
12245            proc: self.proc.clone(),
12246            selection: query,
12247            graphql_client: self.graphql_client.clone(),
12248        }
12249    }
12250    /// Accesses a container image on the host.
12251    ///
12252    /// # Arguments
12253    ///
12254    /// * `name` - Name of the image to access.
12255    pub fn container_image(&self, name: impl Into<String>) -> Container {
12256        let mut query = self.selection.select("containerImage");
12257        query = query.arg("name", name.into());
12258        Container {
12259            proc: self.proc.clone(),
12260            selection: query,
12261            graphql_client: self.graphql_client.clone(),
12262        }
12263    }
12264}
12265impl Node for Host {
12266    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12267        let query = self.selection.select("id");
12268        let graphql_client = self.graphql_client.clone();
12269        async move { query.execute(graphql_client).await }
12270    }
12271}
12272#[derive(Clone)]
12273pub struct Identifier {
12274    pub proc: Option<Arc<DaggerSessionProc>>,
12275    pub selection: Selection,
12276    pub graphql_client: DynGraphQLClient,
12277}
12278#[derive(Builder, Debug, PartialEq)]
12279pub struct IdentifierFormatOpts {
12280    /// How to write acronyms and terms where a word starts with a capital.
12281    #[builder(setter(into, strip_option), default)]
12282    pub acronyms: Option<AcronymStyle>,
12283}
12284impl IntoID<Id> for Identifier {
12285    fn into_id(
12286        self,
12287    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12288        Box::pin(async move { self.id().await })
12289    }
12290}
12291impl Loadable for Identifier {
12292    fn graphql_type() -> &'static str {
12293        "Identifier"
12294    }
12295    fn from_query(
12296        proc: Option<Arc<DaggerSessionProc>>,
12297        selection: Selection,
12298        graphql_client: DynGraphQLClient,
12299    ) -> Self {
12300        Self {
12301            proc,
12302            selection,
12303            graphql_client,
12304        }
12305    }
12306}
12307impl Identifier {
12308    /// A unique identifier for this Identifier.
12309    pub async fn id(&self) -> Result<Id, DaggerError> {
12310        let query = self.selection.select("id");
12311        query.execute(self.graphql_client.clone()).await
12312    }
12313    /// Format the identifier in a casing.
12314    ///
12315    /// # Arguments
12316    ///
12317    /// * `casing` - The casing to format the identifier in.
12318    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12319    pub async fn format(&self, casing: Casing) -> Result<String, DaggerError> {
12320        let mut query = self.selection.select("format");
12321        query = query.arg("casing", casing);
12322        query.execute(self.graphql_client.clone()).await
12323    }
12324    /// Format the identifier in a casing.
12325    ///
12326    /// # Arguments
12327    ///
12328    /// * `casing` - The casing to format the identifier in.
12329    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12330    pub async fn format_opts(
12331        &self,
12332        casing: Casing,
12333        opts: IdentifierFormatOpts,
12334    ) -> Result<String, DaggerError> {
12335        let mut query = self.selection.select("format");
12336        query = query.arg("casing", casing);
12337        if let Some(acronyms) = opts.acronyms {
12338            query = query.arg("acronyms", acronyms);
12339        }
12340        query.execute(self.graphql_client.clone()).await
12341    }
12342    /// The name as given.
12343    pub async fn name(&self) -> Result<String, DaggerError> {
12344        let query = self.selection.select("name");
12345        query.execute(self.graphql_client.clone()).await
12346    }
12347    /// The words that make up the name, in order.
12348    pub async fn words(&self) -> Result<Vec<IdentifierWord>, DaggerError> {
12349        let query = self.selection.select("words");
12350        let query = query.select("id");
12351        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12352        Ok(ids
12353            .into_iter()
12354            .map(|id| IdentifierWord {
12355                proc: self.proc.clone(),
12356                selection: crate::querybuilder::query()
12357                    .select("node")
12358                    .arg("id", &id.0)
12359                    .inline_fragment("IdentifierWord"),
12360                graphql_client: self.graphql_client.clone(),
12361            })
12362            .collect())
12363    }
12364}
12365impl Node for Identifier {
12366    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12367        let query = self.selection.select("id");
12368        let graphql_client = self.graphql_client.clone();
12369        async move { query.execute(graphql_client).await }
12370    }
12371}
12372#[derive(Clone)]
12373pub struct IdentifierWord {
12374    pub proc: Option<Arc<DaggerSessionProc>>,
12375    pub selection: Selection,
12376    pub graphql_client: DynGraphQLClient,
12377}
12378impl IntoID<Id> for IdentifierWord {
12379    fn into_id(
12380        self,
12381    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12382        Box::pin(async move { self.id().await })
12383    }
12384}
12385impl Loadable for IdentifierWord {
12386    fn graphql_type() -> &'static str {
12387        "IdentifierWord"
12388    }
12389    fn from_query(
12390        proc: Option<Arc<DaggerSessionProc>>,
12391        selection: Selection,
12392        graphql_client: DynGraphQLClient,
12393    ) -> Self {
12394        Self {
12395            proc,
12396            selection,
12397            graphql_client,
12398        }
12399    }
12400}
12401impl IdentifierWord {
12402    /// A unique identifier for this IdentifierWord.
12403    pub async fn id(&self) -> Result<Id, DaggerError> {
12404        let query = self.selection.select("id");
12405        query.execute(self.graphql_client.clone()).await
12406    }
12407    /// The dictionary entry this word matched, if any.
12408    pub async fn term(&self) -> Result<Option<NamingTerm>, DaggerError> {
12409        let query = self.selection.select("term");
12410        let query = query.select("id");
12411        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12412        Ok(id.map(|id| NamingTerm {
12413            proc: self.proc.clone(),
12414            selection: query
12415                .root()
12416                .select("node")
12417                .arg("id", &id.0)
12418                .inline_fragment("NamingTerm"),
12419            graphql_client: self.graphql_client.clone(),
12420        }))
12421    }
12422    /// Standard spelling: "client" (WORD), "HTTP" (ACRONYM), "GitHub" (TERM).
12423    pub async fn text(&self) -> Result<String, DaggerError> {
12424        let query = self.selection.select("text");
12425        query.execute(self.graphql_client.clone()).await
12426    }
12427    /// Trailing digits and/or a plural "s", in that order: SHA+"s", OAuth+"2", HTTP+"2s".
12428    pub async fn suffix(&self) -> Result<String, DaggerError> {
12429        let query = self.selection.select("suffix");
12430        query.execute(self.graphql_client.clone()).await
12431    }
12432    /// The kind of word.
12433    pub async fn kind(&self) -> Result<IdentifierWordKind, DaggerError> {
12434        let query = self.selection.select("kind");
12435        query.execute(self.graphql_client.clone()).await
12436    }
12437}
12438impl Node for IdentifierWord {
12439    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12440        let query = self.selection.select("id");
12441        let graphql_client = self.graphql_client.clone();
12442        async move { query.execute(graphql_client).await }
12443    }
12444}
12445#[derive(Clone)]
12446pub struct InputTypeDef {
12447    pub proc: Option<Arc<DaggerSessionProc>>,
12448    pub selection: Selection,
12449    pub graphql_client: DynGraphQLClient,
12450}
12451impl IntoID<Id> for InputTypeDef {
12452    fn into_id(
12453        self,
12454    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12455        Box::pin(async move { self.id().await })
12456    }
12457}
12458impl Loadable for InputTypeDef {
12459    fn graphql_type() -> &'static str {
12460        "InputTypeDef"
12461    }
12462    fn from_query(
12463        proc: Option<Arc<DaggerSessionProc>>,
12464        selection: Selection,
12465        graphql_client: DynGraphQLClient,
12466    ) -> Self {
12467        Self {
12468            proc,
12469            selection,
12470            graphql_client,
12471        }
12472    }
12473}
12474impl InputTypeDef {
12475    /// A unique identifier for this InputTypeDef.
12476    pub async fn id(&self) -> Result<Id, DaggerError> {
12477        let query = self.selection.select("id");
12478        query.execute(self.graphql_client.clone()).await
12479    }
12480    /// Static fields defined on this input object, if any.
12481    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12482        let query = self.selection.select("fields");
12483        let query = query.select("id");
12484        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12485        Ok(ids
12486            .into_iter()
12487            .map(|id| FieldTypeDef {
12488                proc: self.proc.clone(),
12489                selection: crate::querybuilder::query()
12490                    .select("node")
12491                    .arg("id", &id.0)
12492                    .inline_fragment("FieldTypeDef"),
12493                graphql_client: self.graphql_client.clone(),
12494            })
12495            .collect())
12496    }
12497    /// The name of the input object.
12498    pub async fn name(&self) -> Result<String, DaggerError> {
12499        let query = self.selection.select("name");
12500        query.execute(self.graphql_client.clone()).await
12501    }
12502}
12503impl Node for InputTypeDef {
12504    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12505        let query = self.selection.select("id");
12506        let graphql_client = self.graphql_client.clone();
12507        async move { query.execute(graphql_client).await }
12508    }
12509}
12510#[derive(Clone)]
12511pub struct InterfaceTypeDef {
12512    pub proc: Option<Arc<DaggerSessionProc>>,
12513    pub selection: Selection,
12514    pub graphql_client: DynGraphQLClient,
12515}
12516impl IntoID<Id> for InterfaceTypeDef {
12517    fn into_id(
12518        self,
12519    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12520        Box::pin(async move { self.id().await })
12521    }
12522}
12523impl Loadable for InterfaceTypeDef {
12524    fn graphql_type() -> &'static str {
12525        "InterfaceTypeDef"
12526    }
12527    fn from_query(
12528        proc: Option<Arc<DaggerSessionProc>>,
12529        selection: Selection,
12530        graphql_client: DynGraphQLClient,
12531    ) -> Self {
12532        Self {
12533            proc,
12534            selection,
12535            graphql_client,
12536        }
12537    }
12538}
12539impl InterfaceTypeDef {
12540    /// A unique identifier for this InterfaceTypeDef.
12541    pub async fn id(&self) -> Result<Id, DaggerError> {
12542        let query = self.selection.select("id");
12543        query.execute(self.graphql_client.clone()).await
12544    }
12545    /// Functions defined on this interface, if any.
12546    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12547        let query = self.selection.select("functions");
12548        let query = query.select("id");
12549        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12550        Ok(ids
12551            .into_iter()
12552            .map(|id| Function {
12553                proc: self.proc.clone(),
12554                selection: crate::querybuilder::query()
12555                    .select("node")
12556                    .arg("id", &id.0)
12557                    .inline_fragment("Function"),
12558                graphql_client: self.graphql_client.clone(),
12559            })
12560            .collect())
12561    }
12562    /// The name of the interface.
12563    pub async fn name(&self) -> Result<String, DaggerError> {
12564        let query = self.selection.select("name");
12565        query.execute(self.graphql_client.clone()).await
12566    }
12567    /// The doc string for the interface, if any.
12568    pub async fn description(&self) -> Result<String, DaggerError> {
12569        let query = self.selection.select("description");
12570        query.execute(self.graphql_client.clone()).await
12571    }
12572    /// The location of this interface declaration.
12573    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12574        let query = self.selection.select("sourceMap");
12575        let query = query.select("id");
12576        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12577        Ok(id.map(|id| SourceMap {
12578            proc: self.proc.clone(),
12579            selection: query
12580                .root()
12581                .select("node")
12582                .arg("id", &id.0)
12583                .inline_fragment("SourceMap"),
12584            graphql_client: self.graphql_client.clone(),
12585        }))
12586    }
12587    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
12588    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12589        let query = self.selection.select("sourceModuleName");
12590        query.execute(self.graphql_client.clone()).await
12591    }
12592}
12593impl Node for InterfaceTypeDef {
12594    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12595        let query = self.selection.select("id");
12596        let graphql_client = self.graphql_client.clone();
12597        async move { query.execute(graphql_client).await }
12598    }
12599}
12600#[derive(Clone)]
12601pub struct JsonValue {
12602    pub proc: Option<Arc<DaggerSessionProc>>,
12603    pub selection: Selection,
12604    pub graphql_client: DynGraphQLClient,
12605}
12606#[derive(Builder, Debug, PartialEq)]
12607pub struct JsonValueContentsOpts<'a> {
12608    /// Optional line prefix
12609    #[builder(setter(into, strip_option), default)]
12610    pub indent: Option<&'a str>,
12611    /// Pretty-print
12612    #[builder(setter(into, strip_option), default)]
12613    pub pretty: Option<bool>,
12614}
12615impl IntoID<Id> for JsonValue {
12616    fn into_id(
12617        self,
12618    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12619        Box::pin(async move { self.id().await })
12620    }
12621}
12622impl Loadable for JsonValue {
12623    fn graphql_type() -> &'static str {
12624        "JSONValue"
12625    }
12626    fn from_query(
12627        proc: Option<Arc<DaggerSessionProc>>,
12628        selection: Selection,
12629        graphql_client: DynGraphQLClient,
12630    ) -> Self {
12631        Self {
12632            proc,
12633            selection,
12634            graphql_client,
12635        }
12636    }
12637}
12638impl JsonValue {
12639    /// A unique identifier for this JSONValue.
12640    pub async fn id(&self) -> Result<Id, DaggerError> {
12641        let query = self.selection.select("id");
12642        query.execute(self.graphql_client.clone()).await
12643    }
12644    /// Return the value encoded as json
12645    ///
12646    /// # Arguments
12647    ///
12648    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12649    pub async fn contents(&self) -> Result<Json, DaggerError> {
12650        let query = self.selection.select("contents");
12651        query.execute(self.graphql_client.clone()).await
12652    }
12653    /// Return the value encoded as json
12654    ///
12655    /// # Arguments
12656    ///
12657    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12658    pub async fn contents_opts<'a>(
12659        &self,
12660        opts: JsonValueContentsOpts<'a>,
12661    ) -> Result<Json, DaggerError> {
12662        let mut query = self.selection.select("contents");
12663        if let Some(pretty) = opts.pretty {
12664            query = query.arg("pretty", pretty);
12665        }
12666        if let Some(indent) = opts.indent {
12667            query = query.arg("indent", indent);
12668        }
12669        query.execute(self.graphql_client.clone()).await
12670    }
12671    /// Return a new json value, decoded from the given content
12672    ///
12673    /// # Arguments
12674    ///
12675    /// * `contents` - New JSON-encoded contents
12676    pub fn with_contents(&self, contents: Json) -> JsonValue {
12677        let mut query = self.selection.select("withContents");
12678        query = query.arg("contents", contents);
12679        JsonValue {
12680            proc: self.proc.clone(),
12681            selection: query,
12682            graphql_client: self.graphql_client.clone(),
12683        }
12684    }
12685    /// Encode an integer to json
12686    ///
12687    /// # Arguments
12688    ///
12689    /// * `value` - New integer value
12690    pub fn new_integer(&self, value: isize) -> JsonValue {
12691        let mut query = self.selection.select("newInteger");
12692        query = query.arg("value", value);
12693        JsonValue {
12694            proc: self.proc.clone(),
12695            selection: query,
12696            graphql_client: self.graphql_client.clone(),
12697        }
12698    }
12699    /// Decode an integer from json
12700    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
12701        let query = self.selection.select("asInteger");
12702        query.execute(self.graphql_client.clone()).await
12703    }
12704    /// Encode a string to json
12705    ///
12706    /// # Arguments
12707    ///
12708    /// * `value` - New string value
12709    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
12710        let mut query = self.selection.select("newString");
12711        query = query.arg("value", value.into());
12712        JsonValue {
12713            proc: self.proc.clone(),
12714            selection: query,
12715            graphql_client: self.graphql_client.clone(),
12716        }
12717    }
12718    /// Decode a string from json
12719    pub async fn as_string(&self) -> Result<String, DaggerError> {
12720        let query = self.selection.select("asString");
12721        query.execute(self.graphql_client.clone()).await
12722    }
12723    /// Encode a boolean to json
12724    ///
12725    /// # Arguments
12726    ///
12727    /// * `value` - New boolean value
12728    pub fn new_boolean(&self, value: bool) -> JsonValue {
12729        let mut query = self.selection.select("newBoolean");
12730        query = query.arg("value", value);
12731        JsonValue {
12732            proc: self.proc.clone(),
12733            selection: query,
12734            graphql_client: self.graphql_client.clone(),
12735        }
12736    }
12737    /// Decode a boolean from json
12738    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
12739        let query = self.selection.select("asBoolean");
12740        query.execute(self.graphql_client.clone()).await
12741    }
12742    /// Decode an array from json
12743    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
12744        let query = self.selection.select("asArray");
12745        let query = query.select("id");
12746        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12747        Ok(ids
12748            .into_iter()
12749            .map(|id| JsonValue {
12750                proc: self.proc.clone(),
12751                selection: crate::querybuilder::query()
12752                    .select("node")
12753                    .arg("id", &id.0)
12754                    .inline_fragment("JSONValue"),
12755                graphql_client: self.graphql_client.clone(),
12756            })
12757            .collect())
12758    }
12759    /// List fields of the encoded object
12760    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
12761        let query = self.selection.select("fields");
12762        query.execute(self.graphql_client.clone()).await
12763    }
12764    /// Lookup the field at the given path, and return its value.
12765    ///
12766    /// # Arguments
12767    ///
12768    /// * `path` - Path of the field to lookup, encoded as an array of field names
12769    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
12770        let mut query = self.selection.select("field");
12771        query = query.arg(
12772            "path",
12773            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12774        );
12775        JsonValue {
12776            proc: self.proc.clone(),
12777            selection: query,
12778            graphql_client: self.graphql_client.clone(),
12779        }
12780    }
12781    /// Set a new field at the given path
12782    ///
12783    /// # Arguments
12784    ///
12785    /// * `path` - Path of the field to set, encoded as an array of field names
12786    /// * `value` - The new value of the field
12787    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
12788        let mut query = self.selection.select("withField");
12789        query = query.arg(
12790            "path",
12791            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12792        );
12793        query = query.arg_lazy(
12794            "value",
12795            Box::new(move || {
12796                let value = value.clone();
12797                Box::pin(async move { value.into_id().await.unwrap().quote() })
12798            }),
12799        );
12800        JsonValue {
12801            proc: self.proc.clone(),
12802            selection: query,
12803            graphql_client: self.graphql_client.clone(),
12804        }
12805    }
12806}
12807impl Node for JsonValue {
12808    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12809        let query = self.selection.select("id");
12810        let graphql_client = self.graphql_client.clone();
12811        async move { query.execute(graphql_client).await }
12812    }
12813}
12814#[derive(Clone)]
12815pub struct Llm {
12816    pub proc: Option<Arc<DaggerSessionProc>>,
12817    pub selection: Selection,
12818    pub graphql_client: DynGraphQLClient,
12819}
12820#[derive(Builder, Debug, PartialEq)]
12821pub struct LlmArtifactsOpts<'a> {
12822    /// Only include artifacts matching these path patterns, as with Workspace.artifacts. A path selects that path and its children.
12823    #[builder(setter(into, strip_option), default)]
12824    pub include: Option<Vec<&'a str>>,
12825}
12826#[derive(Builder, Debug, PartialEq)]
12827pub struct LlmWithModelOpts<'a> {
12828    /// 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.
12829    #[builder(setter(into, strip_option), default)]
12830    pub provider: Option<&'a str>,
12831}
12832#[derive(Builder, Debug, PartialEq)]
12833pub struct LlmWithPromptOpts {
12834    /// 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.
12835    #[builder(setter(into, strip_option), default)]
12836    pub origin: Option<LlmMessageOriginInput>,
12837}
12838#[derive(Builder, Debug, PartialEq)]
12839pub struct LlmWithContentOpts {
12840    /// The message's recorded provenance.
12841    #[builder(setter(into, strip_option), default)]
12842    pub origin: Option<LlmMessageOriginInput>,
12843}
12844#[derive(Builder, Debug, PartialEq)]
12845pub struct LlmWithContentFileOpts<'a> {
12846    /// The media MIME type; inferred from the file's contents when omitted.
12847    #[builder(setter(into, strip_option), default)]
12848    pub mime_type: Option<&'a str>,
12849}
12850#[derive(Builder, Debug, PartialEq)]
12851pub struct LlmWithResponseOpts {
12852    /// Cached input tokens read
12853    #[builder(setter(into, strip_option), default)]
12854    pub cached_token_reads: Option<isize>,
12855    /// Cached input tokens written
12856    #[builder(setter(into, strip_option), default)]
12857    pub cached_token_writes: Option<isize>,
12858    /// Uncached input tokens sent
12859    #[builder(setter(into, strip_option), default)]
12860    pub input_tokens: Option<isize>,
12861    /// Tokens received from the model, including text and tool calls
12862    #[builder(setter(into, strip_option), default)]
12863    pub output_tokens: Option<isize>,
12864    /// Total tokens consumed by this response
12865    #[builder(setter(into, strip_option), default)]
12866    pub total_tokens: Option<isize>,
12867}
12868#[derive(Builder, Debug, PartialEq)]
12869pub struct LlmWithToolResultOpts {
12870    /// Ordered text and media returned by the tool
12871    #[builder(setter(into, strip_option), default)]
12872    pub blocks: Option<Vec<LlmContentBlockInput>>,
12873}
12874#[derive(Builder, Debug, PartialEq)]
12875pub struct LlmWithToolsOpts<'a> {
12876    /// Method names to exclude from the toolset (e.g. constructors, entrypoints).
12877    #[builder(setter(into, strip_option), default)]
12878    pub except: Option<Vec<&'a str>>,
12879    /// 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.
12880    #[builder(setter(into, strip_option), default)]
12881    pub version: Option<isize>,
12882}
12883#[derive(Builder, Debug, PartialEq)]
12884pub struct LlmLoopOpts {
12885    /// Cap the number of steps. The loop fails if the cap is reached before the model ends its turn.
12886    #[builder(setter(into, strip_option), default)]
12887    pub max_steps: Option<isize>,
12888    /// Cap the model's output tokens on each step. Defaults to the model's maximum.
12889    #[builder(setter(into, strip_option), default)]
12890    pub max_tokens: Option<isize>,
12891}
12892#[derive(Builder, Debug, PartialEq)]
12893pub struct LlmStepOpts {
12894    /// Cap the model's output tokens for this step. Defaults to the model's maximum.
12895    #[builder(setter(into, strip_option), default)]
12896    pub max_tokens: Option<isize>,
12897}
12898#[derive(Builder, Debug, PartialEq)]
12899pub struct LlmSpawnOpts<'a> {
12900    /// The loop error to create the agent with, for state FAILED. Refused with any other state.
12901    #[builder(setter(into, strip_option), default)]
12902    pub error: Option<&'a str>,
12903    /// Expertise to compose into the new agent's conversation. Agent arguments receive the new agent, which cannot be used until composition completes; if composition fails, the agent is left STOPPED.
12904    #[builder(setter(into, strip_option), default)]
12905    pub expertise: Option<Vec<Id>>,
12906    /// 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.
12907    #[builder(setter(into, strip_option), default)]
12908    pub handle: Option<&'a str>,
12909    /// Display label for the agent — telemetry and error messages; carries no identity. Defaults to a short name derived from the conversation.
12910    #[builder(setter(into, strip_option), default)]
12911    pub name: Option<&'a str>,
12912    /// 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.
12913    #[builder(setter(into, strip_option), default)]
12914    pub parent_handle: Option<&'a str>,
12915    /// 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.
12916    /// 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.
12917    #[builder(setter(into, strip_option), default)]
12918    pub state: Option<AgentState>,
12919}
12920impl IntoID<Id> for Llm {
12921    fn into_id(
12922        self,
12923    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12924        Box::pin(async move { self.id().await })
12925    }
12926}
12927impl Loadable for Llm {
12928    fn graphql_type() -> &'static str {
12929        "LLM"
12930    }
12931    fn from_query(
12932        proc: Option<Arc<DaggerSessionProc>>,
12933        selection: Selection,
12934        graphql_client: DynGraphQLClient,
12935    ) -> Self {
12936        Self {
12937            proc,
12938            selection,
12939            graphql_client,
12940        }
12941    }
12942}
12943impl Llm {
12944    /// A unique identifier for this LLM.
12945    pub async fn id(&self) -> Result<Id, DaggerError> {
12946        let query = self.selection.select("id");
12947        query.execute(self.graphql_client.clone()).await
12948    }
12949    /// Expertise composed into this conversation, in order.
12950    pub async fn expertise(&self) -> Result<Vec<Expertise>, DaggerError> {
12951        let query = self.selection.select("expertise");
12952        let query = query.select("id");
12953        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12954        Ok(ids
12955            .into_iter()
12956            .map(|id| Expertise {
12957                proc: self.proc.clone(),
12958                selection: crate::querybuilder::query()
12959                    .select("node")
12960                    .arg("id", &id.0)
12961                    .inline_fragment("Expertise"),
12962                graphql_client: self.graphql_client.clone(),
12963            })
12964            .collect())
12965    }
12966    /// Run expertise on this conversation, passing it through each function in order, and record it in expertise.
12967    /// Composing an entry that is already recorded refreshes its module: the module's contributions are cleared, all of its recorded entries run again, and compatible tool state is kept. Other contributions are untouched.
12968    /// Agent arguments receive the agent that owns this conversation. Without one, entries requiring an Agent are skipped.
12969    ///
12970    /// # Arguments
12971    ///
12972    /// * `expertise` - The expertise to run. Each reference retains its source workspace.
12973    pub fn compose(&self, expertise: Vec<Id>) -> Llm {
12974        let mut query = self.selection.select("compose");
12975        query = query.arg("expertise", expertise);
12976        Llm {
12977            proc: self.proc.clone(),
12978            selection: query,
12979            graphql_client: self.graphql_client.clone(),
12980        }
12981    }
12982    /// The model the conversation is running against, after resolving any configured default.
12983    pub async fn model(&self) -> Result<String, DaggerError> {
12984        let query = self.selection.select("model");
12985        query.execute(self.graphql_client.clone()).await
12986    }
12987    /// The provider serving the model, e.g. "anthropic", "openai", "google", or "local".
12988    pub async fn provider(&self) -> Result<String, DaggerError> {
12989        let query = self.selection.select("provider");
12990        query.execute(self.graphql_client.clone()).await
12991    }
12992    /// The model's total context window in tokens, or null if unknown (e.g. a local or uncatalogued model).
12993    pub async fn context_window(&self) -> Result<isize, DaggerError> {
12994        let query = self.selection.select("contextWindow");
12995        query.execute(self.graphql_client.clone()).await
12996    }
12997    /// The full message history, as structured messages.
12998    pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
12999        let query = self.selection.select("messages");
13000        let query = query.select("id");
13001        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13002        Ok(ids
13003            .into_iter()
13004            .map(|id| LlmMessage {
13005                proc: self.proc.clone(),
13006                selection: crate::querybuilder::query()
13007                    .select("node")
13008                    .arg("id", &id.0)
13009                    .inline_fragment("LLMMessage"),
13010                graphql_client: self.graphql_client.clone(),
13011            })
13012            .collect())
13013    }
13014    /// The message history rendered as a plain-text transcript, suitable for feeding back to an LLM (e.g. for summarization).
13015    pub async fn transcript(&self) -> Result<String, DaggerError> {
13016        let query = self.selection.select("transcript");
13017        query.execute(self.graphql_client.clone()).await
13018    }
13019    /// Clear the message history, keeping only the system prompts.
13020    pub fn without_message_history(&self) -> Llm {
13021        let query = self.selection.select("withoutMessageHistory");
13022        Llm {
13023            proc: self.proc.clone(),
13024            selection: query,
13025            graphql_client: self.graphql_client.clone(),
13026        }
13027    }
13028    /// Clear the user-added system prompts, keeping only the default system prompt.
13029    pub fn without_system_prompts(&self) -> Llm {
13030        let query = self.selection.select("withoutSystemPrompts");
13031        Llm {
13032            proc: self.proc.clone(),
13033            selection: query,
13034            graphql_client: self.graphql_client.clone(),
13035        }
13036    }
13037    /// The text of the model's most recent reply.
13038    pub async fn last_reply(&self) -> Result<String, DaggerError> {
13039        let query = self.selection.select("lastReply");
13040        query.execute(self.graphql_client.clone()).await
13041    }
13042    /// Bind the LLM to a workspace, exposing its modules as tools exactly as the Dagger CLI would serve them for that workspace.
13043    ///
13044    /// # Arguments
13045    ///
13046    /// * `workspace` - The workspace to work in.
13047    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
13048        let mut query = self.selection.select("withWorkspace");
13049        query = query.arg_lazy(
13050            "workspace",
13051            Box::new(move || {
13052                let workspace = workspace.clone();
13053                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
13054            }),
13055        );
13056        Llm {
13057            proc: self.proc.clone(),
13058            selection: query,
13059            graphql_client: self.graphql_client.clone(),
13060        }
13061    }
13062    /// Return the workspace the LLM is bound to.
13063    pub fn workspace(&self) -> Workspace {
13064        let query = self.selection.select("workspace");
13065        Workspace {
13066            proc: self.proc.clone(),
13067            selection: query,
13068            graphql_client: self.graphql_client.clone(),
13069        }
13070    }
13071    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
13072    /// 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.
13073    /// 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.
13074    /// 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.
13075    ///
13076    /// # Arguments
13077    ///
13078    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13079    pub fn artifacts(&self) -> Artifacts {
13080        let query = self.selection.select("artifacts");
13081        Artifacts {
13082            proc: self.proc.clone(),
13083            selection: query,
13084            graphql_client: self.graphql_client.clone(),
13085        }
13086    }
13087    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
13088    /// 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.
13089    /// 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.
13090    /// 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.
13091    ///
13092    /// # Arguments
13093    ///
13094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13095    pub fn artifacts_opts<'a>(&self, opts: LlmArtifactsOpts<'a>) -> Artifacts {
13096        let mut query = self.selection.select("artifacts");
13097        if let Some(include) = opts.include {
13098            query = query.arg("include", include);
13099        }
13100        Artifacts {
13101            proc: self.proc.clone(),
13102            selection: query,
13103            graphql_client: self.graphql_client.clone(),
13104        }
13105    }
13106    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
13107    ///
13108    /// # Arguments
13109    ///
13110    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
13111    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13112    pub fn with_model(&self, model: impl Into<String>) -> Llm {
13113        let mut query = self.selection.select("withModel");
13114        query = query.arg("model", model.into());
13115        Llm {
13116            proc: self.proc.clone(),
13117            selection: query,
13118            graphql_client: self.graphql_client.clone(),
13119        }
13120    }
13121    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
13122    ///
13123    /// # Arguments
13124    ///
13125    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
13126    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13127    pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
13128        let mut query = self.selection.select("withModel");
13129        query = query.arg("model", model.into());
13130        if let Some(provider) = opts.provider {
13131            query = query.arg("provider", provider);
13132        }
13133        Llm {
13134            proc: self.proc.clone(),
13135            selection: query,
13136            graphql_client: self.graphql_client.clone(),
13137        }
13138    }
13139    /// 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.
13140    pub fn with_small_model(&self) -> Llm {
13141        let query = self.selection.select("withSmallModel");
13142        Llm {
13143            proc: self.proc.clone(),
13144            selection: query,
13145            graphql_client: self.graphql_client.clone(),
13146        }
13147    }
13148    /// The reasoning effort in use, e.g. "low", "medium", or "high". Empty or "none" when reasoning is disabled.
13149    pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
13150        let query = self.selection.select("reasoningEffort");
13151        query.execute(self.graphql_client.clone()).await
13152    }
13153    /// 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.
13154    ///
13155    /// # Arguments
13156    ///
13157    /// * `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".
13158    pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
13159        let mut query = self.selection.select("withReasoningEffort");
13160        query = query.arg("effort", effort.into());
13161        Llm {
13162            proc: self.proc.clone(),
13163            selection: query,
13164            graphql_client: self.graphql_client.clone(),
13165        }
13166    }
13167    /// Queue a user prompt, to be sent to the model on the next step or loop.
13168    ///
13169    /// # Arguments
13170    ///
13171    /// * `prompt` - The prompt to send
13172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13173    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
13174        let mut query = self.selection.select("withPrompt");
13175        query = query.arg("prompt", prompt.into());
13176        Llm {
13177            proc: self.proc.clone(),
13178            selection: query,
13179            graphql_client: self.graphql_client.clone(),
13180        }
13181    }
13182    /// Queue a user prompt, to be sent to the model on the next step or loop.
13183    ///
13184    /// # Arguments
13185    ///
13186    /// * `prompt` - The prompt to send
13187    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13188    pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
13189        let mut query = self.selection.select("withPrompt");
13190        query = query.arg("prompt", prompt.into());
13191        if let Some(origin) = opts.origin {
13192            query = query.arg("origin", origin);
13193        }
13194        Llm {
13195            proc: self.proc.clone(),
13196            selection: query,
13197            graphql_client: self.graphql_client.clone(),
13198        }
13199    }
13200    /// Queue one user message containing ordered text and media blocks.
13201    ///
13202    /// # Arguments
13203    ///
13204    /// * `content` - The ordered message content.
13205    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13206    pub fn with_content(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13207        let mut query = self.selection.select("withContent");
13208        query = query.arg("content", content);
13209        Llm {
13210            proc: self.proc.clone(),
13211            selection: query,
13212            graphql_client: self.graphql_client.clone(),
13213        }
13214    }
13215    /// Queue one user message containing ordered text and media blocks.
13216    ///
13217    /// # Arguments
13218    ///
13219    /// * `content` - The ordered message content.
13220    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13221    pub fn with_content_opts(
13222        &self,
13223        content: Vec<LlmContentBlockInput>,
13224        opts: LlmWithContentOpts,
13225    ) -> Llm {
13226        let mut query = self.selection.select("withContent");
13227        query = query.arg("content", content);
13228        if let Some(origin) = opts.origin {
13229            query = query.arg("origin", origin);
13230        }
13231        Llm {
13232            proc: self.proc.clone(),
13233            selection: query,
13234            graphql_client: self.graphql_client.clone(),
13235        }
13236    }
13237    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
13238    ///
13239    /// # Arguments
13240    ///
13241    /// * `file` - The media file.
13242    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13243    pub fn with_content_file(&self, file: impl IntoID<Id>) -> Llm {
13244        let mut query = self.selection.select("withContentFile");
13245        query = query.arg_lazy(
13246            "file",
13247            Box::new(move || {
13248                let file = file.clone();
13249                Box::pin(async move { file.into_id().await.unwrap().quote() })
13250            }),
13251        );
13252        Llm {
13253            proc: self.proc.clone(),
13254            selection: query,
13255            graphql_client: self.graphql_client.clone(),
13256        }
13257    }
13258    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
13259    ///
13260    /// # Arguments
13261    ///
13262    /// * `file` - The media file.
13263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13264    pub fn with_content_file_opts<'a>(
13265        &self,
13266        file: impl IntoID<Id>,
13267        opts: LlmWithContentFileOpts<'a>,
13268    ) -> Llm {
13269        let mut query = self.selection.select("withContentFile");
13270        query = query.arg_lazy(
13271            "file",
13272            Box::new(move || {
13273                let file = file.clone();
13274                Box::pin(async move { file.into_id().await.unwrap().quote() })
13275            }),
13276        );
13277        if let Some(mime_type) = opts.mime_type {
13278            query = query.arg("mimeType", mime_type);
13279        }
13280        Llm {
13281            proc: self.proc.clone(),
13282            selection: query,
13283            graphql_client: self.graphql_client.clone(),
13284        }
13285    }
13286    /// Queue a file's contents as a user prompt, like withPrompt.
13287    ///
13288    /// # Arguments
13289    ///
13290    /// * `file` - The file to read the prompt from
13291    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
13292        let mut query = self.selection.select("withPromptFile");
13293        query = query.arg_lazy(
13294            "file",
13295            Box::new(move || {
13296                let file = file.clone();
13297                Box::pin(async move { file.into_id().await.unwrap().quote() })
13298            }),
13299        );
13300        Llm {
13301            proc: self.proc.clone(),
13302            selection: query,
13303            graphql_client: self.graphql_client.clone(),
13304        }
13305    }
13306    /// Add a system prompt, instructing the model across the whole conversation.
13307    ///
13308    /// # Arguments
13309    ///
13310    /// * `prompt` - The system prompt to send
13311    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
13312        let mut query = self.selection.select("withSystemPrompt");
13313        query = query.arg("prompt", prompt.into());
13314        Llm {
13315            proc: self.proc.clone(),
13316            selection: query,
13317            graphql_client: self.graphql_client.clone(),
13318        }
13319    }
13320    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
13321    ///
13322    /// # Arguments
13323    ///
13324    /// * `content` - The response content
13325    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13326    pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13327        let mut query = self.selection.select("withResponse");
13328        query = query.arg("content", content);
13329        Llm {
13330            proc: self.proc.clone(),
13331            selection: query,
13332            graphql_client: self.graphql_client.clone(),
13333        }
13334    }
13335    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
13336    ///
13337    /// # Arguments
13338    ///
13339    /// * `content` - The response content
13340    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13341    pub fn with_response_opts(
13342        &self,
13343        content: Vec<LlmContentBlockInput>,
13344        opts: LlmWithResponseOpts,
13345    ) -> Llm {
13346        let mut query = self.selection.select("withResponse");
13347        query = query.arg("content", content);
13348        if let Some(input_tokens) = opts.input_tokens {
13349            query = query.arg("inputTokens", input_tokens);
13350        }
13351        if let Some(output_tokens) = opts.output_tokens {
13352            query = query.arg("outputTokens", output_tokens);
13353        }
13354        if let Some(cached_token_reads) = opts.cached_token_reads {
13355            query = query.arg("cachedTokenReads", cached_token_reads);
13356        }
13357        if let Some(cached_token_writes) = opts.cached_token_writes {
13358            query = query.arg("cachedTokenWrites", cached_token_writes);
13359        }
13360        if let Some(total_tokens) = opts.total_tokens {
13361            query = query.arg("totalTokens", total_tokens);
13362        }
13363        Llm {
13364            proc: self.proc.clone(),
13365            selection: query,
13366            graphql_client: self.graphql_client.clone(),
13367        }
13368    }
13369    /// Append the result of a tool call to the message history.
13370    ///
13371    /// # Arguments
13372    ///
13373    /// * `call_id` - The ID of the tool call this result responds to
13374    /// * `content` - Text returned by the tool, placed before blocks
13375    /// * `errored` - Whether the tool call resulted in an error
13376    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13377    pub fn with_tool_result(
13378        &self,
13379        call_id: impl Into<String>,
13380        content: impl Into<String>,
13381        errored: bool,
13382    ) -> Llm {
13383        let mut query = self.selection.select("withToolResult");
13384        query = query.arg("callId", call_id.into());
13385        query = query.arg("content", content.into());
13386        query = query.arg("errored", errored);
13387        Llm {
13388            proc: self.proc.clone(),
13389            selection: query,
13390            graphql_client: self.graphql_client.clone(),
13391        }
13392    }
13393    /// Append the result of a tool call to the message history.
13394    ///
13395    /// # Arguments
13396    ///
13397    /// * `call_id` - The ID of the tool call this result responds to
13398    /// * `content` - Text returned by the tool, placed before blocks
13399    /// * `errored` - Whether the tool call resulted in an error
13400    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13401    pub fn with_tool_result_opts(
13402        &self,
13403        call_id: impl Into<String>,
13404        content: impl Into<String>,
13405        errored: bool,
13406        opts: LlmWithToolResultOpts,
13407    ) -> Llm {
13408        let mut query = self.selection.select("withToolResult");
13409        query = query.arg("callId", call_id.into());
13410        query = query.arg("content", content.into());
13411        query = query.arg("errored", errored);
13412        if let Some(blocks) = opts.blocks {
13413            query = query.arg("blocks", blocks);
13414        }
13415        Llm {
13416            proc: self.proc.clone(),
13417            selection: query,
13418            graphql_client: self.graphql_client.clone(),
13419        }
13420    }
13421    /// 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.
13422    ///
13423    /// # Arguments
13424    ///
13425    /// * `object` - The object whose methods become tools.
13426    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13427    pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
13428        let mut query = self.selection.select("withTools");
13429        query = query.arg_lazy(
13430            "object",
13431            Box::new(move || {
13432                let object = object.clone();
13433                Box::pin(async move { object.into_id().await.unwrap().quote() })
13434            }),
13435        );
13436        Llm {
13437            proc: self.proc.clone(),
13438            selection: query,
13439            graphql_client: self.graphql_client.clone(),
13440        }
13441    }
13442    /// 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.
13443    ///
13444    /// # Arguments
13445    ///
13446    /// * `object` - The object whose methods become tools.
13447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13448    pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
13449        let mut query = self.selection.select("withTools");
13450        query = query.arg_lazy(
13451            "object",
13452            Box::new(move || {
13453                let object = object.clone();
13454                Box::pin(async move { object.into_id().await.unwrap().quote() })
13455            }),
13456        );
13457        if let Some(except) = opts.except {
13458            query = query.arg("except", except);
13459        }
13460        if let Some(version) = opts.version {
13461            query = query.arg("version", version);
13462        }
13463        Llm {
13464            proc: self.proc.clone(),
13465            selection: query,
13466            graphql_client: self.graphql_client.clone(),
13467        }
13468    }
13469    /// Disable the default system prompt
13470    pub fn without_default_system_prompt(&self) -> Llm {
13471        let query = self.selection.select("withoutDefaultSystemPrompt");
13472        Llm {
13473            proc: self.proc.clone(),
13474            selection: query,
13475            graphql_client: self.graphql_client.clone(),
13476        }
13477    }
13478    /// Add an external MCP server to the LLM
13479    ///
13480    /// # Arguments
13481    ///
13482    /// * `name` - The name of the MCP server
13483    /// * `service` - The MCP service to run and communicate with over stdio
13484    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
13485        let mut query = self.selection.select("withMCPServer");
13486        query = query.arg("name", name.into());
13487        query = query.arg_lazy(
13488            "service",
13489            Box::new(move || {
13490                let service = service.clone();
13491                Box::pin(async move { service.into_id().await.unwrap().quote() })
13492            }),
13493        );
13494        Llm {
13495            proc: self.proc.clone(),
13496            selection: query,
13497            graphql_client: self.graphql_client.clone(),
13498        }
13499    }
13500    /// 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.
13501    ///
13502    /// # Arguments
13503    ///
13504    /// * `directory` - A directory containing skills, each a subdirectory holding a SKILL.md.
13505    pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
13506        let mut query = self.selection.select("withSkills");
13507        query = query.arg_lazy(
13508            "directory",
13509            Box::new(move || {
13510                let directory = directory.clone();
13511                Box::pin(async move { directory.into_id().await.unwrap().quote() })
13512            }),
13513        );
13514        Llm {
13515            proc: self.proc.clone(),
13516            selection: query,
13517            graphql_client: self.graphql_client.clone(),
13518        }
13519    }
13520    /// 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.
13521    pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
13522        let query = self.selection.select("skills");
13523        let query = query.select("id");
13524        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13525        Ok(ids
13526            .into_iter()
13527            .map(|id| LlmSkill {
13528                proc: self.proc.clone(),
13529                selection: crate::querybuilder::query()
13530                    .select("node")
13531                    .arg("id", &id.0)
13532                    .inline_fragment("LLMSkill"),
13533                graphql_client: self.graphql_client.clone(),
13534            })
13535            .collect())
13536    }
13537    /// Force evaluation of the conversation's pending operations (prompts, steps, loops) in the engine.
13538    pub async fn sync(&self) -> Result<Llm, DaggerError> {
13539        let query = self.selection.select("sync");
13540        let id: Id = query.execute(self.graphql_client.clone()).await?;
13541        Ok(Llm {
13542            proc: self.proc.clone(),
13543            selection: query
13544                .root()
13545                .select("node")
13546                .arg("id", &id.0)
13547                .inline_fragment("LLM"),
13548            graphql_client: self.graphql_client.clone(),
13549        })
13550    }
13551    /// 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.
13552    ///
13553    /// # Arguments
13554    ///
13555    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13556    pub fn r#loop(&self) -> Llm {
13557        let query = self.selection.select("loop");
13558        Llm {
13559            proc: self.proc.clone(),
13560            selection: query,
13561            graphql_client: self.graphql_client.clone(),
13562        }
13563    }
13564    /// 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.
13565    ///
13566    /// # Arguments
13567    ///
13568    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13569    pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
13570        let mut query = self.selection.select("loop");
13571        if let Some(max_steps) = opts.max_steps {
13572            query = query.arg("maxSteps", max_steps);
13573        }
13574        if let Some(max_tokens) = opts.max_tokens {
13575            query = query.arg("maxTokens", max_tokens);
13576        }
13577        Llm {
13578            proc: self.proc.clone(),
13579            selection: query,
13580            graphql_client: self.graphql_client.clone(),
13581        }
13582    }
13583    /// 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.
13584    ///
13585    /// # Arguments
13586    ///
13587    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13588    pub fn step(&self) -> Llm {
13589        let query = self.selection.select("step");
13590        Llm {
13591            proc: self.proc.clone(),
13592            selection: query,
13593            graphql_client: self.graphql_client.clone(),
13594        }
13595    }
13596    /// 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.
13597    ///
13598    /// # Arguments
13599    ///
13600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13601    pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
13602        let mut query = self.selection.select("step");
13603        if let Some(max_tokens) = opts.max_tokens {
13604            query = query.arg("maxTokens", max_tokens);
13605        }
13606        Llm {
13607            proc: self.proc.clone(),
13608            selection: query,
13609            graphql_client: self.graphql_client.clone(),
13610        }
13611    }
13612    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13613    /// 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.
13614    /// 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.
13615    /// 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.
13616    ///
13617    /// # Arguments
13618    ///
13619    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13620    pub async fn spawn(&self) -> Result<Agent, DaggerError> {
13621        let query = self.selection.select("spawn");
13622        let id: Id = query.execute(self.graphql_client.clone()).await?;
13623        Ok(Agent {
13624            proc: self.proc.clone(),
13625            selection: query
13626                .root()
13627                .select("node")
13628                .arg("id", &id.0)
13629                .inline_fragment("Agent"),
13630            graphql_client: self.graphql_client.clone(),
13631        })
13632    }
13633    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13634    /// 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.
13635    /// 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.
13636    /// 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.
13637    ///
13638    /// # Arguments
13639    ///
13640    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13641    pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
13642        let mut query = self.selection.select("spawn");
13643        if let Some(expertise) = opts.expertise {
13644            query = query.arg("expertise", expertise);
13645        }
13646        if let Some(name) = opts.name {
13647            query = query.arg("name", name);
13648        }
13649        if let Some(handle) = opts.handle {
13650            query = query.arg("handle", handle);
13651        }
13652        if let Some(state) = opts.state {
13653            query = query.arg("state", state);
13654        }
13655        if let Some(parent_handle) = opts.parent_handle {
13656            query = query.arg("parentHandle", parent_handle);
13657        }
13658        if let Some(error) = opts.error {
13659            query = query.arg("error", error);
13660        }
13661        let id: Id = query.execute(self.graphql_client.clone()).await?;
13662        Ok(Agent {
13663            proc: self.proc.clone(),
13664            selection: query
13665                .root()
13666                .select("node")
13667                .arg("id", &id.0)
13668                .inline_fragment("Agent"),
13669            graphql_client: self.graphql_client.clone(),
13670        })
13671    }
13672    /// Reconstruct a spawned agent from its runtime handle.
13673    /// 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.
13674    ///
13675    /// # Arguments
13676    ///
13677    /// * `handle` - The opaque runtime handle minted by the spawn that created the agent.
13678    /// * `name` - The agent's display name, as recorded by the spawn.
13679    pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
13680        let mut query = self.selection.select("agent");
13681        query = query.arg("handle", handle.into());
13682        query = query.arg("name", name.into());
13683        Agent {
13684            proc: self.proc.clone(),
13685            selection: query,
13686            graphql_client: self.graphql_client.clone(),
13687        }
13688    }
13689    /// 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.
13690    pub async fn has_pending(&self) -> Result<bool, DaggerError> {
13691        let query = self.selection.select("hasPending");
13692        query.execute(self.graphql_client.clone()).await
13693    }
13694    /// Fork the conversation, so that otherwise-identical follow-ups evaluate independently instead of deduplicating to a single cached result.
13695    ///
13696    /// # Arguments
13697    ///
13698    /// * `label` - A label distinguishing this fork from its siblings, e.g. "attempt-2" when retrying a flaky evaluation.
13699    pub fn fork(&self, label: impl Into<String>) -> Llm {
13700        let mut query = self.selection.select("fork");
13701        query = query.arg("label", label.into());
13702        Llm {
13703            proc: self.proc.clone(),
13704            selection: query,
13705            graphql_client: self.graphql_client.clone(),
13706        }
13707    }
13708    /// Render documentation for the tools currently exposed to the model.
13709    pub async fn tools(&self) -> Result<String, DaggerError> {
13710        let query = self.selection.select("tools");
13711        query.execute(self.graphql_client.clone()).await
13712    }
13713    /// The cumulative token usage, summed across every API call in the conversation.
13714    pub fn token_usage(&self) -> LlmTokenUsage {
13715        let query = self.selection.select("tokenUsage");
13716        LlmTokenUsage {
13717            proc: self.proc.clone(),
13718            selection: query,
13719            graphql_client: self.graphql_client.clone(),
13720        }
13721    }
13722    /// estimated number of tokens currently occupying the context window; unlike tokenUsage this is not cumulative over the session
13723    pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
13724        let query = self.selection.select("contextTokens");
13725        query.execute(self.graphql_client.clone()).await
13726    }
13727}
13728impl Node for Llm {
13729    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13730        let query = self.selection.select("id");
13731        let graphql_client = self.graphql_client.clone();
13732        async move { query.execute(graphql_client).await }
13733    }
13734}
13735impl Syncer for Llm {
13736    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13737        let query = self.selection.select("id");
13738        let graphql_client = self.graphql_client.clone();
13739        async move { query.execute(graphql_client).await }
13740    }
13741    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13742        let query = self.selection.select("sync");
13743        let proc = self.proc.clone();
13744        let graphql_client = self.graphql_client.clone();
13745        async move {
13746            let id: Id = query.execute(graphql_client.clone()).await?;
13747            Ok(Self {
13748                proc,
13749                selection: query
13750                    .root()
13751                    .select("node")
13752                    .arg("id", &id.0)
13753                    .inline_fragment("LLM"),
13754                graphql_client,
13755            })
13756        }
13757    }
13758}
13759#[derive(Clone)]
13760pub struct LlmContent {
13761    pub proc: Option<Arc<DaggerSessionProc>>,
13762    pub selection: Selection,
13763    pub graphql_client: DynGraphQLClient,
13764}
13765#[derive(Builder, Debug, PartialEq)]
13766pub struct LlmContentWithFileOpts<'a> {
13767    /// The media MIME type, e.g. "image/png". Inferred from the file's contents when omitted.
13768    #[builder(setter(into, strip_option), default)]
13769    pub mime_type: Option<&'a str>,
13770}
13771impl IntoID<Id> for LlmContent {
13772    fn into_id(
13773        self,
13774    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13775        Box::pin(async move { self.id().await })
13776    }
13777}
13778impl Loadable for LlmContent {
13779    fn graphql_type() -> &'static str {
13780        "LLMContent"
13781    }
13782    fn from_query(
13783        proc: Option<Arc<DaggerSessionProc>>,
13784        selection: Selection,
13785        graphql_client: DynGraphQLClient,
13786    ) -> Self {
13787        Self {
13788            proc,
13789            selection,
13790            graphql_client,
13791        }
13792    }
13793}
13794impl LlmContent {
13795    /// A unique identifier for this LLMContent.
13796    pub async fn id(&self) -> Result<Id, DaggerError> {
13797        let query = self.selection.select("id");
13798        query.execute(self.graphql_client.clone()).await
13799    }
13800    /// Append a block of text.
13801    ///
13802    /// # Arguments
13803    ///
13804    /// * `text` - The text.
13805    pub fn with_text(&self, text: impl Into<String>) -> LlmContent {
13806        let mut query = self.selection.select("withText");
13807        query = query.arg("text", text.into());
13808        LlmContent {
13809            proc: self.proc.clone(),
13810            selection: query,
13811            graphql_client: self.graphql_client.clone(),
13812        }
13813    }
13814    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13815    ///
13816    /// # Arguments
13817    ///
13818    /// * `file` - The media file. Its contents become the block's inline bytes.
13819    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13820    pub fn with_file(&self, file: impl IntoID<Id>) -> LlmContent {
13821        let mut query = self.selection.select("withFile");
13822        query = query.arg_lazy(
13823            "file",
13824            Box::new(move || {
13825                let file = file.clone();
13826                Box::pin(async move { file.into_id().await.unwrap().quote() })
13827            }),
13828        );
13829        LlmContent {
13830            proc: self.proc.clone(),
13831            selection: query,
13832            graphql_client: self.graphql_client.clone(),
13833        }
13834    }
13835    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13836    ///
13837    /// # Arguments
13838    ///
13839    /// * `file` - The media file. Its contents become the block's inline bytes.
13840    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13841    pub fn with_file_opts<'a>(
13842        &self,
13843        file: impl IntoID<Id>,
13844        opts: LlmContentWithFileOpts<'a>,
13845    ) -> LlmContent {
13846        let mut query = self.selection.select("withFile");
13847        query = query.arg_lazy(
13848            "file",
13849            Box::new(move || {
13850                let file = file.clone();
13851                Box::pin(async move { file.into_id().await.unwrap().quote() })
13852            }),
13853        );
13854        if let Some(mime_type) = opts.mime_type {
13855            query = query.arg("mimeType", mime_type);
13856        }
13857        LlmContent {
13858            proc: self.proc.clone(),
13859            selection: query,
13860            graphql_client: self.graphql_client.clone(),
13861        }
13862    }
13863    /// Append image, audio, or PDF bytes as an inline media block. The media kind follows the MIME type.
13864    /// Prefer withFile for anything but small payloads: the bytes become part of the content's identity, so they travel with every reference to it.
13865    ///
13866    /// # Arguments
13867    ///
13868    /// * `data` - The media bytes.
13869    /// * `mime_type` - The media MIME type, e.g. "image/png".
13870    pub fn with_data(&self, data: Bytes, mime_type: impl Into<String>) -> LlmContent {
13871        let mut query = self.selection.select("withData");
13872        query = query.arg("data", data);
13873        query = query.arg("mimeType", mime_type.into());
13874        LlmContent {
13875            proc: self.proc.clone(),
13876            selection: query,
13877            graphql_client: self.graphql_client.clone(),
13878        }
13879    }
13880    /// The ordered text and media blocks.
13881    pub async fn blocks(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13882        let query = self.selection.select("blocks");
13883        let query = query.select("id");
13884        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13885        Ok(ids
13886            .into_iter()
13887            .map(|id| LlmContentBlock {
13888                proc: self.proc.clone(),
13889                selection: crate::querybuilder::query()
13890                    .select("node")
13891                    .arg("id", &id.0)
13892                    .inline_fragment("LLMContentBlock"),
13893                graphql_client: self.graphql_client.clone(),
13894            })
13895            .collect())
13896    }
13897}
13898impl Node for LlmContent {
13899    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13900        let query = self.selection.select("id");
13901        let graphql_client = self.graphql_client.clone();
13902        async move { query.execute(graphql_client).await }
13903    }
13904}
13905#[derive(Clone)]
13906pub struct LlmContentBlock {
13907    pub proc: Option<Arc<DaggerSessionProc>>,
13908    pub selection: Selection,
13909    pub graphql_client: DynGraphQLClient,
13910}
13911impl IntoID<Id> for LlmContentBlock {
13912    fn into_id(
13913        self,
13914    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13915        Box::pin(async move { self.id().await })
13916    }
13917}
13918impl Loadable for LlmContentBlock {
13919    fn graphql_type() -> &'static str {
13920        "LLMContentBlock"
13921    }
13922    fn from_query(
13923        proc: Option<Arc<DaggerSessionProc>>,
13924        selection: Selection,
13925        graphql_client: DynGraphQLClient,
13926    ) -> Self {
13927        Self {
13928            proc,
13929            selection,
13930            graphql_client,
13931        }
13932    }
13933}
13934impl LlmContentBlock {
13935    /// A unique identifier for this LLMContentBlock.
13936    pub async fn id(&self) -> Result<Id, DaggerError> {
13937        let query = self.selection.select("id");
13938        query.execute(self.graphql_client.clone()).await
13939    }
13940    /// The kind of content block, which determines the other populated fields.
13941    pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
13942        let query = self.selection.select("kind");
13943        query.execute(self.graphql_client.clone()).await
13944    }
13945    /// Text content (for TEXT, THINKING, or TOOL_RESULT kinds).
13946    pub async fn text(&self) -> Result<String, DaggerError> {
13947        let query = self.selection.select("text");
13948        query.execute(self.graphql_client.clone()).await
13949    }
13950    /// The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
13951    pub async fn call_id(&self) -> Result<String, DaggerError> {
13952        let query = self.selection.select("callId");
13953        query.execute(self.graphql_client.clone()).await
13954    }
13955    /// The name of the tool called (for TOOL_CALL kind).
13956    pub async fn tool_name(&self) -> Result<String, DaggerError> {
13957        let query = self.selection.select("toolName");
13958        query.execute(self.graphql_client.clone()).await
13959    }
13960    /// The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).
13961    pub async fn arguments(&self) -> Result<Json, DaggerError> {
13962        let query = self.selection.select("arguments");
13963        query.execute(self.graphql_client.clone()).await
13964    }
13965    /// Whether the tool call resulted in an error (for TOOL_RESULT kind).
13966    pub async fn errored(&self) -> Result<bool, DaggerError> {
13967        let query = self.selection.select("errored");
13968        query.execute(self.graphql_client.clone()).await
13969    }
13970    /// The media MIME type (for IMAGE, AUDIO, or DOCUMENT kinds).
13971    pub async fn mime_type(&self) -> Result<String, DaggerError> {
13972        let query = self.selection.select("mimeType");
13973        query.execute(self.graphql_client.clone()).await
13974    }
13975    /// The media bytes (for IMAGE, AUDIO, or DOCUMENT kinds).
13976    pub async fn data(&self) -> Result<Bytes, DaggerError> {
13977        let query = self.selection.select("data");
13978        query.execute(self.graphql_client.clone()).await
13979    }
13980    /// Ordered content returned by a tool, following any text (for TOOL_RESULT kind).
13981    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13982        let query = self.selection.select("content");
13983        let query = query.select("id");
13984        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13985        Ok(ids
13986            .into_iter()
13987            .map(|id| LlmContentBlock {
13988                proc: self.proc.clone(),
13989                selection: crate::querybuilder::query()
13990                    .select("node")
13991                    .arg("id", &id.0)
13992                    .inline_fragment("LLMContentBlock"),
13993                graphql_client: self.graphql_client.clone(),
13994            })
13995            .collect())
13996    }
13997    /// Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.
13998    pub async fn signature(&self) -> Result<String, DaggerError> {
13999        let query = self.selection.select("signature");
14000        query.execute(self.graphql_client.clone()).await
14001    }
14002}
14003impl Node for LlmContentBlock {
14004    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14005        let query = self.selection.select("id");
14006        let graphql_client = self.graphql_client.clone();
14007        async move { query.execute(graphql_client).await }
14008    }
14009}
14010#[derive(Clone)]
14011pub struct LlmMessage {
14012    pub proc: Option<Arc<DaggerSessionProc>>,
14013    pub selection: Selection,
14014    pub graphql_client: DynGraphQLClient,
14015}
14016impl IntoID<Id> for LlmMessage {
14017    fn into_id(
14018        self,
14019    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14020        Box::pin(async move { self.id().await })
14021    }
14022}
14023impl Loadable for LlmMessage {
14024    fn graphql_type() -> &'static str {
14025        "LLMMessage"
14026    }
14027    fn from_query(
14028        proc: Option<Arc<DaggerSessionProc>>,
14029        selection: Selection,
14030        graphql_client: DynGraphQLClient,
14031    ) -> Self {
14032        Self {
14033            proc,
14034            selection,
14035            graphql_client,
14036        }
14037    }
14038}
14039impl LlmMessage {
14040    /// A unique identifier for this LLMMessage.
14041    pub async fn id(&self) -> Result<Id, DaggerError> {
14042        let query = self.selection.select("id");
14043        query.execute(self.graphql_client.clone()).await
14044    }
14045    /// Who put this message on the record, when it arrived through an agent mailbox.
14046    /// Null for the user's own prompts and for everything the model or tools produced.
14047    pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
14048        let query = self.selection.select("origin");
14049        let query = query.select("id");
14050        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14051        Ok(id.map(|id| LlmMessageOrigin {
14052            proc: self.proc.clone(),
14053            selection: query
14054                .root()
14055                .select("node")
14056                .arg("id", &id.0)
14057                .inline_fragment("LLMMessageOrigin"),
14058            graphql_client: self.graphql_client.clone(),
14059        }))
14060    }
14061    /// The role that produced this message.
14062    pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
14063        let query = self.selection.select("role");
14064        query.execute(self.graphql_client.clone()).await
14065    }
14066    /// The message's content blocks, in the order the model produced them.
14067    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
14068        let query = self.selection.select("content");
14069        let query = query.select("id");
14070        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14071        Ok(ids
14072            .into_iter()
14073            .map(|id| LlmContentBlock {
14074                proc: self.proc.clone(),
14075                selection: crate::querybuilder::query()
14076                    .select("node")
14077                    .arg("id", &id.0)
14078                    .inline_fragment("LLMContentBlock"),
14079                graphql_client: self.graphql_client.clone(),
14080            })
14081            .collect())
14082    }
14083    /// Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.
14084    pub fn token_usage(&self) -> LlmTokenUsage {
14085        let query = self.selection.select("tokenUsage");
14086        LlmTokenUsage {
14087            proc: self.proc.clone(),
14088            selection: query,
14089            graphql_client: self.graphql_client.clone(),
14090        }
14091    }
14092}
14093impl Node for LlmMessage {
14094    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14095        let query = self.selection.select("id");
14096        let graphql_client = self.graphql_client.clone();
14097        async move { query.execute(graphql_client).await }
14098    }
14099}
14100#[derive(Clone)]
14101pub struct LlmMessageOrigin {
14102    pub proc: Option<Arc<DaggerSessionProc>>,
14103    pub selection: Selection,
14104    pub graphql_client: DynGraphQLClient,
14105}
14106impl IntoID<Id> for LlmMessageOrigin {
14107    fn into_id(
14108        self,
14109    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14110        Box::pin(async move { self.id().await })
14111    }
14112}
14113impl Loadable for LlmMessageOrigin {
14114    fn graphql_type() -> &'static str {
14115        "LLMMessageOrigin"
14116    }
14117    fn from_query(
14118        proc: Option<Arc<DaggerSessionProc>>,
14119        selection: Selection,
14120        graphql_client: DynGraphQLClient,
14121    ) -> Self {
14122        Self {
14123            proc,
14124            selection,
14125            graphql_client,
14126        }
14127    }
14128}
14129impl LlmMessageOrigin {
14130    /// A unique identifier for this LLMMessageOrigin.
14131    pub async fn id(&self) -> Result<Id, DaggerError> {
14132        let query = self.selection.select("id");
14133        query.execute(self.graphql_client.clone()).await
14134    }
14135    /// Who put this message on the record.
14136    pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
14137        let query = self.selection.select("kind");
14138        query.execute(self.graphql_client.clone()).await
14139    }
14140    /// The display name of the sending agent (for AGENT origins) or the observed agent (for EVENT origins).
14141    pub async fn agent_name(&self) -> Result<String, DaggerError> {
14142        let query = self.selection.select("agentName");
14143        query.execute(self.graphql_client.clone()).await
14144    }
14145    /// 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.
14146    pub async fn r#ref(&self) -> Result<String, DaggerError> {
14147        let query = self.selection.select("ref");
14148        query.execute(self.graphql_client.clone()).await
14149    }
14150    /// The ref of the message this one answers, in the sender's own runtime, if any.
14151    pub async fn reply_to(&self) -> Result<String, DaggerError> {
14152        let query = self.selection.select("replyTo");
14153        query.execute(self.graphql_client.clone()).await
14154    }
14155}
14156impl Node for LlmMessageOrigin {
14157    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14158        let query = self.selection.select("id");
14159        let graphql_client = self.graphql_client.clone();
14160        async move { query.execute(graphql_client).await }
14161    }
14162}
14163#[derive(Clone)]
14164pub struct LlmSkill {
14165    pub proc: Option<Arc<DaggerSessionProc>>,
14166    pub selection: Selection,
14167    pub graphql_client: DynGraphQLClient,
14168}
14169impl IntoID<Id> for LlmSkill {
14170    fn into_id(
14171        self,
14172    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14173        Box::pin(async move { self.id().await })
14174    }
14175}
14176impl Loadable for LlmSkill {
14177    fn graphql_type() -> &'static str {
14178        "LLMSkill"
14179    }
14180    fn from_query(
14181        proc: Option<Arc<DaggerSessionProc>>,
14182        selection: Selection,
14183        graphql_client: DynGraphQLClient,
14184    ) -> Self {
14185        Self {
14186            proc,
14187            selection,
14188            graphql_client,
14189        }
14190    }
14191}
14192impl LlmSkill {
14193    /// A unique identifier for this LLMSkill.
14194    pub async fn id(&self) -> Result<Id, DaggerError> {
14195        let query = self.selection.select("id");
14196        query.execute(self.graphql_client.clone()).await
14197    }
14198    /// The skill name, as passed to ReadSkill.
14199    pub async fn name(&self) -> Result<String, DaggerError> {
14200        let query = self.selection.select("name");
14201        query.execute(self.graphql_client.clone()).await
14202    }
14203    /// The one-line description from the SKILL.md frontmatter.
14204    pub async fn description(&self) -> Result<String, DaggerError> {
14205        let query = self.selection.select("description");
14206        query.execute(self.graphql_client.clone()).await
14207    }
14208}
14209impl Node for LlmSkill {
14210    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14211        let query = self.selection.select("id");
14212        let graphql_client = self.graphql_client.clone();
14213        async move { query.execute(graphql_client).await }
14214    }
14215}
14216#[derive(Clone)]
14217pub struct LlmTokenUsage {
14218    pub proc: Option<Arc<DaggerSessionProc>>,
14219    pub selection: Selection,
14220    pub graphql_client: DynGraphQLClient,
14221}
14222impl IntoID<Id> for LlmTokenUsage {
14223    fn into_id(
14224        self,
14225    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14226        Box::pin(async move { self.id().await })
14227    }
14228}
14229impl Loadable for LlmTokenUsage {
14230    fn graphql_type() -> &'static str {
14231        "LLMTokenUsage"
14232    }
14233    fn from_query(
14234        proc: Option<Arc<DaggerSessionProc>>,
14235        selection: Selection,
14236        graphql_client: DynGraphQLClient,
14237    ) -> Self {
14238        Self {
14239            proc,
14240            selection,
14241            graphql_client,
14242        }
14243    }
14244}
14245impl LlmTokenUsage {
14246    /// A unique identifier for this LLMTokenUsage.
14247    pub async fn id(&self) -> Result<Id, DaggerError> {
14248        let query = self.selection.select("id");
14249        query.execute(self.graphql_client.clone()).await
14250    }
14251    /// Uncached input tokens sent to the model.
14252    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
14253        let query = self.selection.select("inputTokens");
14254        query.execute(self.graphql_client.clone()).await
14255    }
14256    /// Tokens received from the model, including text and tool calls.
14257    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
14258        let query = self.selection.select("outputTokens");
14259        query.execute(self.graphql_client.clone()).await
14260    }
14261    /// Input tokens served from the provider's prompt cache.
14262    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
14263        let query = self.selection.select("cachedTokenReads");
14264        query.execute(self.graphql_client.clone()).await
14265    }
14266    /// Input tokens written to the provider's prompt cache.
14267    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
14268        let query = self.selection.select("cachedTokenWrites");
14269        query.execute(self.graphql_client.clone()).await
14270    }
14271    /// Total tokens consumed, as reported by the provider.
14272    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
14273        let query = self.selection.select("totalTokens");
14274        query.execute(self.graphql_client.clone()).await
14275    }
14276}
14277impl Node for LlmTokenUsage {
14278    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14279        let query = self.selection.select("id");
14280        let graphql_client = self.graphql_client.clone();
14281        async move { query.execute(graphql_client).await }
14282    }
14283}
14284#[derive(Clone)]
14285pub struct Label {
14286    pub proc: Option<Arc<DaggerSessionProc>>,
14287    pub selection: Selection,
14288    pub graphql_client: DynGraphQLClient,
14289}
14290impl IntoID<Id> for Label {
14291    fn into_id(
14292        self,
14293    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14294        Box::pin(async move { self.id().await })
14295    }
14296}
14297impl Loadable for Label {
14298    fn graphql_type() -> &'static str {
14299        "Label"
14300    }
14301    fn from_query(
14302        proc: Option<Arc<DaggerSessionProc>>,
14303        selection: Selection,
14304        graphql_client: DynGraphQLClient,
14305    ) -> Self {
14306        Self {
14307            proc,
14308            selection,
14309            graphql_client,
14310        }
14311    }
14312}
14313impl Label {
14314    /// A unique identifier for this Label.
14315    pub async fn id(&self) -> Result<Id, DaggerError> {
14316        let query = self.selection.select("id");
14317        query.execute(self.graphql_client.clone()).await
14318    }
14319    /// The label name.
14320    pub async fn name(&self) -> Result<String, DaggerError> {
14321        let query = self.selection.select("name");
14322        query.execute(self.graphql_client.clone()).await
14323    }
14324    /// The label value.
14325    pub async fn value(&self) -> Result<String, DaggerError> {
14326        let query = self.selection.select("value");
14327        query.execute(self.graphql_client.clone()).await
14328    }
14329}
14330impl Node for Label {
14331    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14332        let query = self.selection.select("id");
14333        let graphql_client = self.graphql_client.clone();
14334        async move { query.execute(graphql_client).await }
14335    }
14336}
14337#[derive(Clone)]
14338pub struct ListTypeDef {
14339    pub proc: Option<Arc<DaggerSessionProc>>,
14340    pub selection: Selection,
14341    pub graphql_client: DynGraphQLClient,
14342}
14343impl IntoID<Id> for ListTypeDef {
14344    fn into_id(
14345        self,
14346    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14347        Box::pin(async move { self.id().await })
14348    }
14349}
14350impl Loadable for ListTypeDef {
14351    fn graphql_type() -> &'static str {
14352        "ListTypeDef"
14353    }
14354    fn from_query(
14355        proc: Option<Arc<DaggerSessionProc>>,
14356        selection: Selection,
14357        graphql_client: DynGraphQLClient,
14358    ) -> Self {
14359        Self {
14360            proc,
14361            selection,
14362            graphql_client,
14363        }
14364    }
14365}
14366impl ListTypeDef {
14367    /// A unique identifier for this ListTypeDef.
14368    pub async fn id(&self) -> Result<Id, DaggerError> {
14369        let query = self.selection.select("id");
14370        query.execute(self.graphql_client.clone()).await
14371    }
14372    /// The type of the elements in the list.
14373    pub fn element_type_def(&self) -> TypeDef {
14374        let query = self.selection.select("elementTypeDef");
14375        TypeDef {
14376            proc: self.proc.clone(),
14377            selection: query,
14378            graphql_client: self.graphql_client.clone(),
14379        }
14380    }
14381}
14382impl Node for ListTypeDef {
14383    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14384        let query = self.selection.select("id");
14385        let graphql_client = self.graphql_client.clone();
14386        async move { query.execute(graphql_client).await }
14387    }
14388}
14389#[derive(Clone)]
14390pub struct Module {
14391    pub proc: Option<Arc<DaggerSessionProc>>,
14392    pub selection: Selection,
14393    pub graphql_client: DynGraphQLClient,
14394}
14395#[derive(Builder, Debug, PartialEq)]
14396pub struct ModuleServeOpts {
14397    /// Compatibility alias for main.
14398    #[builder(setter(into, strip_option), default)]
14399    pub entrypoint: Option<bool>,
14400    /// Expose the dependencies of this module to the client
14401    #[builder(setter(into, strip_option), default)]
14402    pub include_dependencies: Option<bool>,
14403    /// Install the module as the workspace main, promoting its main-object methods onto the Query root
14404    #[builder(setter(into, strip_option), default)]
14405    pub main: Option<bool>,
14406}
14407impl IntoID<Id> for Module {
14408    fn into_id(
14409        self,
14410    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14411        Box::pin(async move { self.id().await })
14412    }
14413}
14414impl Loadable for Module {
14415    fn graphql_type() -> &'static str {
14416        "Module"
14417    }
14418    fn from_query(
14419        proc: Option<Arc<DaggerSessionProc>>,
14420        selection: Selection,
14421        graphql_client: DynGraphQLClient,
14422    ) -> Self {
14423        Self {
14424            proc,
14425            selection,
14426            graphql_client,
14427        }
14428    }
14429}
14430impl Module {
14431    /// A unique identifier for this Module.
14432    pub async fn id(&self) -> Result<Id, DaggerError> {
14433        let query = self.selection.select("id");
14434        query.execute(self.graphql_client.clone()).await
14435    }
14436    /// The source used to resolve contextual files and directories, when different from source.
14437    pub async fn context_source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14438        let query = self.selection.select("contextSource");
14439        let query = query.select("id");
14440        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14441        Ok(id.map(|id| ModuleSource {
14442            proc: self.proc.clone(),
14443            selection: query
14444                .root()
14445                .select("node")
14446                .arg("id", &id.0)
14447                .inline_fragment("ModuleSource"),
14448            graphql_client: self.graphql_client.clone(),
14449        }))
14450    }
14451    /// Forces evaluation of the module, including any loading into the engine and associated validation.
14452    pub async fn sync(&self) -> Result<Module, DaggerError> {
14453        let query = self.selection.select("sync");
14454        let id: Id = query.execute(self.graphql_client.clone()).await?;
14455        Ok(Module {
14456            proc: self.proc.clone(),
14457            selection: query
14458                .root()
14459                .select("node")
14460                .arg("id", &id.0)
14461                .inline_fragment("Module"),
14462            graphql_client: self.graphql_client.clone(),
14463        })
14464    }
14465    /// The dependencies of the module.
14466    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
14467        let query = self.selection.select("dependencies");
14468        let query = query.select("id");
14469        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14470        Ok(ids
14471            .into_iter()
14472            .map(|id| Module {
14473                proc: self.proc.clone(),
14474                selection: crate::querybuilder::query()
14475                    .select("node")
14476                    .arg("id", &id.0)
14477                    .inline_fragment("Module"),
14478                graphql_client: self.graphql_client.clone(),
14479            })
14480            .collect())
14481    }
14482    /// The introspection schema JSON file for this module.
14483    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
14484    /// Note: this is in the context of a module, so some core types may be hidden.
14485    pub fn introspection_schema_json(&self) -> File {
14486        let query = self.selection.select("introspectionSchemaJSON");
14487        File {
14488            proc: self.proc.clone(),
14489            selection: query,
14490            graphql_client: self.graphql_client.clone(),
14491        }
14492    }
14493    /// The generated files and directories made on top of the module source's context directory.
14494    pub fn generated_context_directory(&self) -> Directory {
14495        let query = self.selection.select("generatedContextDirectory");
14496        Directory {
14497            proc: self.proc.clone(),
14498            selection: query,
14499            graphql_client: self.graphql_client.clone(),
14500        }
14501    }
14502    /// User-defined default values, loaded from local .env files.
14503    pub fn user_defaults(&self) -> EnvFile {
14504        let query = self.selection.select("userDefaults");
14505        EnvFile {
14506            proc: self.proc.clone(),
14507            selection: query,
14508            graphql_client: self.graphql_client.clone(),
14509        }
14510    }
14511    /// Retrieves the module with the given description
14512    ///
14513    /// # Arguments
14514    ///
14515    /// * `description` - The description to set
14516    pub fn with_description(&self, description: impl Into<String>) -> Module {
14517        let mut query = self.selection.select("withDescription");
14518        query = query.arg("description", description.into());
14519        Module {
14520            proc: self.proc.clone(),
14521            selection: query,
14522            graphql_client: self.graphql_client.clone(),
14523        }
14524    }
14525    /// This module plus the given Object type and associated functions.
14526    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
14527        let mut query = self.selection.select("withObject");
14528        query = query.arg_lazy(
14529            "object",
14530            Box::new(move || {
14531                let object = object.clone();
14532                Box::pin(async move { object.into_id().await.unwrap().quote() })
14533            }),
14534        );
14535        Module {
14536            proc: self.proc.clone(),
14537            selection: query,
14538            graphql_client: self.graphql_client.clone(),
14539        }
14540    }
14541    /// This module plus the given Interface type and associated functions
14542    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
14543        let mut query = self.selection.select("withInterface");
14544        query = query.arg_lazy(
14545            "iface",
14546            Box::new(move || {
14547                let iface = iface.clone();
14548                Box::pin(async move { iface.into_id().await.unwrap().quote() })
14549            }),
14550        );
14551        Module {
14552            proc: self.proc.clone(),
14553            selection: query,
14554            graphql_client: self.graphql_client.clone(),
14555        }
14556    }
14557    /// This module plus the given Enum type and associated values
14558    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
14559        let mut query = self.selection.select("withEnum");
14560        query = query.arg_lazy(
14561            "enum",
14562            Box::new(move || {
14563                let r#enum = r#enum.clone();
14564                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
14565            }),
14566        );
14567        Module {
14568            proc: self.proc.clone(),
14569            selection: query,
14570            graphql_client: self.graphql_client.clone(),
14571        }
14572    }
14573    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
14574    pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
14575        let query = self.selection.select("runtime");
14576        let query = query.select("id");
14577        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14578        Ok(id.map(|id| Container {
14579            proc: self.proc.clone(),
14580            selection: query
14581                .root()
14582                .select("node")
14583                .arg("id", &id.0)
14584                .inline_fragment("Container"),
14585            graphql_client: self.graphql_client.clone(),
14586        }))
14587    }
14588    /// Serve a module's API in the current session.
14589    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14590    ///
14591    /// # Arguments
14592    ///
14593    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14594    pub async fn serve(&self) -> Result<Void, DaggerError> {
14595        let query = self.selection.select("serve");
14596        query.execute(self.graphql_client.clone()).await
14597    }
14598    /// Serve a module's API in the current session.
14599    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14600    ///
14601    /// # Arguments
14602    ///
14603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14604    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
14605        let mut query = self.selection.select("serve");
14606        if let Some(include_dependencies) = opts.include_dependencies {
14607            query = query.arg("includeDependencies", include_dependencies);
14608        }
14609        if let Some(main) = opts.main {
14610            query = query.arg("main", main);
14611        }
14612        if let Some(entrypoint) = opts.entrypoint {
14613            query = query.arg("entrypoint", entrypoint);
14614        }
14615        query.execute(self.graphql_client.clone()).await
14616    }
14617    /// The source for the module.
14618    pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14619        let query = self.selection.select("source");
14620        let query = query.select("id");
14621        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14622        Ok(id.map(|id| ModuleSource {
14623            proc: self.proc.clone(),
14624            selection: query
14625                .root()
14626                .select("node")
14627                .arg("id", &id.0)
14628                .inline_fragment("ModuleSource"),
14629            graphql_client: self.graphql_client.clone(),
14630        }))
14631    }
14632    /// The name of the module
14633    pub async fn name(&self) -> Result<String, DaggerError> {
14634        let query = self.selection.select("name");
14635        query.execute(self.graphql_client.clone()).await
14636    }
14637    /// The SDK config used by this module.
14638    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
14639        let query = self.selection.select("sdk");
14640        let query = query.select("id");
14641        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14642        Ok(id.map(|id| SdkConfig {
14643            proc: self.proc.clone(),
14644            selection: query
14645                .root()
14646                .select("node")
14647                .arg("id", &id.0)
14648                .inline_fragment("SDKConfig"),
14649            graphql_client: self.graphql_client.clone(),
14650        }))
14651    }
14652    /// The doc string of the module, if any
14653    pub async fn description(&self) -> Result<String, DaggerError> {
14654        let query = self.selection.select("description");
14655        query.execute(self.graphql_client.clone()).await
14656    }
14657    /// Objects served by this module.
14658    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
14659        let query = self.selection.select("objects");
14660        let query = query.select("id");
14661        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14662        Ok(ids
14663            .into_iter()
14664            .map(|id| TypeDef {
14665                proc: self.proc.clone(),
14666                selection: crate::querybuilder::query()
14667                    .select("node")
14668                    .arg("id", &id.0)
14669                    .inline_fragment("TypeDef"),
14670                graphql_client: self.graphql_client.clone(),
14671            })
14672            .collect())
14673    }
14674    /// Interfaces served by this module.
14675    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
14676        let query = self.selection.select("interfaces");
14677        let query = query.select("id");
14678        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14679        Ok(ids
14680            .into_iter()
14681            .map(|id| TypeDef {
14682                proc: self.proc.clone(),
14683                selection: crate::querybuilder::query()
14684                    .select("node")
14685                    .arg("id", &id.0)
14686                    .inline_fragment("TypeDef"),
14687                graphql_client: self.graphql_client.clone(),
14688            })
14689            .collect())
14690    }
14691    /// Enumerations served by this module.
14692    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
14693        let query = self.selection.select("enums");
14694        let query = query.select("id");
14695        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14696        Ok(ids
14697            .into_iter()
14698            .map(|id| TypeDef {
14699                proc: self.proc.clone(),
14700                selection: crate::querybuilder::query()
14701                    .select("node")
14702                    .arg("id", &id.0)
14703                    .inline_fragment("TypeDef"),
14704                graphql_client: self.graphql_client.clone(),
14705            })
14706            .collect())
14707    }
14708}
14709impl Node for Module {
14710    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14711        let query = self.selection.select("id");
14712        let graphql_client = self.graphql_client.clone();
14713        async move { query.execute(graphql_client).await }
14714    }
14715}
14716impl Syncer for Module {
14717    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14718        let query = self.selection.select("id");
14719        let graphql_client = self.graphql_client.clone();
14720        async move { query.execute(graphql_client).await }
14721    }
14722    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
14723        let query = self.selection.select("sync");
14724        let proc = self.proc.clone();
14725        let graphql_client = self.graphql_client.clone();
14726        async move {
14727            let id: Id = query.execute(graphql_client.clone()).await?;
14728            Ok(Self {
14729                proc,
14730                selection: query
14731                    .root()
14732                    .select("node")
14733                    .arg("id", &id.0)
14734                    .inline_fragment("Module"),
14735                graphql_client,
14736            })
14737        }
14738    }
14739}
14740#[derive(Clone)]
14741pub struct ModuleConfigClient {
14742    pub proc: Option<Arc<DaggerSessionProc>>,
14743    pub selection: Selection,
14744    pub graphql_client: DynGraphQLClient,
14745}
14746impl IntoID<Id> for ModuleConfigClient {
14747    fn into_id(
14748        self,
14749    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14750        Box::pin(async move { self.id().await })
14751    }
14752}
14753impl Loadable for ModuleConfigClient {
14754    fn graphql_type() -> &'static str {
14755        "ModuleConfigClient"
14756    }
14757    fn from_query(
14758        proc: Option<Arc<DaggerSessionProc>>,
14759        selection: Selection,
14760        graphql_client: DynGraphQLClient,
14761    ) -> Self {
14762        Self {
14763            proc,
14764            selection,
14765            graphql_client,
14766        }
14767    }
14768}
14769impl ModuleConfigClient {
14770    /// A unique identifier for this ModuleConfigClient.
14771    pub async fn id(&self) -> Result<Id, DaggerError> {
14772        let query = self.selection.select("id");
14773        query.execute(self.graphql_client.clone()).await
14774    }
14775    /// The generator to use
14776    pub async fn generator(&self) -> Result<String, DaggerError> {
14777        let query = self.selection.select("generator");
14778        query.execute(self.graphql_client.clone()).await
14779    }
14780    /// The directory the client is generated in.
14781    pub async fn directory(&self) -> Result<String, DaggerError> {
14782        let query = self.selection.select("directory");
14783        query.execute(self.graphql_client.clone()).await
14784    }
14785}
14786impl Node for ModuleConfigClient {
14787    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14788        let query = self.selection.select("id");
14789        let graphql_client = self.graphql_client.clone();
14790        async move { query.execute(graphql_client).await }
14791    }
14792}
14793#[derive(Clone)]
14794pub struct ModuleSource {
14795    pub proc: Option<Arc<DaggerSessionProc>>,
14796    pub selection: Selection,
14797    pub graphql_client: DynGraphQLClient,
14798}
14799impl IntoID<Id> for ModuleSource {
14800    fn into_id(
14801        self,
14802    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14803        Box::pin(async move { self.id().await })
14804    }
14805}
14806impl Loadable for ModuleSource {
14807    fn graphql_type() -> &'static str {
14808        "ModuleSource"
14809    }
14810    fn from_query(
14811        proc: Option<Arc<DaggerSessionProc>>,
14812        selection: Selection,
14813        graphql_client: DynGraphQLClient,
14814    ) -> Self {
14815        Self {
14816            proc,
14817            selection,
14818            graphql_client,
14819        }
14820    }
14821}
14822impl ModuleSource {
14823    /// A unique identifier for this ModuleSource.
14824    pub async fn id(&self) -> Result<Id, DaggerError> {
14825        let query = self.selection.select("id");
14826        query.execute(self.graphql_client.clone()).await
14827    }
14828    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
14829    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
14830        let query = self.selection.select("sync");
14831        let id: Id = query.execute(self.graphql_client.clone()).await?;
14832        Ok(ModuleSource {
14833            proc: self.proc.clone(),
14834            selection: query
14835                .root()
14836                .select("node")
14837                .arg("id", &id.0)
14838                .inline_fragment("ModuleSource"),
14839            graphql_client: self.graphql_client.clone(),
14840        })
14841    }
14842    /// The path to the directory containing the module's source code, relative to the context directory.
14843    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
14844        let query = self.selection.select("sourceSubpath");
14845        query.execute(self.graphql_client.clone()).await
14846    }
14847    /// The original subpath used when instantiating this module source, relative to the context directory.
14848    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
14849        let query = self.selection.select("originalSubpath");
14850        query.execute(self.graphql_client.clone()).await
14851    }
14852    /// 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.
14853    pub async fn digest(&self) -> Result<String, DaggerError> {
14854        let query = self.selection.select("digest");
14855        query.execute(self.graphql_client.clone()).await
14856    }
14857    /// Update the module source with a new source subpath.
14858    ///
14859    /// # Arguments
14860    ///
14861    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
14862    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
14863        let mut query = self.selection.select("withSourceSubpath");
14864        query = query.arg("path", path.into());
14865        ModuleSource {
14866            proc: self.proc.clone(),
14867            selection: query,
14868            graphql_client: self.graphql_client.clone(),
14869        }
14870    }
14871    /// Update the module source with a new name.
14872    ///
14873    /// # Arguments
14874    ///
14875    /// * `name` - The name to set.
14876    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
14877        let mut query = self.selection.select("withName");
14878        query = query.arg("name", name.into());
14879        ModuleSource {
14880            proc: self.proc.clone(),
14881            selection: query,
14882            graphql_client: self.graphql_client.clone(),
14883        }
14884    }
14885    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
14886    ///
14887    /// # Arguments
14888    ///
14889    /// * `patterns` - The new additional include patterns.
14890    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
14891        let mut query = self.selection.select("withIncludes");
14892        query = query.arg(
14893            "patterns",
14894            patterns
14895                .into_iter()
14896                .map(|i| i.into())
14897                .collect::<Vec<String>>(),
14898        );
14899        ModuleSource {
14900            proc: self.proc.clone(),
14901            selection: query,
14902            graphql_client: self.graphql_client.clone(),
14903        }
14904    }
14905    /// Update the module source with a new SDK.
14906    ///
14907    /// # Arguments
14908    ///
14909    /// * `source` - The SDK source to set.
14910    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
14911        let mut query = self.selection.select("withSDK");
14912        query = query.arg("source", source.into());
14913        ModuleSource {
14914            proc: self.proc.clone(),
14915            selection: query,
14916            graphql_client: self.graphql_client.clone(),
14917        }
14918    }
14919    /// Upgrade the engine version of the module to the given value.
14920    ///
14921    /// # Arguments
14922    ///
14923    /// * `version` - The engine version to upgrade to.
14924    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
14925        let mut query = self.selection.select("withEngineVersion");
14926        query = query.arg("version", version.into());
14927        ModuleSource {
14928            proc: self.proc.clone(),
14929            selection: query,
14930            graphql_client: self.graphql_client.clone(),
14931        }
14932    }
14933    /// Append the provided dependencies to the module source's dependency list.
14934    ///
14935    /// # Arguments
14936    ///
14937    /// * `dependencies` - The dependencies to append.
14938    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
14939        let mut query = self.selection.select("withDependencies");
14940        query = query.arg("dependencies", dependencies);
14941        ModuleSource {
14942            proc: self.proc.clone(),
14943            selection: query,
14944            graphql_client: self.graphql_client.clone(),
14945        }
14946    }
14947    /// Update one or more module dependencies.
14948    ///
14949    /// # Arguments
14950    ///
14951    /// * `dependencies` - The dependencies to update.
14952    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14953        let mut query = self.selection.select("withUpdateDependencies");
14954        query = query.arg(
14955            "dependencies",
14956            dependencies
14957                .into_iter()
14958                .map(|i| i.into())
14959                .collect::<Vec<String>>(),
14960        );
14961        ModuleSource {
14962            proc: self.proc.clone(),
14963            selection: query,
14964            graphql_client: self.graphql_client.clone(),
14965        }
14966    }
14967    /// Remove the provided dependencies from the module source's dependency list.
14968    ///
14969    /// # Arguments
14970    ///
14971    /// * `dependencies` - The dependencies to remove.
14972    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14973        let mut query = self.selection.select("withoutDependencies");
14974        query = query.arg(
14975            "dependencies",
14976            dependencies
14977                .into_iter()
14978                .map(|i| i.into())
14979                .collect::<Vec<String>>(),
14980        );
14981        ModuleSource {
14982            proc: self.proc.clone(),
14983            selection: query,
14984            graphql_client: self.graphql_client.clone(),
14985        }
14986    }
14987    /// Set a blueprint for the module source.
14988    ///
14989    /// # Arguments
14990    ///
14991    /// * `blueprint` - The blueprint module to set.
14992    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
14993        let mut query = self.selection.select("withBlueprint");
14994        query = query.arg_lazy(
14995            "blueprint",
14996            Box::new(move || {
14997                let blueprint = blueprint.clone();
14998                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
14999            }),
15000        );
15001        ModuleSource {
15002            proc: self.proc.clone(),
15003            selection: query,
15004            graphql_client: self.graphql_client.clone(),
15005        }
15006    }
15007    /// Add toolchains to the module source.
15008    ///
15009    /// # Arguments
15010    ///
15011    /// * `toolchains` - The toolchain modules to add.
15012    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
15013        let mut query = self.selection.select("withToolchains");
15014        query = query.arg("toolchains", toolchains);
15015        ModuleSource {
15016            proc: self.proc.clone(),
15017            selection: query,
15018            graphql_client: self.graphql_client.clone(),
15019        }
15020    }
15021    /// Update one or more toolchains.
15022    ///
15023    /// # Arguments
15024    ///
15025    /// * `toolchains` - The toolchains to update.
15026    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
15027        let mut query = self.selection.select("withUpdateToolchains");
15028        query = query.arg(
15029            "toolchains",
15030            toolchains
15031                .into_iter()
15032                .map(|i| i.into())
15033                .collect::<Vec<String>>(),
15034        );
15035        ModuleSource {
15036            proc: self.proc.clone(),
15037            selection: query,
15038            graphql_client: self.graphql_client.clone(),
15039        }
15040    }
15041    /// Remove the provided toolchains from the module source.
15042    ///
15043    /// # Arguments
15044    ///
15045    /// * `toolchains` - The toolchains to remove.
15046    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
15047        let mut query = self.selection.select("withoutToolchains");
15048        query = query.arg(
15049            "toolchains",
15050            toolchains
15051                .into_iter()
15052                .map(|i| i.into())
15053                .collect::<Vec<String>>(),
15054        );
15055        ModuleSource {
15056            proc: self.proc.clone(),
15057            selection: query,
15058            graphql_client: self.graphql_client.clone(),
15059        }
15060    }
15061    /// Update the blueprint module to the latest version.
15062    pub fn with_update_blueprint(&self) -> ModuleSource {
15063        let query = self.selection.select("withUpdateBlueprint");
15064        ModuleSource {
15065            proc: self.proc.clone(),
15066            selection: query,
15067            graphql_client: self.graphql_client.clone(),
15068        }
15069    }
15070    /// Remove the current blueprint from the module source.
15071    pub fn without_blueprint(&self) -> ModuleSource {
15072        let query = self.selection.select("withoutBlueprint");
15073        ModuleSource {
15074            proc: self.proc.clone(),
15075            selection: query,
15076            graphql_client: self.graphql_client.clone(),
15077        }
15078    }
15079    /// Enable the experimental features for the module source.
15080    ///
15081    /// # Arguments
15082    ///
15083    /// * `features` - The experimental features to enable.
15084    pub fn with_experimental_features(
15085        &self,
15086        features: Vec<ModuleSourceExperimentalFeature>,
15087    ) -> ModuleSource {
15088        let mut query = self.selection.select("withExperimentalFeatures");
15089        query = query.arg("features", features);
15090        ModuleSource {
15091            proc: self.proc.clone(),
15092            selection: query,
15093            graphql_client: self.graphql_client.clone(),
15094        }
15095    }
15096    /// Disable experimental features for the module source.
15097    ///
15098    /// # Arguments
15099    ///
15100    /// * `features` - The experimental features to disable.
15101    pub fn without_experimental_features(
15102        &self,
15103        features: Vec<ModuleSourceExperimentalFeature>,
15104    ) -> ModuleSource {
15105        let mut query = self.selection.select("withoutExperimentalFeatures");
15106        query = query.arg("features", features);
15107        ModuleSource {
15108            proc: self.proc.clone(),
15109            selection: query,
15110            graphql_client: self.graphql_client.clone(),
15111        }
15112    }
15113    /// The generated files and directories made on top of the module source's context directory.
15114    pub fn generated_context_directory(&self) -> Directory {
15115        let query = self.selection.select("generatedContextDirectory");
15116        Directory {
15117            proc: self.proc.clone(),
15118            selection: query,
15119            graphql_client: self.graphql_client.clone(),
15120        }
15121    }
15122    /// The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.
15123    /// 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.
15124    pub fn updated_config_directory(&self) -> Directory {
15125        let query = self.selection.select("updatedConfigDirectory");
15126        Directory {
15127            proc: self.proc.clone(),
15128            selection: query,
15129            graphql_client: self.graphql_client.clone(),
15130        }
15131    }
15132    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
15133    pub fn generated_context_changeset(&self) -> Changeset {
15134        let query = self.selection.select("generatedContextChangeset");
15135        Changeset {
15136            proc: self.proc.clone(),
15137            selection: query,
15138            graphql_client: self.graphql_client.clone(),
15139        }
15140    }
15141    /// Return the supplied workspace with this module's generated context applied.
15142    /// The workspace change baseline is preserved, so a later Workspace.changes call includes this generation together with any other edits made by the caller.
15143    ///
15144    /// # Arguments
15145    ///
15146    /// * `workspace` - The workspace to apply generated files to.
15147    pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
15148        let mut query = self.selection.select("generate");
15149        query = query.arg_lazy(
15150            "workspace",
15151            Box::new(move || {
15152                let workspace = workspace.clone();
15153                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
15154            }),
15155        );
15156        Workspace {
15157            proc: self.proc.clone(),
15158            selection: query,
15159            graphql_client: self.graphql_client.clone(),
15160        }
15161    }
15162    /// A human readable ref string representation of this module source.
15163    pub async fn as_string(&self) -> Result<String, DaggerError> {
15164        let query = self.selection.select("asString");
15165        query.execute(self.graphql_client.clone()).await
15166    }
15167    /// The pinned version of this module source.
15168    pub async fn pin(&self) -> Result<String, DaggerError> {
15169        let query = self.selection.select("pin");
15170        query.execute(self.graphql_client.clone()).await
15171    }
15172    /// 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.
15173    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
15174        let query = self.selection.select("localContextDirectoryPath");
15175        query.execute(self.graphql_client.clone()).await
15176    }
15177    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
15178    pub fn as_module(&self) -> Module {
15179        let query = self.selection.select("asModule");
15180        Module {
15181            proc: self.proc.clone(),
15182            selection: query,
15183            graphql_client: self.graphql_client.clone(),
15184        }
15185    }
15186    /// The introspection schema JSON file for this module source.
15187    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
15188    /// Note: this is in the context of a module, so some core types may be hidden.
15189    pub fn introspection_schema_json(&self) -> File {
15190        let query = self.selection.select("introspectionSchemaJSON");
15191        File {
15192            proc: self.proc.clone(),
15193            selection: query,
15194            graphql_client: self.graphql_client.clone(),
15195        }
15196    }
15197    /// The client-facing introspection schema JSON file for this module source.
15198    /// 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.
15199    pub fn client_schema_introspection_json(&self) -> File {
15200        let query = self.selection.select("clientSchemaIntrospectionJSON");
15201        File {
15202            proc: self.proc.clone(),
15203            selection: query,
15204            graphql_client: self.graphql_client.clone(),
15205        }
15206    }
15207    /// The directory containing the module configuration and source code (source code may be in a subdir).
15208    ///
15209    /// # Arguments
15210    ///
15211    /// * `path` - A subpath from the source directory to select.
15212    pub fn directory(&self, path: impl Into<String>) -> Directory {
15213        let mut query = self.selection.select("directory");
15214        query = query.arg("path", path.into());
15215        Directory {
15216            proc: self.proc.clone(),
15217            selection: query,
15218            graphql_client: self.graphql_client.clone(),
15219        }
15220    }
15221    /// The ref to clone the root of the git repo from. Only valid for git sources.
15222    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
15223        let query = self.selection.select("cloneRef");
15224        query.execute(self.graphql_client.clone()).await
15225    }
15226    /// The URL to the source's git repo in a web browser. Only valid for git sources.
15227    pub async fn html_url(&self) -> Result<String, DaggerError> {
15228        let query = self.selection.select("htmlURL");
15229        query.execute(self.graphql_client.clone()).await
15230    }
15231    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
15232    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
15233        let query = self.selection.select("htmlRepoURL");
15234        query.execute(self.graphql_client.clone()).await
15235    }
15236    /// The specified version of the git repo this source points to.
15237    pub async fn version(&self) -> Result<String, DaggerError> {
15238        let query = self.selection.select("version");
15239        query.execute(self.graphql_client.clone()).await
15240    }
15241    /// The resolved commit of the git repo this source points to.
15242    pub async fn commit(&self) -> Result<String, DaggerError> {
15243        let query = self.selection.select("commit");
15244        query.execute(self.graphql_client.clone()).await
15245    }
15246    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
15247    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
15248        let query = self.selection.select("repoRootPath");
15249        query.execute(self.graphql_client.clone()).await
15250    }
15251    /// Update the module source with a new client to generate.
15252    ///
15253    /// # Arguments
15254    ///
15255    /// * `generator` - The generator to use
15256    /// * `output_dir` - The output directory for the generated client.
15257    pub fn with_client(
15258        &self,
15259        generator: impl Into<String>,
15260        output_dir: impl Into<String>,
15261    ) -> ModuleSource {
15262        let mut query = self.selection.select("withClient");
15263        query = query.arg("generator", generator.into());
15264        query = query.arg("outputDir", output_dir.into());
15265        ModuleSource {
15266            proc: self.proc.clone(),
15267            selection: query,
15268            graphql_client: self.graphql_client.clone(),
15269        }
15270    }
15271    /// Update one or more clients.
15272    ///
15273    /// # Arguments
15274    ///
15275    /// * `clients` - The clients to update
15276    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
15277        let mut query = self.selection.select("withUpdatedClients");
15278        query = query.arg(
15279            "clients",
15280            clients
15281                .into_iter()
15282                .map(|i| i.into())
15283                .collect::<Vec<String>>(),
15284        );
15285        ModuleSource {
15286            proc: self.proc.clone(),
15287            selection: query,
15288            graphql_client: self.graphql_client.clone(),
15289        }
15290    }
15291    /// Remove a client from the module source.
15292    ///
15293    /// # Arguments
15294    ///
15295    /// * `path` - The path of the client to remove.
15296    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
15297        let mut query = self.selection.select("withoutClient");
15298        query = query.arg("path", path.into());
15299        ModuleSource {
15300            proc: self.proc.clone(),
15301            selection: query,
15302            graphql_client: self.graphql_client.clone(),
15303        }
15304    }
15305    /// Whether an existing module config file was found.
15306    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
15307        let query = self.selection.select("configExists");
15308        query.execute(self.graphql_client.clone()).await
15309    }
15310    /// The name of the module, including any setting via the withName API.
15311    pub async fn module_name(&self) -> Result<String, DaggerError> {
15312        let query = self.selection.select("moduleName");
15313        query.execute(self.graphql_client.clone()).await
15314    }
15315    /// The original name of the module as read from the module config file (or set for the first time with the withName API).
15316    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
15317        let query = self.selection.select("moduleOriginalName");
15318        query.execute(self.graphql_client.clone()).await
15319    }
15320    /// The engine version of the module.
15321    pub async fn engine_version(&self) -> Result<String, DaggerError> {
15322        let query = self.selection.select("engineVersion");
15323        query.execute(self.graphql_client.clone()).await
15324    }
15325    /// The SDK configuration of the module.
15326    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
15327        let query = self.selection.select("sdk");
15328        let query = query.select("id");
15329        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15330        Ok(id.map(|id| SdkConfig {
15331            proc: self.proc.clone(),
15332            selection: query
15333                .root()
15334                .select("node")
15335                .arg("id", &id.0)
15336                .inline_fragment("SDKConfig"),
15337            graphql_client: self.graphql_client.clone(),
15338        }))
15339    }
15340    /// The dependencies of the module source.
15341    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15342        let query = self.selection.select("dependencies");
15343        let query = query.select("id");
15344        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15345        Ok(ids
15346            .into_iter()
15347            .map(|id| ModuleSource {
15348                proc: self.proc.clone(),
15349                selection: crate::querybuilder::query()
15350                    .select("node")
15351                    .arg("id", &id.0)
15352                    .inline_fragment("ModuleSource"),
15353                graphql_client: self.graphql_client.clone(),
15354            })
15355            .collect())
15356    }
15357    /// The blueprint referenced by the module source.
15358    pub fn blueprint(&self) -> ModuleSource {
15359        let query = self.selection.select("blueprint");
15360        ModuleSource {
15361            proc: self.proc.clone(),
15362            selection: query,
15363            graphql_client: self.graphql_client.clone(),
15364        }
15365    }
15366    /// The toolchains referenced by the module source.
15367    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15368        let query = self.selection.select("toolchains");
15369        let query = query.select("id");
15370        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15371        Ok(ids
15372            .into_iter()
15373            .map(|id| ModuleSource {
15374                proc: self.proc.clone(),
15375                selection: crate::querybuilder::query()
15376                    .select("node")
15377                    .arg("id", &id.0)
15378                    .inline_fragment("ModuleSource"),
15379                graphql_client: self.graphql_client.clone(),
15380            })
15381            .collect())
15382    }
15383    /// User-defined defaults read from local .env files
15384    pub fn user_defaults(&self) -> EnvFile {
15385        let query = self.selection.select("userDefaults");
15386        EnvFile {
15387            proc: self.proc.clone(),
15388            selection: query,
15389            graphql_client: self.graphql_client.clone(),
15390        }
15391    }
15392    /// The clients generated for the module.
15393    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
15394        let query = self.selection.select("configClients");
15395        let query = query.select("id");
15396        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15397        Ok(ids
15398            .into_iter()
15399            .map(|id| ModuleConfigClient {
15400                proc: self.proc.clone(),
15401                selection: crate::querybuilder::query()
15402                    .select("node")
15403                    .arg("id", &id.0)
15404                    .inline_fragment("ModuleConfigClient"),
15405                graphql_client: self.graphql_client.clone(),
15406            })
15407            .collect())
15408    }
15409    /// The path, relative to the context directory, that contains the module config.
15410    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
15411        let query = self.selection.select("sourceRootSubpath");
15412        query.execute(self.graphql_client.clone()).await
15413    }
15414    /// The full directory loaded for the module source, including the source code as a subdirectory.
15415    pub fn context_directory(&self) -> Directory {
15416        let query = self.selection.select("contextDirectory");
15417        Directory {
15418            proc: self.proc.clone(),
15419            selection: query,
15420            graphql_client: self.graphql_client.clone(),
15421        }
15422    }
15423    /// The kind of module source (currently local, git or dir).
15424    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
15425        let query = self.selection.select("kind");
15426        query.execute(self.graphql_client.clone()).await
15427    }
15428}
15429impl Node for ModuleSource {
15430    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15431        let query = self.selection.select("id");
15432        let graphql_client = self.graphql_client.clone();
15433        async move { query.execute(graphql_client).await }
15434    }
15435}
15436impl Syncer for ModuleSource {
15437    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15438        let query = self.selection.select("id");
15439        let graphql_client = self.graphql_client.clone();
15440        async move { query.execute(graphql_client).await }
15441    }
15442    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15443        let query = self.selection.select("sync");
15444        let proc = self.proc.clone();
15445        let graphql_client = self.graphql_client.clone();
15446        async move {
15447            let id: Id = query.execute(graphql_client.clone()).await?;
15448            Ok(Self {
15449                proc,
15450                selection: query
15451                    .root()
15452                    .select("node")
15453                    .arg("id", &id.0)
15454                    .inline_fragment("ModuleSource"),
15455                graphql_client,
15456            })
15457        }
15458    }
15459}
15460#[derive(Clone)]
15461pub struct NamingTerm {
15462    pub proc: Option<Arc<DaggerSessionProc>>,
15463    pub selection: Selection,
15464    pub graphql_client: DynGraphQLClient,
15465}
15466impl IntoID<Id> for NamingTerm {
15467    fn into_id(
15468        self,
15469    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15470        Box::pin(async move { self.id().await })
15471    }
15472}
15473impl Loadable for NamingTerm {
15474    fn graphql_type() -> &'static str {
15475        "NamingTerm"
15476    }
15477    fn from_query(
15478        proc: Option<Arc<DaggerSessionProc>>,
15479        selection: Selection,
15480        graphql_client: DynGraphQLClient,
15481    ) -> Self {
15482        Self {
15483            proc,
15484            selection,
15485            graphql_client,
15486        }
15487    }
15488}
15489impl NamingTerm {
15490    /// A unique identifier for this NamingTerm.
15491    pub async fn id(&self) -> Result<Id, DaggerError> {
15492        let query = self.selection.select("id");
15493        query.execute(self.graphql_client.clone()).await
15494    }
15495    /// Standard spelling: "HTTP", "IPv6", "GitHub", "iOS".
15496    pub async fn spelling(&self) -> Result<String, DaggerError> {
15497        let query = self.selection.select("spelling");
15498        query.execute(self.graphql_client.clone()).await
15499    }
15500    /// Spelling in the CAPITALIZED style: "Http", "Ipv6", "GitHub", "Ios".
15501    pub async fn capitalized(&self) -> Result<String, DaggerError> {
15502        let query = self.selection.select("capitalized");
15503        query.execute(self.graphql_client.clone()).await
15504    }
15505}
15506impl Node for NamingTerm {
15507    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15508        let query = self.selection.select("id");
15509        let graphql_client = self.graphql_client.clone();
15510        async move { query.execute(graphql_client).await }
15511    }
15512}
15513#[derive(Clone)]
15514pub struct ObjectTypeDef {
15515    pub proc: Option<Arc<DaggerSessionProc>>,
15516    pub selection: Selection,
15517    pub graphql_client: DynGraphQLClient,
15518}
15519impl IntoID<Id> for ObjectTypeDef {
15520    fn into_id(
15521        self,
15522    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15523        Box::pin(async move { self.id().await })
15524    }
15525}
15526impl Loadable for ObjectTypeDef {
15527    fn graphql_type() -> &'static str {
15528        "ObjectTypeDef"
15529    }
15530    fn from_query(
15531        proc: Option<Arc<DaggerSessionProc>>,
15532        selection: Selection,
15533        graphql_client: DynGraphQLClient,
15534    ) -> Self {
15535        Self {
15536            proc,
15537            selection,
15538            graphql_client,
15539        }
15540    }
15541}
15542impl ObjectTypeDef {
15543    /// A unique identifier for this ObjectTypeDef.
15544    pub async fn id(&self) -> Result<Id, DaggerError> {
15545        let query = self.selection.select("id");
15546        query.execute(self.graphql_client.clone()).await
15547    }
15548    /// The name of the object.
15549    pub async fn name(&self) -> Result<String, DaggerError> {
15550        let query = self.selection.select("name");
15551        query.execute(self.graphql_client.clone()).await
15552    }
15553    /// The doc string for the object, if any.
15554    pub async fn description(&self) -> Result<String, DaggerError> {
15555        let query = self.selection.select("description");
15556        query.execute(self.graphql_client.clone()).await
15557    }
15558    /// The location of this object declaration.
15559    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
15560        let query = self.selection.select("sourceMap");
15561        let query = query.select("id");
15562        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15563        Ok(id.map(|id| SourceMap {
15564            proc: self.proc.clone(),
15565            selection: query
15566                .root()
15567                .select("node")
15568                .arg("id", &id.0)
15569                .inline_fragment("SourceMap"),
15570            graphql_client: self.graphql_client.clone(),
15571        }))
15572    }
15573    /// The reason this enum member is deprecated, if any.
15574    pub async fn deprecated(&self) -> Result<String, DaggerError> {
15575        let query = self.selection.select("deprecated");
15576        query.execute(self.graphql_client.clone()).await
15577    }
15578    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
15579    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15580        let query = self.selection.select("sourceModuleName");
15581        query.execute(self.graphql_client.clone()).await
15582    }
15583    /// Static fields defined on this object, if any.
15584    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
15585        let query = self.selection.select("fields");
15586        let query = query.select("id");
15587        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15588        Ok(ids
15589            .into_iter()
15590            .map(|id| FieldTypeDef {
15591                proc: self.proc.clone(),
15592                selection: crate::querybuilder::query()
15593                    .select("node")
15594                    .arg("id", &id.0)
15595                    .inline_fragment("FieldTypeDef"),
15596                graphql_client: self.graphql_client.clone(),
15597            })
15598            .collect())
15599    }
15600    /// Functions defined on this object, if any.
15601    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
15602        let query = self.selection.select("functions");
15603        let query = query.select("id");
15604        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15605        Ok(ids
15606            .into_iter()
15607            .map(|id| Function {
15608                proc: self.proc.clone(),
15609                selection: crate::querybuilder::query()
15610                    .select("node")
15611                    .arg("id", &id.0)
15612                    .inline_fragment("Function"),
15613                graphql_client: self.graphql_client.clone(),
15614            })
15615            .collect())
15616    }
15617    /// The function used to construct new instances of this object, if any.
15618    pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
15619        let query = self.selection.select("constructor");
15620        let query = query.select("id");
15621        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15622        Ok(id.map(|id| Function {
15623            proc: self.proc.clone(),
15624            selection: query
15625                .root()
15626                .select("node")
15627                .arg("id", &id.0)
15628                .inline_fragment("Function"),
15629            graphql_client: self.graphql_client.clone(),
15630        }))
15631    }
15632}
15633impl Node for ObjectTypeDef {
15634    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15635        let query = self.selection.select("id");
15636        let graphql_client = self.graphql_client.clone();
15637        async move { query.execute(graphql_client).await }
15638    }
15639}
15640#[derive(Clone)]
15641pub struct Port {
15642    pub proc: Option<Arc<DaggerSessionProc>>,
15643    pub selection: Selection,
15644    pub graphql_client: DynGraphQLClient,
15645}
15646impl IntoID<Id> for Port {
15647    fn into_id(
15648        self,
15649    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15650        Box::pin(async move { self.id().await })
15651    }
15652}
15653impl Loadable for Port {
15654    fn graphql_type() -> &'static str {
15655        "Port"
15656    }
15657    fn from_query(
15658        proc: Option<Arc<DaggerSessionProc>>,
15659        selection: Selection,
15660        graphql_client: DynGraphQLClient,
15661    ) -> Self {
15662        Self {
15663            proc,
15664            selection,
15665            graphql_client,
15666        }
15667    }
15668}
15669impl Port {
15670    /// A unique identifier for this Port.
15671    pub async fn id(&self) -> Result<Id, DaggerError> {
15672        let query = self.selection.select("id");
15673        query.execute(self.graphql_client.clone()).await
15674    }
15675    /// The port number.
15676    pub async fn port(&self) -> Result<isize, DaggerError> {
15677        let query = self.selection.select("port");
15678        query.execute(self.graphql_client.clone()).await
15679    }
15680    /// The transport layer protocol.
15681    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
15682        let query = self.selection.select("protocol");
15683        query.execute(self.graphql_client.clone()).await
15684    }
15685    /// The port description.
15686    pub async fn description(&self) -> Result<String, DaggerError> {
15687        let query = self.selection.select("description");
15688        query.execute(self.graphql_client.clone()).await
15689    }
15690    /// Skip the health check when run as a service.
15691    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
15692        let query = self.selection.select("experimentalSkipHealthcheck");
15693        query.execute(self.graphql_client.clone()).await
15694    }
15695}
15696impl Node for Port {
15697    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15698        let query = self.selection.select("id");
15699        let graphql_client = self.graphql_client.clone();
15700        async move { query.execute(graphql_client).await }
15701    }
15702}
15703#[derive(Clone)]
15704pub struct Query {
15705    pub proc: Option<Arc<DaggerSessionProc>>,
15706    pub selection: Selection,
15707    pub graphql_client: DynGraphQLClient,
15708}
15709#[derive(Builder, Debug, PartialEq)]
15710pub struct QueryFileOpts {
15711    /// Permissions of the new file. Example: 0600
15712    #[builder(setter(into, strip_option), default)]
15713    pub permissions: Option<isize>,
15714}
15715#[derive(Builder, Debug, PartialEq)]
15716pub struct QueryBlobOpts {
15717    /// Permissions of the new file. Example: 0600
15718    #[builder(setter(into, strip_option), default)]
15719    pub permissions: Option<isize>,
15720}
15721#[derive(Builder, Debug, PartialEq)]
15722pub struct QueryGitOpts<'a> {
15723    /// A service which must be started before the repo is fetched.
15724    #[builder(setter(into, strip_option), default)]
15725    pub experimental_service_host: Option<Id>,
15726    /// Secret used to populate the Authorization HTTP header
15727    #[builder(setter(into, strip_option), default)]
15728    pub http_auth_header: Option<Id>,
15729    /// Secret used to populate the password during basic HTTP Authorization
15730    #[builder(setter(into, strip_option), default)]
15731    pub http_auth_token: Option<Id>,
15732    /// Username used to populate the password during basic HTTP Authorization
15733    #[builder(setter(into, strip_option), default)]
15734    pub http_auth_username: Option<&'a str>,
15735    /// DEPRECATED: Set to true to keep .git directory.
15736    #[builder(setter(into, strip_option), default)]
15737    pub keep_git_dir: Option<bool>,
15738    /// Set SSH auth socket
15739    #[builder(setter(into, strip_option), default)]
15740    pub ssh_auth_socket: Option<Id>,
15741    /// Set SSH known hosts
15742    #[builder(setter(into, strip_option), default)]
15743    pub ssh_known_hosts: Option<&'a str>,
15744}
15745#[derive(Builder, Debug, PartialEq)]
15746pub struct QueryContainerOpts {
15747    /// Platform to initialize the container with. Defaults to the native platform of the current engine
15748    #[builder(setter(into, strip_option), default)]
15749    pub platform: Option<Platform>,
15750}
15751#[derive(Builder, Debug, PartialEq)]
15752pub struct QueryCacheVolumeOpts<'a> {
15753    /// A user:group to set for the cache volume root.
15754    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
15755    /// If the group is omitted, it defaults to the same as the user.
15756    #[builder(setter(into, strip_option), default)]
15757    pub owner: Option<&'a str>,
15758    /// Sharing mode of the cache volume.
15759    #[builder(setter(into, strip_option), default)]
15760    pub sharing: Option<CacheSharingMode>,
15761    /// Identifier of the directory to use as the cache volume's root.
15762    #[builder(setter(into, strip_option), default)]
15763    pub source: Option<Id>,
15764}
15765#[derive(Builder, Debug, PartialEq)]
15766pub struct QueryEngineVolumeOpts<'a> {
15767    /// Optional existing subdirectory within the volume payload to mount.
15768    #[builder(setter(into, strip_option), default)]
15769    pub subdir: Option<&'a str>,
15770}
15771#[derive(Builder, Debug, PartialEq)]
15772pub struct QuerySshfsVolumeOpts<'a> {
15773    /// Optional cache equivalence key. If set, volumes with the same cacheKey may be considered equivalent for cache lookups, still subject to their resource dependencies.
15774    #[builder(setter(into, strip_option), default)]
15775    pub cache_key: Option<&'a str>,
15776    /// Service to use as the SSHFS network endpoint while verifying the original host key.
15777    #[builder(setter(into, strip_option), default)]
15778    pub experimental_service_host: Option<Id>,
15779    /// Disable SSH host key verification. This is insecure and must be explicitly opted into.
15780    #[builder(setter(into, strip_option), default)]
15781    pub insecure_skip_host_key_check: Option<bool>,
15782    /// known_hosts material used to verify the remote host key. Required unless insecureSkipHostKeyCheck is true.
15783    #[builder(setter(into, strip_option), default)]
15784    pub known_hosts: Option<Id>,
15785}
15786#[derive(Builder, Debug, PartialEq)]
15787pub struct QuerySecretOpts<'a> {
15788    /// 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.
15789    /// 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.
15790    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
15791    #[builder(setter(into, strip_option), default)]
15792    pub cache_key: Option<&'a str>,
15793}
15794#[derive(Builder, Debug, PartialEq)]
15795pub struct QueryHttpOpts<'a> {
15796    /// Secret used to populate the Authorization HTTP header
15797    #[builder(setter(into, strip_option), default)]
15798    pub auth_header: Option<Id>,
15799    /// Expected digest of the downloaded content (e.g., "sha256:...").
15800    #[builder(setter(into, strip_option), default)]
15801    pub checksum: Option<&'a str>,
15802    /// A service which must be started before the URL is fetched.
15803    #[builder(setter(into, strip_option), default)]
15804    pub experimental_service_host: Option<Id>,
15805    /// File name to use for the file. Defaults to the last part of the URL.
15806    #[builder(setter(into, strip_option), default)]
15807    pub name: Option<&'a str>,
15808    /// Permissions to set on the file.
15809    #[builder(setter(into, strip_option), default)]
15810    pub permissions: Option<isize>,
15811}
15812#[derive(Builder, Debug, PartialEq)]
15813pub struct QueryModuleSourceOpts<'a> {
15814    /// 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.
15815    #[builder(setter(into, strip_option), default)]
15816    pub allow_not_exists: Option<bool>,
15817    /// 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.
15818    #[builder(setter(into, strip_option), default)]
15819    pub disable_find_up: Option<bool>,
15820    /// The pinned version of the module source
15821    #[builder(setter(into, strip_option), default)]
15822    pub ref_pin: Option<&'a str>,
15823    /// If set, error out if the ref string is not of the provided requireKind.
15824    #[builder(setter(into, strip_option), default)]
15825    pub require_kind: Option<ModuleSourceKind>,
15826    /// Version query for a Git module source.
15827    #[builder(setter(into, strip_option), default)]
15828    pub version: Option<&'a str>,
15829}
15830#[derive(Builder, Debug, PartialEq)]
15831pub struct QueryCurrentTypeDefsOpts {
15832    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, workspace main proxies, etc.).
15833    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
15834    #[builder(setter(into, strip_option), default)]
15835    pub hide_core: Option<bool>,
15836    /// Return the full referenced typedef closure instead of only top-level served typedefs.
15837    #[builder(setter(into, strip_option), default)]
15838    pub return_all_types: Option<bool>,
15839}
15840#[derive(Builder, Debug, PartialEq)]
15841pub struct QueryServeModuleOpts<'a> {
15842    /// The pinned version of a remote module address.
15843    #[builder(setter(into, strip_option), default)]
15844    pub ref_pin: Option<&'a str>,
15845}
15846#[derive(Builder, Debug, PartialEq)]
15847pub struct QueryLlmOpts<'a> {
15848    /// The model to converse with, e.g. "claude-sonnet-4-5" or "gpt-5.4". Defaults to the configured default model.
15849    #[builder(setter(into, strip_option), default)]
15850    pub model: Option<&'a str>,
15851    /// 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.
15852    #[builder(setter(into, strip_option), default)]
15853    pub provider: Option<&'a str>,
15854}
15855#[derive(Builder, Debug, PartialEq)]
15856pub struct QueryFormatIdentifiersOpts<'a> {
15857    /// How to write acronyms and terms where a word starts with a capital.
15858    #[builder(setter(into, strip_option), default)]
15859    pub acronyms: Option<AcronymStyle>,
15860    /// The engine version whose naming dictionary to parse the names with, e.g. the __schemaVersion of a schema being generated. Defaults to the caller's engine version.
15861    #[builder(setter(into, strip_option), default)]
15862    pub version: Option<&'a str>,
15863}
15864#[derive(Builder, Debug, PartialEq)]
15865pub struct QueryEnvFileOpts {
15866    /// Replace "${VAR}" or "$VAR" with the value of other vars
15867    #[builder(setter(into, strip_option), default)]
15868    pub expand: Option<bool>,
15869}
15870impl IntoID<Id> for Query {
15871    fn into_id(
15872        self,
15873    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15874        Box::pin(async move { self.id().await })
15875    }
15876}
15877impl Loadable for Query {
15878    fn graphql_type() -> &'static str {
15879        "Query"
15880    }
15881    fn from_query(
15882        proc: Option<Arc<DaggerSessionProc>>,
15883        selection: Selection,
15884        graphql_client: DynGraphQLClient,
15885    ) -> Self {
15886        Self {
15887            proc,
15888            selection,
15889            graphql_client,
15890        }
15891    }
15892}
15893impl Query {
15894    /// A unique identifier for this Query.
15895    pub async fn id(&self) -> Result<Id, DaggerError> {
15896        let query = self.selection.select("id");
15897        query.execute(self.graphql_client.clone()).await
15898    }
15899    /// Load any object by its ID.
15900    pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
15901        let mut query = self.selection.select("node");
15902        query = query.arg_lazy(
15903            "id",
15904            Box::new(move || {
15905                let id = id.clone();
15906                Box::pin(async move { id.into_id().await.unwrap().quote() })
15907            }),
15908        );
15909        let query = query.select("id");
15910        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15911        Ok(id.map(|id| NodeClient {
15912            proc: self.proc.clone(),
15913            selection: query
15914                .root()
15915                .select("node")
15916                .arg("id", &id.0)
15917                .inline_fragment("Node"),
15918            graphql_client: self.graphql_client.clone(),
15919        }))
15920    }
15921    /// Get the current Dagger Engine version.
15922    pub async fn version(&self) -> Result<String, DaggerError> {
15923        let query = self.selection.select("version");
15924        query.execute(self.graphql_client.clone()).await
15925    }
15926    /// The current UTC time in RFC3339 format. Never cached.
15927    pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
15928        let query = self.selection.select("currentTimestamp");
15929        query.execute(self.graphql_client.clone()).await
15930    }
15931    /// Name the current session.
15932    /// 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.
15933    ///
15934    /// # Arguments
15935    ///
15936    /// * `title` - The title, sanitized to a single printable line.
15937    pub async fn set_session_title(&self, title: impl Into<String>) -> Result<Void, DaggerError> {
15938        let mut query = self.selection.select("setSessionTitle");
15939        query = query.arg("title", title.into());
15940        query.execute(self.graphql_client.clone()).await
15941    }
15942    /// Creates an empty directory.
15943    pub fn directory(&self) -> Directory {
15944        let query = self.selection.select("directory");
15945        Directory {
15946            proc: self.proc.clone(),
15947            selection: query,
15948            graphql_client: self.graphql_client.clone(),
15949        }
15950    }
15951    /// Creates an empty changeset
15952    pub fn changeset(&self) -> Changeset {
15953        let query = self.selection.select("changeset");
15954        Changeset {
15955            proc: self.proc.clone(),
15956            selection: query,
15957            graphql_client: self.graphql_client.clone(),
15958        }
15959    }
15960    /// Creates a file with the specified contents.
15961    ///
15962    /// # Arguments
15963    ///
15964    /// * `name` - Name of the new file. Example: "foo.txt"
15965    /// * `contents` - Contents of the new file. Example: "Hello world!"
15966    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15967    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
15968        let mut query = self.selection.select("file");
15969        query = query.arg("name", name.into());
15970        query = query.arg("contents", contents.into());
15971        File {
15972            proc: self.proc.clone(),
15973            selection: query,
15974            graphql_client: self.graphql_client.clone(),
15975        }
15976    }
15977    /// Creates a file with the specified contents.
15978    ///
15979    /// # Arguments
15980    ///
15981    /// * `name` - Name of the new file. Example: "foo.txt"
15982    /// * `contents` - Contents of the new file. Example: "Hello world!"
15983    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15984    pub fn file_opts(
15985        &self,
15986        name: impl Into<String>,
15987        contents: impl Into<String>,
15988        opts: QueryFileOpts,
15989    ) -> File {
15990        let mut query = self.selection.select("file");
15991        query = query.arg("name", name.into());
15992        query = query.arg("contents", contents.into());
15993        if let Some(permissions) = opts.permissions {
15994            query = query.arg("permissions", permissions);
15995        }
15996        File {
15997            proc: self.proc.clone(),
15998            selection: query,
15999            graphql_client: self.graphql_client.clone(),
16000        }
16001    }
16002    /// Creates a file from arbitrary binary contents.
16003    ///
16004    /// # Arguments
16005    ///
16006    /// * `name` - Name of the new file. Example: "archive.tar"
16007    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
16008    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16009    pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
16010        let mut query = self.selection.select("blob");
16011        query = query.arg("name", name.into());
16012        query = query.arg("contents", contents);
16013        File {
16014            proc: self.proc.clone(),
16015            selection: query,
16016            graphql_client: self.graphql_client.clone(),
16017        }
16018    }
16019    /// Creates a file from arbitrary binary contents.
16020    ///
16021    /// # Arguments
16022    ///
16023    /// * `name` - Name of the new file. Example: "archive.tar"
16024    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
16025    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16026    pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
16027        let mut query = self.selection.select("blob");
16028        query = query.arg("name", name.into());
16029        query = query.arg("contents", contents);
16030        if let Some(permissions) = opts.permissions {
16031            query = query.arg("permissions", permissions);
16032        }
16033        File {
16034            proc: self.proc.clone(),
16035            selection: query,
16036            graphql_client: self.graphql_client.clone(),
16037        }
16038    }
16039    /// Queries a Git repository.
16040    ///
16041    /// # Arguments
16042    ///
16043    /// * `url` - URL of the git repository.
16044    ///
16045    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
16046    ///
16047    /// Suffix ".git" is optional.
16048    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16049    pub fn git(&self, url: impl Into<String>) -> GitRepository {
16050        let mut query = self.selection.select("git");
16051        query = query.arg("url", url.into());
16052        GitRepository {
16053            proc: self.proc.clone(),
16054            selection: query,
16055            graphql_client: self.graphql_client.clone(),
16056        }
16057    }
16058    /// Queries a Git repository.
16059    ///
16060    /// # Arguments
16061    ///
16062    /// * `url` - URL of the git repository.
16063    ///
16064    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
16065    ///
16066    /// Suffix ".git" is optional.
16067    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16068    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
16069        let mut query = self.selection.select("git");
16070        query = query.arg("url", url.into());
16071        if let Some(keep_git_dir) = opts.keep_git_dir {
16072            query = query.arg("keepGitDir", keep_git_dir);
16073        }
16074        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
16075            query = query.arg("sshKnownHosts", ssh_known_hosts);
16076        }
16077        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
16078            query = query.arg("sshAuthSocket", ssh_auth_socket);
16079        }
16080        if let Some(http_auth_username) = opts.http_auth_username {
16081            query = query.arg("httpAuthUsername", http_auth_username);
16082        }
16083        if let Some(http_auth_token) = opts.http_auth_token {
16084            query = query.arg("httpAuthToken", http_auth_token);
16085        }
16086        if let Some(http_auth_header) = opts.http_auth_header {
16087            query = query.arg("httpAuthHeader", http_auth_header);
16088        }
16089        if let Some(experimental_service_host) = opts.experimental_service_host {
16090            query = query.arg("experimentalServiceHost", experimental_service_host);
16091        }
16092        GitRepository {
16093            proc: self.proc.clone(),
16094            selection: query,
16095            graphql_client: self.graphql_client.clone(),
16096        }
16097    }
16098    /// Creates a scratch container, with no image or metadata.
16099    /// To pull an image, follow up with the "from" function.
16100    ///
16101    /// # Arguments
16102    ///
16103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16104    pub fn container(&self) -> Container {
16105        let query = self.selection.select("container");
16106        Container {
16107            proc: self.proc.clone(),
16108            selection: query,
16109            graphql_client: self.graphql_client.clone(),
16110        }
16111    }
16112    /// Creates a scratch container, with no image or metadata.
16113    /// To pull an image, follow up with the "from" function.
16114    ///
16115    /// # Arguments
16116    ///
16117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16118    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
16119        let mut query = self.selection.select("container");
16120        if let Some(platform) = opts.platform {
16121            query = query.arg("platform", platform);
16122        }
16123        Container {
16124            proc: self.proc.clone(),
16125            selection: query,
16126            graphql_client: self.graphql_client.clone(),
16127        }
16128    }
16129    /// Constructs a cache volume for a given cache key.
16130    ///
16131    /// # Arguments
16132    ///
16133    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
16134    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16135    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
16136        let mut query = self.selection.select("cacheVolume");
16137        query = query.arg("key", key.into());
16138        CacheVolume {
16139            proc: self.proc.clone(),
16140            selection: query,
16141            graphql_client: self.graphql_client.clone(),
16142        }
16143    }
16144    /// Constructs a cache volume for a given cache key.
16145    ///
16146    /// # Arguments
16147    ///
16148    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
16149    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16150    pub fn cache_volume_opts<'a>(
16151        &self,
16152        key: impl Into<String>,
16153        opts: QueryCacheVolumeOpts<'a>,
16154    ) -> CacheVolume {
16155        let mut query = self.selection.select("cacheVolume");
16156        query = query.arg("key", key.into());
16157        if let Some(source) = opts.source {
16158            query = query.arg("source", source);
16159        }
16160        if let Some(sharing) = opts.sharing {
16161            query = query.arg("sharing", sharing);
16162        }
16163        if let Some(owner) = opts.owner {
16164            query = query.arg("owner", owner);
16165        }
16166        CacheVolume {
16167            proc: self.proc.clone(),
16168            selection: query,
16169            graphql_client: self.graphql_client.clone(),
16170        }
16171    }
16172    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
16173    ///
16174    /// # Arguments
16175    ///
16176    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
16177    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16178    pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
16179        let mut query = self.selection.select("engineVolume");
16180        query = query.arg("name", name.into());
16181        Volume {
16182            proc: self.proc.clone(),
16183            selection: query,
16184            graphql_client: self.graphql_client.clone(),
16185        }
16186    }
16187    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
16188    ///
16189    /// # Arguments
16190    ///
16191    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
16192    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16193    pub fn engine_volume_opts<'a>(
16194        &self,
16195        name: impl Into<String>,
16196        opts: QueryEngineVolumeOpts<'a>,
16197    ) -> Volume {
16198        let mut query = self.selection.select("engineVolume");
16199        query = query.arg("name", name.into());
16200        if let Some(subdir) = opts.subdir {
16201            query = query.arg("subdir", subdir);
16202        }
16203        Volume {
16204            proc: self.proc.clone(),
16205            selection: query,
16206            graphql_client: self.graphql_client.clone(),
16207        }
16208    }
16209    /// Constructs an SSHFS volume.
16210    ///
16211    /// # Arguments
16212    ///
16213    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
16214    /// * `private_key` - Private key secret used to authenticate to the remote host.
16215    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16216    pub fn sshfs_volume(
16217        &self,
16218        endpoint: impl Into<String>,
16219        private_key: impl IntoID<Id>,
16220    ) -> Volume {
16221        let mut query = self.selection.select("sshfsVolume");
16222        query = query.arg("endpoint", endpoint.into());
16223        query = query.arg_lazy(
16224            "privateKey",
16225            Box::new(move || {
16226                let private_key = private_key.clone();
16227                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
16228            }),
16229        );
16230        Volume {
16231            proc: self.proc.clone(),
16232            selection: query,
16233            graphql_client: self.graphql_client.clone(),
16234        }
16235    }
16236    /// Constructs an SSHFS volume.
16237    ///
16238    /// # Arguments
16239    ///
16240    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
16241    /// * `private_key` - Private key secret used to authenticate to the remote host.
16242    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16243    pub fn sshfs_volume_opts<'a>(
16244        &self,
16245        endpoint: impl Into<String>,
16246        private_key: impl IntoID<Id>,
16247        opts: QuerySshfsVolumeOpts<'a>,
16248    ) -> Volume {
16249        let mut query = self.selection.select("sshfsVolume");
16250        query = query.arg("endpoint", endpoint.into());
16251        query = query.arg_lazy(
16252            "privateKey",
16253            Box::new(move || {
16254                let private_key = private_key.clone();
16255                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
16256            }),
16257        );
16258        if let Some(known_hosts) = opts.known_hosts {
16259            query = query.arg("knownHosts", known_hosts);
16260        }
16261        if let Some(cache_key) = opts.cache_key {
16262            query = query.arg("cacheKey", cache_key);
16263        }
16264        if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
16265            query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
16266        }
16267        if let Some(experimental_service_host) = opts.experimental_service_host {
16268            query = query.arg("experimentalServiceHost", experimental_service_host);
16269        }
16270        Volume {
16271            proc: self.proc.clone(),
16272            selection: query,
16273            graphql_client: self.graphql_client.clone(),
16274        }
16275    }
16276    /// Creates a new secret.
16277    ///
16278    /// # Arguments
16279    ///
16280    /// * `uri` - The URI of the secret store
16281    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16282    pub fn secret(&self, uri: impl Into<String>) -> Secret {
16283        let mut query = self.selection.select("secret");
16284        query = query.arg("uri", uri.into());
16285        Secret {
16286            proc: self.proc.clone(),
16287            selection: query,
16288            graphql_client: self.graphql_client.clone(),
16289        }
16290    }
16291    /// Creates a new secret.
16292    ///
16293    /// # Arguments
16294    ///
16295    /// * `uri` - The URI of the secret store
16296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16297    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
16298        let mut query = self.selection.select("secret");
16299        query = query.arg("uri", uri.into());
16300        if let Some(cache_key) = opts.cache_key {
16301            query = query.arg("cacheKey", cache_key);
16302        }
16303        Secret {
16304            proc: self.proc.clone(),
16305            selection: query,
16306            graphql_client: self.graphql_client.clone(),
16307        }
16308    }
16309    /// Sets a secret given a user defined name to its plaintext and returns the secret.
16310    /// The plaintext value is limited to a size of 128000 bytes.
16311    ///
16312    /// # Arguments
16313    ///
16314    /// * `name` - The user defined name for this secret
16315    /// * `plaintext` - The plaintext of the secret
16316    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
16317        let mut query = self.selection.select("setSecret");
16318        query = query.arg("name", name.into());
16319        query = query.arg("plaintext", plaintext.into());
16320        Secret {
16321            proc: self.proc.clone(),
16322            selection: query,
16323            graphql_client: self.graphql_client.clone(),
16324        }
16325    }
16326    /// Queries the host environment.
16327    pub fn host(&self) -> Host {
16328        let query = self.selection.select("host");
16329        Host {
16330            proc: self.proc.clone(),
16331            selection: query,
16332            graphql_client: self.graphql_client.clone(),
16333        }
16334    }
16335    /// Returns a file containing an http remote url content.
16336    ///
16337    /// # Arguments
16338    ///
16339    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
16340    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16341    pub fn http(&self, url: impl Into<String>) -> File {
16342        let mut query = self.selection.select("http");
16343        query = query.arg("url", url.into());
16344        File {
16345            proc: self.proc.clone(),
16346            selection: query,
16347            graphql_client: self.graphql_client.clone(),
16348        }
16349    }
16350    /// Returns a file containing an http remote url content.
16351    ///
16352    /// # Arguments
16353    ///
16354    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
16355    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16356    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
16357        let mut query = self.selection.select("http");
16358        query = query.arg("url", url.into());
16359        if let Some(name) = opts.name {
16360            query = query.arg("name", name);
16361        }
16362        if let Some(permissions) = opts.permissions {
16363            query = query.arg("permissions", permissions);
16364        }
16365        if let Some(checksum) = opts.checksum {
16366            query = query.arg("checksum", checksum);
16367        }
16368        if let Some(auth_header) = opts.auth_header {
16369            query = query.arg("authHeader", auth_header);
16370        }
16371        if let Some(experimental_service_host) = opts.experimental_service_host {
16372            query = query.arg("experimentalServiceHost", experimental_service_host);
16373        }
16374        File {
16375            proc: self.proc.clone(),
16376            selection: query,
16377            graphql_client: self.graphql_client.clone(),
16378        }
16379    }
16380    /// The default platform of the engine.
16381    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
16382        let query = self.selection.select("defaultPlatform");
16383        query.execute(self.graphql_client.clone()).await
16384    }
16385    /// Create a new module source instance from a source ref string
16386    ///
16387    /// # Arguments
16388    ///
16389    /// * `ref_string` - The string ref representation of the module source
16390    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16391    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
16392        let mut query = self.selection.select("moduleSource");
16393        query = query.arg("refString", ref_string.into());
16394        ModuleSource {
16395            proc: self.proc.clone(),
16396            selection: query,
16397            graphql_client: self.graphql_client.clone(),
16398        }
16399    }
16400    /// Create a new module source instance from a source ref string
16401    ///
16402    /// # Arguments
16403    ///
16404    /// * `ref_string` - The string ref representation of the module source
16405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16406    pub fn module_source_opts<'a>(
16407        &self,
16408        ref_string: impl Into<String>,
16409        opts: QueryModuleSourceOpts<'a>,
16410    ) -> ModuleSource {
16411        let mut query = self.selection.select("moduleSource");
16412        query = query.arg("refString", ref_string.into());
16413        if let Some(version) = opts.version {
16414            query = query.arg("version", version);
16415        }
16416        if let Some(ref_pin) = opts.ref_pin {
16417            query = query.arg("refPin", ref_pin);
16418        }
16419        if let Some(disable_find_up) = opts.disable_find_up {
16420            query = query.arg("disableFindUp", disable_find_up);
16421        }
16422        if let Some(allow_not_exists) = opts.allow_not_exists {
16423            query = query.arg("allowNotExists", allow_not_exists);
16424        }
16425        if let Some(require_kind) = opts.require_kind {
16426            query = query.arg("requireKind", require_kind);
16427        }
16428        ModuleSource {
16429            proc: self.proc.clone(),
16430            selection: query,
16431            graphql_client: self.graphql_client.clone(),
16432        }
16433    }
16434    /// Create a new module.
16435    pub fn module(&self) -> Module {
16436        let query = self.selection.select("module");
16437        Module {
16438            proc: self.proc.clone(),
16439            selection: query,
16440            graphql_client: self.graphql_client.clone(),
16441        }
16442    }
16443    /// Create a new TypeDef.
16444    pub fn type_def(&self) -> TypeDef {
16445        let query = self.selection.select("typeDef");
16446        TypeDef {
16447            proc: self.proc.clone(),
16448            selection: query,
16449            graphql_client: self.graphql_client.clone(),
16450        }
16451    }
16452    /// Create a code generation result, given a directory containing the generated code.
16453    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
16454        let mut query = self.selection.select("generatedCode");
16455        query = query.arg_lazy(
16456            "code",
16457            Box::new(move || {
16458                let code = code.clone();
16459                Box::pin(async move { code.into_id().await.unwrap().quote() })
16460            }),
16461        );
16462        GeneratedCode {
16463            proc: self.proc.clone(),
16464            selection: query,
16465            graphql_client: self.graphql_client.clone(),
16466        }
16467    }
16468    /// Creates a function.
16469    ///
16470    /// # Arguments
16471    ///
16472    /// * `name` - Name of the function, in its original format from the implementation language.
16473    /// * `return_type` - Return type of the function.
16474    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
16475        let mut query = self.selection.select("function");
16476        query = query.arg("name", name.into());
16477        query = query.arg_lazy(
16478            "returnType",
16479            Box::new(move || {
16480                let return_type = return_type.clone();
16481                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
16482            }),
16483        );
16484        Function {
16485            proc: self.proc.clone(),
16486            selection: query,
16487            graphql_client: self.graphql_client.clone(),
16488        }
16489    }
16490    /// Creates source map metadata.
16491    ///
16492    /// # Arguments
16493    ///
16494    /// * `filename` - The filename from the module source.
16495    /// * `line` - The line number within the filename.
16496    /// * `column` - The column number within the line.
16497    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
16498        let mut query = self.selection.select("sourceMap");
16499        query = query.arg("filename", filename.into());
16500        query = query.arg("line", line);
16501        query = query.arg("column", column);
16502        SourceMap {
16503            proc: self.proc.clone(),
16504            selection: query,
16505            graphql_client: self.graphql_client.clone(),
16506        }
16507    }
16508    /// The module currently being served in the session, if any.
16509    pub fn current_module(&self) -> CurrentModule {
16510        let query = self.selection.select("currentModule");
16511        CurrentModule {
16512            proc: self.proc.clone(),
16513            selection: query,
16514            graphql_client: self.graphql_client.clone(),
16515        }
16516    }
16517    /// The TypeDef representations of the objects currently being served in the session.
16518    ///
16519    /// # Arguments
16520    ///
16521    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16522    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
16523        let query = self.selection.select("currentTypeDefs");
16524        let query = query.select("id");
16525        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16526        Ok(ids
16527            .into_iter()
16528            .map(|id| TypeDef {
16529                proc: self.proc.clone(),
16530                selection: crate::querybuilder::query()
16531                    .select("node")
16532                    .arg("id", &id.0)
16533                    .inline_fragment("TypeDef"),
16534                graphql_client: self.graphql_client.clone(),
16535            })
16536            .collect())
16537    }
16538    /// The TypeDef representations of the objects currently being served in the session.
16539    ///
16540    /// # Arguments
16541    ///
16542    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16543    pub async fn current_type_defs_opts(
16544        &self,
16545        opts: QueryCurrentTypeDefsOpts,
16546    ) -> Result<Vec<TypeDef>, DaggerError> {
16547        let mut query = self.selection.select("currentTypeDefs");
16548        if let Some(return_all_types) = opts.return_all_types {
16549            query = query.arg("returnAllTypes", return_all_types);
16550        }
16551        if let Some(hide_core) = opts.hide_core {
16552            query = query.arg("hideCore", hide_core);
16553        }
16554        let query = query.select("id");
16555        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16556        Ok(ids
16557            .into_iter()
16558            .map(|id| TypeDef {
16559                proc: self.proc.clone(),
16560                selection: crate::querybuilder::query()
16561                    .select("node")
16562                    .arg("id", &id.0)
16563                    .inline_fragment("TypeDef"),
16564                graphql_client: self.graphql_client.clone(),
16565            })
16566            .collect())
16567    }
16568    /// The FunctionCall context that the SDK caller is currently executing in.
16569    /// If the caller is not currently executing in a function, this will return an error.
16570    pub fn current_function_call(&self) -> FunctionCall {
16571        let query = self.selection.select("currentFunctionCall");
16572        FunctionCall {
16573            proc: self.proc.clone(),
16574            selection: query,
16575            graphql_client: self.graphql_client.clone(),
16576        }
16577    }
16578    /// Load the module at the given address and serve its API in the current session.
16579    /// 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.
16580    ///
16581    /// # Arguments
16582    ///
16583    /// * `address` - A module address, or an explicit path into the caller's workspace.
16584    ///
16585    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16586    ///
16587    /// Installed module names are not accepted.
16588    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16589    pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
16590        let mut query = self.selection.select("serveModule");
16591        query = query.arg("address", address.into());
16592        query.execute(self.graphql_client.clone()).await
16593    }
16594    /// Load the module at the given address and serve its API in the current session.
16595    /// 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.
16596    ///
16597    /// # Arguments
16598    ///
16599    /// * `address` - A module address, or an explicit path into the caller's workspace.
16600    ///
16601    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16602    ///
16603    /// Installed module names are not accepted.
16604    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16605    pub async fn serve_module_opts<'a>(
16606        &self,
16607        address: impl Into<String>,
16608        opts: QueryServeModuleOpts<'a>,
16609    ) -> Result<Void, DaggerError> {
16610        let mut query = self.selection.select("serveModule");
16611        query = query.arg("address", address.into());
16612        if let Some(ref_pin) = opts.ref_pin {
16613            query = query.arg("refPin", ref_pin);
16614        }
16615        query.execute(self.graphql_client.clone()).await
16616    }
16617    /// 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).
16618    pub fn current_node(&self) -> NodeClient {
16619        let query = self.selection.select("currentNode");
16620        NodeClient {
16621            proc: self.proc.clone(),
16622            selection: query,
16623            graphql_client: self.graphql_client.clone(),
16624        }
16625    }
16626    /// Create a new error.
16627    ///
16628    /// # Arguments
16629    ///
16630    /// * `message` - A brief description of the error.
16631    pub fn error(&self, message: impl Into<String>) -> Error {
16632        let mut query = self.selection.select("error");
16633        query = query.arg("message", message.into());
16634        Error {
16635            proc: self.proc.clone(),
16636            selection: query,
16637            graphql_client: self.graphql_client.clone(),
16638        }
16639    }
16640    /// The Dagger engine container configuration and state
16641    pub fn engine(&self) -> Engine {
16642        let query = self.selection.select("engine");
16643        Engine {
16644            proc: self.proc.clone(),
16645            selection: query,
16646            graphql_client: self.graphql_client.clone(),
16647        }
16648    }
16649    /// Dagger Cloud configuration and state
16650    pub fn cloud(&self) -> Cloud {
16651        let query = self.selection.select("cloud");
16652        Cloud {
16653            proc: self.proc.clone(),
16654            selection: query,
16655            graphql_client: self.graphql_client.clone(),
16656        }
16657    }
16658    /// Initialize a new LLM conversation.
16659    ///
16660    /// # Arguments
16661    ///
16662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16663    pub fn llm(&self) -> Llm {
16664        let query = self.selection.select("llm");
16665        Llm {
16666            proc: self.proc.clone(),
16667            selection: query,
16668            graphql_client: self.graphql_client.clone(),
16669        }
16670    }
16671    /// Initialize a new LLM conversation.
16672    ///
16673    /// # Arguments
16674    ///
16675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16676    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
16677        let mut query = self.selection.select("llm");
16678        if let Some(model) = opts.model {
16679            query = query.arg("model", model);
16680        }
16681        if let Some(provider) = opts.provider {
16682            query = query.arg("provider", provider);
16683        }
16684        Llm {
16685            proc: self.proc.clone(),
16686            selection: query,
16687            graphql_client: self.graphql_client.clone(),
16688        }
16689    }
16690    /// Start an empty run of text and media content, independent of any conversation.
16691    /// 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.
16692    pub fn llm_content(&self) -> LlmContent {
16693        let query = self.selection.select("llmContent");
16694        LlmContent {
16695            proc: self.proc.clone(),
16696            selection: query,
16697            graphql_client: self.graphql_client.clone(),
16698        }
16699    }
16700    /// Initialize a JSON value
16701    pub fn json(&self) -> JsonValue {
16702        let query = self.selection.select("json");
16703        JsonValue {
16704            proc: self.proc.clone(),
16705            selection: query,
16706            graphql_client: self.graphql_client.clone(),
16707        }
16708    }
16709    /// Parse a name in any casing into words.
16710    /// Known acronyms and terms come from the naming dictionary; everything else falls back to the case heuristic. Errors on non-ASCII input, input with no letters or digits, or input over 256 bytes.
16711    ///
16712    /// # Arguments
16713    ///
16714    /// * `name` - The name to parse.
16715    pub fn identifier(&self, name: impl Into<String>) -> Identifier {
16716        let mut query = self.selection.select("identifier");
16717        query = query.arg("name", name.into());
16718        Identifier {
16719            proc: self.proc.clone(),
16720            selection: query,
16721            graphql_client: self.graphql_client.clone(),
16722        }
16723    }
16724    /// Format many names at once, for codegen. Returns them in input order.
16725    ///
16726    /// # Arguments
16727    ///
16728    /// * `names` - The names to format, in any casing.
16729    /// * `casing` - The casing to format the names in.
16730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16731    pub async fn format_identifiers(
16732        &self,
16733        names: Vec<impl Into<String>>,
16734        casing: Casing,
16735    ) -> Result<Vec<String>, DaggerError> {
16736        let mut query = self.selection.select("formatIdentifiers");
16737        query = query.arg(
16738            "names",
16739            names.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
16740        );
16741        query = query.arg("casing", casing);
16742        query.execute(self.graphql_client.clone()).await
16743    }
16744    /// Format many names at once, for codegen. Returns them in input order.
16745    ///
16746    /// # Arguments
16747    ///
16748    /// * `names` - The names to format, in any casing.
16749    /// * `casing` - The casing to format the names in.
16750    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16751    pub async fn format_identifiers_opts<'a>(
16752        &self,
16753        names: Vec<impl Into<String>>,
16754        casing: Casing,
16755        opts: QueryFormatIdentifiersOpts<'a>,
16756    ) -> Result<Vec<String>, DaggerError> {
16757        let mut query = self.selection.select("formatIdentifiers");
16758        query = query.arg(
16759            "names",
16760            names.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
16761        );
16762        query = query.arg("casing", casing);
16763        if let Some(acronyms) = opts.acronyms {
16764            query = query.arg("acronyms", acronyms);
16765        }
16766        if let Some(version) = opts.version {
16767            query = query.arg("version", version);
16768        }
16769        query.execute(self.graphql_client.clone()).await
16770    }
16771    /// The acronyms and terms used to parse and format identifiers.
16772    pub async fn naming_dictionary(&self) -> Result<Vec<NamingTerm>, DaggerError> {
16773        let query = self.selection.select("namingDictionary");
16774        let query = query.select("id");
16775        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16776        Ok(ids
16777            .into_iter()
16778            .map(|id| NamingTerm {
16779                proc: self.proc.clone(),
16780                selection: crate::querybuilder::query()
16781                    .select("node")
16782                    .arg("id", &id.0)
16783                    .inline_fragment("NamingTerm"),
16784                graphql_client: self.graphql_client.clone(),
16785            })
16786            .collect())
16787    }
16788    /// Load a GraphQL introspection schema for merging.
16789    ///
16790    /// # Arguments
16791    ///
16792    /// * `json` - The introspection schema JSON to load.
16793    pub fn schema(&self, json: Json) -> Schema {
16794        let mut query = self.selection.select("schema");
16795        query = query.arg("json", json);
16796        Schema {
16797            proc: self.proc.clone(),
16798            selection: query,
16799            graphql_client: self.graphql_client.clone(),
16800        }
16801    }
16802    /// Initialize an environment file
16803    ///
16804    /// # Arguments
16805    ///
16806    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16807    pub fn env_file(&self) -> EnvFile {
16808        let query = self.selection.select("envFile");
16809        EnvFile {
16810            proc: self.proc.clone(),
16811            selection: query,
16812            graphql_client: self.graphql_client.clone(),
16813        }
16814    }
16815    /// Initialize an environment file
16816    ///
16817    /// # Arguments
16818    ///
16819    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16820    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
16821        let mut query = self.selection.select("envFile");
16822        if let Some(expand) = opts.expand {
16823            query = query.arg("expand", expand);
16824        }
16825        EnvFile {
16826            proc: self.proc.clone(),
16827            selection: query,
16828            graphql_client: self.graphql_client.clone(),
16829        }
16830    }
16831    /// Resolve external references only.
16832    pub fn address(&self, value: impl Into<String>) -> Address {
16833        let mut query = self.selection.select("address");
16834        query = query.arg("value", value.into());
16835        Address {
16836            proc: self.proc.clone(),
16837            selection: query,
16838            graphql_client: self.graphql_client.clone(),
16839        }
16840    }
16841    /// Detect and return the current workspace.
16842    pub fn current_workspace(&self) -> Workspace {
16843        let query = self.selection.select("currentWorkspace");
16844        Workspace {
16845            proc: self.proc.clone(),
16846            selection: query,
16847            graphql_client: self.graphql_client.clone(),
16848        }
16849    }
16850}
16851impl Node for Query {
16852    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16853        let query = self.selection.select("id");
16854        let graphql_client = self.graphql_client.clone();
16855        async move { query.execute(graphql_client).await }
16856    }
16857}
16858#[derive(Clone)]
16859pub struct RemoteGitMirror {
16860    pub proc: Option<Arc<DaggerSessionProc>>,
16861    pub selection: Selection,
16862    pub graphql_client: DynGraphQLClient,
16863}
16864impl IntoID<Id> for RemoteGitMirror {
16865    fn into_id(
16866        self,
16867    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16868        Box::pin(async move { self.id().await })
16869    }
16870}
16871impl Loadable for RemoteGitMirror {
16872    fn graphql_type() -> &'static str {
16873        "RemoteGitMirror"
16874    }
16875    fn from_query(
16876        proc: Option<Arc<DaggerSessionProc>>,
16877        selection: Selection,
16878        graphql_client: DynGraphQLClient,
16879    ) -> Self {
16880        Self {
16881            proc,
16882            selection,
16883            graphql_client,
16884        }
16885    }
16886}
16887impl RemoteGitMirror {
16888    /// A unique identifier for this RemoteGitMirror.
16889    pub async fn id(&self) -> Result<Id, DaggerError> {
16890        let query = self.selection.select("id");
16891        query.execute(self.graphql_client.clone()).await
16892    }
16893}
16894impl Node for RemoteGitMirror {
16895    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16896        let query = self.selection.select("id");
16897        let graphql_client = self.graphql_client.clone();
16898        async move { query.execute(graphql_client).await }
16899    }
16900}
16901#[derive(Clone)]
16902pub struct SdkConfig {
16903    pub proc: Option<Arc<DaggerSessionProc>>,
16904    pub selection: Selection,
16905    pub graphql_client: DynGraphQLClient,
16906}
16907impl IntoID<Id> for SdkConfig {
16908    fn into_id(
16909        self,
16910    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16911        Box::pin(async move { self.id().await })
16912    }
16913}
16914impl Loadable for SdkConfig {
16915    fn graphql_type() -> &'static str {
16916        "SDKConfig"
16917    }
16918    fn from_query(
16919        proc: Option<Arc<DaggerSessionProc>>,
16920        selection: Selection,
16921        graphql_client: DynGraphQLClient,
16922    ) -> Self {
16923        Self {
16924            proc,
16925            selection,
16926            graphql_client,
16927        }
16928    }
16929}
16930impl SdkConfig {
16931    /// A unique identifier for this SDKConfig.
16932    pub async fn id(&self) -> Result<Id, DaggerError> {
16933        let query = self.selection.select("id");
16934        query.execute(self.graphql_client.clone()).await
16935    }
16936    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
16937    pub async fn source(&self) -> Result<String, DaggerError> {
16938        let query = self.selection.select("source");
16939        query.execute(self.graphql_client.clone()).await
16940    }
16941    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
16942    pub async fn debug(&self) -> Result<bool, DaggerError> {
16943        let query = self.selection.select("debug");
16944        query.execute(self.graphql_client.clone()).await
16945    }
16946}
16947impl Node for SdkConfig {
16948    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16949        let query = self.selection.select("id");
16950        let graphql_client = self.graphql_client.clone();
16951        async move { query.execute(graphql_client).await }
16952    }
16953}
16954#[derive(Clone)]
16955pub struct ScalarTypeDef {
16956    pub proc: Option<Arc<DaggerSessionProc>>,
16957    pub selection: Selection,
16958    pub graphql_client: DynGraphQLClient,
16959}
16960impl IntoID<Id> for ScalarTypeDef {
16961    fn into_id(
16962        self,
16963    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16964        Box::pin(async move { self.id().await })
16965    }
16966}
16967impl Loadable for ScalarTypeDef {
16968    fn graphql_type() -> &'static str {
16969        "ScalarTypeDef"
16970    }
16971    fn from_query(
16972        proc: Option<Arc<DaggerSessionProc>>,
16973        selection: Selection,
16974        graphql_client: DynGraphQLClient,
16975    ) -> Self {
16976        Self {
16977            proc,
16978            selection,
16979            graphql_client,
16980        }
16981    }
16982}
16983impl ScalarTypeDef {
16984    /// A unique identifier for this ScalarTypeDef.
16985    pub async fn id(&self) -> Result<Id, DaggerError> {
16986        let query = self.selection.select("id");
16987        query.execute(self.graphql_client.clone()).await
16988    }
16989    /// The name of the scalar.
16990    pub async fn name(&self) -> Result<String, DaggerError> {
16991        let query = self.selection.select("name");
16992        query.execute(self.graphql_client.clone()).await
16993    }
16994    /// A doc string for the scalar, if any.
16995    pub async fn description(&self) -> Result<String, DaggerError> {
16996        let query = self.selection.select("description");
16997        query.execute(self.graphql_client.clone()).await
16998    }
16999    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
17000    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
17001        let query = self.selection.select("sourceModuleName");
17002        query.execute(self.graphql_client.clone()).await
17003    }
17004}
17005impl Node for ScalarTypeDef {
17006    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17007        let query = self.selection.select("id");
17008        let graphql_client = self.graphql_client.clone();
17009        async move { query.execute(graphql_client).await }
17010    }
17011}
17012#[derive(Clone)]
17013pub struct Schema {
17014    pub proc: Option<Arc<DaggerSessionProc>>,
17015    pub selection: Selection,
17016    pub graphql_client: DynGraphQLClient,
17017}
17018impl IntoID<Id> for Schema {
17019    fn into_id(
17020        self,
17021    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17022        Box::pin(async move { self.id().await })
17023    }
17024}
17025impl Loadable for Schema {
17026    fn graphql_type() -> &'static str {
17027        "Schema"
17028    }
17029    fn from_query(
17030        proc: Option<Arc<DaggerSessionProc>>,
17031        selection: Selection,
17032        graphql_client: DynGraphQLClient,
17033    ) -> Self {
17034        Self {
17035            proc,
17036            selection,
17037            graphql_client,
17038        }
17039    }
17040}
17041impl Schema {
17042    /// A unique identifier for this Schema.
17043    pub async fn id(&self) -> Result<Id, DaggerError> {
17044        let query = self.selection.select("id");
17045        query.execute(self.graphql_client.clone()).await
17046    }
17047    /// Serialize the schema back to introspection JSON.
17048    pub async fn contents(&self) -> Result<Json, DaggerError> {
17049        let query = self.selection.select("contents");
17050        query.execute(self.graphql_client.clone()).await
17051    }
17052    /// Merge a module's introspection-shaped type definitions into the schema, returning the combined schema.
17053    ///
17054    /// # Arguments
17055    ///
17056    /// * `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.
17057    /// * `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.
17058    pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
17059        let mut query = self.selection.select("merge");
17060        query = query.arg("moduleTypes", module_types);
17061        query = query.arg("moduleName", module_name.into());
17062        Schema {
17063            proc: self.proc.clone(),
17064            selection: query,
17065            graphql_client: self.graphql_client.clone(),
17066        }
17067    }
17068}
17069impl Node for Schema {
17070    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17071        let query = self.selection.select("id");
17072        let graphql_client = self.graphql_client.clone();
17073        async move { query.execute(graphql_client).await }
17074    }
17075}
17076#[derive(Clone)]
17077pub struct SearchResult {
17078    pub proc: Option<Arc<DaggerSessionProc>>,
17079    pub selection: Selection,
17080    pub graphql_client: DynGraphQLClient,
17081}
17082impl IntoID<Id> for SearchResult {
17083    fn into_id(
17084        self,
17085    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17086        Box::pin(async move { self.id().await })
17087    }
17088}
17089impl Loadable for SearchResult {
17090    fn graphql_type() -> &'static str {
17091        "SearchResult"
17092    }
17093    fn from_query(
17094        proc: Option<Arc<DaggerSessionProc>>,
17095        selection: Selection,
17096        graphql_client: DynGraphQLClient,
17097    ) -> Self {
17098        Self {
17099            proc,
17100            selection,
17101            graphql_client,
17102        }
17103    }
17104}
17105impl SearchResult {
17106    /// A unique identifier for this SearchResult.
17107    pub async fn id(&self) -> Result<Id, DaggerError> {
17108        let query = self.selection.select("id");
17109        query.execute(self.graphql_client.clone()).await
17110    }
17111    /// The path to the file that matched.
17112    pub async fn file_path(&self) -> Result<String, DaggerError> {
17113        let query = self.selection.select("filePath");
17114        query.execute(self.graphql_client.clone()).await
17115    }
17116    /// The first line that matched.
17117    pub async fn line_number(&self) -> Result<isize, DaggerError> {
17118        let query = self.selection.select("lineNumber");
17119        query.execute(self.graphql_client.clone()).await
17120    }
17121    /// The byte offset of this line within the file.
17122    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
17123        let query = self.selection.select("absoluteOffset");
17124        query.execute(self.graphql_client.clone()).await
17125    }
17126    /// The line content that matched.
17127    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
17128        let query = self.selection.select("matchedLines");
17129        query.execute(self.graphql_client.clone()).await
17130    }
17131    /// Sub-match positions and content within the matched lines.
17132    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
17133        let query = self.selection.select("submatches");
17134        let query = query.select("id");
17135        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17136        Ok(ids
17137            .into_iter()
17138            .map(|id| SearchSubmatch {
17139                proc: self.proc.clone(),
17140                selection: crate::querybuilder::query()
17141                    .select("node")
17142                    .arg("id", &id.0)
17143                    .inline_fragment("SearchSubmatch"),
17144                graphql_client: self.graphql_client.clone(),
17145            })
17146            .collect())
17147    }
17148}
17149impl Node for SearchResult {
17150    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17151        let query = self.selection.select("id");
17152        let graphql_client = self.graphql_client.clone();
17153        async move { query.execute(graphql_client).await }
17154    }
17155}
17156#[derive(Clone)]
17157pub struct SearchSubmatch {
17158    pub proc: Option<Arc<DaggerSessionProc>>,
17159    pub selection: Selection,
17160    pub graphql_client: DynGraphQLClient,
17161}
17162impl IntoID<Id> for SearchSubmatch {
17163    fn into_id(
17164        self,
17165    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17166        Box::pin(async move { self.id().await })
17167    }
17168}
17169impl Loadable for SearchSubmatch {
17170    fn graphql_type() -> &'static str {
17171        "SearchSubmatch"
17172    }
17173    fn from_query(
17174        proc: Option<Arc<DaggerSessionProc>>,
17175        selection: Selection,
17176        graphql_client: DynGraphQLClient,
17177    ) -> Self {
17178        Self {
17179            proc,
17180            selection,
17181            graphql_client,
17182        }
17183    }
17184}
17185impl SearchSubmatch {
17186    /// A unique identifier for this SearchSubmatch.
17187    pub async fn id(&self) -> Result<Id, DaggerError> {
17188        let query = self.selection.select("id");
17189        query.execute(self.graphql_client.clone()).await
17190    }
17191    /// The matched text.
17192    pub async fn text(&self) -> Result<String, DaggerError> {
17193        let query = self.selection.select("text");
17194        query.execute(self.graphql_client.clone()).await
17195    }
17196    /// The match's start offset within the matched lines.
17197    pub async fn start(&self) -> Result<isize, DaggerError> {
17198        let query = self.selection.select("start");
17199        query.execute(self.graphql_client.clone()).await
17200    }
17201    /// The match's end offset within the matched lines.
17202    pub async fn end(&self) -> Result<isize, DaggerError> {
17203        let query = self.selection.select("end");
17204        query.execute(self.graphql_client.clone()).await
17205    }
17206}
17207impl Node for SearchSubmatch {
17208    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17209        let query = self.selection.select("id");
17210        let graphql_client = self.graphql_client.clone();
17211        async move { query.execute(graphql_client).await }
17212    }
17213}
17214#[derive(Clone)]
17215pub struct Secret {
17216    pub proc: Option<Arc<DaggerSessionProc>>,
17217    pub selection: Selection,
17218    pub graphql_client: DynGraphQLClient,
17219}
17220impl IntoID<Id> for Secret {
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 Secret {
17228    fn graphql_type() -> &'static str {
17229        "Secret"
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 Secret {
17244    /// A unique identifier for this Secret.
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    /// The name of this secret.
17250    pub async fn name(&self) -> Result<String, DaggerError> {
17251        let query = self.selection.select("name");
17252        query.execute(self.graphql_client.clone()).await
17253    }
17254    /// The URI of this secret.
17255    pub async fn uri(&self) -> Result<String, DaggerError> {
17256        let query = self.selection.select("uri");
17257        query.execute(self.graphql_client.clone()).await
17258    }
17259    /// The value of this secret.
17260    pub async fn plaintext(&self) -> Result<String, DaggerError> {
17261        let query = self.selection.select("plaintext");
17262        query.execute(self.graphql_client.clone()).await
17263    }
17264}
17265impl Node for Secret {
17266    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17267        let query = self.selection.select("id");
17268        let graphql_client = self.graphql_client.clone();
17269        async move { query.execute(graphql_client).await }
17270    }
17271}
17272#[derive(Clone)]
17273pub struct Service {
17274    pub proc: Option<Arc<DaggerSessionProc>>,
17275    pub selection: Selection,
17276    pub graphql_client: DynGraphQLClient,
17277}
17278#[derive(Builder, Debug, PartialEq)]
17279pub struct ServicePortsOpts {
17280    /// Return only container ports declared before startup. Other service types return an empty list.
17281    #[builder(setter(into, strip_option), default)]
17282    pub declared: Option<bool>,
17283}
17284#[derive(Builder, Debug, PartialEq)]
17285pub struct ServiceEndpointOpts<'a> {
17286    /// The exposed port number for the endpoint
17287    #[builder(setter(into, strip_option), default)]
17288    pub port: Option<isize>,
17289    /// Return a URL with the given scheme, eg. http for http://
17290    #[builder(setter(into, strip_option), default)]
17291    pub scheme: Option<&'a str>,
17292}
17293#[derive(Builder, Debug, PartialEq)]
17294pub struct ServiceUpOpts {
17295    /// List of frontend/backend port mappings to forward.
17296    /// Frontend is the port accepting traffic on the host, backend is the service port.
17297    #[builder(setter(into, strip_option), default)]
17298    pub ports: Option<Vec<PortForward>>,
17299    /// Bind each tunnel port to a random port on the host.
17300    #[builder(setter(into, strip_option), default)]
17301    pub random: Option<bool>,
17302}
17303#[derive(Builder, Debug, PartialEq)]
17304pub struct ServiceStopOpts {
17305    /// Immediately kill the service without waiting for a graceful exit
17306    #[builder(setter(into, strip_option), default)]
17307    pub kill: Option<bool>,
17308}
17309#[derive(Builder, Debug, PartialEq)]
17310pub struct ServiceTerminalOpts<'a> {
17311    #[builder(setter(into, strip_option), default)]
17312    pub cmd: Option<Vec<&'a str>>,
17313}
17314impl IntoID<Id> for Service {
17315    fn into_id(
17316        self,
17317    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17318        Box::pin(async move { self.id().await })
17319    }
17320}
17321impl Loadable for Service {
17322    fn graphql_type() -> &'static str {
17323        "Service"
17324    }
17325    fn from_query(
17326        proc: Option<Arc<DaggerSessionProc>>,
17327        selection: Selection,
17328        graphql_client: DynGraphQLClient,
17329    ) -> Self {
17330        Self {
17331            proc,
17332            selection,
17333            graphql_client,
17334        }
17335    }
17336}
17337impl Service {
17338    /// A unique identifier for this Service.
17339    pub async fn id(&self) -> Result<Id, DaggerError> {
17340        let query = self.selection.select("id");
17341        query.execute(self.graphql_client.clone()).await
17342    }
17343    /// Forces evaluation of the pipeline in the engine.
17344    pub async fn sync(&self) -> Result<Service, DaggerError> {
17345        let query = self.selection.select("sync");
17346        let id: Id = query.execute(self.graphql_client.clone()).await?;
17347        Ok(Service {
17348            proc: self.proc.clone(),
17349            selection: query
17350                .root()
17351                .select("node")
17352                .arg("id", &id.0)
17353                .inline_fragment("Service"),
17354            graphql_client: self.graphql_client.clone(),
17355        })
17356    }
17357    /// Retrieves a hostname which can be used by clients to reach this container.
17358    pub async fn hostname(&self) -> Result<String, DaggerError> {
17359        let query = self.selection.select("hostname");
17360        query.execute(self.graphql_client.clone()).await
17361    }
17362    /// Configures a hostname which can be used by clients within the session to reach this container.
17363    ///
17364    /// # Arguments
17365    ///
17366    /// * `hostname` - The hostname to use.
17367    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
17368        let mut query = self.selection.select("withHostname");
17369        query = query.arg("hostname", hostname.into());
17370        Service {
17371            proc: self.proc.clone(),
17372            selection: query,
17373            graphql_client: self.graphql_client.clone(),
17374        }
17375    }
17376    /// Retrieves the list of ports provided by the service.
17377    ///
17378    /// # Arguments
17379    ///
17380    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17381    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
17382        let query = self.selection.select("ports");
17383        let query = query.select("id");
17384        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17385        Ok(ids
17386            .into_iter()
17387            .map(|id| Port {
17388                proc: self.proc.clone(),
17389                selection: crate::querybuilder::query()
17390                    .select("node")
17391                    .arg("id", &id.0)
17392                    .inline_fragment("Port"),
17393                graphql_client: self.graphql_client.clone(),
17394            })
17395            .collect())
17396    }
17397    /// Retrieves the list of ports provided by the service.
17398    ///
17399    /// # Arguments
17400    ///
17401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17402    pub async fn ports_opts(&self, opts: ServicePortsOpts) -> Result<Vec<Port>, DaggerError> {
17403        let mut query = self.selection.select("ports");
17404        if let Some(declared) = opts.declared {
17405            query = query.arg("declared", declared);
17406        }
17407        let query = query.select("id");
17408        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17409        Ok(ids
17410            .into_iter()
17411            .map(|id| Port {
17412                proc: self.proc.clone(),
17413                selection: crate::querybuilder::query()
17414                    .select("node")
17415                    .arg("id", &id.0)
17416                    .inline_fragment("Port"),
17417                graphql_client: self.graphql_client.clone(),
17418            })
17419            .collect())
17420    }
17421    /// Retrieves an endpoint that clients can use to reach this container.
17422    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17423    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17424    ///
17425    /// # Arguments
17426    ///
17427    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17428    pub async fn endpoint(&self) -> Result<String, DaggerError> {
17429        let query = self.selection.select("endpoint");
17430        query.execute(self.graphql_client.clone()).await
17431    }
17432    /// Retrieves an endpoint that clients can use to reach this container.
17433    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17434    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17435    ///
17436    /// # Arguments
17437    ///
17438    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17439    pub async fn endpoint_opts<'a>(
17440        &self,
17441        opts: ServiceEndpointOpts<'a>,
17442    ) -> Result<String, DaggerError> {
17443        let mut query = self.selection.select("endpoint");
17444        if let Some(port) = opts.port {
17445            query = query.arg("port", port);
17446        }
17447        if let Some(scheme) = opts.scheme {
17448            query = query.arg("scheme", scheme);
17449        }
17450        query.execute(self.graphql_client.clone()).await
17451    }
17452    /// Start the service and wait for its health checks to succeed.
17453    /// Services bound to a Container do not need to be manually started.
17454    pub async fn start(&self) -> Result<Service, DaggerError> {
17455        let query = self.selection.select("start");
17456        let id: Id = query.execute(self.graphql_client.clone()).await?;
17457        Ok(Service {
17458            proc: self.proc.clone(),
17459            selection: query
17460                .root()
17461                .select("node")
17462                .arg("id", &id.0)
17463                .inline_fragment("Service"),
17464            graphql_client: self.graphql_client.clone(),
17465        })
17466    }
17467    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17468    ///
17469    /// # Arguments
17470    ///
17471    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17472    pub async fn up(&self) -> Result<Void, DaggerError> {
17473        let query = self.selection.select("up");
17474        query.execute(self.graphql_client.clone()).await
17475    }
17476    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17477    ///
17478    /// # Arguments
17479    ///
17480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17481    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
17482        let mut query = self.selection.select("up");
17483        if let Some(ports) = opts.ports {
17484            query = query.arg("ports", ports);
17485        }
17486        if let Some(random) = opts.random {
17487            query = query.arg("random", random);
17488        }
17489        query.execute(self.graphql_client.clone()).await
17490    }
17491    /// Stop the service.
17492    ///
17493    /// # Arguments
17494    ///
17495    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17496    pub async fn stop(&self) -> Result<Service, DaggerError> {
17497        let query = self.selection.select("stop");
17498        let id: Id = query.execute(self.graphql_client.clone()).await?;
17499        Ok(Service {
17500            proc: self.proc.clone(),
17501            selection: query
17502                .root()
17503                .select("node")
17504                .arg("id", &id.0)
17505                .inline_fragment("Service"),
17506            graphql_client: self.graphql_client.clone(),
17507        })
17508    }
17509    /// Stop the service.
17510    ///
17511    /// # Arguments
17512    ///
17513    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17514    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
17515        let mut query = self.selection.select("stop");
17516        if let Some(kill) = opts.kill {
17517            query = query.arg("kill", kill);
17518        }
17519        let id: Id = query.execute(self.graphql_client.clone()).await?;
17520        Ok(Service {
17521            proc: self.proc.clone(),
17522            selection: query
17523                .root()
17524                .select("node")
17525                .arg("id", &id.0)
17526                .inline_fragment("Service"),
17527            graphql_client: self.graphql_client.clone(),
17528        })
17529    }
17530    ///
17531    /// # Arguments
17532    ///
17533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17534    pub fn terminal(&self) -> Service {
17535        let query = self.selection.select("terminal");
17536        Service {
17537            proc: self.proc.clone(),
17538            selection: query,
17539            graphql_client: self.graphql_client.clone(),
17540        }
17541    }
17542    ///
17543    /// # Arguments
17544    ///
17545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17546    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
17547        let mut query = self.selection.select("terminal");
17548        if let Some(cmd) = opts.cmd {
17549            query = query.arg("cmd", cmd);
17550        }
17551        Service {
17552            proc: self.proc.clone(),
17553            selection: query,
17554            graphql_client: self.graphql_client.clone(),
17555        }
17556    }
17557}
17558impl Node for Service {
17559    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17560        let query = self.selection.select("id");
17561        let graphql_client = self.graphql_client.clone();
17562        async move { query.execute(graphql_client).await }
17563    }
17564}
17565impl Syncer for Service {
17566    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17567        let query = self.selection.select("id");
17568        let graphql_client = self.graphql_client.clone();
17569        async move { query.execute(graphql_client).await }
17570    }
17571    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17572        let query = self.selection.select("sync");
17573        let proc = self.proc.clone();
17574        let graphql_client = self.graphql_client.clone();
17575        async move {
17576            let id: Id = query.execute(graphql_client.clone()).await?;
17577            Ok(Self {
17578                proc,
17579                selection: query
17580                    .root()
17581                    .select("node")
17582                    .arg("id", &id.0)
17583                    .inline_fragment("Service"),
17584                graphql_client,
17585            })
17586        }
17587    }
17588}
17589#[derive(Clone)]
17590pub struct Socket {
17591    pub proc: Option<Arc<DaggerSessionProc>>,
17592    pub selection: Selection,
17593    pub graphql_client: DynGraphQLClient,
17594}
17595impl IntoID<Id> for Socket {
17596    fn into_id(
17597        self,
17598    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17599        Box::pin(async move { self.id().await })
17600    }
17601}
17602impl Loadable for Socket {
17603    fn graphql_type() -> &'static str {
17604        "Socket"
17605    }
17606    fn from_query(
17607        proc: Option<Arc<DaggerSessionProc>>,
17608        selection: Selection,
17609        graphql_client: DynGraphQLClient,
17610    ) -> Self {
17611        Self {
17612            proc,
17613            selection,
17614            graphql_client,
17615        }
17616    }
17617}
17618impl Socket {
17619    /// A unique identifier for this Socket.
17620    pub async fn id(&self) -> Result<Id, DaggerError> {
17621        let query = self.selection.select("id");
17622        query.execute(self.graphql_client.clone()).await
17623    }
17624}
17625impl Node for Socket {
17626    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17627        let query = self.selection.select("id");
17628        let graphql_client = self.graphql_client.clone();
17629        async move { query.execute(graphql_client).await }
17630    }
17631}
17632#[derive(Clone)]
17633pub struct SourceMap {
17634    pub proc: Option<Arc<DaggerSessionProc>>,
17635    pub selection: Selection,
17636    pub graphql_client: DynGraphQLClient,
17637}
17638impl IntoID<Id> for SourceMap {
17639    fn into_id(
17640        self,
17641    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17642        Box::pin(async move { self.id().await })
17643    }
17644}
17645impl Loadable for SourceMap {
17646    fn graphql_type() -> &'static str {
17647        "SourceMap"
17648    }
17649    fn from_query(
17650        proc: Option<Arc<DaggerSessionProc>>,
17651        selection: Selection,
17652        graphql_client: DynGraphQLClient,
17653    ) -> Self {
17654        Self {
17655            proc,
17656            selection,
17657            graphql_client,
17658        }
17659    }
17660}
17661impl SourceMap {
17662    /// A unique identifier for this SourceMap.
17663    pub async fn id(&self) -> Result<Id, DaggerError> {
17664        let query = self.selection.select("id");
17665        query.execute(self.graphql_client.clone()).await
17666    }
17667    /// The module dependency this was declared in.
17668    pub async fn module(&self) -> Result<String, DaggerError> {
17669        let query = self.selection.select("module");
17670        query.execute(self.graphql_client.clone()).await
17671    }
17672    /// The filename from the module source.
17673    pub async fn filename(&self) -> Result<String, DaggerError> {
17674        let query = self.selection.select("filename");
17675        query.execute(self.graphql_client.clone()).await
17676    }
17677    /// The line number within the filename.
17678    pub async fn line(&self) -> Result<isize, DaggerError> {
17679        let query = self.selection.select("line");
17680        query.execute(self.graphql_client.clone()).await
17681    }
17682    /// The column number within the line.
17683    pub async fn column(&self) -> Result<isize, DaggerError> {
17684        let query = self.selection.select("column");
17685        query.execute(self.graphql_client.clone()).await
17686    }
17687    /// The URL to the file, if any. This can be used to link to the source map in the browser.
17688    pub async fn url(&self) -> Result<String, DaggerError> {
17689        let query = self.selection.select("url");
17690        query.execute(self.graphql_client.clone()).await
17691    }
17692}
17693impl Node for SourceMap {
17694    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17695        let query = self.selection.select("id");
17696        let graphql_client = self.graphql_client.clone();
17697        async move { query.execute(graphql_client).await }
17698    }
17699}
17700#[derive(Clone)]
17701pub struct Stat {
17702    pub proc: Option<Arc<DaggerSessionProc>>,
17703    pub selection: Selection,
17704    pub graphql_client: DynGraphQLClient,
17705}
17706impl IntoID<Id> for Stat {
17707    fn into_id(
17708        self,
17709    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17710        Box::pin(async move { self.id().await })
17711    }
17712}
17713impl Loadable for Stat {
17714    fn graphql_type() -> &'static str {
17715        "Stat"
17716    }
17717    fn from_query(
17718        proc: Option<Arc<DaggerSessionProc>>,
17719        selection: Selection,
17720        graphql_client: DynGraphQLClient,
17721    ) -> Self {
17722        Self {
17723            proc,
17724            selection,
17725            graphql_client,
17726        }
17727    }
17728}
17729impl Stat {
17730    /// A unique identifier for this Stat.
17731    pub async fn id(&self) -> Result<Id, DaggerError> {
17732        let query = self.selection.select("id");
17733        query.execute(self.graphql_client.clone()).await
17734    }
17735    /// file size
17736    pub async fn size(&self) -> Result<isize, DaggerError> {
17737        let query = self.selection.select("size");
17738        query.execute(self.graphql_client.clone()).await
17739    }
17740    /// file name
17741    pub async fn name(&self) -> Result<String, DaggerError> {
17742        let query = self.selection.select("name");
17743        query.execute(self.graphql_client.clone()).await
17744    }
17745    /// file type
17746    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
17747        let query = self.selection.select("fileType");
17748        query.execute(self.graphql_client.clone()).await
17749    }
17750    /// permission bits
17751    pub async fn permissions(&self) -> Result<isize, DaggerError> {
17752        let query = self.selection.select("permissions");
17753        query.execute(self.graphql_client.clone()).await
17754    }
17755}
17756impl Node for Stat {
17757    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17758        let query = self.selection.select("id");
17759        let graphql_client = self.graphql_client.clone();
17760        async move { query.execute(graphql_client).await }
17761    }
17762}
17763#[derive(Clone)]
17764pub struct Terminal {
17765    pub proc: Option<Arc<DaggerSessionProc>>,
17766    pub selection: Selection,
17767    pub graphql_client: DynGraphQLClient,
17768}
17769impl IntoID<Id> for Terminal {
17770    fn into_id(
17771        self,
17772    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17773        Box::pin(async move { self.id().await })
17774    }
17775}
17776impl Loadable for Terminal {
17777    fn graphql_type() -> &'static str {
17778        "Terminal"
17779    }
17780    fn from_query(
17781        proc: Option<Arc<DaggerSessionProc>>,
17782        selection: Selection,
17783        graphql_client: DynGraphQLClient,
17784    ) -> Self {
17785        Self {
17786            proc,
17787            selection,
17788            graphql_client,
17789        }
17790    }
17791}
17792impl Terminal {
17793    /// A unique identifier for this Terminal.
17794    pub async fn id(&self) -> Result<Id, DaggerError> {
17795        let query = self.selection.select("id");
17796        query.execute(self.graphql_client.clone()).await
17797    }
17798    /// Forces evaluation of the pipeline in the engine.
17799    /// It doesn't run the default command if no exec has been set.
17800    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
17801        let query = self.selection.select("sync");
17802        let id: Id = query.execute(self.graphql_client.clone()).await?;
17803        Ok(Terminal {
17804            proc: self.proc.clone(),
17805            selection: query
17806                .root()
17807                .select("node")
17808                .arg("id", &id.0)
17809                .inline_fragment("Terminal"),
17810            graphql_client: self.graphql_client.clone(),
17811        })
17812    }
17813}
17814impl Node for Terminal {
17815    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17816        let query = self.selection.select("id");
17817        let graphql_client = self.graphql_client.clone();
17818        async move { query.execute(graphql_client).await }
17819    }
17820}
17821impl Syncer for Terminal {
17822    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17823        let query = self.selection.select("id");
17824        let graphql_client = self.graphql_client.clone();
17825        async move { query.execute(graphql_client).await }
17826    }
17827    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17828        let query = self.selection.select("sync");
17829        let proc = self.proc.clone();
17830        let graphql_client = self.graphql_client.clone();
17831        async move {
17832            let id: Id = query.execute(graphql_client.clone()).await?;
17833            Ok(Self {
17834                proc,
17835                selection: query
17836                    .root()
17837                    .select("node")
17838                    .arg("id", &id.0)
17839                    .inline_fragment("Terminal"),
17840                graphql_client,
17841            })
17842        }
17843    }
17844}
17845#[derive(Clone)]
17846pub struct TypeDef {
17847    pub proc: Option<Arc<DaggerSessionProc>>,
17848    pub selection: Selection,
17849    pub graphql_client: DynGraphQLClient,
17850}
17851#[derive(Builder, Debug, PartialEq)]
17852pub struct TypeDefWithScalarOpts<'a> {
17853    #[builder(setter(into, strip_option), default)]
17854    pub description: Option<&'a str>,
17855}
17856#[derive(Builder, Debug, PartialEq)]
17857pub struct TypeDefWithObjectOpts<'a> {
17858    #[builder(setter(into, strip_option), default)]
17859    pub deprecated: Option<&'a str>,
17860    #[builder(setter(into, strip_option), default)]
17861    pub description: Option<&'a str>,
17862    #[builder(setter(into, strip_option), default)]
17863    pub source_map: Option<Id>,
17864}
17865#[derive(Builder, Debug, PartialEq)]
17866pub struct TypeDefWithInterfaceOpts<'a> {
17867    #[builder(setter(into, strip_option), default)]
17868    pub description: Option<&'a str>,
17869    #[builder(setter(into, strip_option), default)]
17870    pub source_map: Option<Id>,
17871}
17872#[derive(Builder, Debug, PartialEq)]
17873pub struct TypeDefWithFieldOpts<'a> {
17874    /// If deprecated, the reason or migration path.
17875    #[builder(setter(into, strip_option), default)]
17876    pub deprecated: Option<&'a str>,
17877    /// A doc string for the field, if any
17878    #[builder(setter(into, strip_option), default)]
17879    pub description: Option<&'a str>,
17880    /// The source map for the field definition.
17881    #[builder(setter(into, strip_option), default)]
17882    pub source_map: Option<Id>,
17883}
17884#[derive(Builder, Debug, PartialEq)]
17885pub struct TypeDefWithEnumOpts<'a> {
17886    /// A doc string for the enum, if any
17887    #[builder(setter(into, strip_option), default)]
17888    pub description: Option<&'a str>,
17889    /// The source map for the enum definition.
17890    #[builder(setter(into, strip_option), default)]
17891    pub source_map: Option<Id>,
17892}
17893#[derive(Builder, Debug, PartialEq)]
17894pub struct TypeDefWithEnumValueOpts<'a> {
17895    /// If deprecated, the reason or migration path.
17896    #[builder(setter(into, strip_option), default)]
17897    pub deprecated: Option<&'a str>,
17898    /// A doc string for the value, if any
17899    #[builder(setter(into, strip_option), default)]
17900    pub description: Option<&'a str>,
17901    /// The source map for the enum value definition.
17902    #[builder(setter(into, strip_option), default)]
17903    pub source_map: Option<Id>,
17904}
17905#[derive(Builder, Debug, PartialEq)]
17906pub struct TypeDefWithEnumMemberOpts<'a> {
17907    /// If deprecated, the reason or migration path.
17908    #[builder(setter(into, strip_option), default)]
17909    pub deprecated: Option<&'a str>,
17910    /// A doc string for the member, if any
17911    #[builder(setter(into, strip_option), default)]
17912    pub description: Option<&'a str>,
17913    /// The source map for the enum member definition.
17914    #[builder(setter(into, strip_option), default)]
17915    pub source_map: Option<Id>,
17916    /// The value of the member in the enum
17917    #[builder(setter(into, strip_option), default)]
17918    pub value: Option<&'a str>,
17919}
17920impl IntoID<Id> for TypeDef {
17921    fn into_id(
17922        self,
17923    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17924        Box::pin(async move { self.id().await })
17925    }
17926}
17927impl Loadable for TypeDef {
17928    fn graphql_type() -> &'static str {
17929        "TypeDef"
17930    }
17931    fn from_query(
17932        proc: Option<Arc<DaggerSessionProc>>,
17933        selection: Selection,
17934        graphql_client: DynGraphQLClient,
17935    ) -> Self {
17936        Self {
17937            proc,
17938            selection,
17939            graphql_client,
17940        }
17941    }
17942}
17943impl TypeDef {
17944    /// A unique identifier for this TypeDef.
17945    pub async fn id(&self) -> Result<Id, DaggerError> {
17946        let query = self.selection.select("id");
17947        query.execute(self.graphql_client.clone()).await
17948    }
17949    /// Mark this object as a collection.
17950    pub fn with_collection(&self) -> TypeDef {
17951        let query = self.selection.select("withCollection");
17952        TypeDef {
17953            proc: self.proc.clone(),
17954            selection: query,
17955            graphql_client: self.graphql_client.clone(),
17956        }
17957    }
17958    /// Select the stored keys field for this collection.
17959    pub fn with_collection_keys(&self, name: impl Into<String>) -> TypeDef {
17960        let mut query = self.selection.select("withCollectionKeys");
17961        query = query.arg("name", name.into());
17962        TypeDef {
17963            proc: self.proc.clone(),
17964            selection: query,
17965            graphql_client: self.graphql_client.clone(),
17966        }
17967    }
17968    /// Select the item lookup function for this collection.
17969    pub fn with_collection_get(&self, name: impl Into<String>) -> TypeDef {
17970        let mut query = self.selection.select("withCollectionGet");
17971        query = query.arg("name", name.into());
17972        TypeDef {
17973            proc: self.proc.clone(),
17974            selection: query,
17975            graphql_client: self.graphql_client.clone(),
17976        }
17977    }
17978    /// Select the field that receives changes from the original collection.
17979    pub fn with_collection_delta(&self, name: impl Into<String>) -> TypeDef {
17980        let mut query = self.selection.select("withCollectionDelta");
17981        query = query.arg("name", name.into());
17982        TypeDef {
17983            proc: self.proc.clone(),
17984            selection: query,
17985            graphql_client: self.graphql_client.clone(),
17986        }
17987    }
17988    /// Collection metadata, or null if this object is not a collection.
17989    pub async fn as_collection(&self) -> Result<Option<CollectionTypeDef>, DaggerError> {
17990        let query = self.selection.select("asCollection");
17991        let query = query.select("id");
17992        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
17993        Ok(id.map(|id| CollectionTypeDef {
17994            proc: self.proc.clone(),
17995            selection: query
17996                .root()
17997                .select("node")
17998                .arg("id", &id.0)
17999                .inline_fragment("CollectionTypeDef"),
18000            graphql_client: self.graphql_client.clone(),
18001        }))
18002    }
18003    /// The canonical non-optional name of the type.
18004    pub async fn name(&self) -> Result<String, DaggerError> {
18005        let query = self.selection.select("name");
18006        query.execute(self.graphql_client.clone()).await
18007    }
18008    /// The kind of type this is (e.g. primitive, list, object).
18009    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
18010        let query = self.selection.select("kind");
18011        query.execute(self.graphql_client.clone()).await
18012    }
18013    /// Whether this type can be set to null. Defaults to false.
18014    pub async fn optional(&self) -> Result<bool, DaggerError> {
18015        let query = self.selection.select("optional");
18016        query.execute(self.graphql_client.clone()).await
18017    }
18018    /// Sets whether this type can be set to null.
18019    pub fn with_optional(&self, optional: bool) -> TypeDef {
18020        let mut query = self.selection.select("withOptional");
18021        query = query.arg("optional", optional);
18022        TypeDef {
18023            proc: self.proc.clone(),
18024            selection: query,
18025            graphql_client: self.graphql_client.clone(),
18026        }
18027    }
18028    /// Sets the kind of the type.
18029    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
18030        let mut query = self.selection.select("withKind");
18031        query = query.arg("kind", kind);
18032        TypeDef {
18033            proc: self.proc.clone(),
18034            selection: query,
18035            graphql_client: self.graphql_client.clone(),
18036        }
18037    }
18038    /// Returns a TypeDef of kind Scalar with the provided name.
18039    ///
18040    /// # Arguments
18041    ///
18042    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18043    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
18044        let mut query = self.selection.select("withScalar");
18045        query = query.arg("name", name.into());
18046        TypeDef {
18047            proc: self.proc.clone(),
18048            selection: query,
18049            graphql_client: self.graphql_client.clone(),
18050        }
18051    }
18052    /// Returns a TypeDef of kind Scalar with the provided name.
18053    ///
18054    /// # Arguments
18055    ///
18056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18057    pub fn with_scalar_opts<'a>(
18058        &self,
18059        name: impl Into<String>,
18060        opts: TypeDefWithScalarOpts<'a>,
18061    ) -> TypeDef {
18062        let mut query = self.selection.select("withScalar");
18063        query = query.arg("name", name.into());
18064        if let Some(description) = opts.description {
18065            query = query.arg("description", description);
18066        }
18067        TypeDef {
18068            proc: self.proc.clone(),
18069            selection: query,
18070            graphql_client: self.graphql_client.clone(),
18071        }
18072    }
18073    /// Returns a TypeDef of kind List with the provided type for its elements.
18074    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
18075        let mut query = self.selection.select("withListOf");
18076        query = query.arg_lazy(
18077            "elementType",
18078            Box::new(move || {
18079                let element_type = element_type.clone();
18080                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
18081            }),
18082        );
18083        TypeDef {
18084            proc: self.proc.clone(),
18085            selection: query,
18086            graphql_client: self.graphql_client.clone(),
18087        }
18088    }
18089    /// Returns a TypeDef of kind Object with the provided name.
18090    /// 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.
18091    ///
18092    /// # Arguments
18093    ///
18094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18095    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
18096        let mut query = self.selection.select("withObject");
18097        query = query.arg("name", name.into());
18098        TypeDef {
18099            proc: self.proc.clone(),
18100            selection: query,
18101            graphql_client: self.graphql_client.clone(),
18102        }
18103    }
18104    /// Returns a TypeDef of kind Object with the provided name.
18105    /// 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.
18106    ///
18107    /// # Arguments
18108    ///
18109    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18110    pub fn with_object_opts<'a>(
18111        &self,
18112        name: impl Into<String>,
18113        opts: TypeDefWithObjectOpts<'a>,
18114    ) -> TypeDef {
18115        let mut query = self.selection.select("withObject");
18116        query = query.arg("name", name.into());
18117        if let Some(description) = opts.description {
18118            query = query.arg("description", description);
18119        }
18120        if let Some(source_map) = opts.source_map {
18121            query = query.arg("sourceMap", source_map);
18122        }
18123        if let Some(deprecated) = opts.deprecated {
18124            query = query.arg("deprecated", deprecated);
18125        }
18126        TypeDef {
18127            proc: self.proc.clone(),
18128            selection: query,
18129            graphql_client: self.graphql_client.clone(),
18130        }
18131    }
18132    /// Returns a TypeDef of kind Interface with the provided name.
18133    ///
18134    /// # Arguments
18135    ///
18136    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18137    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
18138        let mut query = self.selection.select("withInterface");
18139        query = query.arg("name", name.into());
18140        TypeDef {
18141            proc: self.proc.clone(),
18142            selection: query,
18143            graphql_client: self.graphql_client.clone(),
18144        }
18145    }
18146    /// Returns a TypeDef of kind Interface with the provided name.
18147    ///
18148    /// # Arguments
18149    ///
18150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18151    pub fn with_interface_opts<'a>(
18152        &self,
18153        name: impl Into<String>,
18154        opts: TypeDefWithInterfaceOpts<'a>,
18155    ) -> TypeDef {
18156        let mut query = self.selection.select("withInterface");
18157        query = query.arg("name", name.into());
18158        if let Some(description) = opts.description {
18159            query = query.arg("description", description);
18160        }
18161        if let Some(source_map) = opts.source_map {
18162            query = query.arg("sourceMap", source_map);
18163        }
18164        TypeDef {
18165            proc: self.proc.clone(),
18166            selection: query,
18167            graphql_client: self.graphql_client.clone(),
18168        }
18169    }
18170    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
18171    ///
18172    /// # Arguments
18173    ///
18174    /// * `name` - The name of the field in the object
18175    /// * `type_def` - The type of the field
18176    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18177    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
18178        let mut query = self.selection.select("withField");
18179        query = query.arg("name", name.into());
18180        query = query.arg_lazy(
18181            "typeDef",
18182            Box::new(move || {
18183                let type_def = type_def.clone();
18184                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
18185            }),
18186        );
18187        TypeDef {
18188            proc: self.proc.clone(),
18189            selection: query,
18190            graphql_client: self.graphql_client.clone(),
18191        }
18192    }
18193    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
18194    ///
18195    /// # Arguments
18196    ///
18197    /// * `name` - The name of the field in the object
18198    /// * `type_def` - The type of the field
18199    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18200    pub fn with_field_opts<'a>(
18201        &self,
18202        name: impl Into<String>,
18203        type_def: impl IntoID<Id>,
18204        opts: TypeDefWithFieldOpts<'a>,
18205    ) -> TypeDef {
18206        let mut query = self.selection.select("withField");
18207        query = query.arg("name", name.into());
18208        query = query.arg_lazy(
18209            "typeDef",
18210            Box::new(move || {
18211                let type_def = type_def.clone();
18212                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
18213            }),
18214        );
18215        if let Some(description) = opts.description {
18216            query = query.arg("description", description);
18217        }
18218        if let Some(source_map) = opts.source_map {
18219            query = query.arg("sourceMap", source_map);
18220        }
18221        if let Some(deprecated) = opts.deprecated {
18222            query = query.arg("deprecated", deprecated);
18223        }
18224        TypeDef {
18225            proc: self.proc.clone(),
18226            selection: query,
18227            graphql_client: self.graphql_client.clone(),
18228        }
18229    }
18230    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
18231    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
18232        let mut query = self.selection.select("withFunction");
18233        query = query.arg_lazy(
18234            "function",
18235            Box::new(move || {
18236                let function = function.clone();
18237                Box::pin(async move { function.into_id().await.unwrap().quote() })
18238            }),
18239        );
18240        TypeDef {
18241            proc: self.proc.clone(),
18242            selection: query,
18243            graphql_client: self.graphql_client.clone(),
18244        }
18245    }
18246    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
18247    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
18248        let mut query = self.selection.select("withConstructor");
18249        query = query.arg_lazy(
18250            "function",
18251            Box::new(move || {
18252                let function = function.clone();
18253                Box::pin(async move { function.into_id().await.unwrap().quote() })
18254            }),
18255        );
18256        TypeDef {
18257            proc: self.proc.clone(),
18258            selection: query,
18259            graphql_client: self.graphql_client.clone(),
18260        }
18261    }
18262    /// Returns a TypeDef of kind Enum with the provided name.
18263    /// 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.
18264    ///
18265    /// # Arguments
18266    ///
18267    /// * `name` - The name of the enum
18268    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18269    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
18270        let mut query = self.selection.select("withEnum");
18271        query = query.arg("name", name.into());
18272        TypeDef {
18273            proc: self.proc.clone(),
18274            selection: query,
18275            graphql_client: self.graphql_client.clone(),
18276        }
18277    }
18278    /// Returns a TypeDef of kind Enum with the provided name.
18279    /// 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.
18280    ///
18281    /// # Arguments
18282    ///
18283    /// * `name` - The name of the enum
18284    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18285    pub fn with_enum_opts<'a>(
18286        &self,
18287        name: impl Into<String>,
18288        opts: TypeDefWithEnumOpts<'a>,
18289    ) -> TypeDef {
18290        let mut query = self.selection.select("withEnum");
18291        query = query.arg("name", name.into());
18292        if let Some(description) = opts.description {
18293            query = query.arg("description", description);
18294        }
18295        if let Some(source_map) = opts.source_map {
18296            query = query.arg("sourceMap", source_map);
18297        }
18298        TypeDef {
18299            proc: self.proc.clone(),
18300            selection: query,
18301            graphql_client: self.graphql_client.clone(),
18302        }
18303    }
18304    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
18305    ///
18306    /// # Arguments
18307    ///
18308    /// * `value` - The name of the value in the enum
18309    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18310    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
18311        let mut query = self.selection.select("withEnumValue");
18312        query = query.arg("value", value.into());
18313        TypeDef {
18314            proc: self.proc.clone(),
18315            selection: query,
18316            graphql_client: self.graphql_client.clone(),
18317        }
18318    }
18319    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
18320    ///
18321    /// # Arguments
18322    ///
18323    /// * `value` - The name of the value in the enum
18324    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18325    pub fn with_enum_value_opts<'a>(
18326        &self,
18327        value: impl Into<String>,
18328        opts: TypeDefWithEnumValueOpts<'a>,
18329    ) -> TypeDef {
18330        let mut query = self.selection.select("withEnumValue");
18331        query = query.arg("value", value.into());
18332        if let Some(description) = opts.description {
18333            query = query.arg("description", description);
18334        }
18335        if let Some(source_map) = opts.source_map {
18336            query = query.arg("sourceMap", source_map);
18337        }
18338        if let Some(deprecated) = opts.deprecated {
18339            query = query.arg("deprecated", deprecated);
18340        }
18341        TypeDef {
18342            proc: self.proc.clone(),
18343            selection: query,
18344            graphql_client: self.graphql_client.clone(),
18345        }
18346    }
18347    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
18348    ///
18349    /// # Arguments
18350    ///
18351    /// * `name` - The name of the member in the enum
18352    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18353    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
18354        let mut query = self.selection.select("withEnumMember");
18355        query = query.arg("name", name.into());
18356        TypeDef {
18357            proc: self.proc.clone(),
18358            selection: query,
18359            graphql_client: self.graphql_client.clone(),
18360        }
18361    }
18362    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
18363    ///
18364    /// # Arguments
18365    ///
18366    /// * `name` - The name of the member in the enum
18367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18368    pub fn with_enum_member_opts<'a>(
18369        &self,
18370        name: impl Into<String>,
18371        opts: TypeDefWithEnumMemberOpts<'a>,
18372    ) -> TypeDef {
18373        let mut query = self.selection.select("withEnumMember");
18374        query = query.arg("name", name.into());
18375        if let Some(value) = opts.value {
18376            query = query.arg("value", value);
18377        }
18378        if let Some(description) = opts.description {
18379            query = query.arg("description", description);
18380        }
18381        if let Some(source_map) = opts.source_map {
18382            query = query.arg("sourceMap", source_map);
18383        }
18384        if let Some(deprecated) = opts.deprecated {
18385            query = query.arg("deprecated", deprecated);
18386        }
18387        TypeDef {
18388            proc: self.proc.clone(),
18389            selection: query,
18390            graphql_client: self.graphql_client.clone(),
18391        }
18392    }
18393    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
18394    pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
18395        let query = self.selection.select("asList");
18396        let query = query.select("id");
18397        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18398        Ok(id.map(|id| ListTypeDef {
18399            proc: self.proc.clone(),
18400            selection: query
18401                .root()
18402                .select("node")
18403                .arg("id", &id.0)
18404                .inline_fragment("ListTypeDef"),
18405            graphql_client: self.graphql_client.clone(),
18406        }))
18407    }
18408    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
18409    pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
18410        let query = self.selection.select("asObject");
18411        let query = query.select("id");
18412        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18413        Ok(id.map(|id| ObjectTypeDef {
18414            proc: self.proc.clone(),
18415            selection: query
18416                .root()
18417                .select("node")
18418                .arg("id", &id.0)
18419                .inline_fragment("ObjectTypeDef"),
18420            graphql_client: self.graphql_client.clone(),
18421        }))
18422    }
18423    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
18424    pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
18425        let query = self.selection.select("asInterface");
18426        let query = query.select("id");
18427        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18428        Ok(id.map(|id| InterfaceTypeDef {
18429            proc: self.proc.clone(),
18430            selection: query
18431                .root()
18432                .select("node")
18433                .arg("id", &id.0)
18434                .inline_fragment("InterfaceTypeDef"),
18435            graphql_client: self.graphql_client.clone(),
18436        }))
18437    }
18438    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
18439    pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
18440        let query = self.selection.select("asInput");
18441        let query = query.select("id");
18442        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18443        Ok(id.map(|id| InputTypeDef {
18444            proc: self.proc.clone(),
18445            selection: query
18446                .root()
18447                .select("node")
18448                .arg("id", &id.0)
18449                .inline_fragment("InputTypeDef"),
18450            graphql_client: self.graphql_client.clone(),
18451        }))
18452    }
18453    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
18454    pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
18455        let query = self.selection.select("asScalar");
18456        let query = query.select("id");
18457        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18458        Ok(id.map(|id| ScalarTypeDef {
18459            proc: self.proc.clone(),
18460            selection: query
18461                .root()
18462                .select("node")
18463                .arg("id", &id.0)
18464                .inline_fragment("ScalarTypeDef"),
18465            graphql_client: self.graphql_client.clone(),
18466        }))
18467    }
18468    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
18469    pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
18470        let query = self.selection.select("asEnum");
18471        let query = query.select("id");
18472        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18473        Ok(id.map(|id| EnumTypeDef {
18474            proc: self.proc.clone(),
18475            selection: query
18476                .root()
18477                .select("node")
18478                .arg("id", &id.0)
18479                .inline_fragment("EnumTypeDef"),
18480            graphql_client: self.graphql_client.clone(),
18481        }))
18482    }
18483}
18484impl Node for TypeDef {
18485    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18486        let query = self.selection.select("id");
18487        let graphql_client = self.graphql_client.clone();
18488        async move { query.execute(graphql_client).await }
18489    }
18490}
18491#[derive(Clone)]
18492pub struct Volume {
18493    pub proc: Option<Arc<DaggerSessionProc>>,
18494    pub selection: Selection,
18495    pub graphql_client: DynGraphQLClient,
18496}
18497impl IntoID<Id> for Volume {
18498    fn into_id(
18499        self,
18500    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18501        Box::pin(async move { self.id().await })
18502    }
18503}
18504impl Loadable for Volume {
18505    fn graphql_type() -> &'static str {
18506        "Volume"
18507    }
18508    fn from_query(
18509        proc: Option<Arc<DaggerSessionProc>>,
18510        selection: Selection,
18511        graphql_client: DynGraphQLClient,
18512    ) -> Self {
18513        Self {
18514            proc,
18515            selection,
18516            graphql_client,
18517        }
18518    }
18519}
18520impl Volume {
18521    /// A unique identifier for this Volume.
18522    pub async fn id(&self) -> Result<Id, DaggerError> {
18523        let query = self.selection.select("id");
18524        query.execute(self.graphql_client.clone()).await
18525    }
18526}
18527impl Node for Volume {
18528    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18529        let query = self.selection.select("id");
18530        let graphql_client = self.graphql_client.clone();
18531        async move { query.execute(graphql_client).await }
18532    }
18533}
18534#[derive(Clone)]
18535pub struct Workspace {
18536    pub proc: Option<Arc<DaggerSessionProc>>,
18537    pub selection: Selection,
18538    pub graphql_client: DynGraphQLClient,
18539}
18540#[derive(Builder, Debug, PartialEq)]
18541pub struct WorkspaceMigrateModuleOpts<'a> {
18542    /// Module directory. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18543    #[builder(setter(into, strip_option), default)]
18544    pub path: Option<&'a str>,
18545}
18546#[derive(Builder, Debug, PartialEq)]
18547pub struct WorkspaceCompareCommitsFromOpts<'a> {
18548    /// 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.
18549    #[builder(setter(into, strip_option), default)]
18550    pub commits: Option<Vec<&'a str>>,
18551    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18552    #[builder(setter(into, strip_option), default)]
18553    pub max_commits: Option<isize>,
18554}
18555#[derive(Builder, Debug, PartialEq)]
18556pub struct WorkspaceWithCommitsFromOpts<'a> {
18557    /// 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.
18558    #[builder(setter(into, strip_option), default)]
18559    pub commits: Option<Vec<&'a str>>,
18560    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18561    #[builder(setter(into, strip_option), default)]
18562    pub max_commits: Option<isize>,
18563}
18564#[derive(Builder, Debug, PartialEq)]
18565pub struct WorkspaceWithCommitOpts<'a> {
18566    /// Author and committer email. Defaults to git config user.email in the calling client's working directory, otherwise dagger@localhost.
18567    #[builder(setter(into, strip_option), default)]
18568    pub author_email: Option<&'a str>,
18569    /// Author and committer name. Defaults to git config user.name in the calling client's working directory, otherwise Dagger.
18570    #[builder(setter(into, strip_option), default)]
18571    pub author_name: Option<&'a str>,
18572    /// Add a Signed-off-by trailer using the commit author's name and email.
18573    #[builder(setter(into, strip_option), default)]
18574    pub signoff: Option<bool>,
18575}
18576#[derive(Builder, Debug, PartialEq)]
18577pub struct WorkspaceWithResetOpts {
18578    /// Discard uncommitted changes, resetting the working tree to the commit.
18579    #[builder(setter(into, strip_option), default)]
18580    pub hard: Option<bool>,
18581}
18582#[derive(Builder, Debug, PartialEq)]
18583pub struct WorkspaceDirectoryOpts<'a> {
18584    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
18585    #[builder(setter(into, strip_option), default)]
18586    pub exclude: Option<Vec<&'a str>>,
18587    /// Apply .gitignore filter rules inside the directory.
18588    #[builder(setter(into, strip_option), default)]
18589    pub gitignore: Option<bool>,
18590    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
18591    #[builder(setter(into, strip_option), default)]
18592    pub include: Option<Vec<&'a str>>,
18593}
18594#[derive(Builder, Debug, PartialEq)]
18595pub struct WorkspaceSearchOpts<'a> {
18596    /// Allow the . pattern to match newlines in multiline mode.
18597    #[builder(setter(into, strip_option), default)]
18598    pub dotall: Option<bool>,
18599    /// Only return matching files, not lines and content
18600    #[builder(setter(into, strip_option), default)]
18601    pub files_only: Option<bool>,
18602    /// Glob patterns to match (e.g., "*.md")
18603    #[builder(setter(into, strip_option), default)]
18604    pub globs: Option<Vec<&'a str>>,
18605    /// Enable case-insensitive matching.
18606    #[builder(setter(into, strip_option), default)]
18607    pub insensitive: Option<bool>,
18608    /// Limit the number of results to return
18609    #[builder(setter(into, strip_option), default)]
18610    pub limit: Option<isize>,
18611    /// Interpret the pattern as a literal string instead of a regular expression.
18612    #[builder(setter(into, strip_option), default)]
18613    pub literal: Option<bool>,
18614    /// Enable searching across multiple lines.
18615    #[builder(setter(into, strip_option), default)]
18616    pub multiline: Option<bool>,
18617    /// Directory or file paths to search
18618    #[builder(setter(into, strip_option), default)]
18619    pub paths: Option<Vec<&'a str>>,
18620    /// Skip hidden files (files starting with .).
18621    #[builder(setter(into, strip_option), default)]
18622    pub skip_hidden: Option<bool>,
18623    /// Honor .gitignore, .ignore, and .rgignore files.
18624    #[builder(setter(into, strip_option), default)]
18625    pub skip_ignored: Option<bool>,
18626}
18627#[derive(Builder, Debug, PartialEq)]
18628pub struct WorkspaceFindUpOpts<'a> {
18629    /// Path to start the search from. Relative paths resolve from the workspace cwd; absolute paths resolve from the workspace root.
18630    #[builder(setter(into, strip_option), default)]
18631    pub from: Option<&'a str>,
18632}
18633#[derive(Builder, Debug, PartialEq)]
18634pub struct WorkspaceFindRootsOpts<'a> {
18635    /// Glob patterns pruning the walk below start (e.g. ["**/node_modules/**"]).
18636    #[builder(setter(into, strip_option), default)]
18637    pub exclude: Option<Vec<&'a str>>,
18638    /// Directory to start from. Relative paths resolve from the workspace cwd.
18639    #[builder(setter(into, strip_option), default)]
18640    pub start: Option<&'a str>,
18641}
18642#[derive(Builder, Debug, PartialEq)]
18643pub struct WorkspaceWithNewFileOpts {
18644    /// Permissions of the new file.
18645    #[builder(setter(into, strip_option), default)]
18646    pub permissions: Option<isize>,
18647}
18648#[derive(Builder, Debug, PartialEq)]
18649pub struct WorkspaceWithFileOpts {
18650    /// Permissions of the added file. Defaults to the source file permissions.
18651    #[builder(setter(into, strip_option), default)]
18652    pub permissions: Option<isize>,
18653}
18654#[derive(Builder, Debug, PartialEq)]
18655pub struct WorkspaceWithPatchFileOpts {
18656    /// 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.
18657    #[builder(setter(into, strip_option), default)]
18658    pub on_conflict: Option<PatchConflict>,
18659}
18660#[derive(Builder, Debug, PartialEq)]
18661pub struct WorkspaceWithModuleOpts<'a> {
18662    /// Write to the workspace config directory at the workspace cwd.
18663    #[builder(setter(into, strip_option), default)]
18664    pub here: Option<bool>,
18665    /// Override name for the installed module entry.
18666    #[builder(setter(into, strip_option), default)]
18667    pub name: Option<&'a str>,
18668}
18669#[derive(Builder, Debug, PartialEq)]
18670pub struct WorkspaceWithoutModuleOpts {
18671    /// Write to the workspace config directory at the workspace cwd.
18672    #[builder(setter(into, strip_option), default)]
18673    pub here: Option<bool>,
18674}
18675#[derive(Builder, Debug, PartialEq)]
18676pub struct WorkspaceWithSdkOpts<'a> {
18677    /// Optional override for the SDK name conventionally derived from the installed module name.
18678    #[builder(setter(into, strip_option), default)]
18679    pub as_sdk_name: Option<&'a str>,
18680    /// Write to the workspace config directory at the workspace cwd.
18681    #[builder(setter(into, strip_option), default)]
18682    pub here: Option<bool>,
18683    /// Override name for the installed SDK entry.
18684    #[builder(setter(into, strip_option), default)]
18685    pub name: Option<&'a str>,
18686}
18687#[derive(Builder, Debug, PartialEq)]
18688pub struct WorkspaceWithoutSdkOpts {
18689    /// Write to the workspace config directory at the workspace cwd.
18690    #[builder(setter(into, strip_option), default)]
18691    pub here: Option<bool>,
18692}
18693#[derive(Builder, Debug, PartialEq)]
18694pub struct WorkspaceWithInitModuleOpts<'a> {
18695    /// Compatibility alias for main.
18696    #[builder(setter(into, strip_option), default)]
18697    pub entrypoint: Option<bool>,
18698    /// Install the module. When omitted, install only if path is omitted.
18699    #[builder(setter(into, strip_option), default)]
18700    pub install: Option<bool>,
18701    /// Select this module as the workspace main and install it. False prevents automatic selection. When omitted, select only if both path and name are omitted and the module is installed.
18702    #[builder(setter(into, strip_option), default)]
18703    pub main: Option<bool>,
18704    /// Module name. The engine infers it from path, the active config file, or the workspace root when omitted.
18705    #[builder(setter(into, strip_option), default)]
18706    pub name: Option<&'a str>,
18707    /// Module path relative to the workspace cwd, or an absolute workspace path. Defaults to .dagger/modules/<name> beside the active workspace config.
18708    #[builder(setter(into, strip_option), default)]
18709    pub path: Option<&'a str>,
18710    /// Explicit SDK-module constructor setting overrides for this scope.
18711    #[builder(setter(into, strip_option), default)]
18712    pub settings: Option<Json>,
18713}
18714#[derive(Builder, Debug, PartialEq)]
18715pub struct WorkspaceWithClientOpts<'a> {
18716    /// Optional SDK name. Inspect all installed SDKs when omitted.
18717    #[builder(setter(into, strip_option), default)]
18718    pub sdk: Option<&'a str>,
18719    /// Explicit SDK-module constructor setting overrides for this scope. Requires an explicit SDK name.
18720    #[builder(setter(into, strip_option), default)]
18721    pub settings: Option<Json>,
18722}
18723#[derive(Builder, Debug, PartialEq)]
18724pub struct WorkspaceWithoutClientOpts<'a> {
18725    /// Optional SDK name. Search all installed SDKs when omitted.
18726    #[builder(setter(into, strip_option), default)]
18727    pub sdk: Option<&'a str>,
18728}
18729#[derive(Builder, Debug, PartialEq)]
18730pub struct WorkspaceWithUpdatedClientsOpts<'a> {
18731    /// Select clients in every scope instead of only the scopes containing the workspace cwd.
18732    #[builder(setter(into, strip_option), default)]
18733    pub all: Option<bool>,
18734    /// Recorded client targets to update. All targets in the selected scopes are updated when omitted.
18735    #[builder(setter(into, strip_option), default)]
18736    pub modules: Option<Vec<&'a str>>,
18737    /// Optional SDK name. All installed SDK modules are selected when omitted.
18738    #[builder(setter(into, strip_option), default)]
18739    pub sdk: Option<&'a str>,
18740}
18741#[derive(Builder, Debug, PartialEq)]
18742pub struct WorkspaceWithConfigValueOpts<'a> {
18743    /// Write to the workspace config directory at the workspace cwd.
18744    #[builder(setter(into, strip_option), default)]
18745    pub here: Option<bool>,
18746    /// List value to set. Elements are stored verbatim, with no auto-detection. Mutually exclusive with value.
18747    #[builder(setter(into, strip_option), default)]
18748    pub values: Option<Vec<&'a str>>,
18749}
18750#[derive(Builder, Debug, PartialEq)]
18751pub struct WorkspaceWithoutConfigValueOpts {
18752    /// Write to the workspace config directory at the workspace cwd.
18753    #[builder(setter(into, strip_option), default)]
18754    pub here: Option<bool>,
18755}
18756#[derive(Builder, Debug, PartialEq)]
18757pub struct WorkspaceWithConfigEnvOpts {
18758    /// Write to the workspace config directory at the workspace cwd.
18759    #[builder(setter(into, strip_option), default)]
18760    pub here: Option<bool>,
18761}
18762#[derive(Builder, Debug, PartialEq)]
18763pub struct WorkspaceWithoutConfigEnvOpts {
18764    /// Write to the workspace config directory at the workspace cwd.
18765    #[builder(setter(into, strip_option), default)]
18766    pub here: Option<bool>,
18767}
18768#[derive(Builder, Debug, PartialEq)]
18769pub struct WorkspaceWithUpdatedLockOpts {
18770    /// Do not regenerate SDK client scopes.
18771    #[builder(setter(into, strip_option), default)]
18772    pub no_generate: Option<bool>,
18773}
18774#[derive(Builder, Debug, PartialEq)]
18775pub struct WorkspaceWithUpdatedModulesOpts<'a> {
18776    /// Installed module names or sources. A version suffix sets a new request. An empty list refreshes all installed modules.
18777    #[builder(setter(into, strip_option), default)]
18778    pub names: Option<Vec<&'a str>>,
18779    /// New source for exactly one selected module. Resolved like an install source. Cannot be combined with a version or a version suffix.
18780    #[builder(setter(into, strip_option), default)]
18781    pub source: Option<&'a str>,
18782    /// New version request for exactly one selected module. Cannot be combined with a version suffix.
18783    #[builder(setter(into, strip_option), default)]
18784    pub version: Option<&'a str>,
18785}
18786#[derive(Builder, Debug, PartialEq)]
18787pub struct WorkspaceChangesOpts {
18788    /// An earlier workspace state to compare against.
18789    #[builder(setter(into, strip_option), default)]
18790    pub from: Option<Id>,
18791}
18792#[derive(Builder, Debug, PartialEq)]
18793pub struct WorkspaceExportOpts<'a> {
18794    /// 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.
18795    #[builder(setter(into, strip_option), default)]
18796    pub from: Option<Id>,
18797    /// 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.
18798    #[builder(setter(into, strip_option), default)]
18799    pub path: Option<&'a str>,
18800}
18801#[derive(Builder, Debug, PartialEq)]
18802pub struct WorkspaceConfigReadOpts<'a> {
18803    /// Include the selected environment, user overrides, and legacy workspace settings.
18804    #[builder(setter(into, strip_option), default)]
18805    pub effective: Option<bool>,
18806    /// Dotted key path (e.g. modules.greeter.source). Empty for full config.
18807    #[builder(setter(into, strip_option), default)]
18808    pub key: Option<&'a str>,
18809}
18810#[derive(Builder, Debug, PartialEq)]
18811pub struct WorkspaceArtifactsOpts<'a> {
18812    /// Only include artifacts matching these path patterns, as with checks and services. A path selects that path and its children.
18813    #[builder(setter(into, strip_option), default)]
18814    pub include: Option<Vec<&'a str>>,
18815}
18816#[derive(Builder, Debug, PartialEq)]
18817pub struct WorkspaceMigrateOpts<'a> {
18818    /// Additional local modules to migrate. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18819    #[builder(setter(into, strip_option), default)]
18820    pub modules: Option<Vec<&'a str>>,
18821}
18822impl IntoID<Id> for Workspace {
18823    fn into_id(
18824        self,
18825    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18826        Box::pin(async move { self.id().await })
18827    }
18828}
18829impl Loadable for Workspace {
18830    fn graphql_type() -> &'static str {
18831        "Workspace"
18832    }
18833    fn from_query(
18834        proc: Option<Arc<DaggerSessionProc>>,
18835        selection: Selection,
18836        graphql_client: DynGraphQLClient,
18837    ) -> Self {
18838        Self {
18839            proc,
18840            selection,
18841            graphql_client,
18842        }
18843    }
18844}
18845impl Workspace {
18846    /// A unique identifier for this Workspace.
18847    pub async fn id(&self) -> Result<Id, DaggerError> {
18848        let query = self.selection.select("id");
18849        query.execute(self.graphql_client.clone()).await
18850    }
18851    /// Resolve an address in this workspace.
18852    /// 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.
18853    /// A value without the dag:// scheme keeps its external meaning, such as a container image reference.
18854    /// The Address retains this workspace across module calls and ID reloads.
18855    ///
18856    /// # Arguments
18857    ///
18858    /// * `value` - A DAG address, or an external reference.
18859    pub fn resolve(&self, value: impl Into<String>) -> Address {
18860        let mut query = self.selection.select("resolve");
18861        query = query.arg("value", value.into());
18862        Address {
18863            proc: self.proc.clone(),
18864            selection: query,
18865            graphql_client: self.graphql_client.clone(),
18866        }
18867    }
18868    /// Return this workspace with a native configuration, without changing an existing configuration.
18869    /// Fail if legacy configuration needs workspace migration.
18870    pub fn with_initialized(&self) -> Workspace {
18871        let query = self.selection.select("withInitialized");
18872        Workspace {
18873            proc: self.proc.clone(),
18874            selection: query,
18875            graphql_client: self.graphql_client.clone(),
18876        }
18877    }
18878    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18879    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18880    ///
18881    /// # Arguments
18882    ///
18883    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18884    pub fn migrate_module(&self) -> WorkspaceMigration {
18885        let query = self.selection.select("migrateModule");
18886        WorkspaceMigration {
18887            proc: self.proc.clone(),
18888            selection: query,
18889            graphql_client: self.graphql_client.clone(),
18890        }
18891    }
18892    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18893    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18894    ///
18895    /// # Arguments
18896    ///
18897    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18898    pub fn migrate_module_opts<'a>(
18899        &self,
18900        opts: WorkspaceMigrateModuleOpts<'a>,
18901    ) -> WorkspaceMigration {
18902        let mut query = self.selection.select("migrateModule");
18903        if let Some(path) = opts.path {
18904            query = query.arg("path", path);
18905        }
18906        WorkspaceMigration {
18907            proc: self.proc.clone(),
18908            selection: query,
18909            graphql_client: self.graphql_client.clone(),
18910        }
18911    }
18912    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18913    /// 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.
18914    /// 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.
18915    ///
18916    /// # Arguments
18917    ///
18918    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18919    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18920    pub async fn compare_commits_from(
18921        &self,
18922        source: impl IntoID<Id>,
18923    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18924        let mut query = self.selection.select("compareCommitsFrom");
18925        query = query.arg_lazy(
18926            "source",
18927            Box::new(move || {
18928                let source = source.clone();
18929                Box::pin(async move { source.into_id().await.unwrap().quote() })
18930            }),
18931        );
18932        let query = query.select("id");
18933        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18934        Ok(ids
18935            .into_iter()
18936            .map(|id| WorkspaceCommitPick {
18937                proc: self.proc.clone(),
18938                selection: crate::querybuilder::query()
18939                    .select("node")
18940                    .arg("id", &id.0)
18941                    .inline_fragment("WorkspaceCommitPick"),
18942                graphql_client: self.graphql_client.clone(),
18943            })
18944            .collect())
18945    }
18946    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18947    /// 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.
18948    /// 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.
18949    ///
18950    /// # Arguments
18951    ///
18952    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18953    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18954    pub async fn compare_commits_from_opts<'a>(
18955        &self,
18956        source: impl IntoID<Id>,
18957        opts: WorkspaceCompareCommitsFromOpts<'a>,
18958    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18959        let mut query = self.selection.select("compareCommitsFrom");
18960        query = query.arg_lazy(
18961            "source",
18962            Box::new(move || {
18963                let source = source.clone();
18964                Box::pin(async move { source.into_id().await.unwrap().quote() })
18965            }),
18966        );
18967        if let Some(commits) = opts.commits {
18968            query = query.arg("commits", commits);
18969        }
18970        if let Some(max_commits) = opts.max_commits {
18971            query = query.arg("maxCommits", max_commits);
18972        }
18973        let query = query.select("id");
18974        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18975        Ok(ids
18976            .into_iter()
18977            .map(|id| WorkspaceCommitPick {
18978                proc: self.proc.clone(),
18979                selection: crate::querybuilder::query()
18980                    .select("node")
18981                    .arg("id", &id.0)
18982                    .inline_fragment("WorkspaceCommitPick"),
18983                graphql_client: self.graphql_client.clone(),
18984            })
18985            .collect())
18986    }
18987    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
18988    /// 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.
18989    /// 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.
18990    /// 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.
18991    ///
18992    /// # Arguments
18993    ///
18994    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18995    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18996    pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
18997        let mut query = self.selection.select("withCommitsFrom");
18998        query = query.arg_lazy(
18999            "source",
19000            Box::new(move || {
19001                let source = source.clone();
19002                Box::pin(async move { source.into_id().await.unwrap().quote() })
19003            }),
19004        );
19005        Workspace {
19006            proc: self.proc.clone(),
19007            selection: query,
19008            graphql_client: self.graphql_client.clone(),
19009        }
19010    }
19011    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
19012    /// 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.
19013    /// 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.
19014    /// 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.
19015    ///
19016    /// # Arguments
19017    ///
19018    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
19019    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19020    pub fn with_commits_from_opts<'a>(
19021        &self,
19022        source: impl IntoID<Id>,
19023        opts: WorkspaceWithCommitsFromOpts<'a>,
19024    ) -> Workspace {
19025        let mut query = self.selection.select("withCommitsFrom");
19026        query = query.arg_lazy(
19027            "source",
19028            Box::new(move || {
19029                let source = source.clone();
19030                Box::pin(async move { source.into_id().await.unwrap().quote() })
19031            }),
19032        );
19033        if let Some(commits) = opts.commits {
19034            query = query.arg("commits", commits);
19035        }
19036        if let Some(max_commits) = opts.max_commits {
19037            query = query.arg("maxCommits", max_commits);
19038        }
19039        Workspace {
19040            proc: self.proc.clone(),
19041            selection: query,
19042            graphql_client: self.graphql_client.clone(),
19043        }
19044    }
19045    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
19046    /// 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.
19047    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
19048    /// 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.
19049    ///
19050    /// # Arguments
19051    ///
19052    /// * `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.
19053    /// * `message` - Commit message.
19054    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
19055    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19056    pub fn with_commit(
19057        &self,
19058        changes: impl IntoID<Id>,
19059        message: impl Into<String>,
19060        date: impl Into<String>,
19061    ) -> Workspace {
19062        let mut query = self.selection.select("withCommit");
19063        query = query.arg_lazy(
19064            "changes",
19065            Box::new(move || {
19066                let changes = changes.clone();
19067                Box::pin(async move { changes.into_id().await.unwrap().quote() })
19068            }),
19069        );
19070        query = query.arg("message", message.into());
19071        query = query.arg("date", date.into());
19072        Workspace {
19073            proc: self.proc.clone(),
19074            selection: query,
19075            graphql_client: self.graphql_client.clone(),
19076        }
19077    }
19078    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
19079    /// 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.
19080    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
19081    /// 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.
19082    ///
19083    /// # Arguments
19084    ///
19085    /// * `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.
19086    /// * `message` - Commit message.
19087    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
19088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19089    pub fn with_commit_opts<'a>(
19090        &self,
19091        changes: impl IntoID<Id>,
19092        message: impl Into<String>,
19093        date: impl Into<String>,
19094        opts: WorkspaceWithCommitOpts<'a>,
19095    ) -> Workspace {
19096        let mut query = self.selection.select("withCommit");
19097        query = query.arg_lazy(
19098            "changes",
19099            Box::new(move || {
19100                let changes = changes.clone();
19101                Box::pin(async move { changes.into_id().await.unwrap().quote() })
19102            }),
19103        );
19104        query = query.arg("message", message.into());
19105        query = query.arg("date", date.into());
19106        if let Some(author_name) = opts.author_name {
19107            query = query.arg("authorName", author_name);
19108        }
19109        if let Some(author_email) = opts.author_email {
19110            query = query.arg("authorEmail", author_email);
19111        }
19112        if let Some(signoff) = opts.signoff {
19113            query = query.arg("signoff", signoff);
19114        }
19115        Workspace {
19116            proc: self.proc.clone(),
19117            selection: query,
19118            graphql_client: self.graphql_client.clone(),
19119        }
19120    }
19121    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
19122    /// 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.
19123    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
19124    /// 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.
19125    ///
19126    /// # Arguments
19127    ///
19128    /// * `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.
19129    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19130    pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
19131        let mut query = self.selection.select("withReset");
19132        query = query.arg("commit", commit.into());
19133        Workspace {
19134            proc: self.proc.clone(),
19135            selection: query,
19136            graphql_client: self.graphql_client.clone(),
19137        }
19138    }
19139    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
19140    /// 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.
19141    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
19142    /// 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.
19143    ///
19144    /// # Arguments
19145    ///
19146    /// * `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.
19147    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19148    pub fn with_reset_opts(
19149        &self,
19150        commit: impl Into<String>,
19151        opts: WorkspaceWithResetOpts,
19152    ) -> Workspace {
19153        let mut query = self.selection.select("withReset");
19154        query = query.arg("commit", commit.into());
19155        if let Some(hard) = opts.hard {
19156            query = query.arg("hard", hard);
19157        }
19158        Workspace {
19159            proc: self.proc.clone(),
19160            selection: query,
19161            graphql_client: self.graphql_client.clone(),
19162        }
19163    }
19164    /// Return a snapshot of this workspace as a stable value.
19165    /// 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.
19166    /// 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.
19167    /// 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.
19168    /// The recipe is portable when a remote can serve its base; otherwise it is frozen for this session only.
19169    pub fn snapshot(&self) -> Workspace {
19170        let query = self.selection.select("snapshot");
19171        Workspace {
19172            proc: self.proc.clone(),
19173            selection: query,
19174            graphql_client: self.graphql_client.clone(),
19175        }
19176    }
19177    /// Select workspace-root-relative config and lockfile paths. Empty paths clear the selection.
19178    ///
19179    /// # Arguments
19180    ///
19181    /// * `config_file` - Config file path.
19182    /// * `lock_file` - Lockfile path.
19183    pub fn with_config_paths(
19184        &self,
19185        config_file: impl Into<String>,
19186        lock_file: impl Into<String>,
19187    ) -> Workspace {
19188        let mut query = self.selection.select("withConfigPaths");
19189        query = query.arg("configFile", config_file.into());
19190        query = query.arg("lockFile", lock_file.into());
19191        Workspace {
19192            proc: self.proc.clone(),
19193            selection: query,
19194            graphql_client: self.graphql_client.clone(),
19195        }
19196    }
19197    /// Select the config environment carried by this workspace.
19198    ///
19199    /// # Arguments
19200    ///
19201    /// * `name` - Environment name, or empty to clear the selection.
19202    pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
19203        let mut query = self.selection.select("withConfigEnvironment");
19204        query = query.arg("name", name.into());
19205        Workspace {
19206            proc: self.proc.clone(),
19207            selection: query,
19208            graphql_client: self.graphql_client.clone(),
19209        }
19210    }
19211    /// Return this workspace with the calling client's user-level config re-read and applied.
19212    /// 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.
19213    /// 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.
19214    pub fn with_user_config(&self) -> Workspace {
19215        let query = self.selection.select("withUserConfig");
19216        Workspace {
19217            proc: self.proc.clone(),
19218            selection: query,
19219            graphql_client: self.graphql_client.clone(),
19220        }
19221    }
19222    /// Selected native workspace config file relative to the workspace cwd, if any.
19223    pub async fn config_file(&self) -> Result<String, DaggerError> {
19224        let query = self.selection.select("configFile");
19225        query.execute(self.graphql_client.clone()).await
19226    }
19227    /// Returns a Directory from the workspace.
19228    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
19229    ///
19230    /// # Arguments
19231    ///
19232    /// * `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.
19233    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19234    pub fn directory(&self, path: impl Into<String>) -> Directory {
19235        let mut query = self.selection.select("directory");
19236        query = query.arg("path", path.into());
19237        Directory {
19238            proc: self.proc.clone(),
19239            selection: query,
19240            graphql_client: self.graphql_client.clone(),
19241        }
19242    }
19243    /// Returns a Directory from the workspace.
19244    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
19245    ///
19246    /// # Arguments
19247    ///
19248    /// * `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.
19249    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19250    pub fn directory_opts<'a>(
19251        &self,
19252        path: impl Into<String>,
19253        opts: WorkspaceDirectoryOpts<'a>,
19254    ) -> Directory {
19255        let mut query = self.selection.select("directory");
19256        query = query.arg("path", path.into());
19257        if let Some(exclude) = opts.exclude {
19258            query = query.arg("exclude", exclude);
19259        }
19260        if let Some(include) = opts.include {
19261            query = query.arg("include", include);
19262        }
19263        if let Some(gitignore) = opts.gitignore {
19264            query = query.arg("gitignore", gitignore);
19265        }
19266        Directory {
19267            proc: self.proc.clone(),
19268            selection: query,
19269            graphql_client: self.graphql_client.clone(),
19270        }
19271    }
19272    /// Returns a File from the workspace.
19273    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
19274    ///
19275    /// # Arguments
19276    ///
19277    /// * `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.
19278    pub fn file(&self, path: impl Into<String>) -> File {
19279        let mut query = self.selection.select("file");
19280        query = query.arg("path", path.into());
19281        File {
19282            proc: self.proc.clone(),
19283            selection: query,
19284            graphql_client: self.graphql_client.clone(),
19285        }
19286    }
19287    /// Returns a list of files and directories that match the given pattern.
19288    /// Patterns match paths relative to the workspace root.
19289    ///
19290    /// # Arguments
19291    ///
19292    /// * `pattern` - Pattern to match (e.g., "*.md").
19293    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
19294        let mut query = self.selection.select("glob");
19295        query = query.arg("pattern", pattern.into());
19296        query.execute(self.graphql_client.clone()).await
19297    }
19298    /// Searches for content matching the given regular expression or literal string.
19299    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
19300    /// Runs ripgrep on the client host, falling back to grep if unavailable.
19301    ///
19302    /// # Arguments
19303    ///
19304    /// * `pattern` - The text to match.
19305    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19306    pub async fn search(
19307        &self,
19308        pattern: impl Into<String>,
19309    ) -> Result<Vec<SearchResult>, DaggerError> {
19310        let mut query = self.selection.select("search");
19311        query = query.arg("pattern", pattern.into());
19312        let query = query.select("id");
19313        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19314        Ok(ids
19315            .into_iter()
19316            .map(|id| SearchResult {
19317                proc: self.proc.clone(),
19318                selection: crate::querybuilder::query()
19319                    .select("node")
19320                    .arg("id", &id.0)
19321                    .inline_fragment("SearchResult"),
19322                graphql_client: self.graphql_client.clone(),
19323            })
19324            .collect())
19325    }
19326    /// Searches for content matching the given regular expression or literal string.
19327    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
19328    /// Runs ripgrep on the client host, falling back to grep if unavailable.
19329    ///
19330    /// # Arguments
19331    ///
19332    /// * `pattern` - The text to match.
19333    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19334    pub async fn search_opts<'a>(
19335        &self,
19336        pattern: impl Into<String>,
19337        opts: WorkspaceSearchOpts<'a>,
19338    ) -> Result<Vec<SearchResult>, DaggerError> {
19339        let mut query = self.selection.select("search");
19340        query = query.arg("pattern", pattern.into());
19341        if let Some(paths) = opts.paths {
19342            query = query.arg("paths", paths);
19343        }
19344        if let Some(globs) = opts.globs {
19345            query = query.arg("globs", globs);
19346        }
19347        if let Some(literal) = opts.literal {
19348            query = query.arg("literal", literal);
19349        }
19350        if let Some(multiline) = opts.multiline {
19351            query = query.arg("multiline", multiline);
19352        }
19353        if let Some(dotall) = opts.dotall {
19354            query = query.arg("dotall", dotall);
19355        }
19356        if let Some(insensitive) = opts.insensitive {
19357            query = query.arg("insensitive", insensitive);
19358        }
19359        if let Some(skip_ignored) = opts.skip_ignored {
19360            query = query.arg("skipIgnored", skip_ignored);
19361        }
19362        if let Some(skip_hidden) = opts.skip_hidden {
19363            query = query.arg("skipHidden", skip_hidden);
19364        }
19365        if let Some(files_only) = opts.files_only {
19366            query = query.arg("filesOnly", files_only);
19367        }
19368        if let Some(limit) = opts.limit {
19369            query = query.arg("limit", limit);
19370        }
19371        let query = query.select("id");
19372        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19373        Ok(ids
19374            .into_iter()
19375            .map(|id| SearchResult {
19376                proc: self.proc.clone(),
19377                selection: crate::querybuilder::query()
19378                    .select("node")
19379                    .arg("id", &id.0)
19380                    .inline_fragment("SearchResult"),
19381                graphql_client: self.graphql_client.clone(),
19382            })
19383            .collect())
19384    }
19385    /// Search for a file or directory by walking up from the start path within the workspace.
19386    /// Returns the absolute workspace path if found, or null if not found.
19387    /// Relative start paths resolve from the workspace cwd.
19388    /// The search stops at the workspace root and will not traverse above it.
19389    ///
19390    /// # Arguments
19391    ///
19392    /// * `name` - The name of the file or directory to search for.
19393    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19394    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
19395        let mut query = self.selection.select("findUp");
19396        query = query.arg("name", name.into());
19397        query.execute(self.graphql_client.clone()).await
19398    }
19399    /// Search for a file or directory by walking up from the start path within the workspace.
19400    /// Returns the absolute workspace path if found, or null if not found.
19401    /// Relative start paths resolve from the workspace cwd.
19402    /// The search stops at the workspace root and will not traverse above it.
19403    ///
19404    /// # Arguments
19405    ///
19406    /// * `name` - The name of the file or directory to search for.
19407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19408    pub async fn find_up_opts<'a>(
19409        &self,
19410        name: impl Into<String>,
19411        opts: WorkspaceFindUpOpts<'a>,
19412    ) -> Result<String, DaggerError> {
19413        let mut query = self.selection.select("findUp");
19414        query = query.arg("name", name.into());
19415        if let Some(from) = opts.from {
19416            query = query.arg("from", from);
19417        }
19418        query.execute(self.graphql_client.clone()).await
19419    }
19420    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19421    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19422    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19423    ///
19424    /// # Arguments
19425    ///
19426    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19427    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19428    pub async fn find_roots(
19429        &self,
19430        markers: Vec<impl Into<String>>,
19431    ) -> Result<Vec<String>, DaggerError> {
19432        let mut query = self.selection.select("findRoots");
19433        query = query.arg(
19434            "markers",
19435            markers
19436                .into_iter()
19437                .map(|i| i.into())
19438                .collect::<Vec<String>>(),
19439        );
19440        query.execute(self.graphql_client.clone()).await
19441    }
19442    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19443    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19444    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19445    ///
19446    /// # Arguments
19447    ///
19448    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19449    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19450    pub async fn find_roots_opts<'a>(
19451        &self,
19452        markers: Vec<impl Into<String>>,
19453        opts: WorkspaceFindRootsOpts<'a>,
19454    ) -> Result<Vec<String>, DaggerError> {
19455        let mut query = self.selection.select("findRoots");
19456        query = query.arg(
19457            "markers",
19458            markers
19459                .into_iter()
19460                .map(|i| i.into())
19461                .collect::<Vec<String>>(),
19462        );
19463        if let Some(start) = opts.start {
19464            query = query.arg("start", start);
19465        }
19466        if let Some(exclude) = opts.exclude {
19467            query = query.arg("exclude", exclude);
19468        }
19469        query.execute(self.graphql_client.clone()).await
19470    }
19471    /// Git state for this workspace. Errors if the workspace is not in a git repository.
19472    pub fn git(&self) -> WorkspaceGit {
19473        let query = self.selection.select("git");
19474        WorkspaceGit {
19475            proc: self.proc.clone(),
19476            selection: query,
19477            graphql_client: self.graphql_client.clone(),
19478        }
19479    }
19480    /// Return this workspace with a new or replaced file, without mutating the source.
19481    ///
19482    /// # Arguments
19483    ///
19484    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19485    /// * `contents` - Contents of the new file.
19486    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19487    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
19488        let mut query = self.selection.select("withNewFile");
19489        query = query.arg("path", path.into());
19490        query = query.arg("contents", contents.into());
19491        Workspace {
19492            proc: self.proc.clone(),
19493            selection: query,
19494            graphql_client: self.graphql_client.clone(),
19495        }
19496    }
19497    /// Return this workspace with a new or replaced file, without mutating the source.
19498    ///
19499    /// # Arguments
19500    ///
19501    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19502    /// * `contents` - Contents of the new file.
19503    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19504    pub fn with_new_file_opts(
19505        &self,
19506        path: impl Into<String>,
19507        contents: impl Into<String>,
19508        opts: WorkspaceWithNewFileOpts,
19509    ) -> Workspace {
19510        let mut query = self.selection.select("withNewFile");
19511        query = query.arg("path", path.into());
19512        query = query.arg("contents", contents.into());
19513        if let Some(permissions) = opts.permissions {
19514            query = query.arg("permissions", permissions);
19515        }
19516        Workspace {
19517            proc: self.proc.clone(),
19518            selection: query,
19519            graphql_client: self.graphql_client.clone(),
19520        }
19521    }
19522    /// Return this workspace with a file added or replaced, without mutating the source.
19523    ///
19524    /// # Arguments
19525    ///
19526    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19527    /// * `source` - File to add.
19528    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19529    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19530        let mut query = self.selection.select("withFile");
19531        query = query.arg("path", path.into());
19532        query = query.arg_lazy(
19533            "source",
19534            Box::new(move || {
19535                let source = source.clone();
19536                Box::pin(async move { source.into_id().await.unwrap().quote() })
19537            }),
19538        );
19539        Workspace {
19540            proc: self.proc.clone(),
19541            selection: query,
19542            graphql_client: self.graphql_client.clone(),
19543        }
19544    }
19545    /// Return this workspace with a file added or replaced, without mutating the source.
19546    ///
19547    /// # Arguments
19548    ///
19549    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19550    /// * `source` - File to add.
19551    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19552    pub fn with_file_opts(
19553        &self,
19554        path: impl Into<String>,
19555        source: impl IntoID<Id>,
19556        opts: WorkspaceWithFileOpts,
19557    ) -> Workspace {
19558        let mut query = self.selection.select("withFile");
19559        query = query.arg("path", path.into());
19560        query = query.arg_lazy(
19561            "source",
19562            Box::new(move || {
19563                let source = source.clone();
19564                Box::pin(async move { source.into_id().await.unwrap().quote() })
19565            }),
19566        );
19567        if let Some(permissions) = opts.permissions {
19568            query = query.arg("permissions", permissions);
19569        }
19570        Workspace {
19571            proc: self.proc.clone(),
19572            selection: query,
19573            graphql_client: self.graphql_client.clone(),
19574        }
19575    }
19576    /// Return this workspace with the given path replaced by a directory, without mutating the source.
19577    /// 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.
19578    ///
19579    /// # Arguments
19580    ///
19581    /// * `path` - Path to replace. Relative paths resolve from the workspace cwd.
19582    /// * `source` - Directory to write there.
19583    pub fn with_new_directory(
19584        &self,
19585        path: impl Into<String>,
19586        source: impl IntoID<Id>,
19587    ) -> Workspace {
19588        let mut query = self.selection.select("withNewDirectory");
19589        query = query.arg("path", path.into());
19590        query = query.arg_lazy(
19591            "source",
19592            Box::new(move || {
19593                let source = source.clone();
19594                Box::pin(async move { source.into_id().await.unwrap().quote() })
19595            }),
19596        );
19597        Workspace {
19598            proc: self.proc.clone(),
19599            selection: query,
19600            graphql_client: self.graphql_client.clone(),
19601        }
19602    }
19603    /// Return this workspace with a directory merged into the given path, without mutating the source.
19604    /// Anything already at the path stays, and files the source carries win, as with Directory.withDirectory. Use withNewDirectory to replace the path instead.
19605    ///
19606    /// # Arguments
19607    ///
19608    /// * `path` - Path to merge into. Relative paths resolve from the workspace cwd.
19609    /// * `source` - Directory to merge there.
19610    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19611        let mut query = self.selection.select("withDirectory");
19612        query = query.arg("path", path.into());
19613        query = query.arg_lazy(
19614            "source",
19615            Box::new(move || {
19616                let source = source.clone();
19617                Box::pin(async move { source.into_id().await.unwrap().quote() })
19618            }),
19619        );
19620        Workspace {
19621            proc: self.proc.clone(),
19622            selection: query,
19623            graphql_client: self.graphql_client.clone(),
19624        }
19625    }
19626    /// Return this workspace with a file removed, without mutating the source.
19627    ///
19628    /// # Arguments
19629    ///
19630    /// * `path` - Path of the file to remove. Relative paths resolve from the workspace cwd.
19631    pub fn without_file(&self, path: impl Into<String>) -> Workspace {
19632        let mut query = self.selection.select("withoutFile");
19633        query = query.arg("path", path.into());
19634        Workspace {
19635            proc: self.proc.clone(),
19636            selection: query,
19637            graphql_client: self.graphql_client.clone(),
19638        }
19639    }
19640    /// Return this workspace with files removed, without mutating the source.
19641    ///
19642    /// # Arguments
19643    ///
19644    /// * `paths` - Paths of the files to remove. Relative paths resolve from the workspace cwd.
19645    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Workspace {
19646        let mut query = self.selection.select("withoutFiles");
19647        query = query.arg(
19648            "paths",
19649            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
19650        );
19651        Workspace {
19652            proc: self.proc.clone(),
19653            selection: query,
19654            graphql_client: self.graphql_client.clone(),
19655        }
19656    }
19657    /// Return this workspace with a directory removed, without mutating the source.
19658    ///
19659    /// # Arguments
19660    ///
19661    /// * `path` - Path of the directory to remove. Relative paths resolve from the workspace cwd.
19662    pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
19663        let mut query = self.selection.select("withoutDirectory");
19664        query = query.arg("path", path.into());
19665        Workspace {
19666            proc: self.proc.clone(),
19667            selection: query,
19668            graphql_client: self.graphql_client.clone(),
19669        }
19670    }
19671    /// Return this workspace with a changeset applied, without mutating the source.
19672    ///
19673    /// # Arguments
19674    ///
19675    /// * `changes` - Changes to apply.
19676    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
19677        let mut query = self.selection.select("withChanges");
19678        query = query.arg_lazy(
19679            "changes",
19680            Box::new(move || {
19681                let changes = changes.clone();
19682                Box::pin(async move { changes.into_id().await.unwrap().quote() })
19683            }),
19684        );
19685        Workspace {
19686            proc: self.proc.clone(),
19687            selection: query,
19688            graphql_client: self.graphql_client.clone(),
19689        }
19690    }
19691    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19692    /// 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.
19693    ///
19694    /// # Arguments
19695    ///
19696    /// * `patch` - File containing the patch to apply
19697    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19698    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Workspace {
19699        let mut query = self.selection.select("withPatchFile");
19700        query = query.arg_lazy(
19701            "patch",
19702            Box::new(move || {
19703                let patch = patch.clone();
19704                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19705            }),
19706        );
19707        Workspace {
19708            proc: self.proc.clone(),
19709            selection: query,
19710            graphql_client: self.graphql_client.clone(),
19711        }
19712    }
19713    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19714    /// 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.
19715    ///
19716    /// # Arguments
19717    ///
19718    /// * `patch` - File containing the patch to apply
19719    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19720    pub fn with_patch_file_opts(
19721        &self,
19722        patch: impl IntoID<Id>,
19723        opts: WorkspaceWithPatchFileOpts,
19724    ) -> Workspace {
19725        let mut query = self.selection.select("withPatchFile");
19726        query = query.arg_lazy(
19727            "patch",
19728            Box::new(move || {
19729                let patch = patch.clone();
19730                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19731            }),
19732        );
19733        if let Some(on_conflict) = opts.on_conflict {
19734            query = query.arg("onConflict", on_conflict);
19735        }
19736        Workspace {
19737            proc: self.proc.clone(),
19738            selection: query,
19739            graphql_client: self.graphql_client.clone(),
19740        }
19741    }
19742    /// Return this workspace with its working directory pointed at the given workspace-relative path.
19743    ///
19744    /// # Arguments
19745    ///
19746    /// * `path` - Workspace-relative path to use as the working directory.
19747    pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
19748        let mut query = self.selection.select("withWorkdir");
19749        query = query.arg("path", path.into());
19750        Workspace {
19751            proc: self.proc.clone(),
19752            selection: query,
19753            graphql_client: self.graphql_client.clone(),
19754        }
19755    }
19756    /// Return this workspace with a directory mounted read-only at the given path, without mutating the source.
19757    /// 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.
19758    ///
19759    /// # Arguments
19760    ///
19761    /// * `path` - Location of the mounted directory. Relative paths resolve from the workspace cwd.
19762    /// * `source` - Directory to mount.
19763    pub fn with_mounted_directory(
19764        &self,
19765        path: impl Into<String>,
19766        source: impl IntoID<Id>,
19767    ) -> Workspace {
19768        let mut query = self.selection.select("withMountedDirectory");
19769        query = query.arg("path", path.into());
19770        query = query.arg_lazy(
19771            "source",
19772            Box::new(move || {
19773                let source = source.clone();
19774                Box::pin(async move { source.into_id().await.unwrap().quote() })
19775            }),
19776        );
19777        Workspace {
19778            proc: self.proc.clone(),
19779            selection: query,
19780            graphql_client: self.graphql_client.clone(),
19781        }
19782    }
19783    /// Return this workspace with a file mounted read-only at the given path, without mutating the source.
19784    /// 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.
19785    ///
19786    /// # Arguments
19787    ///
19788    /// * `path` - Location of the mounted file. Relative paths resolve from the workspace cwd.
19789    /// * `source` - File to mount.
19790    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19791        let mut query = self.selection.select("withMountedFile");
19792        query = query.arg("path", path.into());
19793        query = query.arg_lazy(
19794            "source",
19795            Box::new(move || {
19796                let source = source.clone();
19797                Box::pin(async move { source.into_id().await.unwrap().quote() })
19798            }),
19799        );
19800        Workspace {
19801            proc: self.proc.clone(),
19802            selection: query,
19803            graphql_client: self.graphql_client.clone(),
19804        }
19805    }
19806    /// Return this workspace with the content mounted at the given path unmounted.
19807    /// Removes directory and file mounts at or below the path, revealing the underlying workspace content. Other mounts and pending changes are preserved.
19808    ///
19809    /// # Arguments
19810    ///
19811    /// * `path` - Location of the mount to remove. Relative paths resolve from the workspace cwd. Use / to remove all mounts.
19812    pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
19813        let mut query = self.selection.select("withoutMount");
19814        query = query.arg("path", path.into());
19815        Workspace {
19816            proc: self.proc.clone(),
19817            selection: query,
19818            graphql_client: self.graphql_client.clone(),
19819        }
19820    }
19821    /// Return this workspace with a module installed in its config.
19822    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19823    ///
19824    /// # Arguments
19825    ///
19826    /// * `r#ref` - Module reference to install.
19827    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19828    pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
19829        let mut query = self.selection.select("withModule");
19830        query = query.arg("ref", r#ref.into());
19831        Workspace {
19832            proc: self.proc.clone(),
19833            selection: query,
19834            graphql_client: self.graphql_client.clone(),
19835        }
19836    }
19837    /// Return this workspace with a module installed in its config.
19838    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19839    ///
19840    /// # Arguments
19841    ///
19842    /// * `r#ref` - Module reference to install.
19843    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19844    pub fn with_module_opts<'a>(
19845        &self,
19846        r#ref: impl Into<String>,
19847        opts: WorkspaceWithModuleOpts<'a>,
19848    ) -> Workspace {
19849        let mut query = self.selection.select("withModule");
19850        query = query.arg("ref", r#ref.into());
19851        if let Some(name) = opts.name {
19852            query = query.arg("name", name);
19853        }
19854        if let Some(here) = opts.here {
19855            query = query.arg("here", here);
19856        }
19857        Workspace {
19858            proc: self.proc.clone(),
19859            selection: query,
19860            graphql_client: self.graphql_client.clone(),
19861        }
19862    }
19863    /// Return this workspace with a module removed from its config.
19864    /// When the session selects an env, only that env's overlay entry is removed.
19865    ///
19866    /// # Arguments
19867    ///
19868    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19870    pub fn without_module(&self, name: impl Into<String>) -> Workspace {
19871        let mut query = self.selection.select("withoutModule");
19872        query = query.arg("name", name.into());
19873        Workspace {
19874            proc: self.proc.clone(),
19875            selection: query,
19876            graphql_client: self.graphql_client.clone(),
19877        }
19878    }
19879    /// Return this workspace with a module removed from its config.
19880    /// When the session selects an env, only that env's overlay entry is removed.
19881    ///
19882    /// # Arguments
19883    ///
19884    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19886    pub fn without_module_opts(
19887        &self,
19888        name: impl Into<String>,
19889        opts: WorkspaceWithoutModuleOpts,
19890    ) -> Workspace {
19891        let mut query = self.selection.select("withoutModule");
19892        query = query.arg("name", name.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 an SDK installed in its config.
19903    ///
19904    /// # Arguments
19905    ///
19906    /// * `r#ref` - SDK module reference to install.
19907    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19908    pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
19909        let mut query = self.selection.select("withSDK");
19910        query = query.arg("ref", r#ref.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 an SDK installed in its config.
19918    ///
19919    /// # Arguments
19920    ///
19921    /// * `r#ref` - SDK module reference to install.
19922    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19923    pub fn with_sdk_opts<'a>(
19924        &self,
19925        r#ref: impl Into<String>,
19926        opts: WorkspaceWithSdkOpts<'a>,
19927    ) -> Workspace {
19928        let mut query = self.selection.select("withSDK");
19929        query = query.arg("ref", r#ref.into());
19930        if let Some(name) = opts.name {
19931            query = query.arg("name", name);
19932        }
19933        if let Some(here) = opts.here {
19934            query = query.arg("here", here);
19935        }
19936        if let Some(as_sdk_name) = opts.as_sdk_name {
19937            query = query.arg("asSdkName", as_sdk_name);
19938        }
19939        Workspace {
19940            proc: self.proc.clone(),
19941            selection: query,
19942            graphql_client: self.graphql_client.clone(),
19943        }
19944    }
19945    /// Return this workspace with an SDK removed from its config.
19946    ///
19947    /// # Arguments
19948    ///
19949    /// * `name` - Name of the installed SDK entry to remove.
19950    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19951    pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
19952        let mut query = self.selection.select("withoutSDK");
19953        query = query.arg("name", name.into());
19954        Workspace {
19955            proc: self.proc.clone(),
19956            selection: query,
19957            graphql_client: self.graphql_client.clone(),
19958        }
19959    }
19960    /// Return this workspace with an SDK removed from its config.
19961    ///
19962    /// # Arguments
19963    ///
19964    /// * `name` - Name of the installed SDK entry to remove.
19965    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19966    pub fn without_sdk_opts(
19967        &self,
19968        name: impl Into<String>,
19969        opts: WorkspaceWithoutSdkOpts,
19970    ) -> Workspace {
19971        let mut query = self.selection.select("withoutSDK");
19972        query = query.arg("name", name.into());
19973        if let Some(here) = opts.here {
19974            query = query.arg("here", here);
19975        }
19976        Workspace {
19977            proc: self.proc.clone(),
19978            selection: query,
19979            graphql_client: self.graphql_client.clone(),
19980        }
19981    }
19982    /// Return this workspace with an installed module selected as its main.
19983    /// Every other main selection is cleared. The main module lives in the base workspace config.
19984    ///
19985    /// # Arguments
19986    ///
19987    /// * `name` - Exact installed module name.
19988    pub fn with_main(&self, name: impl Into<String>) -> Workspace {
19989        let mut query = self.selection.select("withMain");
19990        query = query.arg("name", name.into());
19991        Workspace {
19992            proc: self.proc.clone(),
19993            selection: query,
19994            graphql_client: self.graphql_client.clone(),
19995        }
19996    }
19997    /// Compatibility alias for withMain.
19998    ///
19999    /// # Arguments
20000    ///
20001    /// * `name` - Exact installed module name.
20002    pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
20003        let mut query = self.selection.select("withEntrypoint");
20004        query = query.arg("name", name.into());
20005        Workspace {
20006            proc: self.proc.clone(),
20007            selection: query,
20008            graphql_client: self.graphql_client.clone(),
20009        }
20010    }
20011    /// Return this workspace with no module selected as its main.
20012    pub fn without_main(&self) -> Workspace {
20013        let query = self.selection.select("withoutMain");
20014        Workspace {
20015            proc: self.proc.clone(),
20016            selection: query,
20017            graphql_client: self.graphql_client.clone(),
20018        }
20019    }
20020    /// Compatibility alias for withoutMain.
20021    pub fn without_entrypoint(&self) -> Workspace {
20022        let query = self.selection.select("withoutEntrypoint");
20023        Workspace {
20024            proc: self.proc.clone(),
20025            selection: query,
20026            graphql_client: self.graphql_client.clone(),
20027        }
20028    }
20029    /// Return this workspace with a location initialized as a module scope.
20030    /// The selected SDK module records the scope and generates the module source.
20031    ///
20032    /// # Arguments
20033    ///
20034    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
20035    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20036    pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
20037        let mut query = self.selection.select("withInitModule");
20038        query = query.arg("sdk", sdk.into());
20039        Workspace {
20040            proc: self.proc.clone(),
20041            selection: query,
20042            graphql_client: self.graphql_client.clone(),
20043        }
20044    }
20045    /// Return this workspace with a location initialized as a module scope.
20046    /// The selected SDK module records the scope and generates the module source.
20047    ///
20048    /// # Arguments
20049    ///
20050    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
20051    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20052    pub fn with_init_module_opts<'a>(
20053        &self,
20054        sdk: impl Into<String>,
20055        opts: WorkspaceWithInitModuleOpts<'a>,
20056    ) -> Workspace {
20057        let mut query = self.selection.select("withInitModule");
20058        query = query.arg("sdk", sdk.into());
20059        if let Some(name) = opts.name {
20060            query = query.arg("name", name);
20061        }
20062        if let Some(path) = opts.path {
20063            query = query.arg("path", path);
20064        }
20065        if let Some(install) = opts.install {
20066            query = query.arg("install", install);
20067        }
20068        if let Some(main) = opts.main {
20069            query = query.arg("main", main);
20070        }
20071        if let Some(entrypoint) = opts.entrypoint {
20072            query = query.arg("entrypoint", entrypoint);
20073        }
20074        if let Some(settings) = opts.settings {
20075            query = query.arg("settings", settings);
20076        }
20077        Workspace {
20078            proc: self.proc.clone(),
20079            selection: query,
20080            graphql_client: self.graphql_client.clone(),
20081        }
20082    }
20083    /// Return the selected SDK module's current scope at this workspace location.
20084    ///
20085    /// # Arguments
20086    ///
20087    /// * `sdk` - SDK name to probe. Required.
20088    pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
20089        let mut query = self.selection.select("detectScope");
20090        query = query.arg("sdk", sdk.into());
20091        query.execute(self.graphql_client.clone()).await
20092    }
20093    /// Return this workspace with a generated module client added to one SDK scope.
20094    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
20095    ///
20096    /// # Arguments
20097    ///
20098    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
20099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20100    pub fn with_client(&self, module: impl Into<String>) -> Workspace {
20101        let mut query = self.selection.select("withClient");
20102        query = query.arg("module", module.into());
20103        Workspace {
20104            proc: self.proc.clone(),
20105            selection: query,
20106            graphql_client: self.graphql_client.clone(),
20107        }
20108    }
20109    /// Return this workspace with a generated module client added to one SDK scope.
20110    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
20111    ///
20112    /// # Arguments
20113    ///
20114    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
20115    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20116    pub fn with_client_opts<'a>(
20117        &self,
20118        module: impl Into<String>,
20119        opts: WorkspaceWithClientOpts<'a>,
20120    ) -> Workspace {
20121        let mut query = self.selection.select("withClient");
20122        query = query.arg("module", module.into());
20123        if let Some(sdk) = opts.sdk {
20124            query = query.arg("sdk", sdk);
20125        }
20126        if let Some(settings) = opts.settings {
20127            query = query.arg("settings", settings);
20128        }
20129        Workspace {
20130            proc: self.proc.clone(),
20131            selection: query,
20132            graphql_client: self.graphql_client.clone(),
20133        }
20134    }
20135    /// Return this workspace with a module client removed from the deepest matching recorded scope.
20136    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
20137    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
20138    ///
20139    /// # Arguments
20140    ///
20141    /// * `module` - The recorded target to remove.
20142    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20143    pub fn without_client(&self, module: impl Into<String>) -> Workspace {
20144        let mut query = self.selection.select("withoutClient");
20145        query = query.arg("module", module.into());
20146        Workspace {
20147            proc: self.proc.clone(),
20148            selection: query,
20149            graphql_client: self.graphql_client.clone(),
20150        }
20151    }
20152    /// Return this workspace with a module client removed from the deepest matching recorded scope.
20153    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
20154    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
20155    ///
20156    /// # Arguments
20157    ///
20158    /// * `module` - The recorded target to remove.
20159    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20160    pub fn without_client_opts<'a>(
20161        &self,
20162        module: impl Into<String>,
20163        opts: WorkspaceWithoutClientOpts<'a>,
20164    ) -> Workspace {
20165        let mut query = self.selection.select("withoutClient");
20166        query = query.arg("module", module.into());
20167        if let Some(sdk) = opts.sdk {
20168            query = query.arg("sdk", sdk);
20169        }
20170        Workspace {
20171            proc: self.proc.clone(),
20172            selection: query,
20173            graphql_client: self.graphql_client.clone(),
20174        }
20175    }
20176    /// Return this workspace with the selected module clients updated.
20177    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
20178    /// The selected SDK module then regenerates every scope that owns one of the targets.
20179    ///
20180    /// # Arguments
20181    ///
20182    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20183    pub fn with_updated_clients(&self) -> Workspace {
20184        let query = self.selection.select("withUpdatedClients");
20185        Workspace {
20186            proc: self.proc.clone(),
20187            selection: query,
20188            graphql_client: self.graphql_client.clone(),
20189        }
20190    }
20191    /// Return this workspace with the selected module clients updated.
20192    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
20193    /// The selected SDK module then regenerates every scope that owns one of the targets.
20194    ///
20195    /// # Arguments
20196    ///
20197    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20198    pub fn with_updated_clients_opts<'a>(
20199        &self,
20200        opts: WorkspaceWithUpdatedClientsOpts<'a>,
20201    ) -> Workspace {
20202        let mut query = self.selection.select("withUpdatedClients");
20203        if let Some(modules) = opts.modules {
20204            query = query.arg("modules", modules);
20205        }
20206        if let Some(all) = opts.all {
20207            query = query.arg("all", all);
20208        }
20209        if let Some(sdk) = opts.sdk {
20210            query = query.arg("sdk", sdk);
20211        }
20212        Workspace {
20213            proc: self.proc.clone(),
20214            selection: query,
20215            graphql_client: self.graphql_client.clone(),
20216        }
20217    }
20218    /// Return this workspace with a configuration value written.
20219    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
20220    ///
20221    /// # Arguments
20222    ///
20223    /// * `key` - Dotted key path.
20224    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
20225    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20226    pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
20227        let mut query = self.selection.select("withConfigValue");
20228        query = query.arg("key", key.into());
20229        query = query.arg("value", value.into());
20230        Workspace {
20231            proc: self.proc.clone(),
20232            selection: query,
20233            graphql_client: self.graphql_client.clone(),
20234        }
20235    }
20236    /// Return this workspace with a configuration value written.
20237    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
20238    ///
20239    /// # Arguments
20240    ///
20241    /// * `key` - Dotted key path.
20242    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
20243    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20244    pub fn with_config_value_opts<'a>(
20245        &self,
20246        key: impl Into<String>,
20247        value: impl Into<String>,
20248        opts: WorkspaceWithConfigValueOpts<'a>,
20249    ) -> Workspace {
20250        let mut query = self.selection.select("withConfigValue");
20251        query = query.arg("key", key.into());
20252        query = query.arg("value", value.into());
20253        if let Some(values) = opts.values {
20254            query = query.arg("values", values);
20255        }
20256        if let Some(here) = opts.here {
20257            query = query.arg("here", here);
20258        }
20259        Workspace {
20260            proc: self.proc.clone(),
20261            selection: query,
20262            graphql_client: self.graphql_client.clone(),
20263        }
20264    }
20265    /// Return this workspace with a configuration value removed.
20266    /// Errors when the key is not currently set.
20267    /// When the session selects an env, the key is scoped to that env's overlay.
20268    ///
20269    /// # Arguments
20270    ///
20271    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
20272    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20273    pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
20274        let mut query = self.selection.select("withoutConfigValue");
20275        query = query.arg("key", key.into());
20276        Workspace {
20277            proc: self.proc.clone(),
20278            selection: query,
20279            graphql_client: self.graphql_client.clone(),
20280        }
20281    }
20282    /// Return this workspace with a configuration value removed.
20283    /// Errors when the key is not currently set.
20284    /// When the session selects an env, the key is scoped to that env's overlay.
20285    ///
20286    /// # Arguments
20287    ///
20288    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
20289    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20290    pub fn without_config_value_opts(
20291        &self,
20292        key: impl Into<String>,
20293        opts: WorkspaceWithoutConfigValueOpts,
20294    ) -> Workspace {
20295        let mut query = self.selection.select("withoutConfigValue");
20296        query = query.arg("key", key.into());
20297        if let Some(here) = opts.here {
20298            query = query.arg("here", here);
20299        }
20300        Workspace {
20301            proc: self.proc.clone(),
20302            selection: query,
20303            graphql_client: self.graphql_client.clone(),
20304        }
20305    }
20306    /// Return this workspace with a named config environment created.
20307    ///
20308    /// # Arguments
20309    ///
20310    /// * `name` - Environment name.
20311    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20312    pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
20313        let mut query = self.selection.select("withConfigEnv");
20314        query = query.arg("name", name.into());
20315        Workspace {
20316            proc: self.proc.clone(),
20317            selection: query,
20318            graphql_client: self.graphql_client.clone(),
20319        }
20320    }
20321    /// Return this workspace with a named config environment created.
20322    ///
20323    /// # Arguments
20324    ///
20325    /// * `name` - Environment name.
20326    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20327    pub fn with_config_env_opts(
20328        &self,
20329        name: impl Into<String>,
20330        opts: WorkspaceWithConfigEnvOpts,
20331    ) -> Workspace {
20332        let mut query = self.selection.select("withConfigEnv");
20333        query = query.arg("name", name.into());
20334        if let Some(here) = opts.here {
20335            query = query.arg("here", here);
20336        }
20337        Workspace {
20338            proc: self.proc.clone(),
20339            selection: query,
20340            graphql_client: self.graphql_client.clone(),
20341        }
20342    }
20343    /// Return this workspace with a named config environment removed.
20344    ///
20345    /// # Arguments
20346    ///
20347    /// * `name` - Environment name.
20348    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20349    pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
20350        let mut query = self.selection.select("withoutConfigEnv");
20351        query = query.arg("name", name.into());
20352        Workspace {
20353            proc: self.proc.clone(),
20354            selection: query,
20355            graphql_client: self.graphql_client.clone(),
20356        }
20357    }
20358    /// Return this workspace with a named config environment removed.
20359    ///
20360    /// # Arguments
20361    ///
20362    /// * `name` - Environment name.
20363    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20364    pub fn without_config_env_opts(
20365        &self,
20366        name: impl Into<String>,
20367        opts: WorkspaceWithoutConfigEnvOpts,
20368    ) -> Workspace {
20369        let mut query = self.selection.select("withoutConfigEnv");
20370        query = query.arg("name", name.into());
20371        if let Some(here) = opts.here {
20372            query = query.arg("here", here);
20373        }
20374        Workspace {
20375            proc: self.proc.clone(),
20376            selection: query,
20377            graphql_client: self.graphql_client.clone(),
20378        }
20379    }
20380    /// Return this workspace with refreshed lockfile state.
20381    /// SDK client scopes are regenerated unless noGenerate is true.
20382    ///
20383    /// # Arguments
20384    ///
20385    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20386    pub fn with_updated_lock(&self) -> Workspace {
20387        let query = self.selection.select("withUpdatedLock");
20388        Workspace {
20389            proc: self.proc.clone(),
20390            selection: query,
20391            graphql_client: self.graphql_client.clone(),
20392        }
20393    }
20394    /// Return this workspace with refreshed lockfile state.
20395    /// SDK client scopes are regenerated unless noGenerate is true.
20396    ///
20397    /// # Arguments
20398    ///
20399    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20400    pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
20401        let mut query = self.selection.select("withUpdatedLock");
20402        if let Some(no_generate) = opts.no_generate {
20403            query = query.arg("noGenerate", no_generate);
20404        }
20405        Workspace {
20406            proc: self.proc.clone(),
20407            selection: query,
20408            graphql_client: self.graphql_client.clone(),
20409        }
20410    }
20411    /// Return this workspace with updated module sources, versions and lockfile state.
20412    /// An SDK client scope is regenerated when it targets an updated module.
20413    ///
20414    /// # Arguments
20415    ///
20416    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20417    pub fn with_updated_modules(&self) -> Workspace {
20418        let query = self.selection.select("withUpdatedModules");
20419        Workspace {
20420            proc: self.proc.clone(),
20421            selection: query,
20422            graphql_client: self.graphql_client.clone(),
20423        }
20424    }
20425    /// Return this workspace with updated module sources, versions and lockfile state.
20426    /// An SDK client scope is regenerated when it targets an updated module.
20427    ///
20428    /// # Arguments
20429    ///
20430    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20431    pub fn with_updated_modules_opts<'a>(
20432        &self,
20433        opts: WorkspaceWithUpdatedModulesOpts<'a>,
20434    ) -> Workspace {
20435        let mut query = self.selection.select("withUpdatedModules");
20436        if let Some(names) = opts.names {
20437            query = query.arg("names", names);
20438        }
20439        if let Some(version) = opts.version {
20440            query = query.arg("version", version);
20441        }
20442        if let Some(source) = opts.source {
20443            query = query.arg("source", source);
20444        }
20445        Workspace {
20446            proc: self.proc.clone(),
20447            selection: query,
20448            graphql_client: self.graphql_client.clone(),
20449        }
20450    }
20451    /// Installed SDKs.
20452    pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
20453        let query = self.selection.select("sdks");
20454        let query = query.select("id");
20455        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20456        Ok(ids
20457            .into_iter()
20458            .map(|id| WorkspaceSdk {
20459                proc: self.proc.clone(),
20460                selection: crate::querybuilder::query()
20461                    .select("node")
20462                    .arg("id", &id.0)
20463                    .inline_fragment("WorkspaceSDK"),
20464                graphql_client: self.graphql_client.clone(),
20465            })
20466            .collect())
20467    }
20468    /// An installed SDK, by name.
20469    ///
20470    /// # Arguments
20471    ///
20472    /// * `name` - SDK name to look up.
20473    pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
20474        let mut query = self.selection.select("sdk");
20475        query = query.arg("name", name.into());
20476        WorkspaceSdk {
20477            proc: self.proc.clone(),
20478            selection: query,
20479            graphql_client: self.graphql_client.clone(),
20480        }
20481    }
20482    /// Return this workspace's changes, with paths relative to its working directory.
20483    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20484    ///
20485    /// # Arguments
20486    ///
20487    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20488    pub fn changes(&self) -> Changeset {
20489        let query = self.selection.select("changes");
20490        Changeset {
20491            proc: self.proc.clone(),
20492            selection: query,
20493            graphql_client: self.graphql_client.clone(),
20494        }
20495    }
20496    /// Return this workspace's changes, with paths relative to its working directory.
20497    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20498    ///
20499    /// # Arguments
20500    ///
20501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20502    pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
20503        let mut query = self.selection.select("changes");
20504        if let Some(from) = opts.from {
20505            query = query.arg("from", from);
20506        }
20507        Changeset {
20508            proc: self.proc.clone(),
20509            selection: query,
20510            graphql_client: self.graphql_client.clone(),
20511        }
20512    }
20513    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20514    /// 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.
20515    /// 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.
20516    /// 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.
20517    ///
20518    /// # Arguments
20519    ///
20520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20521    pub async fn export(&self) -> Result<Void, DaggerError> {
20522        let query = self.selection.select("export");
20523        query.execute(self.graphql_client.clone()).await
20524    }
20525    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20526    /// 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.
20527    /// 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.
20528    /// 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.
20529    ///
20530    /// # Arguments
20531    ///
20532    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20533    pub async fn export_opts<'a>(
20534        &self,
20535        opts: WorkspaceExportOpts<'a>,
20536    ) -> Result<Void, DaggerError> {
20537        let mut query = self.selection.select("export");
20538        if let Some(path) = opts.path {
20539            query = query.arg("path", path);
20540        }
20541        if let Some(from) = opts.from {
20542            query = query.arg("from", from);
20543        }
20544        query.execute(self.graphql_client.clone()).await
20545    }
20546    /// Read a configuration value from dagger.toml.
20547    /// If key is empty, returns the full config.
20548    /// If key points to a scalar, returns the value.
20549    /// If key points to a table, returns flattened dotted-key output.
20550    ///
20551    /// # Arguments
20552    ///
20553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20554    pub async fn config_read(&self) -> Result<String, DaggerError> {
20555        let query = self.selection.select("configRead");
20556        query.execute(self.graphql_client.clone()).await
20557    }
20558    /// Read a configuration value from dagger.toml.
20559    /// If key is empty, returns the full config.
20560    /// If key points to a scalar, returns the value.
20561    /// If key points to a table, returns flattened dotted-key output.
20562    ///
20563    /// # Arguments
20564    ///
20565    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20566    pub async fn config_read_opts<'a>(
20567        &self,
20568        opts: WorkspaceConfigReadOpts<'a>,
20569    ) -> Result<String, DaggerError> {
20570        let mut query = self.selection.select("configRead");
20571        if let Some(key) = opts.key {
20572            query = query.arg("key", key);
20573        }
20574        if let Some(effective) = opts.effective {
20575            query = query.arg("effective", effective);
20576        }
20577        query.execute(self.graphql_client.clone()).await
20578    }
20579    /// Installed name of the module selected as the workspace main, or an empty string when none is selected.
20580    /// Reflects the selected env's effective view. Fails if several modules are selected.
20581    pub async fn main(&self) -> Result<String, DaggerError> {
20582        let query = self.selection.select("main");
20583        query.execute(self.graphql_client.clone()).await
20584    }
20585    /// Compatibility alias for main.
20586    pub async fn entrypoint(&self) -> Result<String, DaggerError> {
20587        let query = self.selection.select("entrypoint");
20588        query.execute(self.graphql_client.clone()).await
20589    }
20590    /// List named environments defined in the workspace configuration.
20591    pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
20592        let query = self.selection.select("envList");
20593        query.execute(self.graphql_client.clone()).await
20594    }
20595    /// List modules defined in the workspace configuration.
20596    /// Reflects the selected env's effective view.
20597    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20598        let query = self.selection.select("modules");
20599        let query = query.select("id");
20600        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20601        Ok(ids
20602            .into_iter()
20603            .map(|id| WorkspaceModule {
20604                proc: self.proc.clone(),
20605                selection: crate::querybuilder::query()
20606                    .select("node")
20607                    .arg("id", &id.0)
20608                    .inline_fragment("WorkspaceModule"),
20609                graphql_client: self.graphql_client.clone(),
20610            })
20611            .collect())
20612    }
20613    /// Return a module defined in the workspace configuration.
20614    /// Reflects the selected env's effective view.
20615    ///
20616    /// # Arguments
20617    ///
20618    /// * `name` - Module name to inspect.
20619    pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
20620        let mut query = self.selection.select("module");
20621        query = query.arg("name", name.into());
20622        WorkspaceModule {
20623            proc: self.proc.clone(),
20624            selection: query,
20625            graphql_client: self.graphql_client.clone(),
20626        }
20627    }
20628    /// Load a module source from a path within the workspace.
20629    /// Relative paths (e.g., "foo") resolve from the workspace cwd; absolute paths (e.g., "/foo") resolve from the workspace root.
20630    /// Fails if the path does not point to an initialized module.
20631    ///
20632    /// # Arguments
20633    ///
20634    /// * `path` - Location of the module source to load, relative to the workspace cwd or absolute from the workspace root.
20635    pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
20636        let mut query = self.selection.select("moduleSource");
20637        query = query.arg("path", path.into());
20638        ModuleSource {
20639            proc: self.proc.clone(),
20640            selection: query,
20641            graphql_client: self.graphql_client.clone(),
20642        }
20643    }
20644    /// Current location within the workspace root.
20645    /// The workspace root is returned as "/".
20646    /// Relative paths in workspace APIs resolve from here.
20647    pub async fn cwd(&self) -> Result<String, DaggerError> {
20648        let query = self.selection.select("cwd");
20649        query.execute(self.graphql_client.clone()).await
20650    }
20651    /// Discover static object artifacts from workspace modules without evaluating their values.
20652    /// Omits the paths that the workspace's check.skip, generate.skip, and up.skip settings skip.
20653    ///
20654    /// # Arguments
20655    ///
20656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20657    pub fn artifacts(&self) -> Artifacts {
20658        let query = self.selection.select("artifacts");
20659        Artifacts {
20660            proc: self.proc.clone(),
20661            selection: query,
20662            graphql_client: self.graphql_client.clone(),
20663        }
20664    }
20665    /// Discover static object artifacts from workspace modules without evaluating their values.
20666    /// Omits the paths that the workspace's check.skip, generate.skip, and up.skip settings skip.
20667    ///
20668    /// # Arguments
20669    ///
20670    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20671    pub fn artifacts_opts<'a>(&self, opts: WorkspaceArtifactsOpts<'a>) -> Artifacts {
20672        let mut query = self.selection.select("artifacts");
20673        if let Some(include) = opts.include {
20674            query = query.arg("include", include);
20675        }
20676        Artifacts {
20677            proc: self.proc.clone(),
20678            selection: query,
20679            graphql_client: self.graphql_client.clone(),
20680        }
20681    }
20682    /// Plan the explicit migration needed for the current workspace.
20683    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
20684    /// The returned plan has an empty changeset and no steps when no migration is needed.
20685    ///
20686    /// # Arguments
20687    ///
20688    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20689    pub fn migrate(&self) -> WorkspaceMigration {
20690        let query = self.selection.select("migrate");
20691        WorkspaceMigration {
20692            proc: self.proc.clone(),
20693            selection: query,
20694            graphql_client: self.graphql_client.clone(),
20695        }
20696    }
20697    /// Plan the explicit migration needed for the current workspace.
20698    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
20699    /// The returned plan has an empty changeset and no steps when no migration is needed.
20700    ///
20701    /// # Arguments
20702    ///
20703    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20704    pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
20705        let mut query = self.selection.select("migrate");
20706        if let Some(modules) = opts.modules {
20707            query = query.arg("modules", modules);
20708        }
20709        WorkspaceMigration {
20710            proc: self.proc.clone(),
20711            selection: query,
20712            graphql_client: self.graphql_client.clone(),
20713        }
20714    }
20715    /// Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
20716    pub async fn address(&self) -> Result<String, DaggerError> {
20717        let query = self.selection.select("address");
20718        query.execute(self.graphql_client.clone()).await
20719    }
20720}
20721impl Node for Workspace {
20722    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20723        let query = self.selection.select("id");
20724        let graphql_client = self.graphql_client.clone();
20725        async move { query.execute(graphql_client).await }
20726    }
20727}
20728#[derive(Clone)]
20729pub struct WorkspaceCommitPick {
20730    pub proc: Option<Arc<DaggerSessionProc>>,
20731    pub selection: Selection,
20732    pub graphql_client: DynGraphQLClient,
20733}
20734impl IntoID<Id> for WorkspaceCommitPick {
20735    fn into_id(
20736        self,
20737    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20738        Box::pin(async move { self.id().await })
20739    }
20740}
20741impl Loadable for WorkspaceCommitPick {
20742    fn graphql_type() -> &'static str {
20743        "WorkspaceCommitPick"
20744    }
20745    fn from_query(
20746        proc: Option<Arc<DaggerSessionProc>>,
20747        selection: Selection,
20748        graphql_client: DynGraphQLClient,
20749    ) -> Self {
20750        Self {
20751            proc,
20752            selection,
20753            graphql_client,
20754        }
20755    }
20756}
20757impl WorkspaceCommitPick {
20758    /// A unique identifier for this WorkspaceCommitPick.
20759    pub async fn id(&self) -> Result<Id, DaggerError> {
20760        let query = self.selection.select("id");
20761        query.execute(self.graphql_client.clone()).await
20762    }
20763    /// The commit in the source workspace.
20764    pub fn commit(&self) -> GitCommit {
20765        let query = self.selection.select("commit");
20766        GitCommit {
20767            proc: self.proc.clone(),
20768            selection: query,
20769            graphql_client: self.graphql_client.clone(),
20770        }
20771    }
20772    /// Whether this commit can be applied.
20773    pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
20774        let query = self.selection.select("status");
20775        query.execute(self.graphql_client.clone()).await
20776    }
20777    /// Why the commit conflicts, or NONE.
20778    pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
20779        let query = self.selection.select("reason");
20780        query.execute(self.graphql_client.clone()).await
20781    }
20782    /// Workspace-root-relative conflicting paths. Empty unless the status is CONFLICT.
20783    pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
20784        let query = self.selection.select("conflictPaths");
20785        query.execute(self.graphql_client.clone()).await
20786    }
20787}
20788impl Node for WorkspaceCommitPick {
20789    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20790        let query = self.selection.select("id");
20791        let graphql_client = self.graphql_client.clone();
20792        async move { query.execute(graphql_client).await }
20793    }
20794}
20795#[derive(Clone)]
20796pub struct WorkspaceGit {
20797    pub proc: Option<Arc<DaggerSessionProc>>,
20798    pub selection: Selection,
20799    pub graphql_client: DynGraphQLClient,
20800}
20801impl IntoID<Id> for WorkspaceGit {
20802    fn into_id(
20803        self,
20804    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20805        Box::pin(async move { self.id().await })
20806    }
20807}
20808impl Loadable for WorkspaceGit {
20809    fn graphql_type() -> &'static str {
20810        "WorkspaceGit"
20811    }
20812    fn from_query(
20813        proc: Option<Arc<DaggerSessionProc>>,
20814        selection: Selection,
20815        graphql_client: DynGraphQLClient,
20816    ) -> Self {
20817        Self {
20818            proc,
20819            selection,
20820            graphql_client,
20821        }
20822    }
20823}
20824impl WorkspaceGit {
20825    /// A unique identifier for this WorkspaceGit.
20826    pub async fn id(&self) -> Result<Id, DaggerError> {
20827        let query = self.selection.select("id");
20828        query.execute(self.graphql_client.clone()).await
20829    }
20830    /// The checked-out HEAD of this workspace.
20831    pub fn head(&self) -> GitRef {
20832        let query = self.selection.select("head");
20833        GitRef {
20834            proc: self.proc.clone(),
20835            selection: query,
20836            graphql_client: self.graphql_client.clone(),
20837        }
20838    }
20839    /// Return a self-contained Git metadata directory for this workspace's HEAD, including its full reachable history and an index matching HEAD.
20840    /// 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.
20841    /// 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.
20842    pub fn directory(&self) -> Directory {
20843        let query = self.selection.select("directory");
20844        Directory {
20845            proc: self.proc.clone(),
20846            selection: query,
20847            graphql_client: self.graphql_client.clone(),
20848        }
20849    }
20850    /// Uncommitted changes in this workspace, using the same rules as GitRepository.uncommitted.
20851    pub fn uncommitted(&self) -> Changeset {
20852        let query = self.selection.select("uncommitted");
20853        Changeset {
20854            proc: self.proc.clone(),
20855            selection: query,
20856            graphql_client: self.graphql_client.clone(),
20857        }
20858    }
20859}
20860impl Node for WorkspaceGit {
20861    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20862        let query = self.selection.select("id");
20863        let graphql_client = self.graphql_client.clone();
20864        async move { query.execute(graphql_client).await }
20865    }
20866}
20867#[derive(Clone)]
20868pub struct WorkspaceMigration {
20869    pub proc: Option<Arc<DaggerSessionProc>>,
20870    pub selection: Selection,
20871    pub graphql_client: DynGraphQLClient,
20872}
20873impl IntoID<Id> for WorkspaceMigration {
20874    fn into_id(
20875        self,
20876    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20877        Box::pin(async move { self.id().await })
20878    }
20879}
20880impl Loadable for WorkspaceMigration {
20881    fn graphql_type() -> &'static str {
20882        "WorkspaceMigration"
20883    }
20884    fn from_query(
20885        proc: Option<Arc<DaggerSessionProc>>,
20886        selection: Selection,
20887        graphql_client: DynGraphQLClient,
20888    ) -> Self {
20889        Self {
20890            proc,
20891            selection,
20892            graphql_client,
20893        }
20894    }
20895}
20896impl WorkspaceMigration {
20897    /// A unique identifier for this WorkspaceMigration.
20898    pub async fn id(&self) -> Result<Id, DaggerError> {
20899        let query = self.selection.select("id");
20900        query.execute(self.graphql_client.clone()).await
20901    }
20902    /// Filesystem changes for the full migration plan.
20903    pub fn changes(&self) -> Changeset {
20904        let query = self.selection.select("changes");
20905        Changeset {
20906            proc: self.proc.clone(),
20907            selection: query,
20908            graphql_client: self.graphql_client.clone(),
20909        }
20910    }
20911    /// Logical migration steps, each identified by a stable code.
20912    pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
20913        let query = self.selection.select("steps");
20914        let query = query.select("id");
20915        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20916        Ok(ids
20917            .into_iter()
20918            .map(|id| WorkspaceMigrationStep {
20919                proc: self.proc.clone(),
20920                selection: crate::querybuilder::query()
20921                    .select("node")
20922                    .arg("id", &id.0)
20923                    .inline_fragment("WorkspaceMigrationStep"),
20924                graphql_client: self.graphql_client.clone(),
20925            })
20926            .collect())
20927    }
20928    /// Unselected legacy module directories relative to the workspace root. Candidates can include fixtures.
20929    pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
20930        let query = self.selection.select("moduleCandidates");
20931        query.execute(self.graphql_client.clone()).await
20932    }
20933    /// Native workspace config path after migration, relative to the workspace root. Empty if no workspace config exists.
20934    pub async fn config_file(&self) -> Result<String, DaggerError> {
20935        let query = self.selection.select("configFile");
20936        query.execute(self.graphql_client.clone()).await
20937    }
20938}
20939impl Node for WorkspaceMigration {
20940    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20941        let query = self.selection.select("id");
20942        let graphql_client = self.graphql_client.clone();
20943        async move { query.execute(graphql_client).await }
20944    }
20945}
20946#[derive(Clone)]
20947pub struct WorkspaceMigrationStep {
20948    pub proc: Option<Arc<DaggerSessionProc>>,
20949    pub selection: Selection,
20950    pub graphql_client: DynGraphQLClient,
20951}
20952impl IntoID<Id> for WorkspaceMigrationStep {
20953    fn into_id(
20954        self,
20955    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20956        Box::pin(async move { self.id().await })
20957    }
20958}
20959impl Loadable for WorkspaceMigrationStep {
20960    fn graphql_type() -> &'static str {
20961        "WorkspaceMigrationStep"
20962    }
20963    fn from_query(
20964        proc: Option<Arc<DaggerSessionProc>>,
20965        selection: Selection,
20966        graphql_client: DynGraphQLClient,
20967    ) -> Self {
20968        Self {
20969            proc,
20970            selection,
20971            graphql_client,
20972        }
20973    }
20974}
20975impl WorkspaceMigrationStep {
20976    /// A unique identifier for this WorkspaceMigrationStep.
20977    pub async fn id(&self) -> Result<Id, DaggerError> {
20978        let query = self.selection.select("id");
20979        query.execute(self.graphql_client.clone()).await
20980    }
20981    /// Stable code identifying this logical migration step.
20982    pub async fn code(&self) -> Result<String, DaggerError> {
20983        let query = self.selection.select("code");
20984        query.execute(self.graphql_client.clone()).await
20985    }
20986    /// Generic summary of this step's purpose and impact.
20987    pub async fn description(&self) -> Result<String, DaggerError> {
20988        let query = self.selection.select("description");
20989        query.execute(self.graphql_client.clone()).await
20990    }
20991    /// Non-fatal warnings raised while planning this step.
20992    pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
20993        let query = self.selection.select("warnings");
20994        query.execute(self.graphql_client.clone()).await
20995    }
20996    /// Filesystem changes for this step.
20997    pub fn changes(&self) -> Changeset {
20998        let query = self.selection.select("changes");
20999        Changeset {
21000            proc: self.proc.clone(),
21001            selection: query,
21002            graphql_client: self.graphql_client.clone(),
21003        }
21004    }
21005}
21006impl Node for WorkspaceMigrationStep {
21007    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21008        let query = self.selection.select("id");
21009        let graphql_client = self.graphql_client.clone();
21010        async move { query.execute(graphql_client).await }
21011    }
21012}
21013#[derive(Clone)]
21014pub struct WorkspaceModule {
21015    pub proc: Option<Arc<DaggerSessionProc>>,
21016    pub selection: Selection,
21017    pub graphql_client: DynGraphQLClient,
21018}
21019impl IntoID<Id> for WorkspaceModule {
21020    fn into_id(
21021        self,
21022    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21023        Box::pin(async move { self.id().await })
21024    }
21025}
21026impl Loadable for WorkspaceModule {
21027    fn graphql_type() -> &'static str {
21028        "WorkspaceModule"
21029    }
21030    fn from_query(
21031        proc: Option<Arc<DaggerSessionProc>>,
21032        selection: Selection,
21033        graphql_client: DynGraphQLClient,
21034    ) -> Self {
21035        Self {
21036            proc,
21037            selection,
21038            graphql_client,
21039        }
21040    }
21041}
21042impl WorkspaceModule {
21043    /// A unique identifier for this WorkspaceModule.
21044    pub async fn id(&self) -> Result<Id, DaggerError> {
21045        let query = self.selection.select("id");
21046        query.execute(self.graphql_client.clone()).await
21047    }
21048    /// Compatibility alias for main.
21049    pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
21050        let query = self.selection.select("entrypoint");
21051        query.execute(self.graphql_client.clone()).await
21052    }
21053    /// List constructor-backed settings for this module.
21054    pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
21055        let query = self.selection.select("settings");
21056        let query = query.select("id");
21057        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21058        Ok(ids
21059            .into_iter()
21060            .map(|id| WorkspaceModuleSetting {
21061                proc: self.proc.clone(),
21062                selection: crate::querybuilder::query()
21063                    .select("node")
21064                    .arg("id", &id.0)
21065                    .inline_fragment("WorkspaceModuleSetting"),
21066                graphql_client: self.graphql_client.clone(),
21067            })
21068            .collect())
21069    }
21070    /// List the functions of this module's main object, in GraphQL field form.
21071    pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
21072        let query = self.selection.select("functions");
21073        query.execute(self.graphql_client.clone()).await
21074    }
21075    /// The module name.
21076    pub async fn name(&self) -> Result<String, DaggerError> {
21077        let query = self.selection.select("name");
21078        query.execute(self.graphql_client.clone()).await
21079    }
21080    /// Whether the module is the workspace main (functions aliased to Query root).
21081    pub async fn main(&self) -> Result<bool, DaggerError> {
21082        let query = self.selection.select("main");
21083        query.execute(self.graphql_client.clone()).await
21084    }
21085    /// The module source path.
21086    pub async fn source(&self) -> Result<String, DaggerError> {
21087        let query = self.selection.select("source");
21088        query.execute(self.graphql_client.clone()).await
21089    }
21090}
21091impl Node for WorkspaceModule {
21092    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21093        let query = self.selection.select("id");
21094        let graphql_client = self.graphql_client.clone();
21095        async move { query.execute(graphql_client).await }
21096    }
21097}
21098#[derive(Clone)]
21099pub struct WorkspaceModuleSetting {
21100    pub proc: Option<Arc<DaggerSessionProc>>,
21101    pub selection: Selection,
21102    pub graphql_client: DynGraphQLClient,
21103}
21104impl IntoID<Id> for WorkspaceModuleSetting {
21105    fn into_id(
21106        self,
21107    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21108        Box::pin(async move { self.id().await })
21109    }
21110}
21111impl Loadable for WorkspaceModuleSetting {
21112    fn graphql_type() -> &'static str {
21113        "WorkspaceModuleSetting"
21114    }
21115    fn from_query(
21116        proc: Option<Arc<DaggerSessionProc>>,
21117        selection: Selection,
21118        graphql_client: DynGraphQLClient,
21119    ) -> Self {
21120        Self {
21121            proc,
21122            selection,
21123            graphql_client,
21124        }
21125    }
21126}
21127impl WorkspaceModuleSetting {
21128    /// A unique identifier for this WorkspaceModuleSetting.
21129    pub async fn id(&self) -> Result<Id, DaggerError> {
21130        let query = self.selection.select("id");
21131        query.execute(self.graphql_client.clone()).await
21132    }
21133    /// The setting key.
21134    pub async fn key(&self) -> Result<String, DaggerError> {
21135        let query = self.selection.select("key");
21136        query.execute(self.graphql_client.clone()).await
21137    }
21138    /// The value stored in workspace config after applying the selected workspace environment, or empty when unset.
21139    pub async fn value(&self) -> Result<String, DaggerError> {
21140        let query = self.selection.select("value");
21141        query.execute(self.graphql_client.clone()).await
21142    }
21143    /// The constructor argument description.
21144    pub async fn description(&self) -> Result<String, DaggerError> {
21145        let query = self.selection.select("description");
21146        query.execute(self.graphql_client.clone()).await
21147    }
21148    /// The constructor argument's declared default, formatted like value, or empty when the argument has no default.
21149    pub async fn default_value(&self) -> Result<String, DaggerError> {
21150        let query = self.selection.select("defaultValue");
21151        query.execute(self.graphql_client.clone()).await
21152    }
21153    /// Whether the setting is a string argument, stored as a TOML string even when the value reads as a number or boolean.
21154    pub async fn is_string(&self) -> Result<bool, DaggerError> {
21155        let query = self.selection.select("isString");
21156        query.execute(self.graphql_client.clone()).await
21157    }
21158    /// Whether the setting accepts a list of values.
21159    pub async fn is_list(&self) -> Result<bool, DaggerError> {
21160        let query = self.selection.select("isList");
21161        query.execute(self.graphql_client.clone()).await
21162    }
21163    /// Whether the setting is an object type resolved from an address string (Container, Directory, File, Secret, Service, ...), which may be a module reference.
21164    pub async fn is_object(&self) -> Result<bool, DaggerError> {
21165        let query = self.selection.select("isObject");
21166        query.execute(self.graphql_client.clone()).await
21167    }
21168}
21169impl Node for WorkspaceModuleSetting {
21170    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21171        let query = self.selection.select("id");
21172        let graphql_client = self.graphql_client.clone();
21173        async move { query.execute(graphql_client).await }
21174    }
21175}
21176#[derive(Clone)]
21177pub struct WorkspaceSdk {
21178    pub proc: Option<Arc<DaggerSessionProc>>,
21179    pub selection: Selection,
21180    pub graphql_client: DynGraphQLClient,
21181}
21182impl IntoID<Id> for WorkspaceSdk {
21183    fn into_id(
21184        self,
21185    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21186        Box::pin(async move { self.id().await })
21187    }
21188}
21189impl Loadable for WorkspaceSdk {
21190    fn graphql_type() -> &'static str {
21191        "WorkspaceSDK"
21192    }
21193    fn from_query(
21194        proc: Option<Arc<DaggerSessionProc>>,
21195        selection: Selection,
21196        graphql_client: DynGraphQLClient,
21197    ) -> Self {
21198        Self {
21199            proc,
21200            selection,
21201            graphql_client,
21202        }
21203    }
21204}
21205impl WorkspaceSdk {
21206    /// A unique identifier for this WorkspaceSDK.
21207    pub async fn id(&self) -> Result<Id, DaggerError> {
21208        let query = self.selection.select("id");
21209        query.execute(self.graphql_client.clone()).await
21210    }
21211    /// Generate the modules and clients managed by this SDK.
21212    pub fn generate(&self) -> Changeset {
21213        let query = self.selection.select("generate");
21214        Changeset {
21215            proc: self.proc.clone(),
21216            selection: query,
21217            graphql_client: self.graphql_client.clone(),
21218        }
21219    }
21220    /// The user-facing SDK name.
21221    pub async fn name(&self) -> Result<String, DaggerError> {
21222        let query = self.selection.select("name");
21223        query.execute(self.graphql_client.clone()).await
21224    }
21225    /// The module reference this SDK was installed from.
21226    pub async fn r#ref(&self) -> Result<String, DaggerError> {
21227        let query = self.selection.select("ref");
21228        query.execute(self.graphql_client.clone()).await
21229    }
21230    /// Modules authored with this SDK.
21231    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
21232        let query = self.selection.select("modules");
21233        let query = query.select("id");
21234        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21235        Ok(ids
21236            .into_iter()
21237            .map(|id| WorkspaceModule {
21238                proc: self.proc.clone(),
21239                selection: crate::querybuilder::query()
21240                    .select("node")
21241                    .arg("id", &id.0)
21242                    .inline_fragment("WorkspaceModule"),
21243                graphql_client: self.graphql_client.clone(),
21244            })
21245            .collect())
21246    }
21247    /// Clients generated with this SDK.
21248    pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
21249        let query = self.selection.select("clients");
21250        let query = query.select("id");
21251        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21252        Ok(ids
21253            .into_iter()
21254            .map(|id| WorkspaceModule {
21255                proc: self.proc.clone(),
21256                selection: crate::querybuilder::query()
21257                    .select("node")
21258                    .arg("id", &id.0)
21259                    .inline_fragment("WorkspaceModule"),
21260                graphql_client: self.graphql_client.clone(),
21261            })
21262            .collect())
21263    }
21264}
21265impl Node for WorkspaceSdk {
21266    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21267        let query = self.selection.select("id");
21268        let graphql_client = self.graphql_client.clone();
21269        async move { query.execute(graphql_client).await }
21270    }
21271}
21272#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21273pub enum AcronymStyle {
21274    #[serde(rename = "CAPITALIZED")]
21275    Capitalized,
21276    #[serde(rename = "UPPERCASE")]
21277    Uppercase,
21278}
21279#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21280pub enum AgentMessageDelivery {
21281    #[serde(rename = "QUEUED")]
21282    Queued,
21283    #[serde(rename = "STARTED")]
21284    Started,
21285    #[serde(rename = "STEERED")]
21286    Steered,
21287}
21288#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21289pub enum AgentState {
21290    #[serde(rename = "FAILED")]
21291    Failed,
21292    #[serde(rename = "IDLE")]
21293    Idle,
21294    #[serde(rename = "PAUSED")]
21295    Paused,
21296    #[serde(rename = "RUNNING")]
21297    Running,
21298    #[serde(rename = "STOPPED")]
21299    Stopped,
21300    #[serde(rename = "WAITING_INPUT")]
21301    WaitingInput,
21302}
21303#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21304pub enum ArtifactDimensionKind {
21305    #[serde(rename = "COLLECTION")]
21306    Collection,
21307    #[serde(rename = "MODULE")]
21308    Module,
21309    #[serde(rename = "TYPE")]
21310    Type,
21311}
21312#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21313pub enum CacheSharingMode {
21314    #[serde(rename = "LOCKED")]
21315    Locked,
21316    #[serde(rename = "PRIVATE")]
21317    Private,
21318    #[serde(rename = "SHARED")]
21319    Shared,
21320}
21321#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21322pub enum Casing {
21323    #[serde(rename = "CAMEL")]
21324    Camel,
21325    #[serde(rename = "FLAT")]
21326    Flat,
21327    #[serde(rename = "KEBAB")]
21328    Kebab,
21329    #[serde(rename = "PASCAL")]
21330    Pascal,
21331    #[serde(rename = "SCREAMING_SNAKE")]
21332    ScreamingSnake,
21333    #[serde(rename = "SNAKE")]
21334    Snake,
21335}
21336#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21337pub enum ChangesetMergeConflict {
21338    #[serde(rename = "FAIL")]
21339    Fail,
21340    #[serde(rename = "FAIL_EARLY")]
21341    FailEarly,
21342    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21343    LeaveConflictMarkers,
21344    #[serde(rename = "PREFER_OURS")]
21345    PreferOurs,
21346    #[serde(rename = "PREFER_THEIRS")]
21347    PreferTheirs,
21348}
21349#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21350pub enum ChangesetsMergeConflict {
21351    #[serde(rename = "FAIL")]
21352    Fail,
21353    #[serde(rename = "FAIL_EARLY")]
21354    FailEarly,
21355}
21356#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21357pub enum DiffStatKind {
21358    #[serde(rename = "ADDED")]
21359    Added,
21360    #[serde(rename = "MODIFIED")]
21361    Modified,
21362    #[serde(rename = "REMOVED")]
21363    Removed,
21364    #[serde(rename = "RENAMED")]
21365    Renamed,
21366}
21367#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21368pub enum ExistsType {
21369    #[serde(rename = "DIRECTORY_TYPE")]
21370    DirectoryType,
21371    #[serde(rename = "REGULAR_TYPE")]
21372    RegularType,
21373    #[serde(rename = "SYMLINK_TYPE")]
21374    SymlinkType,
21375}
21376#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21377pub enum FileType {
21378    #[serde(rename = "DIRECTORY")]
21379    Directory,
21380    #[serde(rename = "DIRECTORY_TYPE")]
21381    DirectoryType,
21382    #[serde(rename = "REGULAR")]
21383    Regular,
21384    #[serde(rename = "REGULAR_TYPE")]
21385    RegularType,
21386    #[serde(rename = "SYMLINK")]
21387    Symlink,
21388    #[serde(rename = "SYMLINK_TYPE")]
21389    SymlinkType,
21390    #[serde(rename = "UNKNOWN")]
21391    Unknown,
21392}
21393#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21394pub enum FunctionCachePolicy {
21395    #[serde(rename = "Default")]
21396    Default,
21397    #[serde(rename = "Never")]
21398    Never,
21399    #[serde(rename = "PerSession")]
21400    PerSession,
21401}
21402#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21403pub enum GitPushDisposition {
21404    #[serde(rename = "CREATED")]
21405    Created,
21406    #[serde(rename = "FAST_FORWARD")]
21407    FastForward,
21408    #[serde(rename = "FORCED")]
21409    Forced,
21410    #[serde(rename = "UP_TO_DATE")]
21411    UpToDate,
21412}
21413#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21414pub enum IdentifierWordKind {
21415    #[serde(rename = "ACRONYM")]
21416    Acronym,
21417    #[serde(rename = "TERM")]
21418    Term,
21419    #[serde(rename = "WORD")]
21420    Word,
21421}
21422#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21423pub enum ImageLayerCompression {
21424    #[serde(rename = "EStarGZ")]
21425    EStarGz,
21426    #[serde(rename = "ESTARGZ")]
21427    Estargz,
21428    #[serde(rename = "Gzip")]
21429    Gzip,
21430    #[serde(rename = "Uncompressed")]
21431    Uncompressed,
21432    #[serde(rename = "Zstd")]
21433    Zstd,
21434}
21435#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21436pub enum ImageMediaTypes {
21437    #[serde(rename = "DOCKER")]
21438    Docker,
21439    #[serde(rename = "DockerMediaTypes")]
21440    DockerMediaTypes,
21441    #[serde(rename = "OCI")]
21442    Oci,
21443    #[serde(rename = "OCIMediaTypes")]
21444    OciMediaTypes,
21445}
21446#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21447pub enum LlmContentBlockKind {
21448    #[serde(rename = "AUDIO")]
21449    Audio,
21450    #[serde(rename = "DOCUMENT")]
21451    Document,
21452    #[serde(rename = "IMAGE")]
21453    Image,
21454    #[serde(rename = "TEXT")]
21455    Text,
21456    #[serde(rename = "THINKING")]
21457    Thinking,
21458    #[serde(rename = "TOOL_CALL")]
21459    ToolCall,
21460    #[serde(rename = "TOOL_RESULT")]
21461    ToolResult,
21462}
21463#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21464pub enum LlmMessageOriginKind {
21465    #[serde(rename = "AGENT")]
21466    Agent,
21467    #[serde(rename = "EVENT")]
21468    Event,
21469    #[serde(rename = "USER")]
21470    User,
21471}
21472#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21473pub enum LlmMessageRole {
21474    #[serde(rename = "ASSISTANT")]
21475    Assistant,
21476    #[serde(rename = "SYSTEM")]
21477    System,
21478    #[serde(rename = "USER")]
21479    User,
21480}
21481#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21482pub enum ModuleSourceExperimentalFeature {
21483    #[serde(rename = "SELF_CALLS")]
21484    SelfCalls,
21485}
21486#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21487pub enum ModuleSourceKind {
21488    #[serde(rename = "DIR")]
21489    Dir,
21490    #[serde(rename = "DIR_SOURCE")]
21491    DirSource,
21492    #[serde(rename = "GIT")]
21493    Git,
21494    #[serde(rename = "GIT_SOURCE")]
21495    GitSource,
21496    #[serde(rename = "LOCAL")]
21497    Local,
21498    #[serde(rename = "LOCAL_SOURCE")]
21499    LocalSource,
21500}
21501#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21502pub enum NetworkProtocol {
21503    #[serde(rename = "TCP")]
21504    Tcp,
21505    #[serde(rename = "UDP")]
21506    Udp,
21507}
21508#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21509pub enum PatchConflict {
21510    #[serde(rename = "FAIL")]
21511    Fail,
21512    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21513    LeaveConflictMarkers,
21514}
21515#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21516pub enum RegistryProtocol {
21517    #[serde(rename = "HTTP")]
21518    Http,
21519    #[serde(rename = "HTTPS")]
21520    Https,
21521}
21522#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21523pub enum ReturnType {
21524    #[serde(rename = "ANY")]
21525    Any,
21526    #[serde(rename = "FAILURE")]
21527    Failure,
21528    #[serde(rename = "SUCCESS")]
21529    Success,
21530}
21531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21532pub enum TypeDefKind {
21533    #[serde(rename = "BOOLEAN")]
21534    Boolean,
21535    #[serde(rename = "BOOLEAN_KIND")]
21536    BooleanKind,
21537    #[serde(rename = "ENUM")]
21538    Enum,
21539    #[serde(rename = "ENUM_KIND")]
21540    EnumKind,
21541    #[serde(rename = "FLOAT")]
21542    Float,
21543    #[serde(rename = "FLOAT_KIND")]
21544    FloatKind,
21545    #[serde(rename = "INPUT")]
21546    Input,
21547    #[serde(rename = "INPUT_KIND")]
21548    InputKind,
21549    #[serde(rename = "INTEGER")]
21550    Integer,
21551    #[serde(rename = "INTEGER_KIND")]
21552    IntegerKind,
21553    #[serde(rename = "INTERFACE")]
21554    Interface,
21555    #[serde(rename = "INTERFACE_KIND")]
21556    InterfaceKind,
21557    #[serde(rename = "LIST")]
21558    List,
21559    #[serde(rename = "LIST_KIND")]
21560    ListKind,
21561    #[serde(rename = "OBJECT")]
21562    Object,
21563    #[serde(rename = "OBJECT_KIND")]
21564    ObjectKind,
21565    #[serde(rename = "SCALAR")]
21566    Scalar,
21567    #[serde(rename = "SCALAR_KIND")]
21568    ScalarKind,
21569    #[serde(rename = "STRING")]
21570    String,
21571    #[serde(rename = "STRING_KIND")]
21572    StringKind,
21573    #[serde(rename = "VOID")]
21574    Void,
21575    #[serde(rename = "VOID_KIND")]
21576    VoidKind,
21577}
21578#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21579pub enum WorkspaceCommitPickReason {
21580    #[serde(rename = "CONTENT")]
21581    Content,
21582    #[serde(rename = "DIRTY")]
21583    Dirty,
21584    #[serde(rename = "NONE")]
21585    None,
21586}
21587#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21588pub enum WorkspaceCommitPickStatus {
21589    #[serde(rename = "CONFLICT")]
21590    Conflict,
21591    #[serde(rename = "PICKABLE")]
21592    Pickable,
21593    #[serde(rename = "PICKED")]
21594    Picked,
21595    #[serde(rename = "REDUNDANT")]
21596    Redundant,
21597}