Skip to main content

dagger_sdk/
gen.rs

1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::loadable::Loadable;
8use crate::querybuilder::Selection;
9use derive_builder::Builder;
10use serde::{Deserialize, Serialize};
11use std::sync::Arc;
12
13#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
14pub struct Bytes(pub String);
15impl From<&str> for Bytes {
16    fn from(value: &str) -> Self {
17        Self(value.to_string())
18    }
19}
20impl From<String> for Bytes {
21    fn from(value: String) -> Self {
22        Self(value)
23    }
24}
25impl Bytes {
26    fn quote(&self) -> String {
27        format!("\"{}\"", self.0.clone())
28    }
29}
30#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
31pub struct Id(pub String);
32impl From<&str> for Id {
33    fn from(value: &str) -> Self {
34        Self(value.to_string())
35    }
36}
37impl From<String> for Id {
38    fn from(value: String) -> Self {
39        Self(value)
40    }
41}
42impl IntoID<Id> for Id {
43    fn into_id(
44        self,
45    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
46        Box::pin(async move { Ok::<Id, DaggerError>(self) })
47    }
48}
49impl Id {
50    fn quote(&self) -> String {
51        format!("\"{}\"", self.0.clone())
52    }
53}
54#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
55pub struct Json(pub String);
56impl From<&str> for Json {
57    fn from(value: &str) -> Self {
58        Self(value.to_string())
59    }
60}
61impl From<String> for Json {
62    fn from(value: String) -> Self {
63        Self(value)
64    }
65}
66impl Json {
67    fn quote(&self) -> String {
68        format!("\"{}\"", self.0.clone())
69    }
70}
71#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
72pub struct Platform(pub String);
73impl From<&str> for Platform {
74    fn from(value: &str) -> Self {
75        Self(value.to_string())
76    }
77}
78impl From<String> for Platform {
79    fn from(value: String) -> Self {
80        Self(value)
81    }
82}
83impl Platform {
84    fn quote(&self) -> String {
85        format!("\"{}\"", self.0.clone())
86    }
87}
88#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
89pub struct Void(pub String);
90impl From<&str> for Void {
91    fn from(value: &str) -> Self {
92        Self(value.to_string())
93    }
94}
95impl From<String> for Void {
96    fn from(value: String) -> Self {
97        Self(value)
98    }
99}
100impl Void {
101    fn quote(&self) -> String {
102        format!("\"{}\"", self.0.clone())
103    }
104}
105#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
106pub struct BuildArg {
107    pub name: String,
108    pub value: String,
109}
110#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
111pub struct LlmContentBlockInput {
112    pub arguments: Json,
113    pub call_id: String,
114    pub content: Vec<LlmContentBlockInput>,
115    pub data: Bytes,
116    pub errored: bool,
117    pub file: Id,
118    pub kind: LlmContentBlockKind,
119    pub mime_type: String,
120    pub signature: String,
121    pub text: String,
122    pub tool_name: String,
123}
124#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
125pub struct LlmMessageOriginInput {
126    pub agent_name: String,
127    pub kind: LlmMessageOriginKind,
128    pub r#ref: String,
129    pub reply_to: String,
130}
131#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
132pub struct PipelineLabel {
133    pub name: String,
134    pub value: String,
135}
136#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
137pub struct PortForward {
138    pub backend: isize,
139    pub frontend: isize,
140    pub protocol: NetworkProtocol,
141}
142/// An object that can be exported to the host.
143/// Calling export writes the object to a path on the host filesystem and returns the path that was written.
144pub trait Exportable {
145    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
146    fn export(
147        &self,
148        path: impl Into<String>,
149    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
150}
151#[derive(Clone)]
152pub struct ExportableClient {
153    pub proc: Option<Arc<DaggerSessionProc>>,
154    pub selection: Selection,
155    pub graphql_client: DynGraphQLClient,
156}
157impl IntoID<Id> for ExportableClient {
158    fn into_id(
159        self,
160    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
161        Box::pin(async move { self.id().await })
162    }
163}
164impl ExportableClient {
165    pub async fn id(&self) -> Result<Id, DaggerError> {
166        let query = self.selection.select("id");
167        query.execute(self.graphql_client.clone()).await
168    }
169    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
170        let mut query = self.selection.select("export");
171        query = query.arg("path", path.into());
172        query.execute(self.graphql_client.clone()).await
173    }
174}
175impl Loadable for ExportableClient {
176    fn graphql_type() -> &'static str {
177        "Exportable"
178    }
179    fn from_query(
180        proc: Option<Arc<DaggerSessionProc>>,
181        selection: Selection,
182        graphql_client: DynGraphQLClient,
183    ) -> Self {
184        Self {
185            proc,
186            selection,
187            graphql_client,
188        }
189    }
190}
191impl Exportable for ExportableClient {
192    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
193        let query = self.selection.select("id");
194        let graphql_client = self.graphql_client.clone();
195        async move { query.execute(graphql_client).await }
196    }
197    fn export(
198        &self,
199        path: impl Into<String>,
200    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
201        let mut query = self.selection.select("export");
202        query = query.arg("path", path.into());
203        let graphql_client = self.graphql_client.clone();
204        async move { query.execute(graphql_client).await }
205    }
206}
207/// An object with a globally unique ID.
208pub trait Node {
209    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
210}
211#[derive(Clone)]
212pub struct NodeClient {
213    pub proc: Option<Arc<DaggerSessionProc>>,
214    pub selection: Selection,
215    pub graphql_client: DynGraphQLClient,
216}
217impl IntoID<Id> for NodeClient {
218    fn into_id(
219        self,
220    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
221        Box::pin(async move { self.id().await })
222    }
223}
224impl NodeClient {
225    pub async fn id(&self) -> Result<Id, DaggerError> {
226        let query = self.selection.select("id");
227        query.execute(self.graphql_client.clone()).await
228    }
229}
230impl Loadable for NodeClient {
231    fn graphql_type() -> &'static str {
232        "Node"
233    }
234    fn from_query(
235        proc: Option<Arc<DaggerSessionProc>>,
236        selection: Selection,
237        graphql_client: DynGraphQLClient,
238    ) -> Self {
239        Self {
240            proc,
241            selection,
242            graphql_client,
243        }
244    }
245}
246impl Node for NodeClient {
247    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
248        let query = self.selection.select("id");
249        let graphql_client = self.graphql_client.clone();
250        async move { query.execute(graphql_client).await }
251    }
252}
253/// An object that can be force-evaluated.
254/// Calling sync ensures that the object's entire dependency DAG has been evaluated, returning the object's ID once complete.
255pub trait Syncer {
256    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
257    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send
258    where
259        Self: Sized;
260}
261#[derive(Clone)]
262pub struct SyncerClient {
263    pub proc: Option<Arc<DaggerSessionProc>>,
264    pub selection: Selection,
265    pub graphql_client: DynGraphQLClient,
266}
267impl IntoID<Id> for SyncerClient {
268    fn into_id(
269        self,
270    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
271        Box::pin(async move { self.id().await })
272    }
273}
274impl SyncerClient {
275    pub async fn id(&self) -> Result<Id, DaggerError> {
276        let query = self.selection.select("id");
277        query.execute(self.graphql_client.clone()).await
278    }
279    pub async fn sync(&self) -> Result<SyncerClient, DaggerError> {
280        let query = self.selection.select("sync");
281        let id: Id = query.execute(self.graphql_client.clone()).await?;
282        Ok(SyncerClient {
283            proc: self.proc.clone(),
284            selection: query
285                .root()
286                .select("node")
287                .arg("id", &id.0)
288                .inline_fragment("Syncer"),
289            graphql_client: self.graphql_client.clone(),
290        })
291    }
292}
293impl Loadable for SyncerClient {
294    fn graphql_type() -> &'static str {
295        "Syncer"
296    }
297    fn from_query(
298        proc: Option<Arc<DaggerSessionProc>>,
299        selection: Selection,
300        graphql_client: DynGraphQLClient,
301    ) -> Self {
302        Self {
303            proc,
304            selection,
305            graphql_client,
306        }
307    }
308}
309impl Syncer for SyncerClient {
310    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
311        let query = self.selection.select("id");
312        let graphql_client = self.graphql_client.clone();
313        async move { query.execute(graphql_client).await }
314    }
315    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
316        let query = self.selection.select("sync");
317        let proc = self.proc.clone();
318        let graphql_client = self.graphql_client.clone();
319        async move {
320            let id: Id = query.execute(graphql_client.clone()).await?;
321            Ok(Self {
322                proc,
323                selection: query
324                    .root()
325                    .select("node")
326                    .arg("id", &id.0)
327                    .inline_fragment("Syncer"),
328                graphql_client,
329            })
330        }
331    }
332}
333#[derive(Clone)]
334pub struct Address {
335    pub proc: Option<Arc<DaggerSessionProc>>,
336    pub selection: Selection,
337    pub graphql_client: DynGraphQLClient,
338}
339#[derive(Builder, Debug, PartialEq)]
340pub struct AddressContainerOpts {
341    /// Resolve the address's image tag live, ignoring the workspace lockfile: neither read a pinned value nor record one.
342    /// A DAG address is unaffected: its module evaluates as usual.
343    #[builder(setter(into, strip_option), default)]
344    pub no_lock: Option<bool>,
345}
346#[derive(Builder, Debug, PartialEq)]
347pub struct AddressDirectoryOpts<'a> {
348    #[builder(setter(into, strip_option), default)]
349    pub exclude: Option<Vec<&'a str>>,
350    #[builder(setter(into, strip_option), default)]
351    pub gitignore: Option<bool>,
352    #[builder(setter(into, strip_option), default)]
353    pub include: Option<Vec<&'a str>>,
354    #[builder(setter(into, strip_option), default)]
355    pub no_cache: Option<bool>,
356    /// Resolve the address's git ref live, ignoring the workspace lockfile: neither read a pinned value nor record one.
357    /// A DAG address is unaffected: its module evaluates as usual.
358    #[builder(setter(into, strip_option), default)]
359    pub no_lock: Option<bool>,
360}
361#[derive(Builder, Debug, PartialEq)]
362pub struct AddressFileOpts<'a> {
363    #[builder(setter(into, strip_option), default)]
364    pub exclude: Option<Vec<&'a str>>,
365    #[builder(setter(into, strip_option), default)]
366    pub gitignore: Option<bool>,
367    #[builder(setter(into, strip_option), default)]
368    pub include: Option<Vec<&'a str>>,
369    #[builder(setter(into, strip_option), default)]
370    pub no_cache: Option<bool>,
371    /// Resolve the address's git ref live, ignoring the workspace lockfile: neither read a pinned value nor record one.
372    /// A DAG address is unaffected: its module evaluates as usual.
373    #[builder(setter(into, strip_option), default)]
374    pub no_lock: Option<bool>,
375}
376#[derive(Builder, Debug, PartialEq)]
377pub struct AddressGitRefOpts {
378    /// Resolve the address's git ref live, ignoring the workspace lockfile: neither read a pinned value nor record one.
379    /// A DAG address is unaffected: its module evaluates as usual.
380    #[builder(setter(into, strip_option), default)]
381    pub no_lock: Option<bool>,
382}
383impl IntoID<Id> for Address {
384    fn into_id(
385        self,
386    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
387        Box::pin(async move { self.id().await })
388    }
389}
390impl Loadable for Address {
391    fn graphql_type() -> &'static str {
392        "Address"
393    }
394    fn from_query(
395        proc: Option<Arc<DaggerSessionProc>>,
396        selection: Selection,
397        graphql_client: DynGraphQLClient,
398    ) -> Self {
399        Self {
400            proc,
401            selection,
402            graphql_client,
403        }
404    }
405}
406impl Address {
407    /// A unique identifier for this Address.
408    pub async fn id(&self) -> Result<Id, DaggerError> {
409        let query = self.selection.select("id");
410        query.execute(self.graphql_client.clone()).await
411    }
412    /// The address value
413    pub async fn value(&self) -> Result<String, DaggerError> {
414        let query = self.selection.select("value");
415        query.execute(self.graphql_client.clone()).await
416    }
417    /// Load a container from the address.
418    ///
419    /// # Arguments
420    ///
421    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
422    pub fn container(&self) -> Container {
423        let query = self.selection.select("container");
424        Container {
425            proc: self.proc.clone(),
426            selection: query,
427            graphql_client: self.graphql_client.clone(),
428        }
429    }
430    /// Load a container from the address.
431    ///
432    /// # Arguments
433    ///
434    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
435    pub fn container_opts(&self, opts: AddressContainerOpts) -> Container {
436        let mut query = self.selection.select("container");
437        if let Some(no_lock) = opts.no_lock {
438            query = query.arg("noLock", no_lock);
439        }
440        Container {
441            proc: self.proc.clone(),
442            selection: query,
443            graphql_client: self.graphql_client.clone(),
444        }
445    }
446    /// Load a directory from the address.
447    ///
448    /// # Arguments
449    ///
450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
451    pub fn directory(&self) -> Directory {
452        let query = self.selection.select("directory");
453        Directory {
454            proc: self.proc.clone(),
455            selection: query,
456            graphql_client: self.graphql_client.clone(),
457        }
458    }
459    /// Load a directory from the address.
460    ///
461    /// # Arguments
462    ///
463    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
464    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
465        let mut query = self.selection.select("directory");
466        if let Some(exclude) = opts.exclude {
467            query = query.arg("exclude", exclude);
468        }
469        if let Some(include) = opts.include {
470            query = query.arg("include", include);
471        }
472        if let Some(gitignore) = opts.gitignore {
473            query = query.arg("gitignore", gitignore);
474        }
475        if let Some(no_cache) = opts.no_cache {
476            query = query.arg("noCache", no_cache);
477        }
478        if let Some(no_lock) = opts.no_lock {
479            query = query.arg("noLock", no_lock);
480        }
481        Directory {
482            proc: self.proc.clone(),
483            selection: query,
484            graphql_client: self.graphql_client.clone(),
485        }
486    }
487    /// Load a file from the address.
488    ///
489    /// # Arguments
490    ///
491    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
492    pub fn file(&self) -> File {
493        let query = self.selection.select("file");
494        File {
495            proc: self.proc.clone(),
496            selection: query,
497            graphql_client: self.graphql_client.clone(),
498        }
499    }
500    /// Load a file from the address.
501    ///
502    /// # Arguments
503    ///
504    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
505    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
506        let mut query = self.selection.select("file");
507        if let Some(exclude) = opts.exclude {
508            query = query.arg("exclude", exclude);
509        }
510        if let Some(include) = opts.include {
511            query = query.arg("include", include);
512        }
513        if let Some(gitignore) = opts.gitignore {
514            query = query.arg("gitignore", gitignore);
515        }
516        if let Some(no_cache) = opts.no_cache {
517            query = query.arg("noCache", no_cache);
518        }
519        if let Some(no_lock) = opts.no_lock {
520            query = query.arg("noLock", no_lock);
521        }
522        File {
523            proc: self.proc.clone(),
524            selection: query,
525            graphql_client: self.graphql_client.clone(),
526        }
527    }
528    /// Load a git ref (branch, tag or commit) from the address.
529    ///
530    /// # Arguments
531    ///
532    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
533    pub fn git_ref(&self) -> GitRef {
534        let query = self.selection.select("gitRef");
535        GitRef {
536            proc: self.proc.clone(),
537            selection: query,
538            graphql_client: self.graphql_client.clone(),
539        }
540    }
541    /// Load a git ref (branch, tag or commit) from the address.
542    ///
543    /// # Arguments
544    ///
545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
546    pub fn git_ref_opts(&self, opts: AddressGitRefOpts) -> GitRef {
547        let mut query = self.selection.select("gitRef");
548        if let Some(no_lock) = opts.no_lock {
549            query = query.arg("noLock", no_lock);
550        }
551        GitRef {
552            proc: self.proc.clone(),
553            selection: query,
554            graphql_client: self.graphql_client.clone(),
555        }
556    }
557    /// Load a git repository from the address.
558    pub fn git_repository(&self) -> GitRepository {
559        let query = self.selection.select("gitRepository");
560        GitRepository {
561            proc: self.proc.clone(),
562            selection: query,
563            graphql_client: self.graphql_client.clone(),
564        }
565    }
566    /// Load a secret from the address.
567    pub fn secret(&self) -> Secret {
568        let query = self.selection.select("secret");
569        Secret {
570            proc: self.proc.clone(),
571            selection: query,
572            graphql_client: self.graphql_client.clone(),
573        }
574    }
575    /// Load a service from the address.
576    pub fn service(&self) -> Service {
577        let query = self.selection.select("service");
578        Service {
579            proc: self.proc.clone(),
580            selection: query,
581            graphql_client: self.graphql_client.clone(),
582        }
583    }
584    /// Load a local socket from the address.
585    pub fn socket(&self) -> Socket {
586        let query = self.selection.select("socket");
587        Socket {
588            proc: self.proc.clone(),
589            selection: query,
590            graphql_client: self.graphql_client.clone(),
591        }
592    }
593    /// Load a volume from the address.
594    pub fn volume(&self) -> Volume {
595        let query = self.selection.select("volume");
596        Volume {
597            proc: self.proc.clone(),
598            selection: query,
599            graphql_client: self.graphql_client.clone(),
600        }
601    }
602    /// Load a workspace from a module reference.
603    pub fn workspace(&self) -> Workspace {
604        let query = self.selection.select("workspace");
605        Workspace {
606            proc: self.proc.clone(),
607            selection: query,
608            graphql_client: self.graphql_client.clone(),
609        }
610    }
611}
612impl Node for Address {
613    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
614        let query = self.selection.select("id");
615        let graphql_client = self.graphql_client.clone();
616        async move { query.execute(graphql_client).await }
617    }
618}
619#[derive(Clone)]
620pub struct Agent {
621    pub proc: Option<Arc<DaggerSessionProc>>,
622    pub selection: Selection,
623    pub graphql_client: DynGraphQLClient,
624}
625#[derive(Builder, Debug, PartialEq)]
626pub struct AgentSendOpts<'a> {
627    /// Ordered TEXT, IMAGE, AUDIO, or DOCUMENT user content blocks. File inputs are resolved and all content is validated before enqueueing. Pass an empty message for media-only sends.
628    #[builder(setter(into, strip_option), default)]
629    pub content: Option<Vec<LlmContentBlockInput>>,
630    /// The ref of a message in the SENDER's own mailbox this send answers (e.g. "#3", from its attribution header). The recipient sees the two paired, and awaiters of the replied-to message resolve with this reply immediately instead of at the sender's turn end.
631    #[builder(setter(into, strip_option), default)]
632    pub reply_to: Option<&'a str>,
633}
634#[derive(Builder, Debug, PartialEq)]
635pub struct AgentPauseOpts {
636    /// Preempt the in-flight step instead of letting it finish. All completed steps are kept and the interrupted turn stays open: messages it consumed remain pending, while unconsumed mailbox messages are discarded. Resume continues the turn from the last committed step. On an idle, never-started, or failed agent there is nothing to preempt, so this is a plain pause.
637    #[builder(setter(into, strip_option), default)]
638    pub interrupt: Option<bool>,
639}
640#[derive(Builder, Debug, PartialEq)]
641pub struct AgentNotifyOpts {
642    /// The lifecycle states that fire an event. IDLE events carry the turn's final reply; FAILED events carry the loop error.
643    #[builder(setter(into, strip_option), default)]
644    pub on: Option<Vec<AgentState>>,
645}
646#[derive(Builder, Debug, PartialEq)]
647pub struct AgentStopOpts {
648    /// Cancel the loop immediately instead of letting an in-flight step finish. Either way the completed steps are preserved in the snapshot.
649    #[builder(setter(into, strip_option), default)]
650    pub kill: Option<bool>,
651}
652impl IntoID<Id> for Agent {
653    fn into_id(
654        self,
655    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
656        Box::pin(async move { self.id().await })
657    }
658}
659impl Loadable for Agent {
660    fn graphql_type() -> &'static str {
661        "Agent"
662    }
663    fn from_query(
664        proc: Option<Arc<DaggerSessionProc>>,
665        selection: Selection,
666        graphql_client: DynGraphQLClient,
667    ) -> Self {
668        Self {
669            proc,
670            selection,
671            graphql_client,
672        }
673    }
674}
675impl Agent {
676    /// A unique identifier for this Agent.
677    pub async fn id(&self) -> Result<Id, DaggerError> {
678        let query = self.selection.select("id");
679        query.execute(self.graphql_client.clone()).await
680    }
681    /// Display label for the agent; carries no identity.
682    pub async fn name(&self) -> Result<String, DaggerError> {
683        let query = self.selection.select("name");
684        query.execute(self.graphql_client.clone()).await
685    }
686    /// The opaque runtime handle minted by the spawn that created this agent.
687    /// It is the same value the agent's loop span publishes as dagger.io/agent.id, so a client can correlate the agent with what it discovers in the trace. Two spawns of an identical composition have different handles; a display name is shared freely.
688    pub async fn handle(&self) -> Result<String, DaggerError> {
689        let query = self.selection.select("handle");
690        query.execute(self.graphql_client.clone()).await
691    }
692    /// Computed lifecycle state; never stored.
693    /// An agent that was never started reports IDLE: its mailbox is empty and no turn is open.
694    pub async fn state(&self) -> Result<AgentState, DaggerError> {
695        let query = self.selection.select("state");
696        query.execute(self.graphql_client.clone()).await
697    }
698    /// Why the loop failed, for a FAILED agent; empty otherwise.
699    /// The snapshot holds the completed prefix — send or resume retries from it.
700    pub async fn error(&self) -> Result<String, DaggerError> {
701        let query = self.selection.select("error");
702        query.execute(self.graphql_client.clone()).await
703    }
704    /// The conversation the agent was spawned from: the tools, workspace and message history its loop started with.
705    /// Fixed by the spawn; stepping does not move it (see snapshot for the latest committed step). Its workspace is the baseline the agent's own changes are measured from.
706    /// For an agent restored under a handle, this is the conversation it was restored from.
707    pub fn seed(&self) -> Llm {
708        let query = self.selection.select("seed");
709        Llm {
710            proc: self.proc.clone(),
711            selection: query,
712            graphql_client: self.graphql_client.clone(),
713        }
714    }
715    /// The conversation as of the last committed step: immutable, branchable, persistable.
716    /// The seed conversation if the agent never stepped.
717    /// Branching from it does not affect the agent.
718    pub fn snapshot(&self) -> Llm {
719        let query = self.selection.select("snapshot");
720        Llm {
721            proc: self.proc.clone(),
722            selection: query,
723            graphql_client: self.graphql_client.clone(),
724        }
725    }
726    /// Enqueue a message, on the record: it is consumed at a step boundary, appends to the agent's history, and steers the running turn or opens a new one.
727    /// Never blocks, never drops; concurrent sends queue in order.
728    /// The returned message is pinned through the message lookup field, so its handle is re-addressable from any request in the session: cancel a response request and request it again freely.
729    /// Sending to a never-started agent starts it (signal-with-start). Sending to a stopped agent restarts the same instance from its last committed snapshot. Sending to a paused or failed agent enqueues with QUEUED delivery, to be drained by a resume.
730    ///
731    /// # Arguments
732    ///
733    /// * `message` - The message text, appended to the agent's history as a prompt when a turn consumes it. When content is supplied, nonempty text precedes those blocks in the same user message.
734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
735    pub async fn send(&self, message: impl Into<String>) -> Result<AgentMessage, DaggerError> {
736        let mut query = self.selection.select("send");
737        query = query.arg("message", message.into());
738        let id: Id = query.execute(self.graphql_client.clone()).await?;
739        Ok(AgentMessage {
740            proc: self.proc.clone(),
741            selection: query
742                .root()
743                .select("node")
744                .arg("id", &id.0)
745                .inline_fragment("AgentMessage"),
746            graphql_client: self.graphql_client.clone(),
747        })
748    }
749    /// Enqueue a message, on the record: it is consumed at a step boundary, appends to the agent's history, and steers the running turn or opens a new one.
750    /// Never blocks, never drops; concurrent sends queue in order.
751    /// The returned message is pinned through the message lookup field, so its handle is re-addressable from any request in the session: cancel a response request and request it again freely.
752    /// Sending to a never-started agent starts it (signal-with-start). Sending to a stopped agent restarts the same instance from its last committed snapshot. Sending to a paused or failed agent enqueues with QUEUED delivery, to be drained by a resume.
753    ///
754    /// # Arguments
755    ///
756    /// * `message` - The message text, appended to the agent's history as a prompt when a turn consumes it. When content is supplied, nonempty text precedes those blocks in the same user message.
757    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
758    pub async fn send_opts<'a>(
759        &self,
760        message: impl Into<String>,
761        opts: AgentSendOpts<'a>,
762    ) -> Result<AgentMessage, DaggerError> {
763        let mut query = self.selection.select("send");
764        query = query.arg("message", message.into());
765        if let Some(reply_to) = opts.reply_to {
766            query = query.arg("replyTo", reply_to);
767        }
768        if let Some(content) = opts.content {
769            query = query.arg("content", content);
770        }
771        let id: Id = query.execute(self.graphql_client.clone()).await?;
772        Ok(AgentMessage {
773            proc: self.proc.clone(),
774            selection: query
775                .root()
776                .select("node")
777                .arg("id", &id.0)
778                .inline_fragment("AgentMessage"),
779            graphql_client: self.graphql_client.clone(),
780        })
781    }
782    /// Look up a previously sent message by its ref.
783    /// This is the lookup send pins its result's identity through: the returned handle's ID is an honest, replayable chain, addressable from any request in the session (the cancel-and-request-again contract).
784    /// Fails if the agent has no runtime entry in this session, or no record of the given ref.
785    ///
786    /// # Arguments
787    ///
788    /// * `r#ref` - The message's short ref within this agent's runtime, e.g. "#3": the token its attribution header shows and a reply's replyTo names. A bare ordinal ("3") is accepted too.
789    pub fn message(&self, r#ref: impl Into<String>) -> AgentMessage {
790        let mut query = self.selection.select("message");
791        query = query.arg("ref", r#ref.into());
792        AgentMessage {
793            proc: self.proc.clone(),
794            selection: query,
795            graphql_client: self.graphql_client.clone(),
796        }
797    }
798    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
799    /// Pause takes priority over pending work: a mid-turn pause suspends the turn, which resume continues. Messages sent while paused enqueue with QUEUED delivery until a resume.
800    /// Pausing a never-started agent leaves it paused for its eventual resume; pausing a failed agent is allowed (resume decides the retry); pausing a stopped agent fails.
801    ///
802    /// # Arguments
803    ///
804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
805    pub async fn pause(&self) -> Result<Agent, DaggerError> {
806        let query = self.selection.select("pause");
807        let id: Id = query.execute(self.graphql_client.clone()).await?;
808        Ok(Agent {
809            proc: self.proc.clone(),
810            selection: query
811                .root()
812                .select("node")
813                .arg("id", &id.0)
814                .inline_fragment("Agent"),
815            graphql_client: self.graphql_client.clone(),
816        })
817    }
818    /// Stop draining the mailbox once the in-flight step completes, or immediately with interrupt.
819    /// Pause takes priority over pending work: a mid-turn pause suspends the turn, which resume continues. Messages sent while paused enqueue with QUEUED delivery until a resume.
820    /// Pausing a never-started agent leaves it paused for its eventual resume; pausing a failed agent is allowed (resume decides the retry); pausing a stopped agent fails.
821    ///
822    /// # Arguments
823    ///
824    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
825    pub async fn pause_opts(&self, opts: AgentPauseOpts) -> Result<Agent, DaggerError> {
826        let mut query = self.selection.select("pause");
827        if let Some(interrupt) = opts.interrupt {
828            query = query.arg("interrupt", interrupt);
829        }
830        let id: Id = query.execute(self.graphql_client.clone()).await?;
831        Ok(Agent {
832            proc: self.proc.clone(),
833            selection: query
834                .root()
835                .select("node")
836                .arg("id", &id.0)
837                .inline_fragment("Agent"),
838            graphql_client: self.graphql_client.clone(),
839        })
840    }
841    /// Resume draining the mailbox: a suspended turn continues from the last committed step, and queued messages drain.
842    /// Resuming a never-started agent starts its evaluation loop, detached from the calling request: it steps the conversation while input is pending, then idles awaiting further lifecycle operations. Resuming a FAILED agent retries its pending step. Resuming a STOPPED agent relaunches the same instance from its last committed snapshot.
843    /// No-op on a running or idle agent.
844    pub async fn resume(&self) -> Result<Agent, DaggerError> {
845        let query = self.selection.select("resume");
846        let id: Id = query.execute(self.graphql_client.clone()).await?;
847        Ok(Agent {
848            proc: self.proc.clone(),
849            selection: query
850                .root()
851                .select("node")
852                .arg("id", &id.0)
853                .inline_fragment("Agent"),
854            graphql_client: self.graphql_client.clone(),
855        })
856    }
857    /// Block until the agent settles: IDLE, FAILED, or STOPPED. Read which from state afterwards.
858    /// Unlike waiting for one exact state, this cannot hang merely because the agent settled in a different outcome.
859    pub async fn wait(&self) -> Result<Agent, DaggerError> {
860        let query = self.selection.select("wait");
861        let id: Id = query.execute(self.graphql_client.clone()).await?;
862        Ok(Agent {
863            proc: self.proc.clone(),
864            selection: query
865                .root()
866                .select("node")
867                .arg("id", &id.0)
868                .inline_fragment("Agent"),
869            graphql_client: self.graphql_client.clone(),
870        })
871    }
872    /// Subscribe another agent to this agent's lifecycle: each transition into one of the given states enqueues an event message to the subscriber — steering its open turn, or waking it if idle, like any other message.
873    /// This is how a supervisor hears every completion and failure without polling or blocking: subscribe at spawn time, keep working, and events arrive as attributed messages.
874    /// Events never relaunch a stopped subscriber, and an already-reached state fires immediately at subscribe time, so a fast agent settling before the subscription lands is not missed.
875    /// A restored agent that nothing has sent to, started, or resumed yet is the exception: its state was reached in the session it was restored from, so subscribing to it announces nothing until it next transitions. This is how a restore reinstalls recorded subscriptions without waking their subscribers.
876    /// Idempotent per subscriber; re-subscribing replaces the state set.
877    ///
878    /// # Arguments
879    ///
880    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
882    pub async fn notify(&self, subscriber: impl IntoID<Id>) -> Result<Agent, DaggerError> {
883        let mut query = self.selection.select("notify");
884        query = query.arg_lazy(
885            "subscriber",
886            Box::new(move || {
887                let subscriber = subscriber.clone();
888                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
889            }),
890        );
891        let id: Id = query.execute(self.graphql_client.clone()).await?;
892        Ok(Agent {
893            proc: self.proc.clone(),
894            selection: query
895                .root()
896                .select("node")
897                .arg("id", &id.0)
898                .inline_fragment("Agent"),
899            graphql_client: self.graphql_client.clone(),
900        })
901    }
902    /// Subscribe another agent to this agent's lifecycle: each transition into one of the given states enqueues an event message to the subscriber — steering its open turn, or waking it if idle, like any other message.
903    /// This is how a supervisor hears every completion and failure without polling or blocking: subscribe at spawn time, keep working, and events arrive as attributed messages.
904    /// Events never relaunch a stopped subscriber, and an already-reached state fires immediately at subscribe time, so a fast agent settling before the subscription lands is not missed.
905    /// A restored agent that nothing has sent to, started, or resumed yet is the exception: its state was reached in the session it was restored from, so subscribing to it announces nothing until it next transitions. This is how a restore reinstalls recorded subscriptions without waking their subscribers.
906    /// Idempotent per subscriber; re-subscribing replaces the state set.
907    ///
908    /// # Arguments
909    ///
910    /// * `subscriber` - The agent to deliver event messages to. You must hold its handle: subscriptions are capability-based like everything else.
911    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
912    pub async fn notify_opts(
913        &self,
914        subscriber: impl IntoID<Id>,
915        opts: AgentNotifyOpts,
916    ) -> Result<Agent, DaggerError> {
917        let mut query = self.selection.select("notify");
918        query = query.arg_lazy(
919            "subscriber",
920            Box::new(move || {
921                let subscriber = subscriber.clone();
922                Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
923            }),
924        );
925        if let Some(on) = opts.on {
926            query = query.arg("on", on);
927        }
928        let id: Id = query.execute(self.graphql_client.clone()).await?;
929        Ok(Agent {
930            proc: self.proc.clone(),
931            selection: query
932                .root()
933                .select("node")
934                .arg("id", &id.0)
935                .inline_fragment("Agent"),
936            graphql_client: self.graphql_client.clone(),
937        })
938    }
939    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
940    ///
941    /// # Arguments
942    ///
943    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
944    pub async fn stop(&self) -> Result<Agent, DaggerError> {
945        let query = self.selection.select("stop");
946        let id: Id = query.execute(self.graphql_client.clone()).await?;
947        Ok(Agent {
948            proc: self.proc.clone(),
949            selection: query
950                .root()
951                .select("node")
952                .arg("id", &id.0)
953                .inline_fragment("Agent"),
954            graphql_client: self.graphql_client.clone(),
955        })
956    }
957    /// Release the agent's runtime. The tombstone (state, snapshot) stays readable for the rest of the session.
958    ///
959    /// # Arguments
960    ///
961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
962    pub async fn stop_opts(&self, opts: AgentStopOpts) -> Result<Agent, DaggerError> {
963        let mut query = self.selection.select("stop");
964        if let Some(kill) = opts.kill {
965            query = query.arg("kill", kill);
966        }
967        let id: Id = query.execute(self.graphql_client.clone()).await?;
968        Ok(Agent {
969            proc: self.proc.clone(),
970            selection: query
971                .root()
972                .select("node")
973                .arg("id", &id.0)
974                .inline_fragment("Agent"),
975            graphql_client: self.graphql_client.clone(),
976        })
977    }
978    /// Replace this instance's committed conversation with the given one, keeping the entry: identity, mailbox, and lifecycle state are untouched. A paused suspended turn is abandoned and its consumed messages are resolved before replacement.
979    /// This is the continuity verb. Compaction, a workspace rebind, a model change, or rewinding an interrupted prompt produce a new conversation value for the SAME agent; reseed swaps it in place, where a stop-and-respawn would mint a successor instance and split the agent across two roster entries. It is the client-facing form of what a continuation tool already does mid-turn: the agent adopts a new conversation without changing who it is.
980    /// The next turn continues from the reseeded conversation, and queued messages drain onto it. A FAILED agent keeps its error — resume retries from the new conversation.
981    /// Fails if the instance has no runtime entry in this session (only a spawned or re-hydrated instance holds a conversation to replace), if a step is in flight, or if the agent is stopped.
982    ///
983    /// # Arguments
984    ///
985    /// * `conversation` - The conversation that becomes the agent's committed history, replacing the current one.
986    pub async fn reseed(&self, conversation: impl IntoID<Id>) -> Result<Agent, DaggerError> {
987        let mut query = self.selection.select("reseed");
988        query = query.arg_lazy(
989            "conversation",
990            Box::new(move || {
991                let conversation = conversation.clone();
992                Box::pin(async move { conversation.into_id().await.unwrap().quote() })
993            }),
994        );
995        let id: Id = query.execute(self.graphql_client.clone()).await?;
996        Ok(Agent {
997            proc: self.proc.clone(),
998            selection: query
999                .root()
1000                .select("node")
1001                .arg("id", &id.0)
1002                .inline_fragment("Agent"),
1003            graphql_client: self.graphql_client.clone(),
1004        })
1005    }
1006}
1007impl Node for Agent {
1008    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1009        let query = self.selection.select("id");
1010        let graphql_client = self.graphql_client.clone();
1011        async move { query.execute(graphql_client).await }
1012    }
1013}
1014#[derive(Clone)]
1015pub struct AgentMessage {
1016    pub proc: Option<Arc<DaggerSessionProc>>,
1017    pub selection: Selection,
1018    pub graphql_client: DynGraphQLClient,
1019}
1020impl IntoID<Id> for AgentMessage {
1021    fn into_id(
1022        self,
1023    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1024        Box::pin(async move { self.id().await })
1025    }
1026}
1027impl Loadable for AgentMessage {
1028    fn graphql_type() -> &'static str {
1029        "AgentMessage"
1030    }
1031    fn from_query(
1032        proc: Option<Arc<DaggerSessionProc>>,
1033        selection: Selection,
1034        graphql_client: DynGraphQLClient,
1035    ) -> Self {
1036        Self {
1037            proc,
1038            selection,
1039            graphql_client,
1040        }
1041    }
1042}
1043impl AgentMessage {
1044    /// A unique identifier for this AgentMessage.
1045    pub async fn id(&self) -> Result<Id, DaggerError> {
1046        let query = self.selection.select("id");
1047        query.execute(self.graphql_client.clone()).await
1048    }
1049    /// How the message conclusively landed: opened a new turn (STARTED), was absorbed into the running turn at a step boundary (STEERED), or queued behind it (QUEUED).
1050    /// Blocks until provider or native lifecycle evidence is conclusive. Once recorded, the result or cancellation error is immutable.
1051    pub async fn delivery(&self) -> Result<AgentMessageDelivery, DaggerError> {
1052        let query = self.selection.select("delivery");
1053        query.execute(self.graphql_client.clone()).await
1054    }
1055    /// The message's short ref within the receiving agent's runtime, e.g. "#3".
1056    /// This is the deterministic token the recipient's attribution header shows and a reply's replyTo names — quote it when telling the recipient what to answer.
1057    pub async fn r#ref(&self) -> Result<String, DaggerError> {
1058        let query = self.selection.select("ref");
1059        query.execute(self.graphql_client.clone()).await
1060    }
1061    /// Block until this message is answered, and return the answer: an explicit reply (a send whose replyTo names this message), or the final reply of the turn that consumed it, whichever comes first.
1062    /// Idempotent: cancel and request the response again freely; concurrent waiters share the result.
1063    /// Fails if the agent stops before the message resolves. On a failed agent it projects the failure — but the message stays pending, so after a resume consumes it, requesting the response again returns the real reply.
1064    /// Refused when called from inside an agent turn whose wait would deadlock: turns should not block on other agents — send without awaiting, and the reply arrives as a message.
1065    pub async fn response(&self) -> Result<String, DaggerError> {
1066        let query = self.selection.select("response");
1067        query.execute(self.graphql_client.clone()).await
1068    }
1069}
1070impl Node for AgentMessage {
1071    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1072        let query = self.selection.select("id");
1073        let graphql_client = self.graphql_client.clone();
1074        async move { query.execute(graphql_client).await }
1075    }
1076}
1077#[derive(Clone)]
1078pub struct Artifact {
1079    pub proc: Option<Arc<DaggerSessionProc>>,
1080    pub selection: Selection,
1081    pub graphql_client: DynGraphQLClient,
1082}
1083#[derive(Builder, Debug, PartialEq)]
1084pub struct ArtifactUriOpts {
1085    /// Prefix the workspace's Git address and commit: dag://<workspace>@<commit>:<path>. Fails if the artifact has no workspace, or its workspace has no Git address.
1086    #[builder(setter(into, strip_option), default)]
1087    pub absolute: Option<bool>,
1088    /// Include the dimension keys as a query. Without them, the address is a path selector.
1089    #[builder(setter(into, strip_option), default)]
1090    pub dimension_keys: Option<bool>,
1091    /// Include the artifact type in the scheme: dag+container://.
1092    #[builder(setter(into, strip_option), default)]
1093    pub type_assertion: Option<bool>,
1094}
1095impl IntoID<Id> for Artifact {
1096    fn into_id(
1097        self,
1098    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1099        Box::pin(async move { self.id().await })
1100    }
1101}
1102impl Loadable for Artifact {
1103    fn graphql_type() -> &'static str {
1104        "Artifact"
1105    }
1106    fn from_query(
1107        proc: Option<Arc<DaggerSessionProc>>,
1108        selection: Selection,
1109        graphql_client: DynGraphQLClient,
1110    ) -> Self {
1111        Self {
1112            proc,
1113            selection,
1114            graphql_client,
1115        }
1116    }
1117}
1118impl Artifact {
1119    /// A unique identifier for this Artifact.
1120    pub async fn id(&self) -> Result<Id, DaggerError> {
1121        let query = self.selection.select("id");
1122        query.execute(self.graphql_client.clone()).await
1123    }
1124    /// A module load failure, or an empty string if discovery succeeded.
1125    pub async fn load_error(&self) -> Result<String, DaggerError> {
1126        let query = self.selection.select("loadError");
1127        query.execute(self.graphql_client.clone()).await
1128    }
1129    /// The arguments accepted by the artifact field.
1130    pub async fn arguments(&self) -> Result<Vec<FunctionArg>, DaggerError> {
1131        let query = self.selection.select("arguments");
1132        let query = query.select("id");
1133        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1134        Ok(ids
1135            .into_iter()
1136            .map(|id| FunctionArg {
1137                proc: self.proc.clone(),
1138                selection: crate::querybuilder::query()
1139                    .select("node")
1140                    .arg("id", &id.0)
1141                    .inline_fragment("FunctionArg"),
1142                graphql_client: self.graphql_client.clone(),
1143            })
1144            .collect())
1145    }
1146    /// The description of the field that supplies this artifact.
1147    pub async fn description(&self) -> Result<String, DaggerError> {
1148        let query = self.selection.select("description");
1149        query.execute(self.graphql_client.clone()).await
1150    }
1151    /// The artifact's DAG address, such as dag://engine-dev/playground.
1152    ///
1153    /// # Arguments
1154    ///
1155    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1156    pub async fn uri(&self) -> Result<String, DaggerError> {
1157        let query = self.selection.select("uri");
1158        query.execute(self.graphql_client.clone()).await
1159    }
1160    /// The artifact's DAG address, such as dag://engine-dev/playground.
1161    ///
1162    /// # Arguments
1163    ///
1164    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1165    pub async fn uri_opts(&self, opts: ArtifactUriOpts) -> Result<String, DaggerError> {
1166        let mut query = self.selection.select("uri");
1167        if let Some(absolute) = opts.absolute {
1168            query = query.arg("absolute", absolute);
1169        }
1170        if let Some(dimension_keys) = opts.dimension_keys {
1171            query = query.arg("dimensionKeys", dimension_keys);
1172        }
1173        if let Some(type_assertion) = opts.type_assertion {
1174            query = query.arg("typeAssertion", type_assertion);
1175        }
1176        query.execute(self.graphql_client.clone()).await
1177    }
1178    /// The installed module name.
1179    pub async fn module_name(&self) -> Result<String, DaggerError> {
1180        let query = self.selection.select("moduleName");
1181        query.execute(self.graphql_client.clone()).await
1182    }
1183    /// Ordered, literal fields to follow. Entrypoint targets use their shorthand.
1184    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1185        let query = self.selection.select("path");
1186        query.execute(self.graphql_client.clone()).await
1187    }
1188    /// The module name, collection keys, and full path key in the artifact type dimension.
1189    pub async fn dimension_keys(&self) -> Result<Vec<ArtifactDimensionKey>, DaggerError> {
1190        let query = self.selection.select("dimensionKeys");
1191        let query = query.select("id");
1192        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1193        Ok(ids
1194            .into_iter()
1195            .map(|id| ArtifactDimensionKey {
1196                proc: self.proc.clone(),
1197                selection: crate::querybuilder::query()
1198                    .select("node")
1199                    .arg("id", &id.0)
1200                    .inline_fragment("ArtifactDimensionKey"),
1201                graphql_client: self.graphql_client.clone(),
1202            })
1203            .collect())
1204    }
1205    /// The directives carried by this artifact.
1206    pub async fn directives(&self) -> Result<Vec<String>, DaggerError> {
1207        let query = self.selection.select("directives");
1208        query.execute(self.graphql_client.clone()).await
1209    }
1210    /// Evaluate the target in the workspace that supplied this artifact.
1211    ///
1212    /// # Arguments
1213    ///
1214    /// * `arguments` - Field arguments as a JSON object.
1215    pub fn value(&self, arguments: Json) -> NodeClient {
1216        let mut query = self.selection.select("value");
1217        query = query.arg("arguments", arguments);
1218        NodeClient {
1219            proc: self.proc.clone(),
1220            selection: query,
1221            graphql_client: self.graphql_client.clone(),
1222        }
1223    }
1224}
1225impl Node for Artifact {
1226    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1227        let query = self.selection.select("id");
1228        let graphql_client = self.graphql_client.clone();
1229        async move { query.execute(graphql_client).await }
1230    }
1231}
1232#[derive(Clone)]
1233pub struct ArtifactDimension {
1234    pub proc: Option<Arc<DaggerSessionProc>>,
1235    pub selection: Selection,
1236    pub graphql_client: DynGraphQLClient,
1237}
1238impl IntoID<Id> for ArtifactDimension {
1239    fn into_id(
1240        self,
1241    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1242        Box::pin(async move { self.id().await })
1243    }
1244}
1245impl Loadable for ArtifactDimension {
1246    fn graphql_type() -> &'static str {
1247        "ArtifactDimension"
1248    }
1249    fn from_query(
1250        proc: Option<Arc<DaggerSessionProc>>,
1251        selection: Selection,
1252        graphql_client: DynGraphQLClient,
1253    ) -> Self {
1254        Self {
1255            proc,
1256            selection,
1257            graphql_client,
1258        }
1259    }
1260}
1261impl ArtifactDimension {
1262    /// A unique identifier for this ArtifactDimension.
1263    pub async fn id(&self) -> Result<Id, DaggerError> {
1264        let query = self.selection.select("id");
1265        query.execute(self.graphql_client.clone()).await
1266    }
1267    /// How this dimension gets its keys.
1268    pub async fn kind(&self) -> Result<ArtifactDimensionKind, DaggerError> {
1269        let query = self.selection.select("kind");
1270        query.execute(self.graphql_client.clone()).await
1271    }
1272    /// The collection type, or null for a static dimension.
1273    pub async fn collection_type(&self) -> Result<String, DaggerError> {
1274        let query = self.selection.select("collectionType");
1275        query.execute(self.graphql_client.clone()).await
1276    }
1277    /// Stable identifier: collection schema path, type:TypeName for an artifact type, or module.
1278    pub async fn identifier(&self) -> Result<String, DaggerError> {
1279        let query = self.selection.select("identifier");
1280        query.execute(self.graphql_client.clone()).await
1281    }
1282    /// Short name used to select this dimension.
1283    pub async fn name(&self) -> Result<String, DaggerError> {
1284        let query = self.selection.select("name");
1285        query.execute(self.graphql_client.clone()).await
1286    }
1287    /// Qualified name used when the short name is ambiguous.
1288    pub async fn qualified_name(&self) -> Result<String, DaggerError> {
1289        let query = self.selection.select("qualifiedName");
1290        query.execute(self.graphql_client.clone()).await
1291    }
1292    /// The collection item or artifact type name, or empty for the module dimension.
1293    pub async fn item_type(&self) -> Result<String, DaggerError> {
1294        let query = self.selection.select("itemType");
1295        query.execute(self.graphql_client.clone()).await
1296    }
1297    /// The collection key argument name, or name for a static dimension.
1298    pub async fn key_name(&self) -> Result<String, DaggerError> {
1299        let query = self.selection.select("keyName");
1300        query.execute(self.graphql_client.clone()).await
1301    }
1302    /// The collection key argument description, or empty for a static dimension.
1303    pub async fn key_description(&self) -> Result<String, DaggerError> {
1304        let query = self.selection.select("keyDescription");
1305        query.execute(self.graphql_client.clone()).await
1306    }
1307}
1308impl Node for ArtifactDimension {
1309    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1310        let query = self.selection.select("id");
1311        let graphql_client = self.graphql_client.clone();
1312        async move { query.execute(graphql_client).await }
1313    }
1314}
1315#[derive(Clone)]
1316pub struct ArtifactDimensionKey {
1317    pub proc: Option<Arc<DaggerSessionProc>>,
1318    pub selection: Selection,
1319    pub graphql_client: DynGraphQLClient,
1320}
1321impl IntoID<Id> for ArtifactDimensionKey {
1322    fn into_id(
1323        self,
1324    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1325        Box::pin(async move { self.id().await })
1326    }
1327}
1328impl Loadable for ArtifactDimensionKey {
1329    fn graphql_type() -> &'static str {
1330        "ArtifactDimensionKey"
1331    }
1332    fn from_query(
1333        proc: Option<Arc<DaggerSessionProc>>,
1334        selection: Selection,
1335        graphql_client: DynGraphQLClient,
1336    ) -> Self {
1337        Self {
1338            proc,
1339            selection,
1340            graphql_client,
1341        }
1342    }
1343}
1344impl ArtifactDimensionKey {
1345    /// A unique identifier for this ArtifactDimensionKey.
1346    pub async fn id(&self) -> Result<Id, DaggerError> {
1347        let query = self.selection.select("id");
1348        query.execute(self.graphql_client.clone()).await
1349    }
1350    /// The dimension identifier, fixed across the workspace schema.
1351    pub async fn dimension(&self) -> Result<String, DaggerError> {
1352        let query = self.selection.select("dimension");
1353        query.execute(self.graphql_client.clone()).await
1354    }
1355    /// The dimension item's key.
1356    pub async fn key(&self) -> Result<String, DaggerError> {
1357        let query = self.selection.select("key");
1358        query.execute(self.graphql_client.clone()).await
1359    }
1360}
1361impl Node for ArtifactDimensionKey {
1362    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1363        let query = self.selection.select("id");
1364        let graphql_client = self.graphql_client.clone();
1365        async move { query.execute(graphql_client).await }
1366    }
1367}
1368#[derive(Clone)]
1369pub struct ArtifactPath {
1370    pub proc: Option<Arc<DaggerSessionProc>>,
1371    pub selection: Selection,
1372    pub graphql_client: DynGraphQLClient,
1373}
1374impl IntoID<Id> for ArtifactPath {
1375    fn into_id(
1376        self,
1377    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1378        Box::pin(async move { self.id().await })
1379    }
1380}
1381impl Loadable for ArtifactPath {
1382    fn graphql_type() -> &'static str {
1383        "ArtifactPath"
1384    }
1385    fn from_query(
1386        proc: Option<Arc<DaggerSessionProc>>,
1387        selection: Selection,
1388        graphql_client: DynGraphQLClient,
1389    ) -> Self {
1390        Self {
1391            proc,
1392            selection,
1393            graphql_client,
1394        }
1395    }
1396}
1397impl ArtifactPath {
1398    /// A unique identifier for this ArtifactPath.
1399    pub async fn id(&self) -> Result<Id, DaggerError> {
1400        let query = self.selection.select("id");
1401        query.execute(self.graphql_client.clone()).await
1402    }
1403    /// The installed module name.
1404    pub async fn module_name(&self) -> Result<String, DaggerError> {
1405        let query = self.selection.select("moduleName");
1406        query.execute(self.graphql_client.clone()).await
1407    }
1408    /// The DAG address of this path, without dimension keys.
1409    pub async fn uri(&self) -> Result<String, DaggerError> {
1410        let query = self.selection.select("uri");
1411        query.execute(self.graphql_client.clone()).await
1412    }
1413    /// The description of the field at this path.
1414    pub async fn description(&self) -> Result<String, DaggerError> {
1415        let query = self.selection.select("description");
1416        query.execute(self.graphql_client.clone()).await
1417    }
1418    /// A module load failure for this path, or an empty string.
1419    pub async fn load_error(&self) -> Result<String, DaggerError> {
1420        let query = self.selection.select("loadError");
1421        query.execute(self.graphql_client.clone()).await
1422    }
1423    /// The dimension identifiers required by this path.
1424    pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
1425        let query = self.selection.select("dimensions");
1426        query.execute(self.graphql_client.clone()).await
1427    }
1428}
1429impl Node for ArtifactPath {
1430    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1431        let query = self.selection.select("id");
1432        let graphql_client = self.graphql_client.clone();
1433        async move { query.execute(graphql_client).await }
1434    }
1435}
1436#[derive(Clone)]
1437pub struct ArtifactResult {
1438    pub proc: Option<Arc<DaggerSessionProc>>,
1439    pub selection: Selection,
1440    pub graphql_client: DynGraphQLClient,
1441}
1442impl IntoID<Id> for ArtifactResult {
1443    fn into_id(
1444        self,
1445    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1446        Box::pin(async move { self.id().await })
1447    }
1448}
1449impl Loadable for ArtifactResult {
1450    fn graphql_type() -> &'static str {
1451        "ArtifactResult"
1452    }
1453    fn from_query(
1454        proc: Option<Arc<DaggerSessionProc>>,
1455        selection: Selection,
1456        graphql_client: DynGraphQLClient,
1457    ) -> Self {
1458        Self {
1459            proc,
1460            selection,
1461            graphql_client,
1462        }
1463    }
1464}
1465impl ArtifactResult {
1466    /// A unique identifier for this ArtifactResult.
1467    pub async fn id(&self) -> Result<Id, DaggerError> {
1468        let query = self.selection.select("id");
1469        query.execute(self.graphql_client.clone()).await
1470    }
1471    /// The artifact that was evaluated.
1472    pub fn artifact(&self) -> Artifact {
1473        let query = self.selection.select("artifact");
1474        Artifact {
1475            proc: self.proc.clone(),
1476            selection: query,
1477            graphql_client: self.graphql_client.clone(),
1478        }
1479    }
1480    /// The evaluation failure, if any.
1481    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1482        let query = self.selection.select("error");
1483        let query = query.select("id");
1484        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1485        Ok(id.map(|id| Error {
1486            proc: self.proc.clone(),
1487            selection: query
1488                .root()
1489                .select("node")
1490                .arg("id", &id.0)
1491                .inline_fragment("Error"),
1492            graphql_client: self.graphql_client.clone(),
1493        }))
1494    }
1495    /// The evaluated value, or null when evaluation failed.
1496    pub async fn value(&self) -> Result<Option<NodeClient>, DaggerError> {
1497        let query = self.selection.select("value");
1498        let query = query.select("id");
1499        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1500        Ok(id.map(|id| NodeClient {
1501            proc: self.proc.clone(),
1502            selection: query
1503                .root()
1504                .select("node")
1505                .arg("id", &id.0)
1506                .inline_fragment("Node"),
1507            graphql_client: self.graphql_client.clone(),
1508        }))
1509    }
1510}
1511impl Node for ArtifactResult {
1512    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1513        let query = self.selection.select("id");
1514        let graphql_client = self.graphql_client.clone();
1515        async move { query.execute(graphql_client).await }
1516    }
1517}
1518#[derive(Clone)]
1519pub struct Artifacts {
1520    pub proc: Option<Arc<DaggerSessionProc>>,
1521    pub selection: Selection,
1522    pub graphql_client: DynGraphQLClient,
1523}
1524#[derive(Builder, Debug, PartialEq)]
1525pub struct ArtifactsPathDefinitionsOpts<'a> {
1526    /// Prefix each address with the workspace's Git address and commit.
1527    #[builder(setter(into, strip_option), default)]
1528    pub absolute: Option<bool>,
1529    /// Project paths to the items of this collection dimension. Preserve parent dimensions and remove descendant dimensions.
1530    #[builder(setter(into, strip_option), default)]
1531    pub dimension: Option<&'a str>,
1532    /// Include the artifact type in each address scheme.
1533    #[builder(setter(into, strip_option), default)]
1534    pub type_assertion: Option<bool>,
1535}
1536#[derive(Builder, Debug, PartialEq)]
1537pub struct ArtifactsValuesOpts {
1538    /// Field arguments applied to each artifact, as a JSON object.
1539    #[builder(setter(into, strip_option), default)]
1540    pub arguments: Option<Json>,
1541    /// Cancel remaining work after the first failure.
1542    #[builder(setter(into, strip_option), default)]
1543    pub fail_fast: Option<bool>,
1544    /// Evaluate at most this many artifacts at once on this engine; the rest wait. Checks that scale out to cloud engines are not counted. 0 means no limit.
1545    #[builder(setter(into, strip_option), default)]
1546    pub max_concurrency: Option<isize>,
1547}
1548#[derive(Builder, Debug, PartialEq)]
1549pub struct ArtifactsFilterDirectivesOpts {
1550    /// Remove the matching artifacts instead.
1551    #[builder(setter(into, strip_option), default)]
1552    pub exclude: Option<bool>,
1553}
1554#[derive(Builder, Debug, PartialEq)]
1555pub struct ArtifactsFilterParentTypesOpts {
1556    /// Remove the matching artifacts instead.
1557    #[builder(setter(into, strip_option), default)]
1558    pub exclude: Option<bool>,
1559}
1560#[derive(Builder, Debug, PartialEq)]
1561pub struct ArtifactsFilterParentDirectivesOpts {
1562    /// Remove the matching artifacts instead.
1563    #[builder(setter(into, strip_option), default)]
1564    pub exclude: Option<bool>,
1565}
1566#[derive(Builder, Debug, PartialEq)]
1567pub struct ArtifactsFilterTypesOpts {
1568    /// Remove the matching artifacts instead.
1569    #[builder(setter(into, strip_option), default)]
1570    pub exclude: Option<bool>,
1571}
1572impl IntoID<Id> for Artifacts {
1573    fn into_id(
1574        self,
1575    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1576        Box::pin(async move { self.id().await })
1577    }
1578}
1579impl Loadable for Artifacts {
1580    fn graphql_type() -> &'static str {
1581        "Artifacts"
1582    }
1583    fn from_query(
1584        proc: Option<Arc<DaggerSessionProc>>,
1585        selection: Selection,
1586        graphql_client: DynGraphQLClient,
1587    ) -> Self {
1588        Self {
1589            proc,
1590            selection,
1591            graphql_client,
1592        }
1593    }
1594}
1595impl Artifacts {
1596    /// A unique identifier for this Artifacts.
1597    pub async fn id(&self) -> Result<Id, DaggerError> {
1598        let query = self.selection.select("id");
1599        query.execute(self.graphql_client.clone()).await
1600    }
1601    /// Convert the selection to expertise without running the functions. Fail if any artifact is not a source of expertise.
1602    pub async fn as_expertise(&self) -> Result<Vec<Expertise>, DaggerError> {
1603        let query = self.selection.select("asExpertise");
1604        let query = query.select("id");
1605        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1606        Ok(ids
1607            .into_iter()
1608            .map(|id| Expertise {
1609                proc: self.proc.clone(),
1610                selection: crate::querybuilder::query()
1611                    .select("node")
1612                    .arg("id", &id.0)
1613                    .inline_fragment("Expertise"),
1614                graphql_client: self.graphql_client.clone(),
1615            })
1616            .collect())
1617    }
1618    /// Convert the selection to Generators without running them. Fail if any artifact is not a Generator.
1619    pub async fn as_generators(&self) -> Result<Vec<Generator>, DaggerError> {
1620        let query = self.selection.select("asGenerators");
1621        let query = query.select("id");
1622        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1623        Ok(ids
1624            .into_iter()
1625            .map(|id| Generator {
1626                proc: self.proc.clone(),
1627                selection: crate::querybuilder::query()
1628                    .select("node")
1629                    .arg("id", &id.0)
1630                    .inline_fragment("Generator"),
1631                graphql_client: self.graphql_client.clone(),
1632            })
1633            .collect())
1634    }
1635    /// Convert the selection to Checks. Fail if any artifact is not a Check. Does not apply command filters or run the checks.
1636    pub async fn as_checks(&self) -> Result<Vec<Check>, DaggerError> {
1637        let query = self.selection.select("asChecks");
1638        let query = query.select("id");
1639        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1640        Ok(ids
1641            .into_iter()
1642            .map(|id| Check {
1643                proc: self.proc.clone(),
1644                selection: crate::querybuilder::query()
1645                    .select("node")
1646                    .arg("id", &id.0)
1647                    .inline_fragment("Check"),
1648                graphql_client: self.graphql_client.clone(),
1649            })
1650            .collect())
1651    }
1652    /// Convert the selection to Changesets. Fail if any artifact is not a Changeset. Does not apply command filters.
1653    pub async fn as_changesets(&self) -> Result<Vec<Changeset>, DaggerError> {
1654        let query = self.selection.select("asChangesets");
1655        let query = query.select("id");
1656        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1657        Ok(ids
1658            .into_iter()
1659            .map(|id| Changeset {
1660                proc: self.proc.clone(),
1661                selection: crate::querybuilder::query()
1662                    .select("node")
1663                    .arg("id", &id.0)
1664                    .inline_fragment("Changeset"),
1665                graphql_client: self.graphql_client.clone(),
1666            })
1667            .collect())
1668    }
1669    /// Convert the selection to Services. Fail if any artifact is not a Service. Does not apply command filters or start the services.
1670    pub async fn as_services(&self) -> Result<Vec<Service>, DaggerError> {
1671        let query = self.selection.select("asServices");
1672        let query = query.select("id");
1673        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1674        Ok(ids
1675            .into_iter()
1676            .map(|id| Service {
1677                proc: self.proc.clone(),
1678                selection: crate::querybuilder::query()
1679                    .select("node")
1680                    .arg("id", &id.0)
1681                    .inline_fragment("Service"),
1682                graphql_client: self.graphql_client.clone(),
1683            })
1684            .collect())
1685    }
1686    /// List selected schema paths, including empty collections. Does not read runtime values. Applies type keys and collection presence; collection key values require items.
1687    ///
1688    /// # Arguments
1689    ///
1690    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1691    pub async fn path_definitions(&self) -> Result<Vec<ArtifactPath>, DaggerError> {
1692        let query = self.selection.select("pathDefinitions");
1693        let query = query.select("id");
1694        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1695        Ok(ids
1696            .into_iter()
1697            .map(|id| ArtifactPath {
1698                proc: self.proc.clone(),
1699                selection: crate::querybuilder::query()
1700                    .select("node")
1701                    .arg("id", &id.0)
1702                    .inline_fragment("ArtifactPath"),
1703                graphql_client: self.graphql_client.clone(),
1704            })
1705            .collect())
1706    }
1707    /// List selected schema paths, including empty collections. Does not read runtime values. Applies type keys and collection presence; collection key values require items.
1708    ///
1709    /// # Arguments
1710    ///
1711    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1712    pub async fn path_definitions_opts<'a>(
1713        &self,
1714        opts: ArtifactsPathDefinitionsOpts<'a>,
1715    ) -> Result<Vec<ArtifactPath>, DaggerError> {
1716        let mut query = self.selection.select("pathDefinitions");
1717        if let Some(absolute) = opts.absolute {
1718            query = query.arg("absolute", absolute);
1719        }
1720        if let Some(type_assertion) = opts.type_assertion {
1721            query = query.arg("typeAssertion", type_assertion);
1722        }
1723        if let Some(dimension) = opts.dimension {
1724            query = query.arg("dimension", dimension);
1725        }
1726        let query = query.select("id");
1727        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1728        Ok(ids
1729            .into_iter()
1730            .map(|id| ArtifactPath {
1731                proc: self.proc.clone(),
1732                selection: crate::querybuilder::query()
1733                    .select("node")
1734                    .arg("id", &id.0)
1735                    .inline_fragment("ArtifactPath"),
1736                graphql_client: self.graphql_client.clone(),
1737            })
1738            .collect())
1739    }
1740    /// List dimensions on the selected schema paths, including empty collections. Does not read runtime values.
1741    pub async fn dimension_definitions(&self) -> Result<Vec<ArtifactDimension>, DaggerError> {
1742        let query = self.selection.select("dimensionDefinitions");
1743        let query = query.select("id");
1744        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1745        Ok(ids
1746            .into_iter()
1747            .map(|id| ArtifactDimension {
1748                proc: self.proc.clone(),
1749                selection: crate::querybuilder::query()
1750                    .select("node")
1751                    .arg("id", &id.0)
1752                    .inline_fragment("ArtifactDimension"),
1753                graphql_client: self.graphql_client.clone(),
1754            })
1755            .collect())
1756    }
1757    /// Evaluate the selection in parallel, retaining each result and error.
1758    ///
1759    /// # Arguments
1760    ///
1761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1762    pub async fn values(&self) -> Result<Vec<ArtifactResult>, DaggerError> {
1763        let query = self.selection.select("values");
1764        let query = query.select("id");
1765        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1766        Ok(ids
1767            .into_iter()
1768            .map(|id| ArtifactResult {
1769                proc: self.proc.clone(),
1770                selection: crate::querybuilder::query()
1771                    .select("node")
1772                    .arg("id", &id.0)
1773                    .inline_fragment("ArtifactResult"),
1774                graphql_client: self.graphql_client.clone(),
1775            })
1776            .collect())
1777    }
1778    /// Evaluate the selection in parallel, retaining each result and error.
1779    ///
1780    /// # Arguments
1781    ///
1782    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1783    pub async fn values_opts(
1784        &self,
1785        opts: ArtifactsValuesOpts,
1786    ) -> Result<Vec<ArtifactResult>, DaggerError> {
1787        let mut query = self.selection.select("values");
1788        if let Some(fail_fast) = opts.fail_fast {
1789            query = query.arg("failFast", fail_fast);
1790        }
1791        if let Some(arguments) = opts.arguments {
1792            query = query.arg("arguments", arguments);
1793        }
1794        if let Some(max_concurrency) = opts.max_concurrency {
1795            query = query.arg("maxConcurrency", max_concurrency);
1796        }
1797        let query = query.select("id");
1798        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1799        Ok(ids
1800            .into_iter()
1801            .map(|id| ArtifactResult {
1802                proc: self.proc.clone(),
1803                selection: crate::querybuilder::query()
1804                    .select("node")
1805                    .arg("id", &id.0)
1806                    .inline_fragment("ArtifactResult"),
1807                graphql_client: self.graphql_client.clone(),
1808            })
1809            .collect())
1810    }
1811    /// List the modules represented in this selection without evaluating artifact values.
1812    pub async fn modules(&self) -> Result<Vec<Module>, DaggerError> {
1813        let query = self.selection.select("modules");
1814        let query = query.select("id");
1815        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1816        Ok(ids
1817            .into_iter()
1818            .map(|id| Module {
1819                proc: self.proc.clone(),
1820                selection: crate::querybuilder::query()
1821                    .select("node")
1822                    .arg("id", &id.0)
1823                    .inline_fragment("Module"),
1824                graphql_client: self.graphql_client.clone(),
1825            })
1826            .collect())
1827    }
1828    /// List concrete type definitions represented in this selection, sorted by name with no duplicates.
1829    pub async fn types(&self) -> Result<Vec<TypeDef>, DaggerError> {
1830        let query = self.selection.select("types");
1831        let query = query.select("id");
1832        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1833        Ok(ids
1834            .into_iter()
1835            .map(|id| TypeDef {
1836                proc: self.proc.clone(),
1837                selection: crate::querybuilder::query()
1838                    .select("node")
1839                    .arg("id", &id.0)
1840                    .inline_fragment("TypeDef"),
1841                graphql_client: self.graphql_client.clone(),
1842            })
1843            .collect())
1844    }
1845    /// Keep artifacts with any listed directive. Does not filter by type or workspace settings.
1846    ///
1847    /// # Arguments
1848    ///
1849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1850    pub fn filter_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1851        let mut query = self.selection.select("filterDirectives");
1852        query = query.arg(
1853            "directives",
1854            directives
1855                .into_iter()
1856                .map(|i| i.into())
1857                .collect::<Vec<String>>(),
1858        );
1859        Artifacts {
1860            proc: self.proc.clone(),
1861            selection: query,
1862            graphql_client: self.graphql_client.clone(),
1863        }
1864    }
1865    /// Keep artifacts with any listed directive. Does not filter by type or workspace settings.
1866    ///
1867    /// # Arguments
1868    ///
1869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1870    pub fn filter_directives_opts(
1871        &self,
1872        directives: Vec<impl Into<String>>,
1873        opts: ArtifactsFilterDirectivesOpts,
1874    ) -> Artifacts {
1875        let mut query = self.selection.select("filterDirectives");
1876        query = query.arg(
1877            "directives",
1878            directives
1879                .into_iter()
1880                .map(|i| i.into())
1881                .collect::<Vec<String>>(),
1882        );
1883        if let Some(exclude) = opts.exclude {
1884            query = query.arg("exclude", exclude);
1885        }
1886        Artifacts {
1887            proc: self.proc.clone(),
1888            selection: query,
1889            graphql_client: self.graphql_client.clone(),
1890        }
1891    }
1892    /// Keep artifacts whose immediate parent has any listed object type. Artifacts without a typed parent do not match.
1893    ///
1894    /// # Arguments
1895    ///
1896    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1897    pub fn filter_parent_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
1898        let mut query = self.selection.select("filterParentTypes");
1899        query = query.arg(
1900            "types",
1901            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1902        );
1903        Artifacts {
1904            proc: self.proc.clone(),
1905            selection: query,
1906            graphql_client: self.graphql_client.clone(),
1907        }
1908    }
1909    /// Keep artifacts whose immediate parent has any listed object type. Artifacts without a typed parent do not match.
1910    ///
1911    /// # Arguments
1912    ///
1913    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1914    pub fn filter_parent_types_opts(
1915        &self,
1916        types: Vec<impl Into<String>>,
1917        opts: ArtifactsFilterParentTypesOpts,
1918    ) -> Artifacts {
1919        let mut query = self.selection.select("filterParentTypes");
1920        query = query.arg(
1921            "types",
1922            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1923        );
1924        if let Some(exclude) = opts.exclude {
1925            query = query.arg("exclude", exclude);
1926        }
1927        Artifacts {
1928            proc: self.proc.clone(),
1929            selection: query,
1930            graphql_client: self.graphql_client.clone(),
1931        }
1932    }
1933    /// Keep artifacts whose immediate parent has any listed directive. Artifacts without a parent do not match.
1934    ///
1935    /// # Arguments
1936    ///
1937    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1938    pub fn filter_parent_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1939        let mut query = self.selection.select("filterParentDirectives");
1940        query = query.arg(
1941            "directives",
1942            directives
1943                .into_iter()
1944                .map(|i| i.into())
1945                .collect::<Vec<String>>(),
1946        );
1947        Artifacts {
1948            proc: self.proc.clone(),
1949            selection: query,
1950            graphql_client: self.graphql_client.clone(),
1951        }
1952    }
1953    /// Keep artifacts whose immediate parent has any listed directive. Artifacts without a parent do not match.
1954    ///
1955    /// # Arguments
1956    ///
1957    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1958    pub fn filter_parent_directives_opts(
1959        &self,
1960        directives: Vec<impl Into<String>>,
1961        opts: ArtifactsFilterParentDirectivesOpts,
1962    ) -> Artifacts {
1963        let mut query = self.selection.select("filterParentDirectives");
1964        query = query.arg(
1965            "directives",
1966            directives
1967                .into_iter()
1968                .map(|i| i.into())
1969                .collect::<Vec<String>>(),
1970        );
1971        if let Some(exclude) = opts.exclude {
1972            query = query.arg("exclude", exclude);
1973        }
1974        Artifacts {
1975            proc: self.proc.clone(),
1976            selection: query,
1977            graphql_client: self.graphql_client.clone(),
1978        }
1979    }
1980    /// Combine two selections, keeping each workspace address once. Different addresses remain distinct even if they return the same object.
1981    pub fn with_artifacts(&self, artifacts: impl IntoID<Id>) -> Artifacts {
1982        let mut query = self.selection.select("withArtifacts");
1983        query = query.arg_lazy(
1984            "artifacts",
1985            Box::new(move || {
1986                let artifacts = artifacts.clone();
1987                Box::pin(async move { artifacts.into_id().await.unwrap().quote() })
1988            }),
1989        );
1990        Artifacts {
1991            proc: self.proc.clone(),
1992            selection: query,
1993            graphql_client: self.graphql_client.clone(),
1994        }
1995    }
1996    /// Remove artifacts selected by a DAG address.
1997    pub fn without_uri(&self, uri: impl Into<String>) -> Artifacts {
1998        let mut query = self.selection.select("withoutUri");
1999        query = query.arg("uri", uri.into());
2000        Artifacts {
2001            proc: self.proc.clone(),
2002            selection: query,
2003            graphql_client: self.graphql_client.clone(),
2004        }
2005    }
2006    /// Keep artifacts of any listed concrete GraphQL type.
2007    ///
2008    /// # Arguments
2009    ///
2010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2011    pub fn filter_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
2012        let mut query = self.selection.select("filterTypes");
2013        query = query.arg(
2014            "types",
2015            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2016        );
2017        Artifacts {
2018            proc: self.proc.clone(),
2019            selection: query,
2020            graphql_client: self.graphql_client.clone(),
2021        }
2022    }
2023    /// Keep artifacts of any listed concrete GraphQL type.
2024    ///
2025    /// # Arguments
2026    ///
2027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2028    pub fn filter_types_opts(
2029        &self,
2030        types: Vec<impl Into<String>>,
2031        opts: ArtifactsFilterTypesOpts,
2032    ) -> Artifacts {
2033        let mut query = self.selection.select("filterTypes");
2034        query = query.arg(
2035            "types",
2036            types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2037        );
2038        if let Some(exclude) = opts.exclude {
2039            query = query.arg("exclude", exclude);
2040        }
2041        Artifacts {
2042            proc: self.proc.clone(),
2043            selection: query,
2044            graphql_client: self.graphql_client.clone(),
2045        }
2046    }
2047    /// Match one complete, ordered field sequence exactly.
2048    pub fn filter_path(&self, path: Vec<impl Into<String>>) -> Artifacts {
2049        let mut query = self.selection.select("filterPath");
2050        query = query.arg(
2051            "path",
2052            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2053        );
2054        Artifacts {
2055            proc: self.proc.clone(),
2056            selection: query,
2057            graphql_client: self.graphql_client.clone(),
2058        }
2059    }
2060    /// Keep paths that match a glob pattern. A literal path matches exactly. Both module-qualified and entrypoint paths match.
2061    pub fn filter_path_pattern(&self, pattern: impl Into<String>) -> Artifacts {
2062        let mut query = self.selection.select("filterPathPattern");
2063        query = query.arg("pattern", pattern.into());
2064        Artifacts {
2065            proc: self.proc.clone(),
2066            selection: query,
2067            graphql_client: self.graphql_client.clone(),
2068        }
2069    }
2070    /// Keep artifacts selected through any listed dimension.
2071    pub fn filter_dimensions(&self, dimensions: Vec<impl Into<String>>) -> Artifacts {
2072        let mut query = self.selection.select("filterDimensions");
2073        query = query.arg(
2074            "dimensions",
2075            dimensions
2076                .into_iter()
2077                .map(|i| i.into())
2078                .collect::<Vec<String>>(),
2079        );
2080        Artifacts {
2081            proc: self.proc.clone(),
2082            selection: query,
2083            graphql_client: self.graphql_client.clone(),
2084        }
2085    }
2086    /// Keep artifacts with any listed key in this dimension.
2087    pub fn filter_dimension_keys(
2088        &self,
2089        dimension: impl Into<String>,
2090        keys: Vec<impl Into<String>>,
2091    ) -> Artifacts {
2092        let mut query = self.selection.select("filterDimensionKeys");
2093        query = query.arg("dimension", dimension.into());
2094        query = query.arg(
2095            "keys",
2096            keys.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2097        );
2098        Artifacts {
2099            proc: self.proc.clone(),
2100            selection: query,
2101            graphql_client: self.graphql_client.clone(),
2102        }
2103    }
2104    /// Apply a DAG address as one filter: the chain of path, type, and dimension-key filters it encodes.
2105    /// The scheme is optional. The path may be a pattern; an empty path selects all artifacts.
2106    ///
2107    /// # Arguments
2108    ///
2109    /// * `uri` - A DAG address: [dag[+<type>]://][<path>][?<dimension>=<key>&...]
2110    pub fn filter_uri(&self, uri: impl Into<String>) -> Artifacts {
2111        let mut query = self.selection.select("filterUri");
2112        query = query.arg("uri", uri.into());
2113        Artifacts {
2114            proc: self.proc.clone(),
2115            selection: query,
2116            graphql_client: self.graphql_client.clone(),
2117        }
2118    }
2119    /// List dimension identifiers represented in this selection, sorted with no duplicates.
2120    pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
2121        let query = self.selection.select("dimensions");
2122        query.execute(self.graphql_client.clone()).await
2123    }
2124    /// List keys represented in this selection for the given dimension, sorted with no duplicates.
2125    pub async fn dimension_keys(
2126        &self,
2127        dimension: impl Into<String>,
2128    ) -> Result<Vec<String>, DaggerError> {
2129        let mut query = self.selection.select("dimensionKeys");
2130        query = query.arg("dimension", dimension.into());
2131        query.execute(self.graphql_client.clone()).await
2132    }
2133    /// List collection items represented in this selection for the given dimension. Preserve parent keys and remove duplicate item addresses. Does not evaluate item values.
2134    pub async fn dimension_items(
2135        &self,
2136        dimension: impl Into<String>,
2137    ) -> Result<Vec<Artifact>, DaggerError> {
2138        let mut query = self.selection.select("dimensionItems");
2139        query = query.arg("dimension", dimension.into());
2140        let query = query.select("id");
2141        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2142        Ok(ids
2143            .into_iter()
2144            .map(|id| Artifact {
2145                proc: self.proc.clone(),
2146                selection: crate::querybuilder::query()
2147                    .select("node")
2148                    .arg("id", &id.0)
2149                    .inline_fragment("Artifact"),
2150                graphql_client: self.graphql_client.clone(),
2151            })
2152            .collect())
2153    }
2154    /// Enumerate complete artifacts without evaluating their values.
2155    pub async fn items(&self) -> Result<Vec<Artifact>, DaggerError> {
2156        let query = self.selection.select("items");
2157        let query = query.select("id");
2158        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2159        Ok(ids
2160            .into_iter()
2161            .map(|id| Artifact {
2162                proc: self.proc.clone(),
2163                selection: crate::querybuilder::query()
2164                    .select("node")
2165                    .arg("id", &id.0)
2166                    .inline_fragment("Artifact"),
2167                graphql_client: self.graphql_client.clone(),
2168            })
2169            .collect())
2170    }
2171    /// Require exactly one artifact; fail if there are zero or multiple matches. Several matches are listed, one address per line.
2172    pub fn one(&self) -> Artifact {
2173        let query = self.selection.select("one");
2174        Artifact {
2175            proc: self.proc.clone(),
2176            selection: query,
2177            graphql_client: self.graphql_client.clone(),
2178        }
2179    }
2180    /// The DAG address that selects this whole selection: filterUri(uri) selects the same set.
2181    pub async fn uri(&self) -> Result<String, DaggerError> {
2182        let query = self.selection.select("uri");
2183        query.execute(self.graphql_client.clone()).await
2184    }
2185}
2186impl Node for Artifacts {
2187    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2188        let query = self.selection.select("id");
2189        let graphql_client = self.graphql_client.clone();
2190        async move { query.execute(graphql_client).await }
2191    }
2192}
2193#[derive(Clone)]
2194pub struct CacheVolume {
2195    pub proc: Option<Arc<DaggerSessionProc>>,
2196    pub selection: Selection,
2197    pub graphql_client: DynGraphQLClient,
2198}
2199impl IntoID<Id> for CacheVolume {
2200    fn into_id(
2201        self,
2202    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2203        Box::pin(async move { self.id().await })
2204    }
2205}
2206impl Loadable for CacheVolume {
2207    fn graphql_type() -> &'static str {
2208        "CacheVolume"
2209    }
2210    fn from_query(
2211        proc: Option<Arc<DaggerSessionProc>>,
2212        selection: Selection,
2213        graphql_client: DynGraphQLClient,
2214    ) -> Self {
2215        Self {
2216            proc,
2217            selection,
2218            graphql_client,
2219        }
2220    }
2221}
2222impl CacheVolume {
2223    /// A unique identifier for this CacheVolume.
2224    pub async fn id(&self) -> Result<Id, DaggerError> {
2225        let query = self.selection.select("id");
2226        query.execute(self.graphql_client.clone()).await
2227    }
2228}
2229impl Node for CacheVolume {
2230    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2231        let query = self.selection.select("id");
2232        let graphql_client = self.graphql_client.clone();
2233        async move { query.execute(graphql_client).await }
2234    }
2235}
2236#[derive(Clone)]
2237pub struct Changeset {
2238    pub proc: Option<Arc<DaggerSessionProc>>,
2239    pub selection: Selection,
2240    pub graphql_client: DynGraphQLClient,
2241}
2242#[derive(Builder, Debug, PartialEq)]
2243pub struct ChangesetFilterOpts<'a> {
2244    /// Exclude changes at paths matching these patterns.
2245    #[builder(setter(into, strip_option), default)]
2246    pub exclude: Option<Vec<&'a str>>,
2247    /// Only include changes at paths matching these patterns. Empty includes all paths.
2248    #[builder(setter(into, strip_option), default)]
2249    pub include: Option<Vec<&'a str>>,
2250}
2251#[derive(Builder, Debug, PartialEq)]
2252pub struct ChangesetWithChangesetOpts {
2253    /// What to do on a merge conflict
2254    #[builder(setter(into, strip_option), default)]
2255    pub on_conflict: Option<ChangesetMergeConflict>,
2256}
2257#[derive(Builder, Debug, PartialEq)]
2258pub struct ChangesetWithChangesetsOpts {
2259    /// What to do on a merge conflict
2260    #[builder(setter(into, strip_option), default)]
2261    pub on_conflict: Option<ChangesetsMergeConflict>,
2262}
2263impl IntoID<Id> for Changeset {
2264    fn into_id(
2265        self,
2266    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2267        Box::pin(async move { self.id().await })
2268    }
2269}
2270impl Loadable for Changeset {
2271    fn graphql_type() -> &'static str {
2272        "Changeset"
2273    }
2274    fn from_query(
2275        proc: Option<Arc<DaggerSessionProc>>,
2276        selection: Selection,
2277        graphql_client: DynGraphQLClient,
2278    ) -> Self {
2279        Self {
2280            proc,
2281            selection,
2282            graphql_client,
2283        }
2284    }
2285}
2286impl Changeset {
2287    /// A unique identifier for this Changeset.
2288    pub async fn id(&self) -> Result<Id, DaggerError> {
2289        let query = self.selection.select("id");
2290        query.execute(self.graphql_client.clone()).await
2291    }
2292    /// Force evaluation in the engine.
2293    pub async fn sync(&self) -> Result<Changeset, DaggerError> {
2294        let query = self.selection.select("sync");
2295        let id: Id = query.execute(self.graphql_client.clone()).await?;
2296        Ok(Changeset {
2297            proc: self.proc.clone(),
2298            selection: query
2299                .root()
2300                .select("node")
2301                .arg("id", &id.0)
2302                .inline_fragment("Changeset"),
2303            graphql_client: self.graphql_client.clone(),
2304        })
2305    }
2306    /// Select changes matching the supplied glob patterns, preserving their original baseline.
2307    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
2308    ///
2309    /// # Arguments
2310    ///
2311    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2312    pub fn filter(&self) -> Changeset {
2313        let query = self.selection.select("filter");
2314        Changeset {
2315            proc: self.proc.clone(),
2316            selection: query,
2317            graphql_client: self.graphql_client.clone(),
2318        }
2319    }
2320    /// Select changes matching the supplied glob patterns, preserving their original baseline.
2321    /// Includes additions, modifications, and deletions. Selecting only one side of a rename yields an addition or deletion.
2322    ///
2323    /// # Arguments
2324    ///
2325    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2326    pub fn filter_opts<'a>(&self, opts: ChangesetFilterOpts<'a>) -> Changeset {
2327        let mut query = self.selection.select("filter");
2328        if let Some(include) = opts.include {
2329            query = query.arg("include", include);
2330        }
2331        if let Some(exclude) = opts.exclude {
2332            query = query.arg("exclude", exclude);
2333        }
2334        Changeset {
2335            proc: self.proc.clone(),
2336            selection: query,
2337            graphql_client: self.graphql_client.clone(),
2338        }
2339    }
2340    /// Return a snapshot containing only the created and modified files
2341    pub fn layer(&self) -> Directory {
2342        let query = self.selection.select("layer");
2343        Directory {
2344            proc: self.proc.clone(),
2345            selection: query,
2346            graphql_client: self.graphql_client.clone(),
2347        }
2348    }
2349    /// Return a Git-compatible patch of the changes
2350    pub fn as_patch(&self) -> File {
2351        let query = self.selection.select("asPatch");
2352        File {
2353            proc: self.proc.clone(),
2354            selection: query,
2355            graphql_client: self.graphql_client.clone(),
2356        }
2357    }
2358    /// Applies the diff represented by this changeset to a path on the host.
2359    ///
2360    /// # Arguments
2361    ///
2362    /// * `path` - Location of the copied directory (e.g., "logs/").
2363    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2364        let mut query = self.selection.select("export");
2365        query = query.arg("path", path.into());
2366        query.execute(self.graphql_client.clone()).await
2367    }
2368    /// Returns true if the changeset is empty (i.e. there are no changes).
2369    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2370        let query = self.selection.select("isEmpty");
2371        query.execute(self.graphql_client.clone()).await
2372    }
2373    /// Files and directories that were added in the newer directory.
2374    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2375        let query = self.selection.select("addedPaths");
2376        query.execute(self.graphql_client.clone()).await
2377    }
2378    /// Files and directories that existed before and were updated in the newer directory.
2379    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2380        let query = self.selection.select("modifiedPaths");
2381        query.execute(self.graphql_client.clone()).await
2382    }
2383    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2384    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2385        let query = self.selection.select("removedPaths");
2386        query.execute(self.graphql_client.clone()).await
2387    }
2388    /// Structured per-path diff statistics (kind and line counts) for this changeset.
2389    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
2390        let query = self.selection.select("diffStats");
2391        let query = query.select("id");
2392        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2393        Ok(ids
2394            .into_iter()
2395            .map(|id| DiffStat {
2396                proc: self.proc.clone(),
2397                selection: crate::querybuilder::query()
2398                    .select("node")
2399                    .arg("id", &id.0)
2400                    .inline_fragment("DiffStat"),
2401                graphql_client: self.graphql_client.clone(),
2402            })
2403            .collect())
2404    }
2405    /// Add changes to an existing changeset
2406    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
2407    ///
2408    /// # Arguments
2409    ///
2410    /// * `changes` - Changes to merge into the actual changeset
2411    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2412    pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
2413        let mut query = self.selection.select("withChangeset");
2414        query = query.arg_lazy(
2415            "changes",
2416            Box::new(move || {
2417                let changes = changes.clone();
2418                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2419            }),
2420        );
2421        Changeset {
2422            proc: self.proc.clone(),
2423            selection: query,
2424            graphql_client: self.graphql_client.clone(),
2425        }
2426    }
2427    /// Add changes to an existing changeset
2428    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
2429    ///
2430    /// # Arguments
2431    ///
2432    /// * `changes` - Changes to merge into the actual changeset
2433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2434    pub fn with_changeset_opts(
2435        &self,
2436        changes: impl IntoID<Id>,
2437        opts: ChangesetWithChangesetOpts,
2438    ) -> Changeset {
2439        let mut query = self.selection.select("withChangeset");
2440        query = query.arg_lazy(
2441            "changes",
2442            Box::new(move || {
2443                let changes = changes.clone();
2444                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2445            }),
2446        );
2447        if let Some(on_conflict) = opts.on_conflict {
2448            query = query.arg("onConflict", on_conflict);
2449        }
2450        Changeset {
2451            proc: self.proc.clone(),
2452            selection: query,
2453            graphql_client: self.graphql_client.clone(),
2454        }
2455    }
2456    /// Add changes from multiple changesets using git octopus merge strategy
2457    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2458    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2459    ///
2460    /// # Arguments
2461    ///
2462    /// * `changes` - List of changesets to merge into the actual changeset
2463    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2464    pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
2465        let mut query = self.selection.select("withChangesets");
2466        query = query.arg("changes", changes);
2467        Changeset {
2468            proc: self.proc.clone(),
2469            selection: query,
2470            graphql_client: self.graphql_client.clone(),
2471        }
2472    }
2473    /// Add changes from multiple changesets using git octopus merge strategy
2474    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2475    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2476    ///
2477    /// # Arguments
2478    ///
2479    /// * `changes` - List of changesets to merge into the actual changeset
2480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2481    pub fn with_changesets_opts(
2482        &self,
2483        changes: Vec<Id>,
2484        opts: ChangesetWithChangesetsOpts,
2485    ) -> Changeset {
2486        let mut query = self.selection.select("withChangesets");
2487        query = query.arg("changes", changes);
2488        if let Some(on_conflict) = opts.on_conflict {
2489            query = query.arg("onConflict", on_conflict);
2490        }
2491        Changeset {
2492            proc: self.proc.clone(),
2493            selection: query,
2494            graphql_client: self.graphql_client.clone(),
2495        }
2496    }
2497    /// The older/lower snapshot to compare against.
2498    pub fn before(&self) -> Directory {
2499        let query = self.selection.select("before");
2500        Directory {
2501            proc: self.proc.clone(),
2502            selection: query,
2503            graphql_client: self.graphql_client.clone(),
2504        }
2505    }
2506    /// The newer/upper snapshot.
2507    pub fn after(&self) -> Directory {
2508        let query = self.selection.select("after");
2509        Directory {
2510            proc: self.proc.clone(),
2511            selection: query,
2512            graphql_client: self.graphql_client.clone(),
2513        }
2514    }
2515}
2516impl Exportable for Changeset {
2517    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2518        let query = self.selection.select("id");
2519        let graphql_client = self.graphql_client.clone();
2520        async move { query.execute(graphql_client).await }
2521    }
2522    fn export(
2523        &self,
2524        path: impl Into<String>,
2525    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
2526        let mut query = self.selection.select("export");
2527        query = query.arg("path", path.into());
2528        let graphql_client = self.graphql_client.clone();
2529        async move { query.execute(graphql_client).await }
2530    }
2531}
2532impl Node for Changeset {
2533    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2534        let query = self.selection.select("id");
2535        let graphql_client = self.graphql_client.clone();
2536        async move { query.execute(graphql_client).await }
2537    }
2538}
2539impl Syncer for Changeset {
2540    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2541        let query = self.selection.select("id");
2542        let graphql_client = self.graphql_client.clone();
2543        async move { query.execute(graphql_client).await }
2544    }
2545    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
2546        let query = self.selection.select("sync");
2547        let proc = self.proc.clone();
2548        let graphql_client = self.graphql_client.clone();
2549        async move {
2550            let id: Id = query.execute(graphql_client.clone()).await?;
2551            Ok(Self {
2552                proc,
2553                selection: query
2554                    .root()
2555                    .select("node")
2556                    .arg("id", &id.0)
2557                    .inline_fragment("Changeset"),
2558                graphql_client,
2559            })
2560        }
2561    }
2562}
2563#[derive(Clone)]
2564pub struct Check {
2565    pub proc: Option<Arc<DaggerSessionProc>>,
2566    pub selection: Selection,
2567    pub graphql_client: DynGraphQLClient,
2568}
2569impl IntoID<Id> for Check {
2570    fn into_id(
2571        self,
2572    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2573        Box::pin(async move { self.id().await })
2574    }
2575}
2576impl Loadable for Check {
2577    fn graphql_type() -> &'static str {
2578        "Check"
2579    }
2580    fn from_query(
2581        proc: Option<Arc<DaggerSessionProc>>,
2582        selection: Selection,
2583        graphql_client: DynGraphQLClient,
2584    ) -> Self {
2585        Self {
2586            proc,
2587            selection,
2588            graphql_client,
2589        }
2590    }
2591}
2592impl Check {
2593    /// A unique identifier for this Check.
2594    pub async fn id(&self) -> Result<Id, DaggerError> {
2595        let query = self.selection.select("id");
2596        query.execute(self.graphql_client.clone()).await
2597    }
2598    /// Run the check and retain its result.
2599    pub fn sync(&self) -> Check {
2600        let query = self.selection.select("sync");
2601        Check {
2602            proc: self.proc.clone(),
2603            selection: query,
2604            graphql_client: self.graphql_client.clone(),
2605        }
2606    }
2607    /// Run the check and return whether it passes.
2608    pub async fn pass(&self) -> Result<bool, DaggerError> {
2609        let query = self.selection.select("pass");
2610        query.execute(self.graphql_client.clone()).await
2611    }
2612    /// Run the check and return its failure, if any.
2613    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
2614        let query = self.selection.select("error");
2615        let query = query.select("id");
2616        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2617        Ok(id.map(|id| Error {
2618            proc: self.proc.clone(),
2619            selection: query
2620                .root()
2621                .select("node")
2622                .arg("id", &id.0)
2623                .inline_fragment("Error"),
2624            graphql_client: self.graphql_client.clone(),
2625        }))
2626    }
2627    /// The assertion that is false when this check fails.
2628    pub async fn assertion(&self) -> Result<String, DaggerError> {
2629        let query = self.selection.select("assertion");
2630        query.execute(self.graphql_client.clone()).await
2631    }
2632    /// An optional report produced by the check.
2633    pub async fn report(&self) -> Result<Option<Directory>, DaggerError> {
2634        let query = self.selection.select("report");
2635        let query = query.select("id");
2636        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2637        Ok(id.map(|id| Directory {
2638            proc: self.proc.clone(),
2639            selection: query
2640                .root()
2641                .select("node")
2642                .arg("id", &id.0)
2643                .inline_fragment("Directory"),
2644            graphql_client: self.graphql_client.clone(),
2645        }))
2646    }
2647}
2648impl Node for Check {
2649    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2650        let query = self.selection.select("id");
2651        let graphql_client = self.graphql_client.clone();
2652        async move { query.execute(graphql_client).await }
2653    }
2654}
2655#[derive(Clone)]
2656pub struct ClientFilesyncMirror {
2657    pub proc: Option<Arc<DaggerSessionProc>>,
2658    pub selection: Selection,
2659    pub graphql_client: DynGraphQLClient,
2660}
2661impl IntoID<Id> for ClientFilesyncMirror {
2662    fn into_id(
2663        self,
2664    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2665        Box::pin(async move { self.id().await })
2666    }
2667}
2668impl Loadable for ClientFilesyncMirror {
2669    fn graphql_type() -> &'static str {
2670        "ClientFilesyncMirror"
2671    }
2672    fn from_query(
2673        proc: Option<Arc<DaggerSessionProc>>,
2674        selection: Selection,
2675        graphql_client: DynGraphQLClient,
2676    ) -> Self {
2677        Self {
2678            proc,
2679            selection,
2680            graphql_client,
2681        }
2682    }
2683}
2684impl ClientFilesyncMirror {
2685    /// A unique identifier for this ClientFilesyncMirror.
2686    pub async fn id(&self) -> Result<Id, DaggerError> {
2687        let query = self.selection.select("id");
2688        query.execute(self.graphql_client.clone()).await
2689    }
2690}
2691impl Node for ClientFilesyncMirror {
2692    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2693        let query = self.selection.select("id");
2694        let graphql_client = self.graphql_client.clone();
2695        async move { query.execute(graphql_client).await }
2696    }
2697}
2698#[derive(Clone)]
2699pub struct Cloud {
2700    pub proc: Option<Arc<DaggerSessionProc>>,
2701    pub selection: Selection,
2702    pub graphql_client: DynGraphQLClient,
2703}
2704impl IntoID<Id> for Cloud {
2705    fn into_id(
2706        self,
2707    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2708        Box::pin(async move { self.id().await })
2709    }
2710}
2711impl Loadable for Cloud {
2712    fn graphql_type() -> &'static str {
2713        "Cloud"
2714    }
2715    fn from_query(
2716        proc: Option<Arc<DaggerSessionProc>>,
2717        selection: Selection,
2718        graphql_client: DynGraphQLClient,
2719    ) -> Self {
2720        Self {
2721            proc,
2722            selection,
2723            graphql_client,
2724        }
2725    }
2726}
2727impl Cloud {
2728    /// A unique identifier for this Cloud.
2729    pub async fn id(&self) -> Result<Id, DaggerError> {
2730        let query = self.selection.select("id");
2731        query.execute(self.graphql_client.clone()).await
2732    }
2733    /// The trace URL for the current session
2734    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2735        let query = self.selection.select("traceURL");
2736        query.execute(self.graphql_client.clone()).await
2737    }
2738}
2739impl Node for Cloud {
2740    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2741        let query = self.selection.select("id");
2742        let graphql_client = self.graphql_client.clone();
2743        async move { query.execute(graphql_client).await }
2744    }
2745}
2746#[derive(Clone)]
2747pub struct CollectionDelta {
2748    pub proc: Option<Arc<DaggerSessionProc>>,
2749    pub selection: Selection,
2750    pub graphql_client: DynGraphQLClient,
2751}
2752impl IntoID<Id> for CollectionDelta {
2753    fn into_id(
2754        self,
2755    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2756        Box::pin(async move { self.id().await })
2757    }
2758}
2759impl Loadable for CollectionDelta {
2760    fn graphql_type() -> &'static str {
2761        "CollectionDelta"
2762    }
2763    fn from_query(
2764        proc: Option<Arc<DaggerSessionProc>>,
2765        selection: Selection,
2766        graphql_client: DynGraphQLClient,
2767    ) -> Self {
2768        Self {
2769            proc,
2770            selection,
2771            graphql_client,
2772        }
2773    }
2774}
2775impl CollectionDelta {
2776    /// A unique identifier for this CollectionDelta.
2777    pub async fn id(&self) -> Result<Id, DaggerError> {
2778        let query = self.selection.select("id");
2779        query.execute(self.graphql_client.clone()).await
2780    }
2781    /// Current keys absent from the original collection, in current order.
2782    pub async fn added_keys(&self) -> Result<Vec<String>, DaggerError> {
2783        let query = self.selection.select("addedKeys");
2784        query.execute(self.graphql_client.clone()).await
2785    }
2786    /// Original keys absent from the current collection, in original order.
2787    pub async fn removed_keys(&self) -> Result<Vec<String>, DaggerError> {
2788        let query = self.selection.select("removedKeys");
2789        query.execute(self.graphql_client.clone()).await
2790    }
2791}
2792impl Node for CollectionDelta {
2793    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2794        let query = self.selection.select("id");
2795        let graphql_client = self.graphql_client.clone();
2796        async move { query.execute(graphql_client).await }
2797    }
2798}
2799#[derive(Clone)]
2800pub struct CollectionTypeDef {
2801    pub proc: Option<Arc<DaggerSessionProc>>,
2802    pub selection: Selection,
2803    pub graphql_client: DynGraphQLClient,
2804}
2805impl IntoID<Id> for CollectionTypeDef {
2806    fn into_id(
2807        self,
2808    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2809        Box::pin(async move { self.id().await })
2810    }
2811}
2812impl Loadable for CollectionTypeDef {
2813    fn graphql_type() -> &'static str {
2814        "CollectionTypeDef"
2815    }
2816    fn from_query(
2817        proc: Option<Arc<DaggerSessionProc>>,
2818        selection: Selection,
2819        graphql_client: DynGraphQLClient,
2820    ) -> Self {
2821        Self {
2822            proc,
2823            selection,
2824            graphql_client,
2825        }
2826    }
2827}
2828impl CollectionTypeDef {
2829    /// A unique identifier for this CollectionTypeDef.
2830    pub async fn id(&self) -> Result<Id, DaggerError> {
2831        let query = self.selection.select("id");
2832        query.execute(self.graphql_client.clone()).await
2833    }
2834    /// The type of collection keys.
2835    pub fn key_type(&self) -> TypeDef {
2836        let query = self.selection.select("keyType");
2837        TypeDef {
2838            proc: self.proc.clone(),
2839            selection: query,
2840            graphql_client: self.graphql_client.clone(),
2841        }
2842    }
2843    /// The object type returned by get.
2844    pub fn value_type(&self) -> TypeDef {
2845        let query = self.selection.select("valueType");
2846        TypeDef {
2847            proc: self.proc.clone(),
2848            selection: query,
2849            graphql_client: self.graphql_client.clone(),
2850        }
2851    }
2852    /// The type of batch operations, or null when there are none.
2853    pub async fn batch_type(&self) -> Result<Option<TypeDef>, DaggerError> {
2854        let query = self.selection.select("batchType");
2855        let query = query.select("id");
2856        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2857        Ok(id.map(|id| TypeDef {
2858            proc: self.proc.clone(),
2859            selection: query
2860                .root()
2861                .select("node")
2862                .arg("id", &id.0)
2863                .inline_fragment("TypeDef"),
2864            graphql_client: self.graphql_client.clone(),
2865        }))
2866    }
2867}
2868impl Node for CollectionTypeDef {
2869    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2870        let query = self.selection.select("id");
2871        let graphql_client = self.graphql_client.clone();
2872        async move { query.execute(graphql_client).await }
2873    }
2874}
2875#[derive(Clone)]
2876pub struct Command {
2877    pub proc: Option<Arc<DaggerSessionProc>>,
2878    pub selection: Selection,
2879    pub graphql_client: DynGraphQLClient,
2880}
2881impl IntoID<Id> for Command {
2882    fn into_id(
2883        self,
2884    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2885        Box::pin(async move { self.id().await })
2886    }
2887}
2888impl Loadable for Command {
2889    fn graphql_type() -> &'static str {
2890        "Command"
2891    }
2892    fn from_query(
2893        proc: Option<Arc<DaggerSessionProc>>,
2894        selection: Selection,
2895        graphql_client: DynGraphQLClient,
2896    ) -> Self {
2897        Self {
2898            proc,
2899            selection,
2900            graphql_client,
2901        }
2902    }
2903}
2904impl Command {
2905    /// A unique identifier for this Command.
2906    pub async fn id(&self) -> Result<Id, DaggerError> {
2907        let query = self.selection.select("id");
2908        query.execute(self.graphql_client.clone()).await
2909    }
2910    /// The command arguments.
2911    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
2912        let query = self.selection.select("args");
2913        query.execute(self.graphql_client.clone()).await
2914    }
2915    /// Environment variable overrides. Other variables come from the container.
2916    pub async fn env(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2917        let query = self.selection.select("env");
2918        let query = query.select("id");
2919        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2920        Ok(ids
2921            .into_iter()
2922            .map(|id| EnvVariable {
2923                proc: self.proc.clone(),
2924                selection: crate::querybuilder::query()
2925                    .select("node")
2926                    .arg("id", &id.0)
2927                    .inline_fragment("EnvVariable"),
2928                graphql_client: self.graphql_client.clone(),
2929            })
2930            .collect())
2931    }
2932    /// Working directory override. If unset, use the container's working directory.
2933    pub async fn workdir(&self) -> Result<String, DaggerError> {
2934        let query = self.selection.select("workdir");
2935        query.execute(self.graphql_client.clone()).await
2936    }
2937    /// Whether the command has access to Dagger.
2938    pub async fn privileged_nesting(&self) -> Result<bool, DaggerError> {
2939        let query = self.selection.select("privilegedNesting");
2940        query.execute(self.graphql_client.clone()).await
2941    }
2942    /// Whether the command has all root capabilities.
2943    pub async fn insecure_root_capabilities(&self) -> Result<bool, DaggerError> {
2944        let query = self.selection.select("insecureRootCapabilities");
2945        query.execute(self.graphql_client.clone()).await
2946    }
2947}
2948impl Node for Command {
2949    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2950        let query = self.selection.select("id");
2951        let graphql_client = self.graphql_client.clone();
2952        async move { query.execute(graphql_client).await }
2953    }
2954}
2955#[derive(Clone)]
2956pub struct Container {
2957    pub proc: Option<Arc<DaggerSessionProc>>,
2958    pub selection: Selection,
2959    pub graphql_client: DynGraphQLClient,
2960}
2961#[derive(Builder, Debug, PartialEq)]
2962pub struct ContainerFromOpts<'a> {
2963    /// Allow HTTPS registry communication without verifying the server certificate.
2964    #[builder(setter(into, strip_option), default)]
2965    pub insecure_skip_tls_verify: Option<bool>,
2966    /// Ignore the workspace lockfile for this lookup.
2967    #[builder(setter(into, strip_option), default)]
2968    pub no_lock: Option<bool>,
2969    /// Protocol to use for registry communication.
2970    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
2971    #[builder(setter(into, strip_option), default)]
2972    pub protocol: Option<RegistryProtocol>,
2973    /// Service to use as the registry endpoint for the image address.
2974    /// The service will be started only for this pull.
2975    #[builder(setter(into, strip_option), default)]
2976    pub registry_service: Option<Id>,
2977    /// Version query used to select an image tag. The address must not contain a tag or digest.
2978    #[builder(setter(into, strip_option), default)]
2979    pub version: Option<&'a str>,
2980}
2981#[derive(Builder, Debug, PartialEq)]
2982pub struct ContainerDirectoryOpts {
2983    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2984    #[builder(setter(into, strip_option), default)]
2985    pub expand: Option<bool>,
2986}
2987#[derive(Builder, Debug, PartialEq)]
2988pub struct ContainerFileOpts {
2989    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2990    #[builder(setter(into, strip_option), default)]
2991    pub expand: Option<bool>,
2992}
2993#[derive(Builder, Debug, PartialEq)]
2994pub struct ContainerWithWorkdirOpts {
2995    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2996    #[builder(setter(into, strip_option), default)]
2997    pub expand: Option<bool>,
2998}
2999#[derive(Builder, Debug, PartialEq)]
3000pub struct ContainerWithEnvVariableOpts {
3001    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
3002    #[builder(setter(into, strip_option), default)]
3003    pub expand: Option<bool>,
3004}
3005#[derive(Builder, Debug, PartialEq)]
3006pub struct ContainerWithDockerHealthcheckOpts<'a> {
3007    /// Interval between running healthcheck. Example: "30s"
3008    #[builder(setter(into, strip_option), default)]
3009    pub interval: Option<&'a str>,
3010    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
3011    #[builder(setter(into, strip_option), default)]
3012    pub retries: Option<isize>,
3013    /// When true, command must be a single element, which is run using the container's shell
3014    #[builder(setter(into, strip_option), default)]
3015    pub shell: Option<bool>,
3016    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
3017    #[builder(setter(into, strip_option), default)]
3018    pub start_interval: Option<&'a str>,
3019    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
3020    #[builder(setter(into, strip_option), default)]
3021    pub start_period: Option<&'a str>,
3022    /// Healthcheck timeout. Example: "3s"
3023    #[builder(setter(into, strip_option), default)]
3024    pub timeout: Option<&'a str>,
3025}
3026#[derive(Builder, Debug, PartialEq)]
3027pub struct ContainerWithEntrypointOpts {
3028    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
3029    #[builder(setter(into, strip_option), default)]
3030    pub keep_default_args: Option<bool>,
3031}
3032#[derive(Builder, Debug, PartialEq)]
3033pub struct ContainerWithoutEntrypointOpts {
3034    /// Don't remove the default arguments when unsetting the entrypoint.
3035    #[builder(setter(into, strip_option), default)]
3036    pub keep_default_args: Option<bool>,
3037}
3038#[derive(Builder, Debug, PartialEq)]
3039pub struct ContainerWithMountedDirectoryOpts<'a> {
3040    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3041    #[builder(setter(into, strip_option), default)]
3042    pub expand: Option<bool>,
3043    /// Set the owner to the container's current user.
3044    #[builder(setter(into, strip_option), default)]
3045    pub inherit_owner: Option<bool>,
3046    /// A user:group to set for the mounted directory and its contents.
3047    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3048    /// If the group is omitted, it defaults to the same as the user.
3049    #[builder(setter(into, strip_option), default)]
3050    pub owner: Option<&'a str>,
3051    /// Mount the directory read-only.
3052    #[builder(setter(into, strip_option), default)]
3053    pub read_only: Option<bool>,
3054}
3055#[derive(Builder, Debug, PartialEq)]
3056pub struct ContainerWithMountedFileOpts<'a> {
3057    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3058    #[builder(setter(into, strip_option), default)]
3059    pub expand: Option<bool>,
3060    /// Set the owner to the container's current user.
3061    #[builder(setter(into, strip_option), default)]
3062    pub inherit_owner: Option<bool>,
3063    /// A user or user:group to set for the mounted file.
3064    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3065    /// If the group is omitted, it defaults to the same as the user.
3066    #[builder(setter(into, strip_option), default)]
3067    pub owner: Option<&'a str>,
3068}
3069#[derive(Builder, Debug, PartialEq)]
3070pub struct ContainerWithMountedTempOpts {
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    /// Size of the temporary directory in bytes.
3075    #[builder(setter(into, strip_option), default)]
3076    pub size: Option<isize>,
3077}
3078#[derive(Builder, Debug, PartialEq)]
3079pub struct ContainerWithMountedCacheOpts<'a> {
3080    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3081    #[builder(setter(into, strip_option), default)]
3082    pub expand: Option<bool>,
3083    /// Set the owner to the container's current user.
3084    #[builder(setter(into, strip_option), default)]
3085    pub inherit_owner: Option<bool>,
3086    /// A user:group to set for the mounted cache directory.
3087    /// 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.
3088    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3089    /// If the group is omitted, it defaults to the same as the user.
3090    #[builder(setter(into, strip_option), default)]
3091    pub owner: Option<&'a str>,
3092    /// Sharing mode of the cache volume.
3093    #[builder(setter(into, strip_option), default)]
3094    pub sharing: Option<CacheSharingMode>,
3095    /// Identifier of the directory to use as the cache volume's root.
3096    #[builder(setter(into, strip_option), default)]
3097    pub source: Option<Id>,
3098}
3099#[derive(Builder, Debug, PartialEq)]
3100pub struct ContainerWithMountedVolumeOpts {
3101    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3102    #[builder(setter(into, strip_option), default)]
3103    pub expand: Option<bool>,
3104    /// Mount the volume read-only.
3105    #[builder(setter(into, strip_option), default)]
3106    pub read_only: Option<bool>,
3107}
3108#[derive(Builder, Debug, PartialEq)]
3109pub struct ContainerWithMountedSecretOpts<'a> {
3110    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3111    #[builder(setter(into, strip_option), default)]
3112    pub expand: Option<bool>,
3113    /// Set the owner to the container's current user.
3114    #[builder(setter(into, strip_option), default)]
3115    pub inherit_owner: Option<bool>,
3116    /// Permission given to the mounted secret (e.g., 0600).
3117    /// This option requires an owner to be set to be active.
3118    #[builder(setter(into, strip_option), default)]
3119    pub mode: Option<isize>,
3120    /// A user:group to set for the mounted secret.
3121    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3122    /// If the group is omitted, it defaults to the same as the user.
3123    #[builder(setter(into, strip_option), default)]
3124    pub owner: Option<&'a str>,
3125}
3126#[derive(Builder, Debug, PartialEq)]
3127pub struct ContainerWithUnixSocketOpts<'a> {
3128    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3129    #[builder(setter(into, strip_option), default)]
3130    pub expand: Option<bool>,
3131    /// Set the owner to the container's current user.
3132    #[builder(setter(into, strip_option), default)]
3133    pub inherit_owner: Option<bool>,
3134    /// A user:group to set for the mounted socket.
3135    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3136    /// If the group is omitted, it defaults to the same as the user.
3137    #[builder(setter(into, strip_option), default)]
3138    pub owner: Option<&'a str>,
3139}
3140#[derive(Builder, Debug, PartialEq)]
3141pub struct ContainerWithoutUnixSocketOpts {
3142    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3143    #[builder(setter(into, strip_option), default)]
3144    pub expand: Option<bool>,
3145}
3146#[derive(Builder, Debug, PartialEq)]
3147pub struct ContainerWithoutMountOpts {
3148    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3149    #[builder(setter(into, strip_option), default)]
3150    pub expand: Option<bool>,
3151}
3152#[derive(Builder, Debug, PartialEq)]
3153pub struct ContainerWithFileOpts<'a> {
3154    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3155    #[builder(setter(into, strip_option), default)]
3156    pub expand: Option<bool>,
3157    /// Set the owner to the container's current user.
3158    #[builder(setter(into, strip_option), default)]
3159    pub inherit_owner: Option<bool>,
3160    /// A user:group to set for the file.
3161    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3162    /// If the group is omitted, it defaults to the same as the user.
3163    #[builder(setter(into, strip_option), default)]
3164    pub owner: Option<&'a str>,
3165    /// Permissions of the new file. Example: 0600
3166    #[builder(setter(into, strip_option), default)]
3167    pub permissions: Option<isize>,
3168}
3169#[derive(Builder, Debug, PartialEq)]
3170pub struct ContainerWithoutFileOpts {
3171    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3172    #[builder(setter(into, strip_option), default)]
3173    pub expand: Option<bool>,
3174}
3175#[derive(Builder, Debug, PartialEq)]
3176pub struct ContainerWithoutFilesOpts {
3177    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3178    #[builder(setter(into, strip_option), default)]
3179    pub expand: Option<bool>,
3180}
3181#[derive(Builder, Debug, PartialEq)]
3182pub struct ContainerWithFilesOpts<'a> {
3183    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3184    #[builder(setter(into, strip_option), default)]
3185    pub expand: Option<bool>,
3186    /// Set the owner to the container's current user.
3187    #[builder(setter(into, strip_option), default)]
3188    pub inherit_owner: Option<bool>,
3189    /// A user:group to set for the files.
3190    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3191    /// If the group is omitted, it defaults to the same as the user.
3192    #[builder(setter(into, strip_option), default)]
3193    pub owner: Option<&'a str>,
3194    /// Permission given to the copied files (e.g., 0600).
3195    #[builder(setter(into, strip_option), default)]
3196    pub permissions: Option<isize>,
3197}
3198#[derive(Builder, Debug, PartialEq)]
3199pub struct ContainerWithNewFileOpts<'a> {
3200    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3201    #[builder(setter(into, strip_option), default)]
3202    pub expand: Option<bool>,
3203    /// Set the owner to the container's current user.
3204    #[builder(setter(into, strip_option), default)]
3205    pub inherit_owner: Option<bool>,
3206    /// A user:group to set for the file.
3207    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3208    /// If the group is omitted, it defaults to the same as the user.
3209    #[builder(setter(into, strip_option), default)]
3210    pub owner: Option<&'a str>,
3211    /// Permissions of the new file. Example: 0600
3212    #[builder(setter(into, strip_option), default)]
3213    pub permissions: Option<isize>,
3214}
3215#[derive(Builder, Debug, PartialEq)]
3216pub struct ContainerWithDirectoryOpts<'a> {
3217    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
3218    #[builder(setter(into, strip_option), default)]
3219    pub exclude: Option<Vec<&'a str>>,
3220    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3221    #[builder(setter(into, strip_option), default)]
3222    pub expand: Option<bool>,
3223    /// Apply .gitignore rules when writing the directory.
3224    #[builder(setter(into, strip_option), default)]
3225    pub gitignore: Option<bool>,
3226    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
3227    #[builder(setter(into, strip_option), default)]
3228    pub include: Option<Vec<&'a str>>,
3229    /// Set the owner to the container's current user.
3230    #[builder(setter(into, strip_option), default)]
3231    pub inherit_owner: Option<bool>,
3232    /// A user:group to set for the directory and its contents.
3233    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3234    /// If the group is omitted, it defaults to the same as the user.
3235    #[builder(setter(into, strip_option), default)]
3236    pub owner: Option<&'a str>,
3237    #[builder(setter(into, strip_option), default)]
3238    pub permissions: Option<isize>,
3239}
3240#[derive(Builder, Debug, PartialEq)]
3241pub struct ContainerWithoutDirectoryOpts {
3242    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3243    #[builder(setter(into, strip_option), default)]
3244    pub expand: Option<bool>,
3245}
3246#[derive(Builder, Debug, PartialEq)]
3247pub struct ContainerExistsOpts {
3248    /// If specified, do not follow symlinks.
3249    #[builder(setter(into, strip_option), default)]
3250    pub do_not_follow_symlinks: Option<bool>,
3251    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3252    #[builder(setter(into, strip_option), default)]
3253    pub expand: Option<bool>,
3254    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
3255    #[builder(setter(into, strip_option), default)]
3256    pub expected_type: Option<ExistsType>,
3257}
3258#[derive(Builder, Debug, PartialEq)]
3259pub struct ContainerStatOpts {
3260    /// If specified, do not follow symlinks.
3261    #[builder(setter(into, strip_option), default)]
3262    pub do_not_follow_symlinks: Option<bool>,
3263}
3264#[derive(Builder, Debug, PartialEq)]
3265pub struct ContainerWithExecOpts<'a> {
3266    /// 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.
3267    /// 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.
3268    /// Cannot be combined with "disableDaggerInDagger".
3269    #[builder(setter(into, strip_option), default)]
3270    pub dagger_in_dagger_new_session: Option<bool>,
3271    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3272    #[builder(setter(into, strip_option), default)]
3273    pub disable_dagger_in_dagger: Option<bool>,
3274    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3275    #[builder(setter(into, strip_option), default)]
3276    pub expand: Option<bool>,
3277    /// Exit codes this command is allowed to exit with without error
3278    #[builder(setter(into, strip_option), default)]
3279    pub expect: Option<ReturnType>,
3280    #[builder(setter(into, strip_option), default)]
3281    pub experimental_privileged_nesting: Option<bool>,
3282    /// Execute the command with all root capabilities. Like --privileged in Docker
3283    /// 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.
3284    #[builder(setter(into, strip_option), default)]
3285    pub insecure_root_capabilities: Option<bool>,
3286    /// Skip the automatic init process injected into containers by default.
3287    /// 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.
3288    #[builder(setter(into, strip_option), default)]
3289    pub no_init: Option<bool>,
3290    /// Redirect the command's standard error to a file in the container. The redirected output is not logged. Example: "./stderr.txt"
3291    #[builder(setter(into, strip_option), default)]
3292    pub redirect_stderr: Option<&'a str>,
3293    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
3294    #[builder(setter(into, strip_option), default)]
3295    pub redirect_stdin: Option<&'a str>,
3296    /// Redirect the command's standard output to a file in the container. The redirected output is not logged. Example: "./stdout.txt"
3297    #[builder(setter(into, strip_option), default)]
3298    pub redirect_stdout: Option<&'a str>,
3299    /// Content to write to the command's standard input. Example: "Hello world")
3300    #[builder(setter(into, strip_option), default)]
3301    pub stdin: Option<&'a str>,
3302    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
3303    #[builder(setter(into, strip_option), default)]
3304    pub use_entrypoint: Option<bool>,
3305}
3306#[derive(Builder, Debug, PartialEq)]
3307pub struct ContainerWithSymlinkOpts {
3308    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3309    #[builder(setter(into, strip_option), default)]
3310    pub expand: Option<bool>,
3311}
3312#[derive(Builder, Debug, PartialEq)]
3313pub struct ContainerPublishOpts {
3314    /// Force each layer of the published image to use the specified compression algorithm.
3315    /// 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.
3316    #[builder(setter(into, strip_option), default)]
3317    pub forced_compression: Option<ImageLayerCompression>,
3318    /// Allow HTTPS registry communication without verifying the server certificate.
3319    #[builder(setter(into, strip_option), default)]
3320    pub insecure_skip_tls_verify: Option<bool>,
3321    /// Use the specified media types for the published image's layers.
3322    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
3323    #[builder(setter(into, strip_option), default)]
3324    pub media_types: Option<ImageMediaTypes>,
3325    /// Identifiers for other platform specific containers.
3326    /// Used for multi-platform image.
3327    #[builder(setter(into, strip_option), default)]
3328    pub platform_variants: Option<Vec<Id>>,
3329    /// Protocol to use for registry communication.
3330    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
3331    #[builder(setter(into, strip_option), default)]
3332    pub protocol: Option<RegistryProtocol>,
3333    /// Service to use as the registry endpoint for the image address.
3334    /// The service will be started only for this push.
3335    #[builder(setter(into, strip_option), default)]
3336    pub registry_service: Option<Id>,
3337}
3338#[derive(Builder, Debug, PartialEq)]
3339pub struct ContainerExportOpts {
3340    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3341    #[builder(setter(into, strip_option), default)]
3342    pub expand: Option<bool>,
3343    /// Force each layer of the exported image to use the specified compression algorithm.
3344    /// 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.
3345    #[builder(setter(into, strip_option), default)]
3346    pub forced_compression: Option<ImageLayerCompression>,
3347    /// Use the specified media types for the exported image's layers.
3348    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3349    #[builder(setter(into, strip_option), default)]
3350    pub media_types: Option<ImageMediaTypes>,
3351    /// Identifiers for other platform specific containers.
3352    /// Used for multi-platform image.
3353    #[builder(setter(into, strip_option), default)]
3354    pub platform_variants: Option<Vec<Id>>,
3355}
3356#[derive(Builder, Debug, PartialEq)]
3357pub struct ContainerExportImageOpts {
3358    /// Force each layer of the exported image to use the specified compression algorithm.
3359    /// 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.
3360    #[builder(setter(into, strip_option), default)]
3361    pub forced_compression: Option<ImageLayerCompression>,
3362    /// Use the specified media types for the exported image's layers.
3363    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3364    #[builder(setter(into, strip_option), default)]
3365    pub media_types: Option<ImageMediaTypes>,
3366    /// Identifiers for other platform specific containers.
3367    /// Used for multi-platform image.
3368    #[builder(setter(into, strip_option), default)]
3369    pub platform_variants: Option<Vec<Id>>,
3370}
3371#[derive(Builder, Debug, PartialEq)]
3372pub struct ContainerAsTarballOpts {
3373    /// Force each layer of the image to use the specified compression algorithm.
3374    /// 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.
3375    #[builder(setter(into, strip_option), default)]
3376    pub forced_compression: Option<ImageLayerCompression>,
3377    /// Use the specified media types for the image's layers.
3378    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3379    #[builder(setter(into, strip_option), default)]
3380    pub media_types: Option<ImageMediaTypes>,
3381    /// Identifiers for other platform specific containers.
3382    /// Used for multi-platform images.
3383    #[builder(setter(into, strip_option), default)]
3384    pub platform_variants: Option<Vec<Id>>,
3385}
3386#[derive(Builder, Debug, PartialEq)]
3387pub struct ContainerImportOpts<'a> {
3388    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
3389    #[builder(setter(into, strip_option), default)]
3390    pub tag: Option<&'a str>,
3391}
3392#[derive(Builder, Debug, PartialEq)]
3393pub struct ContainerManifestOpts {
3394    /// Force each layer of the image to use the specified compression algorithm.
3395    /// 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.
3396    #[builder(setter(into, strip_option), default)]
3397    pub forced_compression: Option<ImageLayerCompression>,
3398    /// Media types to use for image layers. Defaults to OCI.
3399    #[builder(setter(into, strip_option), default)]
3400    pub media_types: Option<ImageMediaTypes>,
3401}
3402#[derive(Builder, Debug, PartialEq)]
3403pub struct ContainerLayerOpts {
3404    /// Force each layer of the image to use the specified compression algorithm.
3405    /// 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.
3406    #[builder(setter(into, strip_option), default)]
3407    pub forced_compression: Option<ImageLayerCompression>,
3408    /// Media types to use for image layers. Defaults to OCI.
3409    #[builder(setter(into, strip_option), default)]
3410    pub media_types: Option<ImageMediaTypes>,
3411}
3412#[derive(Builder, Debug, PartialEq)]
3413pub struct ContainerWithExposedPortOpts<'a> {
3414    /// Port description. Example: "payment API endpoint"
3415    #[builder(setter(into, strip_option), default)]
3416    pub description: Option<&'a str>,
3417    /// Skip the health check when run as a service.
3418    #[builder(setter(into, strip_option), default)]
3419    pub experimental_skip_healthcheck: Option<bool>,
3420    /// Network protocol. Example: "tcp"
3421    #[builder(setter(into, strip_option), default)]
3422    pub protocol: Option<NetworkProtocol>,
3423}
3424#[derive(Builder, Debug, PartialEq)]
3425pub struct ContainerWithoutExposedPortOpts {
3426    /// Port protocol to unexpose
3427    #[builder(setter(into, strip_option), default)]
3428    pub protocol: Option<NetworkProtocol>,
3429}
3430#[derive(Builder, Debug, PartialEq)]
3431pub struct ContainerWithDefaultTerminalCmdOpts {
3432    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3433    #[builder(setter(into, strip_option), default)]
3434    pub disable_dagger_in_dagger: Option<bool>,
3435    #[builder(setter(into, strip_option), default)]
3436    pub experimental_privileged_nesting: Option<bool>,
3437    /// 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.
3438    #[builder(setter(into, strip_option), default)]
3439    pub insecure_root_capabilities: Option<bool>,
3440}
3441#[derive(Builder, Debug, PartialEq)]
3442pub struct ContainerWithShellOpts<'a> {
3443    /// Command arguments for batch use. The script is appended as one argument. Defaults to interactive followed by "-c".
3444    #[builder(setter(into, strip_option), default)]
3445    pub batch: Option<Vec<&'a str>>,
3446    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3447    #[builder(setter(into, strip_option), default)]
3448    pub disable_dagger_in_dagger: Option<bool>,
3449    #[builder(setter(into, strip_option), default)]
3450    pub experimental_privileged_nesting: Option<bool>,
3451    /// Give the shell all root capabilities. Use only with trusted commands.
3452    #[builder(setter(into, strip_option), default)]
3453    pub insecure_root_capabilities: Option<bool>,
3454}
3455#[derive(Builder, Debug, PartialEq)]
3456pub struct ContainerShellOpts {
3457    /// Return the batch command instead of the interactive command.
3458    #[builder(setter(into, strip_option), default)]
3459    pub batch: Option<bool>,
3460}
3461#[derive(Builder, Debug, PartialEq)]
3462pub struct ContainerWithRunOpts<'a> {
3463    /// Override whether the shell is denied Dagger API access. Omit to use the configured shell setting.
3464    #[builder(setter(into, strip_option), default)]
3465    pub disable_dagger_in_dagger: Option<bool>,
3466    #[builder(setter(into, strip_option), default)]
3467    pub experimental_privileged_nesting: Option<bool>,
3468    /// Override whether the shell has all root capabilities.
3469    #[builder(setter(into, strip_option), default)]
3470    pub insecure_root_capabilities: Option<bool>,
3471    /// Override the batch shell arguments. Example: ["bash", "-c"].
3472    #[builder(setter(into, strip_option), default)]
3473    pub shell: Option<Vec<&'a str>>,
3474}
3475#[derive(Builder, Debug, PartialEq)]
3476pub struct ContainerTerminalOpts<'a> {
3477    /// If set, override the container's default terminal command and invoke these command arguments instead.
3478    #[builder(setter(into, strip_option), default)]
3479    pub cmd: 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    /// 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.
3486    #[builder(setter(into, strip_option), default)]
3487    pub insecure_root_capabilities: Option<bool>,
3488}
3489#[derive(Builder, Debug, PartialEq)]
3490pub struct ContainerAsServiceOpts<'a> {
3491    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3492    /// If empty, the container's default command is used.
3493    #[builder(setter(into, strip_option), default)]
3494    pub args: Option<Vec<&'a str>>,
3495    /// 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.
3496    /// 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.
3497    /// Cannot be combined with "disableDaggerInDagger".
3498    #[builder(setter(into, strip_option), default)]
3499    pub dagger_in_dagger_new_session: Option<bool>,
3500    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3501    #[builder(setter(into, strip_option), default)]
3502    pub disable_dagger_in_dagger: Option<bool>,
3503    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3504    #[builder(setter(into, strip_option), default)]
3505    pub expand: Option<bool>,
3506    #[builder(setter(into, strip_option), default)]
3507    pub experimental_privileged_nesting: Option<bool>,
3508    /// 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.
3509    #[builder(setter(into, strip_option), default)]
3510    pub insecure_root_capabilities: Option<bool>,
3511    /// If set, skip the automatic init process injected into containers by default.
3512    /// 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.
3513    #[builder(setter(into, strip_option), default)]
3514    pub no_init: Option<bool>,
3515    /// If the container has an entrypoint, prepend it to the args.
3516    #[builder(setter(into, strip_option), default)]
3517    pub use_entrypoint: Option<bool>,
3518}
3519#[derive(Builder, Debug, PartialEq)]
3520pub struct ContainerUpOpts<'a> {
3521    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3522    /// If empty, the container's default command is used.
3523    #[builder(setter(into, strip_option), default)]
3524    pub args: Option<Vec<&'a str>>,
3525    /// 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.
3526    /// 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.
3527    /// Cannot be combined with "disableDaggerInDagger".
3528    #[builder(setter(into, strip_option), default)]
3529    pub dagger_in_dagger_new_session: Option<bool>,
3530    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
3531    #[builder(setter(into, strip_option), default)]
3532    pub disable_dagger_in_dagger: Option<bool>,
3533    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3534    #[builder(setter(into, strip_option), default)]
3535    pub expand: Option<bool>,
3536    #[builder(setter(into, strip_option), default)]
3537    pub experimental_privileged_nesting: Option<bool>,
3538    /// 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.
3539    #[builder(setter(into, strip_option), default)]
3540    pub insecure_root_capabilities: Option<bool>,
3541    /// If set, skip the automatic init process injected into containers by default.
3542    /// 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.
3543    #[builder(setter(into, strip_option), default)]
3544    pub no_init: Option<bool>,
3545    /// List of frontend/backend port mappings to forward.
3546    /// Frontend is the port accepting traffic on the host, backend is the service port.
3547    #[builder(setter(into, strip_option), default)]
3548    pub ports: Option<Vec<PortForward>>,
3549    /// Bind each tunnel port to a random port on the host.
3550    #[builder(setter(into, strip_option), default)]
3551    pub random: Option<bool>,
3552    /// If the container has an entrypoint, prepend it to the args.
3553    #[builder(setter(into, strip_option), default)]
3554    pub use_entrypoint: Option<bool>,
3555}
3556impl IntoID<Id> for Container {
3557    fn into_id(
3558        self,
3559    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
3560        Box::pin(async move { self.id().await })
3561    }
3562}
3563impl Loadable for Container {
3564    fn graphql_type() -> &'static str {
3565        "Container"
3566    }
3567    fn from_query(
3568        proc: Option<Arc<DaggerSessionProc>>,
3569        selection: Selection,
3570        graphql_client: DynGraphQLClient,
3571    ) -> Self {
3572        Self {
3573            proc,
3574            selection,
3575            graphql_client,
3576        }
3577    }
3578}
3579impl Container {
3580    /// A unique identifier for this Container.
3581    pub async fn id(&self) -> Result<Id, DaggerError> {
3582        let query = self.selection.select("id");
3583        query.execute(self.graphql_client.clone()).await
3584    }
3585    /// Forces evaluation of the pipeline in the engine.
3586    /// It doesn't run the default command if no exec has been set.
3587    pub async fn sync(&self) -> Result<Container, DaggerError> {
3588        let query = self.selection.select("sync");
3589        let id: Id = query.execute(self.graphql_client.clone()).await?;
3590        Ok(Container {
3591            proc: self.proc.clone(),
3592            selection: query
3593                .root()
3594                .select("node")
3595                .arg("id", &id.0)
3596                .inline_fragment("Container"),
3597            graphql_client: self.graphql_client.clone(),
3598        })
3599    }
3600    /// Download a container image, and apply it to the container state. All previous state will be lost.
3601    ///
3602    /// # Arguments
3603    ///
3604    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
3605    ///
3606    /// 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.
3607    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3608    pub fn from(&self, address: impl Into<String>) -> Container {
3609        let mut query = self.selection.select("from");
3610        query = query.arg("address", address.into());
3611        Container {
3612            proc: self.proc.clone(),
3613            selection: query,
3614            graphql_client: self.graphql_client.clone(),
3615        }
3616    }
3617    /// Download a container image, and apply it to the container state. All previous state will be lost.
3618    ///
3619    /// # Arguments
3620    ///
3621    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
3622    ///
3623    /// 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.
3624    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3625    pub fn from_opts<'a>(
3626        &self,
3627        address: impl Into<String>,
3628        opts: ContainerFromOpts<'a>,
3629    ) -> Container {
3630        let mut query = self.selection.select("from");
3631        query = query.arg("address", address.into());
3632        if let Some(version) = opts.version {
3633            query = query.arg("version", version);
3634        }
3635        if let Some(registry_service) = opts.registry_service {
3636            query = query.arg("registryService", registry_service);
3637        }
3638        if let Some(protocol) = opts.protocol {
3639            query = query.arg("protocol", protocol);
3640        }
3641        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
3642            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
3643        }
3644        if let Some(no_lock) = opts.no_lock {
3645            query = query.arg("noLock", no_lock);
3646        }
3647        Container {
3648            proc: self.proc.clone(),
3649            selection: query,
3650            graphql_client: self.graphql_client.clone(),
3651        }
3652    }
3653    /// 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.
3654    pub fn rootfs(&self) -> Directory {
3655        let query = self.selection.select("rootfs");
3656        Directory {
3657            proc: self.proc.clone(),
3658            selection: query,
3659            graphql_client: self.graphql_client.clone(),
3660        }
3661    }
3662    /// Change the container's root filesystem. The previous root filesystem will be lost.
3663    ///
3664    /// # Arguments
3665    ///
3666    /// * `directory` - The new root filesystem.
3667    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3668        let mut query = self.selection.select("withRootfs");
3669        query = query.arg_lazy(
3670            "directory",
3671            Box::new(move || {
3672                let directory = directory.clone();
3673                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3674            }),
3675        );
3676        Container {
3677            proc: self.proc.clone(),
3678            selection: query,
3679            graphql_client: self.graphql_client.clone(),
3680        }
3681    }
3682    /// Retrieve a directory from the container's root filesystem
3683    /// Mounts are included.
3684    ///
3685    /// # Arguments
3686    ///
3687    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3688    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3689    pub fn directory(&self, path: impl Into<String>) -> Directory {
3690        let mut query = self.selection.select("directory");
3691        query = query.arg("path", path.into());
3692        Directory {
3693            proc: self.proc.clone(),
3694            selection: query,
3695            graphql_client: self.graphql_client.clone(),
3696        }
3697    }
3698    /// Retrieve a directory from the container's root filesystem
3699    /// Mounts are included.
3700    ///
3701    /// # Arguments
3702    ///
3703    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3705    pub fn directory_opts(
3706        &self,
3707        path: impl Into<String>,
3708        opts: ContainerDirectoryOpts,
3709    ) -> Directory {
3710        let mut query = self.selection.select("directory");
3711        query = query.arg("path", path.into());
3712        if let Some(expand) = opts.expand {
3713            query = query.arg("expand", expand);
3714        }
3715        Directory {
3716            proc: self.proc.clone(),
3717            selection: query,
3718            graphql_client: self.graphql_client.clone(),
3719        }
3720    }
3721    /// Retrieves a file at the given path.
3722    /// Mounts are included.
3723    ///
3724    /// # Arguments
3725    ///
3726    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3727    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3728    pub fn file(&self, path: impl Into<String>) -> File {
3729        let mut query = self.selection.select("file");
3730        query = query.arg("path", path.into());
3731        File {
3732            proc: self.proc.clone(),
3733            selection: query,
3734            graphql_client: self.graphql_client.clone(),
3735        }
3736    }
3737    /// Retrieves a file at the given path.
3738    /// Mounts are included.
3739    ///
3740    /// # Arguments
3741    ///
3742    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3744    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3745        let mut query = self.selection.select("file");
3746        query = query.arg("path", path.into());
3747        if let Some(expand) = opts.expand {
3748            query = query.arg("expand", expand);
3749        }
3750        File {
3751            proc: self.proc.clone(),
3752            selection: query,
3753            graphql_client: self.graphql_client.clone(),
3754        }
3755    }
3756    /// Retrieves the user to be set for all commands.
3757    pub async fn user(&self) -> Result<String, DaggerError> {
3758        let query = self.selection.select("user");
3759        query.execute(self.graphql_client.clone()).await
3760    }
3761    /// Retrieves this container with a different command user.
3762    ///
3763    /// # Arguments
3764    ///
3765    /// * `name` - The user to set (e.g., "root").
3766    pub fn with_user(&self, name: impl Into<String>) -> Container {
3767        let mut query = self.selection.select("withUser");
3768        query = query.arg("name", name.into());
3769        Container {
3770            proc: self.proc.clone(),
3771            selection: query,
3772            graphql_client: self.graphql_client.clone(),
3773        }
3774    }
3775    /// Retrieves this container with an unset command user.
3776    /// Should default to root.
3777    pub fn without_user(&self) -> Container {
3778        let query = self.selection.select("withoutUser");
3779        Container {
3780            proc: self.proc.clone(),
3781            selection: query,
3782            graphql_client: self.graphql_client.clone(),
3783        }
3784    }
3785    /// Retrieves the working directory for all commands.
3786    pub async fn workdir(&self) -> Result<String, DaggerError> {
3787        let query = self.selection.select("workdir");
3788        query.execute(self.graphql_client.clone()).await
3789    }
3790    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3791    ///
3792    /// # Arguments
3793    ///
3794    /// * `path` - The path to set as the working directory (e.g., "/app").
3795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3796    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3797        let mut query = self.selection.select("withWorkdir");
3798        query = query.arg("path", path.into());
3799        Container {
3800            proc: self.proc.clone(),
3801            selection: query,
3802            graphql_client: self.graphql_client.clone(),
3803        }
3804    }
3805    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3806    ///
3807    /// # Arguments
3808    ///
3809    /// * `path` - The path to set as the working directory (e.g., "/app").
3810    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3811    pub fn with_workdir_opts(
3812        &self,
3813        path: impl Into<String>,
3814        opts: ContainerWithWorkdirOpts,
3815    ) -> Container {
3816        let mut query = self.selection.select("withWorkdir");
3817        query = query.arg("path", path.into());
3818        if let Some(expand) = opts.expand {
3819            query = query.arg("expand", expand);
3820        }
3821        Container {
3822            proc: self.proc.clone(),
3823            selection: query,
3824            graphql_client: self.graphql_client.clone(),
3825        }
3826    }
3827    /// Unset the container's working directory.
3828    /// Should default to "/".
3829    pub fn without_workdir(&self) -> Container {
3830        let query = self.selection.select("withoutWorkdir");
3831        Container {
3832            proc: self.proc.clone(),
3833            selection: query,
3834            graphql_client: self.graphql_client.clone(),
3835        }
3836    }
3837    /// Retrieves the list of persistent environment variables configured on the container.
3838    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
3839        let query = self.selection.select("envVariables");
3840        let query = query.select("id");
3841        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
3842        Ok(ids
3843            .into_iter()
3844            .map(|id| EnvVariable {
3845                proc: self.proc.clone(),
3846                selection: crate::querybuilder::query()
3847                    .select("node")
3848                    .arg("id", &id.0)
3849                    .inline_fragment("EnvVariable"),
3850                graphql_client: self.graphql_client.clone(),
3851            })
3852            .collect())
3853    }
3854    /// Retrieves the value of the specified persistent environment variable.
3855    ///
3856    /// # Arguments
3857    ///
3858    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3859    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3860        let mut query = self.selection.select("envVariable");
3861        query = query.arg("name", name.into());
3862        query.execute(self.graphql_client.clone()).await
3863    }
3864    /// Set a new environment variable in the container.
3865    ///
3866    /// # Arguments
3867    ///
3868    /// * `name` - Name of the environment variable (e.g., "HOST").
3869    /// * `value` - Value of the environment variable. (e.g., "localhost").
3870    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3871    pub fn with_env_variable(
3872        &self,
3873        name: impl Into<String>,
3874        value: impl Into<String>,
3875    ) -> Container {
3876        let mut query = self.selection.select("withEnvVariable");
3877        query = query.arg("name", name.into());
3878        query = query.arg("value", value.into());
3879        Container {
3880            proc: self.proc.clone(),
3881            selection: query,
3882            graphql_client: self.graphql_client.clone(),
3883        }
3884    }
3885    /// Set a new environment variable in the container.
3886    ///
3887    /// # Arguments
3888    ///
3889    /// * `name` - Name of the environment variable (e.g., "HOST").
3890    /// * `value` - Value of the environment variable. (e.g., "localhost").
3891    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3892    pub fn with_env_variable_opts(
3893        &self,
3894        name: impl Into<String>,
3895        value: impl Into<String>,
3896        opts: ContainerWithEnvVariableOpts,
3897    ) -> Container {
3898        let mut query = self.selection.select("withEnvVariable");
3899        query = query.arg("name", name.into());
3900        query = query.arg("value", value.into());
3901        if let Some(expand) = opts.expand {
3902            query = query.arg("expand", expand);
3903        }
3904        Container {
3905            proc: self.proc.clone(),
3906            selection: query,
3907            graphql_client: self.graphql_client.clone(),
3908        }
3909    }
3910    /// Export environment variables from an env-file to the container.
3911    ///
3912    /// # Arguments
3913    ///
3914    /// * `source` - Identifier of the envfile
3915    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
3916        let mut query = self.selection.select("withEnvFileVariables");
3917        query = query.arg_lazy(
3918            "source",
3919            Box::new(move || {
3920                let source = source.clone();
3921                Box::pin(async move { source.into_id().await.unwrap().quote() })
3922            }),
3923        );
3924        Container {
3925            proc: self.proc.clone(),
3926            selection: query,
3927            graphql_client: self.graphql_client.clone(),
3928        }
3929    }
3930    /// Set a new environment variable, using a secret value
3931    ///
3932    /// # Arguments
3933    ///
3934    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3935    /// * `secret` - Identifier of the secret value.
3936    pub fn with_secret_variable(
3937        &self,
3938        name: impl Into<String>,
3939        secret: impl IntoID<Id>,
3940    ) -> Container {
3941        let mut query = self.selection.select("withSecretVariable");
3942        query = query.arg("name", name.into());
3943        query = query.arg_lazy(
3944            "secret",
3945            Box::new(move || {
3946                let secret = secret.clone();
3947                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3948            }),
3949        );
3950        Container {
3951            proc: self.proc.clone(),
3952            selection: query,
3953            graphql_client: self.graphql_client.clone(),
3954        }
3955    }
3956    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
3957    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
3958    ///
3959    /// # Arguments
3960    ///
3961    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
3962    /// * `value` - Value of the volatile variable.
3963    pub fn with_volatile_variable(
3964        &self,
3965        name: impl Into<String>,
3966        value: impl Into<String>,
3967    ) -> Container {
3968        let mut query = self.selection.select("withVolatileVariable");
3969        query = query.arg("name", name.into());
3970        query = query.arg("value", value.into());
3971        Container {
3972            proc: self.proc.clone(),
3973            selection: query,
3974            graphql_client: self.graphql_client.clone(),
3975        }
3976    }
3977    /// Retrieves this container minus the given environment variable.
3978    ///
3979    /// # Arguments
3980    ///
3981    /// * `name` - The name of the environment variable (e.g., "HOST").
3982    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3983        let mut query = self.selection.select("withoutEnvVariable");
3984        query = query.arg("name", name.into());
3985        Container {
3986            proc: self.proc.clone(),
3987            selection: query,
3988            graphql_client: self.graphql_client.clone(),
3989        }
3990    }
3991    /// Retrieves this container minus the given environment variable containing the secret.
3992    ///
3993    /// # Arguments
3994    ///
3995    /// * `name` - The name of the environment variable (e.g., "HOST").
3996    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
3997        let mut query = self.selection.select("withoutSecretVariable");
3998        query = query.arg("name", name.into());
3999        Container {
4000            proc: self.proc.clone(),
4001            selection: query,
4002            graphql_client: self.graphql_client.clone(),
4003        }
4004    }
4005    /// Retrieves this container minus the given volatile environment variable.
4006    ///
4007    /// # Arguments
4008    ///
4009    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4010    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4011        let mut query = self.selection.select("withoutVolatileVariable");
4012        query = query.arg("name", name.into());
4013        Container {
4014            proc: self.proc.clone(),
4015            selection: query,
4016            graphql_client: self.graphql_client.clone(),
4017        }
4018    }
4019    /// Retrieves this container plus the given label.
4020    ///
4021    /// # Arguments
4022    ///
4023    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4024    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4025    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4026        let mut query = self.selection.select("withLabel");
4027        query = query.arg("name", name.into());
4028        query = query.arg("value", value.into());
4029        Container {
4030            proc: self.proc.clone(),
4031            selection: query,
4032            graphql_client: self.graphql_client.clone(),
4033        }
4034    }
4035    /// Retrieves the value of the specified label.
4036    ///
4037    /// # Arguments
4038    ///
4039    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4040    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
4041        let mut query = self.selection.select("label");
4042        query = query.arg("name", name.into());
4043        query.execute(self.graphql_client.clone()).await
4044    }
4045    /// Retrieves the list of labels passed to container.
4046    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
4047        let query = self.selection.select("labels");
4048        let query = query.select("id");
4049        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4050        Ok(ids
4051            .into_iter()
4052            .map(|id| Label {
4053                proc: self.proc.clone(),
4054                selection: crate::querybuilder::query()
4055                    .select("node")
4056                    .arg("id", &id.0)
4057                    .inline_fragment("Label"),
4058                graphql_client: self.graphql_client.clone(),
4059            })
4060            .collect())
4061    }
4062    /// Retrieves this container minus the given environment label.
4063    ///
4064    /// # Arguments
4065    ///
4066    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4067    pub fn without_label(&self, name: impl Into<String>) -> Container {
4068        let mut query = self.selection.select("withoutLabel");
4069        query = query.arg("name", name.into());
4070        Container {
4071            proc: self.proc.clone(),
4072            selection: query,
4073            graphql_client: self.graphql_client.clone(),
4074        }
4075    }
4076    /// Retrieves this container with the specificed docker healtcheck command set.
4077    ///
4078    /// # Arguments
4079    ///
4080    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4081    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4082    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4083        let mut query = self.selection.select("withDockerHealthcheck");
4084        query = query.arg(
4085            "args",
4086            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4087        );
4088        Container {
4089            proc: self.proc.clone(),
4090            selection: query,
4091            graphql_client: self.graphql_client.clone(),
4092        }
4093    }
4094    /// Retrieves this container with the specificed docker healtcheck command set.
4095    ///
4096    /// # Arguments
4097    ///
4098    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4100    pub fn with_docker_healthcheck_opts<'a>(
4101        &self,
4102        args: Vec<impl Into<String>>,
4103        opts: ContainerWithDockerHealthcheckOpts<'a>,
4104    ) -> Container {
4105        let mut query = self.selection.select("withDockerHealthcheck");
4106        query = query.arg(
4107            "args",
4108            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4109        );
4110        if let Some(shell) = opts.shell {
4111            query = query.arg("shell", shell);
4112        }
4113        if let Some(interval) = opts.interval {
4114            query = query.arg("interval", interval);
4115        }
4116        if let Some(timeout) = opts.timeout {
4117            query = query.arg("timeout", timeout);
4118        }
4119        if let Some(start_period) = opts.start_period {
4120            query = query.arg("startPeriod", start_period);
4121        }
4122        if let Some(start_interval) = opts.start_interval {
4123            query = query.arg("startInterval", start_interval);
4124        }
4125        if let Some(retries) = opts.retries {
4126            query = query.arg("retries", retries);
4127        }
4128        Container {
4129            proc: self.proc.clone(),
4130            selection: query,
4131            graphql_client: self.graphql_client.clone(),
4132        }
4133    }
4134    /// Retrieves this container without a configured docker healtcheck command.
4135    pub fn without_docker_healthcheck(&self) -> Container {
4136        let query = self.selection.select("withoutDockerHealthcheck");
4137        Container {
4138            proc: self.proc.clone(),
4139            selection: query,
4140            graphql_client: self.graphql_client.clone(),
4141        }
4142    }
4143    /// Retrieves this container's configured docker healthcheck.
4144    pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
4145        let query = self.selection.select("dockerHealthcheck");
4146        let query = query.select("id");
4147        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
4148        Ok(id.map(|id| HealthcheckConfig {
4149            proc: self.proc.clone(),
4150            selection: query
4151                .root()
4152                .select("node")
4153                .arg("id", &id.0)
4154                .inline_fragment("HealthcheckConfig"),
4155            graphql_client: self.graphql_client.clone(),
4156        }))
4157    }
4158    /// Return the container's OCI entrypoint.
4159    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
4160        let query = self.selection.select("entrypoint");
4161        query.execute(self.graphql_client.clone()).await
4162    }
4163    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4164    ///
4165    /// # Arguments
4166    ///
4167    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4168    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4169    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4170        let mut query = self.selection.select("withEntrypoint");
4171        query = query.arg(
4172            "args",
4173            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4174        );
4175        Container {
4176            proc: self.proc.clone(),
4177            selection: query,
4178            graphql_client: self.graphql_client.clone(),
4179        }
4180    }
4181    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4182    ///
4183    /// # Arguments
4184    ///
4185    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4187    pub fn with_entrypoint_opts(
4188        &self,
4189        args: Vec<impl Into<String>>,
4190        opts: ContainerWithEntrypointOpts,
4191    ) -> Container {
4192        let mut query = self.selection.select("withEntrypoint");
4193        query = query.arg(
4194            "args",
4195            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4196        );
4197        if let Some(keep_default_args) = opts.keep_default_args {
4198            query = query.arg("keepDefaultArgs", keep_default_args);
4199        }
4200        Container {
4201            proc: self.proc.clone(),
4202            selection: query,
4203            graphql_client: self.graphql_client.clone(),
4204        }
4205    }
4206    /// Reset the container's OCI entrypoint.
4207    ///
4208    /// # Arguments
4209    ///
4210    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4211    pub fn without_entrypoint(&self) -> Container {
4212        let query = self.selection.select("withoutEntrypoint");
4213        Container {
4214            proc: self.proc.clone(),
4215            selection: query,
4216            graphql_client: self.graphql_client.clone(),
4217        }
4218    }
4219    /// Reset the container's OCI entrypoint.
4220    ///
4221    /// # Arguments
4222    ///
4223    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4224    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4225        let mut query = self.selection.select("withoutEntrypoint");
4226        if let Some(keep_default_args) = opts.keep_default_args {
4227            query = query.arg("keepDefaultArgs", keep_default_args);
4228        }
4229        Container {
4230            proc: self.proc.clone(),
4231            selection: query,
4232            graphql_client: self.graphql_client.clone(),
4233        }
4234    }
4235    /// Return the container's default arguments.
4236    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
4237        let query = self.selection.select("defaultArgs");
4238        query.execute(self.graphql_client.clone()).await
4239    }
4240    /// Configures default arguments for future commands. Like CMD in Dockerfile.
4241    ///
4242    /// # Arguments
4243    ///
4244    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
4245    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4246        let mut query = self.selection.select("withDefaultArgs");
4247        query = query.arg(
4248            "args",
4249            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4250        );
4251        Container {
4252            proc: self.proc.clone(),
4253            selection: query,
4254            graphql_client: self.graphql_client.clone(),
4255        }
4256    }
4257    /// Remove the container's default arguments.
4258    pub fn without_default_args(&self) -> Container {
4259        let query = self.selection.select("withoutDefaultArgs");
4260        Container {
4261            proc: self.proc.clone(),
4262            selection: query,
4263            graphql_client: self.graphql_client.clone(),
4264        }
4265    }
4266    /// Retrieves the list of paths where a directory is mounted.
4267    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
4268        let query = self.selection.select("mounts");
4269        query.execute(self.graphql_client.clone()).await
4270    }
4271    /// Retrieves this container plus a directory mounted at the given path.
4272    ///
4273    /// # Arguments
4274    ///
4275    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4276    /// * `source` - Identifier of the mounted directory.
4277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4278    pub fn with_mounted_directory(
4279        &self,
4280        path: impl Into<String>,
4281        source: impl IntoID<Id>,
4282    ) -> Container {
4283        let mut query = self.selection.select("withMountedDirectory");
4284        query = query.arg("path", path.into());
4285        query = query.arg_lazy(
4286            "source",
4287            Box::new(move || {
4288                let source = source.clone();
4289                Box::pin(async move { source.into_id().await.unwrap().quote() })
4290            }),
4291        );
4292        Container {
4293            proc: self.proc.clone(),
4294            selection: query,
4295            graphql_client: self.graphql_client.clone(),
4296        }
4297    }
4298    /// Retrieves this container plus a directory mounted at the given path.
4299    ///
4300    /// # Arguments
4301    ///
4302    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4303    /// * `source` - Identifier of the mounted directory.
4304    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4305    pub fn with_mounted_directory_opts<'a>(
4306        &self,
4307        path: impl Into<String>,
4308        source: impl IntoID<Id>,
4309        opts: ContainerWithMountedDirectoryOpts<'a>,
4310    ) -> Container {
4311        let mut query = self.selection.select("withMountedDirectory");
4312        query = query.arg("path", path.into());
4313        query = query.arg_lazy(
4314            "source",
4315            Box::new(move || {
4316                let source = source.clone();
4317                Box::pin(async move { source.into_id().await.unwrap().quote() })
4318            }),
4319        );
4320        if let Some(owner) = opts.owner {
4321            query = query.arg("owner", owner);
4322        }
4323        if let Some(inherit_owner) = opts.inherit_owner {
4324            query = query.arg("inheritOwner", inherit_owner);
4325        }
4326        if let Some(read_only) = opts.read_only {
4327            query = query.arg("readOnly", read_only);
4328        }
4329        if let Some(expand) = opts.expand {
4330            query = query.arg("expand", expand);
4331        }
4332        Container {
4333            proc: self.proc.clone(),
4334            selection: query,
4335            graphql_client: self.graphql_client.clone(),
4336        }
4337    }
4338    /// Retrieves this container plus a file mounted at the given path.
4339    ///
4340    /// # Arguments
4341    ///
4342    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4343    /// * `source` - Identifier of the mounted file.
4344    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4345    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4346        let mut query = self.selection.select("withMountedFile");
4347        query = query.arg("path", path.into());
4348        query = query.arg_lazy(
4349            "source",
4350            Box::new(move || {
4351                let source = source.clone();
4352                Box::pin(async move { source.into_id().await.unwrap().quote() })
4353            }),
4354        );
4355        Container {
4356            proc: self.proc.clone(),
4357            selection: query,
4358            graphql_client: self.graphql_client.clone(),
4359        }
4360    }
4361    /// Retrieves this container plus a file mounted at the given path.
4362    ///
4363    /// # Arguments
4364    ///
4365    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4366    /// * `source` - Identifier of the mounted file.
4367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4368    pub fn with_mounted_file_opts<'a>(
4369        &self,
4370        path: impl Into<String>,
4371        source: impl IntoID<Id>,
4372        opts: ContainerWithMountedFileOpts<'a>,
4373    ) -> Container {
4374        let mut query = self.selection.select("withMountedFile");
4375        query = query.arg("path", path.into());
4376        query = query.arg_lazy(
4377            "source",
4378            Box::new(move || {
4379                let source = source.clone();
4380                Box::pin(async move { source.into_id().await.unwrap().quote() })
4381            }),
4382        );
4383        if let Some(owner) = opts.owner {
4384            query = query.arg("owner", owner);
4385        }
4386        if let Some(inherit_owner) = opts.inherit_owner {
4387            query = query.arg("inheritOwner", inherit_owner);
4388        }
4389        if let Some(expand) = opts.expand {
4390            query = query.arg("expand", expand);
4391        }
4392        Container {
4393            proc: self.proc.clone(),
4394            selection: query,
4395            graphql_client: self.graphql_client.clone(),
4396        }
4397    }
4398    /// 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.
4399    ///
4400    /// # Arguments
4401    ///
4402    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4403    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4404    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4405        let mut query = self.selection.select("withMountedTemp");
4406        query = query.arg("path", path.into());
4407        Container {
4408            proc: self.proc.clone(),
4409            selection: query,
4410            graphql_client: self.graphql_client.clone(),
4411        }
4412    }
4413    /// 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.
4414    ///
4415    /// # Arguments
4416    ///
4417    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4418    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4419    pub fn with_mounted_temp_opts(
4420        &self,
4421        path: impl Into<String>,
4422        opts: ContainerWithMountedTempOpts,
4423    ) -> Container {
4424        let mut query = self.selection.select("withMountedTemp");
4425        query = query.arg("path", path.into());
4426        if let Some(size) = opts.size {
4427            query = query.arg("size", size);
4428        }
4429        if let Some(expand) = opts.expand {
4430            query = query.arg("expand", expand);
4431        }
4432        Container {
4433            proc: self.proc.clone(),
4434            selection: query,
4435            graphql_client: self.graphql_client.clone(),
4436        }
4437    }
4438    /// Retrieves this container plus a cache volume mounted at the given path.
4439    ///
4440    /// # Arguments
4441    ///
4442    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4443    /// * `cache` - Identifier of the cache volume to mount.
4444    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4445    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
4446        let mut query = self.selection.select("withMountedCache");
4447        query = query.arg("path", path.into());
4448        query = query.arg_lazy(
4449            "cache",
4450            Box::new(move || {
4451                let cache = cache.clone();
4452                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4453            }),
4454        );
4455        Container {
4456            proc: self.proc.clone(),
4457            selection: query,
4458            graphql_client: self.graphql_client.clone(),
4459        }
4460    }
4461    /// Retrieves this container plus a cache volume mounted at the given path.
4462    ///
4463    /// # Arguments
4464    ///
4465    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4466    /// * `cache` - Identifier of the cache volume to mount.
4467    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4468    pub fn with_mounted_cache_opts<'a>(
4469        &self,
4470        path: impl Into<String>,
4471        cache: impl IntoID<Id>,
4472        opts: ContainerWithMountedCacheOpts<'a>,
4473    ) -> Container {
4474        let mut query = self.selection.select("withMountedCache");
4475        query = query.arg("path", path.into());
4476        query = query.arg_lazy(
4477            "cache",
4478            Box::new(move || {
4479                let cache = cache.clone();
4480                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4481            }),
4482        );
4483        if let Some(source) = opts.source {
4484            query = query.arg("source", source);
4485        }
4486        if let Some(sharing) = opts.sharing {
4487            query = query.arg("sharing", sharing);
4488        }
4489        if let Some(owner) = opts.owner {
4490            query = query.arg("owner", owner);
4491        }
4492        if let Some(inherit_owner) = opts.inherit_owner {
4493            query = query.arg("inheritOwner", inherit_owner);
4494        }
4495        if let Some(expand) = opts.expand {
4496            query = query.arg("expand", expand);
4497        }
4498        Container {
4499            proc: self.proc.clone(),
4500            selection: query,
4501            graphql_client: self.graphql_client.clone(),
4502        }
4503    }
4504    /// Retrieves this container plus a volume mounted at the given path.
4505    ///
4506    /// # Arguments
4507    ///
4508    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4509    /// * `volume` - Identifier of the volume to mount.
4510    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4511    pub fn with_mounted_volume(
4512        &self,
4513        path: impl Into<String>,
4514        volume: impl IntoID<Id>,
4515    ) -> Container {
4516        let mut query = self.selection.select("withMountedVolume");
4517        query = query.arg("path", path.into());
4518        query = query.arg_lazy(
4519            "volume",
4520            Box::new(move || {
4521                let volume = volume.clone();
4522                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4523            }),
4524        );
4525        Container {
4526            proc: self.proc.clone(),
4527            selection: query,
4528            graphql_client: self.graphql_client.clone(),
4529        }
4530    }
4531    /// Retrieves this container plus a volume mounted at the given path.
4532    ///
4533    /// # Arguments
4534    ///
4535    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
4536    /// * `volume` - Identifier of the volume to mount.
4537    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4538    pub fn with_mounted_volume_opts(
4539        &self,
4540        path: impl Into<String>,
4541        volume: impl IntoID<Id>,
4542        opts: ContainerWithMountedVolumeOpts,
4543    ) -> Container {
4544        let mut query = self.selection.select("withMountedVolume");
4545        query = query.arg("path", path.into());
4546        query = query.arg_lazy(
4547            "volume",
4548            Box::new(move || {
4549                let volume = volume.clone();
4550                Box::pin(async move { volume.into_id().await.unwrap().quote() })
4551            }),
4552        );
4553        if let Some(read_only) = opts.read_only {
4554            query = query.arg("readOnly", read_only);
4555        }
4556        if let Some(expand) = opts.expand {
4557            query = query.arg("expand", expand);
4558        }
4559        Container {
4560            proc: self.proc.clone(),
4561            selection: query,
4562            graphql_client: self.graphql_client.clone(),
4563        }
4564    }
4565    /// Retrieves this container plus a secret mounted into a file at the given path.
4566    ///
4567    /// # Arguments
4568    ///
4569    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4570    /// * `source` - Identifier of the secret to mount.
4571    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4572    pub fn with_mounted_secret(
4573        &self,
4574        path: impl Into<String>,
4575        source: impl IntoID<Id>,
4576    ) -> Container {
4577        let mut query = self.selection.select("withMountedSecret");
4578        query = query.arg("path", path.into());
4579        query = query.arg_lazy(
4580            "source",
4581            Box::new(move || {
4582                let source = source.clone();
4583                Box::pin(async move { source.into_id().await.unwrap().quote() })
4584            }),
4585        );
4586        Container {
4587            proc: self.proc.clone(),
4588            selection: query,
4589            graphql_client: self.graphql_client.clone(),
4590        }
4591    }
4592    /// Retrieves this container plus a secret mounted into a file at the given path.
4593    ///
4594    /// # Arguments
4595    ///
4596    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4597    /// * `source` - Identifier of the secret to mount.
4598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4599    pub fn with_mounted_secret_opts<'a>(
4600        &self,
4601        path: impl Into<String>,
4602        source: impl IntoID<Id>,
4603        opts: ContainerWithMountedSecretOpts<'a>,
4604    ) -> Container {
4605        let mut query = self.selection.select("withMountedSecret");
4606        query = query.arg("path", path.into());
4607        query = query.arg_lazy(
4608            "source",
4609            Box::new(move || {
4610                let source = source.clone();
4611                Box::pin(async move { source.into_id().await.unwrap().quote() })
4612            }),
4613        );
4614        if let Some(owner) = opts.owner {
4615            query = query.arg("owner", owner);
4616        }
4617        if let Some(inherit_owner) = opts.inherit_owner {
4618            query = query.arg("inheritOwner", inherit_owner);
4619        }
4620        if let Some(mode) = opts.mode {
4621            query = query.arg("mode", mode);
4622        }
4623        if let Some(expand) = opts.expand {
4624            query = query.arg("expand", expand);
4625        }
4626        Container {
4627            proc: self.proc.clone(),
4628            selection: query,
4629            graphql_client: self.graphql_client.clone(),
4630        }
4631    }
4632    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4633    ///
4634    /// # Arguments
4635    ///
4636    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4637    /// * `source` - Identifier of the socket to forward.
4638    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4639    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4640        let mut query = self.selection.select("withUnixSocket");
4641        query = query.arg("path", path.into());
4642        query = query.arg_lazy(
4643            "source",
4644            Box::new(move || {
4645                let source = source.clone();
4646                Box::pin(async move { source.into_id().await.unwrap().quote() })
4647            }),
4648        );
4649        Container {
4650            proc: self.proc.clone(),
4651            selection: query,
4652            graphql_client: self.graphql_client.clone(),
4653        }
4654    }
4655    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4656    ///
4657    /// # Arguments
4658    ///
4659    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4660    /// * `source` - Identifier of the socket to forward.
4661    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4662    pub fn with_unix_socket_opts<'a>(
4663        &self,
4664        path: impl Into<String>,
4665        source: impl IntoID<Id>,
4666        opts: ContainerWithUnixSocketOpts<'a>,
4667    ) -> Container {
4668        let mut query = self.selection.select("withUnixSocket");
4669        query = query.arg("path", path.into());
4670        query = query.arg_lazy(
4671            "source",
4672            Box::new(move || {
4673                let source = source.clone();
4674                Box::pin(async move { source.into_id().await.unwrap().quote() })
4675            }),
4676        );
4677        if let Some(owner) = opts.owner {
4678            query = query.arg("owner", owner);
4679        }
4680        if let Some(inherit_owner) = opts.inherit_owner {
4681            query = query.arg("inheritOwner", inherit_owner);
4682        }
4683        if let Some(expand) = opts.expand {
4684            query = query.arg("expand", expand);
4685        }
4686        Container {
4687            proc: self.proc.clone(),
4688            selection: query,
4689            graphql_client: self.graphql_client.clone(),
4690        }
4691    }
4692    /// Retrieves this container with a previously added Unix socket removed.
4693    ///
4694    /// # Arguments
4695    ///
4696    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4697    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4698    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4699        let mut query = self.selection.select("withoutUnixSocket");
4700        query = query.arg("path", path.into());
4701        Container {
4702            proc: self.proc.clone(),
4703            selection: query,
4704            graphql_client: self.graphql_client.clone(),
4705        }
4706    }
4707    /// Retrieves this container with a previously added Unix socket removed.
4708    ///
4709    /// # Arguments
4710    ///
4711    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4713    pub fn without_unix_socket_opts(
4714        &self,
4715        path: impl Into<String>,
4716        opts: ContainerWithoutUnixSocketOpts,
4717    ) -> Container {
4718        let mut query = self.selection.select("withoutUnixSocket");
4719        query = query.arg("path", path.into());
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 after unmounting everything at the given path.
4730    ///
4731    /// # Arguments
4732    ///
4733    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4735    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4736        let mut query = self.selection.select("withoutMount");
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 after unmounting everything at the given path.
4745    ///
4746    /// # Arguments
4747    ///
4748    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4750    pub fn without_mount_opts(
4751        &self,
4752        path: impl Into<String>,
4753        opts: ContainerWithoutMountOpts,
4754    ) -> Container {
4755        let mut query = self.selection.select("withoutMount");
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    /// Return a container snapshot with a file added
4767    ///
4768    /// # Arguments
4769    ///
4770    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4771    /// * `source` - File to add
4772    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4773    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4774        let mut query = self.selection.select("withFile");
4775        query = query.arg("path", path.into());
4776        query = query.arg_lazy(
4777            "source",
4778            Box::new(move || {
4779                let source = source.clone();
4780                Box::pin(async move { source.into_id().await.unwrap().quote() })
4781            }),
4782        );
4783        Container {
4784            proc: self.proc.clone(),
4785            selection: query,
4786            graphql_client: self.graphql_client.clone(),
4787        }
4788    }
4789    /// Return a container snapshot with a file added
4790    ///
4791    /// # Arguments
4792    ///
4793    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4794    /// * `source` - File to add
4795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4796    pub fn with_file_opts<'a>(
4797        &self,
4798        path: impl Into<String>,
4799        source: impl IntoID<Id>,
4800        opts: ContainerWithFileOpts<'a>,
4801    ) -> Container {
4802        let mut query = self.selection.select("withFile");
4803        query = query.arg("path", path.into());
4804        query = query.arg_lazy(
4805            "source",
4806            Box::new(move || {
4807                let source = source.clone();
4808                Box::pin(async move { source.into_id().await.unwrap().quote() })
4809            }),
4810        );
4811        if let Some(permissions) = opts.permissions {
4812            query = query.arg("permissions", permissions);
4813        }
4814        if let Some(owner) = opts.owner {
4815            query = query.arg("owner", owner);
4816        }
4817        if let Some(inherit_owner) = opts.inherit_owner {
4818            query = query.arg("inheritOwner", inherit_owner);
4819        }
4820        if let Some(expand) = opts.expand {
4821            query = query.arg("expand", expand);
4822        }
4823        Container {
4824            proc: self.proc.clone(),
4825            selection: query,
4826            graphql_client: self.graphql_client.clone(),
4827        }
4828    }
4829    /// Retrieves this container with the file at the given path removed.
4830    ///
4831    /// # Arguments
4832    ///
4833    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4834    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4835    pub fn without_file(&self, path: impl Into<String>) -> Container {
4836        let mut query = self.selection.select("withoutFile");
4837        query = query.arg("path", path.into());
4838        Container {
4839            proc: self.proc.clone(),
4840            selection: query,
4841            graphql_client: self.graphql_client.clone(),
4842        }
4843    }
4844    /// Retrieves this container with the file at the given path removed.
4845    ///
4846    /// # Arguments
4847    ///
4848    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4850    pub fn without_file_opts(
4851        &self,
4852        path: impl Into<String>,
4853        opts: ContainerWithoutFileOpts,
4854    ) -> Container {
4855        let mut query = self.selection.select("withoutFile");
4856        query = query.arg("path", path.into());
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    /// Return a new container spanshot with specified files removed
4867    ///
4868    /// # Arguments
4869    ///
4870    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4871    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4872    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4873        let mut query = self.selection.select("withoutFiles");
4874        query = query.arg(
4875            "paths",
4876            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4877        );
4878        Container {
4879            proc: self.proc.clone(),
4880            selection: query,
4881            graphql_client: self.graphql_client.clone(),
4882        }
4883    }
4884    /// Return a new container spanshot with specified files removed
4885    ///
4886    /// # Arguments
4887    ///
4888    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4889    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4890    pub fn without_files_opts(
4891        &self,
4892        paths: Vec<impl Into<String>>,
4893        opts: ContainerWithoutFilesOpts,
4894    ) -> Container {
4895        let mut query = self.selection.select("withoutFiles");
4896        query = query.arg(
4897            "paths",
4898            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4899        );
4900        if let Some(expand) = opts.expand {
4901            query = query.arg("expand", expand);
4902        }
4903        Container {
4904            proc: self.proc.clone(),
4905            selection: query,
4906            graphql_client: self.graphql_client.clone(),
4907        }
4908    }
4909    /// Retrieves this container plus the contents of the given files copied to the given path.
4910    ///
4911    /// # Arguments
4912    ///
4913    /// * `path` - Location where copied files should be placed (e.g., "/src").
4914    /// * `sources` - Identifiers of the files to copy.
4915    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4916    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
4917        let mut query = self.selection.select("withFiles");
4918        query = query.arg("path", path.into());
4919        query = query.arg("sources", sources);
4920        Container {
4921            proc: self.proc.clone(),
4922            selection: query,
4923            graphql_client: self.graphql_client.clone(),
4924        }
4925    }
4926    /// Retrieves this container plus the contents of the given files copied to the given path.
4927    ///
4928    /// # Arguments
4929    ///
4930    /// * `path` - Location where copied files should be placed (e.g., "/src").
4931    /// * `sources` - Identifiers of the files to copy.
4932    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4933    pub fn with_files_opts<'a>(
4934        &self,
4935        path: impl Into<String>,
4936        sources: Vec<Id>,
4937        opts: ContainerWithFilesOpts<'a>,
4938    ) -> Container {
4939        let mut query = self.selection.select("withFiles");
4940        query = query.arg("path", path.into());
4941        query = query.arg("sources", sources);
4942        if let Some(permissions) = opts.permissions {
4943            query = query.arg("permissions", permissions);
4944        }
4945        if let Some(owner) = opts.owner {
4946            query = query.arg("owner", owner);
4947        }
4948        if let Some(inherit_owner) = opts.inherit_owner {
4949            query = query.arg("inheritOwner", inherit_owner);
4950        }
4951        if let Some(expand) = opts.expand {
4952            query = query.arg("expand", expand);
4953        }
4954        Container {
4955            proc: self.proc.clone(),
4956            selection: query,
4957            graphql_client: self.graphql_client.clone(),
4958        }
4959    }
4960    /// Return a new container snapshot, with a file added to its filesystem with text content
4961    ///
4962    /// # Arguments
4963    ///
4964    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4965    /// * `contents` - Contents of the new file. Example: "Hello world!"
4966    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4967    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4968        let mut query = self.selection.select("withNewFile");
4969        query = query.arg("path", path.into());
4970        query = query.arg("contents", contents.into());
4971        Container {
4972            proc: self.proc.clone(),
4973            selection: query,
4974            graphql_client: self.graphql_client.clone(),
4975        }
4976    }
4977    /// Return a new container snapshot, with a file added to its filesystem with text content
4978    ///
4979    /// # Arguments
4980    ///
4981    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4982    /// * `contents` - Contents of the new file. Example: "Hello world!"
4983    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4984    pub fn with_new_file_opts<'a>(
4985        &self,
4986        path: impl Into<String>,
4987        contents: impl Into<String>,
4988        opts: ContainerWithNewFileOpts<'a>,
4989    ) -> Container {
4990        let mut query = self.selection.select("withNewFile");
4991        query = query.arg("path", path.into());
4992        query = query.arg("contents", contents.into());
4993        if let Some(permissions) = opts.permissions {
4994            query = query.arg("permissions", permissions);
4995        }
4996        if let Some(owner) = opts.owner {
4997            query = query.arg("owner", owner);
4998        }
4999        if let Some(inherit_owner) = opts.inherit_owner {
5000            query = query.arg("inheritOwner", inherit_owner);
5001        }
5002        if let Some(expand) = opts.expand {
5003            query = query.arg("expand", expand);
5004        }
5005        Container {
5006            proc: self.proc.clone(),
5007            selection: query,
5008            graphql_client: self.graphql_client.clone(),
5009        }
5010    }
5011    /// Return a new container snapshot, with a directory added to its filesystem
5012    ///
5013    /// # Arguments
5014    ///
5015    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
5016    /// * `source` - Identifier of the directory to write
5017    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5018    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
5019        let mut query = self.selection.select("withDirectory");
5020        query = query.arg("path", path.into());
5021        query = query.arg_lazy(
5022            "source",
5023            Box::new(move || {
5024                let source = source.clone();
5025                Box::pin(async move { source.into_id().await.unwrap().quote() })
5026            }),
5027        );
5028        Container {
5029            proc: self.proc.clone(),
5030            selection: query,
5031            graphql_client: self.graphql_client.clone(),
5032        }
5033    }
5034    /// Return a new container snapshot, with a directory added to its filesystem
5035    ///
5036    /// # Arguments
5037    ///
5038    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
5039    /// * `source` - Identifier of the directory to write
5040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5041    pub fn with_directory_opts<'a>(
5042        &self,
5043        path: impl Into<String>,
5044        source: impl IntoID<Id>,
5045        opts: ContainerWithDirectoryOpts<'a>,
5046    ) -> Container {
5047        let mut query = self.selection.select("withDirectory");
5048        query = query.arg("path", path.into());
5049        query = query.arg_lazy(
5050            "source",
5051            Box::new(move || {
5052                let source = source.clone();
5053                Box::pin(async move { source.into_id().await.unwrap().quote() })
5054            }),
5055        );
5056        if let Some(exclude) = opts.exclude {
5057            query = query.arg("exclude", exclude);
5058        }
5059        if let Some(include) = opts.include {
5060            query = query.arg("include", include);
5061        }
5062        if let Some(gitignore) = opts.gitignore {
5063            query = query.arg("gitignore", gitignore);
5064        }
5065        if let Some(owner) = opts.owner {
5066            query = query.arg("owner", owner);
5067        }
5068        if let Some(inherit_owner) = opts.inherit_owner {
5069            query = query.arg("inheritOwner", inherit_owner);
5070        }
5071        if let Some(expand) = opts.expand {
5072            query = query.arg("expand", expand);
5073        }
5074        if let Some(permissions) = opts.permissions {
5075            query = query.arg("permissions", permissions);
5076        }
5077        Container {
5078            proc: self.proc.clone(),
5079            selection: query,
5080            graphql_client: self.graphql_client.clone(),
5081        }
5082    }
5083    /// Return a new container snapshot, with a directory removed from its filesystem
5084    ///
5085    /// # Arguments
5086    ///
5087    /// * `path` - Location of the directory to remove (e.g., ".github/").
5088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5089    pub fn without_directory(&self, path: impl Into<String>) -> Container {
5090        let mut query = self.selection.select("withoutDirectory");
5091        query = query.arg("path", path.into());
5092        Container {
5093            proc: self.proc.clone(),
5094            selection: query,
5095            graphql_client: self.graphql_client.clone(),
5096        }
5097    }
5098    /// Return a new container snapshot, with a directory removed from its filesystem
5099    ///
5100    /// # Arguments
5101    ///
5102    /// * `path` - Location of the directory to remove (e.g., ".github/").
5103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5104    pub fn without_directory_opts(
5105        &self,
5106        path: impl Into<String>,
5107        opts: ContainerWithoutDirectoryOpts,
5108    ) -> Container {
5109        let mut query = self.selection.select("withoutDirectory");
5110        query = query.arg("path", path.into());
5111        if let Some(expand) = opts.expand {
5112            query = query.arg("expand", expand);
5113        }
5114        Container {
5115            proc: self.proc.clone(),
5116            selection: query,
5117            graphql_client: self.graphql_client.clone(),
5118        }
5119    }
5120    /// check if a file or directory exists
5121    ///
5122    /// # Arguments
5123    ///
5124    /// * `path` - Path to check (e.g., "/file.txt").
5125    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5126    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5127        let mut query = self.selection.select("exists");
5128        query = query.arg("path", path.into());
5129        query.execute(self.graphql_client.clone()).await
5130    }
5131    /// check if a file or directory exists
5132    ///
5133    /// # Arguments
5134    ///
5135    /// * `path` - Path to check (e.g., "/file.txt").
5136    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5137    pub async fn exists_opts(
5138        &self,
5139        path: impl Into<String>,
5140        opts: ContainerExistsOpts,
5141    ) -> Result<bool, DaggerError> {
5142        let mut query = self.selection.select("exists");
5143        query = query.arg("path", path.into());
5144        if let Some(expected_type) = opts.expected_type {
5145            query = query.arg("expectedType", expected_type);
5146        }
5147        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5148            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5149        }
5150        if let Some(expand) = opts.expand {
5151            query = query.arg("expand", expand);
5152        }
5153        query.execute(self.graphql_client.clone()).await
5154    }
5155    /// Return file status
5156    ///
5157    /// # Arguments
5158    ///
5159    /// * `path` - Path to check (e.g., "/file.txt").
5160    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5161    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5162        let mut query = self.selection.select("stat");
5163        query = query.arg("path", path.into());
5164        let query = query.select("id");
5165        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5166        Ok(id.map(|id| Stat {
5167            proc: self.proc.clone(),
5168            selection: query
5169                .root()
5170                .select("node")
5171                .arg("id", &id.0)
5172                .inline_fragment("Stat"),
5173            graphql_client: self.graphql_client.clone(),
5174        }))
5175    }
5176    /// Return file status
5177    ///
5178    /// # Arguments
5179    ///
5180    /// * `path` - Path to check (e.g., "/file.txt").
5181    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5182    pub async fn stat_opts(
5183        &self,
5184        path: impl Into<String>,
5185        opts: ContainerStatOpts,
5186    ) -> Result<Option<Stat>, DaggerError> {
5187        let mut query = self.selection.select("stat");
5188        query = query.arg("path", path.into());
5189        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5190            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5191        }
5192        let query = query.select("id");
5193        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5194        Ok(id.map(|id| Stat {
5195            proc: self.proc.clone(),
5196            selection: query
5197                .root()
5198                .select("node")
5199                .arg("id", &id.0)
5200                .inline_fragment("Stat"),
5201            graphql_client: self.graphql_client.clone(),
5202        }))
5203    }
5204    /// Raise an error.
5205    ///
5206    /// # Arguments
5207    ///
5208    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5209    pub fn with_error(&self, err: impl Into<String>) -> Container {
5210        let mut query = self.selection.select("withError");
5211        query = query.arg("err", err.into());
5212        Container {
5213            proc: self.proc.clone(),
5214            selection: query,
5215            graphql_client: self.graphql_client.clone(),
5216        }
5217    }
5218    /// Execute a command in the container, and return a new snapshot of the container state after execution.
5219    ///
5220    /// # Arguments
5221    ///
5222    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
5223    ///
5224    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
5225    ///
5226    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
5227    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5228    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
5229        let mut query = self.selection.select("withExec");
5230        query = query.arg(
5231            "args",
5232            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5233        );
5234        Container {
5235            proc: self.proc.clone(),
5236            selection: query,
5237            graphql_client: self.graphql_client.clone(),
5238        }
5239    }
5240    /// Execute a command in the container, and return a new snapshot of the container state after execution.
5241    ///
5242    /// # Arguments
5243    ///
5244    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
5245    ///
5246    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
5247    ///
5248    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
5249    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5250    pub fn with_exec_opts<'a>(
5251        &self,
5252        args: Vec<impl Into<String>>,
5253        opts: ContainerWithExecOpts<'a>,
5254    ) -> Container {
5255        let mut query = self.selection.select("withExec");
5256        query = query.arg(
5257            "args",
5258            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5259        );
5260        if let Some(use_entrypoint) = opts.use_entrypoint {
5261            query = query.arg("useEntrypoint", use_entrypoint);
5262        }
5263        if let Some(stdin) = opts.stdin {
5264            query = query.arg("stdin", stdin);
5265        }
5266        if let Some(redirect_stdin) = opts.redirect_stdin {
5267            query = query.arg("redirectStdin", redirect_stdin);
5268        }
5269        if let Some(redirect_stdout) = opts.redirect_stdout {
5270            query = query.arg("redirectStdout", redirect_stdout);
5271        }
5272        if let Some(redirect_stderr) = opts.redirect_stderr {
5273            query = query.arg("redirectStderr", redirect_stderr);
5274        }
5275        if let Some(expect) = opts.expect {
5276            query = query.arg("expect", expect);
5277        }
5278        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5279            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5280        }
5281        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5282            query = query.arg(
5283                "experimentalPrivilegedNesting",
5284                experimental_privileged_nesting,
5285            );
5286        }
5287        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
5288            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
5289        }
5290        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5291            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5292        }
5293        if let Some(expand) = opts.expand {
5294            query = query.arg("expand", expand);
5295        }
5296        if let Some(no_init) = opts.no_init {
5297            query = query.arg("noInit", no_init);
5298        }
5299        Container {
5300            proc: self.proc.clone(),
5301            selection: query,
5302            graphql_client: self.graphql_client.clone(),
5303        }
5304    }
5305    /// The buffered standard output stream of the last executed command
5306    /// Returns an error if no command was executed
5307    pub async fn stdout(&self) -> Result<String, DaggerError> {
5308        let query = self.selection.select("stdout");
5309        query.execute(self.graphql_client.clone()).await
5310    }
5311    /// The buffered standard error stream of the last executed command
5312    /// Returns an error if no command was executed
5313    pub async fn stderr(&self) -> Result<String, DaggerError> {
5314        let query = self.selection.select("stderr");
5315        query.execute(self.graphql_client.clone()).await
5316    }
5317    /// The combined buffered standard output and standard error stream of the last executed command
5318    /// Returns an error if no command was executed
5319    pub async fn combined_output(&self) -> Result<String, DaggerError> {
5320        let query = self.selection.select("combinedOutput");
5321        query.execute(self.graphql_client.clone()).await
5322    }
5323    /// The exit code of the last executed command
5324    /// Returns an error if no command was executed
5325    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
5326        let query = self.selection.select("exitCode");
5327        query.execute(self.graphql_client.clone()).await
5328    }
5329    /// Return a snapshot with a symlink
5330    ///
5331    /// # Arguments
5332    ///
5333    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5334    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5335    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5336    pub fn with_symlink(
5337        &self,
5338        target: impl Into<String>,
5339        link_name: impl Into<String>,
5340    ) -> Container {
5341        let mut query = self.selection.select("withSymlink");
5342        query = query.arg("target", target.into());
5343        query = query.arg("linkName", link_name.into());
5344        Container {
5345            proc: self.proc.clone(),
5346            selection: query,
5347            graphql_client: self.graphql_client.clone(),
5348        }
5349    }
5350    /// Return a snapshot with a symlink
5351    ///
5352    /// # Arguments
5353    ///
5354    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5355    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5357    pub fn with_symlink_opts(
5358        &self,
5359        target: impl Into<String>,
5360        link_name: impl Into<String>,
5361        opts: ContainerWithSymlinkOpts,
5362    ) -> Container {
5363        let mut query = self.selection.select("withSymlink");
5364        query = query.arg("target", target.into());
5365        query = query.arg("linkName", link_name.into());
5366        if let Some(expand) = opts.expand {
5367            query = query.arg("expand", expand);
5368        }
5369        Container {
5370            proc: self.proc.clone(),
5371            selection: query,
5372            graphql_client: self.graphql_client.clone(),
5373        }
5374    }
5375    /// Retrieves this container plus the given OCI annotation.
5376    ///
5377    /// # Arguments
5378    ///
5379    /// * `name` - The name of the annotation.
5380    /// * `value` - The value of the annotation.
5381    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
5382        let mut query = self.selection.select("withAnnotation");
5383        query = query.arg("name", name.into());
5384        query = query.arg("value", value.into());
5385        Container {
5386            proc: self.proc.clone(),
5387            selection: query,
5388            graphql_client: self.graphql_client.clone(),
5389        }
5390    }
5391    /// Retrieves this container minus the given OCI annotation.
5392    ///
5393    /// # Arguments
5394    ///
5395    /// * `name` - The name of the annotation.
5396    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5397        let mut query = self.selection.select("withoutAnnotation");
5398        query = query.arg("name", name.into());
5399        Container {
5400            proc: self.proc.clone(),
5401            selection: query,
5402            graphql_client: self.graphql_client.clone(),
5403        }
5404    }
5405    /// Package the container state as an OCI image, and publish it to a registry
5406    /// Returns the fully qualified address of the published image, with digest
5407    ///
5408    /// # Arguments
5409    ///
5410    /// * `address` - The OCI address to publish to
5411    ///
5412    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
5413    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5414    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
5415        let mut query = self.selection.select("publish");
5416        query = query.arg("address", address.into());
5417        query.execute(self.graphql_client.clone()).await
5418    }
5419    /// Package the container state as an OCI image, and publish it to a registry
5420    /// Returns the fully qualified address of the published image, with digest
5421    ///
5422    /// # Arguments
5423    ///
5424    /// * `address` - The OCI address to publish to
5425    ///
5426    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
5427    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5428    pub async fn publish_opts(
5429        &self,
5430        address: impl Into<String>,
5431        opts: ContainerPublishOpts,
5432    ) -> Result<String, DaggerError> {
5433        let mut query = self.selection.select("publish");
5434        query = query.arg("address", address.into());
5435        if let Some(platform_variants) = opts.platform_variants {
5436            query = query.arg("platformVariants", platform_variants);
5437        }
5438        if let Some(forced_compression) = opts.forced_compression {
5439            query = query.arg("forcedCompression", forced_compression);
5440        }
5441        if let Some(media_types) = opts.media_types {
5442            query = query.arg("mediaTypes", media_types);
5443        }
5444        if let Some(registry_service) = opts.registry_service {
5445            query = query.arg("registryService", registry_service);
5446        }
5447        if let Some(protocol) = opts.protocol {
5448            query = query.arg("protocol", protocol);
5449        }
5450        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
5451            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
5452        }
5453        query.execute(self.graphql_client.clone()).await
5454    }
5455    /// The platform this container executes and publishes as.
5456    pub async fn platform(&self) -> Result<Platform, DaggerError> {
5457        let query = self.selection.select("platform");
5458        query.execute(self.graphql_client.clone()).await
5459    }
5460    /// Writes the container as an OCI tarball to the destination file path on the host.
5461    /// It can also export platform variants.
5462    ///
5463    /// # Arguments
5464    ///
5465    /// * `path` - Host's destination path (e.g., "./tarball").
5466    ///
5467    /// Path can be relative to the engine's workdir or absolute.
5468    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5469    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5470        let mut query = self.selection.select("export");
5471        query = query.arg("path", path.into());
5472        query.execute(self.graphql_client.clone()).await
5473    }
5474    /// Writes the container as an OCI tarball to the destination file path on the host.
5475    /// It can also export platform variants.
5476    ///
5477    /// # Arguments
5478    ///
5479    /// * `path` - Host's destination path (e.g., "./tarball").
5480    ///
5481    /// Path can be relative to the engine's workdir or absolute.
5482    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5483    pub async fn export_opts(
5484        &self,
5485        path: impl Into<String>,
5486        opts: ContainerExportOpts,
5487    ) -> Result<String, DaggerError> {
5488        let mut query = self.selection.select("export");
5489        query = query.arg("path", path.into());
5490        if let Some(platform_variants) = opts.platform_variants {
5491            query = query.arg("platformVariants", platform_variants);
5492        }
5493        if let Some(forced_compression) = opts.forced_compression {
5494            query = query.arg("forcedCompression", forced_compression);
5495        }
5496        if let Some(media_types) = opts.media_types {
5497            query = query.arg("mediaTypes", media_types);
5498        }
5499        if let Some(expand) = opts.expand {
5500            query = query.arg("expand", expand);
5501        }
5502        query.execute(self.graphql_client.clone()).await
5503    }
5504    /// Exports the container as an image to the host's container image store.
5505    ///
5506    /// # Arguments
5507    ///
5508    /// * `name` - Name of image to export to in the host's store
5509    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5510    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
5511        let mut query = self.selection.select("exportImage");
5512        query = query.arg("name", name.into());
5513        query.execute(self.graphql_client.clone()).await
5514    }
5515    /// Exports the container as an image to the host's container image store.
5516    ///
5517    /// # Arguments
5518    ///
5519    /// * `name` - Name of image to export to in the host's store
5520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5521    pub async fn export_image_opts(
5522        &self,
5523        name: impl Into<String>,
5524        opts: ContainerExportImageOpts,
5525    ) -> Result<Void, DaggerError> {
5526        let mut query = self.selection.select("exportImage");
5527        query = query.arg("name", name.into());
5528        if let Some(platform_variants) = opts.platform_variants {
5529            query = query.arg("platformVariants", platform_variants);
5530        }
5531        if let Some(forced_compression) = opts.forced_compression {
5532            query = query.arg("forcedCompression", forced_compression);
5533        }
5534        if let Some(media_types) = opts.media_types {
5535            query = query.arg("mediaTypes", media_types);
5536        }
5537        query.execute(self.graphql_client.clone()).await
5538    }
5539    /// Package the container state as an OCI image, and return it as a tar archive
5540    ///
5541    /// # Arguments
5542    ///
5543    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5544    pub fn as_tarball(&self) -> File {
5545        let query = self.selection.select("asTarball");
5546        File {
5547            proc: self.proc.clone(),
5548            selection: query,
5549            graphql_client: self.graphql_client.clone(),
5550        }
5551    }
5552    /// Package the container state as an OCI image, and return it as a tar archive
5553    ///
5554    /// # Arguments
5555    ///
5556    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5557    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
5558        let mut query = self.selection.select("asTarball");
5559        if let Some(platform_variants) = opts.platform_variants {
5560            query = query.arg("platformVariants", platform_variants);
5561        }
5562        if let Some(forced_compression) = opts.forced_compression {
5563            query = query.arg("forcedCompression", forced_compression);
5564        }
5565        if let Some(media_types) = opts.media_types {
5566            query = query.arg("mediaTypes", media_types);
5567        }
5568        File {
5569            proc: self.proc.clone(),
5570            selection: query,
5571            graphql_client: self.graphql_client.clone(),
5572        }
5573    }
5574    /// Reads the container from an OCI tarball.
5575    ///
5576    /// # Arguments
5577    ///
5578    /// * `source` - File to read the container from.
5579    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5580    pub fn import(&self, source: impl IntoID<Id>) -> Container {
5581        let mut query = self.selection.select("import");
5582        query = query.arg_lazy(
5583            "source",
5584            Box::new(move || {
5585                let source = source.clone();
5586                Box::pin(async move { source.into_id().await.unwrap().quote() })
5587            }),
5588        );
5589        Container {
5590            proc: self.proc.clone(),
5591            selection: query,
5592            graphql_client: self.graphql_client.clone(),
5593        }
5594    }
5595    /// Reads the container from an OCI tarball.
5596    ///
5597    /// # Arguments
5598    ///
5599    /// * `source` - File to read the container from.
5600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5601    pub fn import_opts<'a>(
5602        &self,
5603        source: impl IntoID<Id>,
5604        opts: ContainerImportOpts<'a>,
5605    ) -> Container {
5606        let mut query = self.selection.select("import");
5607        query = query.arg_lazy(
5608            "source",
5609            Box::new(move || {
5610                let source = source.clone();
5611                Box::pin(async move { source.into_id().await.unwrap().quote() })
5612            }),
5613        );
5614        if let Some(tag) = opts.tag {
5615            query = query.arg("tag", tag);
5616        }
5617        Container {
5618            proc: self.proc.clone(),
5619            selection: query,
5620            graphql_client: self.graphql_client.clone(),
5621        }
5622    }
5623    /// Attach credentials for future publishing to a registry. Use in combination with publish
5624    ///
5625    /// # Arguments
5626    ///
5627    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
5628    /// * `username` - The username to authenticate with. Example: "alice"
5629    /// * `secret` - The API key, password or token to authenticate to this registry
5630    pub fn with_registry_auth(
5631        &self,
5632        address: impl Into<String>,
5633        username: impl Into<String>,
5634        secret: impl IntoID<Id>,
5635    ) -> Container {
5636        let mut query = self.selection.select("withRegistryAuth");
5637        query = query.arg("address", address.into());
5638        query = query.arg("username", username.into());
5639        query = query.arg_lazy(
5640            "secret",
5641            Box::new(move || {
5642                let secret = secret.clone();
5643                Box::pin(async move { secret.into_id().await.unwrap().quote() })
5644            }),
5645        );
5646        Container {
5647            proc: self.proc.clone(),
5648            selection: query,
5649            graphql_client: self.graphql_client.clone(),
5650        }
5651    }
5652    /// Retrieves this container without the registry authentication of a given address.
5653    ///
5654    /// # Arguments
5655    ///
5656    /// * `address` - Registry's address to remove the authentication from.
5657    ///
5658    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5659    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5660        let mut query = self.selection.select("withoutRegistryAuth");
5661        query = query.arg("address", address.into());
5662        Container {
5663            proc: self.proc.clone(),
5664            selection: query,
5665            graphql_client: self.graphql_client.clone(),
5666        }
5667    }
5668    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
5669    pub async fn image_ref(&self) -> Result<String, DaggerError> {
5670        let query = self.selection.select("imageRef");
5671        query.execute(self.graphql_client.clone()).await
5672    }
5673    /// Computes and returns the manifest for this container as a File.
5674    ///
5675    /// # Arguments
5676    ///
5677    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5678    pub fn manifest(&self) -> File {
5679        let query = self.selection.select("manifest");
5680        File {
5681            proc: self.proc.clone(),
5682            selection: query,
5683            graphql_client: self.graphql_client.clone(),
5684        }
5685    }
5686    /// Computes and returns the manifest for this container as a File.
5687    ///
5688    /// # Arguments
5689    ///
5690    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5691    pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
5692        let mut query = self.selection.select("manifest");
5693        if let Some(forced_compression) = opts.forced_compression {
5694            query = query.arg("forcedCompression", forced_compression);
5695        }
5696        if let Some(media_types) = opts.media_types {
5697            query = query.arg("mediaTypes", media_types);
5698        }
5699        File {
5700            proc: self.proc.clone(),
5701            selection: query,
5702            graphql_client: self.graphql_client.clone(),
5703        }
5704    }
5705    /// Returns the image layer or configuration blob with the given digest as a File.
5706    ///
5707    /// # Arguments
5708    ///
5709    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
5710    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5711    pub fn layer(&self, id: impl Into<String>) -> File {
5712        let mut query = self.selection.select("layer");
5713        query = query.arg("id", id.into());
5714        File {
5715            proc: self.proc.clone(),
5716            selection: query,
5717            graphql_client: self.graphql_client.clone(),
5718        }
5719    }
5720    /// Returns the image layer or configuration blob with the given digest as a File.
5721    ///
5722    /// # Arguments
5723    ///
5724    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
5725    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5726    pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
5727        let mut query = self.selection.select("layer");
5728        query = query.arg("id", id.into());
5729        if let Some(forced_compression) = opts.forced_compression {
5730            query = query.arg("forcedCompression", forced_compression);
5731        }
5732        if let Some(media_types) = opts.media_types {
5733            query = query.arg("mediaTypes", media_types);
5734        }
5735        File {
5736            proc: self.proc.clone(),
5737            selection: query,
5738            graphql_client: self.graphql_client.clone(),
5739        }
5740    }
5741    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
5742    /// Exposed ports serve two purposes:
5743    /// - For health checks and introspection, when running services
5744    /// - For setting the EXPOSE OCI field when publishing the container
5745    ///
5746    /// # Arguments
5747    ///
5748    /// * `port` - Port number to expose. Example: 8080
5749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5750    pub fn with_exposed_port(&self, port: isize) -> Container {
5751        let mut query = self.selection.select("withExposedPort");
5752        query = query.arg("port", port);
5753        Container {
5754            proc: self.proc.clone(),
5755            selection: query,
5756            graphql_client: self.graphql_client.clone(),
5757        }
5758    }
5759    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
5760    /// Exposed ports serve two purposes:
5761    /// - For health checks and introspection, when running services
5762    /// - For setting the EXPOSE OCI field when publishing the container
5763    ///
5764    /// # Arguments
5765    ///
5766    /// * `port` - Port number to expose. Example: 8080
5767    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5768    pub fn with_exposed_port_opts<'a>(
5769        &self,
5770        port: isize,
5771        opts: ContainerWithExposedPortOpts<'a>,
5772    ) -> Container {
5773        let mut query = self.selection.select("withExposedPort");
5774        query = query.arg("port", port);
5775        if let Some(protocol) = opts.protocol {
5776            query = query.arg("protocol", protocol);
5777        }
5778        if let Some(description) = opts.description {
5779            query = query.arg("description", description);
5780        }
5781        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
5782            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
5783        }
5784        Container {
5785            proc: self.proc.clone(),
5786            selection: query,
5787            graphql_client: self.graphql_client.clone(),
5788        }
5789    }
5790    /// Unexpose a previously exposed port.
5791    ///
5792    /// # Arguments
5793    ///
5794    /// * `port` - Port number to unexpose
5795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5796    pub fn without_exposed_port(&self, port: isize) -> Container {
5797        let mut query = self.selection.select("withoutExposedPort");
5798        query = query.arg("port", port);
5799        Container {
5800            proc: self.proc.clone(),
5801            selection: query,
5802            graphql_client: self.graphql_client.clone(),
5803        }
5804    }
5805    /// Unexpose a previously exposed port.
5806    ///
5807    /// # Arguments
5808    ///
5809    /// * `port` - Port number to unexpose
5810    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5811    pub fn without_exposed_port_opts(
5812        &self,
5813        port: isize,
5814        opts: ContainerWithoutExposedPortOpts,
5815    ) -> Container {
5816        let mut query = self.selection.select("withoutExposedPort");
5817        query = query.arg("port", port);
5818        if let Some(protocol) = opts.protocol {
5819            query = query.arg("protocol", protocol);
5820        }
5821        Container {
5822            proc: self.proc.clone(),
5823            selection: query,
5824            graphql_client: self.graphql_client.clone(),
5825        }
5826    }
5827    /// Retrieves the list of exposed ports.
5828    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
5829    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
5830        let query = self.selection.select("exposedPorts");
5831        let query = query.select("id");
5832        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5833        Ok(ids
5834            .into_iter()
5835            .map(|id| Port {
5836                proc: self.proc.clone(),
5837                selection: crate::querybuilder::query()
5838                    .select("node")
5839                    .arg("id", &id.0)
5840                    .inline_fragment("Port"),
5841                graphql_client: self.graphql_client.clone(),
5842            })
5843            .collect())
5844    }
5845    /// Establish a runtime dependency from a container to a network service.
5846    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
5847    /// The service will be reachable from the container via the provided hostname alias.
5848    /// The service dependency will also convey to any files or directories produced by the container.
5849    ///
5850    /// # Arguments
5851    ///
5852    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
5853    /// * `service` - The target service
5854    pub fn with_service_binding(
5855        &self,
5856        alias: impl Into<String>,
5857        service: impl IntoID<Id>,
5858    ) -> Container {
5859        let mut query = self.selection.select("withServiceBinding");
5860        query = query.arg("alias", alias.into());
5861        query = query.arg_lazy(
5862            "service",
5863            Box::new(move || {
5864                let service = service.clone();
5865                Box::pin(async move { service.into_id().await.unwrap().quote() })
5866            }),
5867        );
5868        Container {
5869            proc: self.proc.clone(),
5870            selection: query,
5871            graphql_client: self.graphql_client.clone(),
5872        }
5873    }
5874    /// Set the default command to invoke for the container's terminal API.
5875    ///
5876    /// # Arguments
5877    ///
5878    /// * `args` - The args of the command.
5879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5880    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
5881        let mut query = self.selection.select("withDefaultTerminalCmd");
5882        query = query.arg(
5883            "args",
5884            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5885        );
5886        Container {
5887            proc: self.proc.clone(),
5888            selection: query,
5889            graphql_client: self.graphql_client.clone(),
5890        }
5891    }
5892    /// Set the default command to invoke for the container's terminal API.
5893    ///
5894    /// # Arguments
5895    ///
5896    /// * `args` - The args of the command.
5897    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5898    pub fn with_default_terminal_cmd_opts(
5899        &self,
5900        args: Vec<impl Into<String>>,
5901        opts: ContainerWithDefaultTerminalCmdOpts,
5902    ) -> Container {
5903        let mut query = self.selection.select("withDefaultTerminalCmd");
5904        query = query.arg(
5905            "args",
5906            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5907        );
5908        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5909            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5910        }
5911        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5912            query = query.arg(
5913                "experimentalPrivilegedNesting",
5914                experimental_privileged_nesting,
5915            );
5916        }
5917        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5918            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5919        }
5920        Container {
5921            proc: self.proc.clone(),
5922            selection: query,
5923            graphql_client: self.graphql_client.clone(),
5924        }
5925    }
5926    /// Set the shell used by terminal() and withRun().
5927    ///
5928    /// # Arguments
5929    ///
5930    /// * `interactive` - Command arguments for interactive use. Example: ["sh"].
5931    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5932    pub fn with_shell(&self, interactive: Vec<impl Into<String>>) -> Container {
5933        let mut query = self.selection.select("withShell");
5934        query = query.arg(
5935            "interactive",
5936            interactive
5937                .into_iter()
5938                .map(|i| i.into())
5939                .collect::<Vec<String>>(),
5940        );
5941        Container {
5942            proc: self.proc.clone(),
5943            selection: query,
5944            graphql_client: self.graphql_client.clone(),
5945        }
5946    }
5947    /// Set the shell used by terminal() and withRun().
5948    ///
5949    /// # Arguments
5950    ///
5951    /// * `interactive` - Command arguments for interactive use. Example: ["sh"].
5952    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5953    pub fn with_shell_opts<'a>(
5954        &self,
5955        interactive: Vec<impl Into<String>>,
5956        opts: ContainerWithShellOpts<'a>,
5957    ) -> Container {
5958        let mut query = self.selection.select("withShell");
5959        query = query.arg(
5960            "interactive",
5961            interactive
5962                .into_iter()
5963                .map(|i| i.into())
5964                .collect::<Vec<String>>(),
5965        );
5966        if let Some(batch) = opts.batch {
5967            query = query.arg("batch", batch);
5968        }
5969        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5970            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5971        }
5972        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5973            query = query.arg(
5974                "experimentalPrivilegedNesting",
5975                experimental_privileged_nesting,
5976            );
5977        }
5978        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5979            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5980        }
5981        Container {
5982            proc: self.proc.clone(),
5983            selection: query,
5984            graphql_client: self.graphql_client.clone(),
5985        }
5986    }
5987    /// Return the configured shell command. Defaults to ["sh"].
5988    ///
5989    /// # Arguments
5990    ///
5991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5992    pub fn shell(&self) -> Command {
5993        let query = self.selection.select("shell");
5994        Command {
5995            proc: self.proc.clone(),
5996            selection: query,
5997            graphql_client: self.graphql_client.clone(),
5998        }
5999    }
6000    /// Return the configured shell command. Defaults to ["sh"].
6001    ///
6002    /// # Arguments
6003    ///
6004    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6005    pub fn shell_opts(&self, opts: ContainerShellOpts) -> Command {
6006        let mut query = self.selection.select("shell");
6007        if let Some(batch) = opts.batch {
6008            query = query.arg("batch", batch);
6009        }
6010        Command {
6011            proc: self.proc.clone(),
6012            selection: query,
6013            graphql_client: self.graphql_client.clone(),
6014        }
6015    }
6016    /// Execute a script with the configured batch shell and return the modified container.
6017    ///
6018    /// # Arguments
6019    ///
6020    /// * `command` - Script to append to the shell command as one argument.
6021    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6022    pub fn with_run(&self, command: impl Into<String>) -> Container {
6023        let mut query = self.selection.select("withRun");
6024        query = query.arg("command", command.into());
6025        Container {
6026            proc: self.proc.clone(),
6027            selection: query,
6028            graphql_client: self.graphql_client.clone(),
6029        }
6030    }
6031    /// Execute a script with the configured batch shell and return the modified container.
6032    ///
6033    /// # Arguments
6034    ///
6035    /// * `command` - Script to append to the shell command as one argument.
6036    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6037    pub fn with_run_opts<'a>(
6038        &self,
6039        command: impl Into<String>,
6040        opts: ContainerWithRunOpts<'a>,
6041    ) -> Container {
6042        let mut query = self.selection.select("withRun");
6043        query = query.arg("command", command.into());
6044        if let Some(shell) = opts.shell {
6045            query = query.arg("shell", shell);
6046        }
6047        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6048            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6049        }
6050        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6051            query = query.arg(
6052                "experimentalPrivilegedNesting",
6053                experimental_privileged_nesting,
6054            );
6055        }
6056        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6057            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6058        }
6059        Container {
6060            proc: self.proc.clone(),
6061            selection: query,
6062            graphql_client: self.graphql_client.clone(),
6063        }
6064    }
6065    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
6066    ///
6067    /// # Arguments
6068    ///
6069    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6070    pub fn terminal(&self) -> Container {
6071        let query = self.selection.select("terminal");
6072        Container {
6073            proc: self.proc.clone(),
6074            selection: query,
6075            graphql_client: self.graphql_client.clone(),
6076        }
6077    }
6078    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
6079    ///
6080    /// # Arguments
6081    ///
6082    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6083    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
6084        let mut query = self.selection.select("terminal");
6085        if let Some(cmd) = opts.cmd {
6086            query = query.arg("cmd", cmd);
6087        }
6088        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6089            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6090        }
6091        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6092            query = query.arg(
6093                "experimentalPrivilegedNesting",
6094                experimental_privileged_nesting,
6095            );
6096        }
6097        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6098            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6099        }
6100        Container {
6101            proc: self.proc.clone(),
6102            selection: query,
6103            graphql_client: self.graphql_client.clone(),
6104        }
6105    }
6106    /// Configures all GPUs available on the host to be accessible to this container.
6107    /// This currently works with NVIDIA devices only, and requires the engine to run with GPU support enabled.
6108    pub fn with_gpu(&self) -> Container {
6109        let query = self.selection.select("withGPU");
6110        Container {
6111            proc: self.proc.clone(),
6112            selection: query,
6113            graphql_client: self.graphql_client.clone(),
6114        }
6115    }
6116    /// Configures the provided list of devices to be accessible to this container.
6117    /// This currently works for Nvidia devices only.
6118    ///
6119    /// # Arguments
6120    ///
6121    /// * `devices` - List of devices to be accessible to this container.
6122    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
6123        let mut query = self.selection.select("experimentalWithGPU");
6124        query = query.arg(
6125            "devices",
6126            devices
6127                .into_iter()
6128                .map(|i| i.into())
6129                .collect::<Vec<String>>(),
6130        );
6131        Container {
6132            proc: self.proc.clone(),
6133            selection: query,
6134            graphql_client: self.graphql_client.clone(),
6135        }
6136    }
6137    /// Configures all available GPUs on the host to be accessible to this container.
6138    /// This currently works for Nvidia devices only.
6139    pub fn experimental_with_all_gp_us(&self) -> Container {
6140        let query = self.selection.select("experimentalWithAllGPUs");
6141        Container {
6142            proc: self.proc.clone(),
6143            selection: query,
6144            graphql_client: self.graphql_client.clone(),
6145        }
6146    }
6147    /// Turn the container into a Service.
6148    /// Be sure to set any exposed ports before this conversion.
6149    ///
6150    /// # Arguments
6151    ///
6152    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6153    pub fn as_service(&self) -> Service {
6154        let query = self.selection.select("asService");
6155        Service {
6156            proc: self.proc.clone(),
6157            selection: query,
6158            graphql_client: self.graphql_client.clone(),
6159        }
6160    }
6161    /// Turn the container into a Service.
6162    /// Be sure to set any exposed ports before this conversion.
6163    ///
6164    /// # Arguments
6165    ///
6166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6167    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
6168        let mut query = self.selection.select("asService");
6169        if let Some(args) = opts.args {
6170            query = query.arg("args", args);
6171        }
6172        if let Some(use_entrypoint) = opts.use_entrypoint {
6173            query = query.arg("useEntrypoint", use_entrypoint);
6174        }
6175        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6176            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6177        }
6178        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6179            query = query.arg(
6180                "experimentalPrivilegedNesting",
6181                experimental_privileged_nesting,
6182            );
6183        }
6184        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6185            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6186        }
6187        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6188            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6189        }
6190        if let Some(expand) = opts.expand {
6191            query = query.arg("expand", expand);
6192        }
6193        if let Some(no_init) = opts.no_init {
6194            query = query.arg("noInit", no_init);
6195        }
6196        Service {
6197            proc: self.proc.clone(),
6198            selection: query,
6199            graphql_client: self.graphql_client.clone(),
6200        }
6201    }
6202    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
6203    /// Be sure to set any exposed ports before calling this api.
6204    ///
6205    /// # Arguments
6206    ///
6207    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6208    pub async fn up(&self) -> Result<Void, DaggerError> {
6209        let query = self.selection.select("up");
6210        query.execute(self.graphql_client.clone()).await
6211    }
6212    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
6213    /// Be sure to set any exposed ports before calling this api.
6214    ///
6215    /// # Arguments
6216    ///
6217    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6218    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
6219        let mut query = self.selection.select("up");
6220        if let Some(random) = opts.random {
6221            query = query.arg("random", random);
6222        }
6223        if let Some(ports) = opts.ports {
6224            query = query.arg("ports", ports);
6225        }
6226        if let Some(args) = opts.args {
6227            query = query.arg("args", args);
6228        }
6229        if let Some(use_entrypoint) = opts.use_entrypoint {
6230            query = query.arg("useEntrypoint", use_entrypoint);
6231        }
6232        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6233            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6234        }
6235        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6236            query = query.arg(
6237                "experimentalPrivilegedNesting",
6238                experimental_privileged_nesting,
6239            );
6240        }
6241        if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6242            query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6243        }
6244        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6245            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6246        }
6247        if let Some(expand) = opts.expand {
6248            query = query.arg("expand", expand);
6249        }
6250        if let Some(no_init) = opts.no_init {
6251            query = query.arg("noInit", no_init);
6252        }
6253        query.execute(self.graphql_client.clone()).await
6254    }
6255}
6256impl Exportable for Container {
6257    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6258        let query = self.selection.select("id");
6259        let graphql_client = self.graphql_client.clone();
6260        async move { query.execute(graphql_client).await }
6261    }
6262    fn export(
6263        &self,
6264        path: impl Into<String>,
6265    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
6266        let mut query = self.selection.select("export");
6267        query = query.arg("path", path.into());
6268        let graphql_client = self.graphql_client.clone();
6269        async move { query.execute(graphql_client).await }
6270    }
6271}
6272impl Node for Container {
6273    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6274        let query = self.selection.select("id");
6275        let graphql_client = self.graphql_client.clone();
6276        async move { query.execute(graphql_client).await }
6277    }
6278}
6279impl Syncer for Container {
6280    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6281        let query = self.selection.select("id");
6282        let graphql_client = self.graphql_client.clone();
6283        async move { query.execute(graphql_client).await }
6284    }
6285    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
6286        let query = self.selection.select("sync");
6287        let proc = self.proc.clone();
6288        let graphql_client = self.graphql_client.clone();
6289        async move {
6290            let id: Id = query.execute(graphql_client.clone()).await?;
6291            Ok(Self {
6292                proc,
6293                selection: query
6294                    .root()
6295                    .select("node")
6296                    .arg("id", &id.0)
6297                    .inline_fragment("Container"),
6298                graphql_client,
6299            })
6300        }
6301    }
6302}
6303#[derive(Clone)]
6304pub struct CurrentModule {
6305    pub proc: Option<Arc<DaggerSessionProc>>,
6306    pub selection: Selection,
6307    pub graphql_client: DynGraphQLClient,
6308}
6309#[derive(Builder, Debug, PartialEq)]
6310pub struct CurrentModuleWorkdirOpts<'a> {
6311    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6312    #[builder(setter(into, strip_option), default)]
6313    pub exclude: Option<Vec<&'a str>>,
6314    /// Apply .gitignore filter rules inside the directory
6315    #[builder(setter(into, strip_option), default)]
6316    pub gitignore: Option<bool>,
6317    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6318    #[builder(setter(into, strip_option), default)]
6319    pub include: Option<Vec<&'a str>>,
6320}
6321impl IntoID<Id> for CurrentModule {
6322    fn into_id(
6323        self,
6324    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6325        Box::pin(async move { self.id().await })
6326    }
6327}
6328impl Loadable for CurrentModule {
6329    fn graphql_type() -> &'static str {
6330        "CurrentModule"
6331    }
6332    fn from_query(
6333        proc: Option<Arc<DaggerSessionProc>>,
6334        selection: Selection,
6335        graphql_client: DynGraphQLClient,
6336    ) -> Self {
6337        Self {
6338            proc,
6339            selection,
6340            graphql_client,
6341        }
6342    }
6343}
6344impl CurrentModule {
6345    /// A unique identifier for this CurrentModule.
6346    pub async fn id(&self) -> Result<Id, DaggerError> {
6347        let query = self.selection.select("id");
6348        query.execute(self.graphql_client.clone()).await
6349    }
6350    /// The dependencies of the module.
6351    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
6352        let query = self.selection.select("dependencies");
6353        let query = query.select("id");
6354        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6355        Ok(ids
6356            .into_iter()
6357            .map(|id| Module {
6358                proc: self.proc.clone(),
6359                selection: crate::querybuilder::query()
6360                    .select("node")
6361                    .arg("id", &id.0)
6362                    .inline_fragment("Module"),
6363                graphql_client: self.graphql_client.clone(),
6364            })
6365            .collect())
6366    }
6367    /// The generated files and directories made on top of the module source's context directory.
6368    pub fn generated_context_directory(&self) -> Directory {
6369        let query = self.selection.select("generatedContextDirectory");
6370        Directory {
6371            proc: self.proc.clone(),
6372            selection: query,
6373            graphql_client: self.graphql_client.clone(),
6374        }
6375    }
6376    /// The name of the module being executed in
6377    pub async fn name(&self) -> Result<String, DaggerError> {
6378        let query = self.selection.select("name");
6379        query.execute(self.graphql_client.clone()).await
6380    }
6381    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
6382    pub fn source(&self) -> Directory {
6383        let query = self.selection.select("source");
6384        Directory {
6385            proc: self.proc.clone(),
6386            selection: query,
6387            graphql_client: self.graphql_client.clone(),
6388        }
6389    }
6390    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
6391    ///
6392    /// # Arguments
6393    ///
6394    /// * `path` - Location of the directory to access (e.g., ".").
6395    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6396    pub fn workdir(&self, path: impl Into<String>) -> Directory {
6397        let mut query = self.selection.select("workdir");
6398        query = query.arg("path", path.into());
6399        Directory {
6400            proc: self.proc.clone(),
6401            selection: query,
6402            graphql_client: self.graphql_client.clone(),
6403        }
6404    }
6405    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
6406    ///
6407    /// # Arguments
6408    ///
6409    /// * `path` - Location of the directory to access (e.g., ".").
6410    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6411    pub fn workdir_opts<'a>(
6412        &self,
6413        path: impl Into<String>,
6414        opts: CurrentModuleWorkdirOpts<'a>,
6415    ) -> Directory {
6416        let mut query = self.selection.select("workdir");
6417        query = query.arg("path", path.into());
6418        if let Some(exclude) = opts.exclude {
6419            query = query.arg("exclude", exclude);
6420        }
6421        if let Some(include) = opts.include {
6422            query = query.arg("include", include);
6423        }
6424        if let Some(gitignore) = opts.gitignore {
6425            query = query.arg("gitignore", gitignore);
6426        }
6427        Directory {
6428            proc: self.proc.clone(),
6429            selection: query,
6430            graphql_client: self.graphql_client.clone(),
6431        }
6432    }
6433    /// 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.
6434    ///
6435    /// # Arguments
6436    ///
6437    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6438    pub fn workdir_file(&self, path: impl Into<String>) -> File {
6439        let mut query = self.selection.select("workdirFile");
6440        query = query.arg("path", path.into());
6441        File {
6442            proc: self.proc.clone(),
6443            selection: query,
6444            graphql_client: self.graphql_client.clone(),
6445        }
6446    }
6447}
6448impl Node for CurrentModule {
6449    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6450        let query = self.selection.select("id");
6451        let graphql_client = self.graphql_client.clone();
6452        async move { query.execute(graphql_client).await }
6453    }
6454}
6455#[derive(Clone)]
6456pub struct DiffStat {
6457    pub proc: Option<Arc<DaggerSessionProc>>,
6458    pub selection: Selection,
6459    pub graphql_client: DynGraphQLClient,
6460}
6461impl IntoID<Id> for DiffStat {
6462    fn into_id(
6463        self,
6464    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6465        Box::pin(async move { self.id().await })
6466    }
6467}
6468impl Loadable for DiffStat {
6469    fn graphql_type() -> &'static str {
6470        "DiffStat"
6471    }
6472    fn from_query(
6473        proc: Option<Arc<DaggerSessionProc>>,
6474        selection: Selection,
6475        graphql_client: DynGraphQLClient,
6476    ) -> Self {
6477        Self {
6478            proc,
6479            selection,
6480            graphql_client,
6481        }
6482    }
6483}
6484impl DiffStat {
6485    /// A unique identifier for this DiffStat.
6486    pub async fn id(&self) -> Result<Id, DaggerError> {
6487        let query = self.selection.select("id");
6488        query.execute(self.graphql_client.clone()).await
6489    }
6490    /// Path of the changed file or directory.
6491    pub async fn path(&self) -> Result<String, DaggerError> {
6492        let query = self.selection.select("path");
6493        query.execute(self.graphql_client.clone()).await
6494    }
6495    /// Previous path of the file, set only for renames.
6496    pub async fn old_path(&self) -> Result<String, DaggerError> {
6497        let query = self.selection.select("oldPath");
6498        query.execute(self.graphql_client.clone()).await
6499    }
6500    /// Type of change.
6501    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6502        let query = self.selection.select("kind");
6503        query.execute(self.graphql_client.clone()).await
6504    }
6505    /// Number of added lines for this path.
6506    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6507        let query = self.selection.select("addedLines");
6508        query.execute(self.graphql_client.clone()).await
6509    }
6510    /// Number of removed lines for this path.
6511    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6512        let query = self.selection.select("removedLines");
6513        query.execute(self.graphql_client.clone()).await
6514    }
6515}
6516impl Node for DiffStat {
6517    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6518        let query = self.selection.select("id");
6519        let graphql_client = self.graphql_client.clone();
6520        async move { query.execute(graphql_client).await }
6521    }
6522}
6523#[derive(Clone)]
6524pub struct Directory {
6525    pub proc: Option<Arc<DaggerSessionProc>>,
6526    pub selection: Selection,
6527    pub graphql_client: DynGraphQLClient,
6528}
6529#[derive(Builder, Debug, PartialEq)]
6530pub struct DirectoryEntriesOpts<'a> {
6531    /// Location of the directory to look at (e.g., "/src").
6532    #[builder(setter(into, strip_option), default)]
6533    pub path: Option<&'a str>,
6534}
6535#[derive(Builder, Debug, PartialEq)]
6536pub struct DirectorySearchOpts<'a> {
6537    /// Allow the . pattern to match newlines in multiline mode.
6538    #[builder(setter(into, strip_option), default)]
6539    pub dotall: Option<bool>,
6540    /// Only return matching files, not lines and content
6541    #[builder(setter(into, strip_option), default)]
6542    pub files_only: Option<bool>,
6543    /// Glob patterns to match (e.g., "*.md")
6544    #[builder(setter(into, strip_option), default)]
6545    pub globs: Option<Vec<&'a str>>,
6546    /// Enable case-insensitive matching.
6547    #[builder(setter(into, strip_option), default)]
6548    pub insensitive: Option<bool>,
6549    /// Limit the number of results to return
6550    #[builder(setter(into, strip_option), default)]
6551    pub limit: Option<isize>,
6552    /// Interpret the pattern as a literal string instead of a regular expression.
6553    #[builder(setter(into, strip_option), default)]
6554    pub literal: Option<bool>,
6555    /// Enable searching across multiple lines.
6556    #[builder(setter(into, strip_option), default)]
6557    pub multiline: Option<bool>,
6558    /// Directory or file paths to search
6559    #[builder(setter(into, strip_option), default)]
6560    pub paths: Option<Vec<&'a str>>,
6561    /// Skip hidden files (files starting with .).
6562    #[builder(setter(into, strip_option), default)]
6563    pub skip_hidden: Option<bool>,
6564    /// Honor .gitignore, .ignore, and .rgignore files.
6565    #[builder(setter(into, strip_option), default)]
6566    pub skip_ignored: Option<bool>,
6567}
6568#[derive(Builder, Debug, PartialEq)]
6569pub struct DirectoryWithFileOpts<'a> {
6570    /// A user:group to set for the copied directory and its contents.
6571    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6572    /// If the group is omitted, it defaults to the same as the user.
6573    #[builder(setter(into, strip_option), default)]
6574    pub owner: Option<&'a str>,
6575    /// Permission given to the copied file (e.g., 0600).
6576    #[builder(setter(into, strip_option), default)]
6577    pub permissions: Option<isize>,
6578}
6579#[derive(Builder, Debug, PartialEq)]
6580pub struct DirectoryWithFilesOpts {
6581    /// Permission given to the copied files (e.g., 0600).
6582    #[builder(setter(into, strip_option), default)]
6583    pub permissions: Option<isize>,
6584}
6585#[derive(Builder, Debug, PartialEq)]
6586pub struct DirectoryWithNewFileOpts {
6587    /// Permissions of the new file. Example: 0600
6588    #[builder(setter(into, strip_option), default)]
6589    pub permissions: Option<isize>,
6590}
6591#[derive(Builder, Debug, PartialEq)]
6592pub struct DirectoryExistsOpts {
6593    /// If specified, do not follow symlinks.
6594    #[builder(setter(into, strip_option), default)]
6595    pub do_not_follow_symlinks: Option<bool>,
6596    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
6597    #[builder(setter(into, strip_option), default)]
6598    pub expected_type: Option<ExistsType>,
6599}
6600#[derive(Builder, Debug, PartialEq)]
6601pub struct DirectoryStatOpts {
6602    /// If specified, do not follow symlinks.
6603    #[builder(setter(into, strip_option), default)]
6604    pub do_not_follow_symlinks: Option<bool>,
6605}
6606#[derive(Builder, Debug, PartialEq)]
6607pub struct DirectoryWithDirectoryOpts<'a> {
6608    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6609    #[builder(setter(into, strip_option), default)]
6610    pub exclude: Option<Vec<&'a str>>,
6611    /// Apply .gitignore filter rules inside the directory
6612    #[builder(setter(into, strip_option), default)]
6613    pub gitignore: Option<bool>,
6614    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6615    #[builder(setter(into, strip_option), default)]
6616    pub include: Option<Vec<&'a str>>,
6617    /// A user:group to set for the copied directory and its contents.
6618    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6619    /// If the group is omitted, it defaults to the same as the user.
6620    #[builder(setter(into, strip_option), default)]
6621    pub owner: Option<&'a str>,
6622    /// Permission given to the copied directory and contents (e.g., 0755).
6623    #[builder(setter(into, strip_option), default)]
6624    pub permissions: Option<isize>,
6625}
6626#[derive(Builder, Debug, PartialEq)]
6627pub struct DirectoryFilterOpts<'a> {
6628    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
6629    #[builder(setter(into, strip_option), default)]
6630    pub exclude: Option<Vec<&'a str>>,
6631    /// If set, apply .gitignore rules when filtering the directory.
6632    #[builder(setter(into, strip_option), default)]
6633    pub gitignore: Option<bool>,
6634    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
6635    #[builder(setter(into, strip_option), default)]
6636    pub include: Option<Vec<&'a str>>,
6637}
6638#[derive(Builder, Debug, PartialEq)]
6639pub struct DirectoryWithNewDirectoryOpts {
6640    /// Permission granted to the created directory (e.g., 0777).
6641    #[builder(setter(into, strip_option), default)]
6642    pub permissions: Option<isize>,
6643}
6644#[derive(Builder, Debug, PartialEq)]
6645pub struct DirectoryExportOpts {
6646    /// 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.
6647    #[builder(setter(into, strip_option), default)]
6648    pub wipe: Option<bool>,
6649}
6650#[derive(Builder, Debug, PartialEq)]
6651pub struct DirectoryDockerBuildOpts<'a> {
6652    /// Build arguments to use in the build.
6653    #[builder(setter(into, strip_option), default)]
6654    pub build_args: Option<Vec<BuildArg>>,
6655    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
6656    #[builder(setter(into, strip_option), default)]
6657    pub dockerfile: Option<&'a str>,
6658    /// If set, skip the automatic init process injected into containers created by RUN statements.
6659    /// 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.
6660    #[builder(setter(into, strip_option), default)]
6661    pub no_init: Option<bool>,
6662    /// The platform to build.
6663    #[builder(setter(into, strip_option), default)]
6664    pub platform: Option<Platform>,
6665    /// Secrets to pass to the build.
6666    /// They will be mounted at /run/secrets/[secret-name].
6667    #[builder(setter(into, strip_option), default)]
6668    pub secrets: Option<Vec<Id>>,
6669    /// A socket to use for SSH authentication during the build
6670    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
6671    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
6672    #[builder(setter(into, strip_option), default)]
6673    pub ssh: Option<Id>,
6674    /// Target build stage to build.
6675    #[builder(setter(into, strip_option), default)]
6676    pub target: Option<&'a str>,
6677}
6678#[derive(Builder, Debug, PartialEq)]
6679pub struct DirectoryWithPatchOpts {
6680    /// 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.
6681    #[builder(setter(into, strip_option), default)]
6682    pub on_conflict: Option<PatchConflict>,
6683}
6684#[derive(Builder, Debug, PartialEq)]
6685pub struct DirectoryWithPatchFileOpts {
6686    /// 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.
6687    #[builder(setter(into, strip_option), default)]
6688    pub on_conflict: Option<PatchConflict>,
6689}
6690#[derive(Builder, Debug, PartialEq)]
6691pub struct DirectoryAsWorkspaceOpts<'a> {
6692    /// Current working directory inside the workspace root. Defaults to the workspace root.
6693    #[builder(setter(into, strip_option), default)]
6694    pub cwd: Option<&'a str>,
6695}
6696#[derive(Builder, Debug, PartialEq)]
6697pub struct DirectoryTerminalOpts<'a> {
6698    /// If set, override the container's default terminal command and invoke these command arguments instead.
6699    #[builder(setter(into, strip_option), default)]
6700    pub cmd: Option<Vec<&'a str>>,
6701    /// If set, override the default container used for the terminal.
6702    #[builder(setter(into, strip_option), default)]
6703    pub container: Option<Id>,
6704    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
6705    #[builder(setter(into, strip_option), default)]
6706    pub disable_dagger_in_dagger: Option<bool>,
6707    #[builder(setter(into, strip_option), default)]
6708    pub experimental_privileged_nesting: Option<bool>,
6709    /// 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.
6710    #[builder(setter(into, strip_option), default)]
6711    pub insecure_root_capabilities: Option<bool>,
6712}
6713#[derive(Builder, Debug, PartialEq)]
6714pub struct DirectoryAsModuleOpts<'a> {
6715    /// An optional subpath of the directory which contains the module's configuration file.
6716    /// If not set, the module source code is loaded from the root of the directory.
6717    #[builder(setter(into, strip_option), default)]
6718    pub source_root_path: Option<&'a str>,
6719}
6720#[derive(Builder, Debug, PartialEq)]
6721pub struct DirectoryAsModuleSourceOpts<'a> {
6722    /// An optional subpath of the directory which contains the module's configuration file.
6723    /// If not set, the module source code is loaded from the root of the directory.
6724    #[builder(setter(into, strip_option), default)]
6725    pub source_root_path: Option<&'a str>,
6726}
6727impl IntoID<Id> for Directory {
6728    fn into_id(
6729        self,
6730    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6731        Box::pin(async move { self.id().await })
6732    }
6733}
6734impl Loadable for Directory {
6735    fn graphql_type() -> &'static str {
6736        "Directory"
6737    }
6738    fn from_query(
6739        proc: Option<Arc<DaggerSessionProc>>,
6740        selection: Selection,
6741        graphql_client: DynGraphQLClient,
6742    ) -> Self {
6743        Self {
6744            proc,
6745            selection,
6746            graphql_client,
6747        }
6748    }
6749}
6750impl Directory {
6751    /// A unique identifier for this Directory.
6752    pub async fn id(&self) -> Result<Id, DaggerError> {
6753        let query = self.selection.select("id");
6754        query.execute(self.graphql_client.clone()).await
6755    }
6756    /// Force evaluation in the engine.
6757    pub async fn sync(&self) -> Result<Directory, DaggerError> {
6758        let query = self.selection.select("sync");
6759        let id: Id = query.execute(self.graphql_client.clone()).await?;
6760        Ok(Directory {
6761            proc: self.proc.clone(),
6762            selection: query
6763                .root()
6764                .select("node")
6765                .arg("id", &id.0)
6766                .inline_fragment("Directory"),
6767            graphql_client: self.graphql_client.clone(),
6768        })
6769    }
6770    /// Returns the name of the directory.
6771    pub async fn name(&self) -> Result<String, DaggerError> {
6772        let query = self.selection.select("name");
6773        query.execute(self.graphql_client.clone()).await
6774    }
6775    /// Returns a list of files and directories at the given path.
6776    ///
6777    /// # Arguments
6778    ///
6779    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6780    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6781        let query = self.selection.select("entries");
6782        query.execute(self.graphql_client.clone()).await
6783    }
6784    /// Returns a list of files and directories at the given path.
6785    ///
6786    /// # Arguments
6787    ///
6788    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6789    pub async fn entries_opts<'a>(
6790        &self,
6791        opts: DirectoryEntriesOpts<'a>,
6792    ) -> Result<Vec<String>, DaggerError> {
6793        let mut query = self.selection.select("entries");
6794        if let Some(path) = opts.path {
6795            query = query.arg("path", path);
6796        }
6797        query.execute(self.graphql_client.clone()).await
6798    }
6799    /// Returns a list of files and directories that matche the given pattern.
6800    ///
6801    /// # Arguments
6802    ///
6803    /// * `pattern` - Pattern to match (e.g., "*.md").
6804    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6805        let mut query = self.selection.select("glob");
6806        query = query.arg("pattern", pattern.into());
6807        query.execute(self.graphql_client.clone()).await
6808    }
6809    /// Searches for content matching the given regular expression or literal string.
6810    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6811    ///
6812    /// # Arguments
6813    ///
6814    /// * `pattern` - The text to match.
6815    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6816    pub async fn search(
6817        &self,
6818        pattern: impl Into<String>,
6819    ) -> Result<Vec<SearchResult>, DaggerError> {
6820        let mut query = self.selection.select("search");
6821        query = query.arg("pattern", pattern.into());
6822        let query = query.select("id");
6823        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6824        Ok(ids
6825            .into_iter()
6826            .map(|id| SearchResult {
6827                proc: self.proc.clone(),
6828                selection: crate::querybuilder::query()
6829                    .select("node")
6830                    .arg("id", &id.0)
6831                    .inline_fragment("SearchResult"),
6832                graphql_client: self.graphql_client.clone(),
6833            })
6834            .collect())
6835    }
6836    /// Searches for content matching the given regular expression or literal string.
6837    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6838    ///
6839    /// # Arguments
6840    ///
6841    /// * `pattern` - The text to match.
6842    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6843    pub async fn search_opts<'a>(
6844        &self,
6845        pattern: impl Into<String>,
6846        opts: DirectorySearchOpts<'a>,
6847    ) -> Result<Vec<SearchResult>, DaggerError> {
6848        let mut query = self.selection.select("search");
6849        query = query.arg("pattern", pattern.into());
6850        if let Some(paths) = opts.paths {
6851            query = query.arg("paths", paths);
6852        }
6853        if let Some(globs) = opts.globs {
6854            query = query.arg("globs", globs);
6855        }
6856        if let Some(literal) = opts.literal {
6857            query = query.arg("literal", literal);
6858        }
6859        if let Some(multiline) = opts.multiline {
6860            query = query.arg("multiline", multiline);
6861        }
6862        if let Some(dotall) = opts.dotall {
6863            query = query.arg("dotall", dotall);
6864        }
6865        if let Some(insensitive) = opts.insensitive {
6866            query = query.arg("insensitive", insensitive);
6867        }
6868        if let Some(skip_ignored) = opts.skip_ignored {
6869            query = query.arg("skipIgnored", skip_ignored);
6870        }
6871        if let Some(skip_hidden) = opts.skip_hidden {
6872            query = query.arg("skipHidden", skip_hidden);
6873        }
6874        if let Some(files_only) = opts.files_only {
6875            query = query.arg("filesOnly", files_only);
6876        }
6877        if let Some(limit) = opts.limit {
6878            query = query.arg("limit", limit);
6879        }
6880        let query = query.select("id");
6881        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6882        Ok(ids
6883            .into_iter()
6884            .map(|id| SearchResult {
6885                proc: self.proc.clone(),
6886                selection: crate::querybuilder::query()
6887                    .select("node")
6888                    .arg("id", &id.0)
6889                    .inline_fragment("SearchResult"),
6890                graphql_client: self.graphql_client.clone(),
6891            })
6892            .collect())
6893    }
6894    /// 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.
6895    pub async fn digest(&self) -> Result<String, DaggerError> {
6896        let query = self.selection.select("digest");
6897        query.execute(self.graphql_client.clone()).await
6898    }
6899    /// Retrieve a file at the given path.
6900    ///
6901    /// # Arguments
6902    ///
6903    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6904    pub fn file(&self, path: impl Into<String>) -> File {
6905        let mut query = self.selection.select("file");
6906        query = query.arg("path", path.into());
6907        File {
6908            proc: self.proc.clone(),
6909            selection: query,
6910            graphql_client: self.graphql_client.clone(),
6911        }
6912    }
6913    /// Retrieves this directory plus the contents of the given file copied to the given path.
6914    ///
6915    /// # Arguments
6916    ///
6917    /// * `path` - Location of the copied file (e.g., "/file.txt").
6918    /// * `source` - Identifier of the file to copy.
6919    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6920    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6921        let mut query = self.selection.select("withFile");
6922        query = query.arg("path", path.into());
6923        query = query.arg_lazy(
6924            "source",
6925            Box::new(move || {
6926                let source = source.clone();
6927                Box::pin(async move { source.into_id().await.unwrap().quote() })
6928            }),
6929        );
6930        Directory {
6931            proc: self.proc.clone(),
6932            selection: query,
6933            graphql_client: self.graphql_client.clone(),
6934        }
6935    }
6936    /// Retrieves this directory plus the contents of the given file copied to the given path.
6937    ///
6938    /// # Arguments
6939    ///
6940    /// * `path` - Location of the copied file (e.g., "/file.txt").
6941    /// * `source` - Identifier of the file to copy.
6942    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6943    pub fn with_file_opts<'a>(
6944        &self,
6945        path: impl Into<String>,
6946        source: impl IntoID<Id>,
6947        opts: DirectoryWithFileOpts<'a>,
6948    ) -> Directory {
6949        let mut query = self.selection.select("withFile");
6950        query = query.arg("path", path.into());
6951        query = query.arg_lazy(
6952            "source",
6953            Box::new(move || {
6954                let source = source.clone();
6955                Box::pin(async move { source.into_id().await.unwrap().quote() })
6956            }),
6957        );
6958        if let Some(permissions) = opts.permissions {
6959            query = query.arg("permissions", permissions);
6960        }
6961        if let Some(owner) = opts.owner {
6962            query = query.arg("owner", owner);
6963        }
6964        Directory {
6965            proc: self.proc.clone(),
6966            selection: query,
6967            graphql_client: self.graphql_client.clone(),
6968        }
6969    }
6970    /// Retrieves this directory plus the contents of the given files copied to the given path.
6971    ///
6972    /// # Arguments
6973    ///
6974    /// * `path` - Location where copied files should be placed (e.g., "/src").
6975    /// * `sources` - Identifiers of the files to copy.
6976    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6977    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
6978        let mut query = self.selection.select("withFiles");
6979        query = query.arg("path", path.into());
6980        query = query.arg("sources", sources);
6981        Directory {
6982            proc: self.proc.clone(),
6983            selection: query,
6984            graphql_client: self.graphql_client.clone(),
6985        }
6986    }
6987    /// Retrieves this directory plus the contents of the given files copied to the given path.
6988    ///
6989    /// # Arguments
6990    ///
6991    /// * `path` - Location where copied files should be placed (e.g., "/src").
6992    /// * `sources` - Identifiers of the files to copy.
6993    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6994    pub fn with_files_opts(
6995        &self,
6996        path: impl Into<String>,
6997        sources: Vec<Id>,
6998        opts: DirectoryWithFilesOpts,
6999    ) -> Directory {
7000        let mut query = self.selection.select("withFiles");
7001        query = query.arg("path", path.into());
7002        query = query.arg("sources", sources);
7003        if let Some(permissions) = opts.permissions {
7004            query = query.arg("permissions", permissions);
7005        }
7006        Directory {
7007            proc: self.proc.clone(),
7008            selection: query,
7009            graphql_client: self.graphql_client.clone(),
7010        }
7011    }
7012    /// Return a snapshot with a new file added
7013    ///
7014    /// # Arguments
7015    ///
7016    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7017    /// * `contents` - Contents of the new file. Example: "Hello world!"
7018    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7019    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7020        let mut query = self.selection.select("withNewFile");
7021        query = query.arg("path", path.into());
7022        query = query.arg("contents", contents.into());
7023        Directory {
7024            proc: self.proc.clone(),
7025            selection: query,
7026            graphql_client: self.graphql_client.clone(),
7027        }
7028    }
7029    /// Return a snapshot with a new file added
7030    ///
7031    /// # Arguments
7032    ///
7033    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7034    /// * `contents` - Contents of the new file. Example: "Hello world!"
7035    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7036    pub fn with_new_file_opts(
7037        &self,
7038        path: impl Into<String>,
7039        contents: impl Into<String>,
7040        opts: DirectoryWithNewFileOpts,
7041    ) -> Directory {
7042        let mut query = self.selection.select("withNewFile");
7043        query = query.arg("path", path.into());
7044        query = query.arg("contents", contents.into());
7045        if let Some(permissions) = opts.permissions {
7046            query = query.arg("permissions", permissions);
7047        }
7048        Directory {
7049            proc: self.proc.clone(),
7050            selection: query,
7051            graphql_client: self.graphql_client.clone(),
7052        }
7053    }
7054    /// Return a snapshot with a file removed
7055    ///
7056    /// # Arguments
7057    ///
7058    /// * `path` - Path of the file to remove (e.g., "/file.txt").
7059    pub fn without_file(&self, path: impl Into<String>) -> Directory {
7060        let mut query = self.selection.select("withoutFile");
7061        query = query.arg("path", path.into());
7062        Directory {
7063            proc: self.proc.clone(),
7064            selection: query,
7065            graphql_client: self.graphql_client.clone(),
7066        }
7067    }
7068    /// Return a snapshot with files removed
7069    ///
7070    /// # Arguments
7071    ///
7072    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
7073    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7074        let mut query = self.selection.select("withoutFiles");
7075        query = query.arg(
7076            "paths",
7077            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7078        );
7079        Directory {
7080            proc: self.proc.clone(),
7081            selection: query,
7082            graphql_client: self.graphql_client.clone(),
7083        }
7084    }
7085    /// check if a file or directory exists
7086    ///
7087    /// # Arguments
7088    ///
7089    /// * `path` - Path to check (e.g., "/file.txt").
7090    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7091    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
7092        let mut query = self.selection.select("exists");
7093        query = query.arg("path", path.into());
7094        query.execute(self.graphql_client.clone()).await
7095    }
7096    /// check if a file or directory exists
7097    ///
7098    /// # Arguments
7099    ///
7100    /// * `path` - Path to check (e.g., "/file.txt").
7101    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7102    pub async fn exists_opts(
7103        &self,
7104        path: impl Into<String>,
7105        opts: DirectoryExistsOpts,
7106    ) -> Result<bool, DaggerError> {
7107        let mut query = self.selection.select("exists");
7108        query = query.arg("path", path.into());
7109        if let Some(expected_type) = opts.expected_type {
7110            query = query.arg("expectedType", expected_type);
7111        }
7112        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7113            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7114        }
7115        query.execute(self.graphql_client.clone()).await
7116    }
7117    /// Return file status
7118    ///
7119    /// # Arguments
7120    ///
7121    /// * `path` - Path to stat (e.g., "/file.txt").
7122    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7123    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
7124        let mut query = self.selection.select("stat");
7125        query = query.arg("path", path.into());
7126        let query = query.select("id");
7127        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7128        Ok(id.map(|id| Stat {
7129            proc: self.proc.clone(),
7130            selection: query
7131                .root()
7132                .select("node")
7133                .arg("id", &id.0)
7134                .inline_fragment("Stat"),
7135            graphql_client: self.graphql_client.clone(),
7136        }))
7137    }
7138    /// Return file status
7139    ///
7140    /// # Arguments
7141    ///
7142    /// * `path` - Path to stat (e.g., "/file.txt").
7143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7144    pub async fn stat_opts(
7145        &self,
7146        path: impl Into<String>,
7147        opts: DirectoryStatOpts,
7148    ) -> Result<Option<Stat>, DaggerError> {
7149        let mut query = self.selection.select("stat");
7150        query = query.arg("path", path.into());
7151        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7152            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7153        }
7154        let query = query.select("id");
7155        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7156        Ok(id.map(|id| Stat {
7157            proc: self.proc.clone(),
7158            selection: query
7159                .root()
7160                .select("node")
7161                .arg("id", &id.0)
7162                .inline_fragment("Stat"),
7163            graphql_client: self.graphql_client.clone(),
7164        }))
7165    }
7166    /// Retrieves a directory at the given path.
7167    ///
7168    /// # Arguments
7169    ///
7170    /// * `path` - Location of the directory to retrieve. Example: "/src"
7171    pub fn directory(&self, path: impl Into<String>) -> Directory {
7172        let mut query = self.selection.select("directory");
7173        query = query.arg("path", path.into());
7174        Directory {
7175            proc: self.proc.clone(),
7176            selection: query,
7177            graphql_client: self.graphql_client.clone(),
7178        }
7179    }
7180    /// Return a snapshot with a directory added
7181    ///
7182    /// # Arguments
7183    ///
7184    /// * `path` - Location of the written directory (e.g., "/src/").
7185    /// * `source` - Identifier of the directory to copy.
7186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7187    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
7188        let mut query = self.selection.select("withDirectory");
7189        query = query.arg("path", path.into());
7190        query = query.arg_lazy(
7191            "source",
7192            Box::new(move || {
7193                let source = source.clone();
7194                Box::pin(async move { source.into_id().await.unwrap().quote() })
7195            }),
7196        );
7197        Directory {
7198            proc: self.proc.clone(),
7199            selection: query,
7200            graphql_client: self.graphql_client.clone(),
7201        }
7202    }
7203    /// Return a snapshot with a directory added
7204    ///
7205    /// # Arguments
7206    ///
7207    /// * `path` - Location of the written directory (e.g., "/src/").
7208    /// * `source` - Identifier of the directory to copy.
7209    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7210    pub fn with_directory_opts<'a>(
7211        &self,
7212        path: impl Into<String>,
7213        source: impl IntoID<Id>,
7214        opts: DirectoryWithDirectoryOpts<'a>,
7215    ) -> Directory {
7216        let mut query = self.selection.select("withDirectory");
7217        query = query.arg("path", path.into());
7218        query = query.arg_lazy(
7219            "source",
7220            Box::new(move || {
7221                let source = source.clone();
7222                Box::pin(async move { source.into_id().await.unwrap().quote() })
7223            }),
7224        );
7225        if let Some(exclude) = opts.exclude {
7226            query = query.arg("exclude", exclude);
7227        }
7228        if let Some(include) = opts.include {
7229            query = query.arg("include", include);
7230        }
7231        if let Some(gitignore) = opts.gitignore {
7232            query = query.arg("gitignore", gitignore);
7233        }
7234        if let Some(owner) = opts.owner {
7235            query = query.arg("owner", owner);
7236        }
7237        if let Some(permissions) = opts.permissions {
7238            query = query.arg("permissions", permissions);
7239        }
7240        Directory {
7241            proc: self.proc.clone(),
7242            selection: query,
7243            graphql_client: self.graphql_client.clone(),
7244        }
7245    }
7246    /// Return a snapshot with some paths included or excluded
7247    ///
7248    /// # Arguments
7249    ///
7250    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7251    pub fn filter(&self) -> Directory {
7252        let query = self.selection.select("filter");
7253        Directory {
7254            proc: self.proc.clone(),
7255            selection: query,
7256            graphql_client: self.graphql_client.clone(),
7257        }
7258    }
7259    /// Return a snapshot with some paths included or excluded
7260    ///
7261    /// # Arguments
7262    ///
7263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7264    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
7265        let mut query = self.selection.select("filter");
7266        if let Some(exclude) = opts.exclude {
7267            query = query.arg("exclude", exclude);
7268        }
7269        if let Some(include) = opts.include {
7270            query = query.arg("include", include);
7271        }
7272        if let Some(gitignore) = opts.gitignore {
7273            query = query.arg("gitignore", gitignore);
7274        }
7275        Directory {
7276            proc: self.proc.clone(),
7277            selection: query,
7278            graphql_client: self.graphql_client.clone(),
7279        }
7280    }
7281    /// Retrieves this directory plus a new directory created at the given path.
7282    ///
7283    /// # Arguments
7284    ///
7285    /// * `path` - Location of the directory created (e.g., "/logs").
7286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7287    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
7288        let mut query = self.selection.select("withNewDirectory");
7289        query = query.arg("path", path.into());
7290        Directory {
7291            proc: self.proc.clone(),
7292            selection: query,
7293            graphql_client: self.graphql_client.clone(),
7294        }
7295    }
7296    /// Retrieves this directory plus a new directory created at the given path.
7297    ///
7298    /// # Arguments
7299    ///
7300    /// * `path` - Location of the directory created (e.g., "/logs").
7301    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7302    pub fn with_new_directory_opts(
7303        &self,
7304        path: impl Into<String>,
7305        opts: DirectoryWithNewDirectoryOpts,
7306    ) -> Directory {
7307        let mut query = self.selection.select("withNewDirectory");
7308        query = query.arg("path", path.into());
7309        if let Some(permissions) = opts.permissions {
7310            query = query.arg("permissions", permissions);
7311        }
7312        Directory {
7313            proc: self.proc.clone(),
7314            selection: query,
7315            graphql_client: self.graphql_client.clone(),
7316        }
7317    }
7318    /// Return a snapshot with a subdirectory removed
7319    ///
7320    /// # Arguments
7321    ///
7322    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
7323    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7324        let mut query = self.selection.select("withoutDirectory");
7325        query = query.arg("path", path.into());
7326        Directory {
7327            proc: self.proc.clone(),
7328            selection: query,
7329            graphql_client: self.graphql_client.clone(),
7330        }
7331    }
7332    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
7333    ///
7334    /// # Arguments
7335    ///
7336    /// * `other` - The directory to compare against
7337    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
7338        let mut query = self.selection.select("diff");
7339        query = query.arg_lazy(
7340            "other",
7341            Box::new(move || {
7342                let other = other.clone();
7343                Box::pin(async move { other.into_id().await.unwrap().quote() })
7344            }),
7345        );
7346        Directory {
7347            proc: self.proc.clone(),
7348            selection: query,
7349            graphql_client: self.graphql_client.clone(),
7350        }
7351    }
7352    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
7353    ///
7354    /// # Arguments
7355    ///
7356    /// * `name` - The name of the file or directory to search for
7357    /// * `start` - The path to start the search from
7358    pub async fn find_up(
7359        &self,
7360        name: impl Into<String>,
7361        start: impl Into<String>,
7362    ) -> Result<String, DaggerError> {
7363        let mut query = self.selection.select("findUp");
7364        query = query.arg("name", name.into());
7365        query = query.arg("start", start.into());
7366        query.execute(self.graphql_client.clone()).await
7367    }
7368    /// Return the difference between this directory and another directory, typically an older snapshot.
7369    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
7370    ///
7371    /// # Arguments
7372    ///
7373    /// * `from` - The base directory snapshot to compare against
7374    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
7375        let mut query = self.selection.select("changes");
7376        query = query.arg_lazy(
7377            "from",
7378            Box::new(move || {
7379                let from = from.clone();
7380                Box::pin(async move { from.into_id().await.unwrap().quote() })
7381            }),
7382        );
7383        Changeset {
7384            proc: self.proc.clone(),
7385            selection: query,
7386            graphql_client: self.graphql_client.clone(),
7387        }
7388    }
7389    /// Return a directory with changes from another directory applied to it.
7390    ///
7391    /// # Arguments
7392    ///
7393    /// * `changes` - Changes to apply to the directory
7394    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
7395        let mut query = self.selection.select("withChanges");
7396        query = query.arg_lazy(
7397            "changes",
7398            Box::new(move || {
7399                let changes = changes.clone();
7400                Box::pin(async move { changes.into_id().await.unwrap().quote() })
7401            }),
7402        );
7403        Directory {
7404            proc: self.proc.clone(),
7405            selection: query,
7406            graphql_client: self.graphql_client.clone(),
7407        }
7408    }
7409    /// Writes the contents of the directory to a path on the host.
7410    ///
7411    /// # Arguments
7412    ///
7413    /// * `path` - Location of the copied directory (e.g., "logs/").
7414    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7415    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7416        let mut query = self.selection.select("export");
7417        query = query.arg("path", path.into());
7418        query.execute(self.graphql_client.clone()).await
7419    }
7420    /// Writes the contents of the directory to a path on the host.
7421    ///
7422    /// # Arguments
7423    ///
7424    /// * `path` - Location of the copied directory (e.g., "logs/").
7425    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7426    pub async fn export_opts(
7427        &self,
7428        path: impl Into<String>,
7429        opts: DirectoryExportOpts,
7430    ) -> Result<String, DaggerError> {
7431        let mut query = self.selection.select("export");
7432        query = query.arg("path", path.into());
7433        if let Some(wipe) = opts.wipe {
7434            query = query.arg("wipe", wipe);
7435        }
7436        query.execute(self.graphql_client.clone()).await
7437    }
7438    /// 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.
7439    ///
7440    /// # Arguments
7441    ///
7442    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7443    pub fn docker_build(&self) -> Container {
7444        let query = self.selection.select("dockerBuild");
7445        Container {
7446            proc: self.proc.clone(),
7447            selection: query,
7448            graphql_client: self.graphql_client.clone(),
7449        }
7450    }
7451    /// 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.
7452    ///
7453    /// # Arguments
7454    ///
7455    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7456    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
7457        let mut query = self.selection.select("dockerBuild");
7458        if let Some(dockerfile) = opts.dockerfile {
7459            query = query.arg("dockerfile", dockerfile);
7460        }
7461        if let Some(platform) = opts.platform {
7462            query = query.arg("platform", platform);
7463        }
7464        if let Some(build_args) = opts.build_args {
7465            query = query.arg("buildArgs", build_args);
7466        }
7467        if let Some(target) = opts.target {
7468            query = query.arg("target", target);
7469        }
7470        if let Some(secrets) = opts.secrets {
7471            query = query.arg("secrets", secrets);
7472        }
7473        if let Some(no_init) = opts.no_init {
7474            query = query.arg("noInit", no_init);
7475        }
7476        if let Some(ssh) = opts.ssh {
7477            query = query.arg("ssh", ssh);
7478        }
7479        Container {
7480            proc: self.proc.clone(),
7481            selection: query,
7482            graphql_client: self.graphql_client.clone(),
7483        }
7484    }
7485    /// Retrieves this directory with all file/dir timestamps set to the given time.
7486    ///
7487    /// # Arguments
7488    ///
7489    /// * `timestamp` - Timestamp to set dir/files in.
7490    ///
7491    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7492    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7493        let mut query = self.selection.select("withTimestamps");
7494        query = query.arg("timestamp", timestamp);
7495        Directory {
7496            proc: self.proc.clone(),
7497            selection: query,
7498            graphql_client: self.graphql_client.clone(),
7499        }
7500    }
7501    /// Retrieves this directory with the given Git-compatible patch applied.
7502    ///
7503    /// # Arguments
7504    ///
7505    /// * `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").
7506    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7507    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
7508        let mut query = self.selection.select("withPatch");
7509        query = query.arg("patch", patch.into());
7510        Directory {
7511            proc: self.proc.clone(),
7512            selection: query,
7513            graphql_client: self.graphql_client.clone(),
7514        }
7515    }
7516    /// Retrieves this directory with the given Git-compatible patch applied.
7517    ///
7518    /// # Arguments
7519    ///
7520    /// * `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").
7521    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7522    pub fn with_patch_opts(
7523        &self,
7524        patch: impl Into<String>,
7525        opts: DirectoryWithPatchOpts,
7526    ) -> Directory {
7527        let mut query = self.selection.select("withPatch");
7528        query = query.arg("patch", patch.into());
7529        if let Some(on_conflict) = opts.on_conflict {
7530            query = query.arg("onConflict", on_conflict);
7531        }
7532        Directory {
7533            proc: self.proc.clone(),
7534            selection: query,
7535            graphql_client: self.graphql_client.clone(),
7536        }
7537    }
7538    /// Retrieves this directory with the given Git-compatible patch file applied.
7539    ///
7540    /// # Arguments
7541    ///
7542    /// * `patch` - File containing the patch to apply
7543    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7544    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
7545        let mut query = self.selection.select("withPatchFile");
7546        query = query.arg_lazy(
7547            "patch",
7548            Box::new(move || {
7549                let patch = patch.clone();
7550                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7551            }),
7552        );
7553        Directory {
7554            proc: self.proc.clone(),
7555            selection: query,
7556            graphql_client: self.graphql_client.clone(),
7557        }
7558    }
7559    /// Retrieves this directory with the given Git-compatible patch file applied.
7560    ///
7561    /// # Arguments
7562    ///
7563    /// * `patch` - File containing the patch to apply
7564    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7565    pub fn with_patch_file_opts(
7566        &self,
7567        patch: impl IntoID<Id>,
7568        opts: DirectoryWithPatchFileOpts,
7569    ) -> Directory {
7570        let mut query = self.selection.select("withPatchFile");
7571        query = query.arg_lazy(
7572            "patch",
7573            Box::new(move || {
7574                let patch = patch.clone();
7575                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7576            }),
7577        );
7578        if let Some(on_conflict) = opts.on_conflict {
7579            query = query.arg("onConflict", on_conflict);
7580        }
7581        Directory {
7582            proc: self.proc.clone(),
7583            selection: query,
7584            graphql_client: self.graphql_client.clone(),
7585        }
7586    }
7587    /// Converts this directory to a local git repository
7588    pub fn as_git(&self) -> GitRepository {
7589        let query = self.selection.select("asGit");
7590        GitRepository {
7591            proc: self.proc.clone(),
7592            selection: query,
7593            graphql_client: self.graphql_client.clone(),
7594        }
7595    }
7596    /// Creates a synthetic workspace from this directory.
7597    ///
7598    /// # Arguments
7599    ///
7600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7601    pub fn as_workspace(&self) -> Workspace {
7602        let query = self.selection.select("asWorkspace");
7603        Workspace {
7604            proc: self.proc.clone(),
7605            selection: query,
7606            graphql_client: self.graphql_client.clone(),
7607        }
7608    }
7609    /// Creates a synthetic workspace from this directory.
7610    ///
7611    /// # Arguments
7612    ///
7613    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7614    pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
7615        let mut query = self.selection.select("asWorkspace");
7616        if let Some(cwd) = opts.cwd {
7617            query = query.arg("cwd", cwd);
7618        }
7619        Workspace {
7620            proc: self.proc.clone(),
7621            selection: query,
7622            graphql_client: self.graphql_client.clone(),
7623        }
7624    }
7625    /// Opens an interactive terminal in new container with this directory mounted inside.
7626    ///
7627    /// # Arguments
7628    ///
7629    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7630    pub fn terminal(&self) -> Directory {
7631        let query = self.selection.select("terminal");
7632        Directory {
7633            proc: self.proc.clone(),
7634            selection: query,
7635            graphql_client: self.graphql_client.clone(),
7636        }
7637    }
7638    /// Opens an interactive terminal in new container with this directory mounted inside.
7639    ///
7640    /// # Arguments
7641    ///
7642    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7643    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
7644        let mut query = self.selection.select("terminal");
7645        if let Some(container) = opts.container {
7646            query = query.arg("container", container);
7647        }
7648        if let Some(cmd) = opts.cmd {
7649            query = query.arg("cmd", cmd);
7650        }
7651        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
7652            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
7653        }
7654        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
7655            query = query.arg(
7656                "experimentalPrivilegedNesting",
7657                experimental_privileged_nesting,
7658            );
7659        }
7660        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
7661            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
7662        }
7663        Directory {
7664            proc: self.proc.clone(),
7665            selection: query,
7666            graphql_client: self.graphql_client.clone(),
7667        }
7668    }
7669    /// Return a snapshot with a symlink
7670    ///
7671    /// # Arguments
7672    ///
7673    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
7674    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
7675    pub fn with_symlink(
7676        &self,
7677        target: impl Into<String>,
7678        link_name: impl Into<String>,
7679    ) -> Directory {
7680        let mut query = self.selection.select("withSymlink");
7681        query = query.arg("target", target.into());
7682        query = query.arg("linkName", link_name.into());
7683        Directory {
7684            proc: self.proc.clone(),
7685            selection: query,
7686            graphql_client: self.graphql_client.clone(),
7687        }
7688    }
7689    /// Change the owner of the directory contents recursively.
7690    ///
7691    /// # Arguments
7692    ///
7693    /// * `path` - Path of the directory to change ownership of (e.g., "/").
7694    /// * `owner` - A user:group to set for the mounted directory and its contents.
7695    ///
7696    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
7697    ///
7698    /// If the group is omitted, it defaults to the same as the user.
7699    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
7700        let mut query = self.selection.select("chown");
7701        query = query.arg("path", path.into());
7702        query = query.arg("owner", owner.into());
7703        Directory {
7704            proc: self.proc.clone(),
7705            selection: query,
7706            graphql_client: self.graphql_client.clone(),
7707        }
7708    }
7709    /// Raise an error.
7710    ///
7711    /// # Arguments
7712    ///
7713    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
7714    pub fn with_error(&self, err: impl Into<String>) -> Directory {
7715        let mut query = self.selection.select("withError");
7716        query = query.arg("err", err.into());
7717        Directory {
7718            proc: self.proc.clone(),
7719            selection: query,
7720            graphql_client: self.graphql_client.clone(),
7721        }
7722    }
7723    /// Load the directory as a Dagger module source
7724    ///
7725    /// # Arguments
7726    ///
7727    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7728    pub fn as_module(&self) -> Module {
7729        let query = self.selection.select("asModule");
7730        Module {
7731            proc: self.proc.clone(),
7732            selection: query,
7733            graphql_client: self.graphql_client.clone(),
7734        }
7735    }
7736    /// Load the directory as a Dagger module source
7737    ///
7738    /// # Arguments
7739    ///
7740    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7741    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
7742        let mut query = self.selection.select("asModule");
7743        if let Some(source_root_path) = opts.source_root_path {
7744            query = query.arg("sourceRootPath", source_root_path);
7745        }
7746        Module {
7747            proc: self.proc.clone(),
7748            selection: query,
7749            graphql_client: self.graphql_client.clone(),
7750        }
7751    }
7752    /// Load the directory as a Dagger module source
7753    ///
7754    /// # Arguments
7755    ///
7756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7757    pub fn as_module_source(&self) -> ModuleSource {
7758        let query = self.selection.select("asModuleSource");
7759        ModuleSource {
7760            proc: self.proc.clone(),
7761            selection: query,
7762            graphql_client: self.graphql_client.clone(),
7763        }
7764    }
7765    /// Load the directory as a Dagger module source
7766    ///
7767    /// # Arguments
7768    ///
7769    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7770    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
7771        let mut query = self.selection.select("asModuleSource");
7772        if let Some(source_root_path) = opts.source_root_path {
7773            query = query.arg("sourceRootPath", source_root_path);
7774        }
7775        ModuleSource {
7776            proc: self.proc.clone(),
7777            selection: query,
7778            graphql_client: self.graphql_client.clone(),
7779        }
7780    }
7781}
7782impl Exportable for Directory {
7783    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7784        let query = self.selection.select("id");
7785        let graphql_client = self.graphql_client.clone();
7786        async move { query.execute(graphql_client).await }
7787    }
7788    fn export(
7789        &self,
7790        path: impl Into<String>,
7791    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7792        let mut query = self.selection.select("export");
7793        query = query.arg("path", path.into());
7794        let graphql_client = self.graphql_client.clone();
7795        async move { query.execute(graphql_client).await }
7796    }
7797}
7798impl Node for Directory {
7799    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7800        let query = self.selection.select("id");
7801        let graphql_client = self.graphql_client.clone();
7802        async move { query.execute(graphql_client).await }
7803    }
7804}
7805impl Syncer for Directory {
7806    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7807        let query = self.selection.select("id");
7808        let graphql_client = self.graphql_client.clone();
7809        async move { query.execute(graphql_client).await }
7810    }
7811    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7812        let query = self.selection.select("sync");
7813        let proc = self.proc.clone();
7814        let graphql_client = self.graphql_client.clone();
7815        async move {
7816            let id: Id = query.execute(graphql_client.clone()).await?;
7817            Ok(Self {
7818                proc,
7819                selection: query
7820                    .root()
7821                    .select("node")
7822                    .arg("id", &id.0)
7823                    .inline_fragment("Directory"),
7824                graphql_client,
7825            })
7826        }
7827    }
7828}
7829#[derive(Clone)]
7830pub struct Engine {
7831    pub proc: Option<Arc<DaggerSessionProc>>,
7832    pub selection: Selection,
7833    pub graphql_client: DynGraphQLClient,
7834}
7835impl IntoID<Id> for Engine {
7836    fn into_id(
7837        self,
7838    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7839        Box::pin(async move { self.id().await })
7840    }
7841}
7842impl Loadable for Engine {
7843    fn graphql_type() -> &'static str {
7844        "Engine"
7845    }
7846    fn from_query(
7847        proc: Option<Arc<DaggerSessionProc>>,
7848        selection: Selection,
7849        graphql_client: DynGraphQLClient,
7850    ) -> Self {
7851        Self {
7852            proc,
7853            selection,
7854            graphql_client,
7855        }
7856    }
7857}
7858impl Engine {
7859    /// A unique identifier for this Engine.
7860    pub async fn id(&self) -> Result<Id, DaggerError> {
7861        let query = self.selection.select("id");
7862        query.execute(self.graphql_client.clone()).await
7863    }
7864    /// The list of connected client IDs
7865    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7866        let query = self.selection.select("clients");
7867        query.execute(self.graphql_client.clone()).await
7868    }
7869    /// The name of the engine instance.
7870    pub async fn name(&self) -> Result<String, DaggerError> {
7871        let query = self.selection.select("name");
7872        query.execute(self.graphql_client.clone()).await
7873    }
7874    /// The local engine cache state tracked by dagql
7875    pub fn local_cache(&self) -> EngineCache {
7876        let query = self.selection.select("localCache");
7877        EngineCache {
7878            proc: self.proc.clone(),
7879            selection: query,
7880            graphql_client: self.graphql_client.clone(),
7881        }
7882    }
7883}
7884impl Node for Engine {
7885    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7886        let query = self.selection.select("id");
7887        let graphql_client = self.graphql_client.clone();
7888        async move { query.execute(graphql_client).await }
7889    }
7890}
7891#[derive(Clone)]
7892pub struct EngineCache {
7893    pub proc: Option<Arc<DaggerSessionProc>>,
7894    pub selection: Selection,
7895    pub graphql_client: DynGraphQLClient,
7896}
7897#[derive(Builder, Debug, PartialEq)]
7898pub struct EngineCacheEntrySetOpts<'a> {
7899    #[builder(setter(into, strip_option), default)]
7900    pub key: Option<&'a str>,
7901}
7902#[derive(Builder, Debug, PartialEq)]
7903pub struct EngineCachePruneOpts<'a> {
7904    /// Override the maximum structural metadata estimate in absolute bytes. Explicit values must be positive; the configured/default value is used when omitted.
7905    #[builder(setter(into, strip_option), default)]
7906    pub max_estimated_bytes: Option<isize>,
7907    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
7908    #[builder(setter(into, strip_option), default)]
7909    pub max_used_space: Option<&'a str>,
7910    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
7911    #[builder(setter(into, strip_option), default)]
7912    pub min_free_space: Option<&'a str>,
7913    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
7914    #[builder(setter(into, strip_option), default)]
7915    pub reserved_space: Option<&'a str>,
7916    /// 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.
7917    #[builder(setter(into, strip_option), default)]
7918    pub target_estimated_bytes: Option<isize>,
7919    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
7920    #[builder(setter(into, strip_option), default)]
7921    pub target_space: Option<&'a str>,
7922    /// 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.
7923    #[builder(setter(into, strip_option), default)]
7924    pub use_default_policy: Option<bool>,
7925}
7926impl IntoID<Id> for EngineCache {
7927    fn into_id(
7928        self,
7929    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7930        Box::pin(async move { self.id().await })
7931    }
7932}
7933impl Loadable for EngineCache {
7934    fn graphql_type() -> &'static str {
7935        "EngineCache"
7936    }
7937    fn from_query(
7938        proc: Option<Arc<DaggerSessionProc>>,
7939        selection: Selection,
7940        graphql_client: DynGraphQLClient,
7941    ) -> Self {
7942        Self {
7943            proc,
7944            selection,
7945            graphql_client,
7946        }
7947    }
7948}
7949impl EngineCache {
7950    /// A unique identifier for this EngineCache.
7951    pub async fn id(&self) -> Result<Id, DaggerError> {
7952        let query = self.selection.select("id");
7953        query.execute(self.graphql_client.clone()).await
7954    }
7955    /// The current set of entries in the cache
7956    ///
7957    /// # Arguments
7958    ///
7959    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7960    pub fn entry_set(&self) -> EngineCacheEntrySet {
7961        let query = self.selection.select("entrySet");
7962        EngineCacheEntrySet {
7963            proc: self.proc.clone(),
7964            selection: query,
7965            graphql_client: self.graphql_client.clone(),
7966        }
7967    }
7968    /// The current set of entries in the cache
7969    ///
7970    /// # Arguments
7971    ///
7972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7973    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
7974        let mut query = self.selection.select("entrySet");
7975        if let Some(key) = opts.key {
7976            query = query.arg("key", key);
7977        }
7978        EngineCacheEntrySet {
7979            proc: self.proc.clone(),
7980            selection: query,
7981            graphql_client: self.graphql_client.clone(),
7982        }
7983    }
7984    /// Prune the cache of releaseable entries
7985    ///
7986    /// # Arguments
7987    ///
7988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7989    pub async fn prune(&self) -> Result<Void, DaggerError> {
7990        let query = self.selection.select("prune");
7991        query.execute(self.graphql_client.clone()).await
7992    }
7993    /// Prune the cache of releaseable entries
7994    ///
7995    /// # Arguments
7996    ///
7997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7998    pub async fn prune_opts<'a>(
7999        &self,
8000        opts: EngineCachePruneOpts<'a>,
8001    ) -> Result<Void, DaggerError> {
8002        let mut query = self.selection.select("prune");
8003        if let Some(use_default_policy) = opts.use_default_policy {
8004            query = query.arg("useDefaultPolicy", use_default_policy);
8005        }
8006        if let Some(max_used_space) = opts.max_used_space {
8007            query = query.arg("maxUsedSpace", max_used_space);
8008        }
8009        if let Some(reserved_space) = opts.reserved_space {
8010            query = query.arg("reservedSpace", reserved_space);
8011        }
8012        if let Some(min_free_space) = opts.min_free_space {
8013            query = query.arg("minFreeSpace", min_free_space);
8014        }
8015        if let Some(target_space) = opts.target_space {
8016            query = query.arg("targetSpace", target_space);
8017        }
8018        if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
8019            query = query.arg("maxEstimatedBytes", max_estimated_bytes);
8020        }
8021        if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
8022            query = query.arg("targetEstimatedBytes", target_estimated_bytes);
8023        }
8024        query.execute(self.graphql_client.clone()).await
8025    }
8026    /// The maximum bytes to keep in the cache without pruning.
8027    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
8028        let query = self.selection.select("maxUsedSpace");
8029        query.execute(self.graphql_client.clone()).await
8030    }
8031    /// The target number of bytes to keep when pruning.
8032    pub async fn target_space(&self) -> Result<isize, DaggerError> {
8033        let query = self.selection.select("targetSpace");
8034        query.execute(self.graphql_client.clone()).await
8035    }
8036    /// The minimum amount of disk space this policy is guaranteed to retain.
8037    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
8038        let query = self.selection.select("reservedSpace");
8039        query.execute(self.graphql_client.clone()).await
8040    }
8041    /// The target amount of free disk space the garbage collector will attempt to leave.
8042    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
8043        let query = self.selection.select("minFreeSpace");
8044        query.execute(self.graphql_client.clone()).await
8045    }
8046}
8047impl Node for EngineCache {
8048    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8049        let query = self.selection.select("id");
8050        let graphql_client = self.graphql_client.clone();
8051        async move { query.execute(graphql_client).await }
8052    }
8053}
8054#[derive(Clone)]
8055pub struct EngineCacheEntry {
8056    pub proc: Option<Arc<DaggerSessionProc>>,
8057    pub selection: Selection,
8058    pub graphql_client: DynGraphQLClient,
8059}
8060impl IntoID<Id> for EngineCacheEntry {
8061    fn into_id(
8062        self,
8063    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8064        Box::pin(async move { self.id().await })
8065    }
8066}
8067impl Loadable for EngineCacheEntry {
8068    fn graphql_type() -> &'static str {
8069        "EngineCacheEntry"
8070    }
8071    fn from_query(
8072        proc: Option<Arc<DaggerSessionProc>>,
8073        selection: Selection,
8074        graphql_client: DynGraphQLClient,
8075    ) -> Self {
8076        Self {
8077            proc,
8078            selection,
8079            graphql_client,
8080        }
8081    }
8082}
8083impl EngineCacheEntry {
8084    /// A unique identifier for this EngineCacheEntry.
8085    pub async fn id(&self) -> Result<Id, DaggerError> {
8086        let query = self.selection.select("id");
8087        query.execute(self.graphql_client.clone()).await
8088    }
8089    /// The description of the cache entry.
8090    pub async fn description(&self) -> Result<String, DaggerError> {
8091        let query = self.selection.select("description");
8092        query.execute(self.graphql_client.clone()).await
8093    }
8094    /// The disk space used by the cache entry.
8095    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8096        let query = self.selection.select("diskSpaceBytes");
8097        query.execute(self.graphql_client.clone()).await
8098    }
8099    /// The time the cache entry was created, in Unix nanoseconds.
8100    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
8101        let query = self.selection.select("createdTimeUnixNano");
8102        query.execute(self.graphql_client.clone()).await
8103    }
8104    /// The most recent time the cache entry was used, in Unix nanoseconds.
8105    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
8106        let query = self.selection.select("mostRecentUseTimeUnixNano");
8107        query.execute(self.graphql_client.clone()).await
8108    }
8109    /// Whether the cache entry is actively being used.
8110    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
8111        let query = self.selection.select("activelyUsed");
8112        query.execute(self.graphql_client.clone()).await
8113    }
8114    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
8115    pub async fn record_type(&self) -> Result<String, DaggerError> {
8116        let query = self.selection.select("recordType");
8117        query.execute(self.graphql_client.clone()).await
8118    }
8119    /// The storage record types represented by this cache entry.
8120    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
8121        let query = self.selection.select("recordTypes");
8122        query.execute(self.graphql_client.clone()).await
8123    }
8124    /// The DagQL call that produced this cache entry.
8125    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
8126        let query = self.selection.select("dagqlCall");
8127        query.execute(self.graphql_client.clone()).await
8128    }
8129}
8130impl Node for EngineCacheEntry {
8131    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8132        let query = self.selection.select("id");
8133        let graphql_client = self.graphql_client.clone();
8134        async move { query.execute(graphql_client).await }
8135    }
8136}
8137#[derive(Clone)]
8138pub struct EngineCacheEntrySet {
8139    pub proc: Option<Arc<DaggerSessionProc>>,
8140    pub selection: Selection,
8141    pub graphql_client: DynGraphQLClient,
8142}
8143impl IntoID<Id> for EngineCacheEntrySet {
8144    fn into_id(
8145        self,
8146    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8147        Box::pin(async move { self.id().await })
8148    }
8149}
8150impl Loadable for EngineCacheEntrySet {
8151    fn graphql_type() -> &'static str {
8152        "EngineCacheEntrySet"
8153    }
8154    fn from_query(
8155        proc: Option<Arc<DaggerSessionProc>>,
8156        selection: Selection,
8157        graphql_client: DynGraphQLClient,
8158    ) -> Self {
8159        Self {
8160            proc,
8161            selection,
8162            graphql_client,
8163        }
8164    }
8165}
8166impl EngineCacheEntrySet {
8167    /// A unique identifier for this EngineCacheEntrySet.
8168    pub async fn id(&self) -> Result<Id, DaggerError> {
8169        let query = self.selection.select("id");
8170        query.execute(self.graphql_client.clone()).await
8171    }
8172    /// The list of individual cache entries in the set
8173    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
8174        let query = self.selection.select("entries");
8175        let query = query.select("id");
8176        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8177        Ok(ids
8178            .into_iter()
8179            .map(|id| EngineCacheEntry {
8180                proc: self.proc.clone(),
8181                selection: crate::querybuilder::query()
8182                    .select("node")
8183                    .arg("id", &id.0)
8184                    .inline_fragment("EngineCacheEntry"),
8185                graphql_client: self.graphql_client.clone(),
8186            })
8187            .collect())
8188    }
8189    /// The number of cache entries in this set.
8190    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
8191        let query = self.selection.select("entryCount");
8192        query.execute(self.graphql_client.clone()).await
8193    }
8194    /// The total disk space used by the cache entries in this set.
8195    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8196        let query = self.selection.select("diskSpaceBytes");
8197        query.execute(self.graphql_client.clone()).await
8198    }
8199}
8200impl Node for EngineCacheEntrySet {
8201    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8202        let query = self.selection.select("id");
8203        let graphql_client = self.graphql_client.clone();
8204        async move { query.execute(graphql_client).await }
8205    }
8206}
8207#[derive(Clone)]
8208pub struct EnumTypeDef {
8209    pub proc: Option<Arc<DaggerSessionProc>>,
8210    pub selection: Selection,
8211    pub graphql_client: DynGraphQLClient,
8212}
8213impl IntoID<Id> for EnumTypeDef {
8214    fn into_id(
8215        self,
8216    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8217        Box::pin(async move { self.id().await })
8218    }
8219}
8220impl Loadable for EnumTypeDef {
8221    fn graphql_type() -> &'static str {
8222        "EnumTypeDef"
8223    }
8224    fn from_query(
8225        proc: Option<Arc<DaggerSessionProc>>,
8226        selection: Selection,
8227        graphql_client: DynGraphQLClient,
8228    ) -> Self {
8229        Self {
8230            proc,
8231            selection,
8232            graphql_client,
8233        }
8234    }
8235}
8236impl EnumTypeDef {
8237    /// A unique identifier for this EnumTypeDef.
8238    pub async fn id(&self) -> Result<Id, DaggerError> {
8239        let query = self.selection.select("id");
8240        query.execute(self.graphql_client.clone()).await
8241    }
8242    /// The members of the enum.
8243    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8244        let query = self.selection.select("values");
8245        let query = query.select("id");
8246        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8247        Ok(ids
8248            .into_iter()
8249            .map(|id| EnumValueTypeDef {
8250                proc: self.proc.clone(),
8251                selection: crate::querybuilder::query()
8252                    .select("node")
8253                    .arg("id", &id.0)
8254                    .inline_fragment("EnumValueTypeDef"),
8255                graphql_client: self.graphql_client.clone(),
8256            })
8257            .collect())
8258    }
8259    /// The members of the enum.
8260    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8261        let query = self.selection.select("members");
8262        let query = query.select("id");
8263        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8264        Ok(ids
8265            .into_iter()
8266            .map(|id| EnumValueTypeDef {
8267                proc: self.proc.clone(),
8268                selection: crate::querybuilder::query()
8269                    .select("node")
8270                    .arg("id", &id.0)
8271                    .inline_fragment("EnumValueTypeDef"),
8272                graphql_client: self.graphql_client.clone(),
8273            })
8274            .collect())
8275    }
8276    /// The name of the enum.
8277    pub async fn name(&self) -> Result<String, DaggerError> {
8278        let query = self.selection.select("name");
8279        query.execute(self.graphql_client.clone()).await
8280    }
8281    /// A doc string for the enum, if any.
8282    pub async fn description(&self) -> Result<String, DaggerError> {
8283        let query = self.selection.select("description");
8284        query.execute(self.graphql_client.clone()).await
8285    }
8286    /// The location of this enum declaration.
8287    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8288        let query = self.selection.select("sourceMap");
8289        let query = query.select("id");
8290        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8291        Ok(id.map(|id| SourceMap {
8292            proc: self.proc.clone(),
8293            selection: query
8294                .root()
8295                .select("node")
8296                .arg("id", &id.0)
8297                .inline_fragment("SourceMap"),
8298            graphql_client: self.graphql_client.clone(),
8299        }))
8300    }
8301    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
8302    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8303        let query = self.selection.select("sourceModuleName");
8304        query.execute(self.graphql_client.clone()).await
8305    }
8306}
8307impl Node for EnumTypeDef {
8308    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8309        let query = self.selection.select("id");
8310        let graphql_client = self.graphql_client.clone();
8311        async move { query.execute(graphql_client).await }
8312    }
8313}
8314#[derive(Clone)]
8315pub struct EnumValueTypeDef {
8316    pub proc: Option<Arc<DaggerSessionProc>>,
8317    pub selection: Selection,
8318    pub graphql_client: DynGraphQLClient,
8319}
8320impl IntoID<Id> for EnumValueTypeDef {
8321    fn into_id(
8322        self,
8323    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8324        Box::pin(async move { self.id().await })
8325    }
8326}
8327impl Loadable for EnumValueTypeDef {
8328    fn graphql_type() -> &'static str {
8329        "EnumValueTypeDef"
8330    }
8331    fn from_query(
8332        proc: Option<Arc<DaggerSessionProc>>,
8333        selection: Selection,
8334        graphql_client: DynGraphQLClient,
8335    ) -> Self {
8336        Self {
8337            proc,
8338            selection,
8339            graphql_client,
8340        }
8341    }
8342}
8343impl EnumValueTypeDef {
8344    /// A unique identifier for this EnumValueTypeDef.
8345    pub async fn id(&self) -> Result<Id, DaggerError> {
8346        let query = self.selection.select("id");
8347        query.execute(self.graphql_client.clone()).await
8348    }
8349    /// The name of the enum member.
8350    pub async fn name(&self) -> Result<String, DaggerError> {
8351        let query = self.selection.select("name");
8352        query.execute(self.graphql_client.clone()).await
8353    }
8354    /// The value of the enum member
8355    pub async fn value(&self) -> Result<String, DaggerError> {
8356        let query = self.selection.select("value");
8357        query.execute(self.graphql_client.clone()).await
8358    }
8359    /// A doc string for the enum member, if any.
8360    pub async fn description(&self) -> Result<String, DaggerError> {
8361        let query = self.selection.select("description");
8362        query.execute(self.graphql_client.clone()).await
8363    }
8364    /// The location of this enum member declaration.
8365    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8366        let query = self.selection.select("sourceMap");
8367        let query = query.select("id");
8368        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8369        Ok(id.map(|id| SourceMap {
8370            proc: self.proc.clone(),
8371            selection: query
8372                .root()
8373                .select("node")
8374                .arg("id", &id.0)
8375                .inline_fragment("SourceMap"),
8376            graphql_client: self.graphql_client.clone(),
8377        }))
8378    }
8379    /// The reason this enum member is deprecated, if any.
8380    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8381        let query = self.selection.select("deprecated");
8382        query.execute(self.graphql_client.clone()).await
8383    }
8384}
8385impl Node for EnumValueTypeDef {
8386    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8387        let query = self.selection.select("id");
8388        let graphql_client = self.graphql_client.clone();
8389        async move { query.execute(graphql_client).await }
8390    }
8391}
8392#[derive(Clone)]
8393pub struct EnvFile {
8394    pub proc: Option<Arc<DaggerSessionProc>>,
8395    pub selection: Selection,
8396    pub graphql_client: DynGraphQLClient,
8397}
8398#[derive(Builder, Debug, PartialEq)]
8399pub struct EnvFileVariablesOpts {
8400    /// Return values exactly as written to the file. No quote removal or variable expansion
8401    #[builder(setter(into, strip_option), default)]
8402    pub raw: Option<bool>,
8403}
8404#[derive(Builder, Debug, PartialEq)]
8405pub struct EnvFileGetOpts {
8406    /// Return the value exactly as written to the file. No quote removal or variable expansion
8407    #[builder(setter(into, strip_option), default)]
8408    pub raw: Option<bool>,
8409}
8410impl IntoID<Id> for EnvFile {
8411    fn into_id(
8412        self,
8413    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8414        Box::pin(async move { self.id().await })
8415    }
8416}
8417impl Loadable for EnvFile {
8418    fn graphql_type() -> &'static str {
8419        "EnvFile"
8420    }
8421    fn from_query(
8422        proc: Option<Arc<DaggerSessionProc>>,
8423        selection: Selection,
8424        graphql_client: DynGraphQLClient,
8425    ) -> Self {
8426        Self {
8427            proc,
8428            selection,
8429            graphql_client,
8430        }
8431    }
8432}
8433impl EnvFile {
8434    /// A unique identifier for this EnvFile.
8435    pub async fn id(&self) -> Result<Id, DaggerError> {
8436        let query = self.selection.select("id");
8437        query.execute(self.graphql_client.clone()).await
8438    }
8439    /// Return all variables
8440    ///
8441    /// # Arguments
8442    ///
8443    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8444    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8445        let query = self.selection.select("variables");
8446        let query = query.select("id");
8447        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8448        Ok(ids
8449            .into_iter()
8450            .map(|id| EnvVariable {
8451                proc: self.proc.clone(),
8452                selection: crate::querybuilder::query()
8453                    .select("node")
8454                    .arg("id", &id.0)
8455                    .inline_fragment("EnvVariable"),
8456                graphql_client: self.graphql_client.clone(),
8457            })
8458            .collect())
8459    }
8460    /// Return all variables
8461    ///
8462    /// # Arguments
8463    ///
8464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8465    pub async fn variables_opts(
8466        &self,
8467        opts: EnvFileVariablesOpts,
8468    ) -> Result<Vec<EnvVariable>, DaggerError> {
8469        let mut query = self.selection.select("variables");
8470        if let Some(raw) = opts.raw {
8471            query = query.arg("raw", raw);
8472        }
8473        let query = query.select("id");
8474        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8475        Ok(ids
8476            .into_iter()
8477            .map(|id| EnvVariable {
8478                proc: self.proc.clone(),
8479                selection: crate::querybuilder::query()
8480                    .select("node")
8481                    .arg("id", &id.0)
8482                    .inline_fragment("EnvVariable"),
8483                graphql_client: self.graphql_client.clone(),
8484            })
8485            .collect())
8486    }
8487    /// Add a variable
8488    ///
8489    /// # Arguments
8490    ///
8491    /// * `name` - Variable name
8492    /// * `value` - Variable value
8493    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8494        let mut query = self.selection.select("withVariable");
8495        query = query.arg("name", name.into());
8496        query = query.arg("value", value.into());
8497        EnvFile {
8498            proc: self.proc.clone(),
8499            selection: query,
8500            graphql_client: self.graphql_client.clone(),
8501        }
8502    }
8503    /// Remove all occurrences of the named variable
8504    ///
8505    /// # Arguments
8506    ///
8507    /// * `name` - Variable name
8508    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8509        let mut query = self.selection.select("withoutVariable");
8510        query = query.arg("name", name.into());
8511        EnvFile {
8512            proc: self.proc.clone(),
8513            selection: query,
8514            graphql_client: self.graphql_client.clone(),
8515        }
8516    }
8517    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8518    ///
8519    /// # Arguments
8520    ///
8521    /// * `name` - Variable name
8522    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8523    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8524        let mut query = self.selection.select("get");
8525        query = query.arg("name", name.into());
8526        query.execute(self.graphql_client.clone()).await
8527    }
8528    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8529    ///
8530    /// # Arguments
8531    ///
8532    /// * `name` - Variable name
8533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8534    pub async fn get_opts(
8535        &self,
8536        name: impl Into<String>,
8537        opts: EnvFileGetOpts,
8538    ) -> Result<String, DaggerError> {
8539        let mut query = self.selection.select("get");
8540        query = query.arg("name", name.into());
8541        if let Some(raw) = opts.raw {
8542            query = query.arg("raw", raw);
8543        }
8544        query.execute(self.graphql_client.clone()).await
8545    }
8546    /// Check if a variable exists
8547    ///
8548    /// # Arguments
8549    ///
8550    /// * `name` - Variable name
8551    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8552        let mut query = self.selection.select("exists");
8553        query = query.arg("name", name.into());
8554        query.execute(self.graphql_client.clone()).await
8555    }
8556    /// Return as a file
8557    pub fn as_file(&self) -> File {
8558        let query = self.selection.select("asFile");
8559        File {
8560            proc: self.proc.clone(),
8561            selection: query,
8562            graphql_client: self.graphql_client.clone(),
8563        }
8564    }
8565    /// 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
8566    ///
8567    /// # Arguments
8568    ///
8569    /// * `prefix` - The prefix to filter by
8570    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8571        let mut query = self.selection.select("namespace");
8572        query = query.arg("prefix", prefix.into());
8573        EnvFile {
8574            proc: self.proc.clone(),
8575            selection: query,
8576            graphql_client: self.graphql_client.clone(),
8577        }
8578    }
8579}
8580impl Node for EnvFile {
8581    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8582        let query = self.selection.select("id");
8583        let graphql_client = self.graphql_client.clone();
8584        async move { query.execute(graphql_client).await }
8585    }
8586}
8587#[derive(Clone)]
8588pub struct EnvVariable {
8589    pub proc: Option<Arc<DaggerSessionProc>>,
8590    pub selection: Selection,
8591    pub graphql_client: DynGraphQLClient,
8592}
8593impl IntoID<Id> for EnvVariable {
8594    fn into_id(
8595        self,
8596    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8597        Box::pin(async move { self.id().await })
8598    }
8599}
8600impl Loadable for EnvVariable {
8601    fn graphql_type() -> &'static str {
8602        "EnvVariable"
8603    }
8604    fn from_query(
8605        proc: Option<Arc<DaggerSessionProc>>,
8606        selection: Selection,
8607        graphql_client: DynGraphQLClient,
8608    ) -> Self {
8609        Self {
8610            proc,
8611            selection,
8612            graphql_client,
8613        }
8614    }
8615}
8616impl EnvVariable {
8617    /// A unique identifier for this EnvVariable.
8618    pub async fn id(&self) -> Result<Id, DaggerError> {
8619        let query = self.selection.select("id");
8620        query.execute(self.graphql_client.clone()).await
8621    }
8622    /// The environment variable name.
8623    pub async fn name(&self) -> Result<String, DaggerError> {
8624        let query = self.selection.select("name");
8625        query.execute(self.graphql_client.clone()).await
8626    }
8627    /// The environment variable value.
8628    pub async fn value(&self) -> Result<String, DaggerError> {
8629        let query = self.selection.select("value");
8630        query.execute(self.graphql_client.clone()).await
8631    }
8632}
8633impl Node for EnvVariable {
8634    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8635        let query = self.selection.select("id");
8636        let graphql_client = self.graphql_client.clone();
8637        async move { query.execute(graphql_client).await }
8638    }
8639}
8640#[derive(Clone)]
8641pub struct Error {
8642    pub proc: Option<Arc<DaggerSessionProc>>,
8643    pub selection: Selection,
8644    pub graphql_client: DynGraphQLClient,
8645}
8646impl IntoID<Id> for Error {
8647    fn into_id(
8648        self,
8649    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8650        Box::pin(async move { self.id().await })
8651    }
8652}
8653impl Loadable for Error {
8654    fn graphql_type() -> &'static str {
8655        "Error"
8656    }
8657    fn from_query(
8658        proc: Option<Arc<DaggerSessionProc>>,
8659        selection: Selection,
8660        graphql_client: DynGraphQLClient,
8661    ) -> Self {
8662        Self {
8663            proc,
8664            selection,
8665            graphql_client,
8666        }
8667    }
8668}
8669impl Error {
8670    /// A unique identifier for this Error.
8671    pub async fn id(&self) -> Result<Id, DaggerError> {
8672        let query = self.selection.select("id");
8673        query.execute(self.graphql_client.clone()).await
8674    }
8675    /// Add a value to the error.
8676    ///
8677    /// # Arguments
8678    ///
8679    /// * `name` - The name of the value.
8680    /// * `value` - The value to store on the error.
8681    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8682        let mut query = self.selection.select("withValue");
8683        query = query.arg("name", name.into());
8684        query = query.arg("value", value);
8685        Error {
8686            proc: self.proc.clone(),
8687            selection: query,
8688            graphql_client: self.graphql_client.clone(),
8689        }
8690    }
8691    /// A description of the error.
8692    pub async fn message(&self) -> Result<String, DaggerError> {
8693        let query = self.selection.select("message");
8694        query.execute(self.graphql_client.clone()).await
8695    }
8696    /// The extensions of the error.
8697    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8698        let query = self.selection.select("values");
8699        let query = query.select("id");
8700        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8701        Ok(ids
8702            .into_iter()
8703            .map(|id| ErrorValue {
8704                proc: self.proc.clone(),
8705                selection: crate::querybuilder::query()
8706                    .select("node")
8707                    .arg("id", &id.0)
8708                    .inline_fragment("ErrorValue"),
8709                graphql_client: self.graphql_client.clone(),
8710            })
8711            .collect())
8712    }
8713}
8714impl Node for Error {
8715    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8716        let query = self.selection.select("id");
8717        let graphql_client = self.graphql_client.clone();
8718        async move { query.execute(graphql_client).await }
8719    }
8720}
8721#[derive(Clone)]
8722pub struct ErrorValue {
8723    pub proc: Option<Arc<DaggerSessionProc>>,
8724    pub selection: Selection,
8725    pub graphql_client: DynGraphQLClient,
8726}
8727impl IntoID<Id> for ErrorValue {
8728    fn into_id(
8729        self,
8730    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8731        Box::pin(async move { self.id().await })
8732    }
8733}
8734impl Loadable for ErrorValue {
8735    fn graphql_type() -> &'static str {
8736        "ErrorValue"
8737    }
8738    fn from_query(
8739        proc: Option<Arc<DaggerSessionProc>>,
8740        selection: Selection,
8741        graphql_client: DynGraphQLClient,
8742    ) -> Self {
8743        Self {
8744            proc,
8745            selection,
8746            graphql_client,
8747        }
8748    }
8749}
8750impl ErrorValue {
8751    /// A unique identifier for this ErrorValue.
8752    pub async fn id(&self) -> Result<Id, DaggerError> {
8753        let query = self.selection.select("id");
8754        query.execute(self.graphql_client.clone()).await
8755    }
8756    /// The name of the value.
8757    pub async fn name(&self) -> Result<String, DaggerError> {
8758        let query = self.selection.select("name");
8759        query.execute(self.graphql_client.clone()).await
8760    }
8761    /// The value.
8762    pub async fn value(&self) -> Result<Json, DaggerError> {
8763        let query = self.selection.select("value");
8764        query.execute(self.graphql_client.clone()).await
8765    }
8766}
8767impl Node for ErrorValue {
8768    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8769        let query = self.selection.select("id");
8770        let graphql_client = self.graphql_client.clone();
8771        async move { query.execute(graphql_client).await }
8772    }
8773}
8774#[derive(Clone)]
8775pub struct Expertise {
8776    pub proc: Option<Arc<DaggerSessionProc>>,
8777    pub selection: Selection,
8778    pub graphql_client: DynGraphQLClient,
8779}
8780impl IntoID<Id> for Expertise {
8781    fn into_id(
8782        self,
8783    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8784        Box::pin(async move { self.id().await })
8785    }
8786}
8787impl Loadable for Expertise {
8788    fn graphql_type() -> &'static str {
8789        "Expertise"
8790    }
8791    fn from_query(
8792        proc: Option<Arc<DaggerSessionProc>>,
8793        selection: Selection,
8794        graphql_client: DynGraphQLClient,
8795    ) -> Self {
8796        Self {
8797            proc,
8798            selection,
8799            graphql_client,
8800        }
8801    }
8802}
8803impl Expertise {
8804    /// A unique identifier for this Expertise.
8805    pub async fn id(&self) -> Result<Id, DaggerError> {
8806        let query = self.selection.select("id");
8807        query.execute(self.graphql_client.clone()).await
8808    }
8809    /// The agent function's name.
8810    pub async fn name(&self) -> Result<String, DaggerError> {
8811        let query = self.selection.select("name");
8812        query.execute(self.graphql_client.clone()).await
8813    }
8814    /// The agent function's description.
8815    pub async fn description(&self) -> Result<String, DaggerError> {
8816        let query = self.selection.select("description");
8817        query.execute(self.graphql_client.clone()).await
8818    }
8819    /// The agent function's path within its module.
8820    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8821        let query = self.selection.select("path");
8822        query.execute(self.graphql_client.clone()).await
8823    }
8824    /// The module that defines the agent function.
8825    pub fn original_module(&self) -> Module {
8826        let query = self.selection.select("originalModule");
8827        Module {
8828            proc: self.proc.clone(),
8829            selection: query,
8830            graphql_client: self.graphql_client.clone(),
8831        }
8832    }
8833}
8834impl Node for Expertise {
8835    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8836        let query = self.selection.select("id");
8837        let graphql_client = self.graphql_client.clone();
8838        async move { query.execute(graphql_client).await }
8839    }
8840}
8841#[derive(Clone)]
8842pub struct FieldTypeDef {
8843    pub proc: Option<Arc<DaggerSessionProc>>,
8844    pub selection: Selection,
8845    pub graphql_client: DynGraphQLClient,
8846}
8847impl IntoID<Id> for FieldTypeDef {
8848    fn into_id(
8849        self,
8850    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8851        Box::pin(async move { self.id().await })
8852    }
8853}
8854impl Loadable for FieldTypeDef {
8855    fn graphql_type() -> &'static str {
8856        "FieldTypeDef"
8857    }
8858    fn from_query(
8859        proc: Option<Arc<DaggerSessionProc>>,
8860        selection: Selection,
8861        graphql_client: DynGraphQLClient,
8862    ) -> Self {
8863        Self {
8864            proc,
8865            selection,
8866            graphql_client,
8867        }
8868    }
8869}
8870impl FieldTypeDef {
8871    /// A unique identifier for this FieldTypeDef.
8872    pub async fn id(&self) -> Result<Id, DaggerError> {
8873        let query = self.selection.select("id");
8874        query.execute(self.graphql_client.clone()).await
8875    }
8876    /// The type of the field.
8877    pub fn type_def(&self) -> TypeDef {
8878        let query = self.selection.select("typeDef");
8879        TypeDef {
8880            proc: self.proc.clone(),
8881            selection: query,
8882            graphql_client: self.graphql_client.clone(),
8883        }
8884    }
8885    /// The name of the field in lowerCamelCase format.
8886    pub async fn name(&self) -> Result<String, DaggerError> {
8887        let query = self.selection.select("name");
8888        query.execute(self.graphql_client.clone()).await
8889    }
8890    /// A doc string for the field, if any.
8891    pub async fn description(&self) -> Result<String, DaggerError> {
8892        let query = self.selection.select("description");
8893        query.execute(self.graphql_client.clone()).await
8894    }
8895    /// The location of this field declaration.
8896    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8897        let query = self.selection.select("sourceMap");
8898        let query = query.select("id");
8899        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8900        Ok(id.map(|id| SourceMap {
8901            proc: self.proc.clone(),
8902            selection: query
8903                .root()
8904                .select("node")
8905                .arg("id", &id.0)
8906                .inline_fragment("SourceMap"),
8907            graphql_client: self.graphql_client.clone(),
8908        }))
8909    }
8910    /// The reason this enum member is deprecated, if any.
8911    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8912        let query = self.selection.select("deprecated");
8913        query.execute(self.graphql_client.clone()).await
8914    }
8915}
8916impl Node for FieldTypeDef {
8917    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8918        let query = self.selection.select("id");
8919        let graphql_client = self.graphql_client.clone();
8920        async move { query.execute(graphql_client).await }
8921    }
8922}
8923#[derive(Clone)]
8924pub struct File {
8925    pub proc: Option<Arc<DaggerSessionProc>>,
8926    pub selection: Selection,
8927    pub graphql_client: DynGraphQLClient,
8928}
8929#[derive(Builder, Debug, PartialEq)]
8930pub struct FileContentsOpts {
8931    /// Maximum number of lines to read
8932    #[builder(setter(into, strip_option), default)]
8933    pub limit_lines: Option<isize>,
8934    /// Start reading after this line
8935    #[builder(setter(into, strip_option), default)]
8936    pub offset_lines: Option<isize>,
8937}
8938#[derive(Builder, Debug, PartialEq)]
8939pub struct FileDigestOpts {
8940    /// If true, exclude metadata from the digest.
8941    #[builder(setter(into, strip_option), default)]
8942    pub exclude_metadata: Option<bool>,
8943}
8944#[derive(Builder, Debug, PartialEq)]
8945pub struct FileSearchOpts<'a> {
8946    /// Allow the . pattern to match newlines in multiline mode.
8947    #[builder(setter(into, strip_option), default)]
8948    pub dotall: Option<bool>,
8949    /// Only return matching files, not lines and content
8950    #[builder(setter(into, strip_option), default)]
8951    pub files_only: Option<bool>,
8952    #[builder(setter(into, strip_option), default)]
8953    pub globs: Option<Vec<&'a str>>,
8954    /// Enable case-insensitive matching.
8955    #[builder(setter(into, strip_option), default)]
8956    pub insensitive: Option<bool>,
8957    /// Limit the number of results to return
8958    #[builder(setter(into, strip_option), default)]
8959    pub limit: Option<isize>,
8960    /// Interpret the pattern as a literal string instead of a regular expression.
8961    #[builder(setter(into, strip_option), default)]
8962    pub literal: Option<bool>,
8963    /// Enable searching across multiple lines.
8964    #[builder(setter(into, strip_option), default)]
8965    pub multiline: Option<bool>,
8966    #[builder(setter(into, strip_option), default)]
8967    pub paths: Option<Vec<&'a str>>,
8968    /// Skip hidden files (files starting with .).
8969    #[builder(setter(into, strip_option), default)]
8970    pub skip_hidden: Option<bool>,
8971    /// Honor .gitignore, .ignore, and .rgignore files.
8972    #[builder(setter(into, strip_option), default)]
8973    pub skip_ignored: Option<bool>,
8974}
8975#[derive(Builder, Debug, PartialEq)]
8976pub struct FileWithReplacedOpts {
8977    /// Replace all occurrences of the pattern.
8978    #[builder(setter(into, strip_option), default)]
8979    pub all: Option<bool>,
8980    /// Replace the first match starting from the specified line.
8981    #[builder(setter(into, strip_option), default)]
8982    pub first_from: Option<isize>,
8983}
8984#[derive(Builder, Debug, PartialEq)]
8985pub struct FileExportOpts {
8986    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8987    #[builder(setter(into, strip_option), default)]
8988    pub allow_parent_dir_path: Option<bool>,
8989}
8990#[derive(Builder, Debug, PartialEq)]
8991pub struct FileAsEnvFileOpts {
8992    /// Replace "${VAR}" or "$VAR" with the value of other vars
8993    #[builder(setter(into, strip_option), default)]
8994    pub expand: Option<bool>,
8995}
8996impl IntoID<Id> for File {
8997    fn into_id(
8998        self,
8999    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9000        Box::pin(async move { self.id().await })
9001    }
9002}
9003impl Loadable for File {
9004    fn graphql_type() -> &'static str {
9005        "File"
9006    }
9007    fn from_query(
9008        proc: Option<Arc<DaggerSessionProc>>,
9009        selection: Selection,
9010        graphql_client: DynGraphQLClient,
9011    ) -> Self {
9012        Self {
9013            proc,
9014            selection,
9015            graphql_client,
9016        }
9017    }
9018}
9019impl File {
9020    /// A unique identifier for this File.
9021    pub async fn id(&self) -> Result<Id, DaggerError> {
9022        let query = self.selection.select("id");
9023        query.execute(self.graphql_client.clone()).await
9024    }
9025    /// Force evaluation in the engine.
9026    pub async fn sync(&self) -> Result<File, DaggerError> {
9027        let query = self.selection.select("sync");
9028        let id: Id = query.execute(self.graphql_client.clone()).await?;
9029        Ok(File {
9030            proc: self.proc.clone(),
9031            selection: query
9032                .root()
9033                .select("node")
9034                .arg("id", &id.0)
9035                .inline_fragment("File"),
9036            graphql_client: self.graphql_client.clone(),
9037        })
9038    }
9039    /// Retrieves the contents of the file.
9040    ///
9041    /// # Arguments
9042    ///
9043    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9044    pub async fn contents(&self) -> Result<String, DaggerError> {
9045        let query = self.selection.select("contents");
9046        query.execute(self.graphql_client.clone()).await
9047    }
9048    /// Retrieves the contents of the file.
9049    ///
9050    /// # Arguments
9051    ///
9052    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9053    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9054        let mut query = self.selection.select("contents");
9055        if let Some(offset_lines) = opts.offset_lines {
9056            query = query.arg("offsetLines", offset_lines);
9057        }
9058        if let Some(limit_lines) = opts.limit_lines {
9059            query = query.arg("limitLines", limit_lines);
9060        }
9061        query.execute(self.graphql_client.clone()).await
9062    }
9063    /// Retrieves the size of the file, in bytes.
9064    pub async fn size(&self) -> Result<isize, DaggerError> {
9065        let query = self.selection.select("size");
9066        query.execute(self.graphql_client.clone()).await
9067    }
9068    /// Retrieves the name of the file.
9069    pub async fn name(&self) -> Result<String, DaggerError> {
9070        let query = self.selection.select("name");
9071        query.execute(self.graphql_client.clone()).await
9072    }
9073    /// Return file status
9074    pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
9075        let query = self.selection.select("stat");
9076        let query = query.select("id");
9077        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9078        Ok(id.map(|id| Stat {
9079            proc: self.proc.clone(),
9080            selection: query
9081                .root()
9082                .select("node")
9083                .arg("id", &id.0)
9084                .inline_fragment("Stat"),
9085            graphql_client: self.graphql_client.clone(),
9086        }))
9087    }
9088    /// 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.
9089    ///
9090    /// # Arguments
9091    ///
9092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9093    pub async fn digest(&self) -> Result<String, DaggerError> {
9094        let query = self.selection.select("digest");
9095        query.execute(self.graphql_client.clone()).await
9096    }
9097    /// 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.
9098    ///
9099    /// # Arguments
9100    ///
9101    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9102    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9103        let mut query = self.selection.select("digest");
9104        if let Some(exclude_metadata) = opts.exclude_metadata {
9105            query = query.arg("excludeMetadata", exclude_metadata);
9106        }
9107        query.execute(self.graphql_client.clone()).await
9108    }
9109    /// Retrieves this file with its name set to the given name.
9110    ///
9111    /// # Arguments
9112    ///
9113    /// * `name` - Name to set file to.
9114    pub fn with_name(&self, name: impl Into<String>) -> File {
9115        let mut query = self.selection.select("withName");
9116        query = query.arg("name", name.into());
9117        File {
9118            proc: self.proc.clone(),
9119            selection: query,
9120            graphql_client: self.graphql_client.clone(),
9121        }
9122    }
9123    /// Searches for content matching the given regular expression or literal string.
9124    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9125    ///
9126    /// # Arguments
9127    ///
9128    /// * `pattern` - The text to match.
9129    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9130    pub async fn search(
9131        &self,
9132        pattern: impl Into<String>,
9133    ) -> Result<Vec<SearchResult>, DaggerError> {
9134        let mut query = self.selection.select("search");
9135        query = query.arg("pattern", pattern.into());
9136        let query = query.select("id");
9137        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9138        Ok(ids
9139            .into_iter()
9140            .map(|id| SearchResult {
9141                proc: self.proc.clone(),
9142                selection: crate::querybuilder::query()
9143                    .select("node")
9144                    .arg("id", &id.0)
9145                    .inline_fragment("SearchResult"),
9146                graphql_client: self.graphql_client.clone(),
9147            })
9148            .collect())
9149    }
9150    /// Searches for content matching the given regular expression or literal string.
9151    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9152    ///
9153    /// # Arguments
9154    ///
9155    /// * `pattern` - The text to match.
9156    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9157    pub async fn search_opts<'a>(
9158        &self,
9159        pattern: impl Into<String>,
9160        opts: FileSearchOpts<'a>,
9161    ) -> Result<Vec<SearchResult>, DaggerError> {
9162        let mut query = self.selection.select("search");
9163        query = query.arg("pattern", pattern.into());
9164        if let Some(literal) = opts.literal {
9165            query = query.arg("literal", literal);
9166        }
9167        if let Some(multiline) = opts.multiline {
9168            query = query.arg("multiline", multiline);
9169        }
9170        if let Some(dotall) = opts.dotall {
9171            query = query.arg("dotall", dotall);
9172        }
9173        if let Some(insensitive) = opts.insensitive {
9174            query = query.arg("insensitive", insensitive);
9175        }
9176        if let Some(skip_ignored) = opts.skip_ignored {
9177            query = query.arg("skipIgnored", skip_ignored);
9178        }
9179        if let Some(skip_hidden) = opts.skip_hidden {
9180            query = query.arg("skipHidden", skip_hidden);
9181        }
9182        if let Some(files_only) = opts.files_only {
9183            query = query.arg("filesOnly", files_only);
9184        }
9185        if let Some(limit) = opts.limit {
9186            query = query.arg("limit", limit);
9187        }
9188        if let Some(paths) = opts.paths {
9189            query = query.arg("paths", paths);
9190        }
9191        if let Some(globs) = opts.globs {
9192            query = query.arg("globs", globs);
9193        }
9194        let query = query.select("id");
9195        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9196        Ok(ids
9197            .into_iter()
9198            .map(|id| SearchResult {
9199                proc: self.proc.clone(),
9200                selection: crate::querybuilder::query()
9201                    .select("node")
9202                    .arg("id", &id.0)
9203                    .inline_fragment("SearchResult"),
9204                graphql_client: self.graphql_client.clone(),
9205            })
9206            .collect())
9207    }
9208    /// Retrieves the file with content replaced with the given text.
9209    /// If 'all' is true, all occurrences of the pattern will be replaced.
9210    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9211    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9212    /// If there are no matches for the pattern, this will error.
9213    ///
9214    /// # Arguments
9215    ///
9216    /// * `search` - The text to match.
9217    /// * `replacement` - The text to match.
9218    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9219    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9220        let mut query = self.selection.select("withReplaced");
9221        query = query.arg("search", search.into());
9222        query = query.arg("replacement", replacement.into());
9223        File {
9224            proc: self.proc.clone(),
9225            selection: query,
9226            graphql_client: self.graphql_client.clone(),
9227        }
9228    }
9229    /// Retrieves the file with content replaced with the given text.
9230    /// If 'all' is true, all occurrences of the pattern will be replaced.
9231    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9232    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9233    /// If there are no matches for the pattern, this will error.
9234    ///
9235    /// # Arguments
9236    ///
9237    /// * `search` - The text to match.
9238    /// * `replacement` - The text to match.
9239    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9240    pub fn with_replaced_opts(
9241        &self,
9242        search: impl Into<String>,
9243        replacement: impl Into<String>,
9244        opts: FileWithReplacedOpts,
9245    ) -> File {
9246        let mut query = self.selection.select("withReplaced");
9247        query = query.arg("search", search.into());
9248        query = query.arg("replacement", replacement.into());
9249        if let Some(all) = opts.all {
9250            query = query.arg("all", all);
9251        }
9252        if let Some(first_from) = opts.first_from {
9253            query = query.arg("firstFrom", first_from);
9254        }
9255        File {
9256            proc: self.proc.clone(),
9257            selection: query,
9258            graphql_client: self.graphql_client.clone(),
9259        }
9260    }
9261    /// Writes the file to a file path on the host.
9262    ///
9263    /// # Arguments
9264    ///
9265    /// * `path` - Location of the written directory (e.g., "output.txt").
9266    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9267    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9268        let mut query = self.selection.select("export");
9269        query = query.arg("path", path.into());
9270        query.execute(self.graphql_client.clone()).await
9271    }
9272    /// Writes the file to a file path on the host.
9273    ///
9274    /// # Arguments
9275    ///
9276    /// * `path` - Location of the written directory (e.g., "output.txt").
9277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9278    pub async fn export_opts(
9279        &self,
9280        path: impl Into<String>,
9281        opts: FileExportOpts,
9282    ) -> Result<String, DaggerError> {
9283        let mut query = self.selection.select("export");
9284        query = query.arg("path", path.into());
9285        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9286            query = query.arg("allowParentDirPath", allow_parent_dir_path);
9287        }
9288        query.execute(self.graphql_client.clone()).await
9289    }
9290    /// Retrieves this file with its created/modified timestamps set to the given time.
9291    ///
9292    /// # Arguments
9293    ///
9294    /// * `timestamp` - Timestamp to set dir/files in.
9295    ///
9296    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9297    pub fn with_timestamps(&self, timestamp: isize) -> File {
9298        let mut query = self.selection.select("withTimestamps");
9299        query = query.arg("timestamp", timestamp);
9300        File {
9301            proc: self.proc.clone(),
9302            selection: query,
9303            graphql_client: self.graphql_client.clone(),
9304        }
9305    }
9306    /// Change the owner of the file recursively.
9307    ///
9308    /// # Arguments
9309    ///
9310    /// * `owner` - A user:group to set for the file.
9311    ///
9312    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
9313    ///
9314    /// If the group is omitted, it defaults to the same as the user.
9315    pub fn chown(&self, owner: impl Into<String>) -> File {
9316        let mut query = self.selection.select("chown");
9317        query = query.arg("owner", owner.into());
9318        File {
9319            proc: self.proc.clone(),
9320            selection: query,
9321            graphql_client: self.graphql_client.clone(),
9322        }
9323    }
9324    /// Interpret this file as a Git bundle by lazily parsing its header.
9325    pub fn as_git_bundle(&self) -> GitBundle {
9326        let query = self.selection.select("asGitBundle");
9327        GitBundle {
9328            proc: self.proc.clone(),
9329            selection: query,
9330            graphql_client: self.graphql_client.clone(),
9331        }
9332    }
9333    /// Parse the file contents as JSON.
9334    pub fn as_json(&self) -> JsonValue {
9335        let query = self.selection.select("asJSON");
9336        JsonValue {
9337            proc: self.proc.clone(),
9338            selection: query,
9339            graphql_client: self.graphql_client.clone(),
9340        }
9341    }
9342    /// Parse as an env file
9343    ///
9344    /// # Arguments
9345    ///
9346    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9347    pub fn as_env_file(&self) -> EnvFile {
9348        let query = self.selection.select("asEnvFile");
9349        EnvFile {
9350            proc: self.proc.clone(),
9351            selection: query,
9352            graphql_client: self.graphql_client.clone(),
9353        }
9354    }
9355    /// Parse as an env file
9356    ///
9357    /// # Arguments
9358    ///
9359    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9360    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9361        let mut query = self.selection.select("asEnvFile");
9362        if let Some(expand) = opts.expand {
9363            query = query.arg("expand", expand);
9364        }
9365        EnvFile {
9366            proc: self.proc.clone(),
9367            selection: query,
9368            graphql_client: self.graphql_client.clone(),
9369        }
9370    }
9371}
9372impl Exportable for File {
9373    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9374        let query = self.selection.select("id");
9375        let graphql_client = self.graphql_client.clone();
9376        async move { query.execute(graphql_client).await }
9377    }
9378    fn export(
9379        &self,
9380        path: impl Into<String>,
9381    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9382        let mut query = self.selection.select("export");
9383        query = query.arg("path", path.into());
9384        let graphql_client = self.graphql_client.clone();
9385        async move { query.execute(graphql_client).await }
9386    }
9387}
9388impl Node for File {
9389    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9390        let query = self.selection.select("id");
9391        let graphql_client = self.graphql_client.clone();
9392        async move { query.execute(graphql_client).await }
9393    }
9394}
9395impl Syncer for File {
9396    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9397        let query = self.selection.select("id");
9398        let graphql_client = self.graphql_client.clone();
9399        async move { query.execute(graphql_client).await }
9400    }
9401    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
9402        let query = self.selection.select("sync");
9403        let proc = self.proc.clone();
9404        let graphql_client = self.graphql_client.clone();
9405        async move {
9406            let id: Id = query.execute(graphql_client.clone()).await?;
9407            Ok(Self {
9408                proc,
9409                selection: query
9410                    .root()
9411                    .select("node")
9412                    .arg("id", &id.0)
9413                    .inline_fragment("File"),
9414                graphql_client,
9415            })
9416        }
9417    }
9418}
9419#[derive(Clone)]
9420pub struct Function {
9421    pub proc: Option<Arc<DaggerSessionProc>>,
9422    pub selection: Selection,
9423    pub graphql_client: DynGraphQLClient,
9424}
9425#[derive(Builder, Debug, PartialEq)]
9426pub struct FunctionWithDeprecatedOpts<'a> {
9427    /// Reason or migration path describing the deprecation.
9428    #[builder(setter(into, strip_option), default)]
9429    pub reason: Option<&'a str>,
9430}
9431#[derive(Builder, Debug, PartialEq)]
9432pub struct FunctionWithArgOpts<'a> {
9433    #[builder(setter(into, strip_option), default)]
9434    pub default_address: Option<&'a str>,
9435    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9436    #[builder(setter(into, strip_option), default)]
9437    pub default_path: Option<&'a str>,
9438    /// A default value to use for this argument if not explicitly set by the caller, if any
9439    #[builder(setter(into, strip_option), default)]
9440    pub default_value: Option<Json>,
9441    /// If deprecated, the reason or migration path.
9442    #[builder(setter(into, strip_option), default)]
9443    pub deprecated: Option<&'a str>,
9444    /// A doc string for the argument, if any
9445    #[builder(setter(into, strip_option), default)]
9446    pub description: Option<&'a str>,
9447    /// Patterns to ignore when loading the contextual argument value.
9448    #[builder(setter(into, strip_option), default)]
9449    pub ignore: Option<Vec<&'a str>>,
9450    /// The source map for the argument definition.
9451    #[builder(setter(into, strip_option), default)]
9452    pub source_map: Option<Id>,
9453}
9454#[derive(Builder, Debug, PartialEq)]
9455pub struct FunctionWithCachePolicyOpts<'a> {
9456    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9457    #[builder(setter(into, strip_option), default)]
9458    pub time_to_live: Option<&'a str>,
9459}
9460impl IntoID<Id> for Function {
9461    fn into_id(
9462        self,
9463    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9464        Box::pin(async move { self.id().await })
9465    }
9466}
9467impl Loadable for Function {
9468    fn graphql_type() -> &'static str {
9469        "Function"
9470    }
9471    fn from_query(
9472        proc: Option<Arc<DaggerSessionProc>>,
9473        selection: Selection,
9474        graphql_client: DynGraphQLClient,
9475    ) -> Self {
9476        Self {
9477            proc,
9478            selection,
9479            graphql_client,
9480        }
9481    }
9482}
9483impl Function {
9484    /// A unique identifier for this Function.
9485    pub async fn id(&self) -> Result<Id, DaggerError> {
9486        let query = self.selection.select("id");
9487        query.execute(self.graphql_client.clone()).await
9488    }
9489    /// Returns the function with the given doc string.
9490    ///
9491    /// # Arguments
9492    ///
9493    /// * `description` - The doc string to set.
9494    pub fn with_description(&self, description: impl Into<String>) -> Function {
9495        let mut query = self.selection.select("withDescription");
9496        query = query.arg("description", description.into());
9497        Function {
9498            proc: self.proc.clone(),
9499            selection: query,
9500            graphql_client: self.graphql_client.clone(),
9501        }
9502    }
9503    /// Returns the function with the provided deprecation reason.
9504    ///
9505    /// # Arguments
9506    ///
9507    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9508    pub fn with_deprecated(&self) -> Function {
9509        let query = self.selection.select("withDeprecated");
9510        Function {
9511            proc: self.proc.clone(),
9512            selection: query,
9513            graphql_client: self.graphql_client.clone(),
9514        }
9515    }
9516    /// Returns the function with the provided deprecation reason.
9517    ///
9518    /// # Arguments
9519    ///
9520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9521    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9522        let mut query = self.selection.select("withDeprecated");
9523        if let Some(reason) = opts.reason {
9524            query = query.arg("reason", reason);
9525        }
9526        Function {
9527            proc: self.proc.clone(),
9528            selection: query,
9529            graphql_client: self.graphql_client.clone(),
9530        }
9531    }
9532    /// Returns the function with a flag indicating it's a check.
9533    pub fn with_check(&self) -> Function {
9534        let query = self.selection.select("withCheck");
9535        Function {
9536            proc: self.proc.clone(),
9537            selection: query,
9538            graphql_client: self.graphql_client.clone(),
9539        }
9540    }
9541    /// Returns the function with a flag indicating it's a generator.
9542    pub fn with_generator(&self) -> Function {
9543        let query = self.selection.select("withGenerator");
9544        Function {
9545            proc: self.proc.clone(),
9546            selection: query,
9547            graphql_client: self.graphql_client.clone(),
9548        }
9549    }
9550    /// Returns the function with a flag indicating it returns a service for dagger up.
9551    pub fn with_up(&self) -> Function {
9552        let query = self.selection.select("withUp");
9553        Function {
9554            proc: self.proc.clone(),
9555            selection: query,
9556            graphql_client: self.graphql_client.clone(),
9557        }
9558    }
9559    /// Returns the function with a flag indicating it is a source of expertise.
9560    pub fn with_agent(&self) -> Function {
9561        let query = self.selection.select("withAgent");
9562        Function {
9563            proc: self.proc.clone(),
9564            selection: query,
9565            graphql_client: self.graphql_client.clone(),
9566        }
9567    }
9568    /// Returns the function with the given source map.
9569    ///
9570    /// # Arguments
9571    ///
9572    /// * `source_map` - The source map for the function definition.
9573    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9574        let mut query = self.selection.select("withSourceMap");
9575        query = query.arg_lazy(
9576            "sourceMap",
9577            Box::new(move || {
9578                let source_map = source_map.clone();
9579                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9580            }),
9581        );
9582        Function {
9583            proc: self.proc.clone(),
9584            selection: query,
9585            graphql_client: self.graphql_client.clone(),
9586        }
9587    }
9588    /// Returns the function with the provided argument
9589    ///
9590    /// # Arguments
9591    ///
9592    /// * `name` - The name of the argument
9593    /// * `type_def` - The type of the argument
9594    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9595    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9596        let mut query = self.selection.select("withArg");
9597        query = query.arg("name", name.into());
9598        query = query.arg_lazy(
9599            "typeDef",
9600            Box::new(move || {
9601                let type_def = type_def.clone();
9602                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9603            }),
9604        );
9605        Function {
9606            proc: self.proc.clone(),
9607            selection: query,
9608            graphql_client: self.graphql_client.clone(),
9609        }
9610    }
9611    /// Returns the function with the provided argument
9612    ///
9613    /// # Arguments
9614    ///
9615    /// * `name` - The name of the argument
9616    /// * `type_def` - The type of the argument
9617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9618    pub fn with_arg_opts<'a>(
9619        &self,
9620        name: impl Into<String>,
9621        type_def: impl IntoID<Id>,
9622        opts: FunctionWithArgOpts<'a>,
9623    ) -> Function {
9624        let mut query = self.selection.select("withArg");
9625        query = query.arg("name", name.into());
9626        query = query.arg_lazy(
9627            "typeDef",
9628            Box::new(move || {
9629                let type_def = type_def.clone();
9630                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9631            }),
9632        );
9633        if let Some(description) = opts.description {
9634            query = query.arg("description", description);
9635        }
9636        if let Some(default_value) = opts.default_value {
9637            query = query.arg("defaultValue", default_value);
9638        }
9639        if let Some(default_path) = opts.default_path {
9640            query = query.arg("defaultPath", default_path);
9641        }
9642        if let Some(ignore) = opts.ignore {
9643            query = query.arg("ignore", ignore);
9644        }
9645        if let Some(source_map) = opts.source_map {
9646            query = query.arg("sourceMap", source_map);
9647        }
9648        if let Some(deprecated) = opts.deprecated {
9649            query = query.arg("deprecated", deprecated);
9650        }
9651        if let Some(default_address) = opts.default_address {
9652            query = query.arg("defaultAddress", default_address);
9653        }
9654        Function {
9655            proc: self.proc.clone(),
9656            selection: query,
9657            graphql_client: self.graphql_client.clone(),
9658        }
9659    }
9660    /// Returns the function updated to use the provided cache policy.
9661    ///
9662    /// # Arguments
9663    ///
9664    /// * `policy` - The cache policy to use.
9665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9666    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9667        let mut query = self.selection.select("withCachePolicy");
9668        query = query.arg("policy", policy);
9669        Function {
9670            proc: self.proc.clone(),
9671            selection: query,
9672            graphql_client: self.graphql_client.clone(),
9673        }
9674    }
9675    /// Returns the function updated to use the provided cache policy.
9676    ///
9677    /// # Arguments
9678    ///
9679    /// * `policy` - The cache policy to use.
9680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9681    pub fn with_cache_policy_opts<'a>(
9682        &self,
9683        policy: FunctionCachePolicy,
9684        opts: FunctionWithCachePolicyOpts<'a>,
9685    ) -> Function {
9686        let mut query = self.selection.select("withCachePolicy");
9687        query = query.arg("policy", policy);
9688        if let Some(time_to_live) = opts.time_to_live {
9689            query = query.arg("timeToLive", time_to_live);
9690        }
9691        Function {
9692            proc: self.proc.clone(),
9693            selection: query,
9694            graphql_client: self.graphql_client.clone(),
9695        }
9696    }
9697    /// The name of the function.
9698    pub async fn name(&self) -> Result<String, DaggerError> {
9699        let query = self.selection.select("name");
9700        query.execute(self.graphql_client.clone()).await
9701    }
9702    /// A doc string for the function, if any.
9703    pub async fn description(&self) -> Result<String, DaggerError> {
9704        let query = self.selection.select("description");
9705        query.execute(self.graphql_client.clone()).await
9706    }
9707    /// The reason this function is deprecated, if any.
9708    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9709        let query = self.selection.select("deprecated");
9710        query.execute(self.graphql_client.clone()).await
9711    }
9712    /// The location of this function declaration.
9713    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9714        let query = self.selection.select("sourceMap");
9715        let query = query.select("id");
9716        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9717        Ok(id.map(|id| SourceMap {
9718            proc: self.proc.clone(),
9719            selection: query
9720                .root()
9721                .select("node")
9722                .arg("id", &id.0)
9723                .inline_fragment("SourceMap"),
9724            graphql_client: self.graphql_client.clone(),
9725        }))
9726    }
9727    /// If this function is provided by a module, the name of the module. Unset otherwise.
9728    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9729        let query = self.selection.select("sourceModuleName");
9730        query.execute(self.graphql_client.clone()).await
9731    }
9732    /// Arguments accepted by the function, if any.
9733    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9734        let query = self.selection.select("args");
9735        let query = query.select("id");
9736        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9737        Ok(ids
9738            .into_iter()
9739            .map(|id| FunctionArg {
9740                proc: self.proc.clone(),
9741                selection: crate::querybuilder::query()
9742                    .select("node")
9743                    .arg("id", &id.0)
9744                    .inline_fragment("FunctionArg"),
9745                graphql_client: self.graphql_client.clone(),
9746            })
9747            .collect())
9748    }
9749    /// The type returned by the function.
9750    pub fn return_type(&self) -> TypeDef {
9751        let query = self.selection.select("returnType");
9752        TypeDef {
9753            proc: self.proc.clone(),
9754            selection: query,
9755            graphql_client: self.graphql_client.clone(),
9756        }
9757    }
9758}
9759impl Node for Function {
9760    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9761        let query = self.selection.select("id");
9762        let graphql_client = self.graphql_client.clone();
9763        async move { query.execute(graphql_client).await }
9764    }
9765}
9766#[derive(Clone)]
9767pub struct FunctionArg {
9768    pub proc: Option<Arc<DaggerSessionProc>>,
9769    pub selection: Selection,
9770    pub graphql_client: DynGraphQLClient,
9771}
9772impl IntoID<Id> for FunctionArg {
9773    fn into_id(
9774        self,
9775    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9776        Box::pin(async move { self.id().await })
9777    }
9778}
9779impl Loadable for FunctionArg {
9780    fn graphql_type() -> &'static str {
9781        "FunctionArg"
9782    }
9783    fn from_query(
9784        proc: Option<Arc<DaggerSessionProc>>,
9785        selection: Selection,
9786        graphql_client: DynGraphQLClient,
9787    ) -> Self {
9788        Self {
9789            proc,
9790            selection,
9791            graphql_client,
9792        }
9793    }
9794}
9795impl FunctionArg {
9796    /// A unique identifier for this FunctionArg.
9797    pub async fn id(&self) -> Result<Id, DaggerError> {
9798        let query = self.selection.select("id");
9799        query.execute(self.graphql_client.clone()).await
9800    }
9801    /// The name of the argument in lowerCamelCase format.
9802    pub async fn name(&self) -> Result<String, DaggerError> {
9803        let query = self.selection.select("name");
9804        query.execute(self.graphql_client.clone()).await
9805    }
9806    /// A doc string for the argument, if any.
9807    pub async fn description(&self) -> Result<String, DaggerError> {
9808        let query = self.selection.select("description");
9809        query.execute(self.graphql_client.clone()).await
9810    }
9811    /// The location of this arg declaration.
9812    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9813        let query = self.selection.select("sourceMap");
9814        let query = query.select("id");
9815        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9816        Ok(id.map(|id| SourceMap {
9817            proc: self.proc.clone(),
9818            selection: query
9819                .root()
9820                .select("node")
9821                .arg("id", &id.0)
9822                .inline_fragment("SourceMap"),
9823            graphql_client: self.graphql_client.clone(),
9824        }))
9825    }
9826    /// A default value to use for this argument when not explicitly set by the caller, if any.
9827    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9828        let query = self.selection.select("defaultValue");
9829        query.execute(self.graphql_client.clone()).await
9830    }
9831    /// 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
9832    pub async fn default_path(&self) -> Result<String, DaggerError> {
9833        let query = self.selection.select("defaultPath");
9834        query.execute(self.graphql_client.clone()).await
9835    }
9836    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9837    pub async fn default_address(&self) -> Result<String, DaggerError> {
9838        let query = self.selection.select("defaultAddress");
9839        query.execute(self.graphql_client.clone()).await
9840    }
9841    /// 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.
9842    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9843        let query = self.selection.select("ignore");
9844        query.execute(self.graphql_client.clone()).await
9845    }
9846    /// The reason this function is deprecated, if any.
9847    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9848        let query = self.selection.select("deprecated");
9849        query.execute(self.graphql_client.clone()).await
9850    }
9851    /// The type of the argument.
9852    pub fn type_def(&self) -> TypeDef {
9853        let query = self.selection.select("typeDef");
9854        TypeDef {
9855            proc: self.proc.clone(),
9856            selection: query,
9857            graphql_client: self.graphql_client.clone(),
9858        }
9859    }
9860}
9861impl Node for FunctionArg {
9862    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9863        let query = self.selection.select("id");
9864        let graphql_client = self.graphql_client.clone();
9865        async move { query.execute(graphql_client).await }
9866    }
9867}
9868#[derive(Clone)]
9869pub struct FunctionCall {
9870    pub proc: Option<Arc<DaggerSessionProc>>,
9871    pub selection: Selection,
9872    pub graphql_client: DynGraphQLClient,
9873}
9874impl IntoID<Id> for FunctionCall {
9875    fn into_id(
9876        self,
9877    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9878        Box::pin(async move { self.id().await })
9879    }
9880}
9881impl Loadable for FunctionCall {
9882    fn graphql_type() -> &'static str {
9883        "FunctionCall"
9884    }
9885    fn from_query(
9886        proc: Option<Arc<DaggerSessionProc>>,
9887        selection: Selection,
9888        graphql_client: DynGraphQLClient,
9889    ) -> Self {
9890        Self {
9891            proc,
9892            selection,
9893            graphql_client,
9894        }
9895    }
9896}
9897impl FunctionCall {
9898    /// A unique identifier for this FunctionCall.
9899    pub async fn id(&self) -> Result<Id, DaggerError> {
9900        let query = self.selection.select("id");
9901        query.execute(self.graphql_client.clone()).await
9902    }
9903    /// Set the return value of the function call to the provided value.
9904    ///
9905    /// # Arguments
9906    ///
9907    /// * `value` - JSON serialization of the return value.
9908    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9909        let mut query = self.selection.select("returnValue");
9910        query = query.arg("value", value);
9911        query.execute(self.graphql_client.clone()).await
9912    }
9913    /// Return an error from the function.
9914    ///
9915    /// # Arguments
9916    ///
9917    /// * `error` - The error to return.
9918    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9919        let mut query = self.selection.select("returnError");
9920        query = query.arg_lazy(
9921            "error",
9922            Box::new(move || {
9923                let error = error.clone();
9924                Box::pin(async move { error.into_id().await.unwrap().quote() })
9925            }),
9926        );
9927        query.execute(self.graphql_client.clone()).await
9928    }
9929    /// The name of the function being called.
9930    pub async fn name(&self) -> Result<String, DaggerError> {
9931        let query = self.selection.select("name");
9932        query.execute(self.graphql_client.clone()).await
9933    }
9934    /// 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.
9935    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9936        let query = self.selection.select("parentName");
9937        query.execute(self.graphql_client.clone()).await
9938    }
9939    /// 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.
9940    pub async fn parent(&self) -> Result<Json, DaggerError> {
9941        let query = self.selection.select("parent");
9942        query.execute(self.graphql_client.clone()).await
9943    }
9944    /// The argument values the function is being invoked with.
9945    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9946        let query = self.selection.select("inputArgs");
9947        let query = query.select("id");
9948        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9949        Ok(ids
9950            .into_iter()
9951            .map(|id| FunctionCallArgValue {
9952                proc: self.proc.clone(),
9953                selection: crate::querybuilder::query()
9954                    .select("node")
9955                    .arg("id", &id.0)
9956                    .inline_fragment("FunctionCallArgValue"),
9957                graphql_client: self.graphql_client.clone(),
9958            })
9959            .collect())
9960    }
9961}
9962impl Node for FunctionCall {
9963    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9964        let query = self.selection.select("id");
9965        let graphql_client = self.graphql_client.clone();
9966        async move { query.execute(graphql_client).await }
9967    }
9968}
9969#[derive(Clone)]
9970pub struct FunctionCallArgValue {
9971    pub proc: Option<Arc<DaggerSessionProc>>,
9972    pub selection: Selection,
9973    pub graphql_client: DynGraphQLClient,
9974}
9975impl IntoID<Id> for FunctionCallArgValue {
9976    fn into_id(
9977        self,
9978    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9979        Box::pin(async move { self.id().await })
9980    }
9981}
9982impl Loadable for FunctionCallArgValue {
9983    fn graphql_type() -> &'static str {
9984        "FunctionCallArgValue"
9985    }
9986    fn from_query(
9987        proc: Option<Arc<DaggerSessionProc>>,
9988        selection: Selection,
9989        graphql_client: DynGraphQLClient,
9990    ) -> Self {
9991        Self {
9992            proc,
9993            selection,
9994            graphql_client,
9995        }
9996    }
9997}
9998impl FunctionCallArgValue {
9999    /// A unique identifier for this FunctionCallArgValue.
10000    pub async fn id(&self) -> Result<Id, DaggerError> {
10001        let query = self.selection.select("id");
10002        query.execute(self.graphql_client.clone()).await
10003    }
10004    /// The name of the argument.
10005    pub async fn name(&self) -> Result<String, DaggerError> {
10006        let query = self.selection.select("name");
10007        query.execute(self.graphql_client.clone()).await
10008    }
10009    /// The value of the argument represented as a JSON serialized string.
10010    pub async fn value(&self) -> Result<Json, DaggerError> {
10011        let query = self.selection.select("value");
10012        query.execute(self.graphql_client.clone()).await
10013    }
10014}
10015impl Node for FunctionCallArgValue {
10016    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10017        let query = self.selection.select("id");
10018        let graphql_client = self.graphql_client.clone();
10019        async move { query.execute(graphql_client).await }
10020    }
10021}
10022#[derive(Clone)]
10023pub struct GeneratedCode {
10024    pub proc: Option<Arc<DaggerSessionProc>>,
10025    pub selection: Selection,
10026    pub graphql_client: DynGraphQLClient,
10027}
10028impl IntoID<Id> for GeneratedCode {
10029    fn into_id(
10030        self,
10031    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10032        Box::pin(async move { self.id().await })
10033    }
10034}
10035impl Loadable for GeneratedCode {
10036    fn graphql_type() -> &'static str {
10037        "GeneratedCode"
10038    }
10039    fn from_query(
10040        proc: Option<Arc<DaggerSessionProc>>,
10041        selection: Selection,
10042        graphql_client: DynGraphQLClient,
10043    ) -> Self {
10044        Self {
10045            proc,
10046            selection,
10047            graphql_client,
10048        }
10049    }
10050}
10051impl GeneratedCode {
10052    /// A unique identifier for this GeneratedCode.
10053    pub async fn id(&self) -> Result<Id, DaggerError> {
10054        let query = self.selection.select("id");
10055        query.execute(self.graphql_client.clone()).await
10056    }
10057    /// Set the list of paths to mark generated in version control.
10058    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10059        let mut query = self.selection.select("withVCSGeneratedPaths");
10060        query = query.arg(
10061            "paths",
10062            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10063        );
10064        GeneratedCode {
10065            proc: self.proc.clone(),
10066            selection: query,
10067            graphql_client: self.graphql_client.clone(),
10068        }
10069    }
10070    /// Set the list of paths to ignore in version control.
10071    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10072        let mut query = self.selection.select("withVCSIgnoredPaths");
10073        query = query.arg(
10074            "paths",
10075            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10076        );
10077        GeneratedCode {
10078            proc: self.proc.clone(),
10079            selection: query,
10080            graphql_client: self.graphql_client.clone(),
10081        }
10082    }
10083    /// The directory containing the generated code.
10084    pub fn code(&self) -> Directory {
10085        let query = self.selection.select("code");
10086        Directory {
10087            proc: self.proc.clone(),
10088            selection: query,
10089            graphql_client: self.graphql_client.clone(),
10090        }
10091    }
10092    /// List of paths to mark generated in version control (i.e. .gitattributes).
10093    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10094        let query = self.selection.select("vcsGeneratedPaths");
10095        query.execute(self.graphql_client.clone()).await
10096    }
10097    /// List of paths to ignore in version control (i.e. .gitignore).
10098    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10099        let query = self.selection.select("vcsIgnoredPaths");
10100        query.execute(self.graphql_client.clone()).await
10101    }
10102}
10103impl Node for GeneratedCode {
10104    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10105        let query = self.selection.select("id");
10106        let graphql_client = self.graphql_client.clone();
10107        async move { query.execute(graphql_client).await }
10108    }
10109}
10110#[derive(Clone)]
10111pub struct Generator {
10112    pub proc: Option<Arc<DaggerSessionProc>>,
10113    pub selection: Selection,
10114    pub graphql_client: DynGraphQLClient,
10115}
10116impl IntoID<Id> for Generator {
10117    fn into_id(
10118        self,
10119    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10120        Box::pin(async move { self.id().await })
10121    }
10122}
10123impl Loadable for Generator {
10124    fn graphql_type() -> &'static str {
10125        "Generator"
10126    }
10127    fn from_query(
10128        proc: Option<Arc<DaggerSessionProc>>,
10129        selection: Selection,
10130        graphql_client: DynGraphQLClient,
10131    ) -> Self {
10132        Self {
10133            proc,
10134            selection,
10135            graphql_client,
10136        }
10137    }
10138}
10139impl Generator {
10140    /// A unique identifier for this Generator.
10141    pub async fn id(&self) -> Result<Id, DaggerError> {
10142        let query = self.selection.select("id");
10143        query.execute(self.graphql_client.clone()).await
10144    }
10145    /// Run the generator and return its changes.
10146    pub fn changeset(&self) -> Changeset {
10147        let query = self.selection.select("changeset");
10148        Changeset {
10149            proc: self.proc.clone(),
10150            selection: query,
10151            graphql_client: self.graphql_client.clone(),
10152        }
10153    }
10154    /// Run the generator and retain its result.
10155    pub fn sync(&self) -> Generator {
10156        let query = self.selection.select("sync");
10157        Generator {
10158            proc: self.proc.clone(),
10159            selection: query,
10160            graphql_client: self.graphql_client.clone(),
10161        }
10162    }
10163    /// A check that passes when this generator would produce no changes.
10164    pub fn stale(&self) -> Check {
10165        let query = self.selection.select("stale");
10166        Check {
10167            proc: self.proc.clone(),
10168            selection: query,
10169            graphql_client: self.graphql_client.clone(),
10170        }
10171    }
10172}
10173impl Node for Generator {
10174    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10175        let query = self.selection.select("id");
10176        let graphql_client = self.graphql_client.clone();
10177        async move { query.execute(graphql_client).await }
10178    }
10179}
10180#[derive(Clone)]
10181pub struct GitBundle {
10182    pub proc: Option<Arc<DaggerSessionProc>>,
10183    pub selection: Selection,
10184    pub graphql_client: DynGraphQLClient,
10185}
10186impl IntoID<Id> for GitBundle {
10187    fn into_id(
10188        self,
10189    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10190        Box::pin(async move { self.id().await })
10191    }
10192}
10193impl Loadable for GitBundle {
10194    fn graphql_type() -> &'static str {
10195        "GitBundle"
10196    }
10197    fn from_query(
10198        proc: Option<Arc<DaggerSessionProc>>,
10199        selection: Selection,
10200        graphql_client: DynGraphQLClient,
10201    ) -> Self {
10202        Self {
10203            proc,
10204            selection,
10205            graphql_client,
10206        }
10207    }
10208}
10209impl GitBundle {
10210    /// A unique identifier for this GitBundle.
10211    pub async fn id(&self) -> Result<Id, DaggerError> {
10212        let query = self.selection.select("id");
10213        query.execute(self.graphql_client.clone()).await
10214    }
10215    /// Perform full structural verification of the bundle and error if it is malformed.
10216    pub fn validate(&self) -> GitBundle {
10217        let query = self.selection.select("validate");
10218        GitBundle {
10219            proc: self.proc.clone(),
10220            selection: query,
10221            graphql_client: self.graphql_client.clone(),
10222        }
10223    }
10224    /// Return the bundle bytes as a File.
10225    pub fn as_file(&self) -> File {
10226        let query = self.selection.select("asFile");
10227        File {
10228            proc: self.proc.clone(),
10229            selection: query,
10230            graphql_client: self.graphql_client.clone(),
10231        }
10232    }
10233    /// Bundle format version (2 or 3).
10234    pub async fn version(&self) -> Result<isize, DaggerError> {
10235        let query = self.selection.select("version");
10236        query.execute(self.graphql_client.clone()).await
10237    }
10238    /// Object format capability: sha1 or sha256.
10239    pub async fn object_format(&self) -> Result<String, DaggerError> {
10240        let query = self.selection.select("objectFormat");
10241        query.execute(self.graphql_client.clone()).await
10242    }
10243    /// Refs advertised by the bundle and the object IDs they resolve to.
10244    pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
10245        let query = self.selection.select("refs");
10246        let query = query.select("id");
10247        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10248        Ok(ids
10249            .into_iter()
10250            .map(|id| GitBundleRef {
10251                proc: self.proc.clone(),
10252                selection: crate::querybuilder::query()
10253                    .select("node")
10254                    .arg("id", &id.0)
10255                    .inline_fragment("GitBundleRef"),
10256                graphql_client: self.graphql_client.clone(),
10257            })
10258            .collect())
10259    }
10260    /// Commits that must already exist wherever this bundle is applied.
10261    pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
10262        let query = self.selection.select("prerequisiteSHAs");
10263        query.execute(self.graphql_client.clone()).await
10264    }
10265}
10266impl Node for GitBundle {
10267    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10268        let query = self.selection.select("id");
10269        let graphql_client = self.graphql_client.clone();
10270        async move { query.execute(graphql_client).await }
10271    }
10272}
10273#[derive(Clone)]
10274pub struct GitBundleRef {
10275    pub proc: Option<Arc<DaggerSessionProc>>,
10276    pub selection: Selection,
10277    pub graphql_client: DynGraphQLClient,
10278}
10279impl IntoID<Id> for GitBundleRef {
10280    fn into_id(
10281        self,
10282    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10283        Box::pin(async move { self.id().await })
10284    }
10285}
10286impl Loadable for GitBundleRef {
10287    fn graphql_type() -> &'static str {
10288        "GitBundleRef"
10289    }
10290    fn from_query(
10291        proc: Option<Arc<DaggerSessionProc>>,
10292        selection: Selection,
10293        graphql_client: DynGraphQLClient,
10294    ) -> Self {
10295        Self {
10296            proc,
10297            selection,
10298            graphql_client,
10299        }
10300    }
10301}
10302impl GitBundleRef {
10303    /// A unique identifier for this GitBundleRef.
10304    pub async fn id(&self) -> Result<Id, DaggerError> {
10305        let query = self.selection.select("id");
10306        query.execute(self.graphql_client.clone()).await
10307    }
10308    /// The advertised ref name.
10309    pub async fn name(&self) -> Result<String, DaggerError> {
10310        let query = self.selection.select("name");
10311        query.execute(self.graphql_client.clone()).await
10312    }
10313    /// The object ID the advertised ref resolves to.
10314    pub async fn sha(&self) -> Result<String, DaggerError> {
10315        let query = self.selection.select("sha");
10316        query.execute(self.graphql_client.clone()).await
10317    }
10318}
10319impl Node for GitBundleRef {
10320    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10321        let query = self.selection.select("id");
10322        let graphql_client = self.graphql_client.clone();
10323        async move { query.execute(graphql_client).await }
10324    }
10325}
10326#[derive(Clone)]
10327pub struct GitCommit {
10328    pub proc: Option<Arc<DaggerSessionProc>>,
10329    pub selection: Selection,
10330    pub graphql_client: DynGraphQLClient,
10331}
10332#[derive(Builder, Debug, PartialEq)]
10333pub struct GitCommitReleaseTagOpts {
10334    /// Include pre-release tags when choosing the latest tag.
10335    #[builder(setter(into, strip_option), default)]
10336    pub include_pre_release: Option<bool>,
10337}
10338#[derive(Builder, Debug, PartialEq)]
10339pub struct GitCommitAncestorReleaseTagOpts {
10340    /// Include pre-release tags when choosing the latest tag.
10341    #[builder(setter(into, strip_option), default)]
10342    pub include_pre_release: Option<bool>,
10343}
10344#[derive(Builder, Debug, PartialEq)]
10345pub struct GitCommitTreeOpts {
10346    /// The depth of the tree to fetch.
10347    #[builder(setter(into, strip_option), default)]
10348    pub depth: Option<isize>,
10349    /// Set to true to discard .git directory.
10350    #[builder(setter(into, strip_option), default)]
10351    pub discard_git_dir: Option<bool>,
10352    /// Set to true to populate tag refs in the local checkout .git.
10353    #[builder(setter(into, strip_option), default)]
10354    pub include_tags: Option<bool>,
10355}
10356#[derive(Builder, Debug, PartialEq)]
10357pub struct GitCommitChangesOpts {
10358    /// Use this commit as the comparison base instead of the first parent. The comparison commit may belong to an unrelated history or repository.
10359    #[builder(setter(into, strip_option), default)]
10360    pub against: Option<Id>,
10361}
10362impl IntoID<Id> for GitCommit {
10363    fn into_id(
10364        self,
10365    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10366        Box::pin(async move { self.id().await })
10367    }
10368}
10369impl Loadable for GitCommit {
10370    fn graphql_type() -> &'static str {
10371        "GitCommit"
10372    }
10373    fn from_query(
10374        proc: Option<Arc<DaggerSessionProc>>,
10375        selection: Selection,
10376        graphql_client: DynGraphQLClient,
10377    ) -> Self {
10378        Self {
10379            proc,
10380            selection,
10381            graphql_client,
10382        }
10383    }
10384}
10385impl GitCommit {
10386    /// A unique identifier for this GitCommit.
10387    pub async fn id(&self) -> Result<Id, DaggerError> {
10388        let query = self.selection.select("id");
10389        query.execute(self.graphql_client.clone()).await
10390    }
10391    /// The latest semver release tag that points directly at this commit.
10392    ///
10393    /// # Arguments
10394    ///
10395    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10396    pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10397        let query = self.selection.select("releaseTag");
10398        let query = query.select("id");
10399        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10400        Ok(id.map(|id| GitRef {
10401            proc: self.proc.clone(),
10402            selection: query
10403                .root()
10404                .select("node")
10405                .arg("id", &id.0)
10406                .inline_fragment("GitRef"),
10407            graphql_client: self.graphql_client.clone(),
10408        }))
10409    }
10410    /// The latest semver release tag that points directly at this commit.
10411    ///
10412    /// # Arguments
10413    ///
10414    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10415    pub async fn release_tag_opts(
10416        &self,
10417        opts: GitCommitReleaseTagOpts,
10418    ) -> Result<Option<GitRef>, DaggerError> {
10419        let mut query = self.selection.select("releaseTag");
10420        if let Some(include_pre_release) = opts.include_pre_release {
10421            query = query.arg("includePreRelease", include_pre_release);
10422        }
10423        let query = query.select("id");
10424        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10425        Ok(id.map(|id| GitRef {
10426            proc: self.proc.clone(),
10427            selection: query
10428                .root()
10429                .select("node")
10430                .arg("id", &id.0)
10431                .inline_fragment("GitRef"),
10432            graphql_client: self.graphql_client.clone(),
10433        }))
10434    }
10435    /// The latest semver release tag reachable from this commit.
10436    ///
10437    /// # Arguments
10438    ///
10439    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10440    pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10441        let query = self.selection.select("ancestorReleaseTag");
10442        let query = query.select("id");
10443        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10444        Ok(id.map(|id| GitRef {
10445            proc: self.proc.clone(),
10446            selection: query
10447                .root()
10448                .select("node")
10449                .arg("id", &id.0)
10450                .inline_fragment("GitRef"),
10451            graphql_client: self.graphql_client.clone(),
10452        }))
10453    }
10454    /// The latest semver release tag reachable from this commit.
10455    ///
10456    /// # Arguments
10457    ///
10458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10459    pub async fn ancestor_release_tag_opts(
10460        &self,
10461        opts: GitCommitAncestorReleaseTagOpts,
10462    ) -> Result<Option<GitRef>, DaggerError> {
10463        let mut query = self.selection.select("ancestorReleaseTag");
10464        if let Some(include_pre_release) = opts.include_pre_release {
10465            query = query.arg("includePreRelease", include_pre_release);
10466        }
10467        let query = query.select("id");
10468        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10469        Ok(id.map(|id| GitRef {
10470            proc: self.proc.clone(),
10471            selection: query
10472                .root()
10473                .select("node")
10474                .arg("id", &id.0)
10475                .inline_fragment("GitRef"),
10476            graphql_client: self.graphql_client.clone(),
10477        }))
10478    }
10479    /// The filesystem tree at this commit.
10480    ///
10481    /// # Arguments
10482    ///
10483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10484    pub fn tree(&self) -> Directory {
10485        let query = self.selection.select("tree");
10486        Directory {
10487            proc: self.proc.clone(),
10488            selection: query,
10489            graphql_client: self.graphql_client.clone(),
10490        }
10491    }
10492    /// The filesystem tree at this commit.
10493    ///
10494    /// # Arguments
10495    ///
10496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10497    pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
10498        let mut query = self.selection.select("tree");
10499        if let Some(discard_git_dir) = opts.discard_git_dir {
10500            query = query.arg("discardGitDir", discard_git_dir);
10501        }
10502        if let Some(depth) = opts.depth {
10503            query = query.arg("depth", depth);
10504        }
10505        if let Some(include_tags) = opts.include_tags {
10506            query = query.arg("includeTags", include_tags);
10507        }
10508        Directory {
10509            proc: self.proc.clone(),
10510            selection: query,
10511            graphql_client: self.graphql_client.clone(),
10512        }
10513    }
10514    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10515    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10516    ///
10517    /// # Arguments
10518    ///
10519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10520    pub fn changes(&self) -> Changeset {
10521        let query = self.selection.select("changes");
10522        Changeset {
10523            proc: self.proc.clone(),
10524            selection: query,
10525            graphql_client: self.graphql_client.clone(),
10526        }
10527    }
10528    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10529    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10530    ///
10531    /// # Arguments
10532    ///
10533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10534    pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
10535        let mut query = self.selection.select("changes");
10536        if let Some(against) = opts.against {
10537            query = query.arg("against", against);
10538        }
10539        Changeset {
10540            proc: self.proc.clone(),
10541            selection: query,
10542            graphql_client: self.graphql_client.clone(),
10543        }
10544    }
10545    /// The full commit SHA.
10546    pub async fn sha(&self) -> Result<String, DaggerError> {
10547        let query = self.selection.select("sha");
10548        query.execute(self.graphql_client.clone()).await
10549    }
10550    /// The abbreviated commit SHA.
10551    pub async fn short_sha(&self) -> Result<String, DaggerError> {
10552        let query = self.selection.select("shortSha");
10553        query.execute(self.graphql_client.clone()).await
10554    }
10555    /// Git author date, in RFC3339 format.
10556    pub async fn authored_date(&self) -> Result<String, DaggerError> {
10557        let query = self.selection.select("authoredDate");
10558        query.execute(self.graphql_client.clone()).await
10559    }
10560    /// Git committer date, in RFC3339 format.
10561    pub async fn committed_date(&self) -> Result<String, DaggerError> {
10562        let query = self.selection.select("committedDate");
10563        query.execute(self.graphql_client.clone()).await
10564    }
10565    /// Git author name.
10566    pub async fn author_name(&self) -> Result<String, DaggerError> {
10567        let query = self.selection.select("authorName");
10568        query.execute(self.graphql_client.clone()).await
10569    }
10570    /// Git author email.
10571    pub async fn author_email(&self) -> Result<String, DaggerError> {
10572        let query = self.selection.select("authorEmail");
10573        query.execute(self.graphql_client.clone()).await
10574    }
10575    /// Git committer name.
10576    pub async fn committer_name(&self) -> Result<String, DaggerError> {
10577        let query = self.selection.select("committerName");
10578        query.execute(self.graphql_client.clone()).await
10579    }
10580    /// Git committer email.
10581    pub async fn committer_email(&self) -> Result<String, DaggerError> {
10582        let query = self.selection.select("committerEmail");
10583        query.execute(self.graphql_client.clone()).await
10584    }
10585    /// Full commit message.
10586    pub async fn message(&self) -> Result<String, DaggerError> {
10587        let query = self.selection.select("message");
10588        query.execute(self.graphql_client.clone()).await
10589    }
10590    /// First line of the commit message.
10591    pub async fn message_headline(&self) -> Result<String, DaggerError> {
10592        let query = self.selection.select("messageHeadline");
10593        query.execute(self.graphql_client.clone()).await
10594    }
10595    /// Commit message body, excluding the headline.
10596    pub async fn message_body(&self) -> Result<String, DaggerError> {
10597        let query = self.selection.select("messageBody");
10598        query.execute(self.graphql_client.clone()).await
10599    }
10600    /// Parent commit SHAs.
10601    pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
10602        let query = self.selection.select("parentShas");
10603        query.execute(self.graphql_client.clone()).await
10604    }
10605}
10606impl Node for GitCommit {
10607    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10608        let query = self.selection.select("id");
10609        let graphql_client = self.graphql_client.clone();
10610        async move { query.execute(graphql_client).await }
10611    }
10612}
10613#[derive(Clone)]
10614pub struct GitPushResult {
10615    pub proc: Option<Arc<DaggerSessionProc>>,
10616    pub selection: Selection,
10617    pub graphql_client: DynGraphQLClient,
10618}
10619impl IntoID<Id> for GitPushResult {
10620    fn into_id(
10621        self,
10622    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10623        Box::pin(async move { self.id().await })
10624    }
10625}
10626impl Loadable for GitPushResult {
10627    fn graphql_type() -> &'static str {
10628        "GitPushResult"
10629    }
10630    fn from_query(
10631        proc: Option<Arc<DaggerSessionProc>>,
10632        selection: Selection,
10633        graphql_client: DynGraphQLClient,
10634    ) -> Self {
10635        Self {
10636            proc,
10637            selection,
10638            graphql_client,
10639        }
10640    }
10641}
10642impl GitPushResult {
10643    /// A unique identifier for this GitPushResult.
10644    pub async fn id(&self) -> Result<Id, DaggerError> {
10645        let query = self.selection.select("id");
10646        query.execute(self.graphql_client.clone()).await
10647    }
10648    /// The fully qualified remote ref.
10649    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10650        let query = self.selection.select("ref");
10651        query.execute(self.graphql_client.clone()).await
10652    }
10653    /// The previous remote object ID; empty when the ref was created.
10654    pub async fn previous_sha(&self) -> Result<String, DaggerError> {
10655        let query = self.selection.select("previousSHA");
10656        query.execute(self.graphql_client.clone()).await
10657    }
10658    /// The object ID pushed to the remote.
10659    pub async fn sha(&self) -> Result<String, DaggerError> {
10660        let query = self.selection.select("sha");
10661        query.execute(self.graphql_client.clone()).await
10662    }
10663    /// How the remote ref was updated.
10664    pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
10665        let query = self.selection.select("disposition");
10666        query.execute(self.graphql_client.clone()).await
10667    }
10668}
10669impl Node for GitPushResult {
10670    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10671        let query = self.selection.select("id");
10672        let graphql_client = self.graphql_client.clone();
10673        async move { query.execute(graphql_client).await }
10674    }
10675}
10676#[derive(Clone)]
10677pub struct GitRef {
10678    pub proc: Option<Arc<DaggerSessionProc>>,
10679    pub selection: Selection,
10680    pub graphql_client: DynGraphQLClient,
10681}
10682#[derive(Builder, Debug, PartialEq)]
10683pub struct GitRefPushOpts<'a> {
10684    /// Destination branch; a refs/ prefix is used verbatim. Defaults to this ref's branch name. Required for detached and non-branch refs.
10685    #[builder(setter(into, strip_option), default)]
10686    pub branch: Option<&'a str>,
10687    /// 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.
10688    #[builder(setter(into, strip_option), default)]
10689    pub expected_remote_sha: Option<&'a str>,
10690    /// 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.
10691    #[builder(setter(into, strip_option), default)]
10692    pub remote: Option<&'a str>,
10693    /// 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.
10694    #[builder(setter(into, strip_option), default)]
10695    pub to: Option<Id>,
10696}
10697#[derive(Builder, Debug, PartialEq)]
10698pub struct GitRefTreeOpts {
10699    /// The depth of the tree to fetch.
10700    #[builder(setter(into, strip_option), default)]
10701    pub depth: Option<isize>,
10702    /// Set to true to discard .git directory.
10703    #[builder(setter(into, strip_option), default)]
10704    pub discard_git_dir: Option<bool>,
10705    /// Set to true to populate tag refs in the local checkout .git.
10706    #[builder(setter(into, strip_option), default)]
10707    pub include_tags: Option<bool>,
10708}
10709#[derive(Builder, Debug, PartialEq)]
10710pub struct GitRefLogOpts<'a> {
10711    /// Exclude commits reachable from this ref, i.e. only list commits added on top of it.
10712    #[builder(setter(into, strip_option), default)]
10713    pub base: Option<Id>,
10714    /// Maximum number of commits to return.
10715    #[builder(setter(into, strip_option), default)]
10716    pub limit: Option<isize>,
10717    /// Only include commits touching these paths, relative to the root of the repository.
10718    #[builder(setter(into, strip_option), default)]
10719    pub paths: Option<Vec<&'a str>>,
10720}
10721#[derive(Builder, Debug, PartialEq)]
10722pub struct GitRefWithCommitOpts<'a> {
10723    /// Allow a commit whose tree matches its parent, including when the supplied edits are already present. Defaults to false.
10724    #[builder(setter(into, strip_option), default)]
10725    pub allow_empty: Option<bool>,
10726    /// RFC3339 committer date. Defaults to date.
10727    #[builder(setter(into, strip_option), default)]
10728    pub committer_date: Option<&'a str>,
10729    /// Committer email. Defaults to authorEmail.
10730    #[builder(setter(into, strip_option), default)]
10731    pub committer_email: Option<&'a str>,
10732    /// Committer name. Defaults to authorName.
10733    #[builder(setter(into, strip_option), default)]
10734    pub committer_name: Option<&'a str>,
10735    /// Add a Signed-off-by trailer using the commit author's name and email.
10736    #[builder(setter(into, strip_option), default)]
10737    pub signoff: Option<bool>,
10738}
10739#[derive(Builder, Debug, PartialEq)]
10740pub struct GitRefAsWorkspaceOpts<'a> {
10741    /// Current working directory inside the workspace root. Defaults to the workspace root.
10742    #[builder(setter(into, strip_option), default)]
10743    pub cwd: Option<&'a str>,
10744}
10745impl IntoID<Id> for GitRef {
10746    fn into_id(
10747        self,
10748    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10749        Box::pin(async move { self.id().await })
10750    }
10751}
10752impl Loadable for GitRef {
10753    fn graphql_type() -> &'static str {
10754        "GitRef"
10755    }
10756    fn from_query(
10757        proc: Option<Arc<DaggerSessionProc>>,
10758        selection: Selection,
10759        graphql_client: DynGraphQLClient,
10760    ) -> Self {
10761        Self {
10762            proc,
10763            selection,
10764            graphql_client,
10765        }
10766    }
10767}
10768impl GitRef {
10769    /// A unique identifier for this GitRef.
10770    pub async fn id(&self) -> Result<Id, DaggerError> {
10771        let query = self.selection.select("id");
10772        query.execute(self.graphql_client.clone()).await
10773    }
10774    /// Push this ref's commit and history to a remote repository using the destination's credentials.
10775    /// 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.
10776    /// 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.
10777    ///
10778    /// # Arguments
10779    ///
10780    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10781    pub fn push(&self) -> GitPushResult {
10782        let query = self.selection.select("push");
10783        GitPushResult {
10784            proc: self.proc.clone(),
10785            selection: query,
10786            graphql_client: self.graphql_client.clone(),
10787        }
10788    }
10789    /// Push this ref's commit and history to a remote repository using the destination's credentials.
10790    /// 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.
10791    /// 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.
10792    ///
10793    /// # Arguments
10794    ///
10795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10796    pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
10797        let mut query = self.selection.select("push");
10798        if let Some(to) = opts.to {
10799            query = query.arg("to", to);
10800        }
10801        if let Some(remote) = opts.remote {
10802            query = query.arg("remote", remote);
10803        }
10804        if let Some(branch) = opts.branch {
10805            query = query.arg("branch", branch);
10806        }
10807        if let Some(expected_remote_sha) = opts.expected_remote_sha {
10808            query = query.arg("expectedRemoteSHA", expected_remote_sha);
10809        }
10810        GitPushResult {
10811            proc: self.proc.clone(),
10812            selection: query,
10813            graphql_client: self.graphql_client.clone(),
10814        }
10815    }
10816    /// The commit this ref resolves to.
10817    pub fn target_commit(&self) -> GitCommit {
10818        let query = self.selection.select("targetCommit");
10819        GitCommit {
10820            proc: self.proc.clone(),
10821            selection: query,
10822            graphql_client: self.graphql_client.clone(),
10823        }
10824    }
10825    /// The resolved commit SHA at this ref.
10826    pub async fn commit_sha(&self) -> Result<String, DaggerError> {
10827        let query = self.selection.select("commitSHA");
10828        query.execute(self.graphql_client.clone()).await
10829    }
10830    /// The filesystem tree at this ref.
10831    ///
10832    /// # Arguments
10833    ///
10834    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10835    pub fn tree(&self) -> Directory {
10836        let query = self.selection.select("tree");
10837        Directory {
10838            proc: self.proc.clone(),
10839            selection: query,
10840            graphql_client: self.graphql_client.clone(),
10841        }
10842    }
10843    /// The filesystem tree at this ref.
10844    ///
10845    /// # Arguments
10846    ///
10847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10848    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10849        let mut query = self.selection.select("tree");
10850        if let Some(discard_git_dir) = opts.discard_git_dir {
10851            query = query.arg("discardGitDir", discard_git_dir);
10852        }
10853        if let Some(depth) = opts.depth {
10854            query = query.arg("depth", depth);
10855        }
10856        if let Some(include_tags) = opts.include_tags {
10857            query = query.arg("includeTags", include_tags);
10858        }
10859        Directory {
10860            proc: self.proc.clone(),
10861            selection: query,
10862            graphql_client: self.graphql_client.clone(),
10863        }
10864    }
10865    /// The resolved commit id at this ref.
10866    pub async fn commit(&self) -> Result<String, DaggerError> {
10867        let query = self.selection.select("commit");
10868        query.execute(self.graphql_client.clone()).await
10869    }
10870    /// The resolved name of this ref.
10871    pub async fn name(&self) -> Result<String, DaggerError> {
10872        let query = self.selection.select("name");
10873        query.execute(self.graphql_client.clone()).await
10874    }
10875    /// The resolved ref name at this ref.
10876    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10877        let query = self.selection.select("ref");
10878        query.execute(self.graphql_client.clone()).await
10879    }
10880    /// Return true when the other ref's commit equals this commit or is an ancestor of it.
10881    /// Compares commit history across branches, tags and detached refs. Incomplete or unavailable history is an error.
10882    ///
10883    /// # Arguments
10884    ///
10885    /// * `other` - The ref whose commit to look for in this ref's history.
10886    pub async fn contains(&self, other: impl IntoID<Id>) -> Result<bool, DaggerError> {
10887        let mut query = self.selection.select("contains");
10888        query = query.arg_lazy(
10889            "other",
10890            Box::new(move || {
10891                let other = other.clone();
10892                Box::pin(async move { other.into_id().await.unwrap().quote() })
10893            }),
10894        );
10895        query.execute(self.graphql_client.clone()).await
10896    }
10897    /// Find the best common ancestor between this ref and another ref.
10898    ///
10899    /// # Arguments
10900    ///
10901    /// * `other` - The other ref to compare against.
10902    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10903        let mut query = self.selection.select("commonAncestor");
10904        query = query.arg_lazy(
10905            "other",
10906            Box::new(move || {
10907                let other = other.clone();
10908                Box::pin(async move { other.into_id().await.unwrap().quote() })
10909            }),
10910        );
10911        GitRef {
10912            proc: self.proc.clone(),
10913            selection: query,
10914            graphql_client: self.graphql_client.clone(),
10915        }
10916    }
10917    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
10918    ///
10919    /// # Arguments
10920    ///
10921    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10922    pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
10923        let query = self.selection.select("log");
10924        let query = query.select("id");
10925        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10926        Ok(ids
10927            .into_iter()
10928            .map(|id| GitCommit {
10929                proc: self.proc.clone(),
10930                selection: crate::querybuilder::query()
10931                    .select("node")
10932                    .arg("id", &id.0)
10933                    .inline_fragment("GitCommit"),
10934                graphql_client: self.graphql_client.clone(),
10935            })
10936            .collect())
10937    }
10938    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
10939    ///
10940    /// # Arguments
10941    ///
10942    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10943    pub async fn log_opts<'a>(
10944        &self,
10945        opts: GitRefLogOpts<'a>,
10946    ) -> Result<Vec<GitCommit>, DaggerError> {
10947        let mut query = self.selection.select("log");
10948        if let Some(limit) = opts.limit {
10949            query = query.arg("limit", limit);
10950        }
10951        if let Some(paths) = opts.paths {
10952            query = query.arg("paths", paths);
10953        }
10954        if let Some(base) = opts.base {
10955            query = query.arg("base", base);
10956        }
10957        let query = query.select("id");
10958        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10959        Ok(ids
10960            .into_iter()
10961            .map(|id| GitCommit {
10962                proc: self.proc.clone(),
10963                selection: crate::querybuilder::query()
10964                    .select("node")
10965                    .arg("id", &id.0)
10966                    .inline_fragment("GitCommit"),
10967                graphql_client: self.graphql_client.clone(),
10968            })
10969            .collect())
10970    }
10971    /// Create a single-parent commit on this ref by applying a changeset's edits.
10972    /// 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.
10973    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
10974    ///
10975    /// # Arguments
10976    ///
10977    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
10978    /// * `message` - Commit message.
10979    /// * `date` - RFC3339 author date; also the default committer date.
10980    /// * `author_name` - Author name.
10981    /// * `author_email` - Author email.
10982    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10983    pub fn with_commit(
10984        &self,
10985        changes: impl IntoID<Id>,
10986        message: impl Into<String>,
10987        date: impl Into<String>,
10988        author_name: impl Into<String>,
10989        author_email: impl Into<String>,
10990    ) -> GitRef {
10991        let mut query = self.selection.select("withCommit");
10992        query = query.arg_lazy(
10993            "changes",
10994            Box::new(move || {
10995                let changes = changes.clone();
10996                Box::pin(async move { changes.into_id().await.unwrap().quote() })
10997            }),
10998        );
10999        query = query.arg("message", message.into());
11000        query = query.arg("date", date.into());
11001        query = query.arg("authorName", author_name.into());
11002        query = query.arg("authorEmail", author_email.into());
11003        GitRef {
11004            proc: self.proc.clone(),
11005            selection: query,
11006            graphql_client: self.graphql_client.clone(),
11007        }
11008    }
11009    /// Create a single-parent commit on this ref by applying a changeset's edits.
11010    /// 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.
11011    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
11012    ///
11013    /// # Arguments
11014    ///
11015    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
11016    /// * `message` - Commit message.
11017    /// * `date` - RFC3339 author date; also the default committer date.
11018    /// * `author_name` - Author name.
11019    /// * `author_email` - Author email.
11020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11021    pub fn with_commit_opts<'a>(
11022        &self,
11023        changes: impl IntoID<Id>,
11024        message: impl Into<String>,
11025        date: impl Into<String>,
11026        author_name: impl Into<String>,
11027        author_email: impl Into<String>,
11028        opts: GitRefWithCommitOpts<'a>,
11029    ) -> GitRef {
11030        let mut query = self.selection.select("withCommit");
11031        query = query.arg_lazy(
11032            "changes",
11033            Box::new(move || {
11034                let changes = changes.clone();
11035                Box::pin(async move { changes.into_id().await.unwrap().quote() })
11036            }),
11037        );
11038        query = query.arg("message", message.into());
11039        query = query.arg("date", date.into());
11040        query = query.arg("authorName", author_name.into());
11041        query = query.arg("authorEmail", author_email.into());
11042        if let Some(committer_name) = opts.committer_name {
11043            query = query.arg("committerName", committer_name);
11044        }
11045        if let Some(committer_email) = opts.committer_email {
11046            query = query.arg("committerEmail", committer_email);
11047        }
11048        if let Some(committer_date) = opts.committer_date {
11049            query = query.arg("committerDate", committer_date);
11050        }
11051        if let Some(allow_empty) = opts.allow_empty {
11052            query = query.arg("allowEmpty", allow_empty);
11053        }
11054        if let Some(signoff) = opts.signoff {
11055            query = query.arg("signoff", signoff);
11056        }
11057        GitRef {
11058            proc: self.proc.clone(),
11059            selection: query,
11060            graphql_client: self.graphql_client.clone(),
11061        }
11062    }
11063    /// Return this ref's repository with HEAD pinned to the selected commit.
11064    /// Preserves the original repository backend, connection information, and other refs. Does not modify a branch or checkout, or prune history.
11065    pub fn as_repository(&self) -> GitRepository {
11066        let query = self.selection.select("asRepository");
11067        GitRepository {
11068            proc: self.proc.clone(),
11069            selection: query,
11070            graphql_client: self.graphql_client.clone(),
11071        }
11072    }
11073    /// Creates a synthetic workspace from this git ref.
11074    ///
11075    /// # Arguments
11076    ///
11077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11078    pub fn as_workspace(&self) -> Workspace {
11079        let query = self.selection.select("asWorkspace");
11080        Workspace {
11081            proc: self.proc.clone(),
11082            selection: query,
11083            graphql_client: self.graphql_client.clone(),
11084        }
11085    }
11086    /// Creates a synthetic workspace from this git ref.
11087    ///
11088    /// # Arguments
11089    ///
11090    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11091    pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
11092        let mut query = self.selection.select("asWorkspace");
11093        if let Some(cwd) = opts.cwd {
11094            query = query.arg("cwd", cwd);
11095        }
11096        Workspace {
11097            proc: self.proc.clone(),
11098            selection: query,
11099            graphql_client: self.graphql_client.clone(),
11100        }
11101    }
11102}
11103impl Node for GitRef {
11104    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11105        let query = self.selection.select("id");
11106        let graphql_client = self.graphql_client.clone();
11107        async move { query.execute(graphql_client).await }
11108    }
11109}
11110#[derive(Clone)]
11111pub struct GitRemote {
11112    pub proc: Option<Arc<DaggerSessionProc>>,
11113    pub selection: Selection,
11114    pub graphql_client: DynGraphQLClient,
11115}
11116impl IntoID<Id> for GitRemote {
11117    fn into_id(
11118        self,
11119    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11120        Box::pin(async move { self.id().await })
11121    }
11122}
11123impl Loadable for GitRemote {
11124    fn graphql_type() -> &'static str {
11125        "GitRemote"
11126    }
11127    fn from_query(
11128        proc: Option<Arc<DaggerSessionProc>>,
11129        selection: Selection,
11130        graphql_client: DynGraphQLClient,
11131    ) -> Self {
11132        Self {
11133            proc,
11134            selection,
11135            graphql_client,
11136        }
11137    }
11138}
11139impl GitRemote {
11140    /// A unique identifier for this GitRemote.
11141    pub async fn id(&self) -> Result<Id, DaggerError> {
11142        let query = self.selection.select("id");
11143        query.execute(self.graphql_client.clone()).await
11144    }
11145    /// Access this remote's repository using its fetch URL and the caller's credentials, or the source's existing capability for this exact destination.
11146    /// HEAD is the remote's HEAD, independent of the workspace's selected commit. Remote registration alone does not grant credentials.
11147    pub fn repository(&self) -> GitRepository {
11148        let query = self.selection.select("repository");
11149        GitRepository {
11150            proc: self.proc.clone(),
11151            selection: query,
11152            graphql_client: self.graphql_client.clone(),
11153        }
11154    }
11155    /// The remote's name.
11156    pub async fn name(&self) -> Result<String, DaggerError> {
11157        let query = self.selection.select("name");
11158        query.execute(self.graphql_client.clone()).await
11159    }
11160}
11161impl Node for GitRemote {
11162    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11163        let query = self.selection.select("id");
11164        let graphql_client = self.graphql_client.clone();
11165        async move { query.execute(graphql_client).await }
11166    }
11167}
11168#[derive(Clone)]
11169pub struct GitRepository {
11170    pub proc: Option<Arc<DaggerSessionProc>>,
11171    pub selection: Selection,
11172    pub graphql_client: DynGraphQLClient,
11173}
11174#[derive(Builder, Debug, PartialEq)]
11175pub struct GitRepositoryHeadOpts {
11176    /// Ignore the workspace lockfile for this lookup.
11177    #[builder(setter(into, strip_option), default)]
11178    pub no_lock: Option<bool>,
11179}
11180#[derive(Builder, Debug, PartialEq)]
11181pub struct GitRepositoryRefOpts {
11182    /// Ignore the workspace lockfile for this lookup.
11183    #[builder(setter(into, strip_option), default)]
11184    pub no_lock: Option<bool>,
11185}
11186#[derive(Builder, Debug, PartialEq)]
11187pub struct GitRepositoryBranchOpts {
11188    /// Ignore the workspace lockfile for this lookup.
11189    #[builder(setter(into, strip_option), default)]
11190    pub no_lock: Option<bool>,
11191}
11192#[derive(Builder, Debug, PartialEq)]
11193pub struct GitRepositoryTagOpts {
11194    /// Ignore the workspace lockfile for this lookup.
11195    #[builder(setter(into, strip_option), default)]
11196    pub no_lock: Option<bool>,
11197}
11198#[derive(Builder, Debug, PartialEq)]
11199pub struct GitRepositoryLatestOpts<'a> {
11200    /// Ignore the workspace lockfile for this lookup.
11201    #[builder(setter(into, strip_option), default)]
11202    pub no_lock: Option<bool>,
11203    /// Version query used to select the greatest matching release ref.
11204    #[builder(setter(into, strip_option), default)]
11205    pub version: Option<&'a str>,
11206}
11207#[derive(Builder, Debug, PartialEq)]
11208pub struct GitRepositoryTagsOpts<'a> {
11209    /// Glob patterns (e.g., "refs/tags/v*").
11210    #[builder(setter(into, strip_option), default)]
11211    pub patterns: Option<Vec<&'a str>>,
11212}
11213#[derive(Builder, Debug, PartialEq)]
11214pub struct GitRepositoryBranchesOpts<'a> {
11215    /// Glob patterns (e.g., "refs/tags/v*").
11216    #[builder(setter(into, strip_option), default)]
11217    pub patterns: Option<Vec<&'a str>>,
11218}
11219#[derive(Builder, Debug, PartialEq)]
11220pub struct GitRepositoryBundleOpts {
11221    /// A Git ref whose reachable objects are omitted and recorded as a prerequisite.
11222    #[builder(setter(into, strip_option), default)]
11223    pub base: Option<Id>,
11224}
11225#[derive(Builder, Debug, PartialEq)]
11226pub struct GitRepositoryWithBundleOpts<'a> {
11227    /// An optional remote ref hint for fetching a prerequisite when the remote does not allow fetches by object ID.
11228    #[builder(setter(into, strip_option), default)]
11229    pub prerequisite_ref: Option<&'a str>,
11230}
11231#[derive(Builder, Debug, PartialEq)]
11232pub struct GitRepositoryWithRemoteOpts<'a> {
11233    /// Push destination, when pushes go somewhere other than url. Empty uses url.
11234    #[builder(setter(into, strip_option), default)]
11235    pub push_url: Option<&'a str>,
11236}
11237#[derive(Builder, Debug, PartialEq)]
11238pub struct GitRepositoryAsWorkspaceOpts<'a> {
11239    /// Current working directory inside the workspace root. Defaults to the workspace root.
11240    #[builder(setter(into, strip_option), default)]
11241    pub cwd: Option<&'a str>,
11242}
11243impl IntoID<Id> for GitRepository {
11244    fn into_id(
11245        self,
11246    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11247        Box::pin(async move { self.id().await })
11248    }
11249}
11250impl Loadable for GitRepository {
11251    fn graphql_type() -> &'static str {
11252        "GitRepository"
11253    }
11254    fn from_query(
11255        proc: Option<Arc<DaggerSessionProc>>,
11256        selection: Selection,
11257        graphql_client: DynGraphQLClient,
11258    ) -> Self {
11259        Self {
11260            proc,
11261            selection,
11262            graphql_client,
11263        }
11264    }
11265}
11266impl GitRepository {
11267    /// A unique identifier for this GitRepository.
11268    pub async fn id(&self) -> Result<Id, DaggerError> {
11269        let query = self.selection.select("id");
11270        query.execute(self.graphql_client.clone()).await
11271    }
11272    /// Returns details for HEAD.
11273    ///
11274    /// # Arguments
11275    ///
11276    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11277    pub fn head(&self) -> GitRef {
11278        let query = self.selection.select("head");
11279        GitRef {
11280            proc: self.proc.clone(),
11281            selection: query,
11282            graphql_client: self.graphql_client.clone(),
11283        }
11284    }
11285    /// Returns details for HEAD.
11286    ///
11287    /// # Arguments
11288    ///
11289    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11290    pub fn head_opts(&self, opts: GitRepositoryHeadOpts) -> GitRef {
11291        let mut query = self.selection.select("head");
11292        if let Some(no_lock) = opts.no_lock {
11293            query = query.arg("noLock", no_lock);
11294        }
11295        GitRef {
11296            proc: self.proc.clone(),
11297            selection: query,
11298            graphql_client: self.graphql_client.clone(),
11299        }
11300    }
11301    /// Returns details of a ref.
11302    ///
11303    /// # Arguments
11304    ///
11305    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11306    ///
11307    /// 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.
11308    ///
11309    /// 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.
11310    ///
11311    /// 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.
11312    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11313    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
11314        let mut query = self.selection.select("ref");
11315        query = query.arg("name", name.into());
11316        GitRef {
11317            proc: self.proc.clone(),
11318            selection: query,
11319            graphql_client: self.graphql_client.clone(),
11320        }
11321    }
11322    /// Returns details of a ref.
11323    ///
11324    /// # Arguments
11325    ///
11326    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11327    ///
11328    /// Commit identifiers may be abbreviated: an unambiguous hex prefix (4-40 characters) of a commit SHA resolves like git rev-parse, with named refs taking precedence. Abbreviated SHAs resolve against locally available objects, so remote repositories (resolved via ls-remote) can only expand prefixes of already-fetched commits; use the full SHA or a named ref otherwise.
11329    ///
11330    /// The name may be followed by git revision suffixes, applied left to right: `~N` follows first parents N times and `^N` selects the Nth parent (`~` and `^` mean 1, `^0` is the commit itself), e.g. `HEAD~3`, `main^2` or `abc1234~2`. The result is a detached ref of the resulting commit; remote repositories fetch the history the walk needs. Other git revision syntax (`^{...}`, `@{...}`, `:path`, ranges) is not supported.
11331    ///
11332    /// A repository derived from a remote one (e.g. a workspace's history after a snapshot or commit) resolves names and commits it does not contain itself through that remote, with its authentication. Its branches and tags listings include the remote's.
11333    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11334    pub fn r#ref_opts(&self, name: impl Into<String>, opts: GitRepositoryRefOpts) -> GitRef {
11335        let mut query = self.selection.select("ref");
11336        query = query.arg("name", name.into());
11337        if let Some(no_lock) = opts.no_lock {
11338            query = query.arg("noLock", no_lock);
11339        }
11340        GitRef {
11341            proc: self.proc.clone(),
11342            selection: query,
11343            graphql_client: self.graphql_client.clone(),
11344        }
11345    }
11346    /// Returns details of a branch.
11347    ///
11348    /// # Arguments
11349    ///
11350    /// * `name` - Branch's name (e.g., "main").
11351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11352    pub fn branch(&self, name: impl Into<String>) -> GitRef {
11353        let mut query = self.selection.select("branch");
11354        query = query.arg("name", name.into());
11355        GitRef {
11356            proc: self.proc.clone(),
11357            selection: query,
11358            graphql_client: self.graphql_client.clone(),
11359        }
11360    }
11361    /// Returns details of a branch.
11362    ///
11363    /// # Arguments
11364    ///
11365    /// * `name` - Branch's name (e.g., "main").
11366    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11367    pub fn branch_opts(&self, name: impl Into<String>, opts: GitRepositoryBranchOpts) -> GitRef {
11368        let mut query = self.selection.select("branch");
11369        query = query.arg("name", name.into());
11370        if let Some(no_lock) = opts.no_lock {
11371            query = query.arg("noLock", no_lock);
11372        }
11373        GitRef {
11374            proc: self.proc.clone(),
11375            selection: query,
11376            graphql_client: self.graphql_client.clone(),
11377        }
11378    }
11379    /// Returns details of a tag.
11380    ///
11381    /// # Arguments
11382    ///
11383    /// * `name` - Tag's name (e.g., "v0.3.9").
11384    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11385    pub fn tag(&self, name: impl Into<String>) -> GitRef {
11386        let mut query = self.selection.select("tag");
11387        query = query.arg("name", name.into());
11388        GitRef {
11389            proc: self.proc.clone(),
11390            selection: query,
11391            graphql_client: self.graphql_client.clone(),
11392        }
11393    }
11394    /// Returns details of a tag.
11395    ///
11396    /// # Arguments
11397    ///
11398    /// * `name` - Tag's name (e.g., "v0.3.9").
11399    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11400    pub fn tag_opts(&self, name: impl Into<String>, opts: GitRepositoryTagOpts) -> GitRef {
11401        let mut query = self.selection.select("tag");
11402        query = query.arg("name", name.into());
11403        if let Some(no_lock) = opts.no_lock {
11404            query = query.arg("noLock", no_lock);
11405        }
11406        GitRef {
11407            proc: self.proc.clone(),
11408            selection: query,
11409            graphql_client: self.graphql_client.clone(),
11410        }
11411    }
11412    /// Returns details of a commit.
11413    ///
11414    /// # Arguments
11415    ///
11416    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
11417    ///
11418    /// 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.
11419    pub fn commit(&self, id: impl Into<String>) -> GitCommit {
11420        let mut query = self.selection.select("commit");
11421        query = query.arg("id", id.into());
11422        GitCommit {
11423            proc: self.proc.clone(),
11424            selection: query,
11425            graphql_client: self.graphql_client.clone(),
11426        }
11427    }
11428    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11429    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11430    ///
11431    /// # Arguments
11432    ///
11433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11434    pub fn latest(&self) -> GitRef {
11435        let query = self.selection.select("latest");
11436        GitRef {
11437            proc: self.proc.clone(),
11438            selection: query,
11439            graphql_client: self.graphql_client.clone(),
11440        }
11441    }
11442    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11443    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11444    ///
11445    /// # Arguments
11446    ///
11447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11448    pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
11449        let mut query = self.selection.select("latest");
11450        if let Some(version) = opts.version {
11451            query = query.arg("version", version);
11452        }
11453        if let Some(no_lock) = opts.no_lock {
11454            query = query.arg("noLock", no_lock);
11455        }
11456        GitRef {
11457            proc: self.proc.clone(),
11458            selection: query,
11459            graphql_client: self.graphql_client.clone(),
11460        }
11461    }
11462    /// tags that match any of the given glob patterns.
11463    ///
11464    /// # Arguments
11465    ///
11466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11467    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
11468        let query = self.selection.select("tags");
11469        query.execute(self.graphql_client.clone()).await
11470    }
11471    /// tags that match any of the given glob patterns.
11472    ///
11473    /// # Arguments
11474    ///
11475    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11476    pub async fn tags_opts<'a>(
11477        &self,
11478        opts: GitRepositoryTagsOpts<'a>,
11479    ) -> Result<Vec<String>, DaggerError> {
11480        let mut query = self.selection.select("tags");
11481        if let Some(patterns) = opts.patterns {
11482            query = query.arg("patterns", patterns);
11483        }
11484        query.execute(self.graphql_client.clone()).await
11485    }
11486    /// branches that match any of the given glob patterns.
11487    ///
11488    /// # Arguments
11489    ///
11490    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11491    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
11492        let query = self.selection.select("branches");
11493        query.execute(self.graphql_client.clone()).await
11494    }
11495    /// branches that match any of the given glob patterns.
11496    ///
11497    /// # Arguments
11498    ///
11499    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11500    pub async fn branches_opts<'a>(
11501        &self,
11502        opts: GitRepositoryBranchesOpts<'a>,
11503    ) -> Result<Vec<String>, DaggerError> {
11504        let mut query = self.selection.select("branches");
11505        if let Some(patterns) = opts.patterns {
11506            query = query.arg("patterns", patterns);
11507        }
11508        query.execute(self.graphql_client.clone()).await
11509    }
11510    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11511    ///
11512    /// # Arguments
11513    ///
11514    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11516    pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
11517        let mut query = self.selection.select("bundle");
11518        query = query.arg(
11519            "refs",
11520            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11521        );
11522        GitBundle {
11523            proc: self.proc.clone(),
11524            selection: query,
11525            graphql_client: self.graphql_client.clone(),
11526        }
11527    }
11528    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11529    ///
11530    /// # Arguments
11531    ///
11532    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11534    pub fn bundle_opts(
11535        &self,
11536        refs: Vec<impl Into<String>>,
11537        opts: GitRepositoryBundleOpts,
11538    ) -> GitBundle {
11539        let mut query = self.selection.select("bundle");
11540        query = query.arg(
11541            "refs",
11542            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11543        );
11544        if let Some(base) = opts.base {
11545            query = query.arg("base", base);
11546        }
11547        GitBundle {
11548            proc: self.proc.clone(),
11549            selection: query,
11550            graphql_client: self.graphql_client.clone(),
11551        }
11552    }
11553    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11554    ///
11555    /// # Arguments
11556    ///
11557    /// * `bundle` - The Git bundle to import.
11558    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11559    pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
11560        let mut query = self.selection.select("withBundle");
11561        query = query.arg_lazy(
11562            "bundle",
11563            Box::new(move || {
11564                let bundle = bundle.clone();
11565                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11566            }),
11567        );
11568        GitRepository {
11569            proc: self.proc.clone(),
11570            selection: query,
11571            graphql_client: self.graphql_client.clone(),
11572        }
11573    }
11574    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11575    ///
11576    /// # Arguments
11577    ///
11578    /// * `bundle` - The Git bundle to import.
11579    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11580    pub fn with_bundle_opts<'a>(
11581        &self,
11582        bundle: impl IntoID<Id>,
11583        opts: GitRepositoryWithBundleOpts<'a>,
11584    ) -> GitRepository {
11585        let mut query = self.selection.select("withBundle");
11586        query = query.arg_lazy(
11587            "bundle",
11588            Box::new(move || {
11589                let bundle = bundle.clone();
11590                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11591            }),
11592        );
11593        if let Some(prerequisite_ref) = opts.prerequisite_ref {
11594            query = query.arg("prerequisiteRef", prerequisite_ref);
11595        }
11596        GitRepository {
11597            proc: self.proc.clone(),
11598            selection: query,
11599            graphql_client: self.graphql_client.clone(),
11600        }
11601    }
11602    /// Register a named remote on this repository, replacing any registered remote of the same name.
11603    /// 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.
11604    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11605    ///
11606    /// # Arguments
11607    ///
11608    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11609    /// * `url` - The remote's fetch URL.
11610    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11611    pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
11612        let mut query = self.selection.select("withRemote");
11613        query = query.arg("name", name.into());
11614        query = query.arg("url", url.into());
11615        GitRepository {
11616            proc: self.proc.clone(),
11617            selection: query,
11618            graphql_client: self.graphql_client.clone(),
11619        }
11620    }
11621    /// Register a named remote on this repository, replacing any registered remote of the same name.
11622    /// 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.
11623    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11624    ///
11625    /// # Arguments
11626    ///
11627    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11628    /// * `url` - The remote's fetch URL.
11629    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11630    pub fn with_remote_opts<'a>(
11631        &self,
11632        name: impl Into<String>,
11633        url: impl Into<String>,
11634        opts: GitRepositoryWithRemoteOpts<'a>,
11635    ) -> GitRepository {
11636        let mut query = self.selection.select("withRemote");
11637        query = query.arg("name", name.into());
11638        query = query.arg("url", url.into());
11639        if let Some(push_url) = opts.push_url {
11640            query = query.arg("pushUrl", push_url);
11641        }
11642        GitRepository {
11643            proc: self.proc.clone(),
11644            selection: query,
11645            graphql_client: self.graphql_client.clone(),
11646        }
11647    }
11648    /// List this repository's named remotes, with registered remotes overriding configured ones. Does not contact remote servers.
11649    pub async fn remotes(&self) -> Result<Vec<GitRemote>, DaggerError> {
11650        let query = self.selection.select("remotes");
11651        let query = query.select("id");
11652        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11653        Ok(ids
11654            .into_iter()
11655            .map(|id| GitRemote {
11656                proc: self.proc.clone(),
11657                selection: crate::querybuilder::query()
11658                    .select("node")
11659                    .arg("id", &id.0)
11660                    .inline_fragment("GitRemote"),
11661                graphql_client: self.graphql_client.clone(),
11662            })
11663            .collect())
11664    }
11665    /// Look up a remote by name. Fails when the remote does not exist.
11666    ///
11667    /// # Arguments
11668    ///
11669    /// * `name` - The remote's name.
11670    pub fn remote(&self, name: impl Into<String>) -> GitRemote {
11671        let mut query = self.selection.select("remote");
11672        query = query.arg("name", name.into());
11673        GitRemote {
11674            proc: self.proc.clone(),
11675            selection: query,
11676            graphql_client: self.graphql_client.clone(),
11677        }
11678    }
11679    /// Return the sole remote, otherwise origin, otherwise the selected branch's upstream remote, otherwise null.
11680    /// Frozen workspaces retain their captured upstream selection. Does not contact remote servers.
11681    pub async fn default_remote(&self) -> Result<Option<GitRemote>, DaggerError> {
11682        let query = self.selection.select("defaultRemote");
11683        let query = query.select("id");
11684        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11685        Ok(id.map(|id| GitRemote {
11686            proc: self.proc.clone(),
11687            selection: query
11688                .root()
11689                .select("node")
11690                .arg("id", &id.0)
11691                .inline_fragment("GitRemote"),
11692            graphql_client: self.graphql_client.clone(),
11693        }))
11694    }
11695    /// Replace this repository's storage with the supplied self-contained Git repository, retaining its logical URL and push destinations.
11696    /// 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.
11697    /// 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.
11698    /// 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.
11699    ///
11700    /// # Arguments
11701    ///
11702    /// * `directory` - Existing Git storage to open. Git metadata and object dependencies must be contained in this directory.
11703    pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
11704        let mut query = self.selection.select("withContents");
11705        query = query.arg_lazy(
11706            "directory",
11707            Box::new(move || {
11708                let directory = directory.clone();
11709                Box::pin(async move { directory.into_id().await.unwrap().quote() })
11710            }),
11711        );
11712        GitRepository {
11713            proc: self.proc.clone(),
11714            selection: query,
11715            graphql_client: self.graphql_client.clone(),
11716        }
11717    }
11718    /// Returns the changeset of uncommitted changes in the git repository.
11719    pub fn uncommitted(&self) -> Changeset {
11720        let query = self.selection.select("uncommitted");
11721        Changeset {
11722            proc: self.proc.clone(),
11723            selection: query,
11724            graphql_client: self.graphql_client.clone(),
11725        }
11726    }
11727    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11728    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11729    ///
11730    /// # Arguments
11731    ///
11732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11733    pub fn as_workspace(&self) -> Workspace {
11734        let query = self.selection.select("asWorkspace");
11735        Workspace {
11736            proc: self.proc.clone(),
11737            selection: query,
11738            graphql_client: self.graphql_client.clone(),
11739        }
11740    }
11741    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11742    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11743    ///
11744    /// # Arguments
11745    ///
11746    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11747    pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
11748        let mut query = self.selection.select("asWorkspace");
11749        if let Some(cwd) = opts.cwd {
11750            query = query.arg("cwd", cwd);
11751        }
11752        Workspace {
11753            proc: self.proc.clone(),
11754            selection: query,
11755            graphql_client: self.graphql_client.clone(),
11756        }
11757    }
11758    /// The URL of the git repository.
11759    pub async fn url(&self) -> Result<String, DaggerError> {
11760        let query = self.selection.select("url");
11761        query.execute(self.graphql_client.clone()).await
11762    }
11763}
11764impl Node for GitRepository {
11765    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11766        let query = self.selection.select("id");
11767        let graphql_client = self.graphql_client.clone();
11768        async move { query.execute(graphql_client).await }
11769    }
11770}
11771#[derive(Clone)]
11772pub struct HttpState {
11773    pub proc: Option<Arc<DaggerSessionProc>>,
11774    pub selection: Selection,
11775    pub graphql_client: DynGraphQLClient,
11776}
11777impl IntoID<Id> for HttpState {
11778    fn into_id(
11779        self,
11780    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11781        Box::pin(async move { self.id().await })
11782    }
11783}
11784impl Loadable for HttpState {
11785    fn graphql_type() -> &'static str {
11786        "HTTPState"
11787    }
11788    fn from_query(
11789        proc: Option<Arc<DaggerSessionProc>>,
11790        selection: Selection,
11791        graphql_client: DynGraphQLClient,
11792    ) -> Self {
11793        Self {
11794            proc,
11795            selection,
11796            graphql_client,
11797        }
11798    }
11799}
11800impl HttpState {
11801    /// A unique identifier for this HTTPState.
11802    pub async fn id(&self) -> Result<Id, DaggerError> {
11803        let query = self.selection.select("id");
11804        query.execute(self.graphql_client.clone()).await
11805    }
11806}
11807impl Node for HttpState {
11808    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11809        let query = self.selection.select("id");
11810        let graphql_client = self.graphql_client.clone();
11811        async move { query.execute(graphql_client).await }
11812    }
11813}
11814#[derive(Clone)]
11815pub struct HealthcheckConfig {
11816    pub proc: Option<Arc<DaggerSessionProc>>,
11817    pub selection: Selection,
11818    pub graphql_client: DynGraphQLClient,
11819}
11820impl IntoID<Id> for HealthcheckConfig {
11821    fn into_id(
11822        self,
11823    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11824        Box::pin(async move { self.id().await })
11825    }
11826}
11827impl Loadable for HealthcheckConfig {
11828    fn graphql_type() -> &'static str {
11829        "HealthcheckConfig"
11830    }
11831    fn from_query(
11832        proc: Option<Arc<DaggerSessionProc>>,
11833        selection: Selection,
11834        graphql_client: DynGraphQLClient,
11835    ) -> Self {
11836        Self {
11837            proc,
11838            selection,
11839            graphql_client,
11840        }
11841    }
11842}
11843impl HealthcheckConfig {
11844    /// A unique identifier for this HealthcheckConfig.
11845    pub async fn id(&self) -> Result<Id, DaggerError> {
11846        let query = self.selection.select("id");
11847        query.execute(self.graphql_client.clone()).await
11848    }
11849    /// Healthcheck command arguments.
11850    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
11851        let query = self.selection.select("args");
11852        query.execute(self.graphql_client.clone()).await
11853    }
11854    /// Healthcheck command is a shell command.
11855    pub async fn shell(&self) -> Result<bool, DaggerError> {
11856        let query = self.selection.select("shell");
11857        query.execute(self.graphql_client.clone()).await
11858    }
11859    /// Healthcheck timeout. Example:3s
11860    pub async fn timeout(&self) -> Result<String, DaggerError> {
11861        let query = self.selection.select("timeout");
11862        query.execute(self.graphql_client.clone()).await
11863    }
11864    /// Interval between running healthcheck. Example:30s
11865    pub async fn interval(&self) -> Result<String, DaggerError> {
11866        let query = self.selection.select("interval");
11867        query.execute(self.graphql_client.clone()).await
11868    }
11869    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
11870    pub async fn start_period(&self) -> Result<String, DaggerError> {
11871        let query = self.selection.select("startPeriod");
11872        query.execute(self.graphql_client.clone()).await
11873    }
11874    /// StartInterval configures the duration between checks during the startup phase. Example:5s
11875    pub async fn start_interval(&self) -> Result<String, DaggerError> {
11876        let query = self.selection.select("startInterval");
11877        query.execute(self.graphql_client.clone()).await
11878    }
11879    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
11880    pub async fn retries(&self) -> Result<isize, DaggerError> {
11881        let query = self.selection.select("retries");
11882        query.execute(self.graphql_client.clone()).await
11883    }
11884}
11885impl Node for HealthcheckConfig {
11886    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11887        let query = self.selection.select("id");
11888        let graphql_client = self.graphql_client.clone();
11889        async move { query.execute(graphql_client).await }
11890    }
11891}
11892#[derive(Clone)]
11893pub struct Host {
11894    pub proc: Option<Arc<DaggerSessionProc>>,
11895    pub selection: Selection,
11896    pub graphql_client: DynGraphQLClient,
11897}
11898#[derive(Builder, Debug, PartialEq)]
11899pub struct HostDirectoryOpts<'a> {
11900    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
11901    #[builder(setter(into, strip_option), default)]
11902    pub exclude: Option<Vec<&'a str>>,
11903    /// Apply .gitignore filter rules inside the directory
11904    #[builder(setter(into, strip_option), default)]
11905    pub gitignore: Option<bool>,
11906    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
11907    #[builder(setter(into, strip_option), default)]
11908    pub include: Option<Vec<&'a str>>,
11909    /// If true, the directory will always be reloaded from the host.
11910    #[builder(setter(into, strip_option), default)]
11911    pub no_cache: Option<bool>,
11912}
11913#[derive(Builder, Debug, PartialEq)]
11914pub struct HostFileOpts {
11915    /// If true, the file will always be reloaded from the host.
11916    #[builder(setter(into, strip_option), default)]
11917    pub no_cache: Option<bool>,
11918}
11919#[derive(Builder, Debug, PartialEq)]
11920pub struct HostFindUpOpts {
11921    #[builder(setter(into, strip_option), default)]
11922    pub no_cache: Option<bool>,
11923}
11924#[derive(Builder, Debug, PartialEq)]
11925pub struct HostTunnelOpts {
11926    /// Map each service port to the same port on the host, as if the service were running natively.
11927    /// Note: enabling may result in port conflicts.
11928    #[builder(setter(into, strip_option), default)]
11929    pub native: Option<bool>,
11930    /// Configure explicit port forwarding rules for the tunnel.
11931    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
11932    /// 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.
11933    /// If ports are given and native is true, the ports are additive.
11934    #[builder(setter(into, strip_option), default)]
11935    pub ports: Option<Vec<PortForward>>,
11936}
11937#[derive(Builder, Debug, PartialEq)]
11938pub struct HostServiceOpts<'a> {
11939    /// Upstream host to forward traffic to.
11940    #[builder(setter(into, strip_option), default)]
11941    pub host: Option<&'a str>,
11942}
11943impl IntoID<Id> for Host {
11944    fn into_id(
11945        self,
11946    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11947        Box::pin(async move { self.id().await })
11948    }
11949}
11950impl Loadable for Host {
11951    fn graphql_type() -> &'static str {
11952        "Host"
11953    }
11954    fn from_query(
11955        proc: Option<Arc<DaggerSessionProc>>,
11956        selection: Selection,
11957        graphql_client: DynGraphQLClient,
11958    ) -> Self {
11959        Self {
11960            proc,
11961            selection,
11962            graphql_client,
11963        }
11964    }
11965}
11966impl Host {
11967    /// A unique identifier for this Host.
11968    pub async fn id(&self) -> Result<Id, DaggerError> {
11969        let query = self.selection.select("id");
11970        query.execute(self.graphql_client.clone()).await
11971    }
11972    /// Accesses a directory on the host.
11973    ///
11974    /// # Arguments
11975    ///
11976    /// * `path` - Location of the directory to access (e.g., ".").
11977    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11978    pub fn directory(&self, path: impl Into<String>) -> Directory {
11979        let mut query = self.selection.select("directory");
11980        query = query.arg("path", path.into());
11981        Directory {
11982            proc: self.proc.clone(),
11983            selection: query,
11984            graphql_client: self.graphql_client.clone(),
11985        }
11986    }
11987    /// Accesses a directory on the host.
11988    ///
11989    /// # Arguments
11990    ///
11991    /// * `path` - Location of the directory to access (e.g., ".").
11992    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11993    pub fn directory_opts<'a>(
11994        &self,
11995        path: impl Into<String>,
11996        opts: HostDirectoryOpts<'a>,
11997    ) -> Directory {
11998        let mut query = self.selection.select("directory");
11999        query = query.arg("path", path.into());
12000        if let Some(exclude) = opts.exclude {
12001            query = query.arg("exclude", exclude);
12002        }
12003        if let Some(include) = opts.include {
12004            query = query.arg("include", include);
12005        }
12006        if let Some(no_cache) = opts.no_cache {
12007            query = query.arg("noCache", no_cache);
12008        }
12009        if let Some(gitignore) = opts.gitignore {
12010            query = query.arg("gitignore", gitignore);
12011        }
12012        Directory {
12013            proc: self.proc.clone(),
12014            selection: query,
12015            graphql_client: self.graphql_client.clone(),
12016        }
12017    }
12018    /// Accesses a file on the host.
12019    ///
12020    /// # Arguments
12021    ///
12022    /// * `path` - Location of the file to retrieve (e.g., "README.md").
12023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12024    pub fn file(&self, path: impl Into<String>) -> File {
12025        let mut query = self.selection.select("file");
12026        query = query.arg("path", path.into());
12027        File {
12028            proc: self.proc.clone(),
12029            selection: query,
12030            graphql_client: self.graphql_client.clone(),
12031        }
12032    }
12033    /// Accesses a file on the host.
12034    ///
12035    /// # Arguments
12036    ///
12037    /// * `path` - Location of the file to retrieve (e.g., "README.md").
12038    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12039    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
12040        let mut query = self.selection.select("file");
12041        query = query.arg("path", path.into());
12042        if let Some(no_cache) = opts.no_cache {
12043            query = query.arg("noCache", no_cache);
12044        }
12045        File {
12046            proc: self.proc.clone(),
12047            selection: query,
12048            graphql_client: self.graphql_client.clone(),
12049        }
12050    }
12051    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12052    ///
12053    /// # Arguments
12054    ///
12055    /// * `name` - name of the file or directory to search for
12056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12057    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
12058        let mut query = self.selection.select("findUp");
12059        query = query.arg("name", name.into());
12060        query.execute(self.graphql_client.clone()).await
12061    }
12062    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12063    ///
12064    /// # Arguments
12065    ///
12066    /// * `name` - name of the file or directory to search for
12067    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12068    pub async fn find_up_opts(
12069        &self,
12070        name: impl Into<String>,
12071        opts: HostFindUpOpts,
12072    ) -> Result<String, DaggerError> {
12073        let mut query = self.selection.select("findUp");
12074        query = query.arg("name", name.into());
12075        if let Some(no_cache) = opts.no_cache {
12076            query = query.arg("noCache", no_cache);
12077        }
12078        query.execute(self.graphql_client.clone()).await
12079    }
12080    /// Accesses a Unix socket on the host.
12081    ///
12082    /// # Arguments
12083    ///
12084    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
12085    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
12086        let mut query = self.selection.select("unixSocket");
12087        query = query.arg("path", path.into());
12088        Socket {
12089            proc: self.proc.clone(),
12090            selection: query,
12091            graphql_client: self.graphql_client.clone(),
12092        }
12093    }
12094    /// Creates a tunnel that forwards traffic from the host to a service.
12095    ///
12096    /// # Arguments
12097    ///
12098    /// * `service` - Service to send traffic from the tunnel.
12099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12100    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
12101        let mut query = self.selection.select("tunnel");
12102        query = query.arg_lazy(
12103            "service",
12104            Box::new(move || {
12105                let service = service.clone();
12106                Box::pin(async move { service.into_id().await.unwrap().quote() })
12107            }),
12108        );
12109        Service {
12110            proc: self.proc.clone(),
12111            selection: query,
12112            graphql_client: self.graphql_client.clone(),
12113        }
12114    }
12115    /// Creates a tunnel that forwards traffic from the host to a service.
12116    ///
12117    /// # Arguments
12118    ///
12119    /// * `service` - Service to send traffic from the tunnel.
12120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12121    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
12122        let mut query = self.selection.select("tunnel");
12123        query = query.arg_lazy(
12124            "service",
12125            Box::new(move || {
12126                let service = service.clone();
12127                Box::pin(async move { service.into_id().await.unwrap().quote() })
12128            }),
12129        );
12130        if let Some(native) = opts.native {
12131            query = query.arg("native", native);
12132        }
12133        if let Some(ports) = opts.ports {
12134            query = query.arg("ports", ports);
12135        }
12136        Service {
12137            proc: self.proc.clone(),
12138            selection: query,
12139            graphql_client: self.graphql_client.clone(),
12140        }
12141    }
12142    /// Creates a service that forwards traffic to a specified address via the host.
12143    ///
12144    /// # Arguments
12145    ///
12146    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12147    ///
12148    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12149    ///
12150    /// An empty set of ports is not valid; an error will be returned.
12151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12152    pub fn service(&self, ports: Vec<PortForward>) -> Service {
12153        let mut query = self.selection.select("service");
12154        query = query.arg("ports", ports);
12155        Service {
12156            proc: self.proc.clone(),
12157            selection: query,
12158            graphql_client: self.graphql_client.clone(),
12159        }
12160    }
12161    /// Creates a service that forwards traffic to a specified address via the host.
12162    ///
12163    /// # Arguments
12164    ///
12165    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12166    ///
12167    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12168    ///
12169    /// An empty set of ports is not valid; an error will be returned.
12170    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12171    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
12172        let mut query = self.selection.select("service");
12173        query = query.arg("ports", ports);
12174        if let Some(host) = opts.host {
12175            query = query.arg("host", host);
12176        }
12177        Service {
12178            proc: self.proc.clone(),
12179            selection: query,
12180            graphql_client: self.graphql_client.clone(),
12181        }
12182    }
12183    /// Accesses a container image on the host.
12184    ///
12185    /// # Arguments
12186    ///
12187    /// * `name` - Name of the image to access.
12188    pub fn container_image(&self, name: impl Into<String>) -> Container {
12189        let mut query = self.selection.select("containerImage");
12190        query = query.arg("name", name.into());
12191        Container {
12192            proc: self.proc.clone(),
12193            selection: query,
12194            graphql_client: self.graphql_client.clone(),
12195        }
12196    }
12197}
12198impl Node for Host {
12199    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12200        let query = self.selection.select("id");
12201        let graphql_client = self.graphql_client.clone();
12202        async move { query.execute(graphql_client).await }
12203    }
12204}
12205#[derive(Clone)]
12206pub struct InputTypeDef {
12207    pub proc: Option<Arc<DaggerSessionProc>>,
12208    pub selection: Selection,
12209    pub graphql_client: DynGraphQLClient,
12210}
12211impl IntoID<Id> for InputTypeDef {
12212    fn into_id(
12213        self,
12214    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12215        Box::pin(async move { self.id().await })
12216    }
12217}
12218impl Loadable for InputTypeDef {
12219    fn graphql_type() -> &'static str {
12220        "InputTypeDef"
12221    }
12222    fn from_query(
12223        proc: Option<Arc<DaggerSessionProc>>,
12224        selection: Selection,
12225        graphql_client: DynGraphQLClient,
12226    ) -> Self {
12227        Self {
12228            proc,
12229            selection,
12230            graphql_client,
12231        }
12232    }
12233}
12234impl InputTypeDef {
12235    /// A unique identifier for this InputTypeDef.
12236    pub async fn id(&self) -> Result<Id, DaggerError> {
12237        let query = self.selection.select("id");
12238        query.execute(self.graphql_client.clone()).await
12239    }
12240    /// Static fields defined on this input object, if any.
12241    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12242        let query = self.selection.select("fields");
12243        let query = query.select("id");
12244        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12245        Ok(ids
12246            .into_iter()
12247            .map(|id| FieldTypeDef {
12248                proc: self.proc.clone(),
12249                selection: crate::querybuilder::query()
12250                    .select("node")
12251                    .arg("id", &id.0)
12252                    .inline_fragment("FieldTypeDef"),
12253                graphql_client: self.graphql_client.clone(),
12254            })
12255            .collect())
12256    }
12257    /// The name of the input object.
12258    pub async fn name(&self) -> Result<String, DaggerError> {
12259        let query = self.selection.select("name");
12260        query.execute(self.graphql_client.clone()).await
12261    }
12262}
12263impl Node for InputTypeDef {
12264    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12265        let query = self.selection.select("id");
12266        let graphql_client = self.graphql_client.clone();
12267        async move { query.execute(graphql_client).await }
12268    }
12269}
12270#[derive(Clone)]
12271pub struct InterfaceTypeDef {
12272    pub proc: Option<Arc<DaggerSessionProc>>,
12273    pub selection: Selection,
12274    pub graphql_client: DynGraphQLClient,
12275}
12276impl IntoID<Id> for InterfaceTypeDef {
12277    fn into_id(
12278        self,
12279    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12280        Box::pin(async move { self.id().await })
12281    }
12282}
12283impl Loadable for InterfaceTypeDef {
12284    fn graphql_type() -> &'static str {
12285        "InterfaceTypeDef"
12286    }
12287    fn from_query(
12288        proc: Option<Arc<DaggerSessionProc>>,
12289        selection: Selection,
12290        graphql_client: DynGraphQLClient,
12291    ) -> Self {
12292        Self {
12293            proc,
12294            selection,
12295            graphql_client,
12296        }
12297    }
12298}
12299impl InterfaceTypeDef {
12300    /// A unique identifier for this InterfaceTypeDef.
12301    pub async fn id(&self) -> Result<Id, DaggerError> {
12302        let query = self.selection.select("id");
12303        query.execute(self.graphql_client.clone()).await
12304    }
12305    /// Functions defined on this interface, if any.
12306    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12307        let query = self.selection.select("functions");
12308        let query = query.select("id");
12309        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12310        Ok(ids
12311            .into_iter()
12312            .map(|id| Function {
12313                proc: self.proc.clone(),
12314                selection: crate::querybuilder::query()
12315                    .select("node")
12316                    .arg("id", &id.0)
12317                    .inline_fragment("Function"),
12318                graphql_client: self.graphql_client.clone(),
12319            })
12320            .collect())
12321    }
12322    /// The name of the interface.
12323    pub async fn name(&self) -> Result<String, DaggerError> {
12324        let query = self.selection.select("name");
12325        query.execute(self.graphql_client.clone()).await
12326    }
12327    /// The doc string for the interface, if any.
12328    pub async fn description(&self) -> Result<String, DaggerError> {
12329        let query = self.selection.select("description");
12330        query.execute(self.graphql_client.clone()).await
12331    }
12332    /// The location of this interface declaration.
12333    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12334        let query = self.selection.select("sourceMap");
12335        let query = query.select("id");
12336        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12337        Ok(id.map(|id| SourceMap {
12338            proc: self.proc.clone(),
12339            selection: query
12340                .root()
12341                .select("node")
12342                .arg("id", &id.0)
12343                .inline_fragment("SourceMap"),
12344            graphql_client: self.graphql_client.clone(),
12345        }))
12346    }
12347    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
12348    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12349        let query = self.selection.select("sourceModuleName");
12350        query.execute(self.graphql_client.clone()).await
12351    }
12352}
12353impl Node for InterfaceTypeDef {
12354    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12355        let query = self.selection.select("id");
12356        let graphql_client = self.graphql_client.clone();
12357        async move { query.execute(graphql_client).await }
12358    }
12359}
12360#[derive(Clone)]
12361pub struct JsonValue {
12362    pub proc: Option<Arc<DaggerSessionProc>>,
12363    pub selection: Selection,
12364    pub graphql_client: DynGraphQLClient,
12365}
12366#[derive(Builder, Debug, PartialEq)]
12367pub struct JsonValueContentsOpts<'a> {
12368    /// Optional line prefix
12369    #[builder(setter(into, strip_option), default)]
12370    pub indent: Option<&'a str>,
12371    /// Pretty-print
12372    #[builder(setter(into, strip_option), default)]
12373    pub pretty: Option<bool>,
12374}
12375impl IntoID<Id> for JsonValue {
12376    fn into_id(
12377        self,
12378    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12379        Box::pin(async move { self.id().await })
12380    }
12381}
12382impl Loadable for JsonValue {
12383    fn graphql_type() -> &'static str {
12384        "JSONValue"
12385    }
12386    fn from_query(
12387        proc: Option<Arc<DaggerSessionProc>>,
12388        selection: Selection,
12389        graphql_client: DynGraphQLClient,
12390    ) -> Self {
12391        Self {
12392            proc,
12393            selection,
12394            graphql_client,
12395        }
12396    }
12397}
12398impl JsonValue {
12399    /// A unique identifier for this JSONValue.
12400    pub async fn id(&self) -> Result<Id, DaggerError> {
12401        let query = self.selection.select("id");
12402        query.execute(self.graphql_client.clone()).await
12403    }
12404    /// Return the value encoded as json
12405    ///
12406    /// # Arguments
12407    ///
12408    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12409    pub async fn contents(&self) -> Result<Json, DaggerError> {
12410        let query = self.selection.select("contents");
12411        query.execute(self.graphql_client.clone()).await
12412    }
12413    /// Return the value encoded as json
12414    ///
12415    /// # Arguments
12416    ///
12417    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12418    pub async fn contents_opts<'a>(
12419        &self,
12420        opts: JsonValueContentsOpts<'a>,
12421    ) -> Result<Json, DaggerError> {
12422        let mut query = self.selection.select("contents");
12423        if let Some(pretty) = opts.pretty {
12424            query = query.arg("pretty", pretty);
12425        }
12426        if let Some(indent) = opts.indent {
12427            query = query.arg("indent", indent);
12428        }
12429        query.execute(self.graphql_client.clone()).await
12430    }
12431    /// Return a new json value, decoded from the given content
12432    ///
12433    /// # Arguments
12434    ///
12435    /// * `contents` - New JSON-encoded contents
12436    pub fn with_contents(&self, contents: Json) -> JsonValue {
12437        let mut query = self.selection.select("withContents");
12438        query = query.arg("contents", contents);
12439        JsonValue {
12440            proc: self.proc.clone(),
12441            selection: query,
12442            graphql_client: self.graphql_client.clone(),
12443        }
12444    }
12445    /// Encode an integer to json
12446    ///
12447    /// # Arguments
12448    ///
12449    /// * `value` - New integer value
12450    pub fn new_integer(&self, value: isize) -> JsonValue {
12451        let mut query = self.selection.select("newInteger");
12452        query = query.arg("value", value);
12453        JsonValue {
12454            proc: self.proc.clone(),
12455            selection: query,
12456            graphql_client: self.graphql_client.clone(),
12457        }
12458    }
12459    /// Decode an integer from json
12460    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
12461        let query = self.selection.select("asInteger");
12462        query.execute(self.graphql_client.clone()).await
12463    }
12464    /// Encode a string to json
12465    ///
12466    /// # Arguments
12467    ///
12468    /// * `value` - New string value
12469    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
12470        let mut query = self.selection.select("newString");
12471        query = query.arg("value", value.into());
12472        JsonValue {
12473            proc: self.proc.clone(),
12474            selection: query,
12475            graphql_client: self.graphql_client.clone(),
12476        }
12477    }
12478    /// Decode a string from json
12479    pub async fn as_string(&self) -> Result<String, DaggerError> {
12480        let query = self.selection.select("asString");
12481        query.execute(self.graphql_client.clone()).await
12482    }
12483    /// Encode a boolean to json
12484    ///
12485    /// # Arguments
12486    ///
12487    /// * `value` - New boolean value
12488    pub fn new_boolean(&self, value: bool) -> JsonValue {
12489        let mut query = self.selection.select("newBoolean");
12490        query = query.arg("value", value);
12491        JsonValue {
12492            proc: self.proc.clone(),
12493            selection: query,
12494            graphql_client: self.graphql_client.clone(),
12495        }
12496    }
12497    /// Decode a boolean from json
12498    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
12499        let query = self.selection.select("asBoolean");
12500        query.execute(self.graphql_client.clone()).await
12501    }
12502    /// Decode an array from json
12503    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
12504        let query = self.selection.select("asArray");
12505        let query = query.select("id");
12506        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12507        Ok(ids
12508            .into_iter()
12509            .map(|id| JsonValue {
12510                proc: self.proc.clone(),
12511                selection: crate::querybuilder::query()
12512                    .select("node")
12513                    .arg("id", &id.0)
12514                    .inline_fragment("JSONValue"),
12515                graphql_client: self.graphql_client.clone(),
12516            })
12517            .collect())
12518    }
12519    /// List fields of the encoded object
12520    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
12521        let query = self.selection.select("fields");
12522        query.execute(self.graphql_client.clone()).await
12523    }
12524    /// Lookup the field at the given path, and return its value.
12525    ///
12526    /// # Arguments
12527    ///
12528    /// * `path` - Path of the field to lookup, encoded as an array of field names
12529    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
12530        let mut query = self.selection.select("field");
12531        query = query.arg(
12532            "path",
12533            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12534        );
12535        JsonValue {
12536            proc: self.proc.clone(),
12537            selection: query,
12538            graphql_client: self.graphql_client.clone(),
12539        }
12540    }
12541    /// Set a new field at the given path
12542    ///
12543    /// # Arguments
12544    ///
12545    /// * `path` - Path of the field to set, encoded as an array of field names
12546    /// * `value` - The new value of the field
12547    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
12548        let mut query = self.selection.select("withField");
12549        query = query.arg(
12550            "path",
12551            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12552        );
12553        query = query.arg_lazy(
12554            "value",
12555            Box::new(move || {
12556                let value = value.clone();
12557                Box::pin(async move { value.into_id().await.unwrap().quote() })
12558            }),
12559        );
12560        JsonValue {
12561            proc: self.proc.clone(),
12562            selection: query,
12563            graphql_client: self.graphql_client.clone(),
12564        }
12565    }
12566}
12567impl Node for JsonValue {
12568    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12569        let query = self.selection.select("id");
12570        let graphql_client = self.graphql_client.clone();
12571        async move { query.execute(graphql_client).await }
12572    }
12573}
12574#[derive(Clone)]
12575pub struct Llm {
12576    pub proc: Option<Arc<DaggerSessionProc>>,
12577    pub selection: Selection,
12578    pub graphql_client: DynGraphQLClient,
12579}
12580#[derive(Builder, Debug, PartialEq)]
12581pub struct LlmArtifactsOpts<'a> {
12582    /// Only include artifacts matching these path patterns, as with Workspace.artifacts. A path selects that path and its children.
12583    #[builder(setter(into, strip_option), default)]
12584    pub include: Option<Vec<&'a str>>,
12585}
12586#[derive(Builder, Debug, PartialEq)]
12587pub struct LlmWithModelOpts<'a> {
12588    /// 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.
12589    #[builder(setter(into, strip_option), default)]
12590    pub provider: Option<&'a str>,
12591}
12592#[derive(Builder, Debug, PartialEq)]
12593pub struct LlmWithPromptOpts {
12594    /// 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.
12595    #[builder(setter(into, strip_option), default)]
12596    pub origin: Option<LlmMessageOriginInput>,
12597}
12598#[derive(Builder, Debug, PartialEq)]
12599pub struct LlmWithContentOpts {
12600    /// The message's recorded provenance.
12601    #[builder(setter(into, strip_option), default)]
12602    pub origin: Option<LlmMessageOriginInput>,
12603}
12604#[derive(Builder, Debug, PartialEq)]
12605pub struct LlmWithContentFileOpts<'a> {
12606    /// The media MIME type; inferred from the file's contents when omitted.
12607    #[builder(setter(into, strip_option), default)]
12608    pub mime_type: Option<&'a str>,
12609}
12610#[derive(Builder, Debug, PartialEq)]
12611pub struct LlmWithResponseOpts {
12612    /// Cached input tokens read
12613    #[builder(setter(into, strip_option), default)]
12614    pub cached_token_reads: Option<isize>,
12615    /// Cached input tokens written
12616    #[builder(setter(into, strip_option), default)]
12617    pub cached_token_writes: Option<isize>,
12618    /// Uncached input tokens sent
12619    #[builder(setter(into, strip_option), default)]
12620    pub input_tokens: Option<isize>,
12621    /// Tokens received from the model, including text and tool calls
12622    #[builder(setter(into, strip_option), default)]
12623    pub output_tokens: Option<isize>,
12624    /// Total tokens consumed by this response
12625    #[builder(setter(into, strip_option), default)]
12626    pub total_tokens: Option<isize>,
12627}
12628#[derive(Builder, Debug, PartialEq)]
12629pub struct LlmWithToolResultOpts {
12630    /// Ordered text and media returned by the tool
12631    #[builder(setter(into, strip_option), default)]
12632    pub blocks: Option<Vec<LlmContentBlockInput>>,
12633}
12634#[derive(Builder, Debug, PartialEq)]
12635pub struct LlmWithToolsOpts<'a> {
12636    /// Method names to exclude from the toolset (e.g. constructors, entrypoints).
12637    #[builder(setter(into, strip_option), default)]
12638    pub except: Option<Vec<&'a str>>,
12639    /// 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.
12640    #[builder(setter(into, strip_option), default)]
12641    pub version: Option<isize>,
12642}
12643#[derive(Builder, Debug, PartialEq)]
12644pub struct LlmLoopOpts {
12645    /// Cap the number of steps. The loop fails if the cap is reached before the model ends its turn.
12646    #[builder(setter(into, strip_option), default)]
12647    pub max_steps: Option<isize>,
12648    /// Cap the model's output tokens on each step. Defaults to the model's maximum.
12649    #[builder(setter(into, strip_option), default)]
12650    pub max_tokens: Option<isize>,
12651}
12652#[derive(Builder, Debug, PartialEq)]
12653pub struct LlmStepOpts {
12654    /// Cap the model's output tokens for this step. Defaults to the model's maximum.
12655    #[builder(setter(into, strip_option), default)]
12656    pub max_tokens: Option<isize>,
12657}
12658#[derive(Builder, Debug, PartialEq)]
12659pub struct LlmSpawnOpts<'a> {
12660    /// The loop error to create the agent with, for state FAILED. Refused with any other state.
12661    #[builder(setter(into, strip_option), default)]
12662    pub error: Option<&'a str>,
12663    /// 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.
12664    #[builder(setter(into, strip_option), default)]
12665    pub handle: Option<&'a str>,
12666    /// Display label for the agent — telemetry and error messages; carries no identity. Defaults to a short name derived from the conversation.
12667    #[builder(setter(into, strip_option), default)]
12668    pub name: Option<&'a str>,
12669    /// 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.
12670    #[builder(setter(into, strip_option), default)]
12671    pub parent_handle: Option<&'a str>,
12672    /// 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.
12673    /// 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.
12674    #[builder(setter(into, strip_option), default)]
12675    pub state: Option<AgentState>,
12676}
12677impl IntoID<Id> for Llm {
12678    fn into_id(
12679        self,
12680    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12681        Box::pin(async move { self.id().await })
12682    }
12683}
12684impl Loadable for Llm {
12685    fn graphql_type() -> &'static str {
12686        "LLM"
12687    }
12688    fn from_query(
12689        proc: Option<Arc<DaggerSessionProc>>,
12690        selection: Selection,
12691        graphql_client: DynGraphQLClient,
12692    ) -> Self {
12693        Self {
12694            proc,
12695            selection,
12696            graphql_client,
12697        }
12698    }
12699}
12700impl Llm {
12701    /// A unique identifier for this LLM.
12702    pub async fn id(&self) -> Result<Id, DaggerError> {
12703        let query = self.selection.select("id");
12704        query.execute(self.graphql_client.clone()).await
12705    }
12706    /// Run expertise in list order, passing this conversation through each function. Retain existing contributions.
12707    ///
12708    /// # Arguments
12709    ///
12710    /// * `expertise` - The expertise to run. Each reference retains its source workspace.
12711    pub fn compose(&self, expertise: Vec<Id>) -> Llm {
12712        let mut query = self.selection.select("compose");
12713        query = query.arg("expertise", expertise);
12714        Llm {
12715            proc: self.proc.clone(),
12716            selection: query,
12717            graphql_client: self.graphql_client.clone(),
12718        }
12719    }
12720    /// Run expertise in list order, replacing their modules' contributions and preserving compatible tool state.
12721    /// Clear each selected module's contributions once before execution. Retain unowned contributions and contributions from other modules. Keep this LLM's workspace.
12722    /// A change to a tool binding's version resets its state. Removed bindings, changed identities, and incompatible state are errors.
12723    ///
12724    /// # Arguments
12725    ///
12726    /// * `expertise` - The expertise to run. Each reference retains its source workspace.
12727    pub fn recompose(&self, expertise: Vec<Id>) -> Llm {
12728        let mut query = self.selection.select("recompose");
12729        query = query.arg("expertise", expertise);
12730        Llm {
12731            proc: self.proc.clone(),
12732            selection: query,
12733            graphql_client: self.graphql_client.clone(),
12734        }
12735    }
12736    /// The model the conversation is running against, after resolving any configured default.
12737    pub async fn model(&self) -> Result<String, DaggerError> {
12738        let query = self.selection.select("model");
12739        query.execute(self.graphql_client.clone()).await
12740    }
12741    /// The provider serving the model, e.g. "anthropic", "openai", "google", or "local".
12742    pub async fn provider(&self) -> Result<String, DaggerError> {
12743        let query = self.selection.select("provider");
12744        query.execute(self.graphql_client.clone()).await
12745    }
12746    /// The model's total context window in tokens, or null if unknown (e.g. a local or uncatalogued model).
12747    pub async fn context_window(&self) -> Result<isize, DaggerError> {
12748        let query = self.selection.select("contextWindow");
12749        query.execute(self.graphql_client.clone()).await
12750    }
12751    /// The full message history, as structured messages.
12752    pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
12753        let query = self.selection.select("messages");
12754        let query = query.select("id");
12755        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12756        Ok(ids
12757            .into_iter()
12758            .map(|id| LlmMessage {
12759                proc: self.proc.clone(),
12760                selection: crate::querybuilder::query()
12761                    .select("node")
12762                    .arg("id", &id.0)
12763                    .inline_fragment("LLMMessage"),
12764                graphql_client: self.graphql_client.clone(),
12765            })
12766            .collect())
12767    }
12768    /// The message history rendered as a plain-text transcript, suitable for feeding back to an LLM (e.g. for summarization).
12769    pub async fn transcript(&self) -> Result<String, DaggerError> {
12770        let query = self.selection.select("transcript");
12771        query.execute(self.graphql_client.clone()).await
12772    }
12773    /// Clear the message history, keeping only the system prompts.
12774    pub fn without_message_history(&self) -> Llm {
12775        let query = self.selection.select("withoutMessageHistory");
12776        Llm {
12777            proc: self.proc.clone(),
12778            selection: query,
12779            graphql_client: self.graphql_client.clone(),
12780        }
12781    }
12782    /// Clear the user-added system prompts, keeping only the default system prompt.
12783    pub fn without_system_prompts(&self) -> Llm {
12784        let query = self.selection.select("withoutSystemPrompts");
12785        Llm {
12786            proc: self.proc.clone(),
12787            selection: query,
12788            graphql_client: self.graphql_client.clone(),
12789        }
12790    }
12791    /// The text of the model's most recent reply.
12792    pub async fn last_reply(&self) -> Result<String, DaggerError> {
12793        let query = self.selection.select("lastReply");
12794        query.execute(self.graphql_client.clone()).await
12795    }
12796    /// Bind the LLM to a workspace, exposing its modules as tools exactly as the Dagger CLI would serve them for that workspace.
12797    ///
12798    /// # Arguments
12799    ///
12800    /// * `workspace` - The workspace to work in.
12801    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
12802        let mut query = self.selection.select("withWorkspace");
12803        query = query.arg_lazy(
12804            "workspace",
12805            Box::new(move || {
12806                let workspace = workspace.clone();
12807                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
12808            }),
12809        );
12810        Llm {
12811            proc: self.proc.clone(),
12812            selection: query,
12813            graphql_client: self.graphql_client.clone(),
12814        }
12815    }
12816    /// Return the workspace the LLM is bound to.
12817    pub fn workspace(&self) -> Workspace {
12818        let query = self.selection.select("workspace");
12819        Workspace {
12820            proc: self.proc.clone(),
12821            selection: query,
12822            graphql_client: self.graphql_client.clone(),
12823        }
12824    }
12825    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
12826    /// 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.
12827    /// 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.
12828    /// 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.
12829    ///
12830    /// # Arguments
12831    ///
12832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12833    pub fn artifacts(&self) -> Artifacts {
12834        let query = self.selection.select("artifacts");
12835        Artifacts {
12836            proc: self.proc.clone(),
12837            selection: query,
12838            graphql_client: self.graphql_client.clone(),
12839        }
12840    }
12841    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
12842    /// 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.
12843    /// 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.
12844    /// 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.
12845    ///
12846    /// # Arguments
12847    ///
12848    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12849    pub fn artifacts_opts<'a>(&self, opts: LlmArtifactsOpts<'a>) -> Artifacts {
12850        let mut query = self.selection.select("artifacts");
12851        if let Some(include) = opts.include {
12852            query = query.arg("include", include);
12853        }
12854        Artifacts {
12855            proc: self.proc.clone(),
12856            selection: query,
12857            graphql_client: self.graphql_client.clone(),
12858        }
12859    }
12860    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
12861    ///
12862    /// # Arguments
12863    ///
12864    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
12865    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12866    pub fn with_model(&self, model: impl Into<String>) -> Llm {
12867        let mut query = self.selection.select("withModel");
12868        query = query.arg("model", model.into());
12869        Llm {
12870            proc: self.proc.clone(),
12871            selection: query,
12872            graphql_client: self.graphql_client.clone(),
12873        }
12874    }
12875    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
12876    ///
12877    /// # Arguments
12878    ///
12879    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
12880    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12881    pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
12882        let mut query = self.selection.select("withModel");
12883        query = query.arg("model", model.into());
12884        if let Some(provider) = opts.provider {
12885            query = query.arg("provider", provider);
12886        }
12887        Llm {
12888            proc: self.proc.clone(),
12889            selection: query,
12890            graphql_client: self.graphql_client.clone(),
12891        }
12892    }
12893    /// 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.
12894    pub fn with_small_model(&self) -> Llm {
12895        let query = self.selection.select("withSmallModel");
12896        Llm {
12897            proc: self.proc.clone(),
12898            selection: query,
12899            graphql_client: self.graphql_client.clone(),
12900        }
12901    }
12902    /// The reasoning effort in use, e.g. "low", "medium", or "high". Empty or "none" when reasoning is disabled.
12903    pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
12904        let query = self.selection.select("reasoningEffort");
12905        query.execute(self.graphql_client.clone()).await
12906    }
12907    /// 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.
12908    ///
12909    /// # Arguments
12910    ///
12911    /// * `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".
12912    pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
12913        let mut query = self.selection.select("withReasoningEffort");
12914        query = query.arg("effort", effort.into());
12915        Llm {
12916            proc: self.proc.clone(),
12917            selection: query,
12918            graphql_client: self.graphql_client.clone(),
12919        }
12920    }
12921    /// Queue a user prompt, to be sent to the model on the next step or loop.
12922    ///
12923    /// # Arguments
12924    ///
12925    /// * `prompt` - The prompt to send
12926    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12927    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
12928        let mut query = self.selection.select("withPrompt");
12929        query = query.arg("prompt", prompt.into());
12930        Llm {
12931            proc: self.proc.clone(),
12932            selection: query,
12933            graphql_client: self.graphql_client.clone(),
12934        }
12935    }
12936    /// Queue a user prompt, to be sent to the model on the next step or loop.
12937    ///
12938    /// # Arguments
12939    ///
12940    /// * `prompt` - The prompt to send
12941    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12942    pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
12943        let mut query = self.selection.select("withPrompt");
12944        query = query.arg("prompt", prompt.into());
12945        if let Some(origin) = opts.origin {
12946            query = query.arg("origin", origin);
12947        }
12948        Llm {
12949            proc: self.proc.clone(),
12950            selection: query,
12951            graphql_client: self.graphql_client.clone(),
12952        }
12953    }
12954    /// Queue one user message containing ordered text and media blocks.
12955    ///
12956    /// # Arguments
12957    ///
12958    /// * `content` - The ordered message content.
12959    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12960    pub fn with_content(&self, content: Vec<LlmContentBlockInput>) -> Llm {
12961        let mut query = self.selection.select("withContent");
12962        query = query.arg("content", content);
12963        Llm {
12964            proc: self.proc.clone(),
12965            selection: query,
12966            graphql_client: self.graphql_client.clone(),
12967        }
12968    }
12969    /// Queue one user message containing ordered text and media blocks.
12970    ///
12971    /// # Arguments
12972    ///
12973    /// * `content` - The ordered message content.
12974    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12975    pub fn with_content_opts(
12976        &self,
12977        content: Vec<LlmContentBlockInput>,
12978        opts: LlmWithContentOpts,
12979    ) -> Llm {
12980        let mut query = self.selection.select("withContent");
12981        query = query.arg("content", content);
12982        if let Some(origin) = opts.origin {
12983            query = query.arg("origin", origin);
12984        }
12985        Llm {
12986            proc: self.proc.clone(),
12987            selection: query,
12988            graphql_client: self.graphql_client.clone(),
12989        }
12990    }
12991    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
12992    ///
12993    /// # Arguments
12994    ///
12995    /// * `file` - The media file.
12996    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12997    pub fn with_content_file(&self, file: impl IntoID<Id>) -> Llm {
12998        let mut query = self.selection.select("withContentFile");
12999        query = query.arg_lazy(
13000            "file",
13001            Box::new(move || {
13002                let file = file.clone();
13003                Box::pin(async move { file.into_id().await.unwrap().quote() })
13004            }),
13005        );
13006        Llm {
13007            proc: self.proc.clone(),
13008            selection: query,
13009            graphql_client: self.graphql_client.clone(),
13010        }
13011    }
13012    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
13013    ///
13014    /// # Arguments
13015    ///
13016    /// * `file` - The media file.
13017    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13018    pub fn with_content_file_opts<'a>(
13019        &self,
13020        file: impl IntoID<Id>,
13021        opts: LlmWithContentFileOpts<'a>,
13022    ) -> Llm {
13023        let mut query = self.selection.select("withContentFile");
13024        query = query.arg_lazy(
13025            "file",
13026            Box::new(move || {
13027                let file = file.clone();
13028                Box::pin(async move { file.into_id().await.unwrap().quote() })
13029            }),
13030        );
13031        if let Some(mime_type) = opts.mime_type {
13032            query = query.arg("mimeType", mime_type);
13033        }
13034        Llm {
13035            proc: self.proc.clone(),
13036            selection: query,
13037            graphql_client: self.graphql_client.clone(),
13038        }
13039    }
13040    /// Queue a file's contents as a user prompt, like withPrompt.
13041    ///
13042    /// # Arguments
13043    ///
13044    /// * `file` - The file to read the prompt from
13045    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
13046        let mut query = self.selection.select("withPromptFile");
13047        query = query.arg_lazy(
13048            "file",
13049            Box::new(move || {
13050                let file = file.clone();
13051                Box::pin(async move { file.into_id().await.unwrap().quote() })
13052            }),
13053        );
13054        Llm {
13055            proc: self.proc.clone(),
13056            selection: query,
13057            graphql_client: self.graphql_client.clone(),
13058        }
13059    }
13060    /// Add a system prompt, instructing the model across the whole conversation.
13061    ///
13062    /// # Arguments
13063    ///
13064    /// * `prompt` - The system prompt to send
13065    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
13066        let mut query = self.selection.select("withSystemPrompt");
13067        query = query.arg("prompt", prompt.into());
13068        Llm {
13069            proc: self.proc.clone(),
13070            selection: query,
13071            graphql_client: self.graphql_client.clone(),
13072        }
13073    }
13074    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
13075    ///
13076    /// # Arguments
13077    ///
13078    /// * `content` - The response content
13079    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13080    pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13081        let mut query = self.selection.select("withResponse");
13082        query = query.arg("content", content);
13083        Llm {
13084            proc: self.proc.clone(),
13085            selection: query,
13086            graphql_client: self.graphql_client.clone(),
13087        }
13088    }
13089    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
13090    ///
13091    /// # Arguments
13092    ///
13093    /// * `content` - The response content
13094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13095    pub fn with_response_opts(
13096        &self,
13097        content: Vec<LlmContentBlockInput>,
13098        opts: LlmWithResponseOpts,
13099    ) -> Llm {
13100        let mut query = self.selection.select("withResponse");
13101        query = query.arg("content", content);
13102        if let Some(input_tokens) = opts.input_tokens {
13103            query = query.arg("inputTokens", input_tokens);
13104        }
13105        if let Some(output_tokens) = opts.output_tokens {
13106            query = query.arg("outputTokens", output_tokens);
13107        }
13108        if let Some(cached_token_reads) = opts.cached_token_reads {
13109            query = query.arg("cachedTokenReads", cached_token_reads);
13110        }
13111        if let Some(cached_token_writes) = opts.cached_token_writes {
13112            query = query.arg("cachedTokenWrites", cached_token_writes);
13113        }
13114        if let Some(total_tokens) = opts.total_tokens {
13115            query = query.arg("totalTokens", total_tokens);
13116        }
13117        Llm {
13118            proc: self.proc.clone(),
13119            selection: query,
13120            graphql_client: self.graphql_client.clone(),
13121        }
13122    }
13123    /// Append the result of a tool call to the message history.
13124    ///
13125    /// # Arguments
13126    ///
13127    /// * `call_id` - The ID of the tool call this result responds to
13128    /// * `content` - Text returned by the tool, placed before blocks
13129    /// * `errored` - Whether the tool call resulted in an error
13130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13131    pub fn with_tool_result(
13132        &self,
13133        call_id: impl Into<String>,
13134        content: impl Into<String>,
13135        errored: bool,
13136    ) -> Llm {
13137        let mut query = self.selection.select("withToolResult");
13138        query = query.arg("callId", call_id.into());
13139        query = query.arg("content", content.into());
13140        query = query.arg("errored", errored);
13141        Llm {
13142            proc: self.proc.clone(),
13143            selection: query,
13144            graphql_client: self.graphql_client.clone(),
13145        }
13146    }
13147    /// Append the result of a tool call to the message history.
13148    ///
13149    /// # Arguments
13150    ///
13151    /// * `call_id` - The ID of the tool call this result responds to
13152    /// * `content` - Text returned by the tool, placed before blocks
13153    /// * `errored` - Whether the tool call resulted in an error
13154    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13155    pub fn with_tool_result_opts(
13156        &self,
13157        call_id: impl Into<String>,
13158        content: impl Into<String>,
13159        errored: bool,
13160        opts: LlmWithToolResultOpts,
13161    ) -> Llm {
13162        let mut query = self.selection.select("withToolResult");
13163        query = query.arg("callId", call_id.into());
13164        query = query.arg("content", content.into());
13165        query = query.arg("errored", errored);
13166        if let Some(blocks) = opts.blocks {
13167            query = query.arg("blocks", blocks);
13168        }
13169        Llm {
13170            proc: self.proc.clone(),
13171            selection: query,
13172            graphql_client: self.graphql_client.clone(),
13173        }
13174    }
13175    /// 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.
13176    ///
13177    /// # Arguments
13178    ///
13179    /// * `object` - The object whose methods become tools.
13180    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13181    pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
13182        let mut query = self.selection.select("withTools");
13183        query = query.arg_lazy(
13184            "object",
13185            Box::new(move || {
13186                let object = object.clone();
13187                Box::pin(async move { object.into_id().await.unwrap().quote() })
13188            }),
13189        );
13190        Llm {
13191            proc: self.proc.clone(),
13192            selection: query,
13193            graphql_client: self.graphql_client.clone(),
13194        }
13195    }
13196    /// Expose an object's methods as tools. Every eligible method of the bound object becomes a tool; a tool that returns this object's own type replaces it as the new state. Repeatable to bind several objects.
13197    ///
13198    /// # Arguments
13199    ///
13200    /// * `object` - The object whose methods become tools.
13201    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13202    pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
13203        let mut query = self.selection.select("withTools");
13204        query = query.arg_lazy(
13205            "object",
13206            Box::new(move || {
13207                let object = object.clone();
13208                Box::pin(async move { object.into_id().await.unwrap().quote() })
13209            }),
13210        );
13211        if let Some(except) = opts.except {
13212            query = query.arg("except", except);
13213        }
13214        if let Some(version) = opts.version {
13215            query = query.arg("version", version);
13216        }
13217        Llm {
13218            proc: self.proc.clone(),
13219            selection: query,
13220            graphql_client: self.graphql_client.clone(),
13221        }
13222    }
13223    /// Disable the default system prompt
13224    pub fn without_default_system_prompt(&self) -> Llm {
13225        let query = self.selection.select("withoutDefaultSystemPrompt");
13226        Llm {
13227            proc: self.proc.clone(),
13228            selection: query,
13229            graphql_client: self.graphql_client.clone(),
13230        }
13231    }
13232    /// Add an external MCP server to the LLM
13233    ///
13234    /// # Arguments
13235    ///
13236    /// * `name` - The name of the MCP server
13237    /// * `service` - The MCP service to run and communicate with over stdio
13238    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
13239        let mut query = self.selection.select("withMCPServer");
13240        query = query.arg("name", name.into());
13241        query = query.arg_lazy(
13242            "service",
13243            Box::new(move || {
13244                let service = service.clone();
13245                Box::pin(async move { service.into_id().await.unwrap().quote() })
13246            }),
13247        );
13248        Llm {
13249            proc: self.proc.clone(),
13250            selection: query,
13251            graphql_client: self.graphql_client.clone(),
13252        }
13253    }
13254    /// 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.
13255    ///
13256    /// # Arguments
13257    ///
13258    /// * `directory` - A directory containing skills, each a subdirectory holding a SKILL.md.
13259    pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
13260        let mut query = self.selection.select("withSkills");
13261        query = query.arg_lazy(
13262            "directory",
13263            Box::new(move || {
13264                let directory = directory.clone();
13265                Box::pin(async move { directory.into_id().await.unwrap().quote() })
13266            }),
13267        );
13268        Llm {
13269            proc: self.proc.clone(),
13270            selection: query,
13271            graphql_client: self.graphql_client.clone(),
13272        }
13273    }
13274    /// 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.
13275    pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
13276        let query = self.selection.select("skills");
13277        let query = query.select("id");
13278        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13279        Ok(ids
13280            .into_iter()
13281            .map(|id| LlmSkill {
13282                proc: self.proc.clone(),
13283                selection: crate::querybuilder::query()
13284                    .select("node")
13285                    .arg("id", &id.0)
13286                    .inline_fragment("LLMSkill"),
13287                graphql_client: self.graphql_client.clone(),
13288            })
13289            .collect())
13290    }
13291    /// Force evaluation of the conversation's pending operations (prompts, steps, loops) in the engine.
13292    pub async fn sync(&self) -> Result<Llm, DaggerError> {
13293        let query = self.selection.select("sync");
13294        let id: Id = query.execute(self.graphql_client.clone()).await?;
13295        Ok(Llm {
13296            proc: self.proc.clone(),
13297            selection: query
13298                .root()
13299                .select("node")
13300                .arg("id", &id.0)
13301                .inline_fragment("LLM"),
13302            graphql_client: self.graphql_client.clone(),
13303        })
13304    }
13305    /// 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.
13306    ///
13307    /// # Arguments
13308    ///
13309    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13310    pub fn r#loop(&self) -> Llm {
13311        let query = self.selection.select("loop");
13312        Llm {
13313            proc: self.proc.clone(),
13314            selection: query,
13315            graphql_client: self.graphql_client.clone(),
13316        }
13317    }
13318    /// 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.
13319    ///
13320    /// # Arguments
13321    ///
13322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13323    pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
13324        let mut query = self.selection.select("loop");
13325        if let Some(max_steps) = opts.max_steps {
13326            query = query.arg("maxSteps", max_steps);
13327        }
13328        if let Some(max_tokens) = opts.max_tokens {
13329            query = query.arg("maxTokens", max_tokens);
13330        }
13331        Llm {
13332            proc: self.proc.clone(),
13333            selection: query,
13334            graphql_client: self.graphql_client.clone(),
13335        }
13336    }
13337    /// 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.
13338    ///
13339    /// # Arguments
13340    ///
13341    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13342    pub fn step(&self) -> Llm {
13343        let query = self.selection.select("step");
13344        Llm {
13345            proc: self.proc.clone(),
13346            selection: query,
13347            graphql_client: self.graphql_client.clone(),
13348        }
13349    }
13350    /// 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.
13351    ///
13352    /// # Arguments
13353    ///
13354    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13355    pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
13356        let mut query = self.selection.select("step");
13357        if let Some(max_tokens) = opts.max_tokens {
13358            query = query.arg("maxTokens", max_tokens);
13359        }
13360        Llm {
13361            proc: self.proc.clone(),
13362            selection: query,
13363            graphql_client: self.graphql_client.clone(),
13364        }
13365    }
13366    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13367    /// 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.
13368    /// 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.
13369    /// 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.
13370    ///
13371    /// # Arguments
13372    ///
13373    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13374    pub async fn spawn(&self) -> Result<Agent, DaggerError> {
13375        let query = self.selection.select("spawn");
13376        let id: Id = query.execute(self.graphql_client.clone()).await?;
13377        Ok(Agent {
13378            proc: self.proc.clone(),
13379            selection: query
13380                .root()
13381                .select("node")
13382                .arg("id", &id.0)
13383                .inline_fragment("Agent"),
13384            graphql_client: self.graphql_client.clone(),
13385        })
13386    }
13387    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13388    /// Every spawn mints a unique agent instance — two spawns of an identical conversation are two distinct agents, like two calls to a process spawn. The result is pinned to the instance (via the agent lookup field), so re-loading its ID re-addresses the same agent from any request in the session.
13389    /// The loop is not started: the agent spends nothing until it is prompted or resumed, and any input pending on the conversation is stepped then.
13390    /// With a handle, spawn restores an instance instead of minting one: this conversation becomes the committed history of the agent that handle names, so prompting it continues where it left off — rebuild a conversation's ID from a trace, load it, and spawn it under the handle it belonged to. Fails if that instance already has a runtime entry in this session: a restore must happen before anything else addresses the instance, since by then it may have stepped.
13391    ///
13392    /// # Arguments
13393    ///
13394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13395    pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
13396        let mut query = self.selection.select("spawn");
13397        if let Some(name) = opts.name {
13398            query = query.arg("name", name);
13399        }
13400        if let Some(handle) = opts.handle {
13401            query = query.arg("handle", handle);
13402        }
13403        if let Some(state) = opts.state {
13404            query = query.arg("state", state);
13405        }
13406        if let Some(parent_handle) = opts.parent_handle {
13407            query = query.arg("parentHandle", parent_handle);
13408        }
13409        if let Some(error) = opts.error {
13410            query = query.arg("error", error);
13411        }
13412        let id: Id = query.execute(self.graphql_client.clone()).await?;
13413        Ok(Agent {
13414            proc: self.proc.clone(),
13415            selection: query
13416                .root()
13417                .select("node")
13418                .arg("id", &id.0)
13419                .inline_fragment("Agent"),
13420            graphql_client: self.graphql_client.clone(),
13421        })
13422    }
13423    /// Reconstruct a spawned agent from its runtime handle.
13424    /// 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.
13425    ///
13426    /// # Arguments
13427    ///
13428    /// * `handle` - The opaque runtime handle minted by the spawn that created the agent.
13429    /// * `name` - The agent's display name, as recorded by the spawn.
13430    pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
13431        let mut query = self.selection.select("agent");
13432        query = query.arg("handle", handle.into());
13433        query = query.arg("name", name.into());
13434        Agent {
13435            proc: self.proc.clone(),
13436            selection: query,
13437            graphql_client: self.graphql_client.clone(),
13438        }
13439    }
13440    /// 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.
13441    pub async fn has_pending(&self) -> Result<bool, DaggerError> {
13442        let query = self.selection.select("hasPending");
13443        query.execute(self.graphql_client.clone()).await
13444    }
13445    /// Fork the conversation, so that otherwise-identical follow-ups evaluate independently instead of deduplicating to a single cached result.
13446    ///
13447    /// # Arguments
13448    ///
13449    /// * `label` - A label distinguishing this fork from its siblings, e.g. "attempt-2" when retrying a flaky evaluation.
13450    pub fn fork(&self, label: impl Into<String>) -> Llm {
13451        let mut query = self.selection.select("fork");
13452        query = query.arg("label", label.into());
13453        Llm {
13454            proc: self.proc.clone(),
13455            selection: query,
13456            graphql_client: self.graphql_client.clone(),
13457        }
13458    }
13459    /// Render documentation for the tools currently exposed to the model.
13460    pub async fn tools(&self) -> Result<String, DaggerError> {
13461        let query = self.selection.select("tools");
13462        query.execute(self.graphql_client.clone()).await
13463    }
13464    /// The cumulative token usage, summed across every API call in the conversation.
13465    pub fn token_usage(&self) -> LlmTokenUsage {
13466        let query = self.selection.select("tokenUsage");
13467        LlmTokenUsage {
13468            proc: self.proc.clone(),
13469            selection: query,
13470            graphql_client: self.graphql_client.clone(),
13471        }
13472    }
13473    /// estimated number of tokens currently occupying the context window; unlike tokenUsage this is not cumulative over the session
13474    pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
13475        let query = self.selection.select("contextTokens");
13476        query.execute(self.graphql_client.clone()).await
13477    }
13478}
13479impl Node for Llm {
13480    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13481        let query = self.selection.select("id");
13482        let graphql_client = self.graphql_client.clone();
13483        async move { query.execute(graphql_client).await }
13484    }
13485}
13486impl Syncer for Llm {
13487    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13488        let query = self.selection.select("id");
13489        let graphql_client = self.graphql_client.clone();
13490        async move { query.execute(graphql_client).await }
13491    }
13492    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13493        let query = self.selection.select("sync");
13494        let proc = self.proc.clone();
13495        let graphql_client = self.graphql_client.clone();
13496        async move {
13497            let id: Id = query.execute(graphql_client.clone()).await?;
13498            Ok(Self {
13499                proc,
13500                selection: query
13501                    .root()
13502                    .select("node")
13503                    .arg("id", &id.0)
13504                    .inline_fragment("LLM"),
13505                graphql_client,
13506            })
13507        }
13508    }
13509}
13510#[derive(Clone)]
13511pub struct LlmContent {
13512    pub proc: Option<Arc<DaggerSessionProc>>,
13513    pub selection: Selection,
13514    pub graphql_client: DynGraphQLClient,
13515}
13516#[derive(Builder, Debug, PartialEq)]
13517pub struct LlmContentWithFileOpts<'a> {
13518    /// The media MIME type, e.g. "image/png". Inferred from the file's contents when omitted.
13519    #[builder(setter(into, strip_option), default)]
13520    pub mime_type: Option<&'a str>,
13521}
13522impl IntoID<Id> for LlmContent {
13523    fn into_id(
13524        self,
13525    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13526        Box::pin(async move { self.id().await })
13527    }
13528}
13529impl Loadable for LlmContent {
13530    fn graphql_type() -> &'static str {
13531        "LLMContent"
13532    }
13533    fn from_query(
13534        proc: Option<Arc<DaggerSessionProc>>,
13535        selection: Selection,
13536        graphql_client: DynGraphQLClient,
13537    ) -> Self {
13538        Self {
13539            proc,
13540            selection,
13541            graphql_client,
13542        }
13543    }
13544}
13545impl LlmContent {
13546    /// A unique identifier for this LLMContent.
13547    pub async fn id(&self) -> Result<Id, DaggerError> {
13548        let query = self.selection.select("id");
13549        query.execute(self.graphql_client.clone()).await
13550    }
13551    /// Append a block of text.
13552    ///
13553    /// # Arguments
13554    ///
13555    /// * `text` - The text.
13556    pub fn with_text(&self, text: impl Into<String>) -> LlmContent {
13557        let mut query = self.selection.select("withText");
13558        query = query.arg("text", text.into());
13559        LlmContent {
13560            proc: self.proc.clone(),
13561            selection: query,
13562            graphql_client: self.graphql_client.clone(),
13563        }
13564    }
13565    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13566    ///
13567    /// # Arguments
13568    ///
13569    /// * `file` - The media file. Its contents become the block's inline bytes.
13570    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13571    pub fn with_file(&self, file: impl IntoID<Id>) -> LlmContent {
13572        let mut query = self.selection.select("withFile");
13573        query = query.arg_lazy(
13574            "file",
13575            Box::new(move || {
13576                let file = file.clone();
13577                Box::pin(async move { file.into_id().await.unwrap().quote() })
13578            }),
13579        );
13580        LlmContent {
13581            proc: self.proc.clone(),
13582            selection: query,
13583            graphql_client: self.graphql_client.clone(),
13584        }
13585    }
13586    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13587    ///
13588    /// # Arguments
13589    ///
13590    /// * `file` - The media file. Its contents become the block's inline bytes.
13591    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13592    pub fn with_file_opts<'a>(
13593        &self,
13594        file: impl IntoID<Id>,
13595        opts: LlmContentWithFileOpts<'a>,
13596    ) -> LlmContent {
13597        let mut query = self.selection.select("withFile");
13598        query = query.arg_lazy(
13599            "file",
13600            Box::new(move || {
13601                let file = file.clone();
13602                Box::pin(async move { file.into_id().await.unwrap().quote() })
13603            }),
13604        );
13605        if let Some(mime_type) = opts.mime_type {
13606            query = query.arg("mimeType", mime_type);
13607        }
13608        LlmContent {
13609            proc: self.proc.clone(),
13610            selection: query,
13611            graphql_client: self.graphql_client.clone(),
13612        }
13613    }
13614    /// Append image, audio, or PDF bytes as an inline media block. The media kind follows the MIME type.
13615    /// Prefer withFile for anything but small payloads: the bytes become part of the content's identity, so they travel with every reference to it.
13616    ///
13617    /// # Arguments
13618    ///
13619    /// * `data` - The media bytes.
13620    /// * `mime_type` - The media MIME type, e.g. "image/png".
13621    pub fn with_data(&self, data: Bytes, mime_type: impl Into<String>) -> LlmContent {
13622        let mut query = self.selection.select("withData");
13623        query = query.arg("data", data);
13624        query = query.arg("mimeType", mime_type.into());
13625        LlmContent {
13626            proc: self.proc.clone(),
13627            selection: query,
13628            graphql_client: self.graphql_client.clone(),
13629        }
13630    }
13631    /// The ordered text and media blocks.
13632    pub async fn blocks(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13633        let query = self.selection.select("blocks");
13634        let query = query.select("id");
13635        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13636        Ok(ids
13637            .into_iter()
13638            .map(|id| LlmContentBlock {
13639                proc: self.proc.clone(),
13640                selection: crate::querybuilder::query()
13641                    .select("node")
13642                    .arg("id", &id.0)
13643                    .inline_fragment("LLMContentBlock"),
13644                graphql_client: self.graphql_client.clone(),
13645            })
13646            .collect())
13647    }
13648}
13649impl Node for LlmContent {
13650    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13651        let query = self.selection.select("id");
13652        let graphql_client = self.graphql_client.clone();
13653        async move { query.execute(graphql_client).await }
13654    }
13655}
13656#[derive(Clone)]
13657pub struct LlmContentBlock {
13658    pub proc: Option<Arc<DaggerSessionProc>>,
13659    pub selection: Selection,
13660    pub graphql_client: DynGraphQLClient,
13661}
13662impl IntoID<Id> for LlmContentBlock {
13663    fn into_id(
13664        self,
13665    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13666        Box::pin(async move { self.id().await })
13667    }
13668}
13669impl Loadable for LlmContentBlock {
13670    fn graphql_type() -> &'static str {
13671        "LLMContentBlock"
13672    }
13673    fn from_query(
13674        proc: Option<Arc<DaggerSessionProc>>,
13675        selection: Selection,
13676        graphql_client: DynGraphQLClient,
13677    ) -> Self {
13678        Self {
13679            proc,
13680            selection,
13681            graphql_client,
13682        }
13683    }
13684}
13685impl LlmContentBlock {
13686    /// A unique identifier for this LLMContentBlock.
13687    pub async fn id(&self) -> Result<Id, DaggerError> {
13688        let query = self.selection.select("id");
13689        query.execute(self.graphql_client.clone()).await
13690    }
13691    /// The kind of content block, which determines the other populated fields.
13692    pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
13693        let query = self.selection.select("kind");
13694        query.execute(self.graphql_client.clone()).await
13695    }
13696    /// Text content (for TEXT, THINKING, or TOOL_RESULT kinds).
13697    pub async fn text(&self) -> Result<String, DaggerError> {
13698        let query = self.selection.select("text");
13699        query.execute(self.graphql_client.clone()).await
13700    }
13701    /// The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
13702    pub async fn call_id(&self) -> Result<String, DaggerError> {
13703        let query = self.selection.select("callId");
13704        query.execute(self.graphql_client.clone()).await
13705    }
13706    /// The name of the tool called (for TOOL_CALL kind).
13707    pub async fn tool_name(&self) -> Result<String, DaggerError> {
13708        let query = self.selection.select("toolName");
13709        query.execute(self.graphql_client.clone()).await
13710    }
13711    /// The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).
13712    pub async fn arguments(&self) -> Result<Json, DaggerError> {
13713        let query = self.selection.select("arguments");
13714        query.execute(self.graphql_client.clone()).await
13715    }
13716    /// Whether the tool call resulted in an error (for TOOL_RESULT kind).
13717    pub async fn errored(&self) -> Result<bool, DaggerError> {
13718        let query = self.selection.select("errored");
13719        query.execute(self.graphql_client.clone()).await
13720    }
13721    /// The media MIME type (for IMAGE, AUDIO, or DOCUMENT kinds).
13722    pub async fn mime_type(&self) -> Result<String, DaggerError> {
13723        let query = self.selection.select("mimeType");
13724        query.execute(self.graphql_client.clone()).await
13725    }
13726    /// The media bytes (for IMAGE, AUDIO, or DOCUMENT kinds).
13727    pub async fn data(&self) -> Result<Bytes, DaggerError> {
13728        let query = self.selection.select("data");
13729        query.execute(self.graphql_client.clone()).await
13730    }
13731    /// Ordered content returned by a tool, following any text (for TOOL_RESULT kind).
13732    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13733        let query = self.selection.select("content");
13734        let query = query.select("id");
13735        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13736        Ok(ids
13737            .into_iter()
13738            .map(|id| LlmContentBlock {
13739                proc: self.proc.clone(),
13740                selection: crate::querybuilder::query()
13741                    .select("node")
13742                    .arg("id", &id.0)
13743                    .inline_fragment("LLMContentBlock"),
13744                graphql_client: self.graphql_client.clone(),
13745            })
13746            .collect())
13747    }
13748    /// Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.
13749    pub async fn signature(&self) -> Result<String, DaggerError> {
13750        let query = self.selection.select("signature");
13751        query.execute(self.graphql_client.clone()).await
13752    }
13753}
13754impl Node for LlmContentBlock {
13755    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13756        let query = self.selection.select("id");
13757        let graphql_client = self.graphql_client.clone();
13758        async move { query.execute(graphql_client).await }
13759    }
13760}
13761#[derive(Clone)]
13762pub struct LlmMessage {
13763    pub proc: Option<Arc<DaggerSessionProc>>,
13764    pub selection: Selection,
13765    pub graphql_client: DynGraphQLClient,
13766}
13767impl IntoID<Id> for LlmMessage {
13768    fn into_id(
13769        self,
13770    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13771        Box::pin(async move { self.id().await })
13772    }
13773}
13774impl Loadable for LlmMessage {
13775    fn graphql_type() -> &'static str {
13776        "LLMMessage"
13777    }
13778    fn from_query(
13779        proc: Option<Arc<DaggerSessionProc>>,
13780        selection: Selection,
13781        graphql_client: DynGraphQLClient,
13782    ) -> Self {
13783        Self {
13784            proc,
13785            selection,
13786            graphql_client,
13787        }
13788    }
13789}
13790impl LlmMessage {
13791    /// A unique identifier for this LLMMessage.
13792    pub async fn id(&self) -> Result<Id, DaggerError> {
13793        let query = self.selection.select("id");
13794        query.execute(self.graphql_client.clone()).await
13795    }
13796    /// Who put this message on the record, when it arrived through an agent mailbox.
13797    /// Null for the user's own prompts and for everything the model or tools produced.
13798    pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
13799        let query = self.selection.select("origin");
13800        let query = query.select("id");
13801        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13802        Ok(id.map(|id| LlmMessageOrigin {
13803            proc: self.proc.clone(),
13804            selection: query
13805                .root()
13806                .select("node")
13807                .arg("id", &id.0)
13808                .inline_fragment("LLMMessageOrigin"),
13809            graphql_client: self.graphql_client.clone(),
13810        }))
13811    }
13812    /// The role that produced this message.
13813    pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
13814        let query = self.selection.select("role");
13815        query.execute(self.graphql_client.clone()).await
13816    }
13817    /// The message's content blocks, in the order the model produced them.
13818    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13819        let query = self.selection.select("content");
13820        let query = query.select("id");
13821        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13822        Ok(ids
13823            .into_iter()
13824            .map(|id| LlmContentBlock {
13825                proc: self.proc.clone(),
13826                selection: crate::querybuilder::query()
13827                    .select("node")
13828                    .arg("id", &id.0)
13829                    .inline_fragment("LLMContentBlock"),
13830                graphql_client: self.graphql_client.clone(),
13831            })
13832            .collect())
13833    }
13834    /// Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.
13835    pub fn token_usage(&self) -> LlmTokenUsage {
13836        let query = self.selection.select("tokenUsage");
13837        LlmTokenUsage {
13838            proc: self.proc.clone(),
13839            selection: query,
13840            graphql_client: self.graphql_client.clone(),
13841        }
13842    }
13843}
13844impl Node for LlmMessage {
13845    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13846        let query = self.selection.select("id");
13847        let graphql_client = self.graphql_client.clone();
13848        async move { query.execute(graphql_client).await }
13849    }
13850}
13851#[derive(Clone)]
13852pub struct LlmMessageOrigin {
13853    pub proc: Option<Arc<DaggerSessionProc>>,
13854    pub selection: Selection,
13855    pub graphql_client: DynGraphQLClient,
13856}
13857impl IntoID<Id> for LlmMessageOrigin {
13858    fn into_id(
13859        self,
13860    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13861        Box::pin(async move { self.id().await })
13862    }
13863}
13864impl Loadable for LlmMessageOrigin {
13865    fn graphql_type() -> &'static str {
13866        "LLMMessageOrigin"
13867    }
13868    fn from_query(
13869        proc: Option<Arc<DaggerSessionProc>>,
13870        selection: Selection,
13871        graphql_client: DynGraphQLClient,
13872    ) -> Self {
13873        Self {
13874            proc,
13875            selection,
13876            graphql_client,
13877        }
13878    }
13879}
13880impl LlmMessageOrigin {
13881    /// A unique identifier for this LLMMessageOrigin.
13882    pub async fn id(&self) -> Result<Id, DaggerError> {
13883        let query = self.selection.select("id");
13884        query.execute(self.graphql_client.clone()).await
13885    }
13886    /// Who put this message on the record.
13887    pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
13888        let query = self.selection.select("kind");
13889        query.execute(self.graphql_client.clone()).await
13890    }
13891    /// The display name of the sending agent (for AGENT origins) or the observed agent (for EVENT origins).
13892    pub async fn agent_name(&self) -> Result<String, DaggerError> {
13893        let query = self.selection.select("agentName");
13894        query.execute(self.graphql_client.clone()).await
13895    }
13896    /// 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.
13897    pub async fn r#ref(&self) -> Result<String, DaggerError> {
13898        let query = self.selection.select("ref");
13899        query.execute(self.graphql_client.clone()).await
13900    }
13901    /// The ref of the message this one answers, in the sender's own runtime, if any.
13902    pub async fn reply_to(&self) -> Result<String, DaggerError> {
13903        let query = self.selection.select("replyTo");
13904        query.execute(self.graphql_client.clone()).await
13905    }
13906}
13907impl Node for LlmMessageOrigin {
13908    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13909        let query = self.selection.select("id");
13910        let graphql_client = self.graphql_client.clone();
13911        async move { query.execute(graphql_client).await }
13912    }
13913}
13914#[derive(Clone)]
13915pub struct LlmSkill {
13916    pub proc: Option<Arc<DaggerSessionProc>>,
13917    pub selection: Selection,
13918    pub graphql_client: DynGraphQLClient,
13919}
13920impl IntoID<Id> for LlmSkill {
13921    fn into_id(
13922        self,
13923    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13924        Box::pin(async move { self.id().await })
13925    }
13926}
13927impl Loadable for LlmSkill {
13928    fn graphql_type() -> &'static str {
13929        "LLMSkill"
13930    }
13931    fn from_query(
13932        proc: Option<Arc<DaggerSessionProc>>,
13933        selection: Selection,
13934        graphql_client: DynGraphQLClient,
13935    ) -> Self {
13936        Self {
13937            proc,
13938            selection,
13939            graphql_client,
13940        }
13941    }
13942}
13943impl LlmSkill {
13944    /// A unique identifier for this LLMSkill.
13945    pub async fn id(&self) -> Result<Id, DaggerError> {
13946        let query = self.selection.select("id");
13947        query.execute(self.graphql_client.clone()).await
13948    }
13949    /// The skill name, as passed to ReadSkill.
13950    pub async fn name(&self) -> Result<String, DaggerError> {
13951        let query = self.selection.select("name");
13952        query.execute(self.graphql_client.clone()).await
13953    }
13954    /// The one-line description from the SKILL.md frontmatter.
13955    pub async fn description(&self) -> Result<String, DaggerError> {
13956        let query = self.selection.select("description");
13957        query.execute(self.graphql_client.clone()).await
13958    }
13959}
13960impl Node for LlmSkill {
13961    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13962        let query = self.selection.select("id");
13963        let graphql_client = self.graphql_client.clone();
13964        async move { query.execute(graphql_client).await }
13965    }
13966}
13967#[derive(Clone)]
13968pub struct LlmTokenUsage {
13969    pub proc: Option<Arc<DaggerSessionProc>>,
13970    pub selection: Selection,
13971    pub graphql_client: DynGraphQLClient,
13972}
13973impl IntoID<Id> for LlmTokenUsage {
13974    fn into_id(
13975        self,
13976    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13977        Box::pin(async move { self.id().await })
13978    }
13979}
13980impl Loadable for LlmTokenUsage {
13981    fn graphql_type() -> &'static str {
13982        "LLMTokenUsage"
13983    }
13984    fn from_query(
13985        proc: Option<Arc<DaggerSessionProc>>,
13986        selection: Selection,
13987        graphql_client: DynGraphQLClient,
13988    ) -> Self {
13989        Self {
13990            proc,
13991            selection,
13992            graphql_client,
13993        }
13994    }
13995}
13996impl LlmTokenUsage {
13997    /// A unique identifier for this LLMTokenUsage.
13998    pub async fn id(&self) -> Result<Id, DaggerError> {
13999        let query = self.selection.select("id");
14000        query.execute(self.graphql_client.clone()).await
14001    }
14002    /// Uncached input tokens sent to the model.
14003    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
14004        let query = self.selection.select("inputTokens");
14005        query.execute(self.graphql_client.clone()).await
14006    }
14007    /// Tokens received from the model, including text and tool calls.
14008    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
14009        let query = self.selection.select("outputTokens");
14010        query.execute(self.graphql_client.clone()).await
14011    }
14012    /// Input tokens served from the provider's prompt cache.
14013    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
14014        let query = self.selection.select("cachedTokenReads");
14015        query.execute(self.graphql_client.clone()).await
14016    }
14017    /// Input tokens written to the provider's prompt cache.
14018    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
14019        let query = self.selection.select("cachedTokenWrites");
14020        query.execute(self.graphql_client.clone()).await
14021    }
14022    /// Total tokens consumed, as reported by the provider.
14023    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
14024        let query = self.selection.select("totalTokens");
14025        query.execute(self.graphql_client.clone()).await
14026    }
14027}
14028impl Node for LlmTokenUsage {
14029    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14030        let query = self.selection.select("id");
14031        let graphql_client = self.graphql_client.clone();
14032        async move { query.execute(graphql_client).await }
14033    }
14034}
14035#[derive(Clone)]
14036pub struct Label {
14037    pub proc: Option<Arc<DaggerSessionProc>>,
14038    pub selection: Selection,
14039    pub graphql_client: DynGraphQLClient,
14040}
14041impl IntoID<Id> for Label {
14042    fn into_id(
14043        self,
14044    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14045        Box::pin(async move { self.id().await })
14046    }
14047}
14048impl Loadable for Label {
14049    fn graphql_type() -> &'static str {
14050        "Label"
14051    }
14052    fn from_query(
14053        proc: Option<Arc<DaggerSessionProc>>,
14054        selection: Selection,
14055        graphql_client: DynGraphQLClient,
14056    ) -> Self {
14057        Self {
14058            proc,
14059            selection,
14060            graphql_client,
14061        }
14062    }
14063}
14064impl Label {
14065    /// A unique identifier for this Label.
14066    pub async fn id(&self) -> Result<Id, DaggerError> {
14067        let query = self.selection.select("id");
14068        query.execute(self.graphql_client.clone()).await
14069    }
14070    /// The label name.
14071    pub async fn name(&self) -> Result<String, DaggerError> {
14072        let query = self.selection.select("name");
14073        query.execute(self.graphql_client.clone()).await
14074    }
14075    /// The label value.
14076    pub async fn value(&self) -> Result<String, DaggerError> {
14077        let query = self.selection.select("value");
14078        query.execute(self.graphql_client.clone()).await
14079    }
14080}
14081impl Node for Label {
14082    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14083        let query = self.selection.select("id");
14084        let graphql_client = self.graphql_client.clone();
14085        async move { query.execute(graphql_client).await }
14086    }
14087}
14088#[derive(Clone)]
14089pub struct ListTypeDef {
14090    pub proc: Option<Arc<DaggerSessionProc>>,
14091    pub selection: Selection,
14092    pub graphql_client: DynGraphQLClient,
14093}
14094impl IntoID<Id> for ListTypeDef {
14095    fn into_id(
14096        self,
14097    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14098        Box::pin(async move { self.id().await })
14099    }
14100}
14101impl Loadable for ListTypeDef {
14102    fn graphql_type() -> &'static str {
14103        "ListTypeDef"
14104    }
14105    fn from_query(
14106        proc: Option<Arc<DaggerSessionProc>>,
14107        selection: Selection,
14108        graphql_client: DynGraphQLClient,
14109    ) -> Self {
14110        Self {
14111            proc,
14112            selection,
14113            graphql_client,
14114        }
14115    }
14116}
14117impl ListTypeDef {
14118    /// A unique identifier for this ListTypeDef.
14119    pub async fn id(&self) -> Result<Id, DaggerError> {
14120        let query = self.selection.select("id");
14121        query.execute(self.graphql_client.clone()).await
14122    }
14123    /// The type of the elements in the list.
14124    pub fn element_type_def(&self) -> TypeDef {
14125        let query = self.selection.select("elementTypeDef");
14126        TypeDef {
14127            proc: self.proc.clone(),
14128            selection: query,
14129            graphql_client: self.graphql_client.clone(),
14130        }
14131    }
14132}
14133impl Node for ListTypeDef {
14134    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14135        let query = self.selection.select("id");
14136        let graphql_client = self.graphql_client.clone();
14137        async move { query.execute(graphql_client).await }
14138    }
14139}
14140#[derive(Clone)]
14141pub struct Module {
14142    pub proc: Option<Arc<DaggerSessionProc>>,
14143    pub selection: Selection,
14144    pub graphql_client: DynGraphQLClient,
14145}
14146#[derive(Builder, Debug, PartialEq)]
14147pub struct ModuleServeOpts {
14148    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
14149    #[builder(setter(into, strip_option), default)]
14150    pub entrypoint: Option<bool>,
14151    /// Expose the dependencies of this module to the client
14152    #[builder(setter(into, strip_option), default)]
14153    pub include_dependencies: Option<bool>,
14154}
14155impl IntoID<Id> for Module {
14156    fn into_id(
14157        self,
14158    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14159        Box::pin(async move { self.id().await })
14160    }
14161}
14162impl Loadable for Module {
14163    fn graphql_type() -> &'static str {
14164        "Module"
14165    }
14166    fn from_query(
14167        proc: Option<Arc<DaggerSessionProc>>,
14168        selection: Selection,
14169        graphql_client: DynGraphQLClient,
14170    ) -> Self {
14171        Self {
14172            proc,
14173            selection,
14174            graphql_client,
14175        }
14176    }
14177}
14178impl Module {
14179    /// A unique identifier for this Module.
14180    pub async fn id(&self) -> Result<Id, DaggerError> {
14181        let query = self.selection.select("id");
14182        query.execute(self.graphql_client.clone()).await
14183    }
14184    /// The source used to resolve contextual files and directories, when different from source.
14185    pub async fn context_source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14186        let query = self.selection.select("contextSource");
14187        let query = query.select("id");
14188        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14189        Ok(id.map(|id| ModuleSource {
14190            proc: self.proc.clone(),
14191            selection: query
14192                .root()
14193                .select("node")
14194                .arg("id", &id.0)
14195                .inline_fragment("ModuleSource"),
14196            graphql_client: self.graphql_client.clone(),
14197        }))
14198    }
14199    /// Forces evaluation of the module, including any loading into the engine and associated validation.
14200    pub async fn sync(&self) -> Result<Module, DaggerError> {
14201        let query = self.selection.select("sync");
14202        let id: Id = query.execute(self.graphql_client.clone()).await?;
14203        Ok(Module {
14204            proc: self.proc.clone(),
14205            selection: query
14206                .root()
14207                .select("node")
14208                .arg("id", &id.0)
14209                .inline_fragment("Module"),
14210            graphql_client: self.graphql_client.clone(),
14211        })
14212    }
14213    /// The dependencies of the module.
14214    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
14215        let query = self.selection.select("dependencies");
14216        let query = query.select("id");
14217        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14218        Ok(ids
14219            .into_iter()
14220            .map(|id| Module {
14221                proc: self.proc.clone(),
14222                selection: crate::querybuilder::query()
14223                    .select("node")
14224                    .arg("id", &id.0)
14225                    .inline_fragment("Module"),
14226                graphql_client: self.graphql_client.clone(),
14227            })
14228            .collect())
14229    }
14230    /// The introspection schema JSON file for this module.
14231    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
14232    /// Note: this is in the context of a module, so some core types may be hidden.
14233    pub fn introspection_schema_json(&self) -> File {
14234        let query = self.selection.select("introspectionSchemaJSON");
14235        File {
14236            proc: self.proc.clone(),
14237            selection: query,
14238            graphql_client: self.graphql_client.clone(),
14239        }
14240    }
14241    /// The generated files and directories made on top of the module source's context directory.
14242    pub fn generated_context_directory(&self) -> Directory {
14243        let query = self.selection.select("generatedContextDirectory");
14244        Directory {
14245            proc: self.proc.clone(),
14246            selection: query,
14247            graphql_client: self.graphql_client.clone(),
14248        }
14249    }
14250    /// User-defined default values, loaded from local .env files.
14251    pub fn user_defaults(&self) -> EnvFile {
14252        let query = self.selection.select("userDefaults");
14253        EnvFile {
14254            proc: self.proc.clone(),
14255            selection: query,
14256            graphql_client: self.graphql_client.clone(),
14257        }
14258    }
14259    /// Retrieves the module with the given description
14260    ///
14261    /// # Arguments
14262    ///
14263    /// * `description` - The description to set
14264    pub fn with_description(&self, description: impl Into<String>) -> Module {
14265        let mut query = self.selection.select("withDescription");
14266        query = query.arg("description", description.into());
14267        Module {
14268            proc: self.proc.clone(),
14269            selection: query,
14270            graphql_client: self.graphql_client.clone(),
14271        }
14272    }
14273    /// This module plus the given Object type and associated functions.
14274    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
14275        let mut query = self.selection.select("withObject");
14276        query = query.arg_lazy(
14277            "object",
14278            Box::new(move || {
14279                let object = object.clone();
14280                Box::pin(async move { object.into_id().await.unwrap().quote() })
14281            }),
14282        );
14283        Module {
14284            proc: self.proc.clone(),
14285            selection: query,
14286            graphql_client: self.graphql_client.clone(),
14287        }
14288    }
14289    /// This module plus the given Interface type and associated functions
14290    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
14291        let mut query = self.selection.select("withInterface");
14292        query = query.arg_lazy(
14293            "iface",
14294            Box::new(move || {
14295                let iface = iface.clone();
14296                Box::pin(async move { iface.into_id().await.unwrap().quote() })
14297            }),
14298        );
14299        Module {
14300            proc: self.proc.clone(),
14301            selection: query,
14302            graphql_client: self.graphql_client.clone(),
14303        }
14304    }
14305    /// This module plus the given Enum type and associated values
14306    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
14307        let mut query = self.selection.select("withEnum");
14308        query = query.arg_lazy(
14309            "enum",
14310            Box::new(move || {
14311                let r#enum = r#enum.clone();
14312                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
14313            }),
14314        );
14315        Module {
14316            proc: self.proc.clone(),
14317            selection: query,
14318            graphql_client: self.graphql_client.clone(),
14319        }
14320    }
14321    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
14322    pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
14323        let query = self.selection.select("runtime");
14324        let query = query.select("id");
14325        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14326        Ok(id.map(|id| Container {
14327            proc: self.proc.clone(),
14328            selection: query
14329                .root()
14330                .select("node")
14331                .arg("id", &id.0)
14332                .inline_fragment("Container"),
14333            graphql_client: self.graphql_client.clone(),
14334        }))
14335    }
14336    /// Serve a module's API in the current session.
14337    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14338    ///
14339    /// # Arguments
14340    ///
14341    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14342    pub async fn serve(&self) -> Result<Void, DaggerError> {
14343        let query = self.selection.select("serve");
14344        query.execute(self.graphql_client.clone()).await
14345    }
14346    /// Serve a module's API in the current session.
14347    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14348    ///
14349    /// # Arguments
14350    ///
14351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14352    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
14353        let mut query = self.selection.select("serve");
14354        if let Some(include_dependencies) = opts.include_dependencies {
14355            query = query.arg("includeDependencies", include_dependencies);
14356        }
14357        if let Some(entrypoint) = opts.entrypoint {
14358            query = query.arg("entrypoint", entrypoint);
14359        }
14360        query.execute(self.graphql_client.clone()).await
14361    }
14362    /// The source for the module.
14363    pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14364        let query = self.selection.select("source");
14365        let query = query.select("id");
14366        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14367        Ok(id.map(|id| ModuleSource {
14368            proc: self.proc.clone(),
14369            selection: query
14370                .root()
14371                .select("node")
14372                .arg("id", &id.0)
14373                .inline_fragment("ModuleSource"),
14374            graphql_client: self.graphql_client.clone(),
14375        }))
14376    }
14377    /// The name of the module
14378    pub async fn name(&self) -> Result<String, DaggerError> {
14379        let query = self.selection.select("name");
14380        query.execute(self.graphql_client.clone()).await
14381    }
14382    /// The SDK config used by this module.
14383    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
14384        let query = self.selection.select("sdk");
14385        let query = query.select("id");
14386        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14387        Ok(id.map(|id| SdkConfig {
14388            proc: self.proc.clone(),
14389            selection: query
14390                .root()
14391                .select("node")
14392                .arg("id", &id.0)
14393                .inline_fragment("SDKConfig"),
14394            graphql_client: self.graphql_client.clone(),
14395        }))
14396    }
14397    /// The doc string of the module, if any
14398    pub async fn description(&self) -> Result<String, DaggerError> {
14399        let query = self.selection.select("description");
14400        query.execute(self.graphql_client.clone()).await
14401    }
14402    /// Objects served by this module.
14403    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
14404        let query = self.selection.select("objects");
14405        let query = query.select("id");
14406        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14407        Ok(ids
14408            .into_iter()
14409            .map(|id| TypeDef {
14410                proc: self.proc.clone(),
14411                selection: crate::querybuilder::query()
14412                    .select("node")
14413                    .arg("id", &id.0)
14414                    .inline_fragment("TypeDef"),
14415                graphql_client: self.graphql_client.clone(),
14416            })
14417            .collect())
14418    }
14419    /// Interfaces served by this module.
14420    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
14421        let query = self.selection.select("interfaces");
14422        let query = query.select("id");
14423        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14424        Ok(ids
14425            .into_iter()
14426            .map(|id| TypeDef {
14427                proc: self.proc.clone(),
14428                selection: crate::querybuilder::query()
14429                    .select("node")
14430                    .arg("id", &id.0)
14431                    .inline_fragment("TypeDef"),
14432                graphql_client: self.graphql_client.clone(),
14433            })
14434            .collect())
14435    }
14436    /// Enumerations served by this module.
14437    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
14438        let query = self.selection.select("enums");
14439        let query = query.select("id");
14440        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14441        Ok(ids
14442            .into_iter()
14443            .map(|id| TypeDef {
14444                proc: self.proc.clone(),
14445                selection: crate::querybuilder::query()
14446                    .select("node")
14447                    .arg("id", &id.0)
14448                    .inline_fragment("TypeDef"),
14449                graphql_client: self.graphql_client.clone(),
14450            })
14451            .collect())
14452    }
14453}
14454impl Node for Module {
14455    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14456        let query = self.selection.select("id");
14457        let graphql_client = self.graphql_client.clone();
14458        async move { query.execute(graphql_client).await }
14459    }
14460}
14461impl Syncer for Module {
14462    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14463        let query = self.selection.select("id");
14464        let graphql_client = self.graphql_client.clone();
14465        async move { query.execute(graphql_client).await }
14466    }
14467    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
14468        let query = self.selection.select("sync");
14469        let proc = self.proc.clone();
14470        let graphql_client = self.graphql_client.clone();
14471        async move {
14472            let id: Id = query.execute(graphql_client.clone()).await?;
14473            Ok(Self {
14474                proc,
14475                selection: query
14476                    .root()
14477                    .select("node")
14478                    .arg("id", &id.0)
14479                    .inline_fragment("Module"),
14480                graphql_client,
14481            })
14482        }
14483    }
14484}
14485#[derive(Clone)]
14486pub struct ModuleConfigClient {
14487    pub proc: Option<Arc<DaggerSessionProc>>,
14488    pub selection: Selection,
14489    pub graphql_client: DynGraphQLClient,
14490}
14491impl IntoID<Id> for ModuleConfigClient {
14492    fn into_id(
14493        self,
14494    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14495        Box::pin(async move { self.id().await })
14496    }
14497}
14498impl Loadable for ModuleConfigClient {
14499    fn graphql_type() -> &'static str {
14500        "ModuleConfigClient"
14501    }
14502    fn from_query(
14503        proc: Option<Arc<DaggerSessionProc>>,
14504        selection: Selection,
14505        graphql_client: DynGraphQLClient,
14506    ) -> Self {
14507        Self {
14508            proc,
14509            selection,
14510            graphql_client,
14511        }
14512    }
14513}
14514impl ModuleConfigClient {
14515    /// A unique identifier for this ModuleConfigClient.
14516    pub async fn id(&self) -> Result<Id, DaggerError> {
14517        let query = self.selection.select("id");
14518        query.execute(self.graphql_client.clone()).await
14519    }
14520    /// The generator to use
14521    pub async fn generator(&self) -> Result<String, DaggerError> {
14522        let query = self.selection.select("generator");
14523        query.execute(self.graphql_client.clone()).await
14524    }
14525    /// The directory the client is generated in.
14526    pub async fn directory(&self) -> Result<String, DaggerError> {
14527        let query = self.selection.select("directory");
14528        query.execute(self.graphql_client.clone()).await
14529    }
14530}
14531impl Node for ModuleConfigClient {
14532    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14533        let query = self.selection.select("id");
14534        let graphql_client = self.graphql_client.clone();
14535        async move { query.execute(graphql_client).await }
14536    }
14537}
14538#[derive(Clone)]
14539pub struct ModuleSource {
14540    pub proc: Option<Arc<DaggerSessionProc>>,
14541    pub selection: Selection,
14542    pub graphql_client: DynGraphQLClient,
14543}
14544impl IntoID<Id> for ModuleSource {
14545    fn into_id(
14546        self,
14547    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14548        Box::pin(async move { self.id().await })
14549    }
14550}
14551impl Loadable for ModuleSource {
14552    fn graphql_type() -> &'static str {
14553        "ModuleSource"
14554    }
14555    fn from_query(
14556        proc: Option<Arc<DaggerSessionProc>>,
14557        selection: Selection,
14558        graphql_client: DynGraphQLClient,
14559    ) -> Self {
14560        Self {
14561            proc,
14562            selection,
14563            graphql_client,
14564        }
14565    }
14566}
14567impl ModuleSource {
14568    /// A unique identifier for this ModuleSource.
14569    pub async fn id(&self) -> Result<Id, DaggerError> {
14570        let query = self.selection.select("id");
14571        query.execute(self.graphql_client.clone()).await
14572    }
14573    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
14574    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
14575        let query = self.selection.select("sync");
14576        let id: Id = query.execute(self.graphql_client.clone()).await?;
14577        Ok(ModuleSource {
14578            proc: self.proc.clone(),
14579            selection: query
14580                .root()
14581                .select("node")
14582                .arg("id", &id.0)
14583                .inline_fragment("ModuleSource"),
14584            graphql_client: self.graphql_client.clone(),
14585        })
14586    }
14587    /// The path to the directory containing the module's source code, relative to the context directory.
14588    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
14589        let query = self.selection.select("sourceSubpath");
14590        query.execute(self.graphql_client.clone()).await
14591    }
14592    /// The original subpath used when instantiating this module source, relative to the context directory.
14593    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
14594        let query = self.selection.select("originalSubpath");
14595        query.execute(self.graphql_client.clone()).await
14596    }
14597    /// 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.
14598    pub async fn digest(&self) -> Result<String, DaggerError> {
14599        let query = self.selection.select("digest");
14600        query.execute(self.graphql_client.clone()).await
14601    }
14602    /// Update the module source with a new source subpath.
14603    ///
14604    /// # Arguments
14605    ///
14606    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
14607    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
14608        let mut query = self.selection.select("withSourceSubpath");
14609        query = query.arg("path", path.into());
14610        ModuleSource {
14611            proc: self.proc.clone(),
14612            selection: query,
14613            graphql_client: self.graphql_client.clone(),
14614        }
14615    }
14616    /// Update the module source with a new name.
14617    ///
14618    /// # Arguments
14619    ///
14620    /// * `name` - The name to set.
14621    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
14622        let mut query = self.selection.select("withName");
14623        query = query.arg("name", name.into());
14624        ModuleSource {
14625            proc: self.proc.clone(),
14626            selection: query,
14627            graphql_client: self.graphql_client.clone(),
14628        }
14629    }
14630    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
14631    ///
14632    /// # Arguments
14633    ///
14634    /// * `patterns` - The new additional include patterns.
14635    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
14636        let mut query = self.selection.select("withIncludes");
14637        query = query.arg(
14638            "patterns",
14639            patterns
14640                .into_iter()
14641                .map(|i| i.into())
14642                .collect::<Vec<String>>(),
14643        );
14644        ModuleSource {
14645            proc: self.proc.clone(),
14646            selection: query,
14647            graphql_client: self.graphql_client.clone(),
14648        }
14649    }
14650    /// Update the module source with a new SDK.
14651    ///
14652    /// # Arguments
14653    ///
14654    /// * `source` - The SDK source to set.
14655    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
14656        let mut query = self.selection.select("withSDK");
14657        query = query.arg("source", source.into());
14658        ModuleSource {
14659            proc: self.proc.clone(),
14660            selection: query,
14661            graphql_client: self.graphql_client.clone(),
14662        }
14663    }
14664    /// Upgrade the engine version of the module to the given value.
14665    ///
14666    /// # Arguments
14667    ///
14668    /// * `version` - The engine version to upgrade to.
14669    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
14670        let mut query = self.selection.select("withEngineVersion");
14671        query = query.arg("version", version.into());
14672        ModuleSource {
14673            proc: self.proc.clone(),
14674            selection: query,
14675            graphql_client: self.graphql_client.clone(),
14676        }
14677    }
14678    /// Append the provided dependencies to the module source's dependency list.
14679    ///
14680    /// # Arguments
14681    ///
14682    /// * `dependencies` - The dependencies to append.
14683    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
14684        let mut query = self.selection.select("withDependencies");
14685        query = query.arg("dependencies", dependencies);
14686        ModuleSource {
14687            proc: self.proc.clone(),
14688            selection: query,
14689            graphql_client: self.graphql_client.clone(),
14690        }
14691    }
14692    /// Update one or more module dependencies.
14693    ///
14694    /// # Arguments
14695    ///
14696    /// * `dependencies` - The dependencies to update.
14697    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14698        let mut query = self.selection.select("withUpdateDependencies");
14699        query = query.arg(
14700            "dependencies",
14701            dependencies
14702                .into_iter()
14703                .map(|i| i.into())
14704                .collect::<Vec<String>>(),
14705        );
14706        ModuleSource {
14707            proc: self.proc.clone(),
14708            selection: query,
14709            graphql_client: self.graphql_client.clone(),
14710        }
14711    }
14712    /// Remove the provided dependencies from the module source's dependency list.
14713    ///
14714    /// # Arguments
14715    ///
14716    /// * `dependencies` - The dependencies to remove.
14717    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14718        let mut query = self.selection.select("withoutDependencies");
14719        query = query.arg(
14720            "dependencies",
14721            dependencies
14722                .into_iter()
14723                .map(|i| i.into())
14724                .collect::<Vec<String>>(),
14725        );
14726        ModuleSource {
14727            proc: self.proc.clone(),
14728            selection: query,
14729            graphql_client: self.graphql_client.clone(),
14730        }
14731    }
14732    /// Set a blueprint for the module source.
14733    ///
14734    /// # Arguments
14735    ///
14736    /// * `blueprint` - The blueprint module to set.
14737    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
14738        let mut query = self.selection.select("withBlueprint");
14739        query = query.arg_lazy(
14740            "blueprint",
14741            Box::new(move || {
14742                let blueprint = blueprint.clone();
14743                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
14744            }),
14745        );
14746        ModuleSource {
14747            proc: self.proc.clone(),
14748            selection: query,
14749            graphql_client: self.graphql_client.clone(),
14750        }
14751    }
14752    /// Add toolchains to the module source.
14753    ///
14754    /// # Arguments
14755    ///
14756    /// * `toolchains` - The toolchain modules to add.
14757    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
14758        let mut query = self.selection.select("withToolchains");
14759        query = query.arg("toolchains", toolchains);
14760        ModuleSource {
14761            proc: self.proc.clone(),
14762            selection: query,
14763            graphql_client: self.graphql_client.clone(),
14764        }
14765    }
14766    /// Update one or more toolchains.
14767    ///
14768    /// # Arguments
14769    ///
14770    /// * `toolchains` - The toolchains to update.
14771    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14772        let mut query = self.selection.select("withUpdateToolchains");
14773        query = query.arg(
14774            "toolchains",
14775            toolchains
14776                .into_iter()
14777                .map(|i| i.into())
14778                .collect::<Vec<String>>(),
14779        );
14780        ModuleSource {
14781            proc: self.proc.clone(),
14782            selection: query,
14783            graphql_client: self.graphql_client.clone(),
14784        }
14785    }
14786    /// Remove the provided toolchains from the module source.
14787    ///
14788    /// # Arguments
14789    ///
14790    /// * `toolchains` - The toolchains to remove.
14791    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14792        let mut query = self.selection.select("withoutToolchains");
14793        query = query.arg(
14794            "toolchains",
14795            toolchains
14796                .into_iter()
14797                .map(|i| i.into())
14798                .collect::<Vec<String>>(),
14799        );
14800        ModuleSource {
14801            proc: self.proc.clone(),
14802            selection: query,
14803            graphql_client: self.graphql_client.clone(),
14804        }
14805    }
14806    /// Update the blueprint module to the latest version.
14807    pub fn with_update_blueprint(&self) -> ModuleSource {
14808        let query = self.selection.select("withUpdateBlueprint");
14809        ModuleSource {
14810            proc: self.proc.clone(),
14811            selection: query,
14812            graphql_client: self.graphql_client.clone(),
14813        }
14814    }
14815    /// Remove the current blueprint from the module source.
14816    pub fn without_blueprint(&self) -> ModuleSource {
14817        let query = self.selection.select("withoutBlueprint");
14818        ModuleSource {
14819            proc: self.proc.clone(),
14820            selection: query,
14821            graphql_client: self.graphql_client.clone(),
14822        }
14823    }
14824    /// Enable the experimental features for the module source.
14825    ///
14826    /// # Arguments
14827    ///
14828    /// * `features` - The experimental features to enable.
14829    pub fn with_experimental_features(
14830        &self,
14831        features: Vec<ModuleSourceExperimentalFeature>,
14832    ) -> ModuleSource {
14833        let mut query = self.selection.select("withExperimentalFeatures");
14834        query = query.arg("features", features);
14835        ModuleSource {
14836            proc: self.proc.clone(),
14837            selection: query,
14838            graphql_client: self.graphql_client.clone(),
14839        }
14840    }
14841    /// Disable experimental features for the module source.
14842    ///
14843    /// # Arguments
14844    ///
14845    /// * `features` - The experimental features to disable.
14846    pub fn without_experimental_features(
14847        &self,
14848        features: Vec<ModuleSourceExperimentalFeature>,
14849    ) -> ModuleSource {
14850        let mut query = self.selection.select("withoutExperimentalFeatures");
14851        query = query.arg("features", features);
14852        ModuleSource {
14853            proc: self.proc.clone(),
14854            selection: query,
14855            graphql_client: self.graphql_client.clone(),
14856        }
14857    }
14858    /// The generated files and directories made on top of the module source's context directory.
14859    pub fn generated_context_directory(&self) -> Directory {
14860        let query = self.selection.select("generatedContextDirectory");
14861        Directory {
14862            proc: self.proc.clone(),
14863            selection: query,
14864            graphql_client: self.graphql_client.clone(),
14865        }
14866    }
14867    /// The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.
14868    /// 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.
14869    pub fn updated_config_directory(&self) -> Directory {
14870        let query = self.selection.select("updatedConfigDirectory");
14871        Directory {
14872            proc: self.proc.clone(),
14873            selection: query,
14874            graphql_client: self.graphql_client.clone(),
14875        }
14876    }
14877    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
14878    pub fn generated_context_changeset(&self) -> Changeset {
14879        let query = self.selection.select("generatedContextChangeset");
14880        Changeset {
14881            proc: self.proc.clone(),
14882            selection: query,
14883            graphql_client: self.graphql_client.clone(),
14884        }
14885    }
14886    /// Return the supplied workspace with this module's generated context applied.
14887    /// The workspace change baseline is preserved, so a later Workspace.changes call includes this generation together with any other edits made by the caller.
14888    ///
14889    /// # Arguments
14890    ///
14891    /// * `workspace` - The workspace to apply generated files to.
14892    pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
14893        let mut query = self.selection.select("generate");
14894        query = query.arg_lazy(
14895            "workspace",
14896            Box::new(move || {
14897                let workspace = workspace.clone();
14898                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
14899            }),
14900        );
14901        Workspace {
14902            proc: self.proc.clone(),
14903            selection: query,
14904            graphql_client: self.graphql_client.clone(),
14905        }
14906    }
14907    /// A human readable ref string representation of this module source.
14908    pub async fn as_string(&self) -> Result<String, DaggerError> {
14909        let query = self.selection.select("asString");
14910        query.execute(self.graphql_client.clone()).await
14911    }
14912    /// The pinned version of this module source.
14913    pub async fn pin(&self) -> Result<String, DaggerError> {
14914        let query = self.selection.select("pin");
14915        query.execute(self.graphql_client.clone()).await
14916    }
14917    /// 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.
14918    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
14919        let query = self.selection.select("localContextDirectoryPath");
14920        query.execute(self.graphql_client.clone()).await
14921    }
14922    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
14923    pub fn as_module(&self) -> Module {
14924        let query = self.selection.select("asModule");
14925        Module {
14926            proc: self.proc.clone(),
14927            selection: query,
14928            graphql_client: self.graphql_client.clone(),
14929        }
14930    }
14931    /// The introspection schema JSON file for this module source.
14932    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
14933    /// Note: this is in the context of a module, so some core types may be hidden.
14934    pub fn introspection_schema_json(&self) -> File {
14935        let query = self.selection.select("introspectionSchemaJSON");
14936        File {
14937            proc: self.proc.clone(),
14938            selection: query,
14939            graphql_client: self.graphql_client.clone(),
14940        }
14941    }
14942    /// The client-facing introspection schema JSON file for this module source.
14943    /// 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.
14944    pub fn client_schema_introspection_json(&self) -> File {
14945        let query = self.selection.select("clientSchemaIntrospectionJSON");
14946        File {
14947            proc: self.proc.clone(),
14948            selection: query,
14949            graphql_client: self.graphql_client.clone(),
14950        }
14951    }
14952    /// The directory containing the module configuration and source code (source code may be in a subdir).
14953    ///
14954    /// # Arguments
14955    ///
14956    /// * `path` - A subpath from the source directory to select.
14957    pub fn directory(&self, path: impl Into<String>) -> Directory {
14958        let mut query = self.selection.select("directory");
14959        query = query.arg("path", path.into());
14960        Directory {
14961            proc: self.proc.clone(),
14962            selection: query,
14963            graphql_client: self.graphql_client.clone(),
14964        }
14965    }
14966    /// The ref to clone the root of the git repo from. Only valid for git sources.
14967    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
14968        let query = self.selection.select("cloneRef");
14969        query.execute(self.graphql_client.clone()).await
14970    }
14971    /// The URL to the source's git repo in a web browser. Only valid for git sources.
14972    pub async fn html_url(&self) -> Result<String, DaggerError> {
14973        let query = self.selection.select("htmlURL");
14974        query.execute(self.graphql_client.clone()).await
14975    }
14976    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
14977    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
14978        let query = self.selection.select("htmlRepoURL");
14979        query.execute(self.graphql_client.clone()).await
14980    }
14981    /// The specified version of the git repo this source points to.
14982    pub async fn version(&self) -> Result<String, DaggerError> {
14983        let query = self.selection.select("version");
14984        query.execute(self.graphql_client.clone()).await
14985    }
14986    /// The resolved commit of the git repo this source points to.
14987    pub async fn commit(&self) -> Result<String, DaggerError> {
14988        let query = self.selection.select("commit");
14989        query.execute(self.graphql_client.clone()).await
14990    }
14991    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
14992    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
14993        let query = self.selection.select("repoRootPath");
14994        query.execute(self.graphql_client.clone()).await
14995    }
14996    /// Update the module source with a new client to generate.
14997    ///
14998    /// # Arguments
14999    ///
15000    /// * `generator` - The generator to use
15001    /// * `output_dir` - The output directory for the generated client.
15002    pub fn with_client(
15003        &self,
15004        generator: impl Into<String>,
15005        output_dir: impl Into<String>,
15006    ) -> ModuleSource {
15007        let mut query = self.selection.select("withClient");
15008        query = query.arg("generator", generator.into());
15009        query = query.arg("outputDir", output_dir.into());
15010        ModuleSource {
15011            proc: self.proc.clone(),
15012            selection: query,
15013            graphql_client: self.graphql_client.clone(),
15014        }
15015    }
15016    /// Update one or more clients.
15017    ///
15018    /// # Arguments
15019    ///
15020    /// * `clients` - The clients to update
15021    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
15022        let mut query = self.selection.select("withUpdatedClients");
15023        query = query.arg(
15024            "clients",
15025            clients
15026                .into_iter()
15027                .map(|i| i.into())
15028                .collect::<Vec<String>>(),
15029        );
15030        ModuleSource {
15031            proc: self.proc.clone(),
15032            selection: query,
15033            graphql_client: self.graphql_client.clone(),
15034        }
15035    }
15036    /// Remove a client from the module source.
15037    ///
15038    /// # Arguments
15039    ///
15040    /// * `path` - The path of the client to remove.
15041    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
15042        let mut query = self.selection.select("withoutClient");
15043        query = query.arg("path", path.into());
15044        ModuleSource {
15045            proc: self.proc.clone(),
15046            selection: query,
15047            graphql_client: self.graphql_client.clone(),
15048        }
15049    }
15050    /// Whether an existing module config file was found.
15051    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
15052        let query = self.selection.select("configExists");
15053        query.execute(self.graphql_client.clone()).await
15054    }
15055    /// The name of the module, including any setting via the withName API.
15056    pub async fn module_name(&self) -> Result<String, DaggerError> {
15057        let query = self.selection.select("moduleName");
15058        query.execute(self.graphql_client.clone()).await
15059    }
15060    /// The original name of the module as read from the module config file (or set for the first time with the withName API).
15061    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
15062        let query = self.selection.select("moduleOriginalName");
15063        query.execute(self.graphql_client.clone()).await
15064    }
15065    /// The engine version of the module.
15066    pub async fn engine_version(&self) -> Result<String, DaggerError> {
15067        let query = self.selection.select("engineVersion");
15068        query.execute(self.graphql_client.clone()).await
15069    }
15070    /// The SDK configuration of the module.
15071    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
15072        let query = self.selection.select("sdk");
15073        let query = query.select("id");
15074        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15075        Ok(id.map(|id| SdkConfig {
15076            proc: self.proc.clone(),
15077            selection: query
15078                .root()
15079                .select("node")
15080                .arg("id", &id.0)
15081                .inline_fragment("SDKConfig"),
15082            graphql_client: self.graphql_client.clone(),
15083        }))
15084    }
15085    /// The dependencies of the module source.
15086    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15087        let query = self.selection.select("dependencies");
15088        let query = query.select("id");
15089        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15090        Ok(ids
15091            .into_iter()
15092            .map(|id| ModuleSource {
15093                proc: self.proc.clone(),
15094                selection: crate::querybuilder::query()
15095                    .select("node")
15096                    .arg("id", &id.0)
15097                    .inline_fragment("ModuleSource"),
15098                graphql_client: self.graphql_client.clone(),
15099            })
15100            .collect())
15101    }
15102    /// The blueprint referenced by the module source.
15103    pub fn blueprint(&self) -> ModuleSource {
15104        let query = self.selection.select("blueprint");
15105        ModuleSource {
15106            proc: self.proc.clone(),
15107            selection: query,
15108            graphql_client: self.graphql_client.clone(),
15109        }
15110    }
15111    /// The toolchains referenced by the module source.
15112    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15113        let query = self.selection.select("toolchains");
15114        let query = query.select("id");
15115        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15116        Ok(ids
15117            .into_iter()
15118            .map(|id| ModuleSource {
15119                proc: self.proc.clone(),
15120                selection: crate::querybuilder::query()
15121                    .select("node")
15122                    .arg("id", &id.0)
15123                    .inline_fragment("ModuleSource"),
15124                graphql_client: self.graphql_client.clone(),
15125            })
15126            .collect())
15127    }
15128    /// User-defined defaults read from local .env files
15129    pub fn user_defaults(&self) -> EnvFile {
15130        let query = self.selection.select("userDefaults");
15131        EnvFile {
15132            proc: self.proc.clone(),
15133            selection: query,
15134            graphql_client: self.graphql_client.clone(),
15135        }
15136    }
15137    /// The clients generated for the module.
15138    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
15139        let query = self.selection.select("configClients");
15140        let query = query.select("id");
15141        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15142        Ok(ids
15143            .into_iter()
15144            .map(|id| ModuleConfigClient {
15145                proc: self.proc.clone(),
15146                selection: crate::querybuilder::query()
15147                    .select("node")
15148                    .arg("id", &id.0)
15149                    .inline_fragment("ModuleConfigClient"),
15150                graphql_client: self.graphql_client.clone(),
15151            })
15152            .collect())
15153    }
15154    /// The path, relative to the context directory, that contains the module config.
15155    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
15156        let query = self.selection.select("sourceRootSubpath");
15157        query.execute(self.graphql_client.clone()).await
15158    }
15159    /// The full directory loaded for the module source, including the source code as a subdirectory.
15160    pub fn context_directory(&self) -> Directory {
15161        let query = self.selection.select("contextDirectory");
15162        Directory {
15163            proc: self.proc.clone(),
15164            selection: query,
15165            graphql_client: self.graphql_client.clone(),
15166        }
15167    }
15168    /// The kind of module source (currently local, git or dir).
15169    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
15170        let query = self.selection.select("kind");
15171        query.execute(self.graphql_client.clone()).await
15172    }
15173}
15174impl Node for ModuleSource {
15175    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15176        let query = self.selection.select("id");
15177        let graphql_client = self.graphql_client.clone();
15178        async move { query.execute(graphql_client).await }
15179    }
15180}
15181impl Syncer for ModuleSource {
15182    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15183        let query = self.selection.select("id");
15184        let graphql_client = self.graphql_client.clone();
15185        async move { query.execute(graphql_client).await }
15186    }
15187    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15188        let query = self.selection.select("sync");
15189        let proc = self.proc.clone();
15190        let graphql_client = self.graphql_client.clone();
15191        async move {
15192            let id: Id = query.execute(graphql_client.clone()).await?;
15193            Ok(Self {
15194                proc,
15195                selection: query
15196                    .root()
15197                    .select("node")
15198                    .arg("id", &id.0)
15199                    .inline_fragment("ModuleSource"),
15200                graphql_client,
15201            })
15202        }
15203    }
15204}
15205#[derive(Clone)]
15206pub struct ObjectTypeDef {
15207    pub proc: Option<Arc<DaggerSessionProc>>,
15208    pub selection: Selection,
15209    pub graphql_client: DynGraphQLClient,
15210}
15211impl IntoID<Id> for ObjectTypeDef {
15212    fn into_id(
15213        self,
15214    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15215        Box::pin(async move { self.id().await })
15216    }
15217}
15218impl Loadable for ObjectTypeDef {
15219    fn graphql_type() -> &'static str {
15220        "ObjectTypeDef"
15221    }
15222    fn from_query(
15223        proc: Option<Arc<DaggerSessionProc>>,
15224        selection: Selection,
15225        graphql_client: DynGraphQLClient,
15226    ) -> Self {
15227        Self {
15228            proc,
15229            selection,
15230            graphql_client,
15231        }
15232    }
15233}
15234impl ObjectTypeDef {
15235    /// A unique identifier for this ObjectTypeDef.
15236    pub async fn id(&self) -> Result<Id, DaggerError> {
15237        let query = self.selection.select("id");
15238        query.execute(self.graphql_client.clone()).await
15239    }
15240    /// The name of the object.
15241    pub async fn name(&self) -> Result<String, DaggerError> {
15242        let query = self.selection.select("name");
15243        query.execute(self.graphql_client.clone()).await
15244    }
15245    /// The doc string for the object, if any.
15246    pub async fn description(&self) -> Result<String, DaggerError> {
15247        let query = self.selection.select("description");
15248        query.execute(self.graphql_client.clone()).await
15249    }
15250    /// The location of this object declaration.
15251    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
15252        let query = self.selection.select("sourceMap");
15253        let query = query.select("id");
15254        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15255        Ok(id.map(|id| SourceMap {
15256            proc: self.proc.clone(),
15257            selection: query
15258                .root()
15259                .select("node")
15260                .arg("id", &id.0)
15261                .inline_fragment("SourceMap"),
15262            graphql_client: self.graphql_client.clone(),
15263        }))
15264    }
15265    /// The reason this enum member is deprecated, if any.
15266    pub async fn deprecated(&self) -> Result<String, DaggerError> {
15267        let query = self.selection.select("deprecated");
15268        query.execute(self.graphql_client.clone()).await
15269    }
15270    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
15271    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15272        let query = self.selection.select("sourceModuleName");
15273        query.execute(self.graphql_client.clone()).await
15274    }
15275    /// Static fields defined on this object, if any.
15276    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
15277        let query = self.selection.select("fields");
15278        let query = query.select("id");
15279        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15280        Ok(ids
15281            .into_iter()
15282            .map(|id| FieldTypeDef {
15283                proc: self.proc.clone(),
15284                selection: crate::querybuilder::query()
15285                    .select("node")
15286                    .arg("id", &id.0)
15287                    .inline_fragment("FieldTypeDef"),
15288                graphql_client: self.graphql_client.clone(),
15289            })
15290            .collect())
15291    }
15292    /// Functions defined on this object, if any.
15293    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
15294        let query = self.selection.select("functions");
15295        let query = query.select("id");
15296        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15297        Ok(ids
15298            .into_iter()
15299            .map(|id| Function {
15300                proc: self.proc.clone(),
15301                selection: crate::querybuilder::query()
15302                    .select("node")
15303                    .arg("id", &id.0)
15304                    .inline_fragment("Function"),
15305                graphql_client: self.graphql_client.clone(),
15306            })
15307            .collect())
15308    }
15309    /// The function used to construct new instances of this object, if any.
15310    pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
15311        let query = self.selection.select("constructor");
15312        let query = query.select("id");
15313        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15314        Ok(id.map(|id| Function {
15315            proc: self.proc.clone(),
15316            selection: query
15317                .root()
15318                .select("node")
15319                .arg("id", &id.0)
15320                .inline_fragment("Function"),
15321            graphql_client: self.graphql_client.clone(),
15322        }))
15323    }
15324}
15325impl Node for ObjectTypeDef {
15326    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15327        let query = self.selection.select("id");
15328        let graphql_client = self.graphql_client.clone();
15329        async move { query.execute(graphql_client).await }
15330    }
15331}
15332#[derive(Clone)]
15333pub struct Port {
15334    pub proc: Option<Arc<DaggerSessionProc>>,
15335    pub selection: Selection,
15336    pub graphql_client: DynGraphQLClient,
15337}
15338impl IntoID<Id> for Port {
15339    fn into_id(
15340        self,
15341    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15342        Box::pin(async move { self.id().await })
15343    }
15344}
15345impl Loadable for Port {
15346    fn graphql_type() -> &'static str {
15347        "Port"
15348    }
15349    fn from_query(
15350        proc: Option<Arc<DaggerSessionProc>>,
15351        selection: Selection,
15352        graphql_client: DynGraphQLClient,
15353    ) -> Self {
15354        Self {
15355            proc,
15356            selection,
15357            graphql_client,
15358        }
15359    }
15360}
15361impl Port {
15362    /// A unique identifier for this Port.
15363    pub async fn id(&self) -> Result<Id, DaggerError> {
15364        let query = self.selection.select("id");
15365        query.execute(self.graphql_client.clone()).await
15366    }
15367    /// The port number.
15368    pub async fn port(&self) -> Result<isize, DaggerError> {
15369        let query = self.selection.select("port");
15370        query.execute(self.graphql_client.clone()).await
15371    }
15372    /// The transport layer protocol.
15373    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
15374        let query = self.selection.select("protocol");
15375        query.execute(self.graphql_client.clone()).await
15376    }
15377    /// The port description.
15378    pub async fn description(&self) -> Result<String, DaggerError> {
15379        let query = self.selection.select("description");
15380        query.execute(self.graphql_client.clone()).await
15381    }
15382    /// Skip the health check when run as a service.
15383    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
15384        let query = self.selection.select("experimentalSkipHealthcheck");
15385        query.execute(self.graphql_client.clone()).await
15386    }
15387}
15388impl Node for Port {
15389    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15390        let query = self.selection.select("id");
15391        let graphql_client = self.graphql_client.clone();
15392        async move { query.execute(graphql_client).await }
15393    }
15394}
15395#[derive(Clone)]
15396pub struct Query {
15397    pub proc: Option<Arc<DaggerSessionProc>>,
15398    pub selection: Selection,
15399    pub graphql_client: DynGraphQLClient,
15400}
15401#[derive(Builder, Debug, PartialEq)]
15402pub struct QueryFileOpts {
15403    /// Permissions of the new file. Example: 0600
15404    #[builder(setter(into, strip_option), default)]
15405    pub permissions: Option<isize>,
15406}
15407#[derive(Builder, Debug, PartialEq)]
15408pub struct QueryBlobOpts {
15409    /// Permissions of the new file. Example: 0600
15410    #[builder(setter(into, strip_option), default)]
15411    pub permissions: Option<isize>,
15412}
15413#[derive(Builder, Debug, PartialEq)]
15414pub struct QueryGitOpts<'a> {
15415    /// A service which must be started before the repo is fetched.
15416    #[builder(setter(into, strip_option), default)]
15417    pub experimental_service_host: Option<Id>,
15418    /// Secret used to populate the Authorization HTTP header
15419    #[builder(setter(into, strip_option), default)]
15420    pub http_auth_header: Option<Id>,
15421    /// Secret used to populate the password during basic HTTP Authorization
15422    #[builder(setter(into, strip_option), default)]
15423    pub http_auth_token: Option<Id>,
15424    /// Username used to populate the password during basic HTTP Authorization
15425    #[builder(setter(into, strip_option), default)]
15426    pub http_auth_username: Option<&'a str>,
15427    /// DEPRECATED: Set to true to keep .git directory.
15428    #[builder(setter(into, strip_option), default)]
15429    pub keep_git_dir: Option<bool>,
15430    /// Set SSH auth socket
15431    #[builder(setter(into, strip_option), default)]
15432    pub ssh_auth_socket: Option<Id>,
15433    /// Set SSH known hosts
15434    #[builder(setter(into, strip_option), default)]
15435    pub ssh_known_hosts: Option<&'a str>,
15436}
15437#[derive(Builder, Debug, PartialEq)]
15438pub struct QueryContainerOpts {
15439    /// Platform to initialize the container with. Defaults to the native platform of the current engine
15440    #[builder(setter(into, strip_option), default)]
15441    pub platform: Option<Platform>,
15442}
15443#[derive(Builder, Debug, PartialEq)]
15444pub struct QueryCacheVolumeOpts<'a> {
15445    /// A user:group to set for the cache volume root.
15446    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
15447    /// If the group is omitted, it defaults to the same as the user.
15448    #[builder(setter(into, strip_option), default)]
15449    pub owner: Option<&'a str>,
15450    /// Sharing mode of the cache volume.
15451    #[builder(setter(into, strip_option), default)]
15452    pub sharing: Option<CacheSharingMode>,
15453    /// Identifier of the directory to use as the cache volume's root.
15454    #[builder(setter(into, strip_option), default)]
15455    pub source: Option<Id>,
15456}
15457#[derive(Builder, Debug, PartialEq)]
15458pub struct QueryEngineVolumeOpts<'a> {
15459    /// Optional existing subdirectory within the volume payload to mount.
15460    #[builder(setter(into, strip_option), default)]
15461    pub subdir: Option<&'a str>,
15462}
15463#[derive(Builder, Debug, PartialEq)]
15464pub struct QuerySshfsVolumeOpts<'a> {
15465    /// Optional cache equivalence key. If set, volumes with the same cacheKey may be considered equivalent for cache lookups, still subject to their resource dependencies.
15466    #[builder(setter(into, strip_option), default)]
15467    pub cache_key: Option<&'a str>,
15468    /// Service to use as the SSHFS network endpoint while verifying the original host key.
15469    #[builder(setter(into, strip_option), default)]
15470    pub experimental_service_host: Option<Id>,
15471    /// Disable SSH host key verification. This is insecure and must be explicitly opted into.
15472    #[builder(setter(into, strip_option), default)]
15473    pub insecure_skip_host_key_check: Option<bool>,
15474    /// known_hosts material used to verify the remote host key. Required unless insecureSkipHostKeyCheck is true.
15475    #[builder(setter(into, strip_option), default)]
15476    pub known_hosts: Option<Id>,
15477}
15478#[derive(Builder, Debug, PartialEq)]
15479pub struct QuerySecretOpts<'a> {
15480    /// 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.
15481    /// 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.
15482    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
15483    #[builder(setter(into, strip_option), default)]
15484    pub cache_key: Option<&'a str>,
15485}
15486#[derive(Builder, Debug, PartialEq)]
15487pub struct QueryHttpOpts<'a> {
15488    /// Secret used to populate the Authorization HTTP header
15489    #[builder(setter(into, strip_option), default)]
15490    pub auth_header: Option<Id>,
15491    /// Expected digest of the downloaded content (e.g., "sha256:...").
15492    #[builder(setter(into, strip_option), default)]
15493    pub checksum: Option<&'a str>,
15494    /// A service which must be started before the URL is fetched.
15495    #[builder(setter(into, strip_option), default)]
15496    pub experimental_service_host: Option<Id>,
15497    /// File name to use for the file. Defaults to the last part of the URL.
15498    #[builder(setter(into, strip_option), default)]
15499    pub name: Option<&'a str>,
15500    /// Permissions to set on the file.
15501    #[builder(setter(into, strip_option), default)]
15502    pub permissions: Option<isize>,
15503}
15504#[derive(Builder, Debug, PartialEq)]
15505pub struct QueryModuleSourceOpts<'a> {
15506    /// 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.
15507    #[builder(setter(into, strip_option), default)]
15508    pub allow_not_exists: Option<bool>,
15509    /// 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.
15510    #[builder(setter(into, strip_option), default)]
15511    pub disable_find_up: Option<bool>,
15512    /// The pinned version of the module source
15513    #[builder(setter(into, strip_option), default)]
15514    pub ref_pin: Option<&'a str>,
15515    /// If set, error out if the ref string is not of the provided requireKind.
15516    #[builder(setter(into, strip_option), default)]
15517    pub require_kind: Option<ModuleSourceKind>,
15518    /// Version query for a Git module source.
15519    #[builder(setter(into, strip_option), default)]
15520    pub version: Option<&'a str>,
15521}
15522#[derive(Builder, Debug, PartialEq)]
15523pub struct QueryCurrentTypeDefsOpts {
15524    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
15525    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
15526    #[builder(setter(into, strip_option), default)]
15527    pub hide_core: Option<bool>,
15528    /// Return the full referenced typedef closure instead of only top-level served typedefs.
15529    #[builder(setter(into, strip_option), default)]
15530    pub return_all_types: Option<bool>,
15531}
15532#[derive(Builder, Debug, PartialEq)]
15533pub struct QueryServeModuleOpts<'a> {
15534    /// The pinned version of a remote module address.
15535    #[builder(setter(into, strip_option), default)]
15536    pub ref_pin: Option<&'a str>,
15537}
15538#[derive(Builder, Debug, PartialEq)]
15539pub struct QueryLlmOpts<'a> {
15540    /// The model to converse with, e.g. "claude-sonnet-4-5" or "gpt-5.4". Defaults to the configured default model.
15541    #[builder(setter(into, strip_option), default)]
15542    pub model: Option<&'a str>,
15543    /// 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.
15544    #[builder(setter(into, strip_option), default)]
15545    pub provider: Option<&'a str>,
15546}
15547#[derive(Builder, Debug, PartialEq)]
15548pub struct QueryEnvFileOpts {
15549    /// Replace "${VAR}" or "$VAR" with the value of other vars
15550    #[builder(setter(into, strip_option), default)]
15551    pub expand: Option<bool>,
15552}
15553impl IntoID<Id> for Query {
15554    fn into_id(
15555        self,
15556    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15557        Box::pin(async move { self.id().await })
15558    }
15559}
15560impl Loadable for Query {
15561    fn graphql_type() -> &'static str {
15562        "Query"
15563    }
15564    fn from_query(
15565        proc: Option<Arc<DaggerSessionProc>>,
15566        selection: Selection,
15567        graphql_client: DynGraphQLClient,
15568    ) -> Self {
15569        Self {
15570            proc,
15571            selection,
15572            graphql_client,
15573        }
15574    }
15575}
15576impl Query {
15577    /// A unique identifier for this Query.
15578    pub async fn id(&self) -> Result<Id, DaggerError> {
15579        let query = self.selection.select("id");
15580        query.execute(self.graphql_client.clone()).await
15581    }
15582    /// Load any object by its ID.
15583    pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
15584        let mut query = self.selection.select("node");
15585        query = query.arg_lazy(
15586            "id",
15587            Box::new(move || {
15588                let id = id.clone();
15589                Box::pin(async move { id.into_id().await.unwrap().quote() })
15590            }),
15591        );
15592        let query = query.select("id");
15593        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15594        Ok(id.map(|id| NodeClient {
15595            proc: self.proc.clone(),
15596            selection: query
15597                .root()
15598                .select("node")
15599                .arg("id", &id.0)
15600                .inline_fragment("Node"),
15601            graphql_client: self.graphql_client.clone(),
15602        }))
15603    }
15604    /// Get the current Dagger Engine version.
15605    pub async fn version(&self) -> Result<String, DaggerError> {
15606        let query = self.selection.select("version");
15607        query.execute(self.graphql_client.clone()).await
15608    }
15609    /// The current UTC time in RFC3339 format. Never cached.
15610    pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
15611        let query = self.selection.select("currentTimestamp");
15612        query.execute(self.graphql_client.clone()).await
15613    }
15614    /// Name the current session.
15615    /// 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.
15616    ///
15617    /// # Arguments
15618    ///
15619    /// * `title` - The title, sanitized to a single printable line.
15620    pub async fn set_session_title(&self, title: impl Into<String>) -> Result<Void, DaggerError> {
15621        let mut query = self.selection.select("setSessionTitle");
15622        query = query.arg("title", title.into());
15623        query.execute(self.graphql_client.clone()).await
15624    }
15625    /// Creates an empty directory.
15626    pub fn directory(&self) -> Directory {
15627        let query = self.selection.select("directory");
15628        Directory {
15629            proc: self.proc.clone(),
15630            selection: query,
15631            graphql_client: self.graphql_client.clone(),
15632        }
15633    }
15634    /// Creates an empty changeset
15635    pub fn changeset(&self) -> Changeset {
15636        let query = self.selection.select("changeset");
15637        Changeset {
15638            proc: self.proc.clone(),
15639            selection: query,
15640            graphql_client: self.graphql_client.clone(),
15641        }
15642    }
15643    /// Creates a file with the specified contents.
15644    ///
15645    /// # Arguments
15646    ///
15647    /// * `name` - Name of the new file. Example: "foo.txt"
15648    /// * `contents` - Contents of the new file. Example: "Hello world!"
15649    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15650    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
15651        let mut query = self.selection.select("file");
15652        query = query.arg("name", name.into());
15653        query = query.arg("contents", contents.into());
15654        File {
15655            proc: self.proc.clone(),
15656            selection: query,
15657            graphql_client: self.graphql_client.clone(),
15658        }
15659    }
15660    /// Creates a file with the specified contents.
15661    ///
15662    /// # Arguments
15663    ///
15664    /// * `name` - Name of the new file. Example: "foo.txt"
15665    /// * `contents` - Contents of the new file. Example: "Hello world!"
15666    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15667    pub fn file_opts(
15668        &self,
15669        name: impl Into<String>,
15670        contents: impl Into<String>,
15671        opts: QueryFileOpts,
15672    ) -> File {
15673        let mut query = self.selection.select("file");
15674        query = query.arg("name", name.into());
15675        query = query.arg("contents", contents.into());
15676        if let Some(permissions) = opts.permissions {
15677            query = query.arg("permissions", permissions);
15678        }
15679        File {
15680            proc: self.proc.clone(),
15681            selection: query,
15682            graphql_client: self.graphql_client.clone(),
15683        }
15684    }
15685    /// Creates a file from arbitrary binary contents.
15686    ///
15687    /// # Arguments
15688    ///
15689    /// * `name` - Name of the new file. Example: "archive.tar"
15690    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
15691    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15692    pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
15693        let mut query = self.selection.select("blob");
15694        query = query.arg("name", name.into());
15695        query = query.arg("contents", contents);
15696        File {
15697            proc: self.proc.clone(),
15698            selection: query,
15699            graphql_client: self.graphql_client.clone(),
15700        }
15701    }
15702    /// Creates a file from arbitrary binary contents.
15703    ///
15704    /// # Arguments
15705    ///
15706    /// * `name` - Name of the new file. Example: "archive.tar"
15707    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
15708    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15709    pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
15710        let mut query = self.selection.select("blob");
15711        query = query.arg("name", name.into());
15712        query = query.arg("contents", contents);
15713        if let Some(permissions) = opts.permissions {
15714            query = query.arg("permissions", permissions);
15715        }
15716        File {
15717            proc: self.proc.clone(),
15718            selection: query,
15719            graphql_client: self.graphql_client.clone(),
15720        }
15721    }
15722    /// Queries a Git repository.
15723    ///
15724    /// # Arguments
15725    ///
15726    /// * `url` - URL of the git repository.
15727    ///
15728    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
15729    ///
15730    /// Suffix ".git" is optional.
15731    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15732    pub fn git(&self, url: impl Into<String>) -> GitRepository {
15733        let mut query = self.selection.select("git");
15734        query = query.arg("url", url.into());
15735        GitRepository {
15736            proc: self.proc.clone(),
15737            selection: query,
15738            graphql_client: self.graphql_client.clone(),
15739        }
15740    }
15741    /// Queries a Git repository.
15742    ///
15743    /// # Arguments
15744    ///
15745    /// * `url` - URL of the git repository.
15746    ///
15747    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
15748    ///
15749    /// Suffix ".git" is optional.
15750    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15751    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
15752        let mut query = self.selection.select("git");
15753        query = query.arg("url", url.into());
15754        if let Some(keep_git_dir) = opts.keep_git_dir {
15755            query = query.arg("keepGitDir", keep_git_dir);
15756        }
15757        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
15758            query = query.arg("sshKnownHosts", ssh_known_hosts);
15759        }
15760        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
15761            query = query.arg("sshAuthSocket", ssh_auth_socket);
15762        }
15763        if let Some(http_auth_username) = opts.http_auth_username {
15764            query = query.arg("httpAuthUsername", http_auth_username);
15765        }
15766        if let Some(http_auth_token) = opts.http_auth_token {
15767            query = query.arg("httpAuthToken", http_auth_token);
15768        }
15769        if let Some(http_auth_header) = opts.http_auth_header {
15770            query = query.arg("httpAuthHeader", http_auth_header);
15771        }
15772        if let Some(experimental_service_host) = opts.experimental_service_host {
15773            query = query.arg("experimentalServiceHost", experimental_service_host);
15774        }
15775        GitRepository {
15776            proc: self.proc.clone(),
15777            selection: query,
15778            graphql_client: self.graphql_client.clone(),
15779        }
15780    }
15781    /// Creates a scratch container, with no image or metadata.
15782    /// To pull an image, follow up with the "from" function.
15783    ///
15784    /// # Arguments
15785    ///
15786    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15787    pub fn container(&self) -> Container {
15788        let query = self.selection.select("container");
15789        Container {
15790            proc: self.proc.clone(),
15791            selection: query,
15792            graphql_client: self.graphql_client.clone(),
15793        }
15794    }
15795    /// Creates a scratch container, with no image or metadata.
15796    /// To pull an image, follow up with the "from" function.
15797    ///
15798    /// # Arguments
15799    ///
15800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15801    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
15802        let mut query = self.selection.select("container");
15803        if let Some(platform) = opts.platform {
15804            query = query.arg("platform", platform);
15805        }
15806        Container {
15807            proc: self.proc.clone(),
15808            selection: query,
15809            graphql_client: self.graphql_client.clone(),
15810        }
15811    }
15812    /// Constructs a cache volume for a given cache key.
15813    ///
15814    /// # Arguments
15815    ///
15816    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
15817    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15818    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
15819        let mut query = self.selection.select("cacheVolume");
15820        query = query.arg("key", key.into());
15821        CacheVolume {
15822            proc: self.proc.clone(),
15823            selection: query,
15824            graphql_client: self.graphql_client.clone(),
15825        }
15826    }
15827    /// Constructs a cache volume for a given cache key.
15828    ///
15829    /// # Arguments
15830    ///
15831    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
15832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15833    pub fn cache_volume_opts<'a>(
15834        &self,
15835        key: impl Into<String>,
15836        opts: QueryCacheVolumeOpts<'a>,
15837    ) -> CacheVolume {
15838        let mut query = self.selection.select("cacheVolume");
15839        query = query.arg("key", key.into());
15840        if let Some(source) = opts.source {
15841            query = query.arg("source", source);
15842        }
15843        if let Some(sharing) = opts.sharing {
15844            query = query.arg("sharing", sharing);
15845        }
15846        if let Some(owner) = opts.owner {
15847            query = query.arg("owner", owner);
15848        }
15849        CacheVolume {
15850            proc: self.proc.clone(),
15851            selection: query,
15852            graphql_client: self.graphql_client.clone(),
15853        }
15854    }
15855    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
15856    ///
15857    /// # Arguments
15858    ///
15859    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
15860    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15861    pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
15862        let mut query = self.selection.select("engineVolume");
15863        query = query.arg("name", name.into());
15864        Volume {
15865            proc: self.proc.clone(),
15866            selection: query,
15867            graphql_client: self.graphql_client.clone(),
15868        }
15869    }
15870    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
15871    ///
15872    /// # Arguments
15873    ///
15874    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
15875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15876    pub fn engine_volume_opts<'a>(
15877        &self,
15878        name: impl Into<String>,
15879        opts: QueryEngineVolumeOpts<'a>,
15880    ) -> Volume {
15881        let mut query = self.selection.select("engineVolume");
15882        query = query.arg("name", name.into());
15883        if let Some(subdir) = opts.subdir {
15884            query = query.arg("subdir", subdir);
15885        }
15886        Volume {
15887            proc: self.proc.clone(),
15888            selection: query,
15889            graphql_client: self.graphql_client.clone(),
15890        }
15891    }
15892    /// Constructs an SSHFS volume.
15893    ///
15894    /// # Arguments
15895    ///
15896    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
15897    /// * `private_key` - Private key secret used to authenticate to the remote host.
15898    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15899    pub fn sshfs_volume(
15900        &self,
15901        endpoint: impl Into<String>,
15902        private_key: impl IntoID<Id>,
15903    ) -> Volume {
15904        let mut query = self.selection.select("sshfsVolume");
15905        query = query.arg("endpoint", endpoint.into());
15906        query = query.arg_lazy(
15907            "privateKey",
15908            Box::new(move || {
15909                let private_key = private_key.clone();
15910                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15911            }),
15912        );
15913        Volume {
15914            proc: self.proc.clone(),
15915            selection: query,
15916            graphql_client: self.graphql_client.clone(),
15917        }
15918    }
15919    /// Constructs an SSHFS volume.
15920    ///
15921    /// # Arguments
15922    ///
15923    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
15924    /// * `private_key` - Private key secret used to authenticate to the remote host.
15925    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15926    pub fn sshfs_volume_opts<'a>(
15927        &self,
15928        endpoint: impl Into<String>,
15929        private_key: impl IntoID<Id>,
15930        opts: QuerySshfsVolumeOpts<'a>,
15931    ) -> Volume {
15932        let mut query = self.selection.select("sshfsVolume");
15933        query = query.arg("endpoint", endpoint.into());
15934        query = query.arg_lazy(
15935            "privateKey",
15936            Box::new(move || {
15937                let private_key = private_key.clone();
15938                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15939            }),
15940        );
15941        if let Some(known_hosts) = opts.known_hosts {
15942            query = query.arg("knownHosts", known_hosts);
15943        }
15944        if let Some(cache_key) = opts.cache_key {
15945            query = query.arg("cacheKey", cache_key);
15946        }
15947        if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
15948            query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
15949        }
15950        if let Some(experimental_service_host) = opts.experimental_service_host {
15951            query = query.arg("experimentalServiceHost", experimental_service_host);
15952        }
15953        Volume {
15954            proc: self.proc.clone(),
15955            selection: query,
15956            graphql_client: self.graphql_client.clone(),
15957        }
15958    }
15959    /// Creates a new secret.
15960    ///
15961    /// # Arguments
15962    ///
15963    /// * `uri` - The URI of the secret store
15964    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15965    pub fn secret(&self, uri: impl Into<String>) -> Secret {
15966        let mut query = self.selection.select("secret");
15967        query = query.arg("uri", uri.into());
15968        Secret {
15969            proc: self.proc.clone(),
15970            selection: query,
15971            graphql_client: self.graphql_client.clone(),
15972        }
15973    }
15974    /// Creates a new secret.
15975    ///
15976    /// # Arguments
15977    ///
15978    /// * `uri` - The URI of the secret store
15979    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15980    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
15981        let mut query = self.selection.select("secret");
15982        query = query.arg("uri", uri.into());
15983        if let Some(cache_key) = opts.cache_key {
15984            query = query.arg("cacheKey", cache_key);
15985        }
15986        Secret {
15987            proc: self.proc.clone(),
15988            selection: query,
15989            graphql_client: self.graphql_client.clone(),
15990        }
15991    }
15992    /// Sets a secret given a user defined name to its plaintext and returns the secret.
15993    /// The plaintext value is limited to a size of 128000 bytes.
15994    ///
15995    /// # Arguments
15996    ///
15997    /// * `name` - The user defined name for this secret
15998    /// * `plaintext` - The plaintext of the secret
15999    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
16000        let mut query = self.selection.select("setSecret");
16001        query = query.arg("name", name.into());
16002        query = query.arg("plaintext", plaintext.into());
16003        Secret {
16004            proc: self.proc.clone(),
16005            selection: query,
16006            graphql_client: self.graphql_client.clone(),
16007        }
16008    }
16009    /// Queries the host environment.
16010    pub fn host(&self) -> Host {
16011        let query = self.selection.select("host");
16012        Host {
16013            proc: self.proc.clone(),
16014            selection: query,
16015            graphql_client: self.graphql_client.clone(),
16016        }
16017    }
16018    /// Returns a file containing an http remote url content.
16019    ///
16020    /// # Arguments
16021    ///
16022    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
16023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16024    pub fn http(&self, url: impl Into<String>) -> File {
16025        let mut query = self.selection.select("http");
16026        query = query.arg("url", url.into());
16027        File {
16028            proc: self.proc.clone(),
16029            selection: query,
16030            graphql_client: self.graphql_client.clone(),
16031        }
16032    }
16033    /// Returns a file containing an http remote url content.
16034    ///
16035    /// # Arguments
16036    ///
16037    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
16038    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16039    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
16040        let mut query = self.selection.select("http");
16041        query = query.arg("url", url.into());
16042        if let Some(name) = opts.name {
16043            query = query.arg("name", name);
16044        }
16045        if let Some(permissions) = opts.permissions {
16046            query = query.arg("permissions", permissions);
16047        }
16048        if let Some(checksum) = opts.checksum {
16049            query = query.arg("checksum", checksum);
16050        }
16051        if let Some(auth_header) = opts.auth_header {
16052            query = query.arg("authHeader", auth_header);
16053        }
16054        if let Some(experimental_service_host) = opts.experimental_service_host {
16055            query = query.arg("experimentalServiceHost", experimental_service_host);
16056        }
16057        File {
16058            proc: self.proc.clone(),
16059            selection: query,
16060            graphql_client: self.graphql_client.clone(),
16061        }
16062    }
16063    /// The default platform of the engine.
16064    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
16065        let query = self.selection.select("defaultPlatform");
16066        query.execute(self.graphql_client.clone()).await
16067    }
16068    /// Create a new module source instance from a source ref string
16069    ///
16070    /// # Arguments
16071    ///
16072    /// * `ref_string` - The string ref representation of the module source
16073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16074    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
16075        let mut query = self.selection.select("moduleSource");
16076        query = query.arg("refString", ref_string.into());
16077        ModuleSource {
16078            proc: self.proc.clone(),
16079            selection: query,
16080            graphql_client: self.graphql_client.clone(),
16081        }
16082    }
16083    /// Create a new module source instance from a source ref string
16084    ///
16085    /// # Arguments
16086    ///
16087    /// * `ref_string` - The string ref representation of the module source
16088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16089    pub fn module_source_opts<'a>(
16090        &self,
16091        ref_string: impl Into<String>,
16092        opts: QueryModuleSourceOpts<'a>,
16093    ) -> ModuleSource {
16094        let mut query = self.selection.select("moduleSource");
16095        query = query.arg("refString", ref_string.into());
16096        if let Some(version) = opts.version {
16097            query = query.arg("version", version);
16098        }
16099        if let Some(ref_pin) = opts.ref_pin {
16100            query = query.arg("refPin", ref_pin);
16101        }
16102        if let Some(disable_find_up) = opts.disable_find_up {
16103            query = query.arg("disableFindUp", disable_find_up);
16104        }
16105        if let Some(allow_not_exists) = opts.allow_not_exists {
16106            query = query.arg("allowNotExists", allow_not_exists);
16107        }
16108        if let Some(require_kind) = opts.require_kind {
16109            query = query.arg("requireKind", require_kind);
16110        }
16111        ModuleSource {
16112            proc: self.proc.clone(),
16113            selection: query,
16114            graphql_client: self.graphql_client.clone(),
16115        }
16116    }
16117    /// Create a new module.
16118    pub fn module(&self) -> Module {
16119        let query = self.selection.select("module");
16120        Module {
16121            proc: self.proc.clone(),
16122            selection: query,
16123            graphql_client: self.graphql_client.clone(),
16124        }
16125    }
16126    /// Create a new TypeDef.
16127    pub fn type_def(&self) -> TypeDef {
16128        let query = self.selection.select("typeDef");
16129        TypeDef {
16130            proc: self.proc.clone(),
16131            selection: query,
16132            graphql_client: self.graphql_client.clone(),
16133        }
16134    }
16135    /// Create a code generation result, given a directory containing the generated code.
16136    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
16137        let mut query = self.selection.select("generatedCode");
16138        query = query.arg_lazy(
16139            "code",
16140            Box::new(move || {
16141                let code = code.clone();
16142                Box::pin(async move { code.into_id().await.unwrap().quote() })
16143            }),
16144        );
16145        GeneratedCode {
16146            proc: self.proc.clone(),
16147            selection: query,
16148            graphql_client: self.graphql_client.clone(),
16149        }
16150    }
16151    /// Creates a function.
16152    ///
16153    /// # Arguments
16154    ///
16155    /// * `name` - Name of the function, in its original format from the implementation language.
16156    /// * `return_type` - Return type of the function.
16157    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
16158        let mut query = self.selection.select("function");
16159        query = query.arg("name", name.into());
16160        query = query.arg_lazy(
16161            "returnType",
16162            Box::new(move || {
16163                let return_type = return_type.clone();
16164                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
16165            }),
16166        );
16167        Function {
16168            proc: self.proc.clone(),
16169            selection: query,
16170            graphql_client: self.graphql_client.clone(),
16171        }
16172    }
16173    /// Creates source map metadata.
16174    ///
16175    /// # Arguments
16176    ///
16177    /// * `filename` - The filename from the module source.
16178    /// * `line` - The line number within the filename.
16179    /// * `column` - The column number within the line.
16180    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
16181        let mut query = self.selection.select("sourceMap");
16182        query = query.arg("filename", filename.into());
16183        query = query.arg("line", line);
16184        query = query.arg("column", column);
16185        SourceMap {
16186            proc: self.proc.clone(),
16187            selection: query,
16188            graphql_client: self.graphql_client.clone(),
16189        }
16190    }
16191    /// The module currently being served in the session, if any.
16192    pub fn current_module(&self) -> CurrentModule {
16193        let query = self.selection.select("currentModule");
16194        CurrentModule {
16195            proc: self.proc.clone(),
16196            selection: query,
16197            graphql_client: self.graphql_client.clone(),
16198        }
16199    }
16200    /// The TypeDef representations of the objects currently being served in the session.
16201    ///
16202    /// # Arguments
16203    ///
16204    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16205    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
16206        let query = self.selection.select("currentTypeDefs");
16207        let query = query.select("id");
16208        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16209        Ok(ids
16210            .into_iter()
16211            .map(|id| TypeDef {
16212                proc: self.proc.clone(),
16213                selection: crate::querybuilder::query()
16214                    .select("node")
16215                    .arg("id", &id.0)
16216                    .inline_fragment("TypeDef"),
16217                graphql_client: self.graphql_client.clone(),
16218            })
16219            .collect())
16220    }
16221    /// The TypeDef representations of the objects currently being served in the session.
16222    ///
16223    /// # Arguments
16224    ///
16225    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16226    pub async fn current_type_defs_opts(
16227        &self,
16228        opts: QueryCurrentTypeDefsOpts,
16229    ) -> Result<Vec<TypeDef>, DaggerError> {
16230        let mut query = self.selection.select("currentTypeDefs");
16231        if let Some(return_all_types) = opts.return_all_types {
16232            query = query.arg("returnAllTypes", return_all_types);
16233        }
16234        if let Some(hide_core) = opts.hide_core {
16235            query = query.arg("hideCore", hide_core);
16236        }
16237        let query = query.select("id");
16238        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16239        Ok(ids
16240            .into_iter()
16241            .map(|id| TypeDef {
16242                proc: self.proc.clone(),
16243                selection: crate::querybuilder::query()
16244                    .select("node")
16245                    .arg("id", &id.0)
16246                    .inline_fragment("TypeDef"),
16247                graphql_client: self.graphql_client.clone(),
16248            })
16249            .collect())
16250    }
16251    /// The FunctionCall context that the SDK caller is currently executing in.
16252    /// If the caller is not currently executing in a function, this will return an error.
16253    pub fn current_function_call(&self) -> FunctionCall {
16254        let query = self.selection.select("currentFunctionCall");
16255        FunctionCall {
16256            proc: self.proc.clone(),
16257            selection: query,
16258            graphql_client: self.graphql_client.clone(),
16259        }
16260    }
16261    /// Load the module at the given address and serve its API in the current session.
16262    /// 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.
16263    ///
16264    /// # Arguments
16265    ///
16266    /// * `address` - A module address, or an explicit path into the caller's workspace.
16267    ///
16268    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16269    ///
16270    /// Installed module names are not accepted.
16271    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16272    pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
16273        let mut query = self.selection.select("serveModule");
16274        query = query.arg("address", address.into());
16275        query.execute(self.graphql_client.clone()).await
16276    }
16277    /// Load the module at the given address and serve its API in the current session.
16278    /// 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.
16279    ///
16280    /// # Arguments
16281    ///
16282    /// * `address` - A module address, or an explicit path into the caller's workspace.
16283    ///
16284    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16285    ///
16286    /// Installed module names are not accepted.
16287    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16288    pub async fn serve_module_opts<'a>(
16289        &self,
16290        address: impl Into<String>,
16291        opts: QueryServeModuleOpts<'a>,
16292    ) -> Result<Void, DaggerError> {
16293        let mut query = self.selection.select("serveModule");
16294        query = query.arg("address", address.into());
16295        if let Some(ref_pin) = opts.ref_pin {
16296            query = query.arg("refPin", ref_pin);
16297        }
16298        query.execute(self.graphql_client.clone()).await
16299    }
16300    /// 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).
16301    pub fn current_node(&self) -> NodeClient {
16302        let query = self.selection.select("currentNode");
16303        NodeClient {
16304            proc: self.proc.clone(),
16305            selection: query,
16306            graphql_client: self.graphql_client.clone(),
16307        }
16308    }
16309    /// Create a new error.
16310    ///
16311    /// # Arguments
16312    ///
16313    /// * `message` - A brief description of the error.
16314    pub fn error(&self, message: impl Into<String>) -> Error {
16315        let mut query = self.selection.select("error");
16316        query = query.arg("message", message.into());
16317        Error {
16318            proc: self.proc.clone(),
16319            selection: query,
16320            graphql_client: self.graphql_client.clone(),
16321        }
16322    }
16323    /// The Dagger engine container configuration and state
16324    pub fn engine(&self) -> Engine {
16325        let query = self.selection.select("engine");
16326        Engine {
16327            proc: self.proc.clone(),
16328            selection: query,
16329            graphql_client: self.graphql_client.clone(),
16330        }
16331    }
16332    /// Dagger Cloud configuration and state
16333    pub fn cloud(&self) -> Cloud {
16334        let query = self.selection.select("cloud");
16335        Cloud {
16336            proc: self.proc.clone(),
16337            selection: query,
16338            graphql_client: self.graphql_client.clone(),
16339        }
16340    }
16341    /// Initialize a new LLM conversation.
16342    ///
16343    /// # Arguments
16344    ///
16345    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16346    pub fn llm(&self) -> Llm {
16347        let query = self.selection.select("llm");
16348        Llm {
16349            proc: self.proc.clone(),
16350            selection: query,
16351            graphql_client: self.graphql_client.clone(),
16352        }
16353    }
16354    /// Initialize a new LLM conversation.
16355    ///
16356    /// # Arguments
16357    ///
16358    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16359    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
16360        let mut query = self.selection.select("llm");
16361        if let Some(model) = opts.model {
16362            query = query.arg("model", model);
16363        }
16364        if let Some(provider) = opts.provider {
16365            query = query.arg("provider", provider);
16366        }
16367        Llm {
16368            proc: self.proc.clone(),
16369            selection: query,
16370            graphql_client: self.graphql_client.clone(),
16371        }
16372    }
16373    /// Start an empty run of text and media content, independent of any conversation.
16374    /// 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.
16375    pub fn llm_content(&self) -> LlmContent {
16376        let query = self.selection.select("llmContent");
16377        LlmContent {
16378            proc: self.proc.clone(),
16379            selection: query,
16380            graphql_client: self.graphql_client.clone(),
16381        }
16382    }
16383    /// Initialize a JSON value
16384    pub fn json(&self) -> JsonValue {
16385        let query = self.selection.select("json");
16386        JsonValue {
16387            proc: self.proc.clone(),
16388            selection: query,
16389            graphql_client: self.graphql_client.clone(),
16390        }
16391    }
16392    /// Load a GraphQL introspection schema for merging.
16393    ///
16394    /// # Arguments
16395    ///
16396    /// * `json` - The introspection schema JSON to load.
16397    pub fn schema(&self, json: Json) -> Schema {
16398        let mut query = self.selection.select("schema");
16399        query = query.arg("json", json);
16400        Schema {
16401            proc: self.proc.clone(),
16402            selection: query,
16403            graphql_client: self.graphql_client.clone(),
16404        }
16405    }
16406    /// Initialize an environment file
16407    ///
16408    /// # Arguments
16409    ///
16410    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16411    pub fn env_file(&self) -> EnvFile {
16412        let query = self.selection.select("envFile");
16413        EnvFile {
16414            proc: self.proc.clone(),
16415            selection: query,
16416            graphql_client: self.graphql_client.clone(),
16417        }
16418    }
16419    /// Initialize an environment file
16420    ///
16421    /// # Arguments
16422    ///
16423    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16424    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
16425        let mut query = self.selection.select("envFile");
16426        if let Some(expand) = opts.expand {
16427            query = query.arg("expand", expand);
16428        }
16429        EnvFile {
16430            proc: self.proc.clone(),
16431            selection: query,
16432            graphql_client: self.graphql_client.clone(),
16433        }
16434    }
16435    /// Resolve external references only.
16436    pub fn address(&self, value: impl Into<String>) -> Address {
16437        let mut query = self.selection.select("address");
16438        query = query.arg("value", value.into());
16439        Address {
16440            proc: self.proc.clone(),
16441            selection: query,
16442            graphql_client: self.graphql_client.clone(),
16443        }
16444    }
16445    /// Detect and return the current workspace.
16446    pub fn current_workspace(&self) -> Workspace {
16447        let query = self.selection.select("currentWorkspace");
16448        Workspace {
16449            proc: self.proc.clone(),
16450            selection: query,
16451            graphql_client: self.graphql_client.clone(),
16452        }
16453    }
16454}
16455impl Node for Query {
16456    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16457        let query = self.selection.select("id");
16458        let graphql_client = self.graphql_client.clone();
16459        async move { query.execute(graphql_client).await }
16460    }
16461}
16462#[derive(Clone)]
16463pub struct RemoteGitMirror {
16464    pub proc: Option<Arc<DaggerSessionProc>>,
16465    pub selection: Selection,
16466    pub graphql_client: DynGraphQLClient,
16467}
16468impl IntoID<Id> for RemoteGitMirror {
16469    fn into_id(
16470        self,
16471    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16472        Box::pin(async move { self.id().await })
16473    }
16474}
16475impl Loadable for RemoteGitMirror {
16476    fn graphql_type() -> &'static str {
16477        "RemoteGitMirror"
16478    }
16479    fn from_query(
16480        proc: Option<Arc<DaggerSessionProc>>,
16481        selection: Selection,
16482        graphql_client: DynGraphQLClient,
16483    ) -> Self {
16484        Self {
16485            proc,
16486            selection,
16487            graphql_client,
16488        }
16489    }
16490}
16491impl RemoteGitMirror {
16492    /// A unique identifier for this RemoteGitMirror.
16493    pub async fn id(&self) -> Result<Id, DaggerError> {
16494        let query = self.selection.select("id");
16495        query.execute(self.graphql_client.clone()).await
16496    }
16497}
16498impl Node for RemoteGitMirror {
16499    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16500        let query = self.selection.select("id");
16501        let graphql_client = self.graphql_client.clone();
16502        async move { query.execute(graphql_client).await }
16503    }
16504}
16505#[derive(Clone)]
16506pub struct SdkConfig {
16507    pub proc: Option<Arc<DaggerSessionProc>>,
16508    pub selection: Selection,
16509    pub graphql_client: DynGraphQLClient,
16510}
16511impl IntoID<Id> for SdkConfig {
16512    fn into_id(
16513        self,
16514    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16515        Box::pin(async move { self.id().await })
16516    }
16517}
16518impl Loadable for SdkConfig {
16519    fn graphql_type() -> &'static str {
16520        "SDKConfig"
16521    }
16522    fn from_query(
16523        proc: Option<Arc<DaggerSessionProc>>,
16524        selection: Selection,
16525        graphql_client: DynGraphQLClient,
16526    ) -> Self {
16527        Self {
16528            proc,
16529            selection,
16530            graphql_client,
16531        }
16532    }
16533}
16534impl SdkConfig {
16535    /// A unique identifier for this SDKConfig.
16536    pub async fn id(&self) -> Result<Id, DaggerError> {
16537        let query = self.selection.select("id");
16538        query.execute(self.graphql_client.clone()).await
16539    }
16540    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
16541    pub async fn source(&self) -> Result<String, DaggerError> {
16542        let query = self.selection.select("source");
16543        query.execute(self.graphql_client.clone()).await
16544    }
16545    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
16546    pub async fn debug(&self) -> Result<bool, DaggerError> {
16547        let query = self.selection.select("debug");
16548        query.execute(self.graphql_client.clone()).await
16549    }
16550}
16551impl Node for SdkConfig {
16552    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16553        let query = self.selection.select("id");
16554        let graphql_client = self.graphql_client.clone();
16555        async move { query.execute(graphql_client).await }
16556    }
16557}
16558#[derive(Clone)]
16559pub struct ScalarTypeDef {
16560    pub proc: Option<Arc<DaggerSessionProc>>,
16561    pub selection: Selection,
16562    pub graphql_client: DynGraphQLClient,
16563}
16564impl IntoID<Id> for ScalarTypeDef {
16565    fn into_id(
16566        self,
16567    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16568        Box::pin(async move { self.id().await })
16569    }
16570}
16571impl Loadable for ScalarTypeDef {
16572    fn graphql_type() -> &'static str {
16573        "ScalarTypeDef"
16574    }
16575    fn from_query(
16576        proc: Option<Arc<DaggerSessionProc>>,
16577        selection: Selection,
16578        graphql_client: DynGraphQLClient,
16579    ) -> Self {
16580        Self {
16581            proc,
16582            selection,
16583            graphql_client,
16584        }
16585    }
16586}
16587impl ScalarTypeDef {
16588    /// A unique identifier for this ScalarTypeDef.
16589    pub async fn id(&self) -> Result<Id, DaggerError> {
16590        let query = self.selection.select("id");
16591        query.execute(self.graphql_client.clone()).await
16592    }
16593    /// The name of the scalar.
16594    pub async fn name(&self) -> Result<String, DaggerError> {
16595        let query = self.selection.select("name");
16596        query.execute(self.graphql_client.clone()).await
16597    }
16598    /// A doc string for the scalar, if any.
16599    pub async fn description(&self) -> Result<String, DaggerError> {
16600        let query = self.selection.select("description");
16601        query.execute(self.graphql_client.clone()).await
16602    }
16603    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
16604    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
16605        let query = self.selection.select("sourceModuleName");
16606        query.execute(self.graphql_client.clone()).await
16607    }
16608}
16609impl Node for ScalarTypeDef {
16610    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16611        let query = self.selection.select("id");
16612        let graphql_client = self.graphql_client.clone();
16613        async move { query.execute(graphql_client).await }
16614    }
16615}
16616#[derive(Clone)]
16617pub struct Schema {
16618    pub proc: Option<Arc<DaggerSessionProc>>,
16619    pub selection: Selection,
16620    pub graphql_client: DynGraphQLClient,
16621}
16622impl IntoID<Id> for Schema {
16623    fn into_id(
16624        self,
16625    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16626        Box::pin(async move { self.id().await })
16627    }
16628}
16629impl Loadable for Schema {
16630    fn graphql_type() -> &'static str {
16631        "Schema"
16632    }
16633    fn from_query(
16634        proc: Option<Arc<DaggerSessionProc>>,
16635        selection: Selection,
16636        graphql_client: DynGraphQLClient,
16637    ) -> Self {
16638        Self {
16639            proc,
16640            selection,
16641            graphql_client,
16642        }
16643    }
16644}
16645impl Schema {
16646    /// A unique identifier for this Schema.
16647    pub async fn id(&self) -> Result<Id, DaggerError> {
16648        let query = self.selection.select("id");
16649        query.execute(self.graphql_client.clone()).await
16650    }
16651    /// Serialize the schema back to introspection JSON.
16652    pub async fn contents(&self) -> Result<Json, DaggerError> {
16653        let query = self.selection.select("contents");
16654        query.execute(self.graphql_client.clone()).await
16655    }
16656    /// Merge a module's introspection-shaped type definitions into the schema, returning the combined schema.
16657    ///
16658    /// # Arguments
16659    ///
16660    /// * `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.
16661    /// * `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.
16662    pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
16663        let mut query = self.selection.select("merge");
16664        query = query.arg("moduleTypes", module_types);
16665        query = query.arg("moduleName", module_name.into());
16666        Schema {
16667            proc: self.proc.clone(),
16668            selection: query,
16669            graphql_client: self.graphql_client.clone(),
16670        }
16671    }
16672}
16673impl Node for Schema {
16674    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16675        let query = self.selection.select("id");
16676        let graphql_client = self.graphql_client.clone();
16677        async move { query.execute(graphql_client).await }
16678    }
16679}
16680#[derive(Clone)]
16681pub struct SearchResult {
16682    pub proc: Option<Arc<DaggerSessionProc>>,
16683    pub selection: Selection,
16684    pub graphql_client: DynGraphQLClient,
16685}
16686impl IntoID<Id> for SearchResult {
16687    fn into_id(
16688        self,
16689    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16690        Box::pin(async move { self.id().await })
16691    }
16692}
16693impl Loadable for SearchResult {
16694    fn graphql_type() -> &'static str {
16695        "SearchResult"
16696    }
16697    fn from_query(
16698        proc: Option<Arc<DaggerSessionProc>>,
16699        selection: Selection,
16700        graphql_client: DynGraphQLClient,
16701    ) -> Self {
16702        Self {
16703            proc,
16704            selection,
16705            graphql_client,
16706        }
16707    }
16708}
16709impl SearchResult {
16710    /// A unique identifier for this SearchResult.
16711    pub async fn id(&self) -> Result<Id, DaggerError> {
16712        let query = self.selection.select("id");
16713        query.execute(self.graphql_client.clone()).await
16714    }
16715    /// The path to the file that matched.
16716    pub async fn file_path(&self) -> Result<String, DaggerError> {
16717        let query = self.selection.select("filePath");
16718        query.execute(self.graphql_client.clone()).await
16719    }
16720    /// The first line that matched.
16721    pub async fn line_number(&self) -> Result<isize, DaggerError> {
16722        let query = self.selection.select("lineNumber");
16723        query.execute(self.graphql_client.clone()).await
16724    }
16725    /// The byte offset of this line within the file.
16726    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
16727        let query = self.selection.select("absoluteOffset");
16728        query.execute(self.graphql_client.clone()).await
16729    }
16730    /// The line content that matched.
16731    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
16732        let query = self.selection.select("matchedLines");
16733        query.execute(self.graphql_client.clone()).await
16734    }
16735    /// Sub-match positions and content within the matched lines.
16736    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
16737        let query = self.selection.select("submatches");
16738        let query = query.select("id");
16739        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16740        Ok(ids
16741            .into_iter()
16742            .map(|id| SearchSubmatch {
16743                proc: self.proc.clone(),
16744                selection: crate::querybuilder::query()
16745                    .select("node")
16746                    .arg("id", &id.0)
16747                    .inline_fragment("SearchSubmatch"),
16748                graphql_client: self.graphql_client.clone(),
16749            })
16750            .collect())
16751    }
16752}
16753impl Node for SearchResult {
16754    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16755        let query = self.selection.select("id");
16756        let graphql_client = self.graphql_client.clone();
16757        async move { query.execute(graphql_client).await }
16758    }
16759}
16760#[derive(Clone)]
16761pub struct SearchSubmatch {
16762    pub proc: Option<Arc<DaggerSessionProc>>,
16763    pub selection: Selection,
16764    pub graphql_client: DynGraphQLClient,
16765}
16766impl IntoID<Id> for SearchSubmatch {
16767    fn into_id(
16768        self,
16769    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16770        Box::pin(async move { self.id().await })
16771    }
16772}
16773impl Loadable for SearchSubmatch {
16774    fn graphql_type() -> &'static str {
16775        "SearchSubmatch"
16776    }
16777    fn from_query(
16778        proc: Option<Arc<DaggerSessionProc>>,
16779        selection: Selection,
16780        graphql_client: DynGraphQLClient,
16781    ) -> Self {
16782        Self {
16783            proc,
16784            selection,
16785            graphql_client,
16786        }
16787    }
16788}
16789impl SearchSubmatch {
16790    /// A unique identifier for this SearchSubmatch.
16791    pub async fn id(&self) -> Result<Id, DaggerError> {
16792        let query = self.selection.select("id");
16793        query.execute(self.graphql_client.clone()).await
16794    }
16795    /// The matched text.
16796    pub async fn text(&self) -> Result<String, DaggerError> {
16797        let query = self.selection.select("text");
16798        query.execute(self.graphql_client.clone()).await
16799    }
16800    /// The match's start offset within the matched lines.
16801    pub async fn start(&self) -> Result<isize, DaggerError> {
16802        let query = self.selection.select("start");
16803        query.execute(self.graphql_client.clone()).await
16804    }
16805    /// The match's end offset within the matched lines.
16806    pub async fn end(&self) -> Result<isize, DaggerError> {
16807        let query = self.selection.select("end");
16808        query.execute(self.graphql_client.clone()).await
16809    }
16810}
16811impl Node for SearchSubmatch {
16812    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16813        let query = self.selection.select("id");
16814        let graphql_client = self.graphql_client.clone();
16815        async move { query.execute(graphql_client).await }
16816    }
16817}
16818#[derive(Clone)]
16819pub struct Secret {
16820    pub proc: Option<Arc<DaggerSessionProc>>,
16821    pub selection: Selection,
16822    pub graphql_client: DynGraphQLClient,
16823}
16824impl IntoID<Id> for Secret {
16825    fn into_id(
16826        self,
16827    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16828        Box::pin(async move { self.id().await })
16829    }
16830}
16831impl Loadable for Secret {
16832    fn graphql_type() -> &'static str {
16833        "Secret"
16834    }
16835    fn from_query(
16836        proc: Option<Arc<DaggerSessionProc>>,
16837        selection: Selection,
16838        graphql_client: DynGraphQLClient,
16839    ) -> Self {
16840        Self {
16841            proc,
16842            selection,
16843            graphql_client,
16844        }
16845    }
16846}
16847impl Secret {
16848    /// A unique identifier for this Secret.
16849    pub async fn id(&self) -> Result<Id, DaggerError> {
16850        let query = self.selection.select("id");
16851        query.execute(self.graphql_client.clone()).await
16852    }
16853    /// The name of this secret.
16854    pub async fn name(&self) -> Result<String, DaggerError> {
16855        let query = self.selection.select("name");
16856        query.execute(self.graphql_client.clone()).await
16857    }
16858    /// The URI of this secret.
16859    pub async fn uri(&self) -> Result<String, DaggerError> {
16860        let query = self.selection.select("uri");
16861        query.execute(self.graphql_client.clone()).await
16862    }
16863    /// The value of this secret.
16864    pub async fn plaintext(&self) -> Result<String, DaggerError> {
16865        let query = self.selection.select("plaintext");
16866        query.execute(self.graphql_client.clone()).await
16867    }
16868}
16869impl Node for Secret {
16870    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16871        let query = self.selection.select("id");
16872        let graphql_client = self.graphql_client.clone();
16873        async move { query.execute(graphql_client).await }
16874    }
16875}
16876#[derive(Clone)]
16877pub struct Service {
16878    pub proc: Option<Arc<DaggerSessionProc>>,
16879    pub selection: Selection,
16880    pub graphql_client: DynGraphQLClient,
16881}
16882#[derive(Builder, Debug, PartialEq)]
16883pub struct ServicePortsOpts {
16884    /// Return only container ports declared before startup. Other service types return an empty list.
16885    #[builder(setter(into, strip_option), default)]
16886    pub declared: Option<bool>,
16887}
16888#[derive(Builder, Debug, PartialEq)]
16889pub struct ServiceEndpointOpts<'a> {
16890    /// The exposed port number for the endpoint
16891    #[builder(setter(into, strip_option), default)]
16892    pub port: Option<isize>,
16893    /// Return a URL with the given scheme, eg. http for http://
16894    #[builder(setter(into, strip_option), default)]
16895    pub scheme: Option<&'a str>,
16896}
16897#[derive(Builder, Debug, PartialEq)]
16898pub struct ServiceUpOpts {
16899    /// List of frontend/backend port mappings to forward.
16900    /// Frontend is the port accepting traffic on the host, backend is the service port.
16901    #[builder(setter(into, strip_option), default)]
16902    pub ports: Option<Vec<PortForward>>,
16903    /// Bind each tunnel port to a random port on the host.
16904    #[builder(setter(into, strip_option), default)]
16905    pub random: Option<bool>,
16906}
16907#[derive(Builder, Debug, PartialEq)]
16908pub struct ServiceStopOpts {
16909    /// Immediately kill the service without waiting for a graceful exit
16910    #[builder(setter(into, strip_option), default)]
16911    pub kill: Option<bool>,
16912}
16913#[derive(Builder, Debug, PartialEq)]
16914pub struct ServiceTerminalOpts<'a> {
16915    #[builder(setter(into, strip_option), default)]
16916    pub cmd: Option<Vec<&'a str>>,
16917}
16918impl IntoID<Id> for Service {
16919    fn into_id(
16920        self,
16921    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16922        Box::pin(async move { self.id().await })
16923    }
16924}
16925impl Loadable for Service {
16926    fn graphql_type() -> &'static str {
16927        "Service"
16928    }
16929    fn from_query(
16930        proc: Option<Arc<DaggerSessionProc>>,
16931        selection: Selection,
16932        graphql_client: DynGraphQLClient,
16933    ) -> Self {
16934        Self {
16935            proc,
16936            selection,
16937            graphql_client,
16938        }
16939    }
16940}
16941impl Service {
16942    /// A unique identifier for this Service.
16943    pub async fn id(&self) -> Result<Id, DaggerError> {
16944        let query = self.selection.select("id");
16945        query.execute(self.graphql_client.clone()).await
16946    }
16947    /// Forces evaluation of the pipeline in the engine.
16948    pub async fn sync(&self) -> Result<Service, DaggerError> {
16949        let query = self.selection.select("sync");
16950        let id: Id = query.execute(self.graphql_client.clone()).await?;
16951        Ok(Service {
16952            proc: self.proc.clone(),
16953            selection: query
16954                .root()
16955                .select("node")
16956                .arg("id", &id.0)
16957                .inline_fragment("Service"),
16958            graphql_client: self.graphql_client.clone(),
16959        })
16960    }
16961    /// Retrieves a hostname which can be used by clients to reach this container.
16962    pub async fn hostname(&self) -> Result<String, DaggerError> {
16963        let query = self.selection.select("hostname");
16964        query.execute(self.graphql_client.clone()).await
16965    }
16966    /// Configures a hostname which can be used by clients within the session to reach this container.
16967    ///
16968    /// # Arguments
16969    ///
16970    /// * `hostname` - The hostname to use.
16971    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
16972        let mut query = self.selection.select("withHostname");
16973        query = query.arg("hostname", hostname.into());
16974        Service {
16975            proc: self.proc.clone(),
16976            selection: query,
16977            graphql_client: self.graphql_client.clone(),
16978        }
16979    }
16980    /// Retrieves the list of ports provided by the service.
16981    ///
16982    /// # Arguments
16983    ///
16984    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16985    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
16986        let query = self.selection.select("ports");
16987        let query = query.select("id");
16988        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16989        Ok(ids
16990            .into_iter()
16991            .map(|id| Port {
16992                proc: self.proc.clone(),
16993                selection: crate::querybuilder::query()
16994                    .select("node")
16995                    .arg("id", &id.0)
16996                    .inline_fragment("Port"),
16997                graphql_client: self.graphql_client.clone(),
16998            })
16999            .collect())
17000    }
17001    /// Retrieves the list of ports provided by the service.
17002    ///
17003    /// # Arguments
17004    ///
17005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17006    pub async fn ports_opts(&self, opts: ServicePortsOpts) -> Result<Vec<Port>, DaggerError> {
17007        let mut query = self.selection.select("ports");
17008        if let Some(declared) = opts.declared {
17009            query = query.arg("declared", declared);
17010        }
17011        let query = query.select("id");
17012        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17013        Ok(ids
17014            .into_iter()
17015            .map(|id| Port {
17016                proc: self.proc.clone(),
17017                selection: crate::querybuilder::query()
17018                    .select("node")
17019                    .arg("id", &id.0)
17020                    .inline_fragment("Port"),
17021                graphql_client: self.graphql_client.clone(),
17022            })
17023            .collect())
17024    }
17025    /// Retrieves an endpoint that clients can use to reach this container.
17026    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17027    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17028    ///
17029    /// # Arguments
17030    ///
17031    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17032    pub async fn endpoint(&self) -> Result<String, DaggerError> {
17033        let query = self.selection.select("endpoint");
17034        query.execute(self.graphql_client.clone()).await
17035    }
17036    /// Retrieves an endpoint that clients can use to reach this container.
17037    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17038    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17039    ///
17040    /// # Arguments
17041    ///
17042    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17043    pub async fn endpoint_opts<'a>(
17044        &self,
17045        opts: ServiceEndpointOpts<'a>,
17046    ) -> Result<String, DaggerError> {
17047        let mut query = self.selection.select("endpoint");
17048        if let Some(port) = opts.port {
17049            query = query.arg("port", port);
17050        }
17051        if let Some(scheme) = opts.scheme {
17052            query = query.arg("scheme", scheme);
17053        }
17054        query.execute(self.graphql_client.clone()).await
17055    }
17056    /// Start the service and wait for its health checks to succeed.
17057    /// Services bound to a Container do not need to be manually started.
17058    pub async fn start(&self) -> Result<Service, DaggerError> {
17059        let query = self.selection.select("start");
17060        let id: Id = query.execute(self.graphql_client.clone()).await?;
17061        Ok(Service {
17062            proc: self.proc.clone(),
17063            selection: query
17064                .root()
17065                .select("node")
17066                .arg("id", &id.0)
17067                .inline_fragment("Service"),
17068            graphql_client: self.graphql_client.clone(),
17069        })
17070    }
17071    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17072    ///
17073    /// # Arguments
17074    ///
17075    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17076    pub async fn up(&self) -> Result<Void, DaggerError> {
17077        let query = self.selection.select("up");
17078        query.execute(self.graphql_client.clone()).await
17079    }
17080    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17081    ///
17082    /// # Arguments
17083    ///
17084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17085    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
17086        let mut query = self.selection.select("up");
17087        if let Some(ports) = opts.ports {
17088            query = query.arg("ports", ports);
17089        }
17090        if let Some(random) = opts.random {
17091            query = query.arg("random", random);
17092        }
17093        query.execute(self.graphql_client.clone()).await
17094    }
17095    /// Stop the service.
17096    ///
17097    /// # Arguments
17098    ///
17099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17100    pub async fn stop(&self) -> Result<Service, DaggerError> {
17101        let query = self.selection.select("stop");
17102        let id: Id = query.execute(self.graphql_client.clone()).await?;
17103        Ok(Service {
17104            proc: self.proc.clone(),
17105            selection: query
17106                .root()
17107                .select("node")
17108                .arg("id", &id.0)
17109                .inline_fragment("Service"),
17110            graphql_client: self.graphql_client.clone(),
17111        })
17112    }
17113    /// Stop the service.
17114    ///
17115    /// # Arguments
17116    ///
17117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17118    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
17119        let mut query = self.selection.select("stop");
17120        if let Some(kill) = opts.kill {
17121            query = query.arg("kill", kill);
17122        }
17123        let id: Id = query.execute(self.graphql_client.clone()).await?;
17124        Ok(Service {
17125            proc: self.proc.clone(),
17126            selection: query
17127                .root()
17128                .select("node")
17129                .arg("id", &id.0)
17130                .inline_fragment("Service"),
17131            graphql_client: self.graphql_client.clone(),
17132        })
17133    }
17134    ///
17135    /// # Arguments
17136    ///
17137    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17138    pub fn terminal(&self) -> Service {
17139        let query = self.selection.select("terminal");
17140        Service {
17141            proc: self.proc.clone(),
17142            selection: query,
17143            graphql_client: self.graphql_client.clone(),
17144        }
17145    }
17146    ///
17147    /// # Arguments
17148    ///
17149    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17150    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
17151        let mut query = self.selection.select("terminal");
17152        if let Some(cmd) = opts.cmd {
17153            query = query.arg("cmd", cmd);
17154        }
17155        Service {
17156            proc: self.proc.clone(),
17157            selection: query,
17158            graphql_client: self.graphql_client.clone(),
17159        }
17160    }
17161}
17162impl Node for Service {
17163    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17164        let query = self.selection.select("id");
17165        let graphql_client = self.graphql_client.clone();
17166        async move { query.execute(graphql_client).await }
17167    }
17168}
17169impl Syncer for Service {
17170    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17171        let query = self.selection.select("id");
17172        let graphql_client = self.graphql_client.clone();
17173        async move { query.execute(graphql_client).await }
17174    }
17175    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17176        let query = self.selection.select("sync");
17177        let proc = self.proc.clone();
17178        let graphql_client = self.graphql_client.clone();
17179        async move {
17180            let id: Id = query.execute(graphql_client.clone()).await?;
17181            Ok(Self {
17182                proc,
17183                selection: query
17184                    .root()
17185                    .select("node")
17186                    .arg("id", &id.0)
17187                    .inline_fragment("Service"),
17188                graphql_client,
17189            })
17190        }
17191    }
17192}
17193#[derive(Clone)]
17194pub struct Socket {
17195    pub proc: Option<Arc<DaggerSessionProc>>,
17196    pub selection: Selection,
17197    pub graphql_client: DynGraphQLClient,
17198}
17199impl IntoID<Id> for Socket {
17200    fn into_id(
17201        self,
17202    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17203        Box::pin(async move { self.id().await })
17204    }
17205}
17206impl Loadable for Socket {
17207    fn graphql_type() -> &'static str {
17208        "Socket"
17209    }
17210    fn from_query(
17211        proc: Option<Arc<DaggerSessionProc>>,
17212        selection: Selection,
17213        graphql_client: DynGraphQLClient,
17214    ) -> Self {
17215        Self {
17216            proc,
17217            selection,
17218            graphql_client,
17219        }
17220    }
17221}
17222impl Socket {
17223    /// A unique identifier for this Socket.
17224    pub async fn id(&self) -> Result<Id, DaggerError> {
17225        let query = self.selection.select("id");
17226        query.execute(self.graphql_client.clone()).await
17227    }
17228}
17229impl Node for Socket {
17230    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17231        let query = self.selection.select("id");
17232        let graphql_client = self.graphql_client.clone();
17233        async move { query.execute(graphql_client).await }
17234    }
17235}
17236#[derive(Clone)]
17237pub struct SourceMap {
17238    pub proc: Option<Arc<DaggerSessionProc>>,
17239    pub selection: Selection,
17240    pub graphql_client: DynGraphQLClient,
17241}
17242impl IntoID<Id> for SourceMap {
17243    fn into_id(
17244        self,
17245    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17246        Box::pin(async move { self.id().await })
17247    }
17248}
17249impl Loadable for SourceMap {
17250    fn graphql_type() -> &'static str {
17251        "SourceMap"
17252    }
17253    fn from_query(
17254        proc: Option<Arc<DaggerSessionProc>>,
17255        selection: Selection,
17256        graphql_client: DynGraphQLClient,
17257    ) -> Self {
17258        Self {
17259            proc,
17260            selection,
17261            graphql_client,
17262        }
17263    }
17264}
17265impl SourceMap {
17266    /// A unique identifier for this SourceMap.
17267    pub async fn id(&self) -> Result<Id, DaggerError> {
17268        let query = self.selection.select("id");
17269        query.execute(self.graphql_client.clone()).await
17270    }
17271    /// The module dependency this was declared in.
17272    pub async fn module(&self) -> Result<String, DaggerError> {
17273        let query = self.selection.select("module");
17274        query.execute(self.graphql_client.clone()).await
17275    }
17276    /// The filename from the module source.
17277    pub async fn filename(&self) -> Result<String, DaggerError> {
17278        let query = self.selection.select("filename");
17279        query.execute(self.graphql_client.clone()).await
17280    }
17281    /// The line number within the filename.
17282    pub async fn line(&self) -> Result<isize, DaggerError> {
17283        let query = self.selection.select("line");
17284        query.execute(self.graphql_client.clone()).await
17285    }
17286    /// The column number within the line.
17287    pub async fn column(&self) -> Result<isize, DaggerError> {
17288        let query = self.selection.select("column");
17289        query.execute(self.graphql_client.clone()).await
17290    }
17291    /// The URL to the file, if any. This can be used to link to the source map in the browser.
17292    pub async fn url(&self) -> Result<String, DaggerError> {
17293        let query = self.selection.select("url");
17294        query.execute(self.graphql_client.clone()).await
17295    }
17296}
17297impl Node for SourceMap {
17298    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17299        let query = self.selection.select("id");
17300        let graphql_client = self.graphql_client.clone();
17301        async move { query.execute(graphql_client).await }
17302    }
17303}
17304#[derive(Clone)]
17305pub struct Stat {
17306    pub proc: Option<Arc<DaggerSessionProc>>,
17307    pub selection: Selection,
17308    pub graphql_client: DynGraphQLClient,
17309}
17310impl IntoID<Id> for Stat {
17311    fn into_id(
17312        self,
17313    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17314        Box::pin(async move { self.id().await })
17315    }
17316}
17317impl Loadable for Stat {
17318    fn graphql_type() -> &'static str {
17319        "Stat"
17320    }
17321    fn from_query(
17322        proc: Option<Arc<DaggerSessionProc>>,
17323        selection: Selection,
17324        graphql_client: DynGraphQLClient,
17325    ) -> Self {
17326        Self {
17327            proc,
17328            selection,
17329            graphql_client,
17330        }
17331    }
17332}
17333impl Stat {
17334    /// A unique identifier for this Stat.
17335    pub async fn id(&self) -> Result<Id, DaggerError> {
17336        let query = self.selection.select("id");
17337        query.execute(self.graphql_client.clone()).await
17338    }
17339    /// file size
17340    pub async fn size(&self) -> Result<isize, DaggerError> {
17341        let query = self.selection.select("size");
17342        query.execute(self.graphql_client.clone()).await
17343    }
17344    /// file name
17345    pub async fn name(&self) -> Result<String, DaggerError> {
17346        let query = self.selection.select("name");
17347        query.execute(self.graphql_client.clone()).await
17348    }
17349    /// file type
17350    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
17351        let query = self.selection.select("fileType");
17352        query.execute(self.graphql_client.clone()).await
17353    }
17354    /// permission bits
17355    pub async fn permissions(&self) -> Result<isize, DaggerError> {
17356        let query = self.selection.select("permissions");
17357        query.execute(self.graphql_client.clone()).await
17358    }
17359}
17360impl Node for Stat {
17361    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17362        let query = self.selection.select("id");
17363        let graphql_client = self.graphql_client.clone();
17364        async move { query.execute(graphql_client).await }
17365    }
17366}
17367#[derive(Clone)]
17368pub struct Terminal {
17369    pub proc: Option<Arc<DaggerSessionProc>>,
17370    pub selection: Selection,
17371    pub graphql_client: DynGraphQLClient,
17372}
17373impl IntoID<Id> for Terminal {
17374    fn into_id(
17375        self,
17376    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17377        Box::pin(async move { self.id().await })
17378    }
17379}
17380impl Loadable for Terminal {
17381    fn graphql_type() -> &'static str {
17382        "Terminal"
17383    }
17384    fn from_query(
17385        proc: Option<Arc<DaggerSessionProc>>,
17386        selection: Selection,
17387        graphql_client: DynGraphQLClient,
17388    ) -> Self {
17389        Self {
17390            proc,
17391            selection,
17392            graphql_client,
17393        }
17394    }
17395}
17396impl Terminal {
17397    /// A unique identifier for this Terminal.
17398    pub async fn id(&self) -> Result<Id, DaggerError> {
17399        let query = self.selection.select("id");
17400        query.execute(self.graphql_client.clone()).await
17401    }
17402    /// Forces evaluation of the pipeline in the engine.
17403    /// It doesn't run the default command if no exec has been set.
17404    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
17405        let query = self.selection.select("sync");
17406        let id: Id = query.execute(self.graphql_client.clone()).await?;
17407        Ok(Terminal {
17408            proc: self.proc.clone(),
17409            selection: query
17410                .root()
17411                .select("node")
17412                .arg("id", &id.0)
17413                .inline_fragment("Terminal"),
17414            graphql_client: self.graphql_client.clone(),
17415        })
17416    }
17417}
17418impl Node for Terminal {
17419    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17420        let query = self.selection.select("id");
17421        let graphql_client = self.graphql_client.clone();
17422        async move { query.execute(graphql_client).await }
17423    }
17424}
17425impl Syncer for Terminal {
17426    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17427        let query = self.selection.select("id");
17428        let graphql_client = self.graphql_client.clone();
17429        async move { query.execute(graphql_client).await }
17430    }
17431    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17432        let query = self.selection.select("sync");
17433        let proc = self.proc.clone();
17434        let graphql_client = self.graphql_client.clone();
17435        async move {
17436            let id: Id = query.execute(graphql_client.clone()).await?;
17437            Ok(Self {
17438                proc,
17439                selection: query
17440                    .root()
17441                    .select("node")
17442                    .arg("id", &id.0)
17443                    .inline_fragment("Terminal"),
17444                graphql_client,
17445            })
17446        }
17447    }
17448}
17449#[derive(Clone)]
17450pub struct TypeDef {
17451    pub proc: Option<Arc<DaggerSessionProc>>,
17452    pub selection: Selection,
17453    pub graphql_client: DynGraphQLClient,
17454}
17455#[derive(Builder, Debug, PartialEq)]
17456pub struct TypeDefWithScalarOpts<'a> {
17457    #[builder(setter(into, strip_option), default)]
17458    pub description: Option<&'a str>,
17459}
17460#[derive(Builder, Debug, PartialEq)]
17461pub struct TypeDefWithObjectOpts<'a> {
17462    #[builder(setter(into, strip_option), default)]
17463    pub deprecated: Option<&'a str>,
17464    #[builder(setter(into, strip_option), default)]
17465    pub description: Option<&'a str>,
17466    #[builder(setter(into, strip_option), default)]
17467    pub source_map: Option<Id>,
17468}
17469#[derive(Builder, Debug, PartialEq)]
17470pub struct TypeDefWithInterfaceOpts<'a> {
17471    #[builder(setter(into, strip_option), default)]
17472    pub description: Option<&'a str>,
17473    #[builder(setter(into, strip_option), default)]
17474    pub source_map: Option<Id>,
17475}
17476#[derive(Builder, Debug, PartialEq)]
17477pub struct TypeDefWithFieldOpts<'a> {
17478    /// If deprecated, the reason or migration path.
17479    #[builder(setter(into, strip_option), default)]
17480    pub deprecated: Option<&'a str>,
17481    /// A doc string for the field, if any
17482    #[builder(setter(into, strip_option), default)]
17483    pub description: Option<&'a str>,
17484    /// The source map for the field definition.
17485    #[builder(setter(into, strip_option), default)]
17486    pub source_map: Option<Id>,
17487}
17488#[derive(Builder, Debug, PartialEq)]
17489pub struct TypeDefWithEnumOpts<'a> {
17490    /// A doc string for the enum, if any
17491    #[builder(setter(into, strip_option), default)]
17492    pub description: Option<&'a str>,
17493    /// The source map for the enum definition.
17494    #[builder(setter(into, strip_option), default)]
17495    pub source_map: Option<Id>,
17496}
17497#[derive(Builder, Debug, PartialEq)]
17498pub struct TypeDefWithEnumValueOpts<'a> {
17499    /// If deprecated, the reason or migration path.
17500    #[builder(setter(into, strip_option), default)]
17501    pub deprecated: Option<&'a str>,
17502    /// A doc string for the value, if any
17503    #[builder(setter(into, strip_option), default)]
17504    pub description: Option<&'a str>,
17505    /// The source map for the enum value definition.
17506    #[builder(setter(into, strip_option), default)]
17507    pub source_map: Option<Id>,
17508}
17509#[derive(Builder, Debug, PartialEq)]
17510pub struct TypeDefWithEnumMemberOpts<'a> {
17511    /// If deprecated, the reason or migration path.
17512    #[builder(setter(into, strip_option), default)]
17513    pub deprecated: Option<&'a str>,
17514    /// A doc string for the member, if any
17515    #[builder(setter(into, strip_option), default)]
17516    pub description: Option<&'a str>,
17517    /// The source map for the enum member definition.
17518    #[builder(setter(into, strip_option), default)]
17519    pub source_map: Option<Id>,
17520    /// The value of the member in the enum
17521    #[builder(setter(into, strip_option), default)]
17522    pub value: Option<&'a str>,
17523}
17524impl IntoID<Id> for TypeDef {
17525    fn into_id(
17526        self,
17527    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17528        Box::pin(async move { self.id().await })
17529    }
17530}
17531impl Loadable for TypeDef {
17532    fn graphql_type() -> &'static str {
17533        "TypeDef"
17534    }
17535    fn from_query(
17536        proc: Option<Arc<DaggerSessionProc>>,
17537        selection: Selection,
17538        graphql_client: DynGraphQLClient,
17539    ) -> Self {
17540        Self {
17541            proc,
17542            selection,
17543            graphql_client,
17544        }
17545    }
17546}
17547impl TypeDef {
17548    /// A unique identifier for this TypeDef.
17549    pub async fn id(&self) -> Result<Id, DaggerError> {
17550        let query = self.selection.select("id");
17551        query.execute(self.graphql_client.clone()).await
17552    }
17553    /// Mark this object as a collection.
17554    pub fn with_collection(&self) -> TypeDef {
17555        let query = self.selection.select("withCollection");
17556        TypeDef {
17557            proc: self.proc.clone(),
17558            selection: query,
17559            graphql_client: self.graphql_client.clone(),
17560        }
17561    }
17562    /// Select the stored keys field for this collection.
17563    pub fn with_collection_keys(&self, name: impl Into<String>) -> TypeDef {
17564        let mut query = self.selection.select("withCollectionKeys");
17565        query = query.arg("name", name.into());
17566        TypeDef {
17567            proc: self.proc.clone(),
17568            selection: query,
17569            graphql_client: self.graphql_client.clone(),
17570        }
17571    }
17572    /// Select the item lookup function for this collection.
17573    pub fn with_collection_get(&self, name: impl Into<String>) -> TypeDef {
17574        let mut query = self.selection.select("withCollectionGet");
17575        query = query.arg("name", name.into());
17576        TypeDef {
17577            proc: self.proc.clone(),
17578            selection: query,
17579            graphql_client: self.graphql_client.clone(),
17580        }
17581    }
17582    /// Select the field that receives changes from the original collection.
17583    pub fn with_collection_delta(&self, name: impl Into<String>) -> TypeDef {
17584        let mut query = self.selection.select("withCollectionDelta");
17585        query = query.arg("name", name.into());
17586        TypeDef {
17587            proc: self.proc.clone(),
17588            selection: query,
17589            graphql_client: self.graphql_client.clone(),
17590        }
17591    }
17592    /// Collection metadata, or null if this object is not a collection.
17593    pub async fn as_collection(&self) -> Result<Option<CollectionTypeDef>, DaggerError> {
17594        let query = self.selection.select("asCollection");
17595        let query = query.select("id");
17596        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
17597        Ok(id.map(|id| CollectionTypeDef {
17598            proc: self.proc.clone(),
17599            selection: query
17600                .root()
17601                .select("node")
17602                .arg("id", &id.0)
17603                .inline_fragment("CollectionTypeDef"),
17604            graphql_client: self.graphql_client.clone(),
17605        }))
17606    }
17607    /// The canonical non-optional name of the type.
17608    pub async fn name(&self) -> Result<String, DaggerError> {
17609        let query = self.selection.select("name");
17610        query.execute(self.graphql_client.clone()).await
17611    }
17612    /// The kind of type this is (e.g. primitive, list, object).
17613    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
17614        let query = self.selection.select("kind");
17615        query.execute(self.graphql_client.clone()).await
17616    }
17617    /// Whether this type can be set to null. Defaults to false.
17618    pub async fn optional(&self) -> Result<bool, DaggerError> {
17619        let query = self.selection.select("optional");
17620        query.execute(self.graphql_client.clone()).await
17621    }
17622    /// Sets whether this type can be set to null.
17623    pub fn with_optional(&self, optional: bool) -> TypeDef {
17624        let mut query = self.selection.select("withOptional");
17625        query = query.arg("optional", optional);
17626        TypeDef {
17627            proc: self.proc.clone(),
17628            selection: query,
17629            graphql_client: self.graphql_client.clone(),
17630        }
17631    }
17632    /// Sets the kind of the type.
17633    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
17634        let mut query = self.selection.select("withKind");
17635        query = query.arg("kind", kind);
17636        TypeDef {
17637            proc: self.proc.clone(),
17638            selection: query,
17639            graphql_client: self.graphql_client.clone(),
17640        }
17641    }
17642    /// Returns a TypeDef of kind Scalar with the provided name.
17643    ///
17644    /// # Arguments
17645    ///
17646    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17647    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
17648        let mut query = self.selection.select("withScalar");
17649        query = query.arg("name", name.into());
17650        TypeDef {
17651            proc: self.proc.clone(),
17652            selection: query,
17653            graphql_client: self.graphql_client.clone(),
17654        }
17655    }
17656    /// Returns a TypeDef of kind Scalar with the provided name.
17657    ///
17658    /// # Arguments
17659    ///
17660    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17661    pub fn with_scalar_opts<'a>(
17662        &self,
17663        name: impl Into<String>,
17664        opts: TypeDefWithScalarOpts<'a>,
17665    ) -> TypeDef {
17666        let mut query = self.selection.select("withScalar");
17667        query = query.arg("name", name.into());
17668        if let Some(description) = opts.description {
17669            query = query.arg("description", description);
17670        }
17671        TypeDef {
17672            proc: self.proc.clone(),
17673            selection: query,
17674            graphql_client: self.graphql_client.clone(),
17675        }
17676    }
17677    /// Returns a TypeDef of kind List with the provided type for its elements.
17678    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
17679        let mut query = self.selection.select("withListOf");
17680        query = query.arg_lazy(
17681            "elementType",
17682            Box::new(move || {
17683                let element_type = element_type.clone();
17684                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
17685            }),
17686        );
17687        TypeDef {
17688            proc: self.proc.clone(),
17689            selection: query,
17690            graphql_client: self.graphql_client.clone(),
17691        }
17692    }
17693    /// Returns a TypeDef of kind Object with the provided name.
17694    /// 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.
17695    ///
17696    /// # Arguments
17697    ///
17698    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17699    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
17700        let mut query = self.selection.select("withObject");
17701        query = query.arg("name", name.into());
17702        TypeDef {
17703            proc: self.proc.clone(),
17704            selection: query,
17705            graphql_client: self.graphql_client.clone(),
17706        }
17707    }
17708    /// Returns a TypeDef of kind Object with the provided name.
17709    /// 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.
17710    ///
17711    /// # Arguments
17712    ///
17713    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17714    pub fn with_object_opts<'a>(
17715        &self,
17716        name: impl Into<String>,
17717        opts: TypeDefWithObjectOpts<'a>,
17718    ) -> TypeDef {
17719        let mut query = self.selection.select("withObject");
17720        query = query.arg("name", name.into());
17721        if let Some(description) = opts.description {
17722            query = query.arg("description", description);
17723        }
17724        if let Some(source_map) = opts.source_map {
17725            query = query.arg("sourceMap", source_map);
17726        }
17727        if let Some(deprecated) = opts.deprecated {
17728            query = query.arg("deprecated", deprecated);
17729        }
17730        TypeDef {
17731            proc: self.proc.clone(),
17732            selection: query,
17733            graphql_client: self.graphql_client.clone(),
17734        }
17735    }
17736    /// Returns a TypeDef of kind Interface with the provided name.
17737    ///
17738    /// # Arguments
17739    ///
17740    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17741    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
17742        let mut query = self.selection.select("withInterface");
17743        query = query.arg("name", name.into());
17744        TypeDef {
17745            proc: self.proc.clone(),
17746            selection: query,
17747            graphql_client: self.graphql_client.clone(),
17748        }
17749    }
17750    /// Returns a TypeDef of kind Interface with the provided name.
17751    ///
17752    /// # Arguments
17753    ///
17754    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17755    pub fn with_interface_opts<'a>(
17756        &self,
17757        name: impl Into<String>,
17758        opts: TypeDefWithInterfaceOpts<'a>,
17759    ) -> TypeDef {
17760        let mut query = self.selection.select("withInterface");
17761        query = query.arg("name", name.into());
17762        if let Some(description) = opts.description {
17763            query = query.arg("description", description);
17764        }
17765        if let Some(source_map) = opts.source_map {
17766            query = query.arg("sourceMap", source_map);
17767        }
17768        TypeDef {
17769            proc: self.proc.clone(),
17770            selection: query,
17771            graphql_client: self.graphql_client.clone(),
17772        }
17773    }
17774    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
17775    ///
17776    /// # Arguments
17777    ///
17778    /// * `name` - The name of the field in the object
17779    /// * `type_def` - The type of the field
17780    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17781    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
17782        let mut query = self.selection.select("withField");
17783        query = query.arg("name", name.into());
17784        query = query.arg_lazy(
17785            "typeDef",
17786            Box::new(move || {
17787                let type_def = type_def.clone();
17788                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17789            }),
17790        );
17791        TypeDef {
17792            proc: self.proc.clone(),
17793            selection: query,
17794            graphql_client: self.graphql_client.clone(),
17795        }
17796    }
17797    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
17798    ///
17799    /// # Arguments
17800    ///
17801    /// * `name` - The name of the field in the object
17802    /// * `type_def` - The type of the field
17803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17804    pub fn with_field_opts<'a>(
17805        &self,
17806        name: impl Into<String>,
17807        type_def: impl IntoID<Id>,
17808        opts: TypeDefWithFieldOpts<'a>,
17809    ) -> TypeDef {
17810        let mut query = self.selection.select("withField");
17811        query = query.arg("name", name.into());
17812        query = query.arg_lazy(
17813            "typeDef",
17814            Box::new(move || {
17815                let type_def = type_def.clone();
17816                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17817            }),
17818        );
17819        if let Some(description) = opts.description {
17820            query = query.arg("description", description);
17821        }
17822        if let Some(source_map) = opts.source_map {
17823            query = query.arg("sourceMap", source_map);
17824        }
17825        if let Some(deprecated) = opts.deprecated {
17826            query = query.arg("deprecated", deprecated);
17827        }
17828        TypeDef {
17829            proc: self.proc.clone(),
17830            selection: query,
17831            graphql_client: self.graphql_client.clone(),
17832        }
17833    }
17834    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
17835    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
17836        let mut query = self.selection.select("withFunction");
17837        query = query.arg_lazy(
17838            "function",
17839            Box::new(move || {
17840                let function = function.clone();
17841                Box::pin(async move { function.into_id().await.unwrap().quote() })
17842            }),
17843        );
17844        TypeDef {
17845            proc: self.proc.clone(),
17846            selection: query,
17847            graphql_client: self.graphql_client.clone(),
17848        }
17849    }
17850    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
17851    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
17852        let mut query = self.selection.select("withConstructor");
17853        query = query.arg_lazy(
17854            "function",
17855            Box::new(move || {
17856                let function = function.clone();
17857                Box::pin(async move { function.into_id().await.unwrap().quote() })
17858            }),
17859        );
17860        TypeDef {
17861            proc: self.proc.clone(),
17862            selection: query,
17863            graphql_client: self.graphql_client.clone(),
17864        }
17865    }
17866    /// Returns a TypeDef of kind Enum with the provided name.
17867    /// 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.
17868    ///
17869    /// # Arguments
17870    ///
17871    /// * `name` - The name of the enum
17872    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17873    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
17874        let mut query = self.selection.select("withEnum");
17875        query = query.arg("name", name.into());
17876        TypeDef {
17877            proc: self.proc.clone(),
17878            selection: query,
17879            graphql_client: self.graphql_client.clone(),
17880        }
17881    }
17882    /// Returns a TypeDef of kind Enum with the provided name.
17883    /// 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.
17884    ///
17885    /// # Arguments
17886    ///
17887    /// * `name` - The name of the enum
17888    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17889    pub fn with_enum_opts<'a>(
17890        &self,
17891        name: impl Into<String>,
17892        opts: TypeDefWithEnumOpts<'a>,
17893    ) -> TypeDef {
17894        let mut query = self.selection.select("withEnum");
17895        query = query.arg("name", name.into());
17896        if let Some(description) = opts.description {
17897            query = query.arg("description", description);
17898        }
17899        if let Some(source_map) = opts.source_map {
17900            query = query.arg("sourceMap", source_map);
17901        }
17902        TypeDef {
17903            proc: self.proc.clone(),
17904            selection: query,
17905            graphql_client: self.graphql_client.clone(),
17906        }
17907    }
17908    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17909    ///
17910    /// # Arguments
17911    ///
17912    /// * `value` - The name of the value in the enum
17913    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17914    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
17915        let mut query = self.selection.select("withEnumValue");
17916        query = query.arg("value", value.into());
17917        TypeDef {
17918            proc: self.proc.clone(),
17919            selection: query,
17920            graphql_client: self.graphql_client.clone(),
17921        }
17922    }
17923    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17924    ///
17925    /// # Arguments
17926    ///
17927    /// * `value` - The name of the value in the enum
17928    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17929    pub fn with_enum_value_opts<'a>(
17930        &self,
17931        value: impl Into<String>,
17932        opts: TypeDefWithEnumValueOpts<'a>,
17933    ) -> TypeDef {
17934        let mut query = self.selection.select("withEnumValue");
17935        query = query.arg("value", value.into());
17936        if let Some(description) = opts.description {
17937            query = query.arg("description", description);
17938        }
17939        if let Some(source_map) = opts.source_map {
17940            query = query.arg("sourceMap", source_map);
17941        }
17942        if let Some(deprecated) = opts.deprecated {
17943            query = query.arg("deprecated", deprecated);
17944        }
17945        TypeDef {
17946            proc: self.proc.clone(),
17947            selection: query,
17948            graphql_client: self.graphql_client.clone(),
17949        }
17950    }
17951    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17952    ///
17953    /// # Arguments
17954    ///
17955    /// * `name` - The name of the member in the enum
17956    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17957    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
17958        let mut query = self.selection.select("withEnumMember");
17959        query = query.arg("name", name.into());
17960        TypeDef {
17961            proc: self.proc.clone(),
17962            selection: query,
17963            graphql_client: self.graphql_client.clone(),
17964        }
17965    }
17966    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17967    ///
17968    /// # Arguments
17969    ///
17970    /// * `name` - The name of the member in the enum
17971    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17972    pub fn with_enum_member_opts<'a>(
17973        &self,
17974        name: impl Into<String>,
17975        opts: TypeDefWithEnumMemberOpts<'a>,
17976    ) -> TypeDef {
17977        let mut query = self.selection.select("withEnumMember");
17978        query = query.arg("name", name.into());
17979        if let Some(value) = opts.value {
17980            query = query.arg("value", value);
17981        }
17982        if let Some(description) = opts.description {
17983            query = query.arg("description", description);
17984        }
17985        if let Some(source_map) = opts.source_map {
17986            query = query.arg("sourceMap", source_map);
17987        }
17988        if let Some(deprecated) = opts.deprecated {
17989            query = query.arg("deprecated", deprecated);
17990        }
17991        TypeDef {
17992            proc: self.proc.clone(),
17993            selection: query,
17994            graphql_client: self.graphql_client.clone(),
17995        }
17996    }
17997    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
17998    pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
17999        let query = self.selection.select("asList");
18000        let query = query.select("id");
18001        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18002        Ok(id.map(|id| ListTypeDef {
18003            proc: self.proc.clone(),
18004            selection: query
18005                .root()
18006                .select("node")
18007                .arg("id", &id.0)
18008                .inline_fragment("ListTypeDef"),
18009            graphql_client: self.graphql_client.clone(),
18010        }))
18011    }
18012    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
18013    pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
18014        let query = self.selection.select("asObject");
18015        let query = query.select("id");
18016        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18017        Ok(id.map(|id| ObjectTypeDef {
18018            proc: self.proc.clone(),
18019            selection: query
18020                .root()
18021                .select("node")
18022                .arg("id", &id.0)
18023                .inline_fragment("ObjectTypeDef"),
18024            graphql_client: self.graphql_client.clone(),
18025        }))
18026    }
18027    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
18028    pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
18029        let query = self.selection.select("asInterface");
18030        let query = query.select("id");
18031        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18032        Ok(id.map(|id| InterfaceTypeDef {
18033            proc: self.proc.clone(),
18034            selection: query
18035                .root()
18036                .select("node")
18037                .arg("id", &id.0)
18038                .inline_fragment("InterfaceTypeDef"),
18039            graphql_client: self.graphql_client.clone(),
18040        }))
18041    }
18042    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
18043    pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
18044        let query = self.selection.select("asInput");
18045        let query = query.select("id");
18046        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18047        Ok(id.map(|id| InputTypeDef {
18048            proc: self.proc.clone(),
18049            selection: query
18050                .root()
18051                .select("node")
18052                .arg("id", &id.0)
18053                .inline_fragment("InputTypeDef"),
18054            graphql_client: self.graphql_client.clone(),
18055        }))
18056    }
18057    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
18058    pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
18059        let query = self.selection.select("asScalar");
18060        let query = query.select("id");
18061        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18062        Ok(id.map(|id| ScalarTypeDef {
18063            proc: self.proc.clone(),
18064            selection: query
18065                .root()
18066                .select("node")
18067                .arg("id", &id.0)
18068                .inline_fragment("ScalarTypeDef"),
18069            graphql_client: self.graphql_client.clone(),
18070        }))
18071    }
18072    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
18073    pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
18074        let query = self.selection.select("asEnum");
18075        let query = query.select("id");
18076        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18077        Ok(id.map(|id| EnumTypeDef {
18078            proc: self.proc.clone(),
18079            selection: query
18080                .root()
18081                .select("node")
18082                .arg("id", &id.0)
18083                .inline_fragment("EnumTypeDef"),
18084            graphql_client: self.graphql_client.clone(),
18085        }))
18086    }
18087}
18088impl Node for TypeDef {
18089    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18090        let query = self.selection.select("id");
18091        let graphql_client = self.graphql_client.clone();
18092        async move { query.execute(graphql_client).await }
18093    }
18094}
18095#[derive(Clone)]
18096pub struct Volume {
18097    pub proc: Option<Arc<DaggerSessionProc>>,
18098    pub selection: Selection,
18099    pub graphql_client: DynGraphQLClient,
18100}
18101impl IntoID<Id> for Volume {
18102    fn into_id(
18103        self,
18104    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18105        Box::pin(async move { self.id().await })
18106    }
18107}
18108impl Loadable for Volume {
18109    fn graphql_type() -> &'static str {
18110        "Volume"
18111    }
18112    fn from_query(
18113        proc: Option<Arc<DaggerSessionProc>>,
18114        selection: Selection,
18115        graphql_client: DynGraphQLClient,
18116    ) -> Self {
18117        Self {
18118            proc,
18119            selection,
18120            graphql_client,
18121        }
18122    }
18123}
18124impl Volume {
18125    /// A unique identifier for this Volume.
18126    pub async fn id(&self) -> Result<Id, DaggerError> {
18127        let query = self.selection.select("id");
18128        query.execute(self.graphql_client.clone()).await
18129    }
18130}
18131impl Node for Volume {
18132    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18133        let query = self.selection.select("id");
18134        let graphql_client = self.graphql_client.clone();
18135        async move { query.execute(graphql_client).await }
18136    }
18137}
18138#[derive(Clone)]
18139pub struct Workspace {
18140    pub proc: Option<Arc<DaggerSessionProc>>,
18141    pub selection: Selection,
18142    pub graphql_client: DynGraphQLClient,
18143}
18144#[derive(Builder, Debug, PartialEq)]
18145pub struct WorkspaceMigrateModuleOpts<'a> {
18146    /// Module directory. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18147    #[builder(setter(into, strip_option), default)]
18148    pub path: Option<&'a str>,
18149}
18150#[derive(Builder, Debug, PartialEq)]
18151pub struct WorkspaceCompareCommitsFromOpts<'a> {
18152    /// 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.
18153    #[builder(setter(into, strip_option), default)]
18154    pub commits: Option<Vec<&'a str>>,
18155    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18156    #[builder(setter(into, strip_option), default)]
18157    pub max_commits: Option<isize>,
18158}
18159#[derive(Builder, Debug, PartialEq)]
18160pub struct WorkspaceWithCommitsFromOpts<'a> {
18161    /// 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.
18162    #[builder(setter(into, strip_option), default)]
18163    pub commits: Option<Vec<&'a str>>,
18164    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18165    #[builder(setter(into, strip_option), default)]
18166    pub max_commits: Option<isize>,
18167}
18168#[derive(Builder, Debug, PartialEq)]
18169pub struct WorkspaceWithCommitOpts<'a> {
18170    /// Author and committer email. Defaults to git config user.email in the calling client's working directory, otherwise dagger@localhost.
18171    #[builder(setter(into, strip_option), default)]
18172    pub author_email: Option<&'a str>,
18173    /// Author and committer name. Defaults to git config user.name in the calling client's working directory, otherwise Dagger.
18174    #[builder(setter(into, strip_option), default)]
18175    pub author_name: Option<&'a str>,
18176    /// Add a Signed-off-by trailer using the commit author's name and email.
18177    #[builder(setter(into, strip_option), default)]
18178    pub signoff: Option<bool>,
18179}
18180#[derive(Builder, Debug, PartialEq)]
18181pub struct WorkspaceWithResetOpts {
18182    /// Discard uncommitted changes, resetting the working tree to the commit.
18183    #[builder(setter(into, strip_option), default)]
18184    pub hard: Option<bool>,
18185}
18186#[derive(Builder, Debug, PartialEq)]
18187pub struct WorkspaceDirectoryOpts<'a> {
18188    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
18189    #[builder(setter(into, strip_option), default)]
18190    pub exclude: Option<Vec<&'a str>>,
18191    /// Apply .gitignore filter rules inside the directory.
18192    #[builder(setter(into, strip_option), default)]
18193    pub gitignore: Option<bool>,
18194    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
18195    #[builder(setter(into, strip_option), default)]
18196    pub include: Option<Vec<&'a str>>,
18197}
18198#[derive(Builder, Debug, PartialEq)]
18199pub struct WorkspaceSearchOpts<'a> {
18200    /// Allow the . pattern to match newlines in multiline mode.
18201    #[builder(setter(into, strip_option), default)]
18202    pub dotall: Option<bool>,
18203    /// Only return matching files, not lines and content
18204    #[builder(setter(into, strip_option), default)]
18205    pub files_only: Option<bool>,
18206    /// Glob patterns to match (e.g., "*.md")
18207    #[builder(setter(into, strip_option), default)]
18208    pub globs: Option<Vec<&'a str>>,
18209    /// Enable case-insensitive matching.
18210    #[builder(setter(into, strip_option), default)]
18211    pub insensitive: Option<bool>,
18212    /// Limit the number of results to return
18213    #[builder(setter(into, strip_option), default)]
18214    pub limit: Option<isize>,
18215    /// Interpret the pattern as a literal string instead of a regular expression.
18216    #[builder(setter(into, strip_option), default)]
18217    pub literal: Option<bool>,
18218    /// Enable searching across multiple lines.
18219    #[builder(setter(into, strip_option), default)]
18220    pub multiline: Option<bool>,
18221    /// Directory or file paths to search
18222    #[builder(setter(into, strip_option), default)]
18223    pub paths: Option<Vec<&'a str>>,
18224    /// Skip hidden files (files starting with .).
18225    #[builder(setter(into, strip_option), default)]
18226    pub skip_hidden: Option<bool>,
18227    /// Honor .gitignore, .ignore, and .rgignore files.
18228    #[builder(setter(into, strip_option), default)]
18229    pub skip_ignored: Option<bool>,
18230}
18231#[derive(Builder, Debug, PartialEq)]
18232pub struct WorkspaceFindUpOpts<'a> {
18233    /// Path to start the search from. Relative paths resolve from the workspace cwd; absolute paths resolve from the workspace root.
18234    #[builder(setter(into, strip_option), default)]
18235    pub from: Option<&'a str>,
18236}
18237#[derive(Builder, Debug, PartialEq)]
18238pub struct WorkspaceFindRootsOpts<'a> {
18239    /// Glob patterns pruning the walk below start (e.g. ["**/node_modules/**"]).
18240    #[builder(setter(into, strip_option), default)]
18241    pub exclude: Option<Vec<&'a str>>,
18242    /// Directory to start from. Relative paths resolve from the workspace cwd.
18243    #[builder(setter(into, strip_option), default)]
18244    pub start: Option<&'a str>,
18245}
18246#[derive(Builder, Debug, PartialEq)]
18247pub struct WorkspaceWithNewFileOpts {
18248    /// Permissions of the new file.
18249    #[builder(setter(into, strip_option), default)]
18250    pub permissions: Option<isize>,
18251}
18252#[derive(Builder, Debug, PartialEq)]
18253pub struct WorkspaceWithFileOpts {
18254    /// Permissions of the added file. Defaults to the source file permissions.
18255    #[builder(setter(into, strip_option), default)]
18256    pub permissions: Option<isize>,
18257}
18258#[derive(Builder, Debug, PartialEq)]
18259pub struct WorkspaceWithPatchFileOpts {
18260    /// 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.
18261    #[builder(setter(into, strip_option), default)]
18262    pub on_conflict: Option<PatchConflict>,
18263}
18264#[derive(Builder, Debug, PartialEq)]
18265pub struct WorkspaceWithModuleOpts<'a> {
18266    /// Write to the workspace config directory at the workspace cwd.
18267    #[builder(setter(into, strip_option), default)]
18268    pub here: Option<bool>,
18269    /// Override name for the installed module entry.
18270    #[builder(setter(into, strip_option), default)]
18271    pub name: Option<&'a str>,
18272}
18273#[derive(Builder, Debug, PartialEq)]
18274pub struct WorkspaceWithoutModuleOpts {
18275    /// Write to the workspace config directory at the workspace cwd.
18276    #[builder(setter(into, strip_option), default)]
18277    pub here: Option<bool>,
18278}
18279#[derive(Builder, Debug, PartialEq)]
18280pub struct WorkspaceWithSdkOpts<'a> {
18281    /// Optional override for the SDK name conventionally derived from the installed module name.
18282    #[builder(setter(into, strip_option), default)]
18283    pub as_sdk_name: Option<&'a str>,
18284    /// Write to the workspace config directory at the workspace cwd.
18285    #[builder(setter(into, strip_option), default)]
18286    pub here: Option<bool>,
18287    /// Override name for the installed SDK entry.
18288    #[builder(setter(into, strip_option), default)]
18289    pub name: Option<&'a str>,
18290}
18291#[derive(Builder, Debug, PartialEq)]
18292pub struct WorkspaceWithoutSdkOpts {
18293    /// Write to the workspace config directory at the workspace cwd.
18294    #[builder(setter(into, strip_option), default)]
18295    pub here: Option<bool>,
18296}
18297#[derive(Builder, Debug, PartialEq)]
18298pub struct WorkspaceWithInitModuleOpts<'a> {
18299    /// Select this module as the entrypoint and install it. False prevents automatic selection. When omitted, select only if both path and name are omitted and the module is installed.
18300    #[builder(setter(into, strip_option), default)]
18301    pub entrypoint: Option<bool>,
18302    /// Install the module. When omitted, install only if path is omitted.
18303    #[builder(setter(into, strip_option), default)]
18304    pub install: Option<bool>,
18305    /// Module name. The engine infers it from path, the active config file, or the workspace root when omitted.
18306    #[builder(setter(into, strip_option), default)]
18307    pub name: Option<&'a str>,
18308    /// Module path relative to the workspace cwd, or an absolute workspace path. Defaults to .dagger/modules/<name> beside the active workspace config.
18309    #[builder(setter(into, strip_option), default)]
18310    pub path: Option<&'a str>,
18311    /// Explicit SDK-module constructor setting overrides for this scope.
18312    #[builder(setter(into, strip_option), default)]
18313    pub settings: Option<Json>,
18314}
18315#[derive(Builder, Debug, PartialEq)]
18316pub struct WorkspaceWithClientOpts<'a> {
18317    /// Optional SDK name. Inspect all installed SDKs when omitted.
18318    #[builder(setter(into, strip_option), default)]
18319    pub sdk: Option<&'a str>,
18320    /// Explicit SDK-module constructor setting overrides for this scope. Requires an explicit SDK name.
18321    #[builder(setter(into, strip_option), default)]
18322    pub settings: Option<Json>,
18323}
18324#[derive(Builder, Debug, PartialEq)]
18325pub struct WorkspaceWithoutClientOpts<'a> {
18326    /// Optional SDK name. Search all installed SDKs when omitted.
18327    #[builder(setter(into, strip_option), default)]
18328    pub sdk: Option<&'a str>,
18329}
18330#[derive(Builder, Debug, PartialEq)]
18331pub struct WorkspaceWithUpdatedClientsOpts<'a> {
18332    /// Select clients in every scope instead of only the scopes containing the workspace cwd.
18333    #[builder(setter(into, strip_option), default)]
18334    pub all: Option<bool>,
18335    /// Recorded client targets to update. All targets in the selected scopes are updated when omitted.
18336    #[builder(setter(into, strip_option), default)]
18337    pub modules: Option<Vec<&'a str>>,
18338    /// Optional SDK name. All installed SDK modules are selected when omitted.
18339    #[builder(setter(into, strip_option), default)]
18340    pub sdk: Option<&'a str>,
18341}
18342#[derive(Builder, Debug, PartialEq)]
18343pub struct WorkspaceWithConfigValueOpts<'a> {
18344    /// Write to the workspace config directory at the workspace cwd.
18345    #[builder(setter(into, strip_option), default)]
18346    pub here: Option<bool>,
18347    /// List value to set. Elements are stored verbatim, with no auto-detection. Mutually exclusive with value.
18348    #[builder(setter(into, strip_option), default)]
18349    pub values: Option<Vec<&'a str>>,
18350}
18351#[derive(Builder, Debug, PartialEq)]
18352pub struct WorkspaceWithoutConfigValueOpts {
18353    /// Write to the workspace config directory at the workspace cwd.
18354    #[builder(setter(into, strip_option), default)]
18355    pub here: Option<bool>,
18356}
18357#[derive(Builder, Debug, PartialEq)]
18358pub struct WorkspaceWithConfigEnvOpts {
18359    /// Write to the workspace config directory at the workspace cwd.
18360    #[builder(setter(into, strip_option), default)]
18361    pub here: Option<bool>,
18362}
18363#[derive(Builder, Debug, PartialEq)]
18364pub struct WorkspaceWithoutConfigEnvOpts {
18365    /// Write to the workspace config directory at the workspace cwd.
18366    #[builder(setter(into, strip_option), default)]
18367    pub here: Option<bool>,
18368}
18369#[derive(Builder, Debug, PartialEq)]
18370pub struct WorkspaceWithUpdatedLockOpts {
18371    /// Do not regenerate SDK client scopes.
18372    #[builder(setter(into, strip_option), default)]
18373    pub no_generate: Option<bool>,
18374}
18375#[derive(Builder, Debug, PartialEq)]
18376pub struct WorkspaceWithUpdatedModulesOpts<'a> {
18377    /// Installed module names or sources. A version suffix sets a new request. An empty list refreshes all installed modules.
18378    #[builder(setter(into, strip_option), default)]
18379    pub names: Option<Vec<&'a str>>,
18380    /// New source for exactly one selected module. Resolved like an install source. Cannot be combined with a version or a version suffix.
18381    #[builder(setter(into, strip_option), default)]
18382    pub source: Option<&'a str>,
18383    /// New version request for exactly one selected module. Cannot be combined with a version suffix.
18384    #[builder(setter(into, strip_option), default)]
18385    pub version: Option<&'a str>,
18386}
18387#[derive(Builder, Debug, PartialEq)]
18388pub struct WorkspaceChangesOpts {
18389    /// An earlier workspace state to compare against.
18390    #[builder(setter(into, strip_option), default)]
18391    pub from: Option<Id>,
18392}
18393#[derive(Builder, Debug, PartialEq)]
18394pub struct WorkspaceExportOpts<'a> {
18395    /// 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.
18396    #[builder(setter(into, strip_option), default)]
18397    pub from: Option<Id>,
18398    /// 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.
18399    #[builder(setter(into, strip_option), default)]
18400    pub path: Option<&'a str>,
18401}
18402#[derive(Builder, Debug, PartialEq)]
18403pub struct WorkspaceConfigReadOpts<'a> {
18404    /// Include the selected environment, user overrides, and legacy workspace settings.
18405    #[builder(setter(into, strip_option), default)]
18406    pub effective: Option<bool>,
18407    /// Dotted key path (e.g. modules.greeter.source). Empty for full config.
18408    #[builder(setter(into, strip_option), default)]
18409    pub key: Option<&'a str>,
18410}
18411#[derive(Builder, Debug, PartialEq)]
18412pub struct WorkspaceArtifactsOpts<'a> {
18413    /// Only include artifacts matching these path patterns, as with checks and services. A path selects that path and its children.
18414    #[builder(setter(into, strip_option), default)]
18415    pub include: Option<Vec<&'a str>>,
18416}
18417#[derive(Builder, Debug, PartialEq)]
18418pub struct WorkspaceMigrateOpts<'a> {
18419    /// Additional local modules to migrate. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18420    #[builder(setter(into, strip_option), default)]
18421    pub modules: Option<Vec<&'a str>>,
18422}
18423impl IntoID<Id> for Workspace {
18424    fn into_id(
18425        self,
18426    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18427        Box::pin(async move { self.id().await })
18428    }
18429}
18430impl Loadable for Workspace {
18431    fn graphql_type() -> &'static str {
18432        "Workspace"
18433    }
18434    fn from_query(
18435        proc: Option<Arc<DaggerSessionProc>>,
18436        selection: Selection,
18437        graphql_client: DynGraphQLClient,
18438    ) -> Self {
18439        Self {
18440            proc,
18441            selection,
18442            graphql_client,
18443        }
18444    }
18445}
18446impl Workspace {
18447    /// A unique identifier for this Workspace.
18448    pub async fn id(&self) -> Result<Id, DaggerError> {
18449        let query = self.selection.select("id");
18450        query.execute(self.graphql_client.clone()).await
18451    }
18452    /// Resolve an address in this workspace.
18453    /// 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.
18454    /// A value without the dag:// scheme keeps its external meaning, such as a container image reference.
18455    /// The Address retains this workspace across module calls and ID reloads.
18456    ///
18457    /// # Arguments
18458    ///
18459    /// * `value` - A DAG address, or an external reference.
18460    pub fn resolve(&self, value: impl Into<String>) -> Address {
18461        let mut query = self.selection.select("resolve");
18462        query = query.arg("value", value.into());
18463        Address {
18464            proc: self.proc.clone(),
18465            selection: query,
18466            graphql_client: self.graphql_client.clone(),
18467        }
18468    }
18469    /// Return this workspace with a native configuration, without changing an existing configuration.
18470    /// Fail if legacy configuration needs workspace migration.
18471    pub fn with_initialized(&self) -> Workspace {
18472        let query = self.selection.select("withInitialized");
18473        Workspace {
18474            proc: self.proc.clone(),
18475            selection: query,
18476            graphql_client: self.graphql_client.clone(),
18477        }
18478    }
18479    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18480    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18481    ///
18482    /// # Arguments
18483    ///
18484    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18485    pub fn migrate_module(&self) -> WorkspaceMigration {
18486        let query = self.selection.select("migrateModule");
18487        WorkspaceMigration {
18488            proc: self.proc.clone(),
18489            selection: query,
18490            graphql_client: self.graphql_client.clone(),
18491        }
18492    }
18493    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18494    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18495    ///
18496    /// # Arguments
18497    ///
18498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18499    pub fn migrate_module_opts<'a>(
18500        &self,
18501        opts: WorkspaceMigrateModuleOpts<'a>,
18502    ) -> WorkspaceMigration {
18503        let mut query = self.selection.select("migrateModule");
18504        if let Some(path) = opts.path {
18505            query = query.arg("path", path);
18506        }
18507        WorkspaceMigration {
18508            proc: self.proc.clone(),
18509            selection: query,
18510            graphql_client: self.graphql_client.clone(),
18511        }
18512    }
18513    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18514    /// 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.
18515    /// 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.
18516    ///
18517    /// # Arguments
18518    ///
18519    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18521    pub async fn compare_commits_from(
18522        &self,
18523        source: impl IntoID<Id>,
18524    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18525        let mut query = self.selection.select("compareCommitsFrom");
18526        query = query.arg_lazy(
18527            "source",
18528            Box::new(move || {
18529                let source = source.clone();
18530                Box::pin(async move { source.into_id().await.unwrap().quote() })
18531            }),
18532        );
18533        let query = query.select("id");
18534        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18535        Ok(ids
18536            .into_iter()
18537            .map(|id| WorkspaceCommitPick {
18538                proc: self.proc.clone(),
18539                selection: crate::querybuilder::query()
18540                    .select("node")
18541                    .arg("id", &id.0)
18542                    .inline_fragment("WorkspaceCommitPick"),
18543                graphql_client: self.graphql_client.clone(),
18544            })
18545            .collect())
18546    }
18547    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18548    /// 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.
18549    /// 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.
18550    ///
18551    /// # Arguments
18552    ///
18553    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18554    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18555    pub async fn compare_commits_from_opts<'a>(
18556        &self,
18557        source: impl IntoID<Id>,
18558        opts: WorkspaceCompareCommitsFromOpts<'a>,
18559    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18560        let mut query = self.selection.select("compareCommitsFrom");
18561        query = query.arg_lazy(
18562            "source",
18563            Box::new(move || {
18564                let source = source.clone();
18565                Box::pin(async move { source.into_id().await.unwrap().quote() })
18566            }),
18567        );
18568        if let Some(commits) = opts.commits {
18569            query = query.arg("commits", commits);
18570        }
18571        if let Some(max_commits) = opts.max_commits {
18572            query = query.arg("maxCommits", max_commits);
18573        }
18574        let query = query.select("id");
18575        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18576        Ok(ids
18577            .into_iter()
18578            .map(|id| WorkspaceCommitPick {
18579                proc: self.proc.clone(),
18580                selection: crate::querybuilder::query()
18581                    .select("node")
18582                    .arg("id", &id.0)
18583                    .inline_fragment("WorkspaceCommitPick"),
18584                graphql_client: self.graphql_client.clone(),
18585            })
18586            .collect())
18587    }
18588    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
18589    /// 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.
18590    /// 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.
18591    /// 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.
18592    ///
18593    /// # Arguments
18594    ///
18595    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18596    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18597    pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
18598        let mut query = self.selection.select("withCommitsFrom");
18599        query = query.arg_lazy(
18600            "source",
18601            Box::new(move || {
18602                let source = source.clone();
18603                Box::pin(async move { source.into_id().await.unwrap().quote() })
18604            }),
18605        );
18606        Workspace {
18607            proc: self.proc.clone(),
18608            selection: query,
18609            graphql_client: self.graphql_client.clone(),
18610        }
18611    }
18612    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
18613    /// 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.
18614    /// 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.
18615    /// 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.
18616    ///
18617    /// # Arguments
18618    ///
18619    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18620    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18621    pub fn with_commits_from_opts<'a>(
18622        &self,
18623        source: impl IntoID<Id>,
18624        opts: WorkspaceWithCommitsFromOpts<'a>,
18625    ) -> Workspace {
18626        let mut query = self.selection.select("withCommitsFrom");
18627        query = query.arg_lazy(
18628            "source",
18629            Box::new(move || {
18630                let source = source.clone();
18631                Box::pin(async move { source.into_id().await.unwrap().quote() })
18632            }),
18633        );
18634        if let Some(commits) = opts.commits {
18635            query = query.arg("commits", commits);
18636        }
18637        if let Some(max_commits) = opts.max_commits {
18638            query = query.arg("maxCommits", max_commits);
18639        }
18640        Workspace {
18641            proc: self.proc.clone(),
18642            selection: query,
18643            graphql_client: self.graphql_client.clone(),
18644        }
18645    }
18646    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
18647    /// 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.
18648    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
18649    /// 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.
18650    ///
18651    /// # Arguments
18652    ///
18653    /// * `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.
18654    /// * `message` - Commit message.
18655    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
18656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18657    pub fn with_commit(
18658        &self,
18659        changes: impl IntoID<Id>,
18660        message: impl Into<String>,
18661        date: impl Into<String>,
18662    ) -> Workspace {
18663        let mut query = self.selection.select("withCommit");
18664        query = query.arg_lazy(
18665            "changes",
18666            Box::new(move || {
18667                let changes = changes.clone();
18668                Box::pin(async move { changes.into_id().await.unwrap().quote() })
18669            }),
18670        );
18671        query = query.arg("message", message.into());
18672        query = query.arg("date", date.into());
18673        Workspace {
18674            proc: self.proc.clone(),
18675            selection: query,
18676            graphql_client: self.graphql_client.clone(),
18677        }
18678    }
18679    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
18680    /// 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.
18681    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
18682    /// 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.
18683    ///
18684    /// # Arguments
18685    ///
18686    /// * `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.
18687    /// * `message` - Commit message.
18688    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
18689    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18690    pub fn with_commit_opts<'a>(
18691        &self,
18692        changes: impl IntoID<Id>,
18693        message: impl Into<String>,
18694        date: impl Into<String>,
18695        opts: WorkspaceWithCommitOpts<'a>,
18696    ) -> Workspace {
18697        let mut query = self.selection.select("withCommit");
18698        query = query.arg_lazy(
18699            "changes",
18700            Box::new(move || {
18701                let changes = changes.clone();
18702                Box::pin(async move { changes.into_id().await.unwrap().quote() })
18703            }),
18704        );
18705        query = query.arg("message", message.into());
18706        query = query.arg("date", date.into());
18707        if let Some(author_name) = opts.author_name {
18708            query = query.arg("authorName", author_name);
18709        }
18710        if let Some(author_email) = opts.author_email {
18711            query = query.arg("authorEmail", author_email);
18712        }
18713        if let Some(signoff) = opts.signoff {
18714            query = query.arg("signoff", signoff);
18715        }
18716        Workspace {
18717            proc: self.proc.clone(),
18718            selection: query,
18719            graphql_client: self.graphql_client.clone(),
18720        }
18721    }
18722    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18723    /// 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.
18724    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18725    /// 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.
18726    ///
18727    /// # Arguments
18728    ///
18729    /// * `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.
18730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18731    pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
18732        let mut query = self.selection.select("withReset");
18733        query = query.arg("commit", commit.into());
18734        Workspace {
18735            proc: self.proc.clone(),
18736            selection: query,
18737            graphql_client: self.graphql_client.clone(),
18738        }
18739    }
18740    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18741    /// 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.
18742    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18743    /// 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.
18744    ///
18745    /// # Arguments
18746    ///
18747    /// * `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.
18748    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18749    pub fn with_reset_opts(
18750        &self,
18751        commit: impl Into<String>,
18752        opts: WorkspaceWithResetOpts,
18753    ) -> Workspace {
18754        let mut query = self.selection.select("withReset");
18755        query = query.arg("commit", commit.into());
18756        if let Some(hard) = opts.hard {
18757            query = query.arg("hard", hard);
18758        }
18759        Workspace {
18760            proc: self.proc.clone(),
18761            selection: query,
18762            graphql_client: self.graphql_client.clone(),
18763        }
18764    }
18765    /// Return a snapshot of this workspace as a stable value.
18766    /// 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.
18767    /// 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.
18768    /// 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.
18769    /// The recipe is portable when a remote can serve its base; otherwise it is frozen for this session only.
18770    pub fn snapshot(&self) -> Workspace {
18771        let query = self.selection.select("snapshot");
18772        Workspace {
18773            proc: self.proc.clone(),
18774            selection: query,
18775            graphql_client: self.graphql_client.clone(),
18776        }
18777    }
18778    /// Select workspace-root-relative config and lockfile paths. Empty paths clear the selection.
18779    ///
18780    /// # Arguments
18781    ///
18782    /// * `config_file` - Config file path.
18783    /// * `lock_file` - Lockfile path.
18784    pub fn with_config_paths(
18785        &self,
18786        config_file: impl Into<String>,
18787        lock_file: impl Into<String>,
18788    ) -> Workspace {
18789        let mut query = self.selection.select("withConfigPaths");
18790        query = query.arg("configFile", config_file.into());
18791        query = query.arg("lockFile", lock_file.into());
18792        Workspace {
18793            proc: self.proc.clone(),
18794            selection: query,
18795            graphql_client: self.graphql_client.clone(),
18796        }
18797    }
18798    /// Select the config environment carried by this workspace.
18799    ///
18800    /// # Arguments
18801    ///
18802    /// * `name` - Environment name, or empty to clear the selection.
18803    pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
18804        let mut query = self.selection.select("withConfigEnvironment");
18805        query = query.arg("name", name.into());
18806        Workspace {
18807            proc: self.proc.clone(),
18808            selection: query,
18809            graphql_client: self.graphql_client.clone(),
18810        }
18811    }
18812    /// Return this workspace with the calling client's user-level config re-read and applied.
18813    /// 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.
18814    /// 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.
18815    pub fn with_user_config(&self) -> Workspace {
18816        let query = self.selection.select("withUserConfig");
18817        Workspace {
18818            proc: self.proc.clone(),
18819            selection: query,
18820            graphql_client: self.graphql_client.clone(),
18821        }
18822    }
18823    /// Selected native workspace config file relative to the workspace cwd, if any.
18824    pub async fn config_file(&self) -> Result<String, DaggerError> {
18825        let query = self.selection.select("configFile");
18826        query.execute(self.graphql_client.clone()).await
18827    }
18828    /// Returns a Directory from the workspace.
18829    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18830    ///
18831    /// # Arguments
18832    ///
18833    /// * `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.
18834    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18835    pub fn directory(&self, path: impl Into<String>) -> Directory {
18836        let mut query = self.selection.select("directory");
18837        query = query.arg("path", path.into());
18838        Directory {
18839            proc: self.proc.clone(),
18840            selection: query,
18841            graphql_client: self.graphql_client.clone(),
18842        }
18843    }
18844    /// Returns a Directory from the workspace.
18845    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18846    ///
18847    /// # Arguments
18848    ///
18849    /// * `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.
18850    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18851    pub fn directory_opts<'a>(
18852        &self,
18853        path: impl Into<String>,
18854        opts: WorkspaceDirectoryOpts<'a>,
18855    ) -> Directory {
18856        let mut query = self.selection.select("directory");
18857        query = query.arg("path", path.into());
18858        if let Some(exclude) = opts.exclude {
18859            query = query.arg("exclude", exclude);
18860        }
18861        if let Some(include) = opts.include {
18862            query = query.arg("include", include);
18863        }
18864        if let Some(gitignore) = opts.gitignore {
18865            query = query.arg("gitignore", gitignore);
18866        }
18867        Directory {
18868            proc: self.proc.clone(),
18869            selection: query,
18870            graphql_client: self.graphql_client.clone(),
18871        }
18872    }
18873    /// Returns a File from the workspace.
18874    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18875    ///
18876    /// # Arguments
18877    ///
18878    /// * `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.
18879    pub fn file(&self, path: impl Into<String>) -> File {
18880        let mut query = self.selection.select("file");
18881        query = query.arg("path", path.into());
18882        File {
18883            proc: self.proc.clone(),
18884            selection: query,
18885            graphql_client: self.graphql_client.clone(),
18886        }
18887    }
18888    /// Returns a list of files and directories that match the given pattern.
18889    /// Patterns match paths relative to the workspace root.
18890    ///
18891    /// # Arguments
18892    ///
18893    /// * `pattern` - Pattern to match (e.g., "*.md").
18894    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
18895        let mut query = self.selection.select("glob");
18896        query = query.arg("pattern", pattern.into());
18897        query.execute(self.graphql_client.clone()).await
18898    }
18899    /// Searches for content matching the given regular expression or literal string.
18900    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
18901    /// Runs ripgrep on the client host, falling back to grep if unavailable.
18902    ///
18903    /// # Arguments
18904    ///
18905    /// * `pattern` - The text to match.
18906    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18907    pub async fn search(
18908        &self,
18909        pattern: impl Into<String>,
18910    ) -> Result<Vec<SearchResult>, DaggerError> {
18911        let mut query = self.selection.select("search");
18912        query = query.arg("pattern", pattern.into());
18913        let query = query.select("id");
18914        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18915        Ok(ids
18916            .into_iter()
18917            .map(|id| SearchResult {
18918                proc: self.proc.clone(),
18919                selection: crate::querybuilder::query()
18920                    .select("node")
18921                    .arg("id", &id.0)
18922                    .inline_fragment("SearchResult"),
18923                graphql_client: self.graphql_client.clone(),
18924            })
18925            .collect())
18926    }
18927    /// Searches for content matching the given regular expression or literal string.
18928    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
18929    /// Runs ripgrep on the client host, falling back to grep if unavailable.
18930    ///
18931    /// # Arguments
18932    ///
18933    /// * `pattern` - The text to match.
18934    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18935    pub async fn search_opts<'a>(
18936        &self,
18937        pattern: impl Into<String>,
18938        opts: WorkspaceSearchOpts<'a>,
18939    ) -> Result<Vec<SearchResult>, DaggerError> {
18940        let mut query = self.selection.select("search");
18941        query = query.arg("pattern", pattern.into());
18942        if let Some(paths) = opts.paths {
18943            query = query.arg("paths", paths);
18944        }
18945        if let Some(globs) = opts.globs {
18946            query = query.arg("globs", globs);
18947        }
18948        if let Some(literal) = opts.literal {
18949            query = query.arg("literal", literal);
18950        }
18951        if let Some(multiline) = opts.multiline {
18952            query = query.arg("multiline", multiline);
18953        }
18954        if let Some(dotall) = opts.dotall {
18955            query = query.arg("dotall", dotall);
18956        }
18957        if let Some(insensitive) = opts.insensitive {
18958            query = query.arg("insensitive", insensitive);
18959        }
18960        if let Some(skip_ignored) = opts.skip_ignored {
18961            query = query.arg("skipIgnored", skip_ignored);
18962        }
18963        if let Some(skip_hidden) = opts.skip_hidden {
18964            query = query.arg("skipHidden", skip_hidden);
18965        }
18966        if let Some(files_only) = opts.files_only {
18967            query = query.arg("filesOnly", files_only);
18968        }
18969        if let Some(limit) = opts.limit {
18970            query = query.arg("limit", limit);
18971        }
18972        let query = query.select("id");
18973        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18974        Ok(ids
18975            .into_iter()
18976            .map(|id| SearchResult {
18977                proc: self.proc.clone(),
18978                selection: crate::querybuilder::query()
18979                    .select("node")
18980                    .arg("id", &id.0)
18981                    .inline_fragment("SearchResult"),
18982                graphql_client: self.graphql_client.clone(),
18983            })
18984            .collect())
18985    }
18986    /// Search for a file or directory by walking up from the start path within the workspace.
18987    /// Returns the absolute workspace path if found, or null if not found.
18988    /// Relative start paths resolve from the workspace cwd.
18989    /// The search stops at the workspace root and will not traverse above it.
18990    ///
18991    /// # Arguments
18992    ///
18993    /// * `name` - The name of the file or directory to search for.
18994    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18995    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
18996        let mut query = self.selection.select("findUp");
18997        query = query.arg("name", name.into());
18998        query.execute(self.graphql_client.clone()).await
18999    }
19000    /// Search for a file or directory by walking up from the start path within the workspace.
19001    /// Returns the absolute workspace path if found, or null if not found.
19002    /// Relative start paths resolve from the workspace cwd.
19003    /// The search stops at the workspace root and will not traverse above it.
19004    ///
19005    /// # Arguments
19006    ///
19007    /// * `name` - The name of the file or directory to search for.
19008    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19009    pub async fn find_up_opts<'a>(
19010        &self,
19011        name: impl Into<String>,
19012        opts: WorkspaceFindUpOpts<'a>,
19013    ) -> Result<String, DaggerError> {
19014        let mut query = self.selection.select("findUp");
19015        query = query.arg("name", name.into());
19016        if let Some(from) = opts.from {
19017            query = query.arg("from", from);
19018        }
19019        query.execute(self.graphql_client.clone()).await
19020    }
19021    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19022    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19023    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19024    ///
19025    /// # Arguments
19026    ///
19027    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19028    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19029    pub async fn find_roots(
19030        &self,
19031        markers: Vec<impl Into<String>>,
19032    ) -> Result<Vec<String>, DaggerError> {
19033        let mut query = self.selection.select("findRoots");
19034        query = query.arg(
19035            "markers",
19036            markers
19037                .into_iter()
19038                .map(|i| i.into())
19039                .collect::<Vec<String>>(),
19040        );
19041        query.execute(self.graphql_client.clone()).await
19042    }
19043    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19044    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19045    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19046    ///
19047    /// # Arguments
19048    ///
19049    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19050    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19051    pub async fn find_roots_opts<'a>(
19052        &self,
19053        markers: Vec<impl Into<String>>,
19054        opts: WorkspaceFindRootsOpts<'a>,
19055    ) -> Result<Vec<String>, DaggerError> {
19056        let mut query = self.selection.select("findRoots");
19057        query = query.arg(
19058            "markers",
19059            markers
19060                .into_iter()
19061                .map(|i| i.into())
19062                .collect::<Vec<String>>(),
19063        );
19064        if let Some(start) = opts.start {
19065            query = query.arg("start", start);
19066        }
19067        if let Some(exclude) = opts.exclude {
19068            query = query.arg("exclude", exclude);
19069        }
19070        query.execute(self.graphql_client.clone()).await
19071    }
19072    /// Git state for this workspace. Errors if the workspace is not in a git repository.
19073    pub fn git(&self) -> WorkspaceGit {
19074        let query = self.selection.select("git");
19075        WorkspaceGit {
19076            proc: self.proc.clone(),
19077            selection: query,
19078            graphql_client: self.graphql_client.clone(),
19079        }
19080    }
19081    /// Return this workspace with a new or replaced file, without mutating the source.
19082    ///
19083    /// # Arguments
19084    ///
19085    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19086    /// * `contents` - Contents of the new file.
19087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19088    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
19089        let mut query = self.selection.select("withNewFile");
19090        query = query.arg("path", path.into());
19091        query = query.arg("contents", contents.into());
19092        Workspace {
19093            proc: self.proc.clone(),
19094            selection: query,
19095            graphql_client: self.graphql_client.clone(),
19096        }
19097    }
19098    /// Return this workspace with a new or replaced file, without mutating the source.
19099    ///
19100    /// # Arguments
19101    ///
19102    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19103    /// * `contents` - Contents of the new file.
19104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19105    pub fn with_new_file_opts(
19106        &self,
19107        path: impl Into<String>,
19108        contents: impl Into<String>,
19109        opts: WorkspaceWithNewFileOpts,
19110    ) -> Workspace {
19111        let mut query = self.selection.select("withNewFile");
19112        query = query.arg("path", path.into());
19113        query = query.arg("contents", contents.into());
19114        if let Some(permissions) = opts.permissions {
19115            query = query.arg("permissions", permissions);
19116        }
19117        Workspace {
19118            proc: self.proc.clone(),
19119            selection: query,
19120            graphql_client: self.graphql_client.clone(),
19121        }
19122    }
19123    /// Return this workspace with a file added or replaced, without mutating the source.
19124    ///
19125    /// # Arguments
19126    ///
19127    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19128    /// * `source` - File to add.
19129    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19130    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19131        let mut query = self.selection.select("withFile");
19132        query = query.arg("path", path.into());
19133        query = query.arg_lazy(
19134            "source",
19135            Box::new(move || {
19136                let source = source.clone();
19137                Box::pin(async move { source.into_id().await.unwrap().quote() })
19138            }),
19139        );
19140        Workspace {
19141            proc: self.proc.clone(),
19142            selection: query,
19143            graphql_client: self.graphql_client.clone(),
19144        }
19145    }
19146    /// Return this workspace with a file added or replaced, without mutating the source.
19147    ///
19148    /// # Arguments
19149    ///
19150    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19151    /// * `source` - File to add.
19152    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19153    pub fn with_file_opts(
19154        &self,
19155        path: impl Into<String>,
19156        source: impl IntoID<Id>,
19157        opts: WorkspaceWithFileOpts,
19158    ) -> Workspace {
19159        let mut query = self.selection.select("withFile");
19160        query = query.arg("path", path.into());
19161        query = query.arg_lazy(
19162            "source",
19163            Box::new(move || {
19164                let source = source.clone();
19165                Box::pin(async move { source.into_id().await.unwrap().quote() })
19166            }),
19167        );
19168        if let Some(permissions) = opts.permissions {
19169            query = query.arg("permissions", permissions);
19170        }
19171        Workspace {
19172            proc: self.proc.clone(),
19173            selection: query,
19174            graphql_client: self.graphql_client.clone(),
19175        }
19176    }
19177    /// Return this workspace with the given path replaced by a directory, without mutating the source.
19178    /// 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.
19179    ///
19180    /// # Arguments
19181    ///
19182    /// * `path` - Path to replace. Relative paths resolve from the workspace cwd.
19183    /// * `source` - Directory to write there.
19184    pub fn with_new_directory(
19185        &self,
19186        path: impl Into<String>,
19187        source: impl IntoID<Id>,
19188    ) -> Workspace {
19189        let mut query = self.selection.select("withNewDirectory");
19190        query = query.arg("path", path.into());
19191        query = query.arg_lazy(
19192            "source",
19193            Box::new(move || {
19194                let source = source.clone();
19195                Box::pin(async move { source.into_id().await.unwrap().quote() })
19196            }),
19197        );
19198        Workspace {
19199            proc: self.proc.clone(),
19200            selection: query,
19201            graphql_client: self.graphql_client.clone(),
19202        }
19203    }
19204    /// Return this workspace with a directory merged into the given path, without mutating the source.
19205    /// Anything already at the path stays, and files the source carries win, as with Directory.withDirectory. Use withNewDirectory to replace the path instead.
19206    ///
19207    /// # Arguments
19208    ///
19209    /// * `path` - Path to merge into. Relative paths resolve from the workspace cwd.
19210    /// * `source` - Directory to merge there.
19211    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19212        let mut query = self.selection.select("withDirectory");
19213        query = query.arg("path", path.into());
19214        query = query.arg_lazy(
19215            "source",
19216            Box::new(move || {
19217                let source = source.clone();
19218                Box::pin(async move { source.into_id().await.unwrap().quote() })
19219            }),
19220        );
19221        Workspace {
19222            proc: self.proc.clone(),
19223            selection: query,
19224            graphql_client: self.graphql_client.clone(),
19225        }
19226    }
19227    /// Return this workspace with a file removed, without mutating the source.
19228    ///
19229    /// # Arguments
19230    ///
19231    /// * `path` - Path of the file to remove. Relative paths resolve from the workspace cwd.
19232    pub fn without_file(&self, path: impl Into<String>) -> Workspace {
19233        let mut query = self.selection.select("withoutFile");
19234        query = query.arg("path", path.into());
19235        Workspace {
19236            proc: self.proc.clone(),
19237            selection: query,
19238            graphql_client: self.graphql_client.clone(),
19239        }
19240    }
19241    /// Return this workspace with files removed, without mutating the source.
19242    ///
19243    /// # Arguments
19244    ///
19245    /// * `paths` - Paths of the files to remove. Relative paths resolve from the workspace cwd.
19246    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Workspace {
19247        let mut query = self.selection.select("withoutFiles");
19248        query = query.arg(
19249            "paths",
19250            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
19251        );
19252        Workspace {
19253            proc: self.proc.clone(),
19254            selection: query,
19255            graphql_client: self.graphql_client.clone(),
19256        }
19257    }
19258    /// Return this workspace with a directory removed, without mutating the source.
19259    ///
19260    /// # Arguments
19261    ///
19262    /// * `path` - Path of the directory to remove. Relative paths resolve from the workspace cwd.
19263    pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
19264        let mut query = self.selection.select("withoutDirectory");
19265        query = query.arg("path", path.into());
19266        Workspace {
19267            proc: self.proc.clone(),
19268            selection: query,
19269            graphql_client: self.graphql_client.clone(),
19270        }
19271    }
19272    /// Return this workspace with a changeset applied, without mutating the source.
19273    ///
19274    /// # Arguments
19275    ///
19276    /// * `changes` - Changes to apply.
19277    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
19278        let mut query = self.selection.select("withChanges");
19279        query = query.arg_lazy(
19280            "changes",
19281            Box::new(move || {
19282                let changes = changes.clone();
19283                Box::pin(async move { changes.into_id().await.unwrap().quote() })
19284            }),
19285        );
19286        Workspace {
19287            proc: self.proc.clone(),
19288            selection: query,
19289            graphql_client: self.graphql_client.clone(),
19290        }
19291    }
19292    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19293    /// 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.
19294    ///
19295    /// # Arguments
19296    ///
19297    /// * `patch` - File containing the patch to apply
19298    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19299    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Workspace {
19300        let mut query = self.selection.select("withPatchFile");
19301        query = query.arg_lazy(
19302            "patch",
19303            Box::new(move || {
19304                let patch = patch.clone();
19305                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19306            }),
19307        );
19308        Workspace {
19309            proc: self.proc.clone(),
19310            selection: query,
19311            graphql_client: self.graphql_client.clone(),
19312        }
19313    }
19314    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19315    /// 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.
19316    ///
19317    /// # Arguments
19318    ///
19319    /// * `patch` - File containing the patch to apply
19320    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19321    pub fn with_patch_file_opts(
19322        &self,
19323        patch: impl IntoID<Id>,
19324        opts: WorkspaceWithPatchFileOpts,
19325    ) -> Workspace {
19326        let mut query = self.selection.select("withPatchFile");
19327        query = query.arg_lazy(
19328            "patch",
19329            Box::new(move || {
19330                let patch = patch.clone();
19331                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19332            }),
19333        );
19334        if let Some(on_conflict) = opts.on_conflict {
19335            query = query.arg("onConflict", on_conflict);
19336        }
19337        Workspace {
19338            proc: self.proc.clone(),
19339            selection: query,
19340            graphql_client: self.graphql_client.clone(),
19341        }
19342    }
19343    /// Return this workspace with its working directory pointed at the given workspace-relative path.
19344    ///
19345    /// # Arguments
19346    ///
19347    /// * `path` - Workspace-relative path to use as the working directory.
19348    pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
19349        let mut query = self.selection.select("withWorkdir");
19350        query = query.arg("path", path.into());
19351        Workspace {
19352            proc: self.proc.clone(),
19353            selection: query,
19354            graphql_client: self.graphql_client.clone(),
19355        }
19356    }
19357    /// Return this workspace with a directory mounted read-only at the given path, without mutating the source.
19358    /// 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.
19359    ///
19360    /// # Arguments
19361    ///
19362    /// * `path` - Location of the mounted directory. Relative paths resolve from the workspace cwd.
19363    /// * `source` - Directory to mount.
19364    pub fn with_mounted_directory(
19365        &self,
19366        path: impl Into<String>,
19367        source: impl IntoID<Id>,
19368    ) -> Workspace {
19369        let mut query = self.selection.select("withMountedDirectory");
19370        query = query.arg("path", path.into());
19371        query = query.arg_lazy(
19372            "source",
19373            Box::new(move || {
19374                let source = source.clone();
19375                Box::pin(async move { source.into_id().await.unwrap().quote() })
19376            }),
19377        );
19378        Workspace {
19379            proc: self.proc.clone(),
19380            selection: query,
19381            graphql_client: self.graphql_client.clone(),
19382        }
19383    }
19384    /// Return this workspace with a file mounted read-only at the given path, without mutating the source.
19385    /// 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.
19386    ///
19387    /// # Arguments
19388    ///
19389    /// * `path` - Location of the mounted file. Relative paths resolve from the workspace cwd.
19390    /// * `source` - File to mount.
19391    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19392        let mut query = self.selection.select("withMountedFile");
19393        query = query.arg("path", path.into());
19394        query = query.arg_lazy(
19395            "source",
19396            Box::new(move || {
19397                let source = source.clone();
19398                Box::pin(async move { source.into_id().await.unwrap().quote() })
19399            }),
19400        );
19401        Workspace {
19402            proc: self.proc.clone(),
19403            selection: query,
19404            graphql_client: self.graphql_client.clone(),
19405        }
19406    }
19407    /// Return this workspace with the content mounted at the given path unmounted.
19408    /// Removes directory and file mounts at or below the path, revealing the underlying workspace content. Other mounts and pending changes are preserved.
19409    ///
19410    /// # Arguments
19411    ///
19412    /// * `path` - Location of the mount to remove. Relative paths resolve from the workspace cwd. Use / to remove all mounts.
19413    pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
19414        let mut query = self.selection.select("withoutMount");
19415        query = query.arg("path", path.into());
19416        Workspace {
19417            proc: self.proc.clone(),
19418            selection: query,
19419            graphql_client: self.graphql_client.clone(),
19420        }
19421    }
19422    /// Return this workspace with a module installed in its config.
19423    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19424    ///
19425    /// # Arguments
19426    ///
19427    /// * `r#ref` - Module reference to install.
19428    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19429    pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
19430        let mut query = self.selection.select("withModule");
19431        query = query.arg("ref", r#ref.into());
19432        Workspace {
19433            proc: self.proc.clone(),
19434            selection: query,
19435            graphql_client: self.graphql_client.clone(),
19436        }
19437    }
19438    /// Return this workspace with a module installed in its config.
19439    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19440    ///
19441    /// # Arguments
19442    ///
19443    /// * `r#ref` - Module reference to install.
19444    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19445    pub fn with_module_opts<'a>(
19446        &self,
19447        r#ref: impl Into<String>,
19448        opts: WorkspaceWithModuleOpts<'a>,
19449    ) -> Workspace {
19450        let mut query = self.selection.select("withModule");
19451        query = query.arg("ref", r#ref.into());
19452        if let Some(name) = opts.name {
19453            query = query.arg("name", name);
19454        }
19455        if let Some(here) = opts.here {
19456            query = query.arg("here", here);
19457        }
19458        Workspace {
19459            proc: self.proc.clone(),
19460            selection: query,
19461            graphql_client: self.graphql_client.clone(),
19462        }
19463    }
19464    /// Return this workspace with a module removed from its config.
19465    /// When the session selects an env, only that env's overlay entry is removed.
19466    ///
19467    /// # Arguments
19468    ///
19469    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19470    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19471    pub fn without_module(&self, name: impl Into<String>) -> Workspace {
19472        let mut query = self.selection.select("withoutModule");
19473        query = query.arg("name", name.into());
19474        Workspace {
19475            proc: self.proc.clone(),
19476            selection: query,
19477            graphql_client: self.graphql_client.clone(),
19478        }
19479    }
19480    /// Return this workspace with a module removed from its config.
19481    /// When the session selects an env, only that env's overlay entry is removed.
19482    ///
19483    /// # Arguments
19484    ///
19485    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19486    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19487    pub fn without_module_opts(
19488        &self,
19489        name: impl Into<String>,
19490        opts: WorkspaceWithoutModuleOpts,
19491    ) -> Workspace {
19492        let mut query = self.selection.select("withoutModule");
19493        query = query.arg("name", name.into());
19494        if let Some(here) = opts.here {
19495            query = query.arg("here", here);
19496        }
19497        Workspace {
19498            proc: self.proc.clone(),
19499            selection: query,
19500            graphql_client: self.graphql_client.clone(),
19501        }
19502    }
19503    /// Return this workspace with an SDK installed in its config.
19504    ///
19505    /// # Arguments
19506    ///
19507    /// * `r#ref` - SDK module reference to install.
19508    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19509    pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
19510        let mut query = self.selection.select("withSDK");
19511        query = query.arg("ref", r#ref.into());
19512        Workspace {
19513            proc: self.proc.clone(),
19514            selection: query,
19515            graphql_client: self.graphql_client.clone(),
19516        }
19517    }
19518    /// Return this workspace with an SDK installed in its config.
19519    ///
19520    /// # Arguments
19521    ///
19522    /// * `r#ref` - SDK module reference to install.
19523    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19524    pub fn with_sdk_opts<'a>(
19525        &self,
19526        r#ref: impl Into<String>,
19527        opts: WorkspaceWithSdkOpts<'a>,
19528    ) -> Workspace {
19529        let mut query = self.selection.select("withSDK");
19530        query = query.arg("ref", r#ref.into());
19531        if let Some(name) = opts.name {
19532            query = query.arg("name", name);
19533        }
19534        if let Some(here) = opts.here {
19535            query = query.arg("here", here);
19536        }
19537        if let Some(as_sdk_name) = opts.as_sdk_name {
19538            query = query.arg("asSdkName", as_sdk_name);
19539        }
19540        Workspace {
19541            proc: self.proc.clone(),
19542            selection: query,
19543            graphql_client: self.graphql_client.clone(),
19544        }
19545    }
19546    /// Return this workspace with an SDK removed from its config.
19547    ///
19548    /// # Arguments
19549    ///
19550    /// * `name` - Name of the installed SDK entry to remove.
19551    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19552    pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
19553        let mut query = self.selection.select("withoutSDK");
19554        query = query.arg("name", name.into());
19555        Workspace {
19556            proc: self.proc.clone(),
19557            selection: query,
19558            graphql_client: self.graphql_client.clone(),
19559        }
19560    }
19561    /// Return this workspace with an SDK removed from its config.
19562    ///
19563    /// # Arguments
19564    ///
19565    /// * `name` - Name of the installed SDK entry to remove.
19566    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19567    pub fn without_sdk_opts(
19568        &self,
19569        name: impl Into<String>,
19570        opts: WorkspaceWithoutSdkOpts,
19571    ) -> Workspace {
19572        let mut query = self.selection.select("withoutSDK");
19573        query = query.arg("name", name.into());
19574        if let Some(here) = opts.here {
19575            query = query.arg("here", here);
19576        }
19577        Workspace {
19578            proc: self.proc.clone(),
19579            selection: query,
19580            graphql_client: self.graphql_client.clone(),
19581        }
19582    }
19583    /// Return this workspace with an installed module selected as its entrypoint.
19584    /// Every other entrypoint selection is cleared. Entrypoints live in the base workspace config.
19585    ///
19586    /// # Arguments
19587    ///
19588    /// * `name` - Exact installed module name.
19589    pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
19590        let mut query = self.selection.select("withEntrypoint");
19591        query = query.arg("name", name.into());
19592        Workspace {
19593            proc: self.proc.clone(),
19594            selection: query,
19595            graphql_client: self.graphql_client.clone(),
19596        }
19597    }
19598    /// Return this workspace with no module selected as its entrypoint.
19599    pub fn without_entrypoint(&self) -> Workspace {
19600        let query = self.selection.select("withoutEntrypoint");
19601        Workspace {
19602            proc: self.proc.clone(),
19603            selection: query,
19604            graphql_client: self.graphql_client.clone(),
19605        }
19606    }
19607    /// Return this workspace with a location initialized as a module scope.
19608    /// The selected SDK module records the scope and generates the module source.
19609    ///
19610    /// # Arguments
19611    ///
19612    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
19613    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19614    pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
19615        let mut query = self.selection.select("withInitModule");
19616        query = query.arg("sdk", sdk.into());
19617        Workspace {
19618            proc: self.proc.clone(),
19619            selection: query,
19620            graphql_client: self.graphql_client.clone(),
19621        }
19622    }
19623    /// Return this workspace with a location initialized as a module scope.
19624    /// The selected SDK module records the scope and generates the module source.
19625    ///
19626    /// # Arguments
19627    ///
19628    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
19629    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19630    pub fn with_init_module_opts<'a>(
19631        &self,
19632        sdk: impl Into<String>,
19633        opts: WorkspaceWithInitModuleOpts<'a>,
19634    ) -> Workspace {
19635        let mut query = self.selection.select("withInitModule");
19636        query = query.arg("sdk", sdk.into());
19637        if let Some(name) = opts.name {
19638            query = query.arg("name", name);
19639        }
19640        if let Some(path) = opts.path {
19641            query = query.arg("path", path);
19642        }
19643        if let Some(install) = opts.install {
19644            query = query.arg("install", install);
19645        }
19646        if let Some(entrypoint) = opts.entrypoint {
19647            query = query.arg("entrypoint", entrypoint);
19648        }
19649        if let Some(settings) = opts.settings {
19650            query = query.arg("settings", settings);
19651        }
19652        Workspace {
19653            proc: self.proc.clone(),
19654            selection: query,
19655            graphql_client: self.graphql_client.clone(),
19656        }
19657    }
19658    /// Return the selected SDK module's current scope at this workspace location.
19659    ///
19660    /// # Arguments
19661    ///
19662    /// * `sdk` - SDK name to probe. Required.
19663    pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
19664        let mut query = self.selection.select("detectScope");
19665        query = query.arg("sdk", sdk.into());
19666        query.execute(self.graphql_client.clone()).await
19667    }
19668    /// Return this workspace with a generated module client added to one SDK scope.
19669    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
19670    ///
19671    /// # Arguments
19672    ///
19673    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
19674    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19675    pub fn with_client(&self, module: impl Into<String>) -> Workspace {
19676        let mut query = self.selection.select("withClient");
19677        query = query.arg("module", module.into());
19678        Workspace {
19679            proc: self.proc.clone(),
19680            selection: query,
19681            graphql_client: self.graphql_client.clone(),
19682        }
19683    }
19684    /// Return this workspace with a generated module client added to one SDK scope.
19685    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
19686    ///
19687    /// # Arguments
19688    ///
19689    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
19690    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19691    pub fn with_client_opts<'a>(
19692        &self,
19693        module: impl Into<String>,
19694        opts: WorkspaceWithClientOpts<'a>,
19695    ) -> Workspace {
19696        let mut query = self.selection.select("withClient");
19697        query = query.arg("module", module.into());
19698        if let Some(sdk) = opts.sdk {
19699            query = query.arg("sdk", sdk);
19700        }
19701        if let Some(settings) = opts.settings {
19702            query = query.arg("settings", settings);
19703        }
19704        Workspace {
19705            proc: self.proc.clone(),
19706            selection: query,
19707            graphql_client: self.graphql_client.clone(),
19708        }
19709    }
19710    /// Return this workspace with a module client removed from the deepest matching recorded scope.
19711    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
19712    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
19713    ///
19714    /// # Arguments
19715    ///
19716    /// * `module` - The recorded target to remove.
19717    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19718    pub fn without_client(&self, module: impl Into<String>) -> Workspace {
19719        let mut query = self.selection.select("withoutClient");
19720        query = query.arg("module", module.into());
19721        Workspace {
19722            proc: self.proc.clone(),
19723            selection: query,
19724            graphql_client: self.graphql_client.clone(),
19725        }
19726    }
19727    /// Return this workspace with a module client removed from the deepest matching recorded scope.
19728    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
19729    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
19730    ///
19731    /// # Arguments
19732    ///
19733    /// * `module` - The recorded target to remove.
19734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19735    pub fn without_client_opts<'a>(
19736        &self,
19737        module: impl Into<String>,
19738        opts: WorkspaceWithoutClientOpts<'a>,
19739    ) -> Workspace {
19740        let mut query = self.selection.select("withoutClient");
19741        query = query.arg("module", module.into());
19742        if let Some(sdk) = opts.sdk {
19743            query = query.arg("sdk", sdk);
19744        }
19745        Workspace {
19746            proc: self.proc.clone(),
19747            selection: query,
19748            graphql_client: self.graphql_client.clone(),
19749        }
19750    }
19751    /// Return this workspace with the selected module clients updated.
19752    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
19753    /// The selected SDK module then regenerates every scope that owns one of the targets.
19754    ///
19755    /// # Arguments
19756    ///
19757    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19758    pub fn with_updated_clients(&self) -> Workspace {
19759        let query = self.selection.select("withUpdatedClients");
19760        Workspace {
19761            proc: self.proc.clone(),
19762            selection: query,
19763            graphql_client: self.graphql_client.clone(),
19764        }
19765    }
19766    /// Return this workspace with the selected module clients updated.
19767    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
19768    /// The selected SDK module then regenerates every scope that owns one of the targets.
19769    ///
19770    /// # Arguments
19771    ///
19772    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19773    pub fn with_updated_clients_opts<'a>(
19774        &self,
19775        opts: WorkspaceWithUpdatedClientsOpts<'a>,
19776    ) -> Workspace {
19777        let mut query = self.selection.select("withUpdatedClients");
19778        if let Some(modules) = opts.modules {
19779            query = query.arg("modules", modules);
19780        }
19781        if let Some(all) = opts.all {
19782            query = query.arg("all", all);
19783        }
19784        if let Some(sdk) = opts.sdk {
19785            query = query.arg("sdk", sdk);
19786        }
19787        Workspace {
19788            proc: self.proc.clone(),
19789            selection: query,
19790            graphql_client: self.graphql_client.clone(),
19791        }
19792    }
19793    /// Return this workspace with a configuration value written.
19794    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
19795    ///
19796    /// # Arguments
19797    ///
19798    /// * `key` - Dotted key path.
19799    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
19800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19801    pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
19802        let mut query = self.selection.select("withConfigValue");
19803        query = query.arg("key", key.into());
19804        query = query.arg("value", value.into());
19805        Workspace {
19806            proc: self.proc.clone(),
19807            selection: query,
19808            graphql_client: self.graphql_client.clone(),
19809        }
19810    }
19811    /// Return this workspace with a configuration value written.
19812    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
19813    ///
19814    /// # Arguments
19815    ///
19816    /// * `key` - Dotted key path.
19817    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
19818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19819    pub fn with_config_value_opts<'a>(
19820        &self,
19821        key: impl Into<String>,
19822        value: impl Into<String>,
19823        opts: WorkspaceWithConfigValueOpts<'a>,
19824    ) -> Workspace {
19825        let mut query = self.selection.select("withConfigValue");
19826        query = query.arg("key", key.into());
19827        query = query.arg("value", value.into());
19828        if let Some(values) = opts.values {
19829            query = query.arg("values", values);
19830        }
19831        if let Some(here) = opts.here {
19832            query = query.arg("here", here);
19833        }
19834        Workspace {
19835            proc: self.proc.clone(),
19836            selection: query,
19837            graphql_client: self.graphql_client.clone(),
19838        }
19839    }
19840    /// Return this workspace with a configuration value removed.
19841    /// Errors when the key is not currently set.
19842    /// When the session selects an env, the key is scoped to that env's overlay.
19843    ///
19844    /// # Arguments
19845    ///
19846    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
19847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19848    pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
19849        let mut query = self.selection.select("withoutConfigValue");
19850        query = query.arg("key", key.into());
19851        Workspace {
19852            proc: self.proc.clone(),
19853            selection: query,
19854            graphql_client: self.graphql_client.clone(),
19855        }
19856    }
19857    /// Return this workspace with a configuration value removed.
19858    /// Errors when the key is not currently set.
19859    /// When the session selects an env, the key is scoped to that env's overlay.
19860    ///
19861    /// # Arguments
19862    ///
19863    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
19864    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19865    pub fn without_config_value_opts(
19866        &self,
19867        key: impl Into<String>,
19868        opts: WorkspaceWithoutConfigValueOpts,
19869    ) -> Workspace {
19870        let mut query = self.selection.select("withoutConfigValue");
19871        query = query.arg("key", key.into());
19872        if let Some(here) = opts.here {
19873            query = query.arg("here", here);
19874        }
19875        Workspace {
19876            proc: self.proc.clone(),
19877            selection: query,
19878            graphql_client: self.graphql_client.clone(),
19879        }
19880    }
19881    /// Return this workspace with a named config environment created.
19882    ///
19883    /// # Arguments
19884    ///
19885    /// * `name` - Environment name.
19886    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19887    pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
19888        let mut query = self.selection.select("withConfigEnv");
19889        query = query.arg("name", name.into());
19890        Workspace {
19891            proc: self.proc.clone(),
19892            selection: query,
19893            graphql_client: self.graphql_client.clone(),
19894        }
19895    }
19896    /// Return this workspace with a named config environment created.
19897    ///
19898    /// # Arguments
19899    ///
19900    /// * `name` - Environment name.
19901    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19902    pub fn with_config_env_opts(
19903        &self,
19904        name: impl Into<String>,
19905        opts: WorkspaceWithConfigEnvOpts,
19906    ) -> Workspace {
19907        let mut query = self.selection.select("withConfigEnv");
19908        query = query.arg("name", name.into());
19909        if let Some(here) = opts.here {
19910            query = query.arg("here", here);
19911        }
19912        Workspace {
19913            proc: self.proc.clone(),
19914            selection: query,
19915            graphql_client: self.graphql_client.clone(),
19916        }
19917    }
19918    /// Return this workspace with a named config environment removed.
19919    ///
19920    /// # Arguments
19921    ///
19922    /// * `name` - Environment name.
19923    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19924    pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
19925        let mut query = self.selection.select("withoutConfigEnv");
19926        query = query.arg("name", name.into());
19927        Workspace {
19928            proc: self.proc.clone(),
19929            selection: query,
19930            graphql_client: self.graphql_client.clone(),
19931        }
19932    }
19933    /// Return this workspace with a named config environment removed.
19934    ///
19935    /// # Arguments
19936    ///
19937    /// * `name` - Environment name.
19938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19939    pub fn without_config_env_opts(
19940        &self,
19941        name: impl Into<String>,
19942        opts: WorkspaceWithoutConfigEnvOpts,
19943    ) -> Workspace {
19944        let mut query = self.selection.select("withoutConfigEnv");
19945        query = query.arg("name", name.into());
19946        if let Some(here) = opts.here {
19947            query = query.arg("here", here);
19948        }
19949        Workspace {
19950            proc: self.proc.clone(),
19951            selection: query,
19952            graphql_client: self.graphql_client.clone(),
19953        }
19954    }
19955    /// Return this workspace with refreshed lockfile state.
19956    /// SDK client scopes are regenerated unless noGenerate is true.
19957    ///
19958    /// # Arguments
19959    ///
19960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19961    pub fn with_updated_lock(&self) -> Workspace {
19962        let query = self.selection.select("withUpdatedLock");
19963        Workspace {
19964            proc: self.proc.clone(),
19965            selection: query,
19966            graphql_client: self.graphql_client.clone(),
19967        }
19968    }
19969    /// Return this workspace with refreshed lockfile state.
19970    /// SDK client scopes are regenerated unless noGenerate is true.
19971    ///
19972    /// # Arguments
19973    ///
19974    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19975    pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
19976        let mut query = self.selection.select("withUpdatedLock");
19977        if let Some(no_generate) = opts.no_generate {
19978            query = query.arg("noGenerate", no_generate);
19979        }
19980        Workspace {
19981            proc: self.proc.clone(),
19982            selection: query,
19983            graphql_client: self.graphql_client.clone(),
19984        }
19985    }
19986    /// Return this workspace with updated module sources, versions and lockfile state.
19987    /// An SDK client scope is regenerated when it targets an updated module.
19988    ///
19989    /// # Arguments
19990    ///
19991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19992    pub fn with_updated_modules(&self) -> Workspace {
19993        let query = self.selection.select("withUpdatedModules");
19994        Workspace {
19995            proc: self.proc.clone(),
19996            selection: query,
19997            graphql_client: self.graphql_client.clone(),
19998        }
19999    }
20000    /// Return this workspace with updated module sources, versions and lockfile state.
20001    /// An SDK client scope is regenerated when it targets an updated module.
20002    ///
20003    /// # Arguments
20004    ///
20005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20006    pub fn with_updated_modules_opts<'a>(
20007        &self,
20008        opts: WorkspaceWithUpdatedModulesOpts<'a>,
20009    ) -> Workspace {
20010        let mut query = self.selection.select("withUpdatedModules");
20011        if let Some(names) = opts.names {
20012            query = query.arg("names", names);
20013        }
20014        if let Some(version) = opts.version {
20015            query = query.arg("version", version);
20016        }
20017        if let Some(source) = opts.source {
20018            query = query.arg("source", source);
20019        }
20020        Workspace {
20021            proc: self.proc.clone(),
20022            selection: query,
20023            graphql_client: self.graphql_client.clone(),
20024        }
20025    }
20026    /// Installed SDKs.
20027    pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
20028        let query = self.selection.select("sdks");
20029        let query = query.select("id");
20030        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20031        Ok(ids
20032            .into_iter()
20033            .map(|id| WorkspaceSdk {
20034                proc: self.proc.clone(),
20035                selection: crate::querybuilder::query()
20036                    .select("node")
20037                    .arg("id", &id.0)
20038                    .inline_fragment("WorkspaceSDK"),
20039                graphql_client: self.graphql_client.clone(),
20040            })
20041            .collect())
20042    }
20043    /// An installed SDK, by name.
20044    ///
20045    /// # Arguments
20046    ///
20047    /// * `name` - SDK name to look up.
20048    pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
20049        let mut query = self.selection.select("sdk");
20050        query = query.arg("name", name.into());
20051        WorkspaceSdk {
20052            proc: self.proc.clone(),
20053            selection: query,
20054            graphql_client: self.graphql_client.clone(),
20055        }
20056    }
20057    /// Return this workspace's changes, with paths relative to its working directory.
20058    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20059    ///
20060    /// # Arguments
20061    ///
20062    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20063    pub fn changes(&self) -> Changeset {
20064        let query = self.selection.select("changes");
20065        Changeset {
20066            proc: self.proc.clone(),
20067            selection: query,
20068            graphql_client: self.graphql_client.clone(),
20069        }
20070    }
20071    /// Return this workspace's changes, with paths relative to its working directory.
20072    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20073    ///
20074    /// # Arguments
20075    ///
20076    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20077    pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
20078        let mut query = self.selection.select("changes");
20079        if let Some(from) = opts.from {
20080            query = query.arg("from", from);
20081        }
20082        Changeset {
20083            proc: self.proc.clone(),
20084            selection: query,
20085            graphql_client: self.graphql_client.clone(),
20086        }
20087    }
20088    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20089    /// 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.
20090    /// 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.
20091    /// 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.
20092    ///
20093    /// # Arguments
20094    ///
20095    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20096    pub async fn export(&self) -> Result<Void, DaggerError> {
20097        let query = self.selection.select("export");
20098        query.execute(self.graphql_client.clone()).await
20099    }
20100    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20101    /// 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.
20102    /// 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.
20103    /// 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.
20104    ///
20105    /// # Arguments
20106    ///
20107    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20108    pub async fn export_opts<'a>(
20109        &self,
20110        opts: WorkspaceExportOpts<'a>,
20111    ) -> Result<Void, DaggerError> {
20112        let mut query = self.selection.select("export");
20113        if let Some(path) = opts.path {
20114            query = query.arg("path", path);
20115        }
20116        if let Some(from) = opts.from {
20117            query = query.arg("from", from);
20118        }
20119        query.execute(self.graphql_client.clone()).await
20120    }
20121    /// Read a configuration value from dagger.toml.
20122    /// If key is empty, returns the full config.
20123    /// If key points to a scalar, returns the value.
20124    /// If key points to a table, returns flattened dotted-key output.
20125    ///
20126    /// # Arguments
20127    ///
20128    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20129    pub async fn config_read(&self) -> Result<String, DaggerError> {
20130        let query = self.selection.select("configRead");
20131        query.execute(self.graphql_client.clone()).await
20132    }
20133    /// Read a configuration value from dagger.toml.
20134    /// If key is empty, returns the full config.
20135    /// If key points to a scalar, returns the value.
20136    /// If key points to a table, returns flattened dotted-key output.
20137    ///
20138    /// # Arguments
20139    ///
20140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20141    pub async fn config_read_opts<'a>(
20142        &self,
20143        opts: WorkspaceConfigReadOpts<'a>,
20144    ) -> Result<String, DaggerError> {
20145        let mut query = self.selection.select("configRead");
20146        if let Some(key) = opts.key {
20147            query = query.arg("key", key);
20148        }
20149        if let Some(effective) = opts.effective {
20150            query = query.arg("effective", effective);
20151        }
20152        query.execute(self.graphql_client.clone()).await
20153    }
20154    /// Installed name of the module selected as the workspace entrypoint, or an empty string when none is selected.
20155    /// Reflects the selected env's effective view. Fails if several modules are selected.
20156    pub async fn entrypoint(&self) -> Result<String, DaggerError> {
20157        let query = self.selection.select("entrypoint");
20158        query.execute(self.graphql_client.clone()).await
20159    }
20160    /// List named environments defined in the workspace configuration.
20161    pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
20162        let query = self.selection.select("envList");
20163        query.execute(self.graphql_client.clone()).await
20164    }
20165    /// List modules defined in the workspace configuration.
20166    /// Reflects the selected env's effective view.
20167    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20168        let query = self.selection.select("modules");
20169        let query = query.select("id");
20170        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20171        Ok(ids
20172            .into_iter()
20173            .map(|id| WorkspaceModule {
20174                proc: self.proc.clone(),
20175                selection: crate::querybuilder::query()
20176                    .select("node")
20177                    .arg("id", &id.0)
20178                    .inline_fragment("WorkspaceModule"),
20179                graphql_client: self.graphql_client.clone(),
20180            })
20181            .collect())
20182    }
20183    /// Return a module defined in the workspace configuration.
20184    /// Reflects the selected env's effective view.
20185    ///
20186    /// # Arguments
20187    ///
20188    /// * `name` - Module name to inspect.
20189    pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
20190        let mut query = self.selection.select("module");
20191        query = query.arg("name", name.into());
20192        WorkspaceModule {
20193            proc: self.proc.clone(),
20194            selection: query,
20195            graphql_client: self.graphql_client.clone(),
20196        }
20197    }
20198    /// Load a module source from a path within the workspace.
20199    /// Relative paths (e.g., "foo") resolve from the workspace cwd; absolute paths (e.g., "/foo") resolve from the workspace root.
20200    /// Fails if the path does not point to an initialized module.
20201    ///
20202    /// # Arguments
20203    ///
20204    /// * `path` - Location of the module source to load, relative to the workspace cwd or absolute from the workspace root.
20205    pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
20206        let mut query = self.selection.select("moduleSource");
20207        query = query.arg("path", path.into());
20208        ModuleSource {
20209            proc: self.proc.clone(),
20210            selection: query,
20211            graphql_client: self.graphql_client.clone(),
20212        }
20213    }
20214    /// Current location within the workspace root.
20215    /// The workspace root is returned as "/".
20216    /// Relative paths in workspace APIs resolve from here.
20217    pub async fn cwd(&self) -> Result<String, DaggerError> {
20218        let query = self.selection.select("cwd");
20219        query.execute(self.graphql_client.clone()).await
20220    }
20221    /// Discover static object artifacts from workspace modules without evaluating their values.
20222    ///
20223    /// # Arguments
20224    ///
20225    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20226    pub fn artifacts(&self) -> Artifacts {
20227        let query = self.selection.select("artifacts");
20228        Artifacts {
20229            proc: self.proc.clone(),
20230            selection: query,
20231            graphql_client: self.graphql_client.clone(),
20232        }
20233    }
20234    /// Discover static object artifacts from workspace modules without evaluating their values.
20235    ///
20236    /// # Arguments
20237    ///
20238    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20239    pub fn artifacts_opts<'a>(&self, opts: WorkspaceArtifactsOpts<'a>) -> Artifacts {
20240        let mut query = self.selection.select("artifacts");
20241        if let Some(include) = opts.include {
20242            query = query.arg("include", include);
20243        }
20244        Artifacts {
20245            proc: self.proc.clone(),
20246            selection: query,
20247            graphql_client: self.graphql_client.clone(),
20248        }
20249    }
20250    /// Plan the explicit migration needed for the current workspace.
20251    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
20252    /// The returned plan has an empty changeset and no steps when no migration is needed.
20253    ///
20254    /// # Arguments
20255    ///
20256    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20257    pub fn migrate(&self) -> WorkspaceMigration {
20258        let query = self.selection.select("migrate");
20259        WorkspaceMigration {
20260            proc: self.proc.clone(),
20261            selection: query,
20262            graphql_client: self.graphql_client.clone(),
20263        }
20264    }
20265    /// Plan the explicit migration needed for the current workspace.
20266    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
20267    /// The returned plan has an empty changeset and no steps when no migration is needed.
20268    ///
20269    /// # Arguments
20270    ///
20271    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20272    pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
20273        let mut query = self.selection.select("migrate");
20274        if let Some(modules) = opts.modules {
20275            query = query.arg("modules", modules);
20276        }
20277        WorkspaceMigration {
20278            proc: self.proc.clone(),
20279            selection: query,
20280            graphql_client: self.graphql_client.clone(),
20281        }
20282    }
20283    /// Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
20284    pub async fn address(&self) -> Result<String, DaggerError> {
20285        let query = self.selection.select("address");
20286        query.execute(self.graphql_client.clone()).await
20287    }
20288}
20289impl Node for Workspace {
20290    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20291        let query = self.selection.select("id");
20292        let graphql_client = self.graphql_client.clone();
20293        async move { query.execute(graphql_client).await }
20294    }
20295}
20296#[derive(Clone)]
20297pub struct WorkspaceCommitPick {
20298    pub proc: Option<Arc<DaggerSessionProc>>,
20299    pub selection: Selection,
20300    pub graphql_client: DynGraphQLClient,
20301}
20302impl IntoID<Id> for WorkspaceCommitPick {
20303    fn into_id(
20304        self,
20305    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20306        Box::pin(async move { self.id().await })
20307    }
20308}
20309impl Loadable for WorkspaceCommitPick {
20310    fn graphql_type() -> &'static str {
20311        "WorkspaceCommitPick"
20312    }
20313    fn from_query(
20314        proc: Option<Arc<DaggerSessionProc>>,
20315        selection: Selection,
20316        graphql_client: DynGraphQLClient,
20317    ) -> Self {
20318        Self {
20319            proc,
20320            selection,
20321            graphql_client,
20322        }
20323    }
20324}
20325impl WorkspaceCommitPick {
20326    /// A unique identifier for this WorkspaceCommitPick.
20327    pub async fn id(&self) -> Result<Id, DaggerError> {
20328        let query = self.selection.select("id");
20329        query.execute(self.graphql_client.clone()).await
20330    }
20331    /// The commit in the source workspace.
20332    pub fn commit(&self) -> GitCommit {
20333        let query = self.selection.select("commit");
20334        GitCommit {
20335            proc: self.proc.clone(),
20336            selection: query,
20337            graphql_client: self.graphql_client.clone(),
20338        }
20339    }
20340    /// Whether this commit can be applied.
20341    pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
20342        let query = self.selection.select("status");
20343        query.execute(self.graphql_client.clone()).await
20344    }
20345    /// Why the commit conflicts, or NONE.
20346    pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
20347        let query = self.selection.select("reason");
20348        query.execute(self.graphql_client.clone()).await
20349    }
20350    /// Workspace-root-relative conflicting paths. Empty unless the status is CONFLICT.
20351    pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
20352        let query = self.selection.select("conflictPaths");
20353        query.execute(self.graphql_client.clone()).await
20354    }
20355}
20356impl Node for WorkspaceCommitPick {
20357    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20358        let query = self.selection.select("id");
20359        let graphql_client = self.graphql_client.clone();
20360        async move { query.execute(graphql_client).await }
20361    }
20362}
20363#[derive(Clone)]
20364pub struct WorkspaceGit {
20365    pub proc: Option<Arc<DaggerSessionProc>>,
20366    pub selection: Selection,
20367    pub graphql_client: DynGraphQLClient,
20368}
20369impl IntoID<Id> for WorkspaceGit {
20370    fn into_id(
20371        self,
20372    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20373        Box::pin(async move { self.id().await })
20374    }
20375}
20376impl Loadable for WorkspaceGit {
20377    fn graphql_type() -> &'static str {
20378        "WorkspaceGit"
20379    }
20380    fn from_query(
20381        proc: Option<Arc<DaggerSessionProc>>,
20382        selection: Selection,
20383        graphql_client: DynGraphQLClient,
20384    ) -> Self {
20385        Self {
20386            proc,
20387            selection,
20388            graphql_client,
20389        }
20390    }
20391}
20392impl WorkspaceGit {
20393    /// A unique identifier for this WorkspaceGit.
20394    pub async fn id(&self) -> Result<Id, DaggerError> {
20395        let query = self.selection.select("id");
20396        query.execute(self.graphql_client.clone()).await
20397    }
20398    /// The checked-out HEAD of this workspace.
20399    pub fn head(&self) -> GitRef {
20400        let query = self.selection.select("head");
20401        GitRef {
20402            proc: self.proc.clone(),
20403            selection: query,
20404            graphql_client: self.graphql_client.clone(),
20405        }
20406    }
20407    /// Return a self-contained Git metadata directory for this workspace's HEAD, including its full reachable history and an index matching HEAD.
20408    /// 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.
20409    /// 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.
20410    pub fn directory(&self) -> Directory {
20411        let query = self.selection.select("directory");
20412        Directory {
20413            proc: self.proc.clone(),
20414            selection: query,
20415            graphql_client: self.graphql_client.clone(),
20416        }
20417    }
20418    /// Uncommitted changes in this workspace, using the same rules as GitRepository.uncommitted.
20419    pub fn uncommitted(&self) -> Changeset {
20420        let query = self.selection.select("uncommitted");
20421        Changeset {
20422            proc: self.proc.clone(),
20423            selection: query,
20424            graphql_client: self.graphql_client.clone(),
20425        }
20426    }
20427}
20428impl Node for WorkspaceGit {
20429    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20430        let query = self.selection.select("id");
20431        let graphql_client = self.graphql_client.clone();
20432        async move { query.execute(graphql_client).await }
20433    }
20434}
20435#[derive(Clone)]
20436pub struct WorkspaceMigration {
20437    pub proc: Option<Arc<DaggerSessionProc>>,
20438    pub selection: Selection,
20439    pub graphql_client: DynGraphQLClient,
20440}
20441impl IntoID<Id> for WorkspaceMigration {
20442    fn into_id(
20443        self,
20444    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20445        Box::pin(async move { self.id().await })
20446    }
20447}
20448impl Loadable for WorkspaceMigration {
20449    fn graphql_type() -> &'static str {
20450        "WorkspaceMigration"
20451    }
20452    fn from_query(
20453        proc: Option<Arc<DaggerSessionProc>>,
20454        selection: Selection,
20455        graphql_client: DynGraphQLClient,
20456    ) -> Self {
20457        Self {
20458            proc,
20459            selection,
20460            graphql_client,
20461        }
20462    }
20463}
20464impl WorkspaceMigration {
20465    /// A unique identifier for this WorkspaceMigration.
20466    pub async fn id(&self) -> Result<Id, DaggerError> {
20467        let query = self.selection.select("id");
20468        query.execute(self.graphql_client.clone()).await
20469    }
20470    /// Filesystem changes for the full migration plan.
20471    pub fn changes(&self) -> Changeset {
20472        let query = self.selection.select("changes");
20473        Changeset {
20474            proc: self.proc.clone(),
20475            selection: query,
20476            graphql_client: self.graphql_client.clone(),
20477        }
20478    }
20479    /// Logical migration steps, each identified by a stable code.
20480    pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
20481        let query = self.selection.select("steps");
20482        let query = query.select("id");
20483        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20484        Ok(ids
20485            .into_iter()
20486            .map(|id| WorkspaceMigrationStep {
20487                proc: self.proc.clone(),
20488                selection: crate::querybuilder::query()
20489                    .select("node")
20490                    .arg("id", &id.0)
20491                    .inline_fragment("WorkspaceMigrationStep"),
20492                graphql_client: self.graphql_client.clone(),
20493            })
20494            .collect())
20495    }
20496    /// Unselected legacy module directories relative to the workspace root. Candidates can include fixtures.
20497    pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
20498        let query = self.selection.select("moduleCandidates");
20499        query.execute(self.graphql_client.clone()).await
20500    }
20501    /// Native workspace config path after migration, relative to the workspace root. Empty if no workspace config exists.
20502    pub async fn config_file(&self) -> Result<String, DaggerError> {
20503        let query = self.selection.select("configFile");
20504        query.execute(self.graphql_client.clone()).await
20505    }
20506}
20507impl Node for WorkspaceMigration {
20508    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20509        let query = self.selection.select("id");
20510        let graphql_client = self.graphql_client.clone();
20511        async move { query.execute(graphql_client).await }
20512    }
20513}
20514#[derive(Clone)]
20515pub struct WorkspaceMigrationStep {
20516    pub proc: Option<Arc<DaggerSessionProc>>,
20517    pub selection: Selection,
20518    pub graphql_client: DynGraphQLClient,
20519}
20520impl IntoID<Id> for WorkspaceMigrationStep {
20521    fn into_id(
20522        self,
20523    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20524        Box::pin(async move { self.id().await })
20525    }
20526}
20527impl Loadable for WorkspaceMigrationStep {
20528    fn graphql_type() -> &'static str {
20529        "WorkspaceMigrationStep"
20530    }
20531    fn from_query(
20532        proc: Option<Arc<DaggerSessionProc>>,
20533        selection: Selection,
20534        graphql_client: DynGraphQLClient,
20535    ) -> Self {
20536        Self {
20537            proc,
20538            selection,
20539            graphql_client,
20540        }
20541    }
20542}
20543impl WorkspaceMigrationStep {
20544    /// A unique identifier for this WorkspaceMigrationStep.
20545    pub async fn id(&self) -> Result<Id, DaggerError> {
20546        let query = self.selection.select("id");
20547        query.execute(self.graphql_client.clone()).await
20548    }
20549    /// Stable code identifying this logical migration step.
20550    pub async fn code(&self) -> Result<String, DaggerError> {
20551        let query = self.selection.select("code");
20552        query.execute(self.graphql_client.clone()).await
20553    }
20554    /// Generic summary of this step's purpose and impact.
20555    pub async fn description(&self) -> Result<String, DaggerError> {
20556        let query = self.selection.select("description");
20557        query.execute(self.graphql_client.clone()).await
20558    }
20559    /// Non-fatal warnings raised while planning this step.
20560    pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
20561        let query = self.selection.select("warnings");
20562        query.execute(self.graphql_client.clone()).await
20563    }
20564    /// Filesystem changes for this step.
20565    pub fn changes(&self) -> Changeset {
20566        let query = self.selection.select("changes");
20567        Changeset {
20568            proc: self.proc.clone(),
20569            selection: query,
20570            graphql_client: self.graphql_client.clone(),
20571        }
20572    }
20573}
20574impl Node for WorkspaceMigrationStep {
20575    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20576        let query = self.selection.select("id");
20577        let graphql_client = self.graphql_client.clone();
20578        async move { query.execute(graphql_client).await }
20579    }
20580}
20581#[derive(Clone)]
20582pub struct WorkspaceModule {
20583    pub proc: Option<Arc<DaggerSessionProc>>,
20584    pub selection: Selection,
20585    pub graphql_client: DynGraphQLClient,
20586}
20587impl IntoID<Id> for WorkspaceModule {
20588    fn into_id(
20589        self,
20590    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20591        Box::pin(async move { self.id().await })
20592    }
20593}
20594impl Loadable for WorkspaceModule {
20595    fn graphql_type() -> &'static str {
20596        "WorkspaceModule"
20597    }
20598    fn from_query(
20599        proc: Option<Arc<DaggerSessionProc>>,
20600        selection: Selection,
20601        graphql_client: DynGraphQLClient,
20602    ) -> Self {
20603        Self {
20604            proc,
20605            selection,
20606            graphql_client,
20607        }
20608    }
20609}
20610impl WorkspaceModule {
20611    /// A unique identifier for this WorkspaceModule.
20612    pub async fn id(&self) -> Result<Id, DaggerError> {
20613        let query = self.selection.select("id");
20614        query.execute(self.graphql_client.clone()).await
20615    }
20616    /// List constructor-backed settings for this module.
20617    pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
20618        let query = self.selection.select("settings");
20619        let query = query.select("id");
20620        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20621        Ok(ids
20622            .into_iter()
20623            .map(|id| WorkspaceModuleSetting {
20624                proc: self.proc.clone(),
20625                selection: crate::querybuilder::query()
20626                    .select("node")
20627                    .arg("id", &id.0)
20628                    .inline_fragment("WorkspaceModuleSetting"),
20629                graphql_client: self.graphql_client.clone(),
20630            })
20631            .collect())
20632    }
20633    /// List the functions of this module's main object, in GraphQL field form.
20634    pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
20635        let query = self.selection.select("functions");
20636        query.execute(self.graphql_client.clone()).await
20637    }
20638    /// The module name.
20639    pub async fn name(&self) -> Result<String, DaggerError> {
20640        let query = self.selection.select("name");
20641        query.execute(self.graphql_client.clone()).await
20642    }
20643    /// Whether the module is the workspace entrypoint (functions aliased to Query root).
20644    pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
20645        let query = self.selection.select("entrypoint");
20646        query.execute(self.graphql_client.clone()).await
20647    }
20648    /// The module source path.
20649    pub async fn source(&self) -> Result<String, DaggerError> {
20650        let query = self.selection.select("source");
20651        query.execute(self.graphql_client.clone()).await
20652    }
20653}
20654impl Node for WorkspaceModule {
20655    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20656        let query = self.selection.select("id");
20657        let graphql_client = self.graphql_client.clone();
20658        async move { query.execute(graphql_client).await }
20659    }
20660}
20661#[derive(Clone)]
20662pub struct WorkspaceModuleSetting {
20663    pub proc: Option<Arc<DaggerSessionProc>>,
20664    pub selection: Selection,
20665    pub graphql_client: DynGraphQLClient,
20666}
20667impl IntoID<Id> for WorkspaceModuleSetting {
20668    fn into_id(
20669        self,
20670    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20671        Box::pin(async move { self.id().await })
20672    }
20673}
20674impl Loadable for WorkspaceModuleSetting {
20675    fn graphql_type() -> &'static str {
20676        "WorkspaceModuleSetting"
20677    }
20678    fn from_query(
20679        proc: Option<Arc<DaggerSessionProc>>,
20680        selection: Selection,
20681        graphql_client: DynGraphQLClient,
20682    ) -> Self {
20683        Self {
20684            proc,
20685            selection,
20686            graphql_client,
20687        }
20688    }
20689}
20690impl WorkspaceModuleSetting {
20691    /// A unique identifier for this WorkspaceModuleSetting.
20692    pub async fn id(&self) -> Result<Id, DaggerError> {
20693        let query = self.selection.select("id");
20694        query.execute(self.graphql_client.clone()).await
20695    }
20696    /// The setting key.
20697    pub async fn key(&self) -> Result<String, DaggerError> {
20698        let query = self.selection.select("key");
20699        query.execute(self.graphql_client.clone()).await
20700    }
20701    /// The value stored in workspace config after applying the selected workspace environment, or empty when unset.
20702    pub async fn value(&self) -> Result<String, DaggerError> {
20703        let query = self.selection.select("value");
20704        query.execute(self.graphql_client.clone()).await
20705    }
20706    /// The constructor argument description.
20707    pub async fn description(&self) -> Result<String, DaggerError> {
20708        let query = self.selection.select("description");
20709        query.execute(self.graphql_client.clone()).await
20710    }
20711    /// The constructor argument's declared default, formatted like value, or empty when the argument has no default.
20712    pub async fn default_value(&self) -> Result<String, DaggerError> {
20713        let query = self.selection.select("defaultValue");
20714        query.execute(self.graphql_client.clone()).await
20715    }
20716    /// Whether the setting is a string argument, stored as a TOML string even when the value reads as a number or boolean.
20717    pub async fn is_string(&self) -> Result<bool, DaggerError> {
20718        let query = self.selection.select("isString");
20719        query.execute(self.graphql_client.clone()).await
20720    }
20721    /// Whether the setting accepts a list of values.
20722    pub async fn is_list(&self) -> Result<bool, DaggerError> {
20723        let query = self.selection.select("isList");
20724        query.execute(self.graphql_client.clone()).await
20725    }
20726    /// Whether the setting is an object type resolved from an address string (Container, Directory, File, Secret, Service, ...), which may be a module reference.
20727    pub async fn is_object(&self) -> Result<bool, DaggerError> {
20728        let query = self.selection.select("isObject");
20729        query.execute(self.graphql_client.clone()).await
20730    }
20731}
20732impl Node for WorkspaceModuleSetting {
20733    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20734        let query = self.selection.select("id");
20735        let graphql_client = self.graphql_client.clone();
20736        async move { query.execute(graphql_client).await }
20737    }
20738}
20739#[derive(Clone)]
20740pub struct WorkspaceSdk {
20741    pub proc: Option<Arc<DaggerSessionProc>>,
20742    pub selection: Selection,
20743    pub graphql_client: DynGraphQLClient,
20744}
20745impl IntoID<Id> for WorkspaceSdk {
20746    fn into_id(
20747        self,
20748    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20749        Box::pin(async move { self.id().await })
20750    }
20751}
20752impl Loadable for WorkspaceSdk {
20753    fn graphql_type() -> &'static str {
20754        "WorkspaceSDK"
20755    }
20756    fn from_query(
20757        proc: Option<Arc<DaggerSessionProc>>,
20758        selection: Selection,
20759        graphql_client: DynGraphQLClient,
20760    ) -> Self {
20761        Self {
20762            proc,
20763            selection,
20764            graphql_client,
20765        }
20766    }
20767}
20768impl WorkspaceSdk {
20769    /// A unique identifier for this WorkspaceSDK.
20770    pub async fn id(&self) -> Result<Id, DaggerError> {
20771        let query = self.selection.select("id");
20772        query.execute(self.graphql_client.clone()).await
20773    }
20774    /// Generate the modules and clients managed by this SDK.
20775    pub fn generate(&self) -> Changeset {
20776        let query = self.selection.select("generate");
20777        Changeset {
20778            proc: self.proc.clone(),
20779            selection: query,
20780            graphql_client: self.graphql_client.clone(),
20781        }
20782    }
20783    /// The user-facing SDK name.
20784    pub async fn name(&self) -> Result<String, DaggerError> {
20785        let query = self.selection.select("name");
20786        query.execute(self.graphql_client.clone()).await
20787    }
20788    /// The module reference this SDK was installed from.
20789    pub async fn r#ref(&self) -> Result<String, DaggerError> {
20790        let query = self.selection.select("ref");
20791        query.execute(self.graphql_client.clone()).await
20792    }
20793    /// Modules authored with this SDK.
20794    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20795        let query = self.selection.select("modules");
20796        let query = query.select("id");
20797        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20798        Ok(ids
20799            .into_iter()
20800            .map(|id| WorkspaceModule {
20801                proc: self.proc.clone(),
20802                selection: crate::querybuilder::query()
20803                    .select("node")
20804                    .arg("id", &id.0)
20805                    .inline_fragment("WorkspaceModule"),
20806                graphql_client: self.graphql_client.clone(),
20807            })
20808            .collect())
20809    }
20810    /// Clients generated with this SDK.
20811    pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20812        let query = self.selection.select("clients");
20813        let query = query.select("id");
20814        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20815        Ok(ids
20816            .into_iter()
20817            .map(|id| WorkspaceModule {
20818                proc: self.proc.clone(),
20819                selection: crate::querybuilder::query()
20820                    .select("node")
20821                    .arg("id", &id.0)
20822                    .inline_fragment("WorkspaceModule"),
20823                graphql_client: self.graphql_client.clone(),
20824            })
20825            .collect())
20826    }
20827}
20828impl Node for WorkspaceSdk {
20829    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20830        let query = self.selection.select("id");
20831        let graphql_client = self.graphql_client.clone();
20832        async move { query.execute(graphql_client).await }
20833    }
20834}
20835#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20836pub enum AgentMessageDelivery {
20837    #[serde(rename = "QUEUED")]
20838    Queued,
20839    #[serde(rename = "STARTED")]
20840    Started,
20841    #[serde(rename = "STEERED")]
20842    Steered,
20843}
20844#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20845pub enum AgentState {
20846    #[serde(rename = "FAILED")]
20847    Failed,
20848    #[serde(rename = "IDLE")]
20849    Idle,
20850    #[serde(rename = "PAUSED")]
20851    Paused,
20852    #[serde(rename = "RUNNING")]
20853    Running,
20854    #[serde(rename = "STOPPED")]
20855    Stopped,
20856    #[serde(rename = "WAITING_INPUT")]
20857    WaitingInput,
20858}
20859#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20860pub enum ArtifactDimensionKind {
20861    #[serde(rename = "COLLECTION")]
20862    Collection,
20863    #[serde(rename = "MODULE")]
20864    Module,
20865    #[serde(rename = "TYPE")]
20866    Type,
20867}
20868#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20869pub enum CacheSharingMode {
20870    #[serde(rename = "LOCKED")]
20871    Locked,
20872    #[serde(rename = "PRIVATE")]
20873    Private,
20874    #[serde(rename = "SHARED")]
20875    Shared,
20876}
20877#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20878pub enum ChangesetMergeConflict {
20879    #[serde(rename = "FAIL")]
20880    Fail,
20881    #[serde(rename = "FAIL_EARLY")]
20882    FailEarly,
20883    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
20884    LeaveConflictMarkers,
20885    #[serde(rename = "PREFER_OURS")]
20886    PreferOurs,
20887    #[serde(rename = "PREFER_THEIRS")]
20888    PreferTheirs,
20889}
20890#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20891pub enum ChangesetsMergeConflict {
20892    #[serde(rename = "FAIL")]
20893    Fail,
20894    #[serde(rename = "FAIL_EARLY")]
20895    FailEarly,
20896}
20897#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20898pub enum DiffStatKind {
20899    #[serde(rename = "ADDED")]
20900    Added,
20901    #[serde(rename = "MODIFIED")]
20902    Modified,
20903    #[serde(rename = "REMOVED")]
20904    Removed,
20905    #[serde(rename = "RENAMED")]
20906    Renamed,
20907}
20908#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20909pub enum ExistsType {
20910    #[serde(rename = "DIRECTORY_TYPE")]
20911    DirectoryType,
20912    #[serde(rename = "REGULAR_TYPE")]
20913    RegularType,
20914    #[serde(rename = "SYMLINK_TYPE")]
20915    SymlinkType,
20916}
20917#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20918pub enum FileType {
20919    #[serde(rename = "DIRECTORY")]
20920    Directory,
20921    #[serde(rename = "DIRECTORY_TYPE")]
20922    DirectoryType,
20923    #[serde(rename = "REGULAR")]
20924    Regular,
20925    #[serde(rename = "REGULAR_TYPE")]
20926    RegularType,
20927    #[serde(rename = "SYMLINK")]
20928    Symlink,
20929    #[serde(rename = "SYMLINK_TYPE")]
20930    SymlinkType,
20931    #[serde(rename = "UNKNOWN")]
20932    Unknown,
20933}
20934#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20935pub enum FunctionCachePolicy {
20936    #[serde(rename = "Default")]
20937    Default,
20938    #[serde(rename = "Never")]
20939    Never,
20940    #[serde(rename = "PerSession")]
20941    PerSession,
20942}
20943#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20944pub enum GitPushDisposition {
20945    #[serde(rename = "CREATED")]
20946    Created,
20947    #[serde(rename = "FAST_FORWARD")]
20948    FastForward,
20949    #[serde(rename = "FORCED")]
20950    Forced,
20951    #[serde(rename = "UP_TO_DATE")]
20952    UpToDate,
20953}
20954#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20955pub enum ImageLayerCompression {
20956    #[serde(rename = "EStarGZ")]
20957    EStarGz,
20958    #[serde(rename = "ESTARGZ")]
20959    Estargz,
20960    #[serde(rename = "Gzip")]
20961    Gzip,
20962    #[serde(rename = "Uncompressed")]
20963    Uncompressed,
20964    #[serde(rename = "Zstd")]
20965    Zstd,
20966}
20967#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20968pub enum ImageMediaTypes {
20969    #[serde(rename = "DOCKER")]
20970    Docker,
20971    #[serde(rename = "DockerMediaTypes")]
20972    DockerMediaTypes,
20973    #[serde(rename = "OCI")]
20974    Oci,
20975    #[serde(rename = "OCIMediaTypes")]
20976    OciMediaTypes,
20977}
20978#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20979pub enum LlmContentBlockKind {
20980    #[serde(rename = "AUDIO")]
20981    Audio,
20982    #[serde(rename = "DOCUMENT")]
20983    Document,
20984    #[serde(rename = "IMAGE")]
20985    Image,
20986    #[serde(rename = "TEXT")]
20987    Text,
20988    #[serde(rename = "THINKING")]
20989    Thinking,
20990    #[serde(rename = "TOOL_CALL")]
20991    ToolCall,
20992    #[serde(rename = "TOOL_RESULT")]
20993    ToolResult,
20994}
20995#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20996pub enum LlmMessageOriginKind {
20997    #[serde(rename = "AGENT")]
20998    Agent,
20999    #[serde(rename = "EVENT")]
21000    Event,
21001    #[serde(rename = "USER")]
21002    User,
21003}
21004#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21005pub enum LlmMessageRole {
21006    #[serde(rename = "ASSISTANT")]
21007    Assistant,
21008    #[serde(rename = "SYSTEM")]
21009    System,
21010    #[serde(rename = "USER")]
21011    User,
21012}
21013#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21014pub enum ModuleSourceExperimentalFeature {
21015    #[serde(rename = "SELF_CALLS")]
21016    SelfCalls,
21017}
21018#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21019pub enum ModuleSourceKind {
21020    #[serde(rename = "DIR")]
21021    Dir,
21022    #[serde(rename = "DIR_SOURCE")]
21023    DirSource,
21024    #[serde(rename = "GIT")]
21025    Git,
21026    #[serde(rename = "GIT_SOURCE")]
21027    GitSource,
21028    #[serde(rename = "LOCAL")]
21029    Local,
21030    #[serde(rename = "LOCAL_SOURCE")]
21031    LocalSource,
21032}
21033#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21034pub enum NetworkProtocol {
21035    #[serde(rename = "TCP")]
21036    Tcp,
21037    #[serde(rename = "UDP")]
21038    Udp,
21039}
21040#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21041pub enum PatchConflict {
21042    #[serde(rename = "FAIL")]
21043    Fail,
21044    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21045    LeaveConflictMarkers,
21046}
21047#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21048pub enum RegistryProtocol {
21049    #[serde(rename = "HTTP")]
21050    Http,
21051    #[serde(rename = "HTTPS")]
21052    Https,
21053}
21054#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21055pub enum ReturnType {
21056    #[serde(rename = "ANY")]
21057    Any,
21058    #[serde(rename = "FAILURE")]
21059    Failure,
21060    #[serde(rename = "SUCCESS")]
21061    Success,
21062}
21063#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21064pub enum TypeDefKind {
21065    #[serde(rename = "BOOLEAN")]
21066    Boolean,
21067    #[serde(rename = "BOOLEAN_KIND")]
21068    BooleanKind,
21069    #[serde(rename = "ENUM")]
21070    Enum,
21071    #[serde(rename = "ENUM_KIND")]
21072    EnumKind,
21073    #[serde(rename = "FLOAT")]
21074    Float,
21075    #[serde(rename = "FLOAT_KIND")]
21076    FloatKind,
21077    #[serde(rename = "INPUT")]
21078    Input,
21079    #[serde(rename = "INPUT_KIND")]
21080    InputKind,
21081    #[serde(rename = "INTEGER")]
21082    Integer,
21083    #[serde(rename = "INTEGER_KIND")]
21084    IntegerKind,
21085    #[serde(rename = "INTERFACE")]
21086    Interface,
21087    #[serde(rename = "INTERFACE_KIND")]
21088    InterfaceKind,
21089    #[serde(rename = "LIST")]
21090    List,
21091    #[serde(rename = "LIST_KIND")]
21092    ListKind,
21093    #[serde(rename = "OBJECT")]
21094    Object,
21095    #[serde(rename = "OBJECT_KIND")]
21096    ObjectKind,
21097    #[serde(rename = "SCALAR")]
21098    Scalar,
21099    #[serde(rename = "SCALAR_KIND")]
21100    ScalarKind,
21101    #[serde(rename = "STRING")]
21102    String,
21103    #[serde(rename = "STRING_KIND")]
21104    StringKind,
21105    #[serde(rename = "VOID")]
21106    Void,
21107    #[serde(rename = "VOID_KIND")]
21108    VoidKind,
21109}
21110#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21111pub enum WorkspaceCommitPickReason {
21112    #[serde(rename = "CONTENT")]
21113    Content,
21114    #[serde(rename = "DIRTY")]
21115    Dirty,
21116    #[serde(rename = "NONE")]
21117    None,
21118}
21119#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21120pub enum WorkspaceCommitPickStatus {
21121    #[serde(rename = "CONFLICT")]
21122    Conflict,
21123    #[serde(rename = "PICKABLE")]
21124    Pickable,
21125    #[serde(rename = "PICKED")]
21126    Picked,
21127    #[serde(rename = "REDUNDANT")]
21128    Redundant,
21129}