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 module's context directory loaded into the engine (plus any generated code that may have been created).
6351    /// It holds the module's source code and every other file the engine loaded for the module, at their paths relative to the context root. Use sourceSubpath to locate the source code in it.
6352    pub fn context_directory(&self) -> Directory {
6353        let query = self.selection.select("contextDirectory");
6354        Directory {
6355            proc: self.proc.clone(),
6356            selection: query,
6357            graphql_client: self.graphql_client.clone(),
6358        }
6359    }
6360    /// The dependencies of the module.
6361    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
6362        let query = self.selection.select("dependencies");
6363        let query = query.select("id");
6364        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6365        Ok(ids
6366            .into_iter()
6367            .map(|id| Module {
6368                proc: self.proc.clone(),
6369                selection: crate::querybuilder::query()
6370                    .select("node")
6371                    .arg("id", &id.0)
6372                    .inline_fragment("Module"),
6373                graphql_client: self.graphql_client.clone(),
6374            })
6375            .collect())
6376    }
6377    /// The generated files and directories made on top of the module source's context directory.
6378    pub fn generated_context_directory(&self) -> Directory {
6379        let query = self.selection.select("generatedContextDirectory");
6380        Directory {
6381            proc: self.proc.clone(),
6382            selection: query,
6383            graphql_client: self.graphql_client.clone(),
6384        }
6385    }
6386    /// The name of the module being executed in
6387    pub async fn name(&self) -> Result<String, DaggerError> {
6388        let query = self.selection.select("name");
6389        query.execute(self.graphql_client.clone()).await
6390    }
6391    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
6392    pub fn source(&self) -> Directory {
6393        let query = self.selection.select("source");
6394        Directory {
6395            proc: self.proc.clone(),
6396            selection: query,
6397            graphql_client: self.graphql_client.clone(),
6398        }
6399    }
6400    /// The path to the directory containing the module's source code, relative to the context directory.
6401    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6402        let query = self.selection.select("sourceSubpath");
6403        query.execute(self.graphql_client.clone()).await
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(&self, path: impl Into<String>) -> Directory {
6412        let mut query = self.selection.select("workdir");
6413        query = query.arg("path", path.into());
6414        Directory {
6415            proc: self.proc.clone(),
6416            selection: query,
6417            graphql_client: self.graphql_client.clone(),
6418        }
6419    }
6420    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
6421    ///
6422    /// # Arguments
6423    ///
6424    /// * `path` - Location of the directory to access (e.g., ".").
6425    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6426    pub fn workdir_opts<'a>(
6427        &self,
6428        path: impl Into<String>,
6429        opts: CurrentModuleWorkdirOpts<'a>,
6430    ) -> Directory {
6431        let mut query = self.selection.select("workdir");
6432        query = query.arg("path", path.into());
6433        if let Some(exclude) = opts.exclude {
6434            query = query.arg("exclude", exclude);
6435        }
6436        if let Some(include) = opts.include {
6437            query = query.arg("include", include);
6438        }
6439        if let Some(gitignore) = opts.gitignore {
6440            query = query.arg("gitignore", gitignore);
6441        }
6442        Directory {
6443            proc: self.proc.clone(),
6444            selection: query,
6445            graphql_client: self.graphql_client.clone(),
6446        }
6447    }
6448    /// 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.
6449    ///
6450    /// # Arguments
6451    ///
6452    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6453    pub fn workdir_file(&self, path: impl Into<String>) -> File {
6454        let mut query = self.selection.select("workdirFile");
6455        query = query.arg("path", path.into());
6456        File {
6457            proc: self.proc.clone(),
6458            selection: query,
6459            graphql_client: self.graphql_client.clone(),
6460        }
6461    }
6462}
6463impl Node for CurrentModule {
6464    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6465        let query = self.selection.select("id");
6466        let graphql_client = self.graphql_client.clone();
6467        async move { query.execute(graphql_client).await }
6468    }
6469}
6470#[derive(Clone)]
6471pub struct DiffStat {
6472    pub proc: Option<Arc<DaggerSessionProc>>,
6473    pub selection: Selection,
6474    pub graphql_client: DynGraphQLClient,
6475}
6476impl IntoID<Id> for DiffStat {
6477    fn into_id(
6478        self,
6479    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6480        Box::pin(async move { self.id().await })
6481    }
6482}
6483impl Loadable for DiffStat {
6484    fn graphql_type() -> &'static str {
6485        "DiffStat"
6486    }
6487    fn from_query(
6488        proc: Option<Arc<DaggerSessionProc>>,
6489        selection: Selection,
6490        graphql_client: DynGraphQLClient,
6491    ) -> Self {
6492        Self {
6493            proc,
6494            selection,
6495            graphql_client,
6496        }
6497    }
6498}
6499impl DiffStat {
6500    /// A unique identifier for this DiffStat.
6501    pub async fn id(&self) -> Result<Id, DaggerError> {
6502        let query = self.selection.select("id");
6503        query.execute(self.graphql_client.clone()).await
6504    }
6505    /// Path of the changed file or directory.
6506    pub async fn path(&self) -> Result<String, DaggerError> {
6507        let query = self.selection.select("path");
6508        query.execute(self.graphql_client.clone()).await
6509    }
6510    /// Previous path of the file, set only for renames.
6511    pub async fn old_path(&self) -> Result<String, DaggerError> {
6512        let query = self.selection.select("oldPath");
6513        query.execute(self.graphql_client.clone()).await
6514    }
6515    /// Type of change.
6516    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6517        let query = self.selection.select("kind");
6518        query.execute(self.graphql_client.clone()).await
6519    }
6520    /// Number of added lines for this path.
6521    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6522        let query = self.selection.select("addedLines");
6523        query.execute(self.graphql_client.clone()).await
6524    }
6525    /// Number of removed lines for this path.
6526    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6527        let query = self.selection.select("removedLines");
6528        query.execute(self.graphql_client.clone()).await
6529    }
6530}
6531impl Node for DiffStat {
6532    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6533        let query = self.selection.select("id");
6534        let graphql_client = self.graphql_client.clone();
6535        async move { query.execute(graphql_client).await }
6536    }
6537}
6538#[derive(Clone)]
6539pub struct Directory {
6540    pub proc: Option<Arc<DaggerSessionProc>>,
6541    pub selection: Selection,
6542    pub graphql_client: DynGraphQLClient,
6543}
6544#[derive(Builder, Debug, PartialEq)]
6545pub struct DirectoryEntriesOpts<'a> {
6546    /// Location of the directory to look at (e.g., "/src").
6547    #[builder(setter(into, strip_option), default)]
6548    pub path: Option<&'a str>,
6549}
6550#[derive(Builder, Debug, PartialEq)]
6551pub struct DirectorySearchOpts<'a> {
6552    /// Allow the . pattern to match newlines in multiline mode.
6553    #[builder(setter(into, strip_option), default)]
6554    pub dotall: Option<bool>,
6555    /// Only return matching files, not lines and content
6556    #[builder(setter(into, strip_option), default)]
6557    pub files_only: Option<bool>,
6558    /// Glob patterns to match (e.g., "*.md")
6559    #[builder(setter(into, strip_option), default)]
6560    pub globs: Option<Vec<&'a str>>,
6561    /// Enable case-insensitive matching.
6562    #[builder(setter(into, strip_option), default)]
6563    pub insensitive: Option<bool>,
6564    /// Limit the number of results to return
6565    #[builder(setter(into, strip_option), default)]
6566    pub limit: Option<isize>,
6567    /// Interpret the pattern as a literal string instead of a regular expression.
6568    #[builder(setter(into, strip_option), default)]
6569    pub literal: Option<bool>,
6570    /// Enable searching across multiple lines.
6571    #[builder(setter(into, strip_option), default)]
6572    pub multiline: Option<bool>,
6573    /// Directory or file paths to search
6574    #[builder(setter(into, strip_option), default)]
6575    pub paths: Option<Vec<&'a str>>,
6576    /// Skip hidden files (files starting with .).
6577    #[builder(setter(into, strip_option), default)]
6578    pub skip_hidden: Option<bool>,
6579    /// Honor .gitignore, .ignore, and .rgignore files.
6580    #[builder(setter(into, strip_option), default)]
6581    pub skip_ignored: Option<bool>,
6582}
6583#[derive(Builder, Debug, PartialEq)]
6584pub struct DirectoryWithFileOpts<'a> {
6585    /// A user:group to set for the copied directory and its contents.
6586    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6587    /// If the group is omitted, it defaults to the same as the user.
6588    #[builder(setter(into, strip_option), default)]
6589    pub owner: Option<&'a str>,
6590    /// Permission given to the copied file (e.g., 0600).
6591    #[builder(setter(into, strip_option), default)]
6592    pub permissions: Option<isize>,
6593}
6594#[derive(Builder, Debug, PartialEq)]
6595pub struct DirectoryWithFilesOpts {
6596    /// Permission given to the copied files (e.g., 0600).
6597    #[builder(setter(into, strip_option), default)]
6598    pub permissions: Option<isize>,
6599}
6600#[derive(Builder, Debug, PartialEq)]
6601pub struct DirectoryWithNewFileOpts {
6602    /// Permissions of the new file. Example: 0600
6603    #[builder(setter(into, strip_option), default)]
6604    pub permissions: Option<isize>,
6605}
6606#[derive(Builder, Debug, PartialEq)]
6607pub struct DirectoryExistsOpts {
6608    /// If specified, do not follow symlinks.
6609    #[builder(setter(into, strip_option), default)]
6610    pub do_not_follow_symlinks: Option<bool>,
6611    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
6612    #[builder(setter(into, strip_option), default)]
6613    pub expected_type: Option<ExistsType>,
6614}
6615#[derive(Builder, Debug, PartialEq)]
6616pub struct DirectoryStatOpts {
6617    /// If specified, do not follow symlinks.
6618    #[builder(setter(into, strip_option), default)]
6619    pub do_not_follow_symlinks: Option<bool>,
6620}
6621#[derive(Builder, Debug, PartialEq)]
6622pub struct DirectoryWithDirectoryOpts<'a> {
6623    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6624    #[builder(setter(into, strip_option), default)]
6625    pub exclude: Option<Vec<&'a str>>,
6626    /// Apply .gitignore filter rules inside the directory
6627    #[builder(setter(into, strip_option), default)]
6628    pub gitignore: Option<bool>,
6629    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6630    #[builder(setter(into, strip_option), default)]
6631    pub include: Option<Vec<&'a str>>,
6632    /// A user:group to set for the copied directory and its contents.
6633    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6634    /// If the group is omitted, it defaults to the same as the user.
6635    #[builder(setter(into, strip_option), default)]
6636    pub owner: Option<&'a str>,
6637    /// Permission given to the copied directory and contents (e.g., 0755).
6638    #[builder(setter(into, strip_option), default)]
6639    pub permissions: Option<isize>,
6640}
6641#[derive(Builder, Debug, PartialEq)]
6642pub struct DirectoryFilterOpts<'a> {
6643    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
6644    #[builder(setter(into, strip_option), default)]
6645    pub exclude: Option<Vec<&'a str>>,
6646    /// If set, apply .gitignore rules when filtering the directory.
6647    #[builder(setter(into, strip_option), default)]
6648    pub gitignore: Option<bool>,
6649    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
6650    #[builder(setter(into, strip_option), default)]
6651    pub include: Option<Vec<&'a str>>,
6652}
6653#[derive(Builder, Debug, PartialEq)]
6654pub struct DirectoryWithNewDirectoryOpts {
6655    /// Permission granted to the created directory (e.g., 0777).
6656    #[builder(setter(into, strip_option), default)]
6657    pub permissions: Option<isize>,
6658}
6659#[derive(Builder, Debug, PartialEq)]
6660pub struct DirectoryExportOpts {
6661    /// 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.
6662    #[builder(setter(into, strip_option), default)]
6663    pub wipe: Option<bool>,
6664}
6665#[derive(Builder, Debug, PartialEq)]
6666pub struct DirectoryDockerBuildOpts<'a> {
6667    /// Build arguments to use in the build.
6668    #[builder(setter(into, strip_option), default)]
6669    pub build_args: Option<Vec<BuildArg>>,
6670    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
6671    #[builder(setter(into, strip_option), default)]
6672    pub dockerfile: Option<&'a str>,
6673    /// If set, skip the automatic init process injected into containers created by RUN statements.
6674    /// 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.
6675    #[builder(setter(into, strip_option), default)]
6676    pub no_init: Option<bool>,
6677    /// The platform to build.
6678    #[builder(setter(into, strip_option), default)]
6679    pub platform: Option<Platform>,
6680    /// Secrets to pass to the build.
6681    /// They will be mounted at /run/secrets/[secret-name].
6682    #[builder(setter(into, strip_option), default)]
6683    pub secrets: Option<Vec<Id>>,
6684    /// A socket to use for SSH authentication during the build
6685    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
6686    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
6687    #[builder(setter(into, strip_option), default)]
6688    pub ssh: Option<Id>,
6689    /// Target build stage to build.
6690    #[builder(setter(into, strip_option), default)]
6691    pub target: Option<&'a str>,
6692}
6693#[derive(Builder, Debug, PartialEq)]
6694pub struct DirectoryWithPatchOpts {
6695    /// 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.
6696    #[builder(setter(into, strip_option), default)]
6697    pub on_conflict: Option<PatchConflict>,
6698}
6699#[derive(Builder, Debug, PartialEq)]
6700pub struct DirectoryWithPatchFileOpts {
6701    /// How to handle hunks that no longer apply to the target content: fail (default), or apply what fits and leave git-style conflict markers where it doesn't.
6702    #[builder(setter(into, strip_option), default)]
6703    pub on_conflict: Option<PatchConflict>,
6704}
6705#[derive(Builder, Debug, PartialEq)]
6706pub struct DirectoryAsWorkspaceOpts<'a> {
6707    /// Current working directory inside the workspace root. Defaults to the workspace root.
6708    #[builder(setter(into, strip_option), default)]
6709    pub cwd: Option<&'a str>,
6710}
6711#[derive(Builder, Debug, PartialEq)]
6712pub struct DirectoryTerminalOpts<'a> {
6713    /// If set, override the container's default terminal command and invoke these command arguments instead.
6714    #[builder(setter(into, strip_option), default)]
6715    pub cmd: Option<Vec<&'a str>>,
6716    /// If set, override the default container used for the terminal.
6717    #[builder(setter(into, strip_option), default)]
6718    pub container: Option<Id>,
6719    /// Disable Dagger API access for the executed command. By default, commands can connect to the current Dagger engine.
6720    #[builder(setter(into, strip_option), default)]
6721    pub disable_dagger_in_dagger: Option<bool>,
6722    #[builder(setter(into, strip_option), default)]
6723    pub experimental_privileged_nesting: Option<bool>,
6724    /// 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.
6725    #[builder(setter(into, strip_option), default)]
6726    pub insecure_root_capabilities: Option<bool>,
6727}
6728#[derive(Builder, Debug, PartialEq)]
6729pub struct DirectoryAsModuleOpts<'a> {
6730    /// An optional subpath of the directory which contains the module's configuration file.
6731    /// If not set, the module source code is loaded from the root of the directory.
6732    #[builder(setter(into, strip_option), default)]
6733    pub source_root_path: Option<&'a str>,
6734}
6735#[derive(Builder, Debug, PartialEq)]
6736pub struct DirectoryAsModuleSourceOpts<'a> {
6737    /// An optional subpath of the directory which contains the module's configuration file.
6738    /// If not set, the module source code is loaded from the root of the directory.
6739    #[builder(setter(into, strip_option), default)]
6740    pub source_root_path: Option<&'a str>,
6741}
6742impl IntoID<Id> for Directory {
6743    fn into_id(
6744        self,
6745    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6746        Box::pin(async move { self.id().await })
6747    }
6748}
6749impl Loadable for Directory {
6750    fn graphql_type() -> &'static str {
6751        "Directory"
6752    }
6753    fn from_query(
6754        proc: Option<Arc<DaggerSessionProc>>,
6755        selection: Selection,
6756        graphql_client: DynGraphQLClient,
6757    ) -> Self {
6758        Self {
6759            proc,
6760            selection,
6761            graphql_client,
6762        }
6763    }
6764}
6765impl Directory {
6766    /// A unique identifier for this Directory.
6767    pub async fn id(&self) -> Result<Id, DaggerError> {
6768        let query = self.selection.select("id");
6769        query.execute(self.graphql_client.clone()).await
6770    }
6771    /// Force evaluation in the engine.
6772    pub async fn sync(&self) -> Result<Directory, DaggerError> {
6773        let query = self.selection.select("sync");
6774        let id: Id = query.execute(self.graphql_client.clone()).await?;
6775        Ok(Directory {
6776            proc: self.proc.clone(),
6777            selection: query
6778                .root()
6779                .select("node")
6780                .arg("id", &id.0)
6781                .inline_fragment("Directory"),
6782            graphql_client: self.graphql_client.clone(),
6783        })
6784    }
6785    /// Returns the name of the directory.
6786    pub async fn name(&self) -> Result<String, DaggerError> {
6787        let query = self.selection.select("name");
6788        query.execute(self.graphql_client.clone()).await
6789    }
6790    /// Returns a list of files and directories at the given path.
6791    ///
6792    /// # Arguments
6793    ///
6794    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6795    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6796        let query = self.selection.select("entries");
6797        query.execute(self.graphql_client.clone()).await
6798    }
6799    /// Returns a list of files and directories at the given path.
6800    ///
6801    /// # Arguments
6802    ///
6803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6804    pub async fn entries_opts<'a>(
6805        &self,
6806        opts: DirectoryEntriesOpts<'a>,
6807    ) -> Result<Vec<String>, DaggerError> {
6808        let mut query = self.selection.select("entries");
6809        if let Some(path) = opts.path {
6810            query = query.arg("path", path);
6811        }
6812        query.execute(self.graphql_client.clone()).await
6813    }
6814    /// Returns a list of files and directories that matche the given pattern.
6815    ///
6816    /// # Arguments
6817    ///
6818    /// * `pattern` - Pattern to match (e.g., "*.md").
6819    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6820        let mut query = self.selection.select("glob");
6821        query = query.arg("pattern", pattern.into());
6822        query.execute(self.graphql_client.clone()).await
6823    }
6824    /// Searches for content matching the given regular expression or literal string.
6825    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6826    ///
6827    /// # Arguments
6828    ///
6829    /// * `pattern` - The text to match.
6830    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6831    pub async fn search(
6832        &self,
6833        pattern: impl Into<String>,
6834    ) -> Result<Vec<SearchResult>, DaggerError> {
6835        let mut query = self.selection.select("search");
6836        query = query.arg("pattern", pattern.into());
6837        let query = query.select("id");
6838        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6839        Ok(ids
6840            .into_iter()
6841            .map(|id| SearchResult {
6842                proc: self.proc.clone(),
6843                selection: crate::querybuilder::query()
6844                    .select("node")
6845                    .arg("id", &id.0)
6846                    .inline_fragment("SearchResult"),
6847                graphql_client: self.graphql_client.clone(),
6848            })
6849            .collect())
6850    }
6851    /// Searches for content matching the given regular expression or literal string.
6852    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6853    ///
6854    /// # Arguments
6855    ///
6856    /// * `pattern` - The text to match.
6857    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6858    pub async fn search_opts<'a>(
6859        &self,
6860        pattern: impl Into<String>,
6861        opts: DirectorySearchOpts<'a>,
6862    ) -> Result<Vec<SearchResult>, DaggerError> {
6863        let mut query = self.selection.select("search");
6864        query = query.arg("pattern", pattern.into());
6865        if let Some(paths) = opts.paths {
6866            query = query.arg("paths", paths);
6867        }
6868        if let Some(globs) = opts.globs {
6869            query = query.arg("globs", globs);
6870        }
6871        if let Some(literal) = opts.literal {
6872            query = query.arg("literal", literal);
6873        }
6874        if let Some(multiline) = opts.multiline {
6875            query = query.arg("multiline", multiline);
6876        }
6877        if let Some(dotall) = opts.dotall {
6878            query = query.arg("dotall", dotall);
6879        }
6880        if let Some(insensitive) = opts.insensitive {
6881            query = query.arg("insensitive", insensitive);
6882        }
6883        if let Some(skip_ignored) = opts.skip_ignored {
6884            query = query.arg("skipIgnored", skip_ignored);
6885        }
6886        if let Some(skip_hidden) = opts.skip_hidden {
6887            query = query.arg("skipHidden", skip_hidden);
6888        }
6889        if let Some(files_only) = opts.files_only {
6890            query = query.arg("filesOnly", files_only);
6891        }
6892        if let Some(limit) = opts.limit {
6893            query = query.arg("limit", limit);
6894        }
6895        let query = query.select("id");
6896        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6897        Ok(ids
6898            .into_iter()
6899            .map(|id| SearchResult {
6900                proc: self.proc.clone(),
6901                selection: crate::querybuilder::query()
6902                    .select("node")
6903                    .arg("id", &id.0)
6904                    .inline_fragment("SearchResult"),
6905                graphql_client: self.graphql_client.clone(),
6906            })
6907            .collect())
6908    }
6909    /// 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.
6910    pub async fn digest(&self) -> Result<String, DaggerError> {
6911        let query = self.selection.select("digest");
6912        query.execute(self.graphql_client.clone()).await
6913    }
6914    /// Retrieve a file at the given path.
6915    ///
6916    /// # Arguments
6917    ///
6918    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6919    pub fn file(&self, path: impl Into<String>) -> File {
6920        let mut query = self.selection.select("file");
6921        query = query.arg("path", path.into());
6922        File {
6923            proc: self.proc.clone(),
6924            selection: query,
6925            graphql_client: self.graphql_client.clone(),
6926        }
6927    }
6928    /// Retrieves this directory plus the contents of the given file copied to the given path.
6929    ///
6930    /// # Arguments
6931    ///
6932    /// * `path` - Location of the copied file (e.g., "/file.txt").
6933    /// * `source` - Identifier of the file to copy.
6934    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6935    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6936        let mut query = self.selection.select("withFile");
6937        query = query.arg("path", path.into());
6938        query = query.arg_lazy(
6939            "source",
6940            Box::new(move || {
6941                let source = source.clone();
6942                Box::pin(async move { source.into_id().await.unwrap().quote() })
6943            }),
6944        );
6945        Directory {
6946            proc: self.proc.clone(),
6947            selection: query,
6948            graphql_client: self.graphql_client.clone(),
6949        }
6950    }
6951    /// Retrieves this directory plus the contents of the given file copied to the given path.
6952    ///
6953    /// # Arguments
6954    ///
6955    /// * `path` - Location of the copied file (e.g., "/file.txt").
6956    /// * `source` - Identifier of the file to copy.
6957    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6958    pub fn with_file_opts<'a>(
6959        &self,
6960        path: impl Into<String>,
6961        source: impl IntoID<Id>,
6962        opts: DirectoryWithFileOpts<'a>,
6963    ) -> Directory {
6964        let mut query = self.selection.select("withFile");
6965        query = query.arg("path", path.into());
6966        query = query.arg_lazy(
6967            "source",
6968            Box::new(move || {
6969                let source = source.clone();
6970                Box::pin(async move { source.into_id().await.unwrap().quote() })
6971            }),
6972        );
6973        if let Some(permissions) = opts.permissions {
6974            query = query.arg("permissions", permissions);
6975        }
6976        if let Some(owner) = opts.owner {
6977            query = query.arg("owner", owner);
6978        }
6979        Directory {
6980            proc: self.proc.clone(),
6981            selection: query,
6982            graphql_client: self.graphql_client.clone(),
6983        }
6984    }
6985    /// Retrieves this directory plus the contents of the given files copied to the given path.
6986    ///
6987    /// # Arguments
6988    ///
6989    /// * `path` - Location where copied files should be placed (e.g., "/src").
6990    /// * `sources` - Identifiers of the files to copy.
6991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6992    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
6993        let mut query = self.selection.select("withFiles");
6994        query = query.arg("path", path.into());
6995        query = query.arg("sources", sources);
6996        Directory {
6997            proc: self.proc.clone(),
6998            selection: query,
6999            graphql_client: self.graphql_client.clone(),
7000        }
7001    }
7002    /// Retrieves this directory plus the contents of the given files copied to the given path.
7003    ///
7004    /// # Arguments
7005    ///
7006    /// * `path` - Location where copied files should be placed (e.g., "/src").
7007    /// * `sources` - Identifiers of the files to copy.
7008    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7009    pub fn with_files_opts(
7010        &self,
7011        path: impl Into<String>,
7012        sources: Vec<Id>,
7013        opts: DirectoryWithFilesOpts,
7014    ) -> Directory {
7015        let mut query = self.selection.select("withFiles");
7016        query = query.arg("path", path.into());
7017        query = query.arg("sources", sources);
7018        if let Some(permissions) = opts.permissions {
7019            query = query.arg("permissions", permissions);
7020        }
7021        Directory {
7022            proc: self.proc.clone(),
7023            selection: query,
7024            graphql_client: self.graphql_client.clone(),
7025        }
7026    }
7027    /// Return a snapshot with a new file added
7028    ///
7029    /// # Arguments
7030    ///
7031    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7032    /// * `contents` - Contents of the new file. Example: "Hello world!"
7033    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7034    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7035        let mut query = self.selection.select("withNewFile");
7036        query = query.arg("path", path.into());
7037        query = query.arg("contents", contents.into());
7038        Directory {
7039            proc: self.proc.clone(),
7040            selection: query,
7041            graphql_client: self.graphql_client.clone(),
7042        }
7043    }
7044    /// Return a snapshot with a new file added
7045    ///
7046    /// # Arguments
7047    ///
7048    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7049    /// * `contents` - Contents of the new file. Example: "Hello world!"
7050    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7051    pub fn with_new_file_opts(
7052        &self,
7053        path: impl Into<String>,
7054        contents: impl Into<String>,
7055        opts: DirectoryWithNewFileOpts,
7056    ) -> Directory {
7057        let mut query = self.selection.select("withNewFile");
7058        query = query.arg("path", path.into());
7059        query = query.arg("contents", contents.into());
7060        if let Some(permissions) = opts.permissions {
7061            query = query.arg("permissions", permissions);
7062        }
7063        Directory {
7064            proc: self.proc.clone(),
7065            selection: query,
7066            graphql_client: self.graphql_client.clone(),
7067        }
7068    }
7069    /// Return a snapshot with a file removed
7070    ///
7071    /// # Arguments
7072    ///
7073    /// * `path` - Path of the file to remove (e.g., "/file.txt").
7074    pub fn without_file(&self, path: impl Into<String>) -> Directory {
7075        let mut query = self.selection.select("withoutFile");
7076        query = query.arg("path", path.into());
7077        Directory {
7078            proc: self.proc.clone(),
7079            selection: query,
7080            graphql_client: self.graphql_client.clone(),
7081        }
7082    }
7083    /// Return a snapshot with files removed
7084    ///
7085    /// # Arguments
7086    ///
7087    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
7088    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7089        let mut query = self.selection.select("withoutFiles");
7090        query = query.arg(
7091            "paths",
7092            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7093        );
7094        Directory {
7095            proc: self.proc.clone(),
7096            selection: query,
7097            graphql_client: self.graphql_client.clone(),
7098        }
7099    }
7100    /// check if a file or directory exists
7101    ///
7102    /// # Arguments
7103    ///
7104    /// * `path` - Path to check (e.g., "/file.txt").
7105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7106    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
7107        let mut query = self.selection.select("exists");
7108        query = query.arg("path", path.into());
7109        query.execute(self.graphql_client.clone()).await
7110    }
7111    /// check if a file or directory exists
7112    ///
7113    /// # Arguments
7114    ///
7115    /// * `path` - Path to check (e.g., "/file.txt").
7116    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7117    pub async fn exists_opts(
7118        &self,
7119        path: impl Into<String>,
7120        opts: DirectoryExistsOpts,
7121    ) -> Result<bool, DaggerError> {
7122        let mut query = self.selection.select("exists");
7123        query = query.arg("path", path.into());
7124        if let Some(expected_type) = opts.expected_type {
7125            query = query.arg("expectedType", expected_type);
7126        }
7127        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7128            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7129        }
7130        query.execute(self.graphql_client.clone()).await
7131    }
7132    /// Return file status
7133    ///
7134    /// # Arguments
7135    ///
7136    /// * `path` - Path to stat (e.g., "/file.txt").
7137    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7138    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
7139        let mut query = self.selection.select("stat");
7140        query = query.arg("path", path.into());
7141        let query = query.select("id");
7142        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7143        Ok(id.map(|id| Stat {
7144            proc: self.proc.clone(),
7145            selection: query
7146                .root()
7147                .select("node")
7148                .arg("id", &id.0)
7149                .inline_fragment("Stat"),
7150            graphql_client: self.graphql_client.clone(),
7151        }))
7152    }
7153    /// Return file status
7154    ///
7155    /// # Arguments
7156    ///
7157    /// * `path` - Path to stat (e.g., "/file.txt").
7158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7159    pub async fn stat_opts(
7160        &self,
7161        path: impl Into<String>,
7162        opts: DirectoryStatOpts,
7163    ) -> Result<Option<Stat>, DaggerError> {
7164        let mut query = self.selection.select("stat");
7165        query = query.arg("path", path.into());
7166        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7167            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7168        }
7169        let query = query.select("id");
7170        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7171        Ok(id.map(|id| Stat {
7172            proc: self.proc.clone(),
7173            selection: query
7174                .root()
7175                .select("node")
7176                .arg("id", &id.0)
7177                .inline_fragment("Stat"),
7178            graphql_client: self.graphql_client.clone(),
7179        }))
7180    }
7181    /// Retrieves a directory at the given path.
7182    ///
7183    /// # Arguments
7184    ///
7185    /// * `path` - Location of the directory to retrieve. Example: "/src"
7186    pub fn directory(&self, path: impl Into<String>) -> Directory {
7187        let mut query = self.selection.select("directory");
7188        query = query.arg("path", path.into());
7189        Directory {
7190            proc: self.proc.clone(),
7191            selection: query,
7192            graphql_client: self.graphql_client.clone(),
7193        }
7194    }
7195    /// Return a snapshot with a directory added
7196    ///
7197    /// # Arguments
7198    ///
7199    /// * `path` - Location of the written directory (e.g., "/src/").
7200    /// * `source` - Identifier of the directory to copy.
7201    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7202    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
7203        let mut query = self.selection.select("withDirectory");
7204        query = query.arg("path", path.into());
7205        query = query.arg_lazy(
7206            "source",
7207            Box::new(move || {
7208                let source = source.clone();
7209                Box::pin(async move { source.into_id().await.unwrap().quote() })
7210            }),
7211        );
7212        Directory {
7213            proc: self.proc.clone(),
7214            selection: query,
7215            graphql_client: self.graphql_client.clone(),
7216        }
7217    }
7218    /// Return a snapshot with a directory added
7219    ///
7220    /// # Arguments
7221    ///
7222    /// * `path` - Location of the written directory (e.g., "/src/").
7223    /// * `source` - Identifier of the directory to copy.
7224    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7225    pub fn with_directory_opts<'a>(
7226        &self,
7227        path: impl Into<String>,
7228        source: impl IntoID<Id>,
7229        opts: DirectoryWithDirectoryOpts<'a>,
7230    ) -> Directory {
7231        let mut query = self.selection.select("withDirectory");
7232        query = query.arg("path", path.into());
7233        query = query.arg_lazy(
7234            "source",
7235            Box::new(move || {
7236                let source = source.clone();
7237                Box::pin(async move { source.into_id().await.unwrap().quote() })
7238            }),
7239        );
7240        if let Some(exclude) = opts.exclude {
7241            query = query.arg("exclude", exclude);
7242        }
7243        if let Some(include) = opts.include {
7244            query = query.arg("include", include);
7245        }
7246        if let Some(gitignore) = opts.gitignore {
7247            query = query.arg("gitignore", gitignore);
7248        }
7249        if let Some(owner) = opts.owner {
7250            query = query.arg("owner", owner);
7251        }
7252        if let Some(permissions) = opts.permissions {
7253            query = query.arg("permissions", permissions);
7254        }
7255        Directory {
7256            proc: self.proc.clone(),
7257            selection: query,
7258            graphql_client: self.graphql_client.clone(),
7259        }
7260    }
7261    /// Return a snapshot with some paths included or excluded
7262    ///
7263    /// # Arguments
7264    ///
7265    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7266    pub fn filter(&self) -> Directory {
7267        let query = self.selection.select("filter");
7268        Directory {
7269            proc: self.proc.clone(),
7270            selection: query,
7271            graphql_client: self.graphql_client.clone(),
7272        }
7273    }
7274    /// Return a snapshot with some paths included or excluded
7275    ///
7276    /// # Arguments
7277    ///
7278    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7279    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
7280        let mut query = self.selection.select("filter");
7281        if let Some(exclude) = opts.exclude {
7282            query = query.arg("exclude", exclude);
7283        }
7284        if let Some(include) = opts.include {
7285            query = query.arg("include", include);
7286        }
7287        if let Some(gitignore) = opts.gitignore {
7288            query = query.arg("gitignore", gitignore);
7289        }
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(&self, path: impl Into<String>) -> Directory {
7303        let mut query = self.selection.select("withNewDirectory");
7304        query = query.arg("path", path.into());
7305        Directory {
7306            proc: self.proc.clone(),
7307            selection: query,
7308            graphql_client: self.graphql_client.clone(),
7309        }
7310    }
7311    /// Retrieves this directory plus a new directory created at the given path.
7312    ///
7313    /// # Arguments
7314    ///
7315    /// * `path` - Location of the directory created (e.g., "/logs").
7316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7317    pub fn with_new_directory_opts(
7318        &self,
7319        path: impl Into<String>,
7320        opts: DirectoryWithNewDirectoryOpts,
7321    ) -> Directory {
7322        let mut query = self.selection.select("withNewDirectory");
7323        query = query.arg("path", path.into());
7324        if let Some(permissions) = opts.permissions {
7325            query = query.arg("permissions", permissions);
7326        }
7327        Directory {
7328            proc: self.proc.clone(),
7329            selection: query,
7330            graphql_client: self.graphql_client.clone(),
7331        }
7332    }
7333    /// Return a snapshot with a subdirectory removed
7334    ///
7335    /// # Arguments
7336    ///
7337    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
7338    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7339        let mut query = self.selection.select("withoutDirectory");
7340        query = query.arg("path", path.into());
7341        Directory {
7342            proc: self.proc.clone(),
7343            selection: query,
7344            graphql_client: self.graphql_client.clone(),
7345        }
7346    }
7347    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
7348    ///
7349    /// # Arguments
7350    ///
7351    /// * `other` - The directory to compare against
7352    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
7353        let mut query = self.selection.select("diff");
7354        query = query.arg_lazy(
7355            "other",
7356            Box::new(move || {
7357                let other = other.clone();
7358                Box::pin(async move { other.into_id().await.unwrap().quote() })
7359            }),
7360        );
7361        Directory {
7362            proc: self.proc.clone(),
7363            selection: query,
7364            graphql_client: self.graphql_client.clone(),
7365        }
7366    }
7367    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
7368    ///
7369    /// # Arguments
7370    ///
7371    /// * `name` - The name of the file or directory to search for
7372    /// * `start` - The path to start the search from
7373    pub async fn find_up(
7374        &self,
7375        name: impl Into<String>,
7376        start: impl Into<String>,
7377    ) -> Result<String, DaggerError> {
7378        let mut query = self.selection.select("findUp");
7379        query = query.arg("name", name.into());
7380        query = query.arg("start", start.into());
7381        query.execute(self.graphql_client.clone()).await
7382    }
7383    /// Return the difference between this directory and another directory, typically an older snapshot.
7384    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
7385    ///
7386    /// # Arguments
7387    ///
7388    /// * `from` - The base directory snapshot to compare against
7389    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
7390        let mut query = self.selection.select("changes");
7391        query = query.arg_lazy(
7392            "from",
7393            Box::new(move || {
7394                let from = from.clone();
7395                Box::pin(async move { from.into_id().await.unwrap().quote() })
7396            }),
7397        );
7398        Changeset {
7399            proc: self.proc.clone(),
7400            selection: query,
7401            graphql_client: self.graphql_client.clone(),
7402        }
7403    }
7404    /// Return a directory with changes from another directory applied to it.
7405    ///
7406    /// # Arguments
7407    ///
7408    /// * `changes` - Changes to apply to the directory
7409    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
7410        let mut query = self.selection.select("withChanges");
7411        query = query.arg_lazy(
7412            "changes",
7413            Box::new(move || {
7414                let changes = changes.clone();
7415                Box::pin(async move { changes.into_id().await.unwrap().quote() })
7416            }),
7417        );
7418        Directory {
7419            proc: self.proc.clone(),
7420            selection: query,
7421            graphql_client: self.graphql_client.clone(),
7422        }
7423    }
7424    /// Writes the contents of the directory to a path on the host.
7425    ///
7426    /// # Arguments
7427    ///
7428    /// * `path` - Location of the copied directory (e.g., "logs/").
7429    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7430    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7431        let mut query = self.selection.select("export");
7432        query = query.arg("path", path.into());
7433        query.execute(self.graphql_client.clone()).await
7434    }
7435    /// Writes the contents of the directory to a path on the host.
7436    ///
7437    /// # Arguments
7438    ///
7439    /// * `path` - Location of the copied directory (e.g., "logs/").
7440    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7441    pub async fn export_opts(
7442        &self,
7443        path: impl Into<String>,
7444        opts: DirectoryExportOpts,
7445    ) -> Result<String, DaggerError> {
7446        let mut query = self.selection.select("export");
7447        query = query.arg("path", path.into());
7448        if let Some(wipe) = opts.wipe {
7449            query = query.arg("wipe", wipe);
7450        }
7451        query.execute(self.graphql_client.clone()).await
7452    }
7453    /// 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.
7454    ///
7455    /// # Arguments
7456    ///
7457    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7458    pub fn docker_build(&self) -> Container {
7459        let query = self.selection.select("dockerBuild");
7460        Container {
7461            proc: self.proc.clone(),
7462            selection: query,
7463            graphql_client: self.graphql_client.clone(),
7464        }
7465    }
7466    /// 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.
7467    ///
7468    /// # Arguments
7469    ///
7470    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7471    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
7472        let mut query = self.selection.select("dockerBuild");
7473        if let Some(dockerfile) = opts.dockerfile {
7474            query = query.arg("dockerfile", dockerfile);
7475        }
7476        if let Some(platform) = opts.platform {
7477            query = query.arg("platform", platform);
7478        }
7479        if let Some(build_args) = opts.build_args {
7480            query = query.arg("buildArgs", build_args);
7481        }
7482        if let Some(target) = opts.target {
7483            query = query.arg("target", target);
7484        }
7485        if let Some(secrets) = opts.secrets {
7486            query = query.arg("secrets", secrets);
7487        }
7488        if let Some(no_init) = opts.no_init {
7489            query = query.arg("noInit", no_init);
7490        }
7491        if let Some(ssh) = opts.ssh {
7492            query = query.arg("ssh", ssh);
7493        }
7494        Container {
7495            proc: self.proc.clone(),
7496            selection: query,
7497            graphql_client: self.graphql_client.clone(),
7498        }
7499    }
7500    /// Retrieves this directory with all file/dir timestamps set to the given time.
7501    ///
7502    /// # Arguments
7503    ///
7504    /// * `timestamp` - Timestamp to set dir/files in.
7505    ///
7506    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7507    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7508        let mut query = self.selection.select("withTimestamps");
7509        query = query.arg("timestamp", timestamp);
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(&self, patch: impl Into<String>) -> Directory {
7523        let mut query = self.selection.select("withPatch");
7524        query = query.arg("patch", patch.into());
7525        Directory {
7526            proc: self.proc.clone(),
7527            selection: query,
7528            graphql_client: self.graphql_client.clone(),
7529        }
7530    }
7531    /// Retrieves this directory with the given Git-compatible patch applied.
7532    ///
7533    /// # Arguments
7534    ///
7535    /// * `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").
7536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7537    pub fn with_patch_opts(
7538        &self,
7539        patch: impl Into<String>,
7540        opts: DirectoryWithPatchOpts,
7541    ) -> Directory {
7542        let mut query = self.selection.select("withPatch");
7543        query = query.arg("patch", patch.into());
7544        if let Some(on_conflict) = opts.on_conflict {
7545            query = query.arg("onConflict", on_conflict);
7546        }
7547        Directory {
7548            proc: self.proc.clone(),
7549            selection: query,
7550            graphql_client: self.graphql_client.clone(),
7551        }
7552    }
7553    /// Retrieves this directory with the given Git-compatible patch file applied.
7554    ///
7555    /// # Arguments
7556    ///
7557    /// * `patch` - File containing the patch to apply
7558    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7559    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
7560        let mut query = self.selection.select("withPatchFile");
7561        query = query.arg_lazy(
7562            "patch",
7563            Box::new(move || {
7564                let patch = patch.clone();
7565                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7566            }),
7567        );
7568        Directory {
7569            proc: self.proc.clone(),
7570            selection: query,
7571            graphql_client: self.graphql_client.clone(),
7572        }
7573    }
7574    /// Retrieves this directory with the given Git-compatible patch file applied.
7575    ///
7576    /// # Arguments
7577    ///
7578    /// * `patch` - File containing the patch to apply
7579    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7580    pub fn with_patch_file_opts(
7581        &self,
7582        patch: impl IntoID<Id>,
7583        opts: DirectoryWithPatchFileOpts,
7584    ) -> Directory {
7585        let mut query = self.selection.select("withPatchFile");
7586        query = query.arg_lazy(
7587            "patch",
7588            Box::new(move || {
7589                let patch = patch.clone();
7590                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7591            }),
7592        );
7593        if let Some(on_conflict) = opts.on_conflict {
7594            query = query.arg("onConflict", on_conflict);
7595        }
7596        Directory {
7597            proc: self.proc.clone(),
7598            selection: query,
7599            graphql_client: self.graphql_client.clone(),
7600        }
7601    }
7602    /// Converts this directory to a local git repository
7603    pub fn as_git(&self) -> GitRepository {
7604        let query = self.selection.select("asGit");
7605        GitRepository {
7606            proc: self.proc.clone(),
7607            selection: query,
7608            graphql_client: self.graphql_client.clone(),
7609        }
7610    }
7611    /// Creates a synthetic workspace from this directory.
7612    ///
7613    /// # Arguments
7614    ///
7615    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7616    pub fn as_workspace(&self) -> Workspace {
7617        let query = self.selection.select("asWorkspace");
7618        Workspace {
7619            proc: self.proc.clone(),
7620            selection: query,
7621            graphql_client: self.graphql_client.clone(),
7622        }
7623    }
7624    /// Creates a synthetic workspace from this directory.
7625    ///
7626    /// # Arguments
7627    ///
7628    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7629    pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
7630        let mut query = self.selection.select("asWorkspace");
7631        if let Some(cwd) = opts.cwd {
7632            query = query.arg("cwd", cwd);
7633        }
7634        Workspace {
7635            proc: self.proc.clone(),
7636            selection: query,
7637            graphql_client: self.graphql_client.clone(),
7638        }
7639    }
7640    /// Opens an interactive terminal in new container with this directory mounted inside.
7641    ///
7642    /// # Arguments
7643    ///
7644    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7645    pub fn terminal(&self) -> Directory {
7646        let query = self.selection.select("terminal");
7647        Directory {
7648            proc: self.proc.clone(),
7649            selection: query,
7650            graphql_client: self.graphql_client.clone(),
7651        }
7652    }
7653    /// Opens an interactive terminal in new container with this directory mounted inside.
7654    ///
7655    /// # Arguments
7656    ///
7657    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7658    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
7659        let mut query = self.selection.select("terminal");
7660        if let Some(container) = opts.container {
7661            query = query.arg("container", container);
7662        }
7663        if let Some(cmd) = opts.cmd {
7664            query = query.arg("cmd", cmd);
7665        }
7666        if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
7667            query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
7668        }
7669        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
7670            query = query.arg(
7671                "experimentalPrivilegedNesting",
7672                experimental_privileged_nesting,
7673            );
7674        }
7675        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
7676            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
7677        }
7678        Directory {
7679            proc: self.proc.clone(),
7680            selection: query,
7681            graphql_client: self.graphql_client.clone(),
7682        }
7683    }
7684    /// Return a snapshot with a symlink
7685    ///
7686    /// # Arguments
7687    ///
7688    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
7689    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
7690    pub fn with_symlink(
7691        &self,
7692        target: impl Into<String>,
7693        link_name: impl Into<String>,
7694    ) -> Directory {
7695        let mut query = self.selection.select("withSymlink");
7696        query = query.arg("target", target.into());
7697        query = query.arg("linkName", link_name.into());
7698        Directory {
7699            proc: self.proc.clone(),
7700            selection: query,
7701            graphql_client: self.graphql_client.clone(),
7702        }
7703    }
7704    /// Change the owner of the directory contents recursively.
7705    ///
7706    /// # Arguments
7707    ///
7708    /// * `path` - Path of the directory to change ownership of (e.g., "/").
7709    /// * `owner` - A user:group to set for the mounted directory and its contents.
7710    ///
7711    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
7712    ///
7713    /// If the group is omitted, it defaults to the same as the user.
7714    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
7715        let mut query = self.selection.select("chown");
7716        query = query.arg("path", path.into());
7717        query = query.arg("owner", owner.into());
7718        Directory {
7719            proc: self.proc.clone(),
7720            selection: query,
7721            graphql_client: self.graphql_client.clone(),
7722        }
7723    }
7724    /// Raise an error.
7725    ///
7726    /// # Arguments
7727    ///
7728    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
7729    pub fn with_error(&self, err: impl Into<String>) -> Directory {
7730        let mut query = self.selection.select("withError");
7731        query = query.arg("err", err.into());
7732        Directory {
7733            proc: self.proc.clone(),
7734            selection: query,
7735            graphql_client: self.graphql_client.clone(),
7736        }
7737    }
7738    /// Load the directory as a Dagger module source
7739    ///
7740    /// # Arguments
7741    ///
7742    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7743    pub fn as_module(&self) -> Module {
7744        let query = self.selection.select("asModule");
7745        Module {
7746            proc: self.proc.clone(),
7747            selection: query,
7748            graphql_client: self.graphql_client.clone(),
7749        }
7750    }
7751    /// Load the directory as a Dagger module source
7752    ///
7753    /// # Arguments
7754    ///
7755    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7756    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
7757        let mut query = self.selection.select("asModule");
7758        if let Some(source_root_path) = opts.source_root_path {
7759            query = query.arg("sourceRootPath", source_root_path);
7760        }
7761        Module {
7762            proc: self.proc.clone(),
7763            selection: query,
7764            graphql_client: self.graphql_client.clone(),
7765        }
7766    }
7767    /// Load the directory as a Dagger module source
7768    ///
7769    /// # Arguments
7770    ///
7771    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7772    pub fn as_module_source(&self) -> ModuleSource {
7773        let query = self.selection.select("asModuleSource");
7774        ModuleSource {
7775            proc: self.proc.clone(),
7776            selection: query,
7777            graphql_client: self.graphql_client.clone(),
7778        }
7779    }
7780    /// Load the directory as a Dagger module source
7781    ///
7782    /// # Arguments
7783    ///
7784    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7785    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
7786        let mut query = self.selection.select("asModuleSource");
7787        if let Some(source_root_path) = opts.source_root_path {
7788            query = query.arg("sourceRootPath", source_root_path);
7789        }
7790        ModuleSource {
7791            proc: self.proc.clone(),
7792            selection: query,
7793            graphql_client: self.graphql_client.clone(),
7794        }
7795    }
7796}
7797impl Exportable for Directory {
7798    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7799        let query = self.selection.select("id");
7800        let graphql_client = self.graphql_client.clone();
7801        async move { query.execute(graphql_client).await }
7802    }
7803    fn export(
7804        &self,
7805        path: impl Into<String>,
7806    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7807        let mut query = self.selection.select("export");
7808        query = query.arg("path", path.into());
7809        let graphql_client = self.graphql_client.clone();
7810        async move { query.execute(graphql_client).await }
7811    }
7812}
7813impl Node for Directory {
7814    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7815        let query = self.selection.select("id");
7816        let graphql_client = self.graphql_client.clone();
7817        async move { query.execute(graphql_client).await }
7818    }
7819}
7820impl Syncer for Directory {
7821    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7822        let query = self.selection.select("id");
7823        let graphql_client = self.graphql_client.clone();
7824        async move { query.execute(graphql_client).await }
7825    }
7826    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7827        let query = self.selection.select("sync");
7828        let proc = self.proc.clone();
7829        let graphql_client = self.graphql_client.clone();
7830        async move {
7831            let id: Id = query.execute(graphql_client.clone()).await?;
7832            Ok(Self {
7833                proc,
7834                selection: query
7835                    .root()
7836                    .select("node")
7837                    .arg("id", &id.0)
7838                    .inline_fragment("Directory"),
7839                graphql_client,
7840            })
7841        }
7842    }
7843}
7844#[derive(Clone)]
7845pub struct Engine {
7846    pub proc: Option<Arc<DaggerSessionProc>>,
7847    pub selection: Selection,
7848    pub graphql_client: DynGraphQLClient,
7849}
7850impl IntoID<Id> for Engine {
7851    fn into_id(
7852        self,
7853    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7854        Box::pin(async move { self.id().await })
7855    }
7856}
7857impl Loadable for Engine {
7858    fn graphql_type() -> &'static str {
7859        "Engine"
7860    }
7861    fn from_query(
7862        proc: Option<Arc<DaggerSessionProc>>,
7863        selection: Selection,
7864        graphql_client: DynGraphQLClient,
7865    ) -> Self {
7866        Self {
7867            proc,
7868            selection,
7869            graphql_client,
7870        }
7871    }
7872}
7873impl Engine {
7874    /// A unique identifier for this Engine.
7875    pub async fn id(&self) -> Result<Id, DaggerError> {
7876        let query = self.selection.select("id");
7877        query.execute(self.graphql_client.clone()).await
7878    }
7879    /// The list of connected client IDs
7880    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7881        let query = self.selection.select("clients");
7882        query.execute(self.graphql_client.clone()).await
7883    }
7884    /// The name of the engine instance.
7885    pub async fn name(&self) -> Result<String, DaggerError> {
7886        let query = self.selection.select("name");
7887        query.execute(self.graphql_client.clone()).await
7888    }
7889    /// The local engine cache state tracked by dagql
7890    pub fn local_cache(&self) -> EngineCache {
7891        let query = self.selection.select("localCache");
7892        EngineCache {
7893            proc: self.proc.clone(),
7894            selection: query,
7895            graphql_client: self.graphql_client.clone(),
7896        }
7897    }
7898}
7899impl Node for Engine {
7900    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7901        let query = self.selection.select("id");
7902        let graphql_client = self.graphql_client.clone();
7903        async move { query.execute(graphql_client).await }
7904    }
7905}
7906#[derive(Clone)]
7907pub struct EngineCache {
7908    pub proc: Option<Arc<DaggerSessionProc>>,
7909    pub selection: Selection,
7910    pub graphql_client: DynGraphQLClient,
7911}
7912#[derive(Builder, Debug, PartialEq)]
7913pub struct EngineCacheEntrySetOpts<'a> {
7914    #[builder(setter(into, strip_option), default)]
7915    pub key: Option<&'a str>,
7916}
7917#[derive(Builder, Debug, PartialEq)]
7918pub struct EngineCachePruneOpts<'a> {
7919    /// Override the maximum structural metadata estimate in absolute bytes. Explicit values must be positive; the configured/default value is used when omitted.
7920    #[builder(setter(into, strip_option), default)]
7921    pub max_estimated_bytes: Option<isize>,
7922    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
7923    #[builder(setter(into, strip_option), default)]
7924    pub max_used_space: Option<&'a str>,
7925    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
7926    #[builder(setter(into, strip_option), default)]
7927    pub min_free_space: Option<&'a str>,
7928    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
7929    #[builder(setter(into, strip_option), default)]
7930    pub reserved_space: Option<&'a str>,
7931    /// 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.
7932    #[builder(setter(into, strip_option), default)]
7933    pub target_estimated_bytes: Option<isize>,
7934    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
7935    #[builder(setter(into, strip_option), default)]
7936    pub target_space: Option<&'a str>,
7937    /// 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.
7938    #[builder(setter(into, strip_option), default)]
7939    pub use_default_policy: Option<bool>,
7940}
7941impl IntoID<Id> for EngineCache {
7942    fn into_id(
7943        self,
7944    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7945        Box::pin(async move { self.id().await })
7946    }
7947}
7948impl Loadable for EngineCache {
7949    fn graphql_type() -> &'static str {
7950        "EngineCache"
7951    }
7952    fn from_query(
7953        proc: Option<Arc<DaggerSessionProc>>,
7954        selection: Selection,
7955        graphql_client: DynGraphQLClient,
7956    ) -> Self {
7957        Self {
7958            proc,
7959            selection,
7960            graphql_client,
7961        }
7962    }
7963}
7964impl EngineCache {
7965    /// A unique identifier for this EngineCache.
7966    pub async fn id(&self) -> Result<Id, DaggerError> {
7967        let query = self.selection.select("id");
7968        query.execute(self.graphql_client.clone()).await
7969    }
7970    /// The current set of entries in the cache
7971    ///
7972    /// # Arguments
7973    ///
7974    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7975    pub fn entry_set(&self) -> EngineCacheEntrySet {
7976        let query = self.selection.select("entrySet");
7977        EngineCacheEntrySet {
7978            proc: self.proc.clone(),
7979            selection: query,
7980            graphql_client: self.graphql_client.clone(),
7981        }
7982    }
7983    /// The current set of entries in the cache
7984    ///
7985    /// # Arguments
7986    ///
7987    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7988    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
7989        let mut query = self.selection.select("entrySet");
7990        if let Some(key) = opts.key {
7991            query = query.arg("key", key);
7992        }
7993        EngineCacheEntrySet {
7994            proc: self.proc.clone(),
7995            selection: query,
7996            graphql_client: self.graphql_client.clone(),
7997        }
7998    }
7999    /// Prune the cache of releaseable entries
8000    ///
8001    /// # Arguments
8002    ///
8003    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8004    pub async fn prune(&self) -> Result<Void, DaggerError> {
8005        let query = self.selection.select("prune");
8006        query.execute(self.graphql_client.clone()).await
8007    }
8008    /// Prune the cache of releaseable entries
8009    ///
8010    /// # Arguments
8011    ///
8012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8013    pub async fn prune_opts<'a>(
8014        &self,
8015        opts: EngineCachePruneOpts<'a>,
8016    ) -> Result<Void, DaggerError> {
8017        let mut query = self.selection.select("prune");
8018        if let Some(use_default_policy) = opts.use_default_policy {
8019            query = query.arg("useDefaultPolicy", use_default_policy);
8020        }
8021        if let Some(max_used_space) = opts.max_used_space {
8022            query = query.arg("maxUsedSpace", max_used_space);
8023        }
8024        if let Some(reserved_space) = opts.reserved_space {
8025            query = query.arg("reservedSpace", reserved_space);
8026        }
8027        if let Some(min_free_space) = opts.min_free_space {
8028            query = query.arg("minFreeSpace", min_free_space);
8029        }
8030        if let Some(target_space) = opts.target_space {
8031            query = query.arg("targetSpace", target_space);
8032        }
8033        if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
8034            query = query.arg("maxEstimatedBytes", max_estimated_bytes);
8035        }
8036        if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
8037            query = query.arg("targetEstimatedBytes", target_estimated_bytes);
8038        }
8039        query.execute(self.graphql_client.clone()).await
8040    }
8041    /// The maximum bytes to keep in the cache without pruning.
8042    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
8043        let query = self.selection.select("maxUsedSpace");
8044        query.execute(self.graphql_client.clone()).await
8045    }
8046    /// The target number of bytes to keep when pruning.
8047    pub async fn target_space(&self) -> Result<isize, DaggerError> {
8048        let query = self.selection.select("targetSpace");
8049        query.execute(self.graphql_client.clone()).await
8050    }
8051    /// The minimum amount of disk space this policy is guaranteed to retain.
8052    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
8053        let query = self.selection.select("reservedSpace");
8054        query.execute(self.graphql_client.clone()).await
8055    }
8056    /// The target amount of free disk space the garbage collector will attempt to leave.
8057    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
8058        let query = self.selection.select("minFreeSpace");
8059        query.execute(self.graphql_client.clone()).await
8060    }
8061}
8062impl Node for EngineCache {
8063    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8064        let query = self.selection.select("id");
8065        let graphql_client = self.graphql_client.clone();
8066        async move { query.execute(graphql_client).await }
8067    }
8068}
8069#[derive(Clone)]
8070pub struct EngineCacheEntry {
8071    pub proc: Option<Arc<DaggerSessionProc>>,
8072    pub selection: Selection,
8073    pub graphql_client: DynGraphQLClient,
8074}
8075impl IntoID<Id> for EngineCacheEntry {
8076    fn into_id(
8077        self,
8078    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8079        Box::pin(async move { self.id().await })
8080    }
8081}
8082impl Loadable for EngineCacheEntry {
8083    fn graphql_type() -> &'static str {
8084        "EngineCacheEntry"
8085    }
8086    fn from_query(
8087        proc: Option<Arc<DaggerSessionProc>>,
8088        selection: Selection,
8089        graphql_client: DynGraphQLClient,
8090    ) -> Self {
8091        Self {
8092            proc,
8093            selection,
8094            graphql_client,
8095        }
8096    }
8097}
8098impl EngineCacheEntry {
8099    /// A unique identifier for this EngineCacheEntry.
8100    pub async fn id(&self) -> Result<Id, DaggerError> {
8101        let query = self.selection.select("id");
8102        query.execute(self.graphql_client.clone()).await
8103    }
8104    /// The description of the cache entry.
8105    pub async fn description(&self) -> Result<String, DaggerError> {
8106        let query = self.selection.select("description");
8107        query.execute(self.graphql_client.clone()).await
8108    }
8109    /// The disk space used by the cache entry.
8110    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8111        let query = self.selection.select("diskSpaceBytes");
8112        query.execute(self.graphql_client.clone()).await
8113    }
8114    /// The time the cache entry was created, in Unix nanoseconds.
8115    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
8116        let query = self.selection.select("createdTimeUnixNano");
8117        query.execute(self.graphql_client.clone()).await
8118    }
8119    /// The most recent time the cache entry was used, in Unix nanoseconds.
8120    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
8121        let query = self.selection.select("mostRecentUseTimeUnixNano");
8122        query.execute(self.graphql_client.clone()).await
8123    }
8124    /// Whether the cache entry is actively being used.
8125    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
8126        let query = self.selection.select("activelyUsed");
8127        query.execute(self.graphql_client.clone()).await
8128    }
8129    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
8130    pub async fn record_type(&self) -> Result<String, DaggerError> {
8131        let query = self.selection.select("recordType");
8132        query.execute(self.graphql_client.clone()).await
8133    }
8134    /// The storage record types represented by this cache entry.
8135    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
8136        let query = self.selection.select("recordTypes");
8137        query.execute(self.graphql_client.clone()).await
8138    }
8139    /// The DagQL call that produced this cache entry.
8140    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
8141        let query = self.selection.select("dagqlCall");
8142        query.execute(self.graphql_client.clone()).await
8143    }
8144}
8145impl Node for EngineCacheEntry {
8146    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8147        let query = self.selection.select("id");
8148        let graphql_client = self.graphql_client.clone();
8149        async move { query.execute(graphql_client).await }
8150    }
8151}
8152#[derive(Clone)]
8153pub struct EngineCacheEntrySet {
8154    pub proc: Option<Arc<DaggerSessionProc>>,
8155    pub selection: Selection,
8156    pub graphql_client: DynGraphQLClient,
8157}
8158impl IntoID<Id> for EngineCacheEntrySet {
8159    fn into_id(
8160        self,
8161    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8162        Box::pin(async move { self.id().await })
8163    }
8164}
8165impl Loadable for EngineCacheEntrySet {
8166    fn graphql_type() -> &'static str {
8167        "EngineCacheEntrySet"
8168    }
8169    fn from_query(
8170        proc: Option<Arc<DaggerSessionProc>>,
8171        selection: Selection,
8172        graphql_client: DynGraphQLClient,
8173    ) -> Self {
8174        Self {
8175            proc,
8176            selection,
8177            graphql_client,
8178        }
8179    }
8180}
8181impl EngineCacheEntrySet {
8182    /// A unique identifier for this EngineCacheEntrySet.
8183    pub async fn id(&self) -> Result<Id, DaggerError> {
8184        let query = self.selection.select("id");
8185        query.execute(self.graphql_client.clone()).await
8186    }
8187    /// The list of individual cache entries in the set
8188    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
8189        let query = self.selection.select("entries");
8190        let query = query.select("id");
8191        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8192        Ok(ids
8193            .into_iter()
8194            .map(|id| EngineCacheEntry {
8195                proc: self.proc.clone(),
8196                selection: crate::querybuilder::query()
8197                    .select("node")
8198                    .arg("id", &id.0)
8199                    .inline_fragment("EngineCacheEntry"),
8200                graphql_client: self.graphql_client.clone(),
8201            })
8202            .collect())
8203    }
8204    /// The number of cache entries in this set.
8205    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
8206        let query = self.selection.select("entryCount");
8207        query.execute(self.graphql_client.clone()).await
8208    }
8209    /// The total disk space used by the cache entries in this set.
8210    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8211        let query = self.selection.select("diskSpaceBytes");
8212        query.execute(self.graphql_client.clone()).await
8213    }
8214}
8215impl Node for EngineCacheEntrySet {
8216    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8217        let query = self.selection.select("id");
8218        let graphql_client = self.graphql_client.clone();
8219        async move { query.execute(graphql_client).await }
8220    }
8221}
8222#[derive(Clone)]
8223pub struct EnumTypeDef {
8224    pub proc: Option<Arc<DaggerSessionProc>>,
8225    pub selection: Selection,
8226    pub graphql_client: DynGraphQLClient,
8227}
8228impl IntoID<Id> for EnumTypeDef {
8229    fn into_id(
8230        self,
8231    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8232        Box::pin(async move { self.id().await })
8233    }
8234}
8235impl Loadable for EnumTypeDef {
8236    fn graphql_type() -> &'static str {
8237        "EnumTypeDef"
8238    }
8239    fn from_query(
8240        proc: Option<Arc<DaggerSessionProc>>,
8241        selection: Selection,
8242        graphql_client: DynGraphQLClient,
8243    ) -> Self {
8244        Self {
8245            proc,
8246            selection,
8247            graphql_client,
8248        }
8249    }
8250}
8251impl EnumTypeDef {
8252    /// A unique identifier for this EnumTypeDef.
8253    pub async fn id(&self) -> Result<Id, DaggerError> {
8254        let query = self.selection.select("id");
8255        query.execute(self.graphql_client.clone()).await
8256    }
8257    /// The members of the enum.
8258    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8259        let query = self.selection.select("values");
8260        let query = query.select("id");
8261        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8262        Ok(ids
8263            .into_iter()
8264            .map(|id| EnumValueTypeDef {
8265                proc: self.proc.clone(),
8266                selection: crate::querybuilder::query()
8267                    .select("node")
8268                    .arg("id", &id.0)
8269                    .inline_fragment("EnumValueTypeDef"),
8270                graphql_client: self.graphql_client.clone(),
8271            })
8272            .collect())
8273    }
8274    /// The members of the enum.
8275    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8276        let query = self.selection.select("members");
8277        let query = query.select("id");
8278        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8279        Ok(ids
8280            .into_iter()
8281            .map(|id| EnumValueTypeDef {
8282                proc: self.proc.clone(),
8283                selection: crate::querybuilder::query()
8284                    .select("node")
8285                    .arg("id", &id.0)
8286                    .inline_fragment("EnumValueTypeDef"),
8287                graphql_client: self.graphql_client.clone(),
8288            })
8289            .collect())
8290    }
8291    /// The name of the enum.
8292    pub async fn name(&self) -> Result<String, DaggerError> {
8293        let query = self.selection.select("name");
8294        query.execute(self.graphql_client.clone()).await
8295    }
8296    /// A doc string for the enum, if any.
8297    pub async fn description(&self) -> Result<String, DaggerError> {
8298        let query = self.selection.select("description");
8299        query.execute(self.graphql_client.clone()).await
8300    }
8301    /// The location of this enum declaration.
8302    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8303        let query = self.selection.select("sourceMap");
8304        let query = query.select("id");
8305        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8306        Ok(id.map(|id| SourceMap {
8307            proc: self.proc.clone(),
8308            selection: query
8309                .root()
8310                .select("node")
8311                .arg("id", &id.0)
8312                .inline_fragment("SourceMap"),
8313            graphql_client: self.graphql_client.clone(),
8314        }))
8315    }
8316    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
8317    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8318        let query = self.selection.select("sourceModuleName");
8319        query.execute(self.graphql_client.clone()).await
8320    }
8321}
8322impl Node for EnumTypeDef {
8323    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8324        let query = self.selection.select("id");
8325        let graphql_client = self.graphql_client.clone();
8326        async move { query.execute(graphql_client).await }
8327    }
8328}
8329#[derive(Clone)]
8330pub struct EnumValueTypeDef {
8331    pub proc: Option<Arc<DaggerSessionProc>>,
8332    pub selection: Selection,
8333    pub graphql_client: DynGraphQLClient,
8334}
8335impl IntoID<Id> for EnumValueTypeDef {
8336    fn into_id(
8337        self,
8338    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8339        Box::pin(async move { self.id().await })
8340    }
8341}
8342impl Loadable for EnumValueTypeDef {
8343    fn graphql_type() -> &'static str {
8344        "EnumValueTypeDef"
8345    }
8346    fn from_query(
8347        proc: Option<Arc<DaggerSessionProc>>,
8348        selection: Selection,
8349        graphql_client: DynGraphQLClient,
8350    ) -> Self {
8351        Self {
8352            proc,
8353            selection,
8354            graphql_client,
8355        }
8356    }
8357}
8358impl EnumValueTypeDef {
8359    /// A unique identifier for this EnumValueTypeDef.
8360    pub async fn id(&self) -> Result<Id, DaggerError> {
8361        let query = self.selection.select("id");
8362        query.execute(self.graphql_client.clone()).await
8363    }
8364    /// The name of the enum member.
8365    pub async fn name(&self) -> Result<String, DaggerError> {
8366        let query = self.selection.select("name");
8367        query.execute(self.graphql_client.clone()).await
8368    }
8369    /// The value of the enum member
8370    pub async fn value(&self) -> Result<String, DaggerError> {
8371        let query = self.selection.select("value");
8372        query.execute(self.graphql_client.clone()).await
8373    }
8374    /// A doc string for the enum member, if any.
8375    pub async fn description(&self) -> Result<String, DaggerError> {
8376        let query = self.selection.select("description");
8377        query.execute(self.graphql_client.clone()).await
8378    }
8379    /// The location of this enum member declaration.
8380    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8381        let query = self.selection.select("sourceMap");
8382        let query = query.select("id");
8383        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8384        Ok(id.map(|id| SourceMap {
8385            proc: self.proc.clone(),
8386            selection: query
8387                .root()
8388                .select("node")
8389                .arg("id", &id.0)
8390                .inline_fragment("SourceMap"),
8391            graphql_client: self.graphql_client.clone(),
8392        }))
8393    }
8394    /// The reason this enum member is deprecated, if any.
8395    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8396        let query = self.selection.select("deprecated");
8397        query.execute(self.graphql_client.clone()).await
8398    }
8399}
8400impl Node for EnumValueTypeDef {
8401    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8402        let query = self.selection.select("id");
8403        let graphql_client = self.graphql_client.clone();
8404        async move { query.execute(graphql_client).await }
8405    }
8406}
8407#[derive(Clone)]
8408pub struct EnvFile {
8409    pub proc: Option<Arc<DaggerSessionProc>>,
8410    pub selection: Selection,
8411    pub graphql_client: DynGraphQLClient,
8412}
8413#[derive(Builder, Debug, PartialEq)]
8414pub struct EnvFileVariablesOpts {
8415    /// Return values exactly as written to the file. No quote removal or variable expansion
8416    #[builder(setter(into, strip_option), default)]
8417    pub raw: Option<bool>,
8418}
8419#[derive(Builder, Debug, PartialEq)]
8420pub struct EnvFileGetOpts {
8421    /// Return the value exactly as written to the file. No quote removal or variable expansion
8422    #[builder(setter(into, strip_option), default)]
8423    pub raw: Option<bool>,
8424}
8425impl IntoID<Id> for EnvFile {
8426    fn into_id(
8427        self,
8428    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8429        Box::pin(async move { self.id().await })
8430    }
8431}
8432impl Loadable for EnvFile {
8433    fn graphql_type() -> &'static str {
8434        "EnvFile"
8435    }
8436    fn from_query(
8437        proc: Option<Arc<DaggerSessionProc>>,
8438        selection: Selection,
8439        graphql_client: DynGraphQLClient,
8440    ) -> Self {
8441        Self {
8442            proc,
8443            selection,
8444            graphql_client,
8445        }
8446    }
8447}
8448impl EnvFile {
8449    /// A unique identifier for this EnvFile.
8450    pub async fn id(&self) -> Result<Id, DaggerError> {
8451        let query = self.selection.select("id");
8452        query.execute(self.graphql_client.clone()).await
8453    }
8454    /// Return all variables
8455    ///
8456    /// # Arguments
8457    ///
8458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8459    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8460        let query = self.selection.select("variables");
8461        let query = query.select("id");
8462        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8463        Ok(ids
8464            .into_iter()
8465            .map(|id| EnvVariable {
8466                proc: self.proc.clone(),
8467                selection: crate::querybuilder::query()
8468                    .select("node")
8469                    .arg("id", &id.0)
8470                    .inline_fragment("EnvVariable"),
8471                graphql_client: self.graphql_client.clone(),
8472            })
8473            .collect())
8474    }
8475    /// Return all variables
8476    ///
8477    /// # Arguments
8478    ///
8479    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8480    pub async fn variables_opts(
8481        &self,
8482        opts: EnvFileVariablesOpts,
8483    ) -> Result<Vec<EnvVariable>, DaggerError> {
8484        let mut query = self.selection.select("variables");
8485        if let Some(raw) = opts.raw {
8486            query = query.arg("raw", raw);
8487        }
8488        let query = query.select("id");
8489        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8490        Ok(ids
8491            .into_iter()
8492            .map(|id| EnvVariable {
8493                proc: self.proc.clone(),
8494                selection: crate::querybuilder::query()
8495                    .select("node")
8496                    .arg("id", &id.0)
8497                    .inline_fragment("EnvVariable"),
8498                graphql_client: self.graphql_client.clone(),
8499            })
8500            .collect())
8501    }
8502    /// Add a variable
8503    ///
8504    /// # Arguments
8505    ///
8506    /// * `name` - Variable name
8507    /// * `value` - Variable value
8508    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8509        let mut query = self.selection.select("withVariable");
8510        query = query.arg("name", name.into());
8511        query = query.arg("value", value.into());
8512        EnvFile {
8513            proc: self.proc.clone(),
8514            selection: query,
8515            graphql_client: self.graphql_client.clone(),
8516        }
8517    }
8518    /// Remove all occurrences of the named variable
8519    ///
8520    /// # Arguments
8521    ///
8522    /// * `name` - Variable name
8523    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8524        let mut query = self.selection.select("withoutVariable");
8525        query = query.arg("name", name.into());
8526        EnvFile {
8527            proc: self.proc.clone(),
8528            selection: query,
8529            graphql_client: self.graphql_client.clone(),
8530        }
8531    }
8532    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8533    ///
8534    /// # Arguments
8535    ///
8536    /// * `name` - Variable name
8537    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8538    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8539        let mut query = self.selection.select("get");
8540        query = query.arg("name", name.into());
8541        query.execute(self.graphql_client.clone()).await
8542    }
8543    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8544    ///
8545    /// # Arguments
8546    ///
8547    /// * `name` - Variable name
8548    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8549    pub async fn get_opts(
8550        &self,
8551        name: impl Into<String>,
8552        opts: EnvFileGetOpts,
8553    ) -> Result<String, DaggerError> {
8554        let mut query = self.selection.select("get");
8555        query = query.arg("name", name.into());
8556        if let Some(raw) = opts.raw {
8557            query = query.arg("raw", raw);
8558        }
8559        query.execute(self.graphql_client.clone()).await
8560    }
8561    /// Check if a variable exists
8562    ///
8563    /// # Arguments
8564    ///
8565    /// * `name` - Variable name
8566    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8567        let mut query = self.selection.select("exists");
8568        query = query.arg("name", name.into());
8569        query.execute(self.graphql_client.clone()).await
8570    }
8571    /// Return as a file
8572    pub fn as_file(&self) -> File {
8573        let query = self.selection.select("asFile");
8574        File {
8575            proc: self.proc.clone(),
8576            selection: query,
8577            graphql_client: self.graphql_client.clone(),
8578        }
8579    }
8580    /// 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
8581    ///
8582    /// # Arguments
8583    ///
8584    /// * `prefix` - The prefix to filter by
8585    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8586        let mut query = self.selection.select("namespace");
8587        query = query.arg("prefix", prefix.into());
8588        EnvFile {
8589            proc: self.proc.clone(),
8590            selection: query,
8591            graphql_client: self.graphql_client.clone(),
8592        }
8593    }
8594}
8595impl Node for EnvFile {
8596    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8597        let query = self.selection.select("id");
8598        let graphql_client = self.graphql_client.clone();
8599        async move { query.execute(graphql_client).await }
8600    }
8601}
8602#[derive(Clone)]
8603pub struct EnvVariable {
8604    pub proc: Option<Arc<DaggerSessionProc>>,
8605    pub selection: Selection,
8606    pub graphql_client: DynGraphQLClient,
8607}
8608impl IntoID<Id> for EnvVariable {
8609    fn into_id(
8610        self,
8611    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8612        Box::pin(async move { self.id().await })
8613    }
8614}
8615impl Loadable for EnvVariable {
8616    fn graphql_type() -> &'static str {
8617        "EnvVariable"
8618    }
8619    fn from_query(
8620        proc: Option<Arc<DaggerSessionProc>>,
8621        selection: Selection,
8622        graphql_client: DynGraphQLClient,
8623    ) -> Self {
8624        Self {
8625            proc,
8626            selection,
8627            graphql_client,
8628        }
8629    }
8630}
8631impl EnvVariable {
8632    /// A unique identifier for this EnvVariable.
8633    pub async fn id(&self) -> Result<Id, DaggerError> {
8634        let query = self.selection.select("id");
8635        query.execute(self.graphql_client.clone()).await
8636    }
8637    /// The environment variable name.
8638    pub async fn name(&self) -> Result<String, DaggerError> {
8639        let query = self.selection.select("name");
8640        query.execute(self.graphql_client.clone()).await
8641    }
8642    /// The environment variable value.
8643    pub async fn value(&self) -> Result<String, DaggerError> {
8644        let query = self.selection.select("value");
8645        query.execute(self.graphql_client.clone()).await
8646    }
8647}
8648impl Node for EnvVariable {
8649    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8650        let query = self.selection.select("id");
8651        let graphql_client = self.graphql_client.clone();
8652        async move { query.execute(graphql_client).await }
8653    }
8654}
8655#[derive(Clone)]
8656pub struct Error {
8657    pub proc: Option<Arc<DaggerSessionProc>>,
8658    pub selection: Selection,
8659    pub graphql_client: DynGraphQLClient,
8660}
8661impl IntoID<Id> for Error {
8662    fn into_id(
8663        self,
8664    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8665        Box::pin(async move { self.id().await })
8666    }
8667}
8668impl Loadable for Error {
8669    fn graphql_type() -> &'static str {
8670        "Error"
8671    }
8672    fn from_query(
8673        proc: Option<Arc<DaggerSessionProc>>,
8674        selection: Selection,
8675        graphql_client: DynGraphQLClient,
8676    ) -> Self {
8677        Self {
8678            proc,
8679            selection,
8680            graphql_client,
8681        }
8682    }
8683}
8684impl Error {
8685    /// A unique identifier for this Error.
8686    pub async fn id(&self) -> Result<Id, DaggerError> {
8687        let query = self.selection.select("id");
8688        query.execute(self.graphql_client.clone()).await
8689    }
8690    /// Add a value to the error.
8691    ///
8692    /// # Arguments
8693    ///
8694    /// * `name` - The name of the value.
8695    /// * `value` - The value to store on the error.
8696    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8697        let mut query = self.selection.select("withValue");
8698        query = query.arg("name", name.into());
8699        query = query.arg("value", value);
8700        Error {
8701            proc: self.proc.clone(),
8702            selection: query,
8703            graphql_client: self.graphql_client.clone(),
8704        }
8705    }
8706    /// A description of the error.
8707    pub async fn message(&self) -> Result<String, DaggerError> {
8708        let query = self.selection.select("message");
8709        query.execute(self.graphql_client.clone()).await
8710    }
8711    /// The extensions of the error.
8712    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8713        let query = self.selection.select("values");
8714        let query = query.select("id");
8715        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8716        Ok(ids
8717            .into_iter()
8718            .map(|id| ErrorValue {
8719                proc: self.proc.clone(),
8720                selection: crate::querybuilder::query()
8721                    .select("node")
8722                    .arg("id", &id.0)
8723                    .inline_fragment("ErrorValue"),
8724                graphql_client: self.graphql_client.clone(),
8725            })
8726            .collect())
8727    }
8728}
8729impl Node for Error {
8730    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8731        let query = self.selection.select("id");
8732        let graphql_client = self.graphql_client.clone();
8733        async move { query.execute(graphql_client).await }
8734    }
8735}
8736#[derive(Clone)]
8737pub struct ErrorValue {
8738    pub proc: Option<Arc<DaggerSessionProc>>,
8739    pub selection: Selection,
8740    pub graphql_client: DynGraphQLClient,
8741}
8742impl IntoID<Id> for ErrorValue {
8743    fn into_id(
8744        self,
8745    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8746        Box::pin(async move { self.id().await })
8747    }
8748}
8749impl Loadable for ErrorValue {
8750    fn graphql_type() -> &'static str {
8751        "ErrorValue"
8752    }
8753    fn from_query(
8754        proc: Option<Arc<DaggerSessionProc>>,
8755        selection: Selection,
8756        graphql_client: DynGraphQLClient,
8757    ) -> Self {
8758        Self {
8759            proc,
8760            selection,
8761            graphql_client,
8762        }
8763    }
8764}
8765impl ErrorValue {
8766    /// A unique identifier for this ErrorValue.
8767    pub async fn id(&self) -> Result<Id, DaggerError> {
8768        let query = self.selection.select("id");
8769        query.execute(self.graphql_client.clone()).await
8770    }
8771    /// The name of the value.
8772    pub async fn name(&self) -> Result<String, DaggerError> {
8773        let query = self.selection.select("name");
8774        query.execute(self.graphql_client.clone()).await
8775    }
8776    /// The value.
8777    pub async fn value(&self) -> Result<Json, DaggerError> {
8778        let query = self.selection.select("value");
8779        query.execute(self.graphql_client.clone()).await
8780    }
8781}
8782impl Node for ErrorValue {
8783    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8784        let query = self.selection.select("id");
8785        let graphql_client = self.graphql_client.clone();
8786        async move { query.execute(graphql_client).await }
8787    }
8788}
8789#[derive(Clone)]
8790pub struct Expertise {
8791    pub proc: Option<Arc<DaggerSessionProc>>,
8792    pub selection: Selection,
8793    pub graphql_client: DynGraphQLClient,
8794}
8795impl IntoID<Id> for Expertise {
8796    fn into_id(
8797        self,
8798    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8799        Box::pin(async move { self.id().await })
8800    }
8801}
8802impl Loadable for Expertise {
8803    fn graphql_type() -> &'static str {
8804        "Expertise"
8805    }
8806    fn from_query(
8807        proc: Option<Arc<DaggerSessionProc>>,
8808        selection: Selection,
8809        graphql_client: DynGraphQLClient,
8810    ) -> Self {
8811        Self {
8812            proc,
8813            selection,
8814            graphql_client,
8815        }
8816    }
8817}
8818impl Expertise {
8819    /// A unique identifier for this Expertise.
8820    pub async fn id(&self) -> Result<Id, DaggerError> {
8821        let query = self.selection.select("id");
8822        query.execute(self.graphql_client.clone()).await
8823    }
8824    /// The agent function's name.
8825    pub async fn name(&self) -> Result<String, DaggerError> {
8826        let query = self.selection.select("name");
8827        query.execute(self.graphql_client.clone()).await
8828    }
8829    /// The agent function's description.
8830    pub async fn description(&self) -> Result<String, DaggerError> {
8831        let query = self.selection.select("description");
8832        query.execute(self.graphql_client.clone()).await
8833    }
8834    /// The agent function's path within its module.
8835    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8836        let query = self.selection.select("path");
8837        query.execute(self.graphql_client.clone()).await
8838    }
8839    /// The module that defines the agent function.
8840    pub fn original_module(&self) -> Module {
8841        let query = self.selection.select("originalModule");
8842        Module {
8843            proc: self.proc.clone(),
8844            selection: query,
8845            graphql_client: self.graphql_client.clone(),
8846        }
8847    }
8848}
8849impl Node for Expertise {
8850    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8851        let query = self.selection.select("id");
8852        let graphql_client = self.graphql_client.clone();
8853        async move { query.execute(graphql_client).await }
8854    }
8855}
8856#[derive(Clone)]
8857pub struct FieldTypeDef {
8858    pub proc: Option<Arc<DaggerSessionProc>>,
8859    pub selection: Selection,
8860    pub graphql_client: DynGraphQLClient,
8861}
8862impl IntoID<Id> for FieldTypeDef {
8863    fn into_id(
8864        self,
8865    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8866        Box::pin(async move { self.id().await })
8867    }
8868}
8869impl Loadable for FieldTypeDef {
8870    fn graphql_type() -> &'static str {
8871        "FieldTypeDef"
8872    }
8873    fn from_query(
8874        proc: Option<Arc<DaggerSessionProc>>,
8875        selection: Selection,
8876        graphql_client: DynGraphQLClient,
8877    ) -> Self {
8878        Self {
8879            proc,
8880            selection,
8881            graphql_client,
8882        }
8883    }
8884}
8885impl FieldTypeDef {
8886    /// A unique identifier for this FieldTypeDef.
8887    pub async fn id(&self) -> Result<Id, DaggerError> {
8888        let query = self.selection.select("id");
8889        query.execute(self.graphql_client.clone()).await
8890    }
8891    /// The type of the field.
8892    pub fn type_def(&self) -> TypeDef {
8893        let query = self.selection.select("typeDef");
8894        TypeDef {
8895            proc: self.proc.clone(),
8896            selection: query,
8897            graphql_client: self.graphql_client.clone(),
8898        }
8899    }
8900    /// The name of the field in lowerCamelCase format.
8901    pub async fn name(&self) -> Result<String, DaggerError> {
8902        let query = self.selection.select("name");
8903        query.execute(self.graphql_client.clone()).await
8904    }
8905    /// A doc string for the field, if any.
8906    pub async fn description(&self) -> Result<String, DaggerError> {
8907        let query = self.selection.select("description");
8908        query.execute(self.graphql_client.clone()).await
8909    }
8910    /// The location of this field declaration.
8911    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8912        let query = self.selection.select("sourceMap");
8913        let query = query.select("id");
8914        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8915        Ok(id.map(|id| SourceMap {
8916            proc: self.proc.clone(),
8917            selection: query
8918                .root()
8919                .select("node")
8920                .arg("id", &id.0)
8921                .inline_fragment("SourceMap"),
8922            graphql_client: self.graphql_client.clone(),
8923        }))
8924    }
8925    /// The reason this enum member is deprecated, if any.
8926    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8927        let query = self.selection.select("deprecated");
8928        query.execute(self.graphql_client.clone()).await
8929    }
8930}
8931impl Node for FieldTypeDef {
8932    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8933        let query = self.selection.select("id");
8934        let graphql_client = self.graphql_client.clone();
8935        async move { query.execute(graphql_client).await }
8936    }
8937}
8938#[derive(Clone)]
8939pub struct File {
8940    pub proc: Option<Arc<DaggerSessionProc>>,
8941    pub selection: Selection,
8942    pub graphql_client: DynGraphQLClient,
8943}
8944#[derive(Builder, Debug, PartialEq)]
8945pub struct FileContentsOpts {
8946    /// Maximum number of lines to read
8947    #[builder(setter(into, strip_option), default)]
8948    pub limit_lines: Option<isize>,
8949    /// Start reading after this line
8950    #[builder(setter(into, strip_option), default)]
8951    pub offset_lines: Option<isize>,
8952}
8953#[derive(Builder, Debug, PartialEq)]
8954pub struct FileDigestOpts {
8955    /// If true, exclude metadata from the digest.
8956    #[builder(setter(into, strip_option), default)]
8957    pub exclude_metadata: Option<bool>,
8958}
8959#[derive(Builder, Debug, PartialEq)]
8960pub struct FileSearchOpts<'a> {
8961    /// Allow the . pattern to match newlines in multiline mode.
8962    #[builder(setter(into, strip_option), default)]
8963    pub dotall: Option<bool>,
8964    /// Only return matching files, not lines and content
8965    #[builder(setter(into, strip_option), default)]
8966    pub files_only: Option<bool>,
8967    #[builder(setter(into, strip_option), default)]
8968    pub globs: Option<Vec<&'a str>>,
8969    /// Enable case-insensitive matching.
8970    #[builder(setter(into, strip_option), default)]
8971    pub insensitive: Option<bool>,
8972    /// Limit the number of results to return
8973    #[builder(setter(into, strip_option), default)]
8974    pub limit: Option<isize>,
8975    /// Interpret the pattern as a literal string instead of a regular expression.
8976    #[builder(setter(into, strip_option), default)]
8977    pub literal: Option<bool>,
8978    /// Enable searching across multiple lines.
8979    #[builder(setter(into, strip_option), default)]
8980    pub multiline: Option<bool>,
8981    #[builder(setter(into, strip_option), default)]
8982    pub paths: Option<Vec<&'a str>>,
8983    /// Skip hidden files (files starting with .).
8984    #[builder(setter(into, strip_option), default)]
8985    pub skip_hidden: Option<bool>,
8986    /// Honor .gitignore, .ignore, and .rgignore files.
8987    #[builder(setter(into, strip_option), default)]
8988    pub skip_ignored: Option<bool>,
8989}
8990#[derive(Builder, Debug, PartialEq)]
8991pub struct FileWithReplacedOpts {
8992    /// Replace all occurrences of the pattern.
8993    #[builder(setter(into, strip_option), default)]
8994    pub all: Option<bool>,
8995    /// Replace the first match starting from the specified line.
8996    #[builder(setter(into, strip_option), default)]
8997    pub first_from: Option<isize>,
8998}
8999#[derive(Builder, Debug, PartialEq)]
9000pub struct FileExportOpts {
9001    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
9002    #[builder(setter(into, strip_option), default)]
9003    pub allow_parent_dir_path: Option<bool>,
9004}
9005#[derive(Builder, Debug, PartialEq)]
9006pub struct FileAsEnvFileOpts {
9007    /// Replace "${VAR}" or "$VAR" with the value of other vars
9008    #[builder(setter(into, strip_option), default)]
9009    pub expand: Option<bool>,
9010}
9011impl IntoID<Id> for File {
9012    fn into_id(
9013        self,
9014    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9015        Box::pin(async move { self.id().await })
9016    }
9017}
9018impl Loadable for File {
9019    fn graphql_type() -> &'static str {
9020        "File"
9021    }
9022    fn from_query(
9023        proc: Option<Arc<DaggerSessionProc>>,
9024        selection: Selection,
9025        graphql_client: DynGraphQLClient,
9026    ) -> Self {
9027        Self {
9028            proc,
9029            selection,
9030            graphql_client,
9031        }
9032    }
9033}
9034impl File {
9035    /// A unique identifier for this File.
9036    pub async fn id(&self) -> Result<Id, DaggerError> {
9037        let query = self.selection.select("id");
9038        query.execute(self.graphql_client.clone()).await
9039    }
9040    /// Force evaluation in the engine.
9041    pub async fn sync(&self) -> Result<File, DaggerError> {
9042        let query = self.selection.select("sync");
9043        let id: Id = query.execute(self.graphql_client.clone()).await?;
9044        Ok(File {
9045            proc: self.proc.clone(),
9046            selection: query
9047                .root()
9048                .select("node")
9049                .arg("id", &id.0)
9050                .inline_fragment("File"),
9051            graphql_client: self.graphql_client.clone(),
9052        })
9053    }
9054    /// Retrieves the contents of the file.
9055    ///
9056    /// # Arguments
9057    ///
9058    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9059    pub async fn contents(&self) -> Result<String, DaggerError> {
9060        let query = self.selection.select("contents");
9061        query.execute(self.graphql_client.clone()).await
9062    }
9063    /// Retrieves the contents of the file.
9064    ///
9065    /// # Arguments
9066    ///
9067    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9068    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9069        let mut query = self.selection.select("contents");
9070        if let Some(offset_lines) = opts.offset_lines {
9071            query = query.arg("offsetLines", offset_lines);
9072        }
9073        if let Some(limit_lines) = opts.limit_lines {
9074            query = query.arg("limitLines", limit_lines);
9075        }
9076        query.execute(self.graphql_client.clone()).await
9077    }
9078    /// Retrieves the size of the file, in bytes.
9079    pub async fn size(&self) -> Result<isize, DaggerError> {
9080        let query = self.selection.select("size");
9081        query.execute(self.graphql_client.clone()).await
9082    }
9083    /// Retrieves the name of the file.
9084    pub async fn name(&self) -> Result<String, DaggerError> {
9085        let query = self.selection.select("name");
9086        query.execute(self.graphql_client.clone()).await
9087    }
9088    /// Return file status
9089    pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
9090        let query = self.selection.select("stat");
9091        let query = query.select("id");
9092        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9093        Ok(id.map(|id| Stat {
9094            proc: self.proc.clone(),
9095            selection: query
9096                .root()
9097                .select("node")
9098                .arg("id", &id.0)
9099                .inline_fragment("Stat"),
9100            graphql_client: self.graphql_client.clone(),
9101        }))
9102    }
9103    /// 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.
9104    ///
9105    /// # Arguments
9106    ///
9107    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9108    pub async fn digest(&self) -> Result<String, DaggerError> {
9109        let query = self.selection.select("digest");
9110        query.execute(self.graphql_client.clone()).await
9111    }
9112    /// 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.
9113    ///
9114    /// # Arguments
9115    ///
9116    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9117    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9118        let mut query = self.selection.select("digest");
9119        if let Some(exclude_metadata) = opts.exclude_metadata {
9120            query = query.arg("excludeMetadata", exclude_metadata);
9121        }
9122        query.execute(self.graphql_client.clone()).await
9123    }
9124    /// Retrieves this file with its name set to the given name.
9125    ///
9126    /// # Arguments
9127    ///
9128    /// * `name` - Name to set file to.
9129    pub fn with_name(&self, name: impl Into<String>) -> File {
9130        let mut query = self.selection.select("withName");
9131        query = query.arg("name", name.into());
9132        File {
9133            proc: self.proc.clone(),
9134            selection: query,
9135            graphql_client: self.graphql_client.clone(),
9136        }
9137    }
9138    /// Searches for content matching the given regular expression or literal string.
9139    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9140    ///
9141    /// # Arguments
9142    ///
9143    /// * `pattern` - The text to match.
9144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9145    pub async fn search(
9146        &self,
9147        pattern: impl Into<String>,
9148    ) -> Result<Vec<SearchResult>, DaggerError> {
9149        let mut query = self.selection.select("search");
9150        query = query.arg("pattern", pattern.into());
9151        let query = query.select("id");
9152        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9153        Ok(ids
9154            .into_iter()
9155            .map(|id| SearchResult {
9156                proc: self.proc.clone(),
9157                selection: crate::querybuilder::query()
9158                    .select("node")
9159                    .arg("id", &id.0)
9160                    .inline_fragment("SearchResult"),
9161                graphql_client: self.graphql_client.clone(),
9162            })
9163            .collect())
9164    }
9165    /// Searches for content matching the given regular expression or literal string.
9166    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9167    ///
9168    /// # Arguments
9169    ///
9170    /// * `pattern` - The text to match.
9171    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9172    pub async fn search_opts<'a>(
9173        &self,
9174        pattern: impl Into<String>,
9175        opts: FileSearchOpts<'a>,
9176    ) -> Result<Vec<SearchResult>, DaggerError> {
9177        let mut query = self.selection.select("search");
9178        query = query.arg("pattern", pattern.into());
9179        if let Some(literal) = opts.literal {
9180            query = query.arg("literal", literal);
9181        }
9182        if let Some(multiline) = opts.multiline {
9183            query = query.arg("multiline", multiline);
9184        }
9185        if let Some(dotall) = opts.dotall {
9186            query = query.arg("dotall", dotall);
9187        }
9188        if let Some(insensitive) = opts.insensitive {
9189            query = query.arg("insensitive", insensitive);
9190        }
9191        if let Some(skip_ignored) = opts.skip_ignored {
9192            query = query.arg("skipIgnored", skip_ignored);
9193        }
9194        if let Some(skip_hidden) = opts.skip_hidden {
9195            query = query.arg("skipHidden", skip_hidden);
9196        }
9197        if let Some(files_only) = opts.files_only {
9198            query = query.arg("filesOnly", files_only);
9199        }
9200        if let Some(limit) = opts.limit {
9201            query = query.arg("limit", limit);
9202        }
9203        if let Some(paths) = opts.paths {
9204            query = query.arg("paths", paths);
9205        }
9206        if let Some(globs) = opts.globs {
9207            query = query.arg("globs", globs);
9208        }
9209        let query = query.select("id");
9210        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9211        Ok(ids
9212            .into_iter()
9213            .map(|id| SearchResult {
9214                proc: self.proc.clone(),
9215                selection: crate::querybuilder::query()
9216                    .select("node")
9217                    .arg("id", &id.0)
9218                    .inline_fragment("SearchResult"),
9219                graphql_client: self.graphql_client.clone(),
9220            })
9221            .collect())
9222    }
9223    /// Retrieves the file with content replaced with the given text.
9224    /// If 'all' is true, all occurrences of the pattern will be replaced.
9225    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9226    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9227    /// If there are no matches for the pattern, this will error.
9228    ///
9229    /// # Arguments
9230    ///
9231    /// * `search` - The text to match.
9232    /// * `replacement` - The text to match.
9233    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9234    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9235        let mut query = self.selection.select("withReplaced");
9236        query = query.arg("search", search.into());
9237        query = query.arg("replacement", replacement.into());
9238        File {
9239            proc: self.proc.clone(),
9240            selection: query,
9241            graphql_client: self.graphql_client.clone(),
9242        }
9243    }
9244    /// Retrieves the file with content replaced with the given text.
9245    /// If 'all' is true, all occurrences of the pattern will be replaced.
9246    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9247    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9248    /// If there are no matches for the pattern, this will error.
9249    ///
9250    /// # Arguments
9251    ///
9252    /// * `search` - The text to match.
9253    /// * `replacement` - The text to match.
9254    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9255    pub fn with_replaced_opts(
9256        &self,
9257        search: impl Into<String>,
9258        replacement: impl Into<String>,
9259        opts: FileWithReplacedOpts,
9260    ) -> File {
9261        let mut query = self.selection.select("withReplaced");
9262        query = query.arg("search", search.into());
9263        query = query.arg("replacement", replacement.into());
9264        if let Some(all) = opts.all {
9265            query = query.arg("all", all);
9266        }
9267        if let Some(first_from) = opts.first_from {
9268            query = query.arg("firstFrom", first_from);
9269        }
9270        File {
9271            proc: self.proc.clone(),
9272            selection: query,
9273            graphql_client: self.graphql_client.clone(),
9274        }
9275    }
9276    /// Writes the file to a file path on the host.
9277    ///
9278    /// # Arguments
9279    ///
9280    /// * `path` - Location of the written directory (e.g., "output.txt").
9281    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9282    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9283        let mut query = self.selection.select("export");
9284        query = query.arg("path", path.into());
9285        query.execute(self.graphql_client.clone()).await
9286    }
9287    /// Writes the file to a file path on the host.
9288    ///
9289    /// # Arguments
9290    ///
9291    /// * `path` - Location of the written directory (e.g., "output.txt").
9292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9293    pub async fn export_opts(
9294        &self,
9295        path: impl Into<String>,
9296        opts: FileExportOpts,
9297    ) -> Result<String, DaggerError> {
9298        let mut query = self.selection.select("export");
9299        query = query.arg("path", path.into());
9300        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9301            query = query.arg("allowParentDirPath", allow_parent_dir_path);
9302        }
9303        query.execute(self.graphql_client.clone()).await
9304    }
9305    /// Retrieves this file with its created/modified timestamps set to the given time.
9306    ///
9307    /// # Arguments
9308    ///
9309    /// * `timestamp` - Timestamp to set dir/files in.
9310    ///
9311    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9312    pub fn with_timestamps(&self, timestamp: isize) -> File {
9313        let mut query = self.selection.select("withTimestamps");
9314        query = query.arg("timestamp", timestamp);
9315        File {
9316            proc: self.proc.clone(),
9317            selection: query,
9318            graphql_client: self.graphql_client.clone(),
9319        }
9320    }
9321    /// Change the owner of the file recursively.
9322    ///
9323    /// # Arguments
9324    ///
9325    /// * `owner` - A user:group to set for the file.
9326    ///
9327    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
9328    ///
9329    /// If the group is omitted, it defaults to the same as the user.
9330    pub fn chown(&self, owner: impl Into<String>) -> File {
9331        let mut query = self.selection.select("chown");
9332        query = query.arg("owner", owner.into());
9333        File {
9334            proc: self.proc.clone(),
9335            selection: query,
9336            graphql_client: self.graphql_client.clone(),
9337        }
9338    }
9339    /// Interpret this file as a Git bundle by lazily parsing its header.
9340    pub fn as_git_bundle(&self) -> GitBundle {
9341        let query = self.selection.select("asGitBundle");
9342        GitBundle {
9343            proc: self.proc.clone(),
9344            selection: query,
9345            graphql_client: self.graphql_client.clone(),
9346        }
9347    }
9348    /// Parse the file contents as JSON.
9349    pub fn as_json(&self) -> JsonValue {
9350        let query = self.selection.select("asJSON");
9351        JsonValue {
9352            proc: self.proc.clone(),
9353            selection: query,
9354            graphql_client: self.graphql_client.clone(),
9355        }
9356    }
9357    /// Parse as an env file
9358    ///
9359    /// # Arguments
9360    ///
9361    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9362    pub fn as_env_file(&self) -> EnvFile {
9363        let query = self.selection.select("asEnvFile");
9364        EnvFile {
9365            proc: self.proc.clone(),
9366            selection: query,
9367            graphql_client: self.graphql_client.clone(),
9368        }
9369    }
9370    /// Parse as an env file
9371    ///
9372    /// # Arguments
9373    ///
9374    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9375    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9376        let mut query = self.selection.select("asEnvFile");
9377        if let Some(expand) = opts.expand {
9378            query = query.arg("expand", expand);
9379        }
9380        EnvFile {
9381            proc: self.proc.clone(),
9382            selection: query,
9383            graphql_client: self.graphql_client.clone(),
9384        }
9385    }
9386}
9387impl Exportable for File {
9388    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9389        let query = self.selection.select("id");
9390        let graphql_client = self.graphql_client.clone();
9391        async move { query.execute(graphql_client).await }
9392    }
9393    fn export(
9394        &self,
9395        path: impl Into<String>,
9396    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9397        let mut query = self.selection.select("export");
9398        query = query.arg("path", path.into());
9399        let graphql_client = self.graphql_client.clone();
9400        async move { query.execute(graphql_client).await }
9401    }
9402}
9403impl Node for File {
9404    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9405        let query = self.selection.select("id");
9406        let graphql_client = self.graphql_client.clone();
9407        async move { query.execute(graphql_client).await }
9408    }
9409}
9410impl Syncer for File {
9411    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9412        let query = self.selection.select("id");
9413        let graphql_client = self.graphql_client.clone();
9414        async move { query.execute(graphql_client).await }
9415    }
9416    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
9417        let query = self.selection.select("sync");
9418        let proc = self.proc.clone();
9419        let graphql_client = self.graphql_client.clone();
9420        async move {
9421            let id: Id = query.execute(graphql_client.clone()).await?;
9422            Ok(Self {
9423                proc,
9424                selection: query
9425                    .root()
9426                    .select("node")
9427                    .arg("id", &id.0)
9428                    .inline_fragment("File"),
9429                graphql_client,
9430            })
9431        }
9432    }
9433}
9434#[derive(Clone)]
9435pub struct Function {
9436    pub proc: Option<Arc<DaggerSessionProc>>,
9437    pub selection: Selection,
9438    pub graphql_client: DynGraphQLClient,
9439}
9440#[derive(Builder, Debug, PartialEq)]
9441pub struct FunctionWithDeprecatedOpts<'a> {
9442    /// Reason or migration path describing the deprecation.
9443    #[builder(setter(into, strip_option), default)]
9444    pub reason: Option<&'a str>,
9445}
9446#[derive(Builder, Debug, PartialEq)]
9447pub struct FunctionWithArgOpts<'a> {
9448    #[builder(setter(into, strip_option), default)]
9449    pub default_address: Option<&'a str>,
9450    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9451    #[builder(setter(into, strip_option), default)]
9452    pub default_path: Option<&'a str>,
9453    /// A default value to use for this argument if not explicitly set by the caller, if any
9454    #[builder(setter(into, strip_option), default)]
9455    pub default_value: Option<Json>,
9456    /// If deprecated, the reason or migration path.
9457    #[builder(setter(into, strip_option), default)]
9458    pub deprecated: Option<&'a str>,
9459    /// A doc string for the argument, if any
9460    #[builder(setter(into, strip_option), default)]
9461    pub description: Option<&'a str>,
9462    /// Patterns to ignore when loading the contextual argument value.
9463    #[builder(setter(into, strip_option), default)]
9464    pub ignore: Option<Vec<&'a str>>,
9465    /// The source map for the argument definition.
9466    #[builder(setter(into, strip_option), default)]
9467    pub source_map: Option<Id>,
9468}
9469#[derive(Builder, Debug, PartialEq)]
9470pub struct FunctionWithCachePolicyOpts<'a> {
9471    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9472    #[builder(setter(into, strip_option), default)]
9473    pub time_to_live: Option<&'a str>,
9474}
9475impl IntoID<Id> for Function {
9476    fn into_id(
9477        self,
9478    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9479        Box::pin(async move { self.id().await })
9480    }
9481}
9482impl Loadable for Function {
9483    fn graphql_type() -> &'static str {
9484        "Function"
9485    }
9486    fn from_query(
9487        proc: Option<Arc<DaggerSessionProc>>,
9488        selection: Selection,
9489        graphql_client: DynGraphQLClient,
9490    ) -> Self {
9491        Self {
9492            proc,
9493            selection,
9494            graphql_client,
9495        }
9496    }
9497}
9498impl Function {
9499    /// A unique identifier for this Function.
9500    pub async fn id(&self) -> Result<Id, DaggerError> {
9501        let query = self.selection.select("id");
9502        query.execute(self.graphql_client.clone()).await
9503    }
9504    /// Returns the function with the given doc string.
9505    ///
9506    /// # Arguments
9507    ///
9508    /// * `description` - The doc string to set.
9509    pub fn with_description(&self, description: impl Into<String>) -> Function {
9510        let mut query = self.selection.select("withDescription");
9511        query = query.arg("description", description.into());
9512        Function {
9513            proc: self.proc.clone(),
9514            selection: query,
9515            graphql_client: self.graphql_client.clone(),
9516        }
9517    }
9518    /// Returns the function with the provided deprecation reason.
9519    ///
9520    /// # Arguments
9521    ///
9522    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9523    pub fn with_deprecated(&self) -> Function {
9524        let query = self.selection.select("withDeprecated");
9525        Function {
9526            proc: self.proc.clone(),
9527            selection: query,
9528            graphql_client: self.graphql_client.clone(),
9529        }
9530    }
9531    /// Returns the function with the provided deprecation reason.
9532    ///
9533    /// # Arguments
9534    ///
9535    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9536    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9537        let mut query = self.selection.select("withDeprecated");
9538        if let Some(reason) = opts.reason {
9539            query = query.arg("reason", reason);
9540        }
9541        Function {
9542            proc: self.proc.clone(),
9543            selection: query,
9544            graphql_client: self.graphql_client.clone(),
9545        }
9546    }
9547    /// Returns the function with a flag indicating it's a check.
9548    pub fn with_check(&self) -> Function {
9549        let query = self.selection.select("withCheck");
9550        Function {
9551            proc: self.proc.clone(),
9552            selection: query,
9553            graphql_client: self.graphql_client.clone(),
9554        }
9555    }
9556    /// Returns the function with a flag indicating it's a generator.
9557    pub fn with_generator(&self) -> Function {
9558        let query = self.selection.select("withGenerator");
9559        Function {
9560            proc: self.proc.clone(),
9561            selection: query,
9562            graphql_client: self.graphql_client.clone(),
9563        }
9564    }
9565    /// Returns the function with a flag indicating it returns a service for dagger up.
9566    pub fn with_up(&self) -> Function {
9567        let query = self.selection.select("withUp");
9568        Function {
9569            proc: self.proc.clone(),
9570            selection: query,
9571            graphql_client: self.graphql_client.clone(),
9572        }
9573    }
9574    /// Returns the function with a flag indicating it is a source of expertise.
9575    pub fn with_agent(&self) -> Function {
9576        let query = self.selection.select("withAgent");
9577        Function {
9578            proc: self.proc.clone(),
9579            selection: query,
9580            graphql_client: self.graphql_client.clone(),
9581        }
9582    }
9583    /// Returns the function with the given source map.
9584    ///
9585    /// # Arguments
9586    ///
9587    /// * `source_map` - The source map for the function definition.
9588    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9589        let mut query = self.selection.select("withSourceMap");
9590        query = query.arg_lazy(
9591            "sourceMap",
9592            Box::new(move || {
9593                let source_map = source_map.clone();
9594                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9595            }),
9596        );
9597        Function {
9598            proc: self.proc.clone(),
9599            selection: query,
9600            graphql_client: self.graphql_client.clone(),
9601        }
9602    }
9603    /// Returns the function with the provided argument
9604    ///
9605    /// # Arguments
9606    ///
9607    /// * `name` - The name of the argument
9608    /// * `type_def` - The type of the argument
9609    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9610    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9611        let mut query = self.selection.select("withArg");
9612        query = query.arg("name", name.into());
9613        query = query.arg_lazy(
9614            "typeDef",
9615            Box::new(move || {
9616                let type_def = type_def.clone();
9617                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9618            }),
9619        );
9620        Function {
9621            proc: self.proc.clone(),
9622            selection: query,
9623            graphql_client: self.graphql_client.clone(),
9624        }
9625    }
9626    /// Returns the function with the provided argument
9627    ///
9628    /// # Arguments
9629    ///
9630    /// * `name` - The name of the argument
9631    /// * `type_def` - The type of the argument
9632    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9633    pub fn with_arg_opts<'a>(
9634        &self,
9635        name: impl Into<String>,
9636        type_def: impl IntoID<Id>,
9637        opts: FunctionWithArgOpts<'a>,
9638    ) -> Function {
9639        let mut query = self.selection.select("withArg");
9640        query = query.arg("name", name.into());
9641        query = query.arg_lazy(
9642            "typeDef",
9643            Box::new(move || {
9644                let type_def = type_def.clone();
9645                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9646            }),
9647        );
9648        if let Some(description) = opts.description {
9649            query = query.arg("description", description);
9650        }
9651        if let Some(default_value) = opts.default_value {
9652            query = query.arg("defaultValue", default_value);
9653        }
9654        if let Some(default_path) = opts.default_path {
9655            query = query.arg("defaultPath", default_path);
9656        }
9657        if let Some(ignore) = opts.ignore {
9658            query = query.arg("ignore", ignore);
9659        }
9660        if let Some(source_map) = opts.source_map {
9661            query = query.arg("sourceMap", source_map);
9662        }
9663        if let Some(deprecated) = opts.deprecated {
9664            query = query.arg("deprecated", deprecated);
9665        }
9666        if let Some(default_address) = opts.default_address {
9667            query = query.arg("defaultAddress", default_address);
9668        }
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(&self, policy: FunctionCachePolicy) -> Function {
9682        let mut query = self.selection.select("withCachePolicy");
9683        query = query.arg("policy", policy);
9684        Function {
9685            proc: self.proc.clone(),
9686            selection: query,
9687            graphql_client: self.graphql_client.clone(),
9688        }
9689    }
9690    /// Returns the function updated to use the provided cache policy.
9691    ///
9692    /// # Arguments
9693    ///
9694    /// * `policy` - The cache policy to use.
9695    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9696    pub fn with_cache_policy_opts<'a>(
9697        &self,
9698        policy: FunctionCachePolicy,
9699        opts: FunctionWithCachePolicyOpts<'a>,
9700    ) -> Function {
9701        let mut query = self.selection.select("withCachePolicy");
9702        query = query.arg("policy", policy);
9703        if let Some(time_to_live) = opts.time_to_live {
9704            query = query.arg("timeToLive", time_to_live);
9705        }
9706        Function {
9707            proc: self.proc.clone(),
9708            selection: query,
9709            graphql_client: self.graphql_client.clone(),
9710        }
9711    }
9712    /// The name of the function.
9713    pub async fn name(&self) -> Result<String, DaggerError> {
9714        let query = self.selection.select("name");
9715        query.execute(self.graphql_client.clone()).await
9716    }
9717    /// A doc string for the function, if any.
9718    pub async fn description(&self) -> Result<String, DaggerError> {
9719        let query = self.selection.select("description");
9720        query.execute(self.graphql_client.clone()).await
9721    }
9722    /// The reason this function is deprecated, if any.
9723    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9724        let query = self.selection.select("deprecated");
9725        query.execute(self.graphql_client.clone()).await
9726    }
9727    /// The location of this function declaration.
9728    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9729        let query = self.selection.select("sourceMap");
9730        let query = query.select("id");
9731        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9732        Ok(id.map(|id| SourceMap {
9733            proc: self.proc.clone(),
9734            selection: query
9735                .root()
9736                .select("node")
9737                .arg("id", &id.0)
9738                .inline_fragment("SourceMap"),
9739            graphql_client: self.graphql_client.clone(),
9740        }))
9741    }
9742    /// If this function is provided by a module, the name of the module. Unset otherwise.
9743    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9744        let query = self.selection.select("sourceModuleName");
9745        query.execute(self.graphql_client.clone()).await
9746    }
9747    /// Arguments accepted by the function, if any.
9748    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9749        let query = self.selection.select("args");
9750        let query = query.select("id");
9751        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9752        Ok(ids
9753            .into_iter()
9754            .map(|id| FunctionArg {
9755                proc: self.proc.clone(),
9756                selection: crate::querybuilder::query()
9757                    .select("node")
9758                    .arg("id", &id.0)
9759                    .inline_fragment("FunctionArg"),
9760                graphql_client: self.graphql_client.clone(),
9761            })
9762            .collect())
9763    }
9764    /// The type returned by the function.
9765    pub fn return_type(&self) -> TypeDef {
9766        let query = self.selection.select("returnType");
9767        TypeDef {
9768            proc: self.proc.clone(),
9769            selection: query,
9770            graphql_client: self.graphql_client.clone(),
9771        }
9772    }
9773}
9774impl Node for Function {
9775    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9776        let query = self.selection.select("id");
9777        let graphql_client = self.graphql_client.clone();
9778        async move { query.execute(graphql_client).await }
9779    }
9780}
9781#[derive(Clone)]
9782pub struct FunctionArg {
9783    pub proc: Option<Arc<DaggerSessionProc>>,
9784    pub selection: Selection,
9785    pub graphql_client: DynGraphQLClient,
9786}
9787impl IntoID<Id> for FunctionArg {
9788    fn into_id(
9789        self,
9790    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9791        Box::pin(async move { self.id().await })
9792    }
9793}
9794impl Loadable for FunctionArg {
9795    fn graphql_type() -> &'static str {
9796        "FunctionArg"
9797    }
9798    fn from_query(
9799        proc: Option<Arc<DaggerSessionProc>>,
9800        selection: Selection,
9801        graphql_client: DynGraphQLClient,
9802    ) -> Self {
9803        Self {
9804            proc,
9805            selection,
9806            graphql_client,
9807        }
9808    }
9809}
9810impl FunctionArg {
9811    /// A unique identifier for this FunctionArg.
9812    pub async fn id(&self) -> Result<Id, DaggerError> {
9813        let query = self.selection.select("id");
9814        query.execute(self.graphql_client.clone()).await
9815    }
9816    /// The name of the argument in lowerCamelCase format.
9817    pub async fn name(&self) -> Result<String, DaggerError> {
9818        let query = self.selection.select("name");
9819        query.execute(self.graphql_client.clone()).await
9820    }
9821    /// A doc string for the argument, if any.
9822    pub async fn description(&self) -> Result<String, DaggerError> {
9823        let query = self.selection.select("description");
9824        query.execute(self.graphql_client.clone()).await
9825    }
9826    /// The location of this arg declaration.
9827    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9828        let query = self.selection.select("sourceMap");
9829        let query = query.select("id");
9830        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9831        Ok(id.map(|id| SourceMap {
9832            proc: self.proc.clone(),
9833            selection: query
9834                .root()
9835                .select("node")
9836                .arg("id", &id.0)
9837                .inline_fragment("SourceMap"),
9838            graphql_client: self.graphql_client.clone(),
9839        }))
9840    }
9841    /// A default value to use for this argument when not explicitly set by the caller, if any.
9842    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9843        let query = self.selection.select("defaultValue");
9844        query.execute(self.graphql_client.clone()).await
9845    }
9846    /// 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
9847    pub async fn default_path(&self) -> Result<String, DaggerError> {
9848        let query = self.selection.select("defaultPath");
9849        query.execute(self.graphql_client.clone()).await
9850    }
9851    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9852    pub async fn default_address(&self) -> Result<String, DaggerError> {
9853        let query = self.selection.select("defaultAddress");
9854        query.execute(self.graphql_client.clone()).await
9855    }
9856    /// 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.
9857    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9858        let query = self.selection.select("ignore");
9859        query.execute(self.graphql_client.clone()).await
9860    }
9861    /// The reason this function is deprecated, if any.
9862    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9863        let query = self.selection.select("deprecated");
9864        query.execute(self.graphql_client.clone()).await
9865    }
9866    /// The type of the argument.
9867    pub fn type_def(&self) -> TypeDef {
9868        let query = self.selection.select("typeDef");
9869        TypeDef {
9870            proc: self.proc.clone(),
9871            selection: query,
9872            graphql_client: self.graphql_client.clone(),
9873        }
9874    }
9875}
9876impl Node for FunctionArg {
9877    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9878        let query = self.selection.select("id");
9879        let graphql_client = self.graphql_client.clone();
9880        async move { query.execute(graphql_client).await }
9881    }
9882}
9883#[derive(Clone)]
9884pub struct FunctionCall {
9885    pub proc: Option<Arc<DaggerSessionProc>>,
9886    pub selection: Selection,
9887    pub graphql_client: DynGraphQLClient,
9888}
9889impl IntoID<Id> for FunctionCall {
9890    fn into_id(
9891        self,
9892    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9893        Box::pin(async move { self.id().await })
9894    }
9895}
9896impl Loadable for FunctionCall {
9897    fn graphql_type() -> &'static str {
9898        "FunctionCall"
9899    }
9900    fn from_query(
9901        proc: Option<Arc<DaggerSessionProc>>,
9902        selection: Selection,
9903        graphql_client: DynGraphQLClient,
9904    ) -> Self {
9905        Self {
9906            proc,
9907            selection,
9908            graphql_client,
9909        }
9910    }
9911}
9912impl FunctionCall {
9913    /// A unique identifier for this FunctionCall.
9914    pub async fn id(&self) -> Result<Id, DaggerError> {
9915        let query = self.selection.select("id");
9916        query.execute(self.graphql_client.clone()).await
9917    }
9918    /// Set the return value of the function call to the provided value.
9919    ///
9920    /// # Arguments
9921    ///
9922    /// * `value` - JSON serialization of the return value.
9923    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9924        let mut query = self.selection.select("returnValue");
9925        query = query.arg("value", value);
9926        query.execute(self.graphql_client.clone()).await
9927    }
9928    /// Return an error from the function.
9929    ///
9930    /// # Arguments
9931    ///
9932    /// * `error` - The error to return.
9933    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9934        let mut query = self.selection.select("returnError");
9935        query = query.arg_lazy(
9936            "error",
9937            Box::new(move || {
9938                let error = error.clone();
9939                Box::pin(async move { error.into_id().await.unwrap().quote() })
9940            }),
9941        );
9942        query.execute(self.graphql_client.clone()).await
9943    }
9944    /// The name of the function being called.
9945    pub async fn name(&self) -> Result<String, DaggerError> {
9946        let query = self.selection.select("name");
9947        query.execute(self.graphql_client.clone()).await
9948    }
9949    /// 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.
9950    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9951        let query = self.selection.select("parentName");
9952        query.execute(self.graphql_client.clone()).await
9953    }
9954    /// 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.
9955    pub async fn parent(&self) -> Result<Json, DaggerError> {
9956        let query = self.selection.select("parent");
9957        query.execute(self.graphql_client.clone()).await
9958    }
9959    /// The argument values the function is being invoked with.
9960    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9961        let query = self.selection.select("inputArgs");
9962        let query = query.select("id");
9963        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9964        Ok(ids
9965            .into_iter()
9966            .map(|id| FunctionCallArgValue {
9967                proc: self.proc.clone(),
9968                selection: crate::querybuilder::query()
9969                    .select("node")
9970                    .arg("id", &id.0)
9971                    .inline_fragment("FunctionCallArgValue"),
9972                graphql_client: self.graphql_client.clone(),
9973            })
9974            .collect())
9975    }
9976}
9977impl Node for FunctionCall {
9978    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9979        let query = self.selection.select("id");
9980        let graphql_client = self.graphql_client.clone();
9981        async move { query.execute(graphql_client).await }
9982    }
9983}
9984#[derive(Clone)]
9985pub struct FunctionCallArgValue {
9986    pub proc: Option<Arc<DaggerSessionProc>>,
9987    pub selection: Selection,
9988    pub graphql_client: DynGraphQLClient,
9989}
9990impl IntoID<Id> for FunctionCallArgValue {
9991    fn into_id(
9992        self,
9993    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9994        Box::pin(async move { self.id().await })
9995    }
9996}
9997impl Loadable for FunctionCallArgValue {
9998    fn graphql_type() -> &'static str {
9999        "FunctionCallArgValue"
10000    }
10001    fn from_query(
10002        proc: Option<Arc<DaggerSessionProc>>,
10003        selection: Selection,
10004        graphql_client: DynGraphQLClient,
10005    ) -> Self {
10006        Self {
10007            proc,
10008            selection,
10009            graphql_client,
10010        }
10011    }
10012}
10013impl FunctionCallArgValue {
10014    /// A unique identifier for this FunctionCallArgValue.
10015    pub async fn id(&self) -> Result<Id, DaggerError> {
10016        let query = self.selection.select("id");
10017        query.execute(self.graphql_client.clone()).await
10018    }
10019    /// The name of the argument.
10020    pub async fn name(&self) -> Result<String, DaggerError> {
10021        let query = self.selection.select("name");
10022        query.execute(self.graphql_client.clone()).await
10023    }
10024    /// The value of the argument represented as a JSON serialized string.
10025    pub async fn value(&self) -> Result<Json, DaggerError> {
10026        let query = self.selection.select("value");
10027        query.execute(self.graphql_client.clone()).await
10028    }
10029}
10030impl Node for FunctionCallArgValue {
10031    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10032        let query = self.selection.select("id");
10033        let graphql_client = self.graphql_client.clone();
10034        async move { query.execute(graphql_client).await }
10035    }
10036}
10037#[derive(Clone)]
10038pub struct GeneratedCode {
10039    pub proc: Option<Arc<DaggerSessionProc>>,
10040    pub selection: Selection,
10041    pub graphql_client: DynGraphQLClient,
10042}
10043impl IntoID<Id> for GeneratedCode {
10044    fn into_id(
10045        self,
10046    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10047        Box::pin(async move { self.id().await })
10048    }
10049}
10050impl Loadable for GeneratedCode {
10051    fn graphql_type() -> &'static str {
10052        "GeneratedCode"
10053    }
10054    fn from_query(
10055        proc: Option<Arc<DaggerSessionProc>>,
10056        selection: Selection,
10057        graphql_client: DynGraphQLClient,
10058    ) -> Self {
10059        Self {
10060            proc,
10061            selection,
10062            graphql_client,
10063        }
10064    }
10065}
10066impl GeneratedCode {
10067    /// A unique identifier for this GeneratedCode.
10068    pub async fn id(&self) -> Result<Id, DaggerError> {
10069        let query = self.selection.select("id");
10070        query.execute(self.graphql_client.clone()).await
10071    }
10072    /// Set the list of paths to mark generated in version control.
10073    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10074        let mut query = self.selection.select("withVCSGeneratedPaths");
10075        query = query.arg(
10076            "paths",
10077            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10078        );
10079        GeneratedCode {
10080            proc: self.proc.clone(),
10081            selection: query,
10082            graphql_client: self.graphql_client.clone(),
10083        }
10084    }
10085    /// Set the list of paths to ignore in version control.
10086    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10087        let mut query = self.selection.select("withVCSIgnoredPaths");
10088        query = query.arg(
10089            "paths",
10090            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10091        );
10092        GeneratedCode {
10093            proc: self.proc.clone(),
10094            selection: query,
10095            graphql_client: self.graphql_client.clone(),
10096        }
10097    }
10098    /// The directory containing the generated code.
10099    pub fn code(&self) -> Directory {
10100        let query = self.selection.select("code");
10101        Directory {
10102            proc: self.proc.clone(),
10103            selection: query,
10104            graphql_client: self.graphql_client.clone(),
10105        }
10106    }
10107    /// List of paths to mark generated in version control (i.e. .gitattributes).
10108    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10109        let query = self.selection.select("vcsGeneratedPaths");
10110        query.execute(self.graphql_client.clone()).await
10111    }
10112    /// List of paths to ignore in version control (i.e. .gitignore).
10113    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10114        let query = self.selection.select("vcsIgnoredPaths");
10115        query.execute(self.graphql_client.clone()).await
10116    }
10117}
10118impl Node for GeneratedCode {
10119    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10120        let query = self.selection.select("id");
10121        let graphql_client = self.graphql_client.clone();
10122        async move { query.execute(graphql_client).await }
10123    }
10124}
10125#[derive(Clone)]
10126pub struct Generator {
10127    pub proc: Option<Arc<DaggerSessionProc>>,
10128    pub selection: Selection,
10129    pub graphql_client: DynGraphQLClient,
10130}
10131impl IntoID<Id> for Generator {
10132    fn into_id(
10133        self,
10134    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10135        Box::pin(async move { self.id().await })
10136    }
10137}
10138impl Loadable for Generator {
10139    fn graphql_type() -> &'static str {
10140        "Generator"
10141    }
10142    fn from_query(
10143        proc: Option<Arc<DaggerSessionProc>>,
10144        selection: Selection,
10145        graphql_client: DynGraphQLClient,
10146    ) -> Self {
10147        Self {
10148            proc,
10149            selection,
10150            graphql_client,
10151        }
10152    }
10153}
10154impl Generator {
10155    /// A unique identifier for this Generator.
10156    pub async fn id(&self) -> Result<Id, DaggerError> {
10157        let query = self.selection.select("id");
10158        query.execute(self.graphql_client.clone()).await
10159    }
10160    /// Run the generator and return its changes.
10161    pub fn changeset(&self) -> Changeset {
10162        let query = self.selection.select("changeset");
10163        Changeset {
10164            proc: self.proc.clone(),
10165            selection: query,
10166            graphql_client: self.graphql_client.clone(),
10167        }
10168    }
10169    /// Run the generator and retain its result.
10170    pub fn sync(&self) -> Generator {
10171        let query = self.selection.select("sync");
10172        Generator {
10173            proc: self.proc.clone(),
10174            selection: query,
10175            graphql_client: self.graphql_client.clone(),
10176        }
10177    }
10178    /// A check that passes when this generator would produce no changes.
10179    pub fn stale(&self) -> Check {
10180        let query = self.selection.select("stale");
10181        Check {
10182            proc: self.proc.clone(),
10183            selection: query,
10184            graphql_client: self.graphql_client.clone(),
10185        }
10186    }
10187}
10188impl Node for Generator {
10189    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10190        let query = self.selection.select("id");
10191        let graphql_client = self.graphql_client.clone();
10192        async move { query.execute(graphql_client).await }
10193    }
10194}
10195#[derive(Clone)]
10196pub struct GitBundle {
10197    pub proc: Option<Arc<DaggerSessionProc>>,
10198    pub selection: Selection,
10199    pub graphql_client: DynGraphQLClient,
10200}
10201impl IntoID<Id> for GitBundle {
10202    fn into_id(
10203        self,
10204    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10205        Box::pin(async move { self.id().await })
10206    }
10207}
10208impl Loadable for GitBundle {
10209    fn graphql_type() -> &'static str {
10210        "GitBundle"
10211    }
10212    fn from_query(
10213        proc: Option<Arc<DaggerSessionProc>>,
10214        selection: Selection,
10215        graphql_client: DynGraphQLClient,
10216    ) -> Self {
10217        Self {
10218            proc,
10219            selection,
10220            graphql_client,
10221        }
10222    }
10223}
10224impl GitBundle {
10225    /// A unique identifier for this GitBundle.
10226    pub async fn id(&self) -> Result<Id, DaggerError> {
10227        let query = self.selection.select("id");
10228        query.execute(self.graphql_client.clone()).await
10229    }
10230    /// Perform full structural verification of the bundle and error if it is malformed.
10231    pub fn validate(&self) -> GitBundle {
10232        let query = self.selection.select("validate");
10233        GitBundle {
10234            proc: self.proc.clone(),
10235            selection: query,
10236            graphql_client: self.graphql_client.clone(),
10237        }
10238    }
10239    /// Return the bundle bytes as a File.
10240    pub fn as_file(&self) -> File {
10241        let query = self.selection.select("asFile");
10242        File {
10243            proc: self.proc.clone(),
10244            selection: query,
10245            graphql_client: self.graphql_client.clone(),
10246        }
10247    }
10248    /// Bundle format version (2 or 3).
10249    pub async fn version(&self) -> Result<isize, DaggerError> {
10250        let query = self.selection.select("version");
10251        query.execute(self.graphql_client.clone()).await
10252    }
10253    /// Object format capability: sha1 or sha256.
10254    pub async fn object_format(&self) -> Result<String, DaggerError> {
10255        let query = self.selection.select("objectFormat");
10256        query.execute(self.graphql_client.clone()).await
10257    }
10258    /// Refs advertised by the bundle and the object IDs they resolve to.
10259    pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
10260        let query = self.selection.select("refs");
10261        let query = query.select("id");
10262        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10263        Ok(ids
10264            .into_iter()
10265            .map(|id| GitBundleRef {
10266                proc: self.proc.clone(),
10267                selection: crate::querybuilder::query()
10268                    .select("node")
10269                    .arg("id", &id.0)
10270                    .inline_fragment("GitBundleRef"),
10271                graphql_client: self.graphql_client.clone(),
10272            })
10273            .collect())
10274    }
10275    /// Commits that must already exist wherever this bundle is applied.
10276    pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
10277        let query = self.selection.select("prerequisiteSHAs");
10278        query.execute(self.graphql_client.clone()).await
10279    }
10280}
10281impl Node for GitBundle {
10282    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10283        let query = self.selection.select("id");
10284        let graphql_client = self.graphql_client.clone();
10285        async move { query.execute(graphql_client).await }
10286    }
10287}
10288#[derive(Clone)]
10289pub struct GitBundleRef {
10290    pub proc: Option<Arc<DaggerSessionProc>>,
10291    pub selection: Selection,
10292    pub graphql_client: DynGraphQLClient,
10293}
10294impl IntoID<Id> for GitBundleRef {
10295    fn into_id(
10296        self,
10297    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10298        Box::pin(async move { self.id().await })
10299    }
10300}
10301impl Loadable for GitBundleRef {
10302    fn graphql_type() -> &'static str {
10303        "GitBundleRef"
10304    }
10305    fn from_query(
10306        proc: Option<Arc<DaggerSessionProc>>,
10307        selection: Selection,
10308        graphql_client: DynGraphQLClient,
10309    ) -> Self {
10310        Self {
10311            proc,
10312            selection,
10313            graphql_client,
10314        }
10315    }
10316}
10317impl GitBundleRef {
10318    /// A unique identifier for this GitBundleRef.
10319    pub async fn id(&self) -> Result<Id, DaggerError> {
10320        let query = self.selection.select("id");
10321        query.execute(self.graphql_client.clone()).await
10322    }
10323    /// The advertised ref name.
10324    pub async fn name(&self) -> Result<String, DaggerError> {
10325        let query = self.selection.select("name");
10326        query.execute(self.graphql_client.clone()).await
10327    }
10328    /// The object ID the advertised ref resolves to.
10329    pub async fn sha(&self) -> Result<String, DaggerError> {
10330        let query = self.selection.select("sha");
10331        query.execute(self.graphql_client.clone()).await
10332    }
10333}
10334impl Node for GitBundleRef {
10335    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10336        let query = self.selection.select("id");
10337        let graphql_client = self.graphql_client.clone();
10338        async move { query.execute(graphql_client).await }
10339    }
10340}
10341#[derive(Clone)]
10342pub struct GitCommit {
10343    pub proc: Option<Arc<DaggerSessionProc>>,
10344    pub selection: Selection,
10345    pub graphql_client: DynGraphQLClient,
10346}
10347#[derive(Builder, Debug, PartialEq)]
10348pub struct GitCommitReleaseTagOpts {
10349    /// Include pre-release tags when choosing the latest tag.
10350    #[builder(setter(into, strip_option), default)]
10351    pub include_pre_release: Option<bool>,
10352}
10353#[derive(Builder, Debug, PartialEq)]
10354pub struct GitCommitAncestorReleaseTagOpts {
10355    /// Include pre-release tags when choosing the latest tag.
10356    #[builder(setter(into, strip_option), default)]
10357    pub include_pre_release: Option<bool>,
10358}
10359#[derive(Builder, Debug, PartialEq)]
10360pub struct GitCommitTreeOpts {
10361    /// The depth of the tree to fetch.
10362    #[builder(setter(into, strip_option), default)]
10363    pub depth: Option<isize>,
10364    /// Set to true to discard .git directory.
10365    #[builder(setter(into, strip_option), default)]
10366    pub discard_git_dir: Option<bool>,
10367    /// Set to true to populate tag refs in the local checkout .git.
10368    #[builder(setter(into, strip_option), default)]
10369    pub include_tags: Option<bool>,
10370}
10371#[derive(Builder, Debug, PartialEq)]
10372pub struct GitCommitChangesOpts {
10373    /// Use this commit as the comparison base instead of the first parent. The comparison commit may belong to an unrelated history or repository.
10374    #[builder(setter(into, strip_option), default)]
10375    pub against: Option<Id>,
10376}
10377impl IntoID<Id> for GitCommit {
10378    fn into_id(
10379        self,
10380    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10381        Box::pin(async move { self.id().await })
10382    }
10383}
10384impl Loadable for GitCommit {
10385    fn graphql_type() -> &'static str {
10386        "GitCommit"
10387    }
10388    fn from_query(
10389        proc: Option<Arc<DaggerSessionProc>>,
10390        selection: Selection,
10391        graphql_client: DynGraphQLClient,
10392    ) -> Self {
10393        Self {
10394            proc,
10395            selection,
10396            graphql_client,
10397        }
10398    }
10399}
10400impl GitCommit {
10401    /// A unique identifier for this GitCommit.
10402    pub async fn id(&self) -> Result<Id, DaggerError> {
10403        let query = self.selection.select("id");
10404        query.execute(self.graphql_client.clone()).await
10405    }
10406    /// The latest semver release tag that points directly at this commit.
10407    ///
10408    /// # Arguments
10409    ///
10410    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10411    pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10412        let query = self.selection.select("releaseTag");
10413        let query = query.select("id");
10414        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10415        Ok(id.map(|id| GitRef {
10416            proc: self.proc.clone(),
10417            selection: query
10418                .root()
10419                .select("node")
10420                .arg("id", &id.0)
10421                .inline_fragment("GitRef"),
10422            graphql_client: self.graphql_client.clone(),
10423        }))
10424    }
10425    /// The latest semver release tag that points directly at this commit.
10426    ///
10427    /// # Arguments
10428    ///
10429    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10430    pub async fn release_tag_opts(
10431        &self,
10432        opts: GitCommitReleaseTagOpts,
10433    ) -> Result<Option<GitRef>, DaggerError> {
10434        let mut query = self.selection.select("releaseTag");
10435        if let Some(include_pre_release) = opts.include_pre_release {
10436            query = query.arg("includePreRelease", include_pre_release);
10437        }
10438        let query = query.select("id");
10439        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10440        Ok(id.map(|id| GitRef {
10441            proc: self.proc.clone(),
10442            selection: query
10443                .root()
10444                .select("node")
10445                .arg("id", &id.0)
10446                .inline_fragment("GitRef"),
10447            graphql_client: self.graphql_client.clone(),
10448        }))
10449    }
10450    /// The latest semver release tag reachable from this commit.
10451    ///
10452    /// # Arguments
10453    ///
10454    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10455    pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10456        let query = self.selection.select("ancestorReleaseTag");
10457        let query = query.select("id");
10458        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10459        Ok(id.map(|id| GitRef {
10460            proc: self.proc.clone(),
10461            selection: query
10462                .root()
10463                .select("node")
10464                .arg("id", &id.0)
10465                .inline_fragment("GitRef"),
10466            graphql_client: self.graphql_client.clone(),
10467        }))
10468    }
10469    /// The latest semver release tag reachable from this commit.
10470    ///
10471    /// # Arguments
10472    ///
10473    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10474    pub async fn ancestor_release_tag_opts(
10475        &self,
10476        opts: GitCommitAncestorReleaseTagOpts,
10477    ) -> Result<Option<GitRef>, DaggerError> {
10478        let mut query = self.selection.select("ancestorReleaseTag");
10479        if let Some(include_pre_release) = opts.include_pre_release {
10480            query = query.arg("includePreRelease", include_pre_release);
10481        }
10482        let query = query.select("id");
10483        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10484        Ok(id.map(|id| GitRef {
10485            proc: self.proc.clone(),
10486            selection: query
10487                .root()
10488                .select("node")
10489                .arg("id", &id.0)
10490                .inline_fragment("GitRef"),
10491            graphql_client: self.graphql_client.clone(),
10492        }))
10493    }
10494    /// The filesystem tree at this commit.
10495    ///
10496    /// # Arguments
10497    ///
10498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10499    pub fn tree(&self) -> Directory {
10500        let query = self.selection.select("tree");
10501        Directory {
10502            proc: self.proc.clone(),
10503            selection: query,
10504            graphql_client: self.graphql_client.clone(),
10505        }
10506    }
10507    /// The filesystem tree at this commit.
10508    ///
10509    /// # Arguments
10510    ///
10511    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10512    pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
10513        let mut query = self.selection.select("tree");
10514        if let Some(discard_git_dir) = opts.discard_git_dir {
10515            query = query.arg("discardGitDir", discard_git_dir);
10516        }
10517        if let Some(depth) = opts.depth {
10518            query = query.arg("depth", depth);
10519        }
10520        if let Some(include_tags) = opts.include_tags {
10521            query = query.arg("includeTags", include_tags);
10522        }
10523        Directory {
10524            proc: self.proc.clone(),
10525            selection: query,
10526            graphql_client: self.graphql_client.clone(),
10527        }
10528    }
10529    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10530    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10531    ///
10532    /// # Arguments
10533    ///
10534    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10535    pub fn changes(&self) -> Changeset {
10536        let query = self.selection.select("changes");
10537        Changeset {
10538            proc: self.proc.clone(),
10539            selection: query,
10540            graphql_client: self.graphql_client.clone(),
10541        }
10542    }
10543    /// Returns the changes from the first parent to this commit, excluding Git metadata.
10544    /// Root commits are compared with an empty tree. Merge commits are compared with their first parent, not a merge base.
10545    ///
10546    /// # Arguments
10547    ///
10548    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10549    pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
10550        let mut query = self.selection.select("changes");
10551        if let Some(against) = opts.against {
10552            query = query.arg("against", against);
10553        }
10554        Changeset {
10555            proc: self.proc.clone(),
10556            selection: query,
10557            graphql_client: self.graphql_client.clone(),
10558        }
10559    }
10560    /// The full commit SHA.
10561    pub async fn sha(&self) -> Result<String, DaggerError> {
10562        let query = self.selection.select("sha");
10563        query.execute(self.graphql_client.clone()).await
10564    }
10565    /// The abbreviated commit SHA.
10566    pub async fn short_sha(&self) -> Result<String, DaggerError> {
10567        let query = self.selection.select("shortSha");
10568        query.execute(self.graphql_client.clone()).await
10569    }
10570    /// Git author date, in RFC3339 format.
10571    pub async fn authored_date(&self) -> Result<String, DaggerError> {
10572        let query = self.selection.select("authoredDate");
10573        query.execute(self.graphql_client.clone()).await
10574    }
10575    /// Git committer date, in RFC3339 format.
10576    pub async fn committed_date(&self) -> Result<String, DaggerError> {
10577        let query = self.selection.select("committedDate");
10578        query.execute(self.graphql_client.clone()).await
10579    }
10580    /// Git author name.
10581    pub async fn author_name(&self) -> Result<String, DaggerError> {
10582        let query = self.selection.select("authorName");
10583        query.execute(self.graphql_client.clone()).await
10584    }
10585    /// Git author email.
10586    pub async fn author_email(&self) -> Result<String, DaggerError> {
10587        let query = self.selection.select("authorEmail");
10588        query.execute(self.graphql_client.clone()).await
10589    }
10590    /// Git committer name.
10591    pub async fn committer_name(&self) -> Result<String, DaggerError> {
10592        let query = self.selection.select("committerName");
10593        query.execute(self.graphql_client.clone()).await
10594    }
10595    /// Git committer email.
10596    pub async fn committer_email(&self) -> Result<String, DaggerError> {
10597        let query = self.selection.select("committerEmail");
10598        query.execute(self.graphql_client.clone()).await
10599    }
10600    /// Full commit message.
10601    pub async fn message(&self) -> Result<String, DaggerError> {
10602        let query = self.selection.select("message");
10603        query.execute(self.graphql_client.clone()).await
10604    }
10605    /// First line of the commit message.
10606    pub async fn message_headline(&self) -> Result<String, DaggerError> {
10607        let query = self.selection.select("messageHeadline");
10608        query.execute(self.graphql_client.clone()).await
10609    }
10610    /// Commit message body, excluding the headline.
10611    pub async fn message_body(&self) -> Result<String, DaggerError> {
10612        let query = self.selection.select("messageBody");
10613        query.execute(self.graphql_client.clone()).await
10614    }
10615    /// Parent commit SHAs.
10616    pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
10617        let query = self.selection.select("parentShas");
10618        query.execute(self.graphql_client.clone()).await
10619    }
10620}
10621impl Node for GitCommit {
10622    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10623        let query = self.selection.select("id");
10624        let graphql_client = self.graphql_client.clone();
10625        async move { query.execute(graphql_client).await }
10626    }
10627}
10628#[derive(Clone)]
10629pub struct GitPushResult {
10630    pub proc: Option<Arc<DaggerSessionProc>>,
10631    pub selection: Selection,
10632    pub graphql_client: DynGraphQLClient,
10633}
10634impl IntoID<Id> for GitPushResult {
10635    fn into_id(
10636        self,
10637    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10638        Box::pin(async move { self.id().await })
10639    }
10640}
10641impl Loadable for GitPushResult {
10642    fn graphql_type() -> &'static str {
10643        "GitPushResult"
10644    }
10645    fn from_query(
10646        proc: Option<Arc<DaggerSessionProc>>,
10647        selection: Selection,
10648        graphql_client: DynGraphQLClient,
10649    ) -> Self {
10650        Self {
10651            proc,
10652            selection,
10653            graphql_client,
10654        }
10655    }
10656}
10657impl GitPushResult {
10658    /// A unique identifier for this GitPushResult.
10659    pub async fn id(&self) -> Result<Id, DaggerError> {
10660        let query = self.selection.select("id");
10661        query.execute(self.graphql_client.clone()).await
10662    }
10663    /// The fully qualified remote ref.
10664    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10665        let query = self.selection.select("ref");
10666        query.execute(self.graphql_client.clone()).await
10667    }
10668    /// The previous remote object ID; empty when the ref was created.
10669    pub async fn previous_sha(&self) -> Result<String, DaggerError> {
10670        let query = self.selection.select("previousSHA");
10671        query.execute(self.graphql_client.clone()).await
10672    }
10673    /// The object ID pushed to the remote.
10674    pub async fn sha(&self) -> Result<String, DaggerError> {
10675        let query = self.selection.select("sha");
10676        query.execute(self.graphql_client.clone()).await
10677    }
10678    /// How the remote ref was updated.
10679    pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
10680        let query = self.selection.select("disposition");
10681        query.execute(self.graphql_client.clone()).await
10682    }
10683}
10684impl Node for GitPushResult {
10685    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10686        let query = self.selection.select("id");
10687        let graphql_client = self.graphql_client.clone();
10688        async move { query.execute(graphql_client).await }
10689    }
10690}
10691#[derive(Clone)]
10692pub struct GitRef {
10693    pub proc: Option<Arc<DaggerSessionProc>>,
10694    pub selection: Selection,
10695    pub graphql_client: DynGraphQLClient,
10696}
10697#[derive(Builder, Debug, PartialEq)]
10698pub struct GitRefPushOpts<'a> {
10699    /// Destination branch; a refs/ prefix is used verbatim. Defaults to this ref's branch name. Required for detached and non-branch refs.
10700    #[builder(setter(into, strip_option), default)]
10701    pub branch: Option<&'a str>,
10702    /// 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.
10703    #[builder(setter(into, strip_option), default)]
10704    pub expected_remote_sha: Option<&'a str>,
10705    /// 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.
10706    #[builder(setter(into, strip_option), default)]
10707    pub remote: Option<&'a str>,
10708    /// 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.
10709    #[builder(setter(into, strip_option), default)]
10710    pub to: Option<Id>,
10711}
10712#[derive(Builder, Debug, PartialEq)]
10713pub struct GitRefTreeOpts {
10714    /// The depth of the tree to fetch.
10715    #[builder(setter(into, strip_option), default)]
10716    pub depth: Option<isize>,
10717    /// Set to true to discard .git directory.
10718    #[builder(setter(into, strip_option), default)]
10719    pub discard_git_dir: Option<bool>,
10720    /// Set to true to populate tag refs in the local checkout .git.
10721    #[builder(setter(into, strip_option), default)]
10722    pub include_tags: Option<bool>,
10723}
10724#[derive(Builder, Debug, PartialEq)]
10725pub struct GitRefLogOpts<'a> {
10726    /// Exclude commits reachable from this ref, i.e. only list commits added on top of it.
10727    #[builder(setter(into, strip_option), default)]
10728    pub base: Option<Id>,
10729    /// Maximum number of commits to return.
10730    #[builder(setter(into, strip_option), default)]
10731    pub limit: Option<isize>,
10732    /// Only include commits touching these paths, relative to the root of the repository.
10733    #[builder(setter(into, strip_option), default)]
10734    pub paths: Option<Vec<&'a str>>,
10735}
10736#[derive(Builder, Debug, PartialEq)]
10737pub struct GitRefWithCommitOpts<'a> {
10738    /// Allow a commit whose tree matches its parent, including when the supplied edits are already present. Defaults to false.
10739    #[builder(setter(into, strip_option), default)]
10740    pub allow_empty: Option<bool>,
10741    /// RFC3339 committer date. Defaults to date.
10742    #[builder(setter(into, strip_option), default)]
10743    pub committer_date: Option<&'a str>,
10744    /// Committer email. Defaults to authorEmail.
10745    #[builder(setter(into, strip_option), default)]
10746    pub committer_email: Option<&'a str>,
10747    /// Committer name. Defaults to authorName.
10748    #[builder(setter(into, strip_option), default)]
10749    pub committer_name: Option<&'a str>,
10750    /// Add a Signed-off-by trailer using the commit author's name and email.
10751    #[builder(setter(into, strip_option), default)]
10752    pub signoff: Option<bool>,
10753}
10754#[derive(Builder, Debug, PartialEq)]
10755pub struct GitRefAsWorkspaceOpts<'a> {
10756    /// Current working directory inside the workspace root. Defaults to the workspace root.
10757    #[builder(setter(into, strip_option), default)]
10758    pub cwd: Option<&'a str>,
10759}
10760impl IntoID<Id> for GitRef {
10761    fn into_id(
10762        self,
10763    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10764        Box::pin(async move { self.id().await })
10765    }
10766}
10767impl Loadable for GitRef {
10768    fn graphql_type() -> &'static str {
10769        "GitRef"
10770    }
10771    fn from_query(
10772        proc: Option<Arc<DaggerSessionProc>>,
10773        selection: Selection,
10774        graphql_client: DynGraphQLClient,
10775    ) -> Self {
10776        Self {
10777            proc,
10778            selection,
10779            graphql_client,
10780        }
10781    }
10782}
10783impl GitRef {
10784    /// A unique identifier for this GitRef.
10785    pub async fn id(&self) -> Result<Id, DaggerError> {
10786        let query = self.selection.select("id");
10787        query.execute(self.graphql_client.clone()).await
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(&self) -> GitPushResult {
10797        let query = self.selection.select("push");
10798        GitPushResult {
10799            proc: self.proc.clone(),
10800            selection: query,
10801            graphql_client: self.graphql_client.clone(),
10802        }
10803    }
10804    /// Push this ref's commit and history to a remote repository using the destination's credentials.
10805    /// 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.
10806    /// 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.
10807    ///
10808    /// # Arguments
10809    ///
10810    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10811    pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
10812        let mut query = self.selection.select("push");
10813        if let Some(to) = opts.to {
10814            query = query.arg("to", to);
10815        }
10816        if let Some(remote) = opts.remote {
10817            query = query.arg("remote", remote);
10818        }
10819        if let Some(branch) = opts.branch {
10820            query = query.arg("branch", branch);
10821        }
10822        if let Some(expected_remote_sha) = opts.expected_remote_sha {
10823            query = query.arg("expectedRemoteSHA", expected_remote_sha);
10824        }
10825        GitPushResult {
10826            proc: self.proc.clone(),
10827            selection: query,
10828            graphql_client: self.graphql_client.clone(),
10829        }
10830    }
10831    /// The commit this ref resolves to.
10832    pub fn target_commit(&self) -> GitCommit {
10833        let query = self.selection.select("targetCommit");
10834        GitCommit {
10835            proc: self.proc.clone(),
10836            selection: query,
10837            graphql_client: self.graphql_client.clone(),
10838        }
10839    }
10840    /// The resolved commit SHA at this ref.
10841    pub async fn commit_sha(&self) -> Result<String, DaggerError> {
10842        let query = self.selection.select("commitSHA");
10843        query.execute(self.graphql_client.clone()).await
10844    }
10845    /// The filesystem tree at this ref.
10846    ///
10847    /// # Arguments
10848    ///
10849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10850    pub fn tree(&self) -> Directory {
10851        let query = self.selection.select("tree");
10852        Directory {
10853            proc: self.proc.clone(),
10854            selection: query,
10855            graphql_client: self.graphql_client.clone(),
10856        }
10857    }
10858    /// The filesystem tree at this ref.
10859    ///
10860    /// # Arguments
10861    ///
10862    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10863    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10864        let mut query = self.selection.select("tree");
10865        if let Some(discard_git_dir) = opts.discard_git_dir {
10866            query = query.arg("discardGitDir", discard_git_dir);
10867        }
10868        if let Some(depth) = opts.depth {
10869            query = query.arg("depth", depth);
10870        }
10871        if let Some(include_tags) = opts.include_tags {
10872            query = query.arg("includeTags", include_tags);
10873        }
10874        Directory {
10875            proc: self.proc.clone(),
10876            selection: query,
10877            graphql_client: self.graphql_client.clone(),
10878        }
10879    }
10880    /// The resolved commit id at this ref.
10881    pub async fn commit(&self) -> Result<String, DaggerError> {
10882        let query = self.selection.select("commit");
10883        query.execute(self.graphql_client.clone()).await
10884    }
10885    /// The resolved name of this ref.
10886    pub async fn name(&self) -> Result<String, DaggerError> {
10887        let query = self.selection.select("name");
10888        query.execute(self.graphql_client.clone()).await
10889    }
10890    /// The resolved ref name at this ref.
10891    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10892        let query = self.selection.select("ref");
10893        query.execute(self.graphql_client.clone()).await
10894    }
10895    /// Return true when the other ref's commit equals this commit or is an ancestor of it.
10896    /// Compares commit history across branches, tags and detached refs. Incomplete or unavailable history is an error.
10897    ///
10898    /// # Arguments
10899    ///
10900    /// * `other` - The ref whose commit to look for in this ref's history.
10901    pub async fn contains(&self, other: impl IntoID<Id>) -> Result<bool, DaggerError> {
10902        let mut query = self.selection.select("contains");
10903        query = query.arg_lazy(
10904            "other",
10905            Box::new(move || {
10906                let other = other.clone();
10907                Box::pin(async move { other.into_id().await.unwrap().quote() })
10908            }),
10909        );
10910        query.execute(self.graphql_client.clone()).await
10911    }
10912    /// Find the best common ancestor between this ref and another ref.
10913    ///
10914    /// # Arguments
10915    ///
10916    /// * `other` - The other ref to compare against.
10917    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10918        let mut query = self.selection.select("commonAncestor");
10919        query = query.arg_lazy(
10920            "other",
10921            Box::new(move || {
10922                let other = other.clone();
10923                Box::pin(async move { other.into_id().await.unwrap().quote() })
10924            }),
10925        );
10926        GitRef {
10927            proc: self.proc.clone(),
10928            selection: query,
10929            graphql_client: self.graphql_client.clone(),
10930        }
10931    }
10932    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
10933    ///
10934    /// # Arguments
10935    ///
10936    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10937    pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
10938        let query = self.selection.select("log");
10939        let query = query.select("id");
10940        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10941        Ok(ids
10942            .into_iter()
10943            .map(|id| GitCommit {
10944                proc: self.proc.clone(),
10945                selection: crate::querybuilder::query()
10946                    .select("node")
10947                    .arg("id", &id.0)
10948                    .inline_fragment("GitCommit"),
10949                graphql_client: self.graphql_client.clone(),
10950            })
10951            .collect())
10952    }
10953    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
10954    ///
10955    /// # Arguments
10956    ///
10957    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10958    pub async fn log_opts<'a>(
10959        &self,
10960        opts: GitRefLogOpts<'a>,
10961    ) -> Result<Vec<GitCommit>, DaggerError> {
10962        let mut query = self.selection.select("log");
10963        if let Some(limit) = opts.limit {
10964            query = query.arg("limit", limit);
10965        }
10966        if let Some(paths) = opts.paths {
10967            query = query.arg("paths", paths);
10968        }
10969        if let Some(base) = opts.base {
10970            query = query.arg("base", base);
10971        }
10972        let query = query.select("id");
10973        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10974        Ok(ids
10975            .into_iter()
10976            .map(|id| GitCommit {
10977                proc: self.proc.clone(),
10978                selection: crate::querybuilder::query()
10979                    .select("node")
10980                    .arg("id", &id.0)
10981                    .inline_fragment("GitCommit"),
10982                graphql_client: self.graphql_client.clone(),
10983            })
10984            .collect())
10985    }
10986    /// Create a single-parent commit on this ref by applying a changeset's edits.
10987    /// 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.
10988    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
10989    ///
10990    /// # Arguments
10991    ///
10992    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
10993    /// * `message` - Commit message.
10994    /// * `date` - RFC3339 author date; also the default committer date.
10995    /// * `author_name` - Author name.
10996    /// * `author_email` - Author email.
10997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10998    pub fn with_commit(
10999        &self,
11000        changes: impl IntoID<Id>,
11001        message: impl Into<String>,
11002        date: impl Into<String>,
11003        author_name: impl Into<String>,
11004        author_email: impl Into<String>,
11005    ) -> GitRef {
11006        let mut query = self.selection.select("withCommit");
11007        query = query.arg_lazy(
11008            "changes",
11009            Box::new(move || {
11010                let changes = changes.clone();
11011                Box::pin(async move { changes.into_id().await.unwrap().quote() })
11012            }),
11013        );
11014        query = query.arg("message", message.into());
11015        query = query.arg("date", date.into());
11016        query = query.arg("authorName", author_name.into());
11017        query = query.arg("authorEmail", author_email.into());
11018        GitRef {
11019            proc: self.proc.clone(),
11020            selection: query,
11021            graphql_client: self.graphql_client.clone(),
11022        }
11023    }
11024    /// Create a single-parent commit on this ref by applying a changeset's edits.
11025    /// 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.
11026    /// Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.
11027    ///
11028    /// # Arguments
11029    ///
11030    /// * `changes` - Changes to apply. Use Changeset.filter to select paths before committing.
11031    /// * `message` - Commit message.
11032    /// * `date` - RFC3339 author date; also the default committer date.
11033    /// * `author_name` - Author name.
11034    /// * `author_email` - Author email.
11035    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11036    pub fn with_commit_opts<'a>(
11037        &self,
11038        changes: impl IntoID<Id>,
11039        message: impl Into<String>,
11040        date: impl Into<String>,
11041        author_name: impl Into<String>,
11042        author_email: impl Into<String>,
11043        opts: GitRefWithCommitOpts<'a>,
11044    ) -> GitRef {
11045        let mut query = self.selection.select("withCommit");
11046        query = query.arg_lazy(
11047            "changes",
11048            Box::new(move || {
11049                let changes = changes.clone();
11050                Box::pin(async move { changes.into_id().await.unwrap().quote() })
11051            }),
11052        );
11053        query = query.arg("message", message.into());
11054        query = query.arg("date", date.into());
11055        query = query.arg("authorName", author_name.into());
11056        query = query.arg("authorEmail", author_email.into());
11057        if let Some(committer_name) = opts.committer_name {
11058            query = query.arg("committerName", committer_name);
11059        }
11060        if let Some(committer_email) = opts.committer_email {
11061            query = query.arg("committerEmail", committer_email);
11062        }
11063        if let Some(committer_date) = opts.committer_date {
11064            query = query.arg("committerDate", committer_date);
11065        }
11066        if let Some(allow_empty) = opts.allow_empty {
11067            query = query.arg("allowEmpty", allow_empty);
11068        }
11069        if let Some(signoff) = opts.signoff {
11070            query = query.arg("signoff", signoff);
11071        }
11072        GitRef {
11073            proc: self.proc.clone(),
11074            selection: query,
11075            graphql_client: self.graphql_client.clone(),
11076        }
11077    }
11078    /// Return this ref's repository with HEAD pinned to the selected commit.
11079    /// Preserves the original repository backend, connection information, and other refs. Does not modify a branch or checkout, or prune history.
11080    pub fn as_repository(&self) -> GitRepository {
11081        let query = self.selection.select("asRepository");
11082        GitRepository {
11083            proc: self.proc.clone(),
11084            selection: query,
11085            graphql_client: self.graphql_client.clone(),
11086        }
11087    }
11088    /// Creates a synthetic workspace from this git ref.
11089    ///
11090    /// # Arguments
11091    ///
11092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11093    pub fn as_workspace(&self) -> Workspace {
11094        let query = self.selection.select("asWorkspace");
11095        Workspace {
11096            proc: self.proc.clone(),
11097            selection: query,
11098            graphql_client: self.graphql_client.clone(),
11099        }
11100    }
11101    /// Creates a synthetic workspace from this git ref.
11102    ///
11103    /// # Arguments
11104    ///
11105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11106    pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
11107        let mut query = self.selection.select("asWorkspace");
11108        if let Some(cwd) = opts.cwd {
11109            query = query.arg("cwd", cwd);
11110        }
11111        Workspace {
11112            proc: self.proc.clone(),
11113            selection: query,
11114            graphql_client: self.graphql_client.clone(),
11115        }
11116    }
11117}
11118impl Node for GitRef {
11119    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11120        let query = self.selection.select("id");
11121        let graphql_client = self.graphql_client.clone();
11122        async move { query.execute(graphql_client).await }
11123    }
11124}
11125#[derive(Clone)]
11126pub struct GitRemote {
11127    pub proc: Option<Arc<DaggerSessionProc>>,
11128    pub selection: Selection,
11129    pub graphql_client: DynGraphQLClient,
11130}
11131impl IntoID<Id> for GitRemote {
11132    fn into_id(
11133        self,
11134    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11135        Box::pin(async move { self.id().await })
11136    }
11137}
11138impl Loadable for GitRemote {
11139    fn graphql_type() -> &'static str {
11140        "GitRemote"
11141    }
11142    fn from_query(
11143        proc: Option<Arc<DaggerSessionProc>>,
11144        selection: Selection,
11145        graphql_client: DynGraphQLClient,
11146    ) -> Self {
11147        Self {
11148            proc,
11149            selection,
11150            graphql_client,
11151        }
11152    }
11153}
11154impl GitRemote {
11155    /// A unique identifier for this GitRemote.
11156    pub async fn id(&self) -> Result<Id, DaggerError> {
11157        let query = self.selection.select("id");
11158        query.execute(self.graphql_client.clone()).await
11159    }
11160    /// Access this remote's repository using its fetch URL and the caller's credentials, or the source's existing capability for this exact destination.
11161    /// HEAD is the remote's HEAD, independent of the workspace's selected commit. Remote registration alone does not grant credentials.
11162    pub fn repository(&self) -> GitRepository {
11163        let query = self.selection.select("repository");
11164        GitRepository {
11165            proc: self.proc.clone(),
11166            selection: query,
11167            graphql_client: self.graphql_client.clone(),
11168        }
11169    }
11170    /// The remote's name.
11171    pub async fn name(&self) -> Result<String, DaggerError> {
11172        let query = self.selection.select("name");
11173        query.execute(self.graphql_client.clone()).await
11174    }
11175}
11176impl Node for GitRemote {
11177    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11178        let query = self.selection.select("id");
11179        let graphql_client = self.graphql_client.clone();
11180        async move { query.execute(graphql_client).await }
11181    }
11182}
11183#[derive(Clone)]
11184pub struct GitRepository {
11185    pub proc: Option<Arc<DaggerSessionProc>>,
11186    pub selection: Selection,
11187    pub graphql_client: DynGraphQLClient,
11188}
11189#[derive(Builder, Debug, PartialEq)]
11190pub struct GitRepositoryHeadOpts {
11191    /// Ignore the workspace lockfile for this lookup.
11192    #[builder(setter(into, strip_option), default)]
11193    pub no_lock: Option<bool>,
11194}
11195#[derive(Builder, Debug, PartialEq)]
11196pub struct GitRepositoryRefOpts {
11197    /// Ignore the workspace lockfile for this lookup.
11198    #[builder(setter(into, strip_option), default)]
11199    pub no_lock: Option<bool>,
11200}
11201#[derive(Builder, Debug, PartialEq)]
11202pub struct GitRepositoryBranchOpts {
11203    /// Ignore the workspace lockfile for this lookup.
11204    #[builder(setter(into, strip_option), default)]
11205    pub no_lock: Option<bool>,
11206}
11207#[derive(Builder, Debug, PartialEq)]
11208pub struct GitRepositoryTagOpts {
11209    /// Ignore the workspace lockfile for this lookup.
11210    #[builder(setter(into, strip_option), default)]
11211    pub no_lock: Option<bool>,
11212}
11213#[derive(Builder, Debug, PartialEq)]
11214pub struct GitRepositoryLatestOpts<'a> {
11215    /// Ignore the workspace lockfile for this lookup.
11216    #[builder(setter(into, strip_option), default)]
11217    pub no_lock: Option<bool>,
11218    /// Version query used to select the greatest matching release ref.
11219    #[builder(setter(into, strip_option), default)]
11220    pub version: Option<&'a str>,
11221}
11222#[derive(Builder, Debug, PartialEq)]
11223pub struct GitRepositoryTagsOpts<'a> {
11224    /// Glob patterns (e.g., "refs/tags/v*").
11225    #[builder(setter(into, strip_option), default)]
11226    pub patterns: Option<Vec<&'a str>>,
11227}
11228#[derive(Builder, Debug, PartialEq)]
11229pub struct GitRepositoryBranchesOpts<'a> {
11230    /// Glob patterns (e.g., "refs/tags/v*").
11231    #[builder(setter(into, strip_option), default)]
11232    pub patterns: Option<Vec<&'a str>>,
11233}
11234#[derive(Builder, Debug, PartialEq)]
11235pub struct GitRepositoryBundleOpts {
11236    /// A Git ref whose reachable objects are omitted and recorded as a prerequisite.
11237    #[builder(setter(into, strip_option), default)]
11238    pub base: Option<Id>,
11239}
11240#[derive(Builder, Debug, PartialEq)]
11241pub struct GitRepositoryWithBundleOpts<'a> {
11242    /// An optional remote ref hint for fetching a prerequisite when the remote does not allow fetches by object ID.
11243    #[builder(setter(into, strip_option), default)]
11244    pub prerequisite_ref: Option<&'a str>,
11245}
11246#[derive(Builder, Debug, PartialEq)]
11247pub struct GitRepositoryWithRemoteOpts<'a> {
11248    /// Push destination, when pushes go somewhere other than url. Empty uses url.
11249    #[builder(setter(into, strip_option), default)]
11250    pub push_url: Option<&'a str>,
11251}
11252#[derive(Builder, Debug, PartialEq)]
11253pub struct GitRepositoryAsWorkspaceOpts<'a> {
11254    /// Current working directory inside the workspace root. Defaults to the workspace root.
11255    #[builder(setter(into, strip_option), default)]
11256    pub cwd: Option<&'a str>,
11257}
11258impl IntoID<Id> for GitRepository {
11259    fn into_id(
11260        self,
11261    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11262        Box::pin(async move { self.id().await })
11263    }
11264}
11265impl Loadable for GitRepository {
11266    fn graphql_type() -> &'static str {
11267        "GitRepository"
11268    }
11269    fn from_query(
11270        proc: Option<Arc<DaggerSessionProc>>,
11271        selection: Selection,
11272        graphql_client: DynGraphQLClient,
11273    ) -> Self {
11274        Self {
11275            proc,
11276            selection,
11277            graphql_client,
11278        }
11279    }
11280}
11281impl GitRepository {
11282    /// A unique identifier for this GitRepository.
11283    pub async fn id(&self) -> Result<Id, DaggerError> {
11284        let query = self.selection.select("id");
11285        query.execute(self.graphql_client.clone()).await
11286    }
11287    /// Returns details for HEAD.
11288    ///
11289    /// # Arguments
11290    ///
11291    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11292    pub fn head(&self) -> GitRef {
11293        let query = self.selection.select("head");
11294        GitRef {
11295            proc: self.proc.clone(),
11296            selection: query,
11297            graphql_client: self.graphql_client.clone(),
11298        }
11299    }
11300    /// Returns details for HEAD.
11301    ///
11302    /// # Arguments
11303    ///
11304    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11305    pub fn head_opts(&self, opts: GitRepositoryHeadOpts) -> GitRef {
11306        let mut query = self.selection.select("head");
11307        if let Some(no_lock) = opts.no_lock {
11308            query = query.arg("noLock", no_lock);
11309        }
11310        GitRef {
11311            proc: self.proc.clone(),
11312            selection: query,
11313            graphql_client: self.graphql_client.clone(),
11314        }
11315    }
11316    /// Returns details of a ref.
11317    ///
11318    /// # Arguments
11319    ///
11320    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11321    ///
11322    /// 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.
11323    ///
11324    /// 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.
11325    ///
11326    /// 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.
11327    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11328    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
11329        let mut query = self.selection.select("ref");
11330        query = query.arg("name", name.into());
11331        GitRef {
11332            proc: self.proc.clone(),
11333            selection: query,
11334            graphql_client: self.graphql_client.clone(),
11335        }
11336    }
11337    /// Returns details of a ref.
11338    ///
11339    /// # Arguments
11340    ///
11341    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
11342    ///
11343    /// 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.
11344    ///
11345    /// 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.
11346    ///
11347    /// 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.
11348    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11349    pub fn r#ref_opts(&self, name: impl Into<String>, opts: GitRepositoryRefOpts) -> GitRef {
11350        let mut query = self.selection.select("ref");
11351        query = query.arg("name", name.into());
11352        if let Some(no_lock) = opts.no_lock {
11353            query = query.arg("noLock", no_lock);
11354        }
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(&self, name: impl Into<String>) -> GitRef {
11368        let mut query = self.selection.select("branch");
11369        query = query.arg("name", name.into());
11370        GitRef {
11371            proc: self.proc.clone(),
11372            selection: query,
11373            graphql_client: self.graphql_client.clone(),
11374        }
11375    }
11376    /// Returns details of a branch.
11377    ///
11378    /// # Arguments
11379    ///
11380    /// * `name` - Branch's name (e.g., "main").
11381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11382    pub fn branch_opts(&self, name: impl Into<String>, opts: GitRepositoryBranchOpts) -> GitRef {
11383        let mut query = self.selection.select("branch");
11384        query = query.arg("name", name.into());
11385        if let Some(no_lock) = opts.no_lock {
11386            query = query.arg("noLock", no_lock);
11387        }
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(&self, name: impl Into<String>) -> GitRef {
11401        let mut query = self.selection.select("tag");
11402        query = query.arg("name", name.into());
11403        GitRef {
11404            proc: self.proc.clone(),
11405            selection: query,
11406            graphql_client: self.graphql_client.clone(),
11407        }
11408    }
11409    /// Returns details of a tag.
11410    ///
11411    /// # Arguments
11412    ///
11413    /// * `name` - Tag's name (e.g., "v0.3.9").
11414    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11415    pub fn tag_opts(&self, name: impl Into<String>, opts: GitRepositoryTagOpts) -> GitRef {
11416        let mut query = self.selection.select("tag");
11417        query = query.arg("name", name.into());
11418        if let Some(no_lock) = opts.no_lock {
11419            query = query.arg("noLock", no_lock);
11420        }
11421        GitRef {
11422            proc: self.proc.clone(),
11423            selection: query,
11424            graphql_client: self.graphql_client.clone(),
11425        }
11426    }
11427    /// Returns details of a commit.
11428    ///
11429    /// # Arguments
11430    ///
11431    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
11432    ///
11433    /// 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.
11434    pub fn commit(&self, id: impl Into<String>) -> GitCommit {
11435        let mut query = self.selection.select("commit");
11436        query = query.arg("id", id.into());
11437        GitCommit {
11438            proc: self.proc.clone(),
11439            selection: query,
11440            graphql_client: self.graphql_client.clone(),
11441        }
11442    }
11443    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11444    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11445    ///
11446    /// # Arguments
11447    ///
11448    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11449    pub fn latest(&self) -> GitRef {
11450        let query = self.selection.select("latest");
11451        GitRef {
11452            proc: self.proc.clone(),
11453            selection: query,
11454            graphql_client: self.graphql_client.clone(),
11455        }
11456    }
11457    /// Return the latest stable release tag, falling back to HEAD when no release exists.
11458    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned unless noLock is enabled.
11459    ///
11460    /// # Arguments
11461    ///
11462    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11463    pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
11464        let mut query = self.selection.select("latest");
11465        if let Some(version) = opts.version {
11466            query = query.arg("version", version);
11467        }
11468        if let Some(no_lock) = opts.no_lock {
11469            query = query.arg("noLock", no_lock);
11470        }
11471        GitRef {
11472            proc: self.proc.clone(),
11473            selection: query,
11474            graphql_client: self.graphql_client.clone(),
11475        }
11476    }
11477    /// tags that match any of the given glob patterns.
11478    ///
11479    /// # Arguments
11480    ///
11481    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11482    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
11483        let query = self.selection.select("tags");
11484        query.execute(self.graphql_client.clone()).await
11485    }
11486    /// tags 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 tags_opts<'a>(
11492        &self,
11493        opts: GitRepositoryTagsOpts<'a>,
11494    ) -> Result<Vec<String>, DaggerError> {
11495        let mut query = self.selection.select("tags");
11496        if let Some(patterns) = opts.patterns {
11497            query = query.arg("patterns", patterns);
11498        }
11499        query.execute(self.graphql_client.clone()).await
11500    }
11501    /// branches that match any of the given glob patterns.
11502    ///
11503    /// # Arguments
11504    ///
11505    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11506    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
11507        let query = self.selection.select("branches");
11508        query.execute(self.graphql_client.clone()).await
11509    }
11510    /// branches that match any of the given glob patterns.
11511    ///
11512    /// # Arguments
11513    ///
11514    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11515    pub async fn branches_opts<'a>(
11516        &self,
11517        opts: GitRepositoryBranchesOpts<'a>,
11518    ) -> Result<Vec<String>, DaggerError> {
11519        let mut query = self.selection.select("branches");
11520        if let Some(patterns) = opts.patterns {
11521            query = query.arg("patterns", patterns);
11522        }
11523        query.execute(self.graphql_client.clone()).await
11524    }
11525    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11526    ///
11527    /// # Arguments
11528    ///
11529    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11530    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11531    pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
11532        let mut query = self.selection.select("bundle");
11533        query = query.arg(
11534            "refs",
11535            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11536        );
11537        GitBundle {
11538            proc: self.proc.clone(),
11539            selection: query,
11540            graphql_client: self.graphql_client.clone(),
11541        }
11542    }
11543    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
11544    ///
11545    /// # Arguments
11546    ///
11547    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
11548    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11549    pub fn bundle_opts(
11550        &self,
11551        refs: Vec<impl Into<String>>,
11552        opts: GitRepositoryBundleOpts,
11553    ) -> GitBundle {
11554        let mut query = self.selection.select("bundle");
11555        query = query.arg(
11556            "refs",
11557            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11558        );
11559        if let Some(base) = opts.base {
11560            query = query.arg("base", base);
11561        }
11562        GitBundle {
11563            proc: self.proc.clone(),
11564            selection: query,
11565            graphql_client: self.graphql_client.clone(),
11566        }
11567    }
11568    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11569    ///
11570    /// # Arguments
11571    ///
11572    /// * `bundle` - The Git bundle to import.
11573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11574    pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
11575        let mut query = self.selection.select("withBundle");
11576        query = query.arg_lazy(
11577            "bundle",
11578            Box::new(move || {
11579                let bundle = bundle.clone();
11580                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11581            }),
11582        );
11583        GitRepository {
11584            proc: self.proc.clone(),
11585            selection: query,
11586            graphql_client: self.graphql_client.clone(),
11587        }
11588    }
11589    /// Import a Git bundle after fetching and verifying all of its prerequisites.
11590    ///
11591    /// # Arguments
11592    ///
11593    /// * `bundle` - The Git bundle to import.
11594    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11595    pub fn with_bundle_opts<'a>(
11596        &self,
11597        bundle: impl IntoID<Id>,
11598        opts: GitRepositoryWithBundleOpts<'a>,
11599    ) -> GitRepository {
11600        let mut query = self.selection.select("withBundle");
11601        query = query.arg_lazy(
11602            "bundle",
11603            Box::new(move || {
11604                let bundle = bundle.clone();
11605                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11606            }),
11607        );
11608        if let Some(prerequisite_ref) = opts.prerequisite_ref {
11609            query = query.arg("prerequisiteRef", prerequisite_ref);
11610        }
11611        GitRepository {
11612            proc: self.proc.clone(),
11613            selection: query,
11614            graphql_client: self.graphql_client.clone(),
11615        }
11616    }
11617    /// Register a named remote on this repository, replacing any registered remote of the same name.
11618    /// 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.
11619    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11620    ///
11621    /// # Arguments
11622    ///
11623    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11624    /// * `url` - The remote's fetch URL.
11625    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11626    pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
11627        let mut query = self.selection.select("withRemote");
11628        query = query.arg("name", name.into());
11629        query = query.arg("url", url.into());
11630        GitRepository {
11631            proc: self.proc.clone(),
11632            selection: query,
11633            graphql_client: self.graphql_client.clone(),
11634        }
11635    }
11636    /// Register a named remote on this repository, replacing any registered remote of the same name.
11637    /// 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.
11638    /// Routing metadata only, never a credential grant: pushes still authenticate with the caller's own credentials and require approval as usual.
11639    ///
11640    /// # Arguments
11641    ///
11642    /// * `name` - The remote's name, e.g. "origin" or "upstream".
11643    /// * `url` - The remote's fetch URL.
11644    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11645    pub fn with_remote_opts<'a>(
11646        &self,
11647        name: impl Into<String>,
11648        url: impl Into<String>,
11649        opts: GitRepositoryWithRemoteOpts<'a>,
11650    ) -> GitRepository {
11651        let mut query = self.selection.select("withRemote");
11652        query = query.arg("name", name.into());
11653        query = query.arg("url", url.into());
11654        if let Some(push_url) = opts.push_url {
11655            query = query.arg("pushUrl", push_url);
11656        }
11657        GitRepository {
11658            proc: self.proc.clone(),
11659            selection: query,
11660            graphql_client: self.graphql_client.clone(),
11661        }
11662    }
11663    /// List this repository's named remotes, with registered remotes overriding configured ones. Does not contact remote servers.
11664    pub async fn remotes(&self) -> Result<Vec<GitRemote>, DaggerError> {
11665        let query = self.selection.select("remotes");
11666        let query = query.select("id");
11667        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11668        Ok(ids
11669            .into_iter()
11670            .map(|id| GitRemote {
11671                proc: self.proc.clone(),
11672                selection: crate::querybuilder::query()
11673                    .select("node")
11674                    .arg("id", &id.0)
11675                    .inline_fragment("GitRemote"),
11676                graphql_client: self.graphql_client.clone(),
11677            })
11678            .collect())
11679    }
11680    /// Look up a remote by name. Fails when the remote does not exist.
11681    ///
11682    /// # Arguments
11683    ///
11684    /// * `name` - The remote's name.
11685    pub fn remote(&self, name: impl Into<String>) -> GitRemote {
11686        let mut query = self.selection.select("remote");
11687        query = query.arg("name", name.into());
11688        GitRemote {
11689            proc: self.proc.clone(),
11690            selection: query,
11691            graphql_client: self.graphql_client.clone(),
11692        }
11693    }
11694    /// Return the sole remote, otherwise origin, otherwise the selected branch's upstream remote, otherwise null.
11695    /// Frozen workspaces retain their captured upstream selection. Does not contact remote servers.
11696    pub async fn default_remote(&self) -> Result<Option<GitRemote>, DaggerError> {
11697        let query = self.selection.select("defaultRemote");
11698        let query = query.select("id");
11699        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11700        Ok(id.map(|id| GitRemote {
11701            proc: self.proc.clone(),
11702            selection: query
11703                .root()
11704                .select("node")
11705                .arg("id", &id.0)
11706                .inline_fragment("GitRemote"),
11707            graphql_client: self.graphql_client.clone(),
11708        }))
11709    }
11710    /// Replace this repository's storage with the supplied self-contained Git repository, retaining its logical URL and push destinations.
11711    /// 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.
11712    /// 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.
11713    /// 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.
11714    ///
11715    /// # Arguments
11716    ///
11717    /// * `directory` - Existing Git storage to open. Git metadata and object dependencies must be contained in this directory.
11718    pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
11719        let mut query = self.selection.select("withContents");
11720        query = query.arg_lazy(
11721            "directory",
11722            Box::new(move || {
11723                let directory = directory.clone();
11724                Box::pin(async move { directory.into_id().await.unwrap().quote() })
11725            }),
11726        );
11727        GitRepository {
11728            proc: self.proc.clone(),
11729            selection: query,
11730            graphql_client: self.graphql_client.clone(),
11731        }
11732    }
11733    /// Returns the changeset of uncommitted changes in the git repository.
11734    pub fn uncommitted(&self) -> Changeset {
11735        let query = self.selection.select("uncommitted");
11736        Changeset {
11737            proc: self.proc.clone(),
11738            selection: query,
11739            graphql_client: self.graphql_client.clone(),
11740        }
11741    }
11742    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11743    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11744    ///
11745    /// # Arguments
11746    ///
11747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11748    pub fn as_workspace(&self) -> Workspace {
11749        let query = self.selection.select("asWorkspace");
11750        Workspace {
11751            proc: self.proc.clone(),
11752            selection: query,
11753            graphql_client: self.graphql_client.clone(),
11754        }
11755    }
11756    /// Creates a synthetic workspace from this repository's HEAD and uncommitted file changes.
11757    /// Pending changes are applied at the repository root. The staging split is not preserved. The source repository is not modified.
11758    ///
11759    /// # Arguments
11760    ///
11761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11762    pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
11763        let mut query = self.selection.select("asWorkspace");
11764        if let Some(cwd) = opts.cwd {
11765            query = query.arg("cwd", cwd);
11766        }
11767        Workspace {
11768            proc: self.proc.clone(),
11769            selection: query,
11770            graphql_client: self.graphql_client.clone(),
11771        }
11772    }
11773    /// The URL of the git repository.
11774    pub async fn url(&self) -> Result<String, DaggerError> {
11775        let query = self.selection.select("url");
11776        query.execute(self.graphql_client.clone()).await
11777    }
11778}
11779impl Node for GitRepository {
11780    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11781        let query = self.selection.select("id");
11782        let graphql_client = self.graphql_client.clone();
11783        async move { query.execute(graphql_client).await }
11784    }
11785}
11786#[derive(Clone)]
11787pub struct HttpState {
11788    pub proc: Option<Arc<DaggerSessionProc>>,
11789    pub selection: Selection,
11790    pub graphql_client: DynGraphQLClient,
11791}
11792impl IntoID<Id> for HttpState {
11793    fn into_id(
11794        self,
11795    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11796        Box::pin(async move { self.id().await })
11797    }
11798}
11799impl Loadable for HttpState {
11800    fn graphql_type() -> &'static str {
11801        "HTTPState"
11802    }
11803    fn from_query(
11804        proc: Option<Arc<DaggerSessionProc>>,
11805        selection: Selection,
11806        graphql_client: DynGraphQLClient,
11807    ) -> Self {
11808        Self {
11809            proc,
11810            selection,
11811            graphql_client,
11812        }
11813    }
11814}
11815impl HttpState {
11816    /// A unique identifier for this HTTPState.
11817    pub async fn id(&self) -> Result<Id, DaggerError> {
11818        let query = self.selection.select("id");
11819        query.execute(self.graphql_client.clone()).await
11820    }
11821}
11822impl Node for HttpState {
11823    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11824        let query = self.selection.select("id");
11825        let graphql_client = self.graphql_client.clone();
11826        async move { query.execute(graphql_client).await }
11827    }
11828}
11829#[derive(Clone)]
11830pub struct HealthcheckConfig {
11831    pub proc: Option<Arc<DaggerSessionProc>>,
11832    pub selection: Selection,
11833    pub graphql_client: DynGraphQLClient,
11834}
11835impl IntoID<Id> for HealthcheckConfig {
11836    fn into_id(
11837        self,
11838    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11839        Box::pin(async move { self.id().await })
11840    }
11841}
11842impl Loadable for HealthcheckConfig {
11843    fn graphql_type() -> &'static str {
11844        "HealthcheckConfig"
11845    }
11846    fn from_query(
11847        proc: Option<Arc<DaggerSessionProc>>,
11848        selection: Selection,
11849        graphql_client: DynGraphQLClient,
11850    ) -> Self {
11851        Self {
11852            proc,
11853            selection,
11854            graphql_client,
11855        }
11856    }
11857}
11858impl HealthcheckConfig {
11859    /// A unique identifier for this HealthcheckConfig.
11860    pub async fn id(&self) -> Result<Id, DaggerError> {
11861        let query = self.selection.select("id");
11862        query.execute(self.graphql_client.clone()).await
11863    }
11864    /// Healthcheck command arguments.
11865    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
11866        let query = self.selection.select("args");
11867        query.execute(self.graphql_client.clone()).await
11868    }
11869    /// Healthcheck command is a shell command.
11870    pub async fn shell(&self) -> Result<bool, DaggerError> {
11871        let query = self.selection.select("shell");
11872        query.execute(self.graphql_client.clone()).await
11873    }
11874    /// Healthcheck timeout. Example:3s
11875    pub async fn timeout(&self) -> Result<String, DaggerError> {
11876        let query = self.selection.select("timeout");
11877        query.execute(self.graphql_client.clone()).await
11878    }
11879    /// Interval between running healthcheck. Example:30s
11880    pub async fn interval(&self) -> Result<String, DaggerError> {
11881        let query = self.selection.select("interval");
11882        query.execute(self.graphql_client.clone()).await
11883    }
11884    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
11885    pub async fn start_period(&self) -> Result<String, DaggerError> {
11886        let query = self.selection.select("startPeriod");
11887        query.execute(self.graphql_client.clone()).await
11888    }
11889    /// StartInterval configures the duration between checks during the startup phase. Example:5s
11890    pub async fn start_interval(&self) -> Result<String, DaggerError> {
11891        let query = self.selection.select("startInterval");
11892        query.execute(self.graphql_client.clone()).await
11893    }
11894    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
11895    pub async fn retries(&self) -> Result<isize, DaggerError> {
11896        let query = self.selection.select("retries");
11897        query.execute(self.graphql_client.clone()).await
11898    }
11899}
11900impl Node for HealthcheckConfig {
11901    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11902        let query = self.selection.select("id");
11903        let graphql_client = self.graphql_client.clone();
11904        async move { query.execute(graphql_client).await }
11905    }
11906}
11907#[derive(Clone)]
11908pub struct Host {
11909    pub proc: Option<Arc<DaggerSessionProc>>,
11910    pub selection: Selection,
11911    pub graphql_client: DynGraphQLClient,
11912}
11913#[derive(Builder, Debug, PartialEq)]
11914pub struct HostDirectoryOpts<'a> {
11915    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
11916    #[builder(setter(into, strip_option), default)]
11917    pub exclude: Option<Vec<&'a str>>,
11918    /// Apply .gitignore filter rules inside the directory
11919    #[builder(setter(into, strip_option), default)]
11920    pub gitignore: Option<bool>,
11921    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
11922    #[builder(setter(into, strip_option), default)]
11923    pub include: Option<Vec<&'a str>>,
11924    /// If true, the directory will always be reloaded from the host.
11925    #[builder(setter(into, strip_option), default)]
11926    pub no_cache: Option<bool>,
11927}
11928#[derive(Builder, Debug, PartialEq)]
11929pub struct HostFileOpts {
11930    /// If true, the file will always be reloaded from the host.
11931    #[builder(setter(into, strip_option), default)]
11932    pub no_cache: Option<bool>,
11933}
11934#[derive(Builder, Debug, PartialEq)]
11935pub struct HostFindUpOpts {
11936    #[builder(setter(into, strip_option), default)]
11937    pub no_cache: Option<bool>,
11938}
11939#[derive(Builder, Debug, PartialEq)]
11940pub struct HostTunnelOpts {
11941    /// Map each service port to the same port on the host, as if the service were running natively.
11942    /// Note: enabling may result in port conflicts.
11943    #[builder(setter(into, strip_option), default)]
11944    pub native: Option<bool>,
11945    /// Configure explicit port forwarding rules for the tunnel.
11946    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
11947    /// 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.
11948    /// If ports are given and native is true, the ports are additive.
11949    #[builder(setter(into, strip_option), default)]
11950    pub ports: Option<Vec<PortForward>>,
11951}
11952#[derive(Builder, Debug, PartialEq)]
11953pub struct HostServiceOpts<'a> {
11954    /// Upstream host to forward traffic to.
11955    #[builder(setter(into, strip_option), default)]
11956    pub host: Option<&'a str>,
11957}
11958impl IntoID<Id> for Host {
11959    fn into_id(
11960        self,
11961    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11962        Box::pin(async move { self.id().await })
11963    }
11964}
11965impl Loadable for Host {
11966    fn graphql_type() -> &'static str {
11967        "Host"
11968    }
11969    fn from_query(
11970        proc: Option<Arc<DaggerSessionProc>>,
11971        selection: Selection,
11972        graphql_client: DynGraphQLClient,
11973    ) -> Self {
11974        Self {
11975            proc,
11976            selection,
11977            graphql_client,
11978        }
11979    }
11980}
11981impl Host {
11982    /// A unique identifier for this Host.
11983    pub async fn id(&self) -> Result<Id, DaggerError> {
11984        let query = self.selection.select("id");
11985        query.execute(self.graphql_client.clone()).await
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(&self, path: impl Into<String>) -> Directory {
11994        let mut query = self.selection.select("directory");
11995        query = query.arg("path", path.into());
11996        Directory {
11997            proc: self.proc.clone(),
11998            selection: query,
11999            graphql_client: self.graphql_client.clone(),
12000        }
12001    }
12002    /// Accesses a directory on the host.
12003    ///
12004    /// # Arguments
12005    ///
12006    /// * `path` - Location of the directory to access (e.g., ".").
12007    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12008    pub fn directory_opts<'a>(
12009        &self,
12010        path: impl Into<String>,
12011        opts: HostDirectoryOpts<'a>,
12012    ) -> Directory {
12013        let mut query = self.selection.select("directory");
12014        query = query.arg("path", path.into());
12015        if let Some(exclude) = opts.exclude {
12016            query = query.arg("exclude", exclude);
12017        }
12018        if let Some(include) = opts.include {
12019            query = query.arg("include", include);
12020        }
12021        if let Some(no_cache) = opts.no_cache {
12022            query = query.arg("noCache", no_cache);
12023        }
12024        if let Some(gitignore) = opts.gitignore {
12025            query = query.arg("gitignore", gitignore);
12026        }
12027        Directory {
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(&self, path: impl Into<String>) -> File {
12040        let mut query = self.selection.select("file");
12041        query = query.arg("path", path.into());
12042        File {
12043            proc: self.proc.clone(),
12044            selection: query,
12045            graphql_client: self.graphql_client.clone(),
12046        }
12047    }
12048    /// Accesses a file on the host.
12049    ///
12050    /// # Arguments
12051    ///
12052    /// * `path` - Location of the file to retrieve (e.g., "README.md").
12053    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12054    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
12055        let mut query = self.selection.select("file");
12056        query = query.arg("path", path.into());
12057        if let Some(no_cache) = opts.no_cache {
12058            query = query.arg("noCache", no_cache);
12059        }
12060        File {
12061            proc: self.proc.clone(),
12062            selection: query,
12063            graphql_client: self.graphql_client.clone(),
12064        }
12065    }
12066    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12067    ///
12068    /// # Arguments
12069    ///
12070    /// * `name` - name of the file or directory to search for
12071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12072    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
12073        let mut query = self.selection.select("findUp");
12074        query = query.arg("name", name.into());
12075        query.execute(self.graphql_client.clone()).await
12076    }
12077    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
12078    ///
12079    /// # Arguments
12080    ///
12081    /// * `name` - name of the file or directory to search for
12082    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12083    pub async fn find_up_opts(
12084        &self,
12085        name: impl Into<String>,
12086        opts: HostFindUpOpts,
12087    ) -> Result<String, DaggerError> {
12088        let mut query = self.selection.select("findUp");
12089        query = query.arg("name", name.into());
12090        if let Some(no_cache) = opts.no_cache {
12091            query = query.arg("noCache", no_cache);
12092        }
12093        query.execute(self.graphql_client.clone()).await
12094    }
12095    /// Accesses a Unix socket on the host.
12096    ///
12097    /// # Arguments
12098    ///
12099    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
12100    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
12101        let mut query = self.selection.select("unixSocket");
12102        query = query.arg("path", path.into());
12103        Socket {
12104            proc: self.proc.clone(),
12105            selection: query,
12106            graphql_client: self.graphql_client.clone(),
12107        }
12108    }
12109    /// Creates a tunnel that forwards traffic from the host to a service.
12110    ///
12111    /// # Arguments
12112    ///
12113    /// * `service` - Service to send traffic from the tunnel.
12114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12115    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
12116        let mut query = self.selection.select("tunnel");
12117        query = query.arg_lazy(
12118            "service",
12119            Box::new(move || {
12120                let service = service.clone();
12121                Box::pin(async move { service.into_id().await.unwrap().quote() })
12122            }),
12123        );
12124        Service {
12125            proc: self.proc.clone(),
12126            selection: query,
12127            graphql_client: self.graphql_client.clone(),
12128        }
12129    }
12130    /// Creates a tunnel that forwards traffic from the host to a service.
12131    ///
12132    /// # Arguments
12133    ///
12134    /// * `service` - Service to send traffic from the tunnel.
12135    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12136    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
12137        let mut query = self.selection.select("tunnel");
12138        query = query.arg_lazy(
12139            "service",
12140            Box::new(move || {
12141                let service = service.clone();
12142                Box::pin(async move { service.into_id().await.unwrap().quote() })
12143            }),
12144        );
12145        if let Some(native) = opts.native {
12146            query = query.arg("native", native);
12147        }
12148        if let Some(ports) = opts.ports {
12149            query = query.arg("ports", ports);
12150        }
12151        Service {
12152            proc: self.proc.clone(),
12153            selection: query,
12154            graphql_client: self.graphql_client.clone(),
12155        }
12156    }
12157    /// Creates a service that forwards traffic to a specified address via the host.
12158    ///
12159    /// # Arguments
12160    ///
12161    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12162    ///
12163    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12164    ///
12165    /// An empty set of ports is not valid; an error will be returned.
12166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12167    pub fn service(&self, ports: Vec<PortForward>) -> Service {
12168        let mut query = self.selection.select("service");
12169        query = query.arg("ports", ports);
12170        Service {
12171            proc: self.proc.clone(),
12172            selection: query,
12173            graphql_client: self.graphql_client.clone(),
12174        }
12175    }
12176    /// Creates a service that forwards traffic to a specified address via the host.
12177    ///
12178    /// # Arguments
12179    ///
12180    /// * `ports` - Ports to expose via the service, forwarding through the host network.
12181    ///
12182    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
12183    ///
12184    /// An empty set of ports is not valid; an error will be returned.
12185    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12186    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
12187        let mut query = self.selection.select("service");
12188        query = query.arg("ports", ports);
12189        if let Some(host) = opts.host {
12190            query = query.arg("host", host);
12191        }
12192        Service {
12193            proc: self.proc.clone(),
12194            selection: query,
12195            graphql_client: self.graphql_client.clone(),
12196        }
12197    }
12198    /// Accesses a container image on the host.
12199    ///
12200    /// # Arguments
12201    ///
12202    /// * `name` - Name of the image to access.
12203    pub fn container_image(&self, name: impl Into<String>) -> Container {
12204        let mut query = self.selection.select("containerImage");
12205        query = query.arg("name", name.into());
12206        Container {
12207            proc: self.proc.clone(),
12208            selection: query,
12209            graphql_client: self.graphql_client.clone(),
12210        }
12211    }
12212}
12213impl Node for Host {
12214    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12215        let query = self.selection.select("id");
12216        let graphql_client = self.graphql_client.clone();
12217        async move { query.execute(graphql_client).await }
12218    }
12219}
12220#[derive(Clone)]
12221pub struct InputTypeDef {
12222    pub proc: Option<Arc<DaggerSessionProc>>,
12223    pub selection: Selection,
12224    pub graphql_client: DynGraphQLClient,
12225}
12226impl IntoID<Id> for InputTypeDef {
12227    fn into_id(
12228        self,
12229    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12230        Box::pin(async move { self.id().await })
12231    }
12232}
12233impl Loadable for InputTypeDef {
12234    fn graphql_type() -> &'static str {
12235        "InputTypeDef"
12236    }
12237    fn from_query(
12238        proc: Option<Arc<DaggerSessionProc>>,
12239        selection: Selection,
12240        graphql_client: DynGraphQLClient,
12241    ) -> Self {
12242        Self {
12243            proc,
12244            selection,
12245            graphql_client,
12246        }
12247    }
12248}
12249impl InputTypeDef {
12250    /// A unique identifier for this InputTypeDef.
12251    pub async fn id(&self) -> Result<Id, DaggerError> {
12252        let query = self.selection.select("id");
12253        query.execute(self.graphql_client.clone()).await
12254    }
12255    /// Static fields defined on this input object, if any.
12256    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12257        let query = self.selection.select("fields");
12258        let query = query.select("id");
12259        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12260        Ok(ids
12261            .into_iter()
12262            .map(|id| FieldTypeDef {
12263                proc: self.proc.clone(),
12264                selection: crate::querybuilder::query()
12265                    .select("node")
12266                    .arg("id", &id.0)
12267                    .inline_fragment("FieldTypeDef"),
12268                graphql_client: self.graphql_client.clone(),
12269            })
12270            .collect())
12271    }
12272    /// The name of the input object.
12273    pub async fn name(&self) -> Result<String, DaggerError> {
12274        let query = self.selection.select("name");
12275        query.execute(self.graphql_client.clone()).await
12276    }
12277}
12278impl Node for InputTypeDef {
12279    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12280        let query = self.selection.select("id");
12281        let graphql_client = self.graphql_client.clone();
12282        async move { query.execute(graphql_client).await }
12283    }
12284}
12285#[derive(Clone)]
12286pub struct InterfaceTypeDef {
12287    pub proc: Option<Arc<DaggerSessionProc>>,
12288    pub selection: Selection,
12289    pub graphql_client: DynGraphQLClient,
12290}
12291impl IntoID<Id> for InterfaceTypeDef {
12292    fn into_id(
12293        self,
12294    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12295        Box::pin(async move { self.id().await })
12296    }
12297}
12298impl Loadable for InterfaceTypeDef {
12299    fn graphql_type() -> &'static str {
12300        "InterfaceTypeDef"
12301    }
12302    fn from_query(
12303        proc: Option<Arc<DaggerSessionProc>>,
12304        selection: Selection,
12305        graphql_client: DynGraphQLClient,
12306    ) -> Self {
12307        Self {
12308            proc,
12309            selection,
12310            graphql_client,
12311        }
12312    }
12313}
12314impl InterfaceTypeDef {
12315    /// A unique identifier for this InterfaceTypeDef.
12316    pub async fn id(&self) -> Result<Id, DaggerError> {
12317        let query = self.selection.select("id");
12318        query.execute(self.graphql_client.clone()).await
12319    }
12320    /// Functions defined on this interface, if any.
12321    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12322        let query = self.selection.select("functions");
12323        let query = query.select("id");
12324        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12325        Ok(ids
12326            .into_iter()
12327            .map(|id| Function {
12328                proc: self.proc.clone(),
12329                selection: crate::querybuilder::query()
12330                    .select("node")
12331                    .arg("id", &id.0)
12332                    .inline_fragment("Function"),
12333                graphql_client: self.graphql_client.clone(),
12334            })
12335            .collect())
12336    }
12337    /// The name of the interface.
12338    pub async fn name(&self) -> Result<String, DaggerError> {
12339        let query = self.selection.select("name");
12340        query.execute(self.graphql_client.clone()).await
12341    }
12342    /// The doc string for the interface, if any.
12343    pub async fn description(&self) -> Result<String, DaggerError> {
12344        let query = self.selection.select("description");
12345        query.execute(self.graphql_client.clone()).await
12346    }
12347    /// The location of this interface declaration.
12348    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12349        let query = self.selection.select("sourceMap");
12350        let query = query.select("id");
12351        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12352        Ok(id.map(|id| SourceMap {
12353            proc: self.proc.clone(),
12354            selection: query
12355                .root()
12356                .select("node")
12357                .arg("id", &id.0)
12358                .inline_fragment("SourceMap"),
12359            graphql_client: self.graphql_client.clone(),
12360        }))
12361    }
12362    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
12363    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12364        let query = self.selection.select("sourceModuleName");
12365        query.execute(self.graphql_client.clone()).await
12366    }
12367}
12368impl Node for InterfaceTypeDef {
12369    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12370        let query = self.selection.select("id");
12371        let graphql_client = self.graphql_client.clone();
12372        async move { query.execute(graphql_client).await }
12373    }
12374}
12375#[derive(Clone)]
12376pub struct JsonValue {
12377    pub proc: Option<Arc<DaggerSessionProc>>,
12378    pub selection: Selection,
12379    pub graphql_client: DynGraphQLClient,
12380}
12381#[derive(Builder, Debug, PartialEq)]
12382pub struct JsonValueContentsOpts<'a> {
12383    /// Optional line prefix
12384    #[builder(setter(into, strip_option), default)]
12385    pub indent: Option<&'a str>,
12386    /// Pretty-print
12387    #[builder(setter(into, strip_option), default)]
12388    pub pretty: Option<bool>,
12389}
12390impl IntoID<Id> for JsonValue {
12391    fn into_id(
12392        self,
12393    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12394        Box::pin(async move { self.id().await })
12395    }
12396}
12397impl Loadable for JsonValue {
12398    fn graphql_type() -> &'static str {
12399        "JSONValue"
12400    }
12401    fn from_query(
12402        proc: Option<Arc<DaggerSessionProc>>,
12403        selection: Selection,
12404        graphql_client: DynGraphQLClient,
12405    ) -> Self {
12406        Self {
12407            proc,
12408            selection,
12409            graphql_client,
12410        }
12411    }
12412}
12413impl JsonValue {
12414    /// A unique identifier for this JSONValue.
12415    pub async fn id(&self) -> Result<Id, DaggerError> {
12416        let query = self.selection.select("id");
12417        query.execute(self.graphql_client.clone()).await
12418    }
12419    /// Return the value encoded as json
12420    ///
12421    /// # Arguments
12422    ///
12423    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12424    pub async fn contents(&self) -> Result<Json, DaggerError> {
12425        let query = self.selection.select("contents");
12426        query.execute(self.graphql_client.clone()).await
12427    }
12428    /// Return the value encoded as json
12429    ///
12430    /// # Arguments
12431    ///
12432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12433    pub async fn contents_opts<'a>(
12434        &self,
12435        opts: JsonValueContentsOpts<'a>,
12436    ) -> Result<Json, DaggerError> {
12437        let mut query = self.selection.select("contents");
12438        if let Some(pretty) = opts.pretty {
12439            query = query.arg("pretty", pretty);
12440        }
12441        if let Some(indent) = opts.indent {
12442            query = query.arg("indent", indent);
12443        }
12444        query.execute(self.graphql_client.clone()).await
12445    }
12446    /// Return a new json value, decoded from the given content
12447    ///
12448    /// # Arguments
12449    ///
12450    /// * `contents` - New JSON-encoded contents
12451    pub fn with_contents(&self, contents: Json) -> JsonValue {
12452        let mut query = self.selection.select("withContents");
12453        query = query.arg("contents", contents);
12454        JsonValue {
12455            proc: self.proc.clone(),
12456            selection: query,
12457            graphql_client: self.graphql_client.clone(),
12458        }
12459    }
12460    /// Encode an integer to json
12461    ///
12462    /// # Arguments
12463    ///
12464    /// * `value` - New integer value
12465    pub fn new_integer(&self, value: isize) -> JsonValue {
12466        let mut query = self.selection.select("newInteger");
12467        query = query.arg("value", value);
12468        JsonValue {
12469            proc: self.proc.clone(),
12470            selection: query,
12471            graphql_client: self.graphql_client.clone(),
12472        }
12473    }
12474    /// Decode an integer from json
12475    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
12476        let query = self.selection.select("asInteger");
12477        query.execute(self.graphql_client.clone()).await
12478    }
12479    /// Encode a string to json
12480    ///
12481    /// # Arguments
12482    ///
12483    /// * `value` - New string value
12484    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
12485        let mut query = self.selection.select("newString");
12486        query = query.arg("value", value.into());
12487        JsonValue {
12488            proc: self.proc.clone(),
12489            selection: query,
12490            graphql_client: self.graphql_client.clone(),
12491        }
12492    }
12493    /// Decode a string from json
12494    pub async fn as_string(&self) -> Result<String, DaggerError> {
12495        let query = self.selection.select("asString");
12496        query.execute(self.graphql_client.clone()).await
12497    }
12498    /// Encode a boolean to json
12499    ///
12500    /// # Arguments
12501    ///
12502    /// * `value` - New boolean value
12503    pub fn new_boolean(&self, value: bool) -> JsonValue {
12504        let mut query = self.selection.select("newBoolean");
12505        query = query.arg("value", value);
12506        JsonValue {
12507            proc: self.proc.clone(),
12508            selection: query,
12509            graphql_client: self.graphql_client.clone(),
12510        }
12511    }
12512    /// Decode a boolean from json
12513    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
12514        let query = self.selection.select("asBoolean");
12515        query.execute(self.graphql_client.clone()).await
12516    }
12517    /// Decode an array from json
12518    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
12519        let query = self.selection.select("asArray");
12520        let query = query.select("id");
12521        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12522        Ok(ids
12523            .into_iter()
12524            .map(|id| JsonValue {
12525                proc: self.proc.clone(),
12526                selection: crate::querybuilder::query()
12527                    .select("node")
12528                    .arg("id", &id.0)
12529                    .inline_fragment("JSONValue"),
12530                graphql_client: self.graphql_client.clone(),
12531            })
12532            .collect())
12533    }
12534    /// List fields of the encoded object
12535    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
12536        let query = self.selection.select("fields");
12537        query.execute(self.graphql_client.clone()).await
12538    }
12539    /// Lookup the field at the given path, and return its value.
12540    ///
12541    /// # Arguments
12542    ///
12543    /// * `path` - Path of the field to lookup, encoded as an array of field names
12544    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
12545        let mut query = self.selection.select("field");
12546        query = query.arg(
12547            "path",
12548            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12549        );
12550        JsonValue {
12551            proc: self.proc.clone(),
12552            selection: query,
12553            graphql_client: self.graphql_client.clone(),
12554        }
12555    }
12556    /// Set a new field at the given path
12557    ///
12558    /// # Arguments
12559    ///
12560    /// * `path` - Path of the field to set, encoded as an array of field names
12561    /// * `value` - The new value of the field
12562    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
12563        let mut query = self.selection.select("withField");
12564        query = query.arg(
12565            "path",
12566            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12567        );
12568        query = query.arg_lazy(
12569            "value",
12570            Box::new(move || {
12571                let value = value.clone();
12572                Box::pin(async move { value.into_id().await.unwrap().quote() })
12573            }),
12574        );
12575        JsonValue {
12576            proc: self.proc.clone(),
12577            selection: query,
12578            graphql_client: self.graphql_client.clone(),
12579        }
12580    }
12581}
12582impl Node for JsonValue {
12583    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12584        let query = self.selection.select("id");
12585        let graphql_client = self.graphql_client.clone();
12586        async move { query.execute(graphql_client).await }
12587    }
12588}
12589#[derive(Clone)]
12590pub struct Llm {
12591    pub proc: Option<Arc<DaggerSessionProc>>,
12592    pub selection: Selection,
12593    pub graphql_client: DynGraphQLClient,
12594}
12595#[derive(Builder, Debug, PartialEq)]
12596pub struct LlmArtifactsOpts<'a> {
12597    /// Only include artifacts matching these path patterns, as with Workspace.artifacts. A path selects that path and its children.
12598    #[builder(setter(into, strip_option), default)]
12599    pub include: Option<Vec<&'a str>>,
12600}
12601#[derive(Builder, Debug, PartialEq)]
12602pub struct LlmWithModelOpts<'a> {
12603    /// 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.
12604    #[builder(setter(into, strip_option), default)]
12605    pub provider: Option<&'a str>,
12606}
12607#[derive(Builder, Debug, PartialEq)]
12608pub struct LlmWithPromptOpts {
12609    /// 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.
12610    #[builder(setter(into, strip_option), default)]
12611    pub origin: Option<LlmMessageOriginInput>,
12612}
12613#[derive(Builder, Debug, PartialEq)]
12614pub struct LlmWithContentOpts {
12615    /// The message's recorded provenance.
12616    #[builder(setter(into, strip_option), default)]
12617    pub origin: Option<LlmMessageOriginInput>,
12618}
12619#[derive(Builder, Debug, PartialEq)]
12620pub struct LlmWithContentFileOpts<'a> {
12621    /// The media MIME type; inferred from the file's contents when omitted.
12622    #[builder(setter(into, strip_option), default)]
12623    pub mime_type: Option<&'a str>,
12624}
12625#[derive(Builder, Debug, PartialEq)]
12626pub struct LlmWithResponseOpts {
12627    /// Cached input tokens read
12628    #[builder(setter(into, strip_option), default)]
12629    pub cached_token_reads: Option<isize>,
12630    /// Cached input tokens written
12631    #[builder(setter(into, strip_option), default)]
12632    pub cached_token_writes: Option<isize>,
12633    /// Uncached input tokens sent
12634    #[builder(setter(into, strip_option), default)]
12635    pub input_tokens: Option<isize>,
12636    /// Tokens received from the model, including text and tool calls
12637    #[builder(setter(into, strip_option), default)]
12638    pub output_tokens: Option<isize>,
12639    /// Total tokens consumed by this response
12640    #[builder(setter(into, strip_option), default)]
12641    pub total_tokens: Option<isize>,
12642}
12643#[derive(Builder, Debug, PartialEq)]
12644pub struct LlmWithToolResultOpts {
12645    /// Ordered text and media returned by the tool
12646    #[builder(setter(into, strip_option), default)]
12647    pub blocks: Option<Vec<LlmContentBlockInput>>,
12648}
12649#[derive(Builder, Debug, PartialEq)]
12650pub struct LlmWithToolsOpts<'a> {
12651    /// Method names to exclude from the toolset (e.g. constructors, entrypoints).
12652    #[builder(setter(into, strip_option), default)]
12653    pub except: Option<Vec<&'a str>>,
12654    /// 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.
12655    #[builder(setter(into, strip_option), default)]
12656    pub version: Option<isize>,
12657}
12658#[derive(Builder, Debug, PartialEq)]
12659pub struct LlmLoopOpts {
12660    /// Cap the number of steps. The loop fails if the cap is reached before the model ends its turn.
12661    #[builder(setter(into, strip_option), default)]
12662    pub max_steps: Option<isize>,
12663    /// Cap the model's output tokens on each step. Defaults to the model's maximum.
12664    #[builder(setter(into, strip_option), default)]
12665    pub max_tokens: Option<isize>,
12666}
12667#[derive(Builder, Debug, PartialEq)]
12668pub struct LlmStepOpts {
12669    /// Cap the model's output tokens for this step. Defaults to the model's maximum.
12670    #[builder(setter(into, strip_option), default)]
12671    pub max_tokens: Option<isize>,
12672}
12673#[derive(Builder, Debug, PartialEq)]
12674pub struct LlmSpawnOpts<'a> {
12675    /// The loop error to create the agent with, for state FAILED. Refused with any other state.
12676    #[builder(setter(into, strip_option), default)]
12677    pub error: Option<&'a str>,
12678    /// 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.
12679    #[builder(setter(into, strip_option), default)]
12680    pub handle: Option<&'a str>,
12681    /// Display label for the agent — telemetry and error messages; carries no identity. Defaults to a short name derived from the conversation.
12682    #[builder(setter(into, strip_option), default)]
12683    pub name: Option<&'a str>,
12684    /// 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.
12685    #[builder(setter(into, strip_option), default)]
12686    pub parent_handle: Option<&'a str>,
12687    /// 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.
12688    /// 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.
12689    #[builder(setter(into, strip_option), default)]
12690    pub state: Option<AgentState>,
12691}
12692impl IntoID<Id> for Llm {
12693    fn into_id(
12694        self,
12695    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12696        Box::pin(async move { self.id().await })
12697    }
12698}
12699impl Loadable for Llm {
12700    fn graphql_type() -> &'static str {
12701        "LLM"
12702    }
12703    fn from_query(
12704        proc: Option<Arc<DaggerSessionProc>>,
12705        selection: Selection,
12706        graphql_client: DynGraphQLClient,
12707    ) -> Self {
12708        Self {
12709            proc,
12710            selection,
12711            graphql_client,
12712        }
12713    }
12714}
12715impl Llm {
12716    /// A unique identifier for this LLM.
12717    pub async fn id(&self) -> Result<Id, DaggerError> {
12718        let query = self.selection.select("id");
12719        query.execute(self.graphql_client.clone()).await
12720    }
12721    /// Run expertise in list order, passing this conversation through each function. Retain existing contributions.
12722    ///
12723    /// # Arguments
12724    ///
12725    /// * `expertise` - The expertise to run. Each reference retains its source workspace.
12726    pub fn compose(&self, expertise: Vec<Id>) -> Llm {
12727        let mut query = self.selection.select("compose");
12728        query = query.arg("expertise", expertise);
12729        Llm {
12730            proc: self.proc.clone(),
12731            selection: query,
12732            graphql_client: self.graphql_client.clone(),
12733        }
12734    }
12735    /// Run expertise in list order, replacing their modules' contributions and preserving compatible tool state.
12736    /// Clear each selected module's contributions once before execution. Retain unowned contributions and contributions from other modules. Keep this LLM's workspace.
12737    /// A change to a tool binding's version resets its state. Removed bindings, changed identities, and incompatible state are errors.
12738    ///
12739    /// # Arguments
12740    ///
12741    /// * `expertise` - The expertise to run. Each reference retains its source workspace.
12742    pub fn recompose(&self, expertise: Vec<Id>) -> Llm {
12743        let mut query = self.selection.select("recompose");
12744        query = query.arg("expertise", expertise);
12745        Llm {
12746            proc: self.proc.clone(),
12747            selection: query,
12748            graphql_client: self.graphql_client.clone(),
12749        }
12750    }
12751    /// The model the conversation is running against, after resolving any configured default.
12752    pub async fn model(&self) -> Result<String, DaggerError> {
12753        let query = self.selection.select("model");
12754        query.execute(self.graphql_client.clone()).await
12755    }
12756    /// The provider serving the model, e.g. "anthropic", "openai", "google", or "local".
12757    pub async fn provider(&self) -> Result<String, DaggerError> {
12758        let query = self.selection.select("provider");
12759        query.execute(self.graphql_client.clone()).await
12760    }
12761    /// The model's total context window in tokens, or null if unknown (e.g. a local or uncatalogued model).
12762    pub async fn context_window(&self) -> Result<isize, DaggerError> {
12763        let query = self.selection.select("contextWindow");
12764        query.execute(self.graphql_client.clone()).await
12765    }
12766    /// The full message history, as structured messages.
12767    pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
12768        let query = self.selection.select("messages");
12769        let query = query.select("id");
12770        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12771        Ok(ids
12772            .into_iter()
12773            .map(|id| LlmMessage {
12774                proc: self.proc.clone(),
12775                selection: crate::querybuilder::query()
12776                    .select("node")
12777                    .arg("id", &id.0)
12778                    .inline_fragment("LLMMessage"),
12779                graphql_client: self.graphql_client.clone(),
12780            })
12781            .collect())
12782    }
12783    /// The message history rendered as a plain-text transcript, suitable for feeding back to an LLM (e.g. for summarization).
12784    pub async fn transcript(&self) -> Result<String, DaggerError> {
12785        let query = self.selection.select("transcript");
12786        query.execute(self.graphql_client.clone()).await
12787    }
12788    /// Clear the message history, keeping only the system prompts.
12789    pub fn without_message_history(&self) -> Llm {
12790        let query = self.selection.select("withoutMessageHistory");
12791        Llm {
12792            proc: self.proc.clone(),
12793            selection: query,
12794            graphql_client: self.graphql_client.clone(),
12795        }
12796    }
12797    /// Clear the user-added system prompts, keeping only the default system prompt.
12798    pub fn without_system_prompts(&self) -> Llm {
12799        let query = self.selection.select("withoutSystemPrompts");
12800        Llm {
12801            proc: self.proc.clone(),
12802            selection: query,
12803            graphql_client: self.graphql_client.clone(),
12804        }
12805    }
12806    /// The text of the model's most recent reply.
12807    pub async fn last_reply(&self) -> Result<String, DaggerError> {
12808        let query = self.selection.select("lastReply");
12809        query.execute(self.graphql_client.clone()).await
12810    }
12811    /// Bind the LLM to a workspace, exposing its modules as tools exactly as the Dagger CLI would serve them for that workspace.
12812    ///
12813    /// # Arguments
12814    ///
12815    /// * `workspace` - The workspace to work in.
12816    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
12817        let mut query = self.selection.select("withWorkspace");
12818        query = query.arg_lazy(
12819            "workspace",
12820            Box::new(move || {
12821                let workspace = workspace.clone();
12822                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
12823            }),
12824        );
12825        Llm {
12826            proc: self.proc.clone(),
12827            selection: query,
12828            graphql_client: self.graphql_client.clone(),
12829        }
12830    }
12831    /// Return the workspace the LLM is bound to.
12832    pub fn workspace(&self) -> Workspace {
12833        let query = self.selection.select("workspace");
12834        Workspace {
12835            proc: self.proc.clone(),
12836            selection: query,
12837            graphql_client: self.graphql_client.clone(),
12838        }
12839    }
12840    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
12841    /// 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.
12842    /// 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.
12843    /// 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.
12844    ///
12845    /// # Arguments
12846    ///
12847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12848    pub fn artifacts(&self) -> Artifacts {
12849        let query = self.selection.select("artifacts");
12850        Artifacts {
12851            proc: self.proc.clone(),
12852            selection: query,
12853            graphql_client: self.graphql_client.clone(),
12854        }
12855    }
12856    /// Discover every artifact this conversation can address, as one selection, without evaluating their values.
12857    /// 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.
12858    /// 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.
12859    /// 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.
12860    ///
12861    /// # Arguments
12862    ///
12863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12864    pub fn artifacts_opts<'a>(&self, opts: LlmArtifactsOpts<'a>) -> Artifacts {
12865        let mut query = self.selection.select("artifacts");
12866        if let Some(include) = opts.include {
12867            query = query.arg("include", include);
12868        }
12869        Artifacts {
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(&self, model: impl Into<String>) -> Llm {
12882        let mut query = self.selection.select("withModel");
12883        query = query.arg("model", model.into());
12884        Llm {
12885            proc: self.proc.clone(),
12886            selection: query,
12887            graphql_client: self.graphql_client.clone(),
12888        }
12889    }
12890    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
12891    ///
12892    /// # Arguments
12893    ///
12894    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
12895    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12896    pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
12897        let mut query = self.selection.select("withModel");
12898        query = query.arg("model", model.into());
12899        if let Some(provider) = opts.provider {
12900            query = query.arg("provider", provider);
12901        }
12902        Llm {
12903            proc: self.proc.clone(),
12904            selection: query,
12905            graphql_client: self.graphql_client.clone(),
12906        }
12907    }
12908    /// 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.
12909    pub fn with_small_model(&self) -> Llm {
12910        let query = self.selection.select("withSmallModel");
12911        Llm {
12912            proc: self.proc.clone(),
12913            selection: query,
12914            graphql_client: self.graphql_client.clone(),
12915        }
12916    }
12917    /// The reasoning effort in use, e.g. "low", "medium", or "high". Empty or "none" when reasoning is disabled.
12918    pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
12919        let query = self.selection.select("reasoningEffort");
12920        query.execute(self.graphql_client.clone()).await
12921    }
12922    /// 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.
12923    ///
12924    /// # Arguments
12925    ///
12926    /// * `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".
12927    pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
12928        let mut query = self.selection.select("withReasoningEffort");
12929        query = query.arg("effort", effort.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(&self, prompt: impl Into<String>) -> Llm {
12943        let mut query = self.selection.select("withPrompt");
12944        query = query.arg("prompt", prompt.into());
12945        Llm {
12946            proc: self.proc.clone(),
12947            selection: query,
12948            graphql_client: self.graphql_client.clone(),
12949        }
12950    }
12951    /// Queue a user prompt, to be sent to the model on the next step or loop.
12952    ///
12953    /// # Arguments
12954    ///
12955    /// * `prompt` - The prompt to send
12956    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12957    pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
12958        let mut query = self.selection.select("withPrompt");
12959        query = query.arg("prompt", prompt.into());
12960        if let Some(origin) = opts.origin {
12961            query = query.arg("origin", origin);
12962        }
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(&self, content: Vec<LlmContentBlockInput>) -> Llm {
12976        let mut query = self.selection.select("withContent");
12977        query = query.arg("content", content);
12978        Llm {
12979            proc: self.proc.clone(),
12980            selection: query,
12981            graphql_client: self.graphql_client.clone(),
12982        }
12983    }
12984    /// Queue one user message containing ordered text and media blocks.
12985    ///
12986    /// # Arguments
12987    ///
12988    /// * `content` - The ordered message content.
12989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12990    pub fn with_content_opts(
12991        &self,
12992        content: Vec<LlmContentBlockInput>,
12993        opts: LlmWithContentOpts,
12994    ) -> Llm {
12995        let mut query = self.selection.select("withContent");
12996        query = query.arg("content", content);
12997        if let Some(origin) = opts.origin {
12998            query = query.arg("origin", origin);
12999        }
13000        Llm {
13001            proc: self.proc.clone(),
13002            selection: query,
13003            graphql_client: self.graphql_client.clone(),
13004        }
13005    }
13006    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
13007    ///
13008    /// # Arguments
13009    ///
13010    /// * `file` - The media file.
13011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13012    pub fn with_content_file(&self, file: impl IntoID<Id>) -> Llm {
13013        let mut query = self.selection.select("withContentFile");
13014        query = query.arg_lazy(
13015            "file",
13016            Box::new(move || {
13017                let file = file.clone();
13018                Box::pin(async move { file.into_id().await.unwrap().quote() })
13019            }),
13020        );
13021        Llm {
13022            proc: self.proc.clone(),
13023            selection: query,
13024            graphql_client: self.graphql_client.clone(),
13025        }
13026    }
13027    /// Queue an image, audio, or PDF file as one user message. Media bytes are stored in the conversation.
13028    ///
13029    /// # Arguments
13030    ///
13031    /// * `file` - The media file.
13032    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13033    pub fn with_content_file_opts<'a>(
13034        &self,
13035        file: impl IntoID<Id>,
13036        opts: LlmWithContentFileOpts<'a>,
13037    ) -> Llm {
13038        let mut query = self.selection.select("withContentFile");
13039        query = query.arg_lazy(
13040            "file",
13041            Box::new(move || {
13042                let file = file.clone();
13043                Box::pin(async move { file.into_id().await.unwrap().quote() })
13044            }),
13045        );
13046        if let Some(mime_type) = opts.mime_type {
13047            query = query.arg("mimeType", mime_type);
13048        }
13049        Llm {
13050            proc: self.proc.clone(),
13051            selection: query,
13052            graphql_client: self.graphql_client.clone(),
13053        }
13054    }
13055    /// Queue a file's contents as a user prompt, like withPrompt.
13056    ///
13057    /// # Arguments
13058    ///
13059    /// * `file` - The file to read the prompt from
13060    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
13061        let mut query = self.selection.select("withPromptFile");
13062        query = query.arg_lazy(
13063            "file",
13064            Box::new(move || {
13065                let file = file.clone();
13066                Box::pin(async move { file.into_id().await.unwrap().quote() })
13067            }),
13068        );
13069        Llm {
13070            proc: self.proc.clone(),
13071            selection: query,
13072            graphql_client: self.graphql_client.clone(),
13073        }
13074    }
13075    /// Add a system prompt, instructing the model across the whole conversation.
13076    ///
13077    /// # Arguments
13078    ///
13079    /// * `prompt` - The system prompt to send
13080    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
13081        let mut query = self.selection.select("withSystemPrompt");
13082        query = query.arg("prompt", prompt.into());
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(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13096        let mut query = self.selection.select("withResponse");
13097        query = query.arg("content", content);
13098        Llm {
13099            proc: self.proc.clone(),
13100            selection: query,
13101            graphql_client: self.graphql_client.clone(),
13102        }
13103    }
13104    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
13105    ///
13106    /// # Arguments
13107    ///
13108    /// * `content` - The response content
13109    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13110    pub fn with_response_opts(
13111        &self,
13112        content: Vec<LlmContentBlockInput>,
13113        opts: LlmWithResponseOpts,
13114    ) -> Llm {
13115        let mut query = self.selection.select("withResponse");
13116        query = query.arg("content", content);
13117        if let Some(input_tokens) = opts.input_tokens {
13118            query = query.arg("inputTokens", input_tokens);
13119        }
13120        if let Some(output_tokens) = opts.output_tokens {
13121            query = query.arg("outputTokens", output_tokens);
13122        }
13123        if let Some(cached_token_reads) = opts.cached_token_reads {
13124            query = query.arg("cachedTokenReads", cached_token_reads);
13125        }
13126        if let Some(cached_token_writes) = opts.cached_token_writes {
13127            query = query.arg("cachedTokenWrites", cached_token_writes);
13128        }
13129        if let Some(total_tokens) = opts.total_tokens {
13130            query = query.arg("totalTokens", total_tokens);
13131        }
13132        Llm {
13133            proc: self.proc.clone(),
13134            selection: query,
13135            graphql_client: self.graphql_client.clone(),
13136        }
13137    }
13138    /// Append the result of a tool call to the message history.
13139    ///
13140    /// # Arguments
13141    ///
13142    /// * `call_id` - The ID of the tool call this result responds to
13143    /// * `content` - Text returned by the tool, placed before blocks
13144    /// * `errored` - Whether the tool call resulted in an error
13145    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13146    pub fn with_tool_result(
13147        &self,
13148        call_id: impl Into<String>,
13149        content: impl Into<String>,
13150        errored: bool,
13151    ) -> Llm {
13152        let mut query = self.selection.select("withToolResult");
13153        query = query.arg("callId", call_id.into());
13154        query = query.arg("content", content.into());
13155        query = query.arg("errored", errored);
13156        Llm {
13157            proc: self.proc.clone(),
13158            selection: query,
13159            graphql_client: self.graphql_client.clone(),
13160        }
13161    }
13162    /// Append the result of a tool call to the message history.
13163    ///
13164    /// # Arguments
13165    ///
13166    /// * `call_id` - The ID of the tool call this result responds to
13167    /// * `content` - Text returned by the tool, placed before blocks
13168    /// * `errored` - Whether the tool call resulted in an error
13169    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13170    pub fn with_tool_result_opts(
13171        &self,
13172        call_id: impl Into<String>,
13173        content: impl Into<String>,
13174        errored: bool,
13175        opts: LlmWithToolResultOpts,
13176    ) -> Llm {
13177        let mut query = self.selection.select("withToolResult");
13178        query = query.arg("callId", call_id.into());
13179        query = query.arg("content", content.into());
13180        query = query.arg("errored", errored);
13181        if let Some(blocks) = opts.blocks {
13182            query = query.arg("blocks", blocks);
13183        }
13184        Llm {
13185            proc: self.proc.clone(),
13186            selection: query,
13187            graphql_client: self.graphql_client.clone(),
13188        }
13189    }
13190    /// 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.
13191    ///
13192    /// # Arguments
13193    ///
13194    /// * `object` - The object whose methods become tools.
13195    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13196    pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
13197        let mut query = self.selection.select("withTools");
13198        query = query.arg_lazy(
13199            "object",
13200            Box::new(move || {
13201                let object = object.clone();
13202                Box::pin(async move { object.into_id().await.unwrap().quote() })
13203            }),
13204        );
13205        Llm {
13206            proc: self.proc.clone(),
13207            selection: query,
13208            graphql_client: self.graphql_client.clone(),
13209        }
13210    }
13211    /// 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.
13212    ///
13213    /// # Arguments
13214    ///
13215    /// * `object` - The object whose methods become tools.
13216    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13217    pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
13218        let mut query = self.selection.select("withTools");
13219        query = query.arg_lazy(
13220            "object",
13221            Box::new(move || {
13222                let object = object.clone();
13223                Box::pin(async move { object.into_id().await.unwrap().quote() })
13224            }),
13225        );
13226        if let Some(except) = opts.except {
13227            query = query.arg("except", except);
13228        }
13229        if let Some(version) = opts.version {
13230            query = query.arg("version", version);
13231        }
13232        Llm {
13233            proc: self.proc.clone(),
13234            selection: query,
13235            graphql_client: self.graphql_client.clone(),
13236        }
13237    }
13238    /// Disable the default system prompt
13239    pub fn without_default_system_prompt(&self) -> Llm {
13240        let query = self.selection.select("withoutDefaultSystemPrompt");
13241        Llm {
13242            proc: self.proc.clone(),
13243            selection: query,
13244            graphql_client: self.graphql_client.clone(),
13245        }
13246    }
13247    /// Add an external MCP server to the LLM
13248    ///
13249    /// # Arguments
13250    ///
13251    /// * `name` - The name of the MCP server
13252    /// * `service` - The MCP service to run and communicate with over stdio
13253    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
13254        let mut query = self.selection.select("withMCPServer");
13255        query = query.arg("name", name.into());
13256        query = query.arg_lazy(
13257            "service",
13258            Box::new(move || {
13259                let service = service.clone();
13260                Box::pin(async move { service.into_id().await.unwrap().quote() })
13261            }),
13262        );
13263        Llm {
13264            proc: self.proc.clone(),
13265            selection: query,
13266            graphql_client: self.graphql_client.clone(),
13267        }
13268    }
13269    /// 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.
13270    ///
13271    /// # Arguments
13272    ///
13273    /// * `directory` - A directory containing skills, each a subdirectory holding a SKILL.md.
13274    pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
13275        let mut query = self.selection.select("withSkills");
13276        query = query.arg_lazy(
13277            "directory",
13278            Box::new(move || {
13279                let directory = directory.clone();
13280                Box::pin(async move { directory.into_id().await.unwrap().quote() })
13281            }),
13282        );
13283        Llm {
13284            proc: self.proc.clone(),
13285            selection: query,
13286            graphql_client: self.graphql_client.clone(),
13287        }
13288    }
13289    /// 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.
13290    pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
13291        let query = self.selection.select("skills");
13292        let query = query.select("id");
13293        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13294        Ok(ids
13295            .into_iter()
13296            .map(|id| LlmSkill {
13297                proc: self.proc.clone(),
13298                selection: crate::querybuilder::query()
13299                    .select("node")
13300                    .arg("id", &id.0)
13301                    .inline_fragment("LLMSkill"),
13302                graphql_client: self.graphql_client.clone(),
13303            })
13304            .collect())
13305    }
13306    /// Force evaluation of the conversation's pending operations (prompts, steps, loops) in the engine.
13307    pub async fn sync(&self) -> Result<Llm, DaggerError> {
13308        let query = self.selection.select("sync");
13309        let id: Id = query.execute(self.graphql_client.clone()).await?;
13310        Ok(Llm {
13311            proc: self.proc.clone(),
13312            selection: query
13313                .root()
13314                .select("node")
13315                .arg("id", &id.0)
13316                .inline_fragment("LLM"),
13317            graphql_client: self.graphql_client.clone(),
13318        })
13319    }
13320    /// 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.
13321    ///
13322    /// # Arguments
13323    ///
13324    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13325    pub fn r#loop(&self) -> Llm {
13326        let query = self.selection.select("loop");
13327        Llm {
13328            proc: self.proc.clone(),
13329            selection: query,
13330            graphql_client: self.graphql_client.clone(),
13331        }
13332    }
13333    /// 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.
13334    ///
13335    /// # Arguments
13336    ///
13337    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13338    pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
13339        let mut query = self.selection.select("loop");
13340        if let Some(max_steps) = opts.max_steps {
13341            query = query.arg("maxSteps", max_steps);
13342        }
13343        if let Some(max_tokens) = opts.max_tokens {
13344            query = query.arg("maxTokens", max_tokens);
13345        }
13346        Llm {
13347            proc: self.proc.clone(),
13348            selection: query,
13349            graphql_client: self.graphql_client.clone(),
13350        }
13351    }
13352    /// 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.
13353    ///
13354    /// # Arguments
13355    ///
13356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13357    pub fn step(&self) -> Llm {
13358        let query = self.selection.select("step");
13359        Llm {
13360            proc: self.proc.clone(),
13361            selection: query,
13362            graphql_client: self.graphql_client.clone(),
13363        }
13364    }
13365    /// 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.
13366    ///
13367    /// # Arguments
13368    ///
13369    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13370    pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
13371        let mut query = self.selection.select("step");
13372        if let Some(max_tokens) = opts.max_tokens {
13373            query = query.arg("maxTokens", max_tokens);
13374        }
13375        Llm {
13376            proc: self.proc.clone(),
13377            selection: query,
13378            graphql_client: self.graphql_client.clone(),
13379        }
13380    }
13381    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13382    /// 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.
13383    /// 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.
13384    /// 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.
13385    ///
13386    /// # Arguments
13387    ///
13388    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13389    pub async fn spawn(&self) -> Result<Agent, DaggerError> {
13390        let query = self.selection.select("spawn");
13391        let id: Id = query.execute(self.graphql_client.clone()).await?;
13392        Ok(Agent {
13393            proc: self.proc.clone(),
13394            selection: query
13395                .root()
13396                .select("node")
13397                .arg("id", &id.0)
13398                .inline_fragment("Agent"),
13399            graphql_client: self.graphql_client.clone(),
13400        })
13401    }
13402    /// Spawn the conversation as an agent: a startable, addressable evaluation loop seeded with this conversation's state, tools, and workspace.
13403    /// 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.
13404    /// 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.
13405    /// 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.
13406    ///
13407    /// # Arguments
13408    ///
13409    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13410    pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
13411        let mut query = self.selection.select("spawn");
13412        if let Some(name) = opts.name {
13413            query = query.arg("name", name);
13414        }
13415        if let Some(handle) = opts.handle {
13416            query = query.arg("handle", handle);
13417        }
13418        if let Some(state) = opts.state {
13419            query = query.arg("state", state);
13420        }
13421        if let Some(parent_handle) = opts.parent_handle {
13422            query = query.arg("parentHandle", parent_handle);
13423        }
13424        if let Some(error) = opts.error {
13425            query = query.arg("error", error);
13426        }
13427        let id: Id = query.execute(self.graphql_client.clone()).await?;
13428        Ok(Agent {
13429            proc: self.proc.clone(),
13430            selection: query
13431                .root()
13432                .select("node")
13433                .arg("id", &id.0)
13434                .inline_fragment("Agent"),
13435            graphql_client: self.graphql_client.clone(),
13436        })
13437    }
13438    /// Reconstruct a spawned agent from its runtime handle.
13439    /// 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.
13440    ///
13441    /// # Arguments
13442    ///
13443    /// * `handle` - The opaque runtime handle minted by the spawn that created the agent.
13444    /// * `name` - The agent's display name, as recorded by the spawn.
13445    pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
13446        let mut query = self.selection.select("agent");
13447        query = query.arg("handle", handle.into());
13448        query = query.arg("name", name.into());
13449        Agent {
13450            proc: self.proc.clone(),
13451            selection: query,
13452            graphql_client: self.graphql_client.clone(),
13453        }
13454    }
13455    /// 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.
13456    pub async fn has_pending(&self) -> Result<bool, DaggerError> {
13457        let query = self.selection.select("hasPending");
13458        query.execute(self.graphql_client.clone()).await
13459    }
13460    /// Fork the conversation, so that otherwise-identical follow-ups evaluate independently instead of deduplicating to a single cached result.
13461    ///
13462    /// # Arguments
13463    ///
13464    /// * `label` - A label distinguishing this fork from its siblings, e.g. "attempt-2" when retrying a flaky evaluation.
13465    pub fn fork(&self, label: impl Into<String>) -> Llm {
13466        let mut query = self.selection.select("fork");
13467        query = query.arg("label", label.into());
13468        Llm {
13469            proc: self.proc.clone(),
13470            selection: query,
13471            graphql_client: self.graphql_client.clone(),
13472        }
13473    }
13474    /// Render documentation for the tools currently exposed to the model.
13475    pub async fn tools(&self) -> Result<String, DaggerError> {
13476        let query = self.selection.select("tools");
13477        query.execute(self.graphql_client.clone()).await
13478    }
13479    /// The cumulative token usage, summed across every API call in the conversation.
13480    pub fn token_usage(&self) -> LlmTokenUsage {
13481        let query = self.selection.select("tokenUsage");
13482        LlmTokenUsage {
13483            proc: self.proc.clone(),
13484            selection: query,
13485            graphql_client: self.graphql_client.clone(),
13486        }
13487    }
13488    /// estimated number of tokens currently occupying the context window; unlike tokenUsage this is not cumulative over the session
13489    pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
13490        let query = self.selection.select("contextTokens");
13491        query.execute(self.graphql_client.clone()).await
13492    }
13493}
13494impl Node for Llm {
13495    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13496        let query = self.selection.select("id");
13497        let graphql_client = self.graphql_client.clone();
13498        async move { query.execute(graphql_client).await }
13499    }
13500}
13501impl Syncer for Llm {
13502    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13503        let query = self.selection.select("id");
13504        let graphql_client = self.graphql_client.clone();
13505        async move { query.execute(graphql_client).await }
13506    }
13507    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13508        let query = self.selection.select("sync");
13509        let proc = self.proc.clone();
13510        let graphql_client = self.graphql_client.clone();
13511        async move {
13512            let id: Id = query.execute(graphql_client.clone()).await?;
13513            Ok(Self {
13514                proc,
13515                selection: query
13516                    .root()
13517                    .select("node")
13518                    .arg("id", &id.0)
13519                    .inline_fragment("LLM"),
13520                graphql_client,
13521            })
13522        }
13523    }
13524}
13525#[derive(Clone)]
13526pub struct LlmContent {
13527    pub proc: Option<Arc<DaggerSessionProc>>,
13528    pub selection: Selection,
13529    pub graphql_client: DynGraphQLClient,
13530}
13531#[derive(Builder, Debug, PartialEq)]
13532pub struct LlmContentWithFileOpts<'a> {
13533    /// The media MIME type, e.g. "image/png". Inferred from the file's contents when omitted.
13534    #[builder(setter(into, strip_option), default)]
13535    pub mime_type: Option<&'a str>,
13536}
13537impl IntoID<Id> for LlmContent {
13538    fn into_id(
13539        self,
13540    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13541        Box::pin(async move { self.id().await })
13542    }
13543}
13544impl Loadable for LlmContent {
13545    fn graphql_type() -> &'static str {
13546        "LLMContent"
13547    }
13548    fn from_query(
13549        proc: Option<Arc<DaggerSessionProc>>,
13550        selection: Selection,
13551        graphql_client: DynGraphQLClient,
13552    ) -> Self {
13553        Self {
13554            proc,
13555            selection,
13556            graphql_client,
13557        }
13558    }
13559}
13560impl LlmContent {
13561    /// A unique identifier for this LLMContent.
13562    pub async fn id(&self) -> Result<Id, DaggerError> {
13563        let query = self.selection.select("id");
13564        query.execute(self.graphql_client.clone()).await
13565    }
13566    /// Append a block of text.
13567    ///
13568    /// # Arguments
13569    ///
13570    /// * `text` - The text.
13571    pub fn with_text(&self, text: impl Into<String>) -> LlmContent {
13572        let mut query = self.selection.select("withText");
13573        query = query.arg("text", text.into());
13574        LlmContent {
13575            proc: self.proc.clone(),
13576            selection: query,
13577            graphql_client: self.graphql_client.clone(),
13578        }
13579    }
13580    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13581    ///
13582    /// # Arguments
13583    ///
13584    /// * `file` - The media file. Its contents become the block's inline bytes.
13585    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13586    pub fn with_file(&self, file: impl IntoID<Id>) -> LlmContent {
13587        let mut query = self.selection.select("withFile");
13588        query = query.arg_lazy(
13589            "file",
13590            Box::new(move || {
13591                let file = file.clone();
13592                Box::pin(async move { file.into_id().await.unwrap().quote() })
13593            }),
13594        );
13595        LlmContent {
13596            proc: self.proc.clone(),
13597            selection: query,
13598            graphql_client: self.graphql_client.clone(),
13599        }
13600    }
13601    /// Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.
13602    ///
13603    /// # Arguments
13604    ///
13605    /// * `file` - The media file. Its contents become the block's inline bytes.
13606    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13607    pub fn with_file_opts<'a>(
13608        &self,
13609        file: impl IntoID<Id>,
13610        opts: LlmContentWithFileOpts<'a>,
13611    ) -> LlmContent {
13612        let mut query = self.selection.select("withFile");
13613        query = query.arg_lazy(
13614            "file",
13615            Box::new(move || {
13616                let file = file.clone();
13617                Box::pin(async move { file.into_id().await.unwrap().quote() })
13618            }),
13619        );
13620        if let Some(mime_type) = opts.mime_type {
13621            query = query.arg("mimeType", mime_type);
13622        }
13623        LlmContent {
13624            proc: self.proc.clone(),
13625            selection: query,
13626            graphql_client: self.graphql_client.clone(),
13627        }
13628    }
13629    /// Append image, audio, or PDF bytes as an inline media block. The media kind follows the MIME type.
13630    /// Prefer withFile for anything but small payloads: the bytes become part of the content's identity, so they travel with every reference to it.
13631    ///
13632    /// # Arguments
13633    ///
13634    /// * `data` - The media bytes.
13635    /// * `mime_type` - The media MIME type, e.g. "image/png".
13636    pub fn with_data(&self, data: Bytes, mime_type: impl Into<String>) -> LlmContent {
13637        let mut query = self.selection.select("withData");
13638        query = query.arg("data", data);
13639        query = query.arg("mimeType", mime_type.into());
13640        LlmContent {
13641            proc: self.proc.clone(),
13642            selection: query,
13643            graphql_client: self.graphql_client.clone(),
13644        }
13645    }
13646    /// The ordered text and media blocks.
13647    pub async fn blocks(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13648        let query = self.selection.select("blocks");
13649        let query = query.select("id");
13650        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13651        Ok(ids
13652            .into_iter()
13653            .map(|id| LlmContentBlock {
13654                proc: self.proc.clone(),
13655                selection: crate::querybuilder::query()
13656                    .select("node")
13657                    .arg("id", &id.0)
13658                    .inline_fragment("LLMContentBlock"),
13659                graphql_client: self.graphql_client.clone(),
13660            })
13661            .collect())
13662    }
13663}
13664impl Node for LlmContent {
13665    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13666        let query = self.selection.select("id");
13667        let graphql_client = self.graphql_client.clone();
13668        async move { query.execute(graphql_client).await }
13669    }
13670}
13671#[derive(Clone)]
13672pub struct LlmContentBlock {
13673    pub proc: Option<Arc<DaggerSessionProc>>,
13674    pub selection: Selection,
13675    pub graphql_client: DynGraphQLClient,
13676}
13677impl IntoID<Id> for LlmContentBlock {
13678    fn into_id(
13679        self,
13680    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13681        Box::pin(async move { self.id().await })
13682    }
13683}
13684impl Loadable for LlmContentBlock {
13685    fn graphql_type() -> &'static str {
13686        "LLMContentBlock"
13687    }
13688    fn from_query(
13689        proc: Option<Arc<DaggerSessionProc>>,
13690        selection: Selection,
13691        graphql_client: DynGraphQLClient,
13692    ) -> Self {
13693        Self {
13694            proc,
13695            selection,
13696            graphql_client,
13697        }
13698    }
13699}
13700impl LlmContentBlock {
13701    /// A unique identifier for this LLMContentBlock.
13702    pub async fn id(&self) -> Result<Id, DaggerError> {
13703        let query = self.selection.select("id");
13704        query.execute(self.graphql_client.clone()).await
13705    }
13706    /// The kind of content block, which determines the other populated fields.
13707    pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
13708        let query = self.selection.select("kind");
13709        query.execute(self.graphql_client.clone()).await
13710    }
13711    /// Text content (for TEXT, THINKING, or TOOL_RESULT kinds).
13712    pub async fn text(&self) -> Result<String, DaggerError> {
13713        let query = self.selection.select("text");
13714        query.execute(self.graphql_client.clone()).await
13715    }
13716    /// The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
13717    pub async fn call_id(&self) -> Result<String, DaggerError> {
13718        let query = self.selection.select("callId");
13719        query.execute(self.graphql_client.clone()).await
13720    }
13721    /// The name of the tool called (for TOOL_CALL kind).
13722    pub async fn tool_name(&self) -> Result<String, DaggerError> {
13723        let query = self.selection.select("toolName");
13724        query.execute(self.graphql_client.clone()).await
13725    }
13726    /// The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).
13727    pub async fn arguments(&self) -> Result<Json, DaggerError> {
13728        let query = self.selection.select("arguments");
13729        query.execute(self.graphql_client.clone()).await
13730    }
13731    /// Whether the tool call resulted in an error (for TOOL_RESULT kind).
13732    pub async fn errored(&self) -> Result<bool, DaggerError> {
13733        let query = self.selection.select("errored");
13734        query.execute(self.graphql_client.clone()).await
13735    }
13736    /// The media MIME type (for IMAGE, AUDIO, or DOCUMENT kinds).
13737    pub async fn mime_type(&self) -> Result<String, DaggerError> {
13738        let query = self.selection.select("mimeType");
13739        query.execute(self.graphql_client.clone()).await
13740    }
13741    /// The media bytes (for IMAGE, AUDIO, or DOCUMENT kinds).
13742    pub async fn data(&self) -> Result<Bytes, DaggerError> {
13743        let query = self.selection.select("data");
13744        query.execute(self.graphql_client.clone()).await
13745    }
13746    /// Ordered content returned by a tool, following any text (for TOOL_RESULT kind).
13747    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13748        let query = self.selection.select("content");
13749        let query = query.select("id");
13750        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13751        Ok(ids
13752            .into_iter()
13753            .map(|id| LlmContentBlock {
13754                proc: self.proc.clone(),
13755                selection: crate::querybuilder::query()
13756                    .select("node")
13757                    .arg("id", &id.0)
13758                    .inline_fragment("LLMContentBlock"),
13759                graphql_client: self.graphql_client.clone(),
13760            })
13761            .collect())
13762    }
13763    /// Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.
13764    pub async fn signature(&self) -> Result<String, DaggerError> {
13765        let query = self.selection.select("signature");
13766        query.execute(self.graphql_client.clone()).await
13767    }
13768}
13769impl Node for LlmContentBlock {
13770    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13771        let query = self.selection.select("id");
13772        let graphql_client = self.graphql_client.clone();
13773        async move { query.execute(graphql_client).await }
13774    }
13775}
13776#[derive(Clone)]
13777pub struct LlmMessage {
13778    pub proc: Option<Arc<DaggerSessionProc>>,
13779    pub selection: Selection,
13780    pub graphql_client: DynGraphQLClient,
13781}
13782impl IntoID<Id> for LlmMessage {
13783    fn into_id(
13784        self,
13785    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13786        Box::pin(async move { self.id().await })
13787    }
13788}
13789impl Loadable for LlmMessage {
13790    fn graphql_type() -> &'static str {
13791        "LLMMessage"
13792    }
13793    fn from_query(
13794        proc: Option<Arc<DaggerSessionProc>>,
13795        selection: Selection,
13796        graphql_client: DynGraphQLClient,
13797    ) -> Self {
13798        Self {
13799            proc,
13800            selection,
13801            graphql_client,
13802        }
13803    }
13804}
13805impl LlmMessage {
13806    /// A unique identifier for this LLMMessage.
13807    pub async fn id(&self) -> Result<Id, DaggerError> {
13808        let query = self.selection.select("id");
13809        query.execute(self.graphql_client.clone()).await
13810    }
13811    /// Who put this message on the record, when it arrived through an agent mailbox.
13812    /// Null for the user's own prompts and for everything the model or tools produced.
13813    pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
13814        let query = self.selection.select("origin");
13815        let query = query.select("id");
13816        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13817        Ok(id.map(|id| LlmMessageOrigin {
13818            proc: self.proc.clone(),
13819            selection: query
13820                .root()
13821                .select("node")
13822                .arg("id", &id.0)
13823                .inline_fragment("LLMMessageOrigin"),
13824            graphql_client: self.graphql_client.clone(),
13825        }))
13826    }
13827    /// The role that produced this message.
13828    pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
13829        let query = self.selection.select("role");
13830        query.execute(self.graphql_client.clone()).await
13831    }
13832    /// The message's content blocks, in the order the model produced them.
13833    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13834        let query = self.selection.select("content");
13835        let query = query.select("id");
13836        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13837        Ok(ids
13838            .into_iter()
13839            .map(|id| LlmContentBlock {
13840                proc: self.proc.clone(),
13841                selection: crate::querybuilder::query()
13842                    .select("node")
13843                    .arg("id", &id.0)
13844                    .inline_fragment("LLMContentBlock"),
13845                graphql_client: self.graphql_client.clone(),
13846            })
13847            .collect())
13848    }
13849    /// Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.
13850    pub fn token_usage(&self) -> LlmTokenUsage {
13851        let query = self.selection.select("tokenUsage");
13852        LlmTokenUsage {
13853            proc: self.proc.clone(),
13854            selection: query,
13855            graphql_client: self.graphql_client.clone(),
13856        }
13857    }
13858}
13859impl Node for LlmMessage {
13860    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13861        let query = self.selection.select("id");
13862        let graphql_client = self.graphql_client.clone();
13863        async move { query.execute(graphql_client).await }
13864    }
13865}
13866#[derive(Clone)]
13867pub struct LlmMessageOrigin {
13868    pub proc: Option<Arc<DaggerSessionProc>>,
13869    pub selection: Selection,
13870    pub graphql_client: DynGraphQLClient,
13871}
13872impl IntoID<Id> for LlmMessageOrigin {
13873    fn into_id(
13874        self,
13875    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13876        Box::pin(async move { self.id().await })
13877    }
13878}
13879impl Loadable for LlmMessageOrigin {
13880    fn graphql_type() -> &'static str {
13881        "LLMMessageOrigin"
13882    }
13883    fn from_query(
13884        proc: Option<Arc<DaggerSessionProc>>,
13885        selection: Selection,
13886        graphql_client: DynGraphQLClient,
13887    ) -> Self {
13888        Self {
13889            proc,
13890            selection,
13891            graphql_client,
13892        }
13893    }
13894}
13895impl LlmMessageOrigin {
13896    /// A unique identifier for this LLMMessageOrigin.
13897    pub async fn id(&self) -> Result<Id, DaggerError> {
13898        let query = self.selection.select("id");
13899        query.execute(self.graphql_client.clone()).await
13900    }
13901    /// Who put this message on the record.
13902    pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
13903        let query = self.selection.select("kind");
13904        query.execute(self.graphql_client.clone()).await
13905    }
13906    /// The display name of the sending agent (for AGENT origins) or the observed agent (for EVENT origins).
13907    pub async fn agent_name(&self) -> Result<String, DaggerError> {
13908        let query = self.selection.select("agentName");
13909        query.execute(self.graphql_client.clone()).await
13910    }
13911    /// 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.
13912    pub async fn r#ref(&self) -> Result<String, DaggerError> {
13913        let query = self.selection.select("ref");
13914        query.execute(self.graphql_client.clone()).await
13915    }
13916    /// The ref of the message this one answers, in the sender's own runtime, if any.
13917    pub async fn reply_to(&self) -> Result<String, DaggerError> {
13918        let query = self.selection.select("replyTo");
13919        query.execute(self.graphql_client.clone()).await
13920    }
13921}
13922impl Node for LlmMessageOrigin {
13923    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13924        let query = self.selection.select("id");
13925        let graphql_client = self.graphql_client.clone();
13926        async move { query.execute(graphql_client).await }
13927    }
13928}
13929#[derive(Clone)]
13930pub struct LlmSkill {
13931    pub proc: Option<Arc<DaggerSessionProc>>,
13932    pub selection: Selection,
13933    pub graphql_client: DynGraphQLClient,
13934}
13935impl IntoID<Id> for LlmSkill {
13936    fn into_id(
13937        self,
13938    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13939        Box::pin(async move { self.id().await })
13940    }
13941}
13942impl Loadable for LlmSkill {
13943    fn graphql_type() -> &'static str {
13944        "LLMSkill"
13945    }
13946    fn from_query(
13947        proc: Option<Arc<DaggerSessionProc>>,
13948        selection: Selection,
13949        graphql_client: DynGraphQLClient,
13950    ) -> Self {
13951        Self {
13952            proc,
13953            selection,
13954            graphql_client,
13955        }
13956    }
13957}
13958impl LlmSkill {
13959    /// A unique identifier for this LLMSkill.
13960    pub async fn id(&self) -> Result<Id, DaggerError> {
13961        let query = self.selection.select("id");
13962        query.execute(self.graphql_client.clone()).await
13963    }
13964    /// The skill name, as passed to ReadSkill.
13965    pub async fn name(&self) -> Result<String, DaggerError> {
13966        let query = self.selection.select("name");
13967        query.execute(self.graphql_client.clone()).await
13968    }
13969    /// The one-line description from the SKILL.md frontmatter.
13970    pub async fn description(&self) -> Result<String, DaggerError> {
13971        let query = self.selection.select("description");
13972        query.execute(self.graphql_client.clone()).await
13973    }
13974}
13975impl Node for LlmSkill {
13976    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13977        let query = self.selection.select("id");
13978        let graphql_client = self.graphql_client.clone();
13979        async move { query.execute(graphql_client).await }
13980    }
13981}
13982#[derive(Clone)]
13983pub struct LlmTokenUsage {
13984    pub proc: Option<Arc<DaggerSessionProc>>,
13985    pub selection: Selection,
13986    pub graphql_client: DynGraphQLClient,
13987}
13988impl IntoID<Id> for LlmTokenUsage {
13989    fn into_id(
13990        self,
13991    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13992        Box::pin(async move { self.id().await })
13993    }
13994}
13995impl Loadable for LlmTokenUsage {
13996    fn graphql_type() -> &'static str {
13997        "LLMTokenUsage"
13998    }
13999    fn from_query(
14000        proc: Option<Arc<DaggerSessionProc>>,
14001        selection: Selection,
14002        graphql_client: DynGraphQLClient,
14003    ) -> Self {
14004        Self {
14005            proc,
14006            selection,
14007            graphql_client,
14008        }
14009    }
14010}
14011impl LlmTokenUsage {
14012    /// A unique identifier for this LLMTokenUsage.
14013    pub async fn id(&self) -> Result<Id, DaggerError> {
14014        let query = self.selection.select("id");
14015        query.execute(self.graphql_client.clone()).await
14016    }
14017    /// Uncached input tokens sent to the model.
14018    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
14019        let query = self.selection.select("inputTokens");
14020        query.execute(self.graphql_client.clone()).await
14021    }
14022    /// Tokens received from the model, including text and tool calls.
14023    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
14024        let query = self.selection.select("outputTokens");
14025        query.execute(self.graphql_client.clone()).await
14026    }
14027    /// Input tokens served from the provider's prompt cache.
14028    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
14029        let query = self.selection.select("cachedTokenReads");
14030        query.execute(self.graphql_client.clone()).await
14031    }
14032    /// Input tokens written to the provider's prompt cache.
14033    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
14034        let query = self.selection.select("cachedTokenWrites");
14035        query.execute(self.graphql_client.clone()).await
14036    }
14037    /// Total tokens consumed, as reported by the provider.
14038    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
14039        let query = self.selection.select("totalTokens");
14040        query.execute(self.graphql_client.clone()).await
14041    }
14042}
14043impl Node for LlmTokenUsage {
14044    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14045        let query = self.selection.select("id");
14046        let graphql_client = self.graphql_client.clone();
14047        async move { query.execute(graphql_client).await }
14048    }
14049}
14050#[derive(Clone)]
14051pub struct Label {
14052    pub proc: Option<Arc<DaggerSessionProc>>,
14053    pub selection: Selection,
14054    pub graphql_client: DynGraphQLClient,
14055}
14056impl IntoID<Id> for Label {
14057    fn into_id(
14058        self,
14059    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14060        Box::pin(async move { self.id().await })
14061    }
14062}
14063impl Loadable for Label {
14064    fn graphql_type() -> &'static str {
14065        "Label"
14066    }
14067    fn from_query(
14068        proc: Option<Arc<DaggerSessionProc>>,
14069        selection: Selection,
14070        graphql_client: DynGraphQLClient,
14071    ) -> Self {
14072        Self {
14073            proc,
14074            selection,
14075            graphql_client,
14076        }
14077    }
14078}
14079impl Label {
14080    /// A unique identifier for this Label.
14081    pub async fn id(&self) -> Result<Id, DaggerError> {
14082        let query = self.selection.select("id");
14083        query.execute(self.graphql_client.clone()).await
14084    }
14085    /// The label name.
14086    pub async fn name(&self) -> Result<String, DaggerError> {
14087        let query = self.selection.select("name");
14088        query.execute(self.graphql_client.clone()).await
14089    }
14090    /// The label value.
14091    pub async fn value(&self) -> Result<String, DaggerError> {
14092        let query = self.selection.select("value");
14093        query.execute(self.graphql_client.clone()).await
14094    }
14095}
14096impl Node for Label {
14097    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14098        let query = self.selection.select("id");
14099        let graphql_client = self.graphql_client.clone();
14100        async move { query.execute(graphql_client).await }
14101    }
14102}
14103#[derive(Clone)]
14104pub struct ListTypeDef {
14105    pub proc: Option<Arc<DaggerSessionProc>>,
14106    pub selection: Selection,
14107    pub graphql_client: DynGraphQLClient,
14108}
14109impl IntoID<Id> for ListTypeDef {
14110    fn into_id(
14111        self,
14112    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14113        Box::pin(async move { self.id().await })
14114    }
14115}
14116impl Loadable for ListTypeDef {
14117    fn graphql_type() -> &'static str {
14118        "ListTypeDef"
14119    }
14120    fn from_query(
14121        proc: Option<Arc<DaggerSessionProc>>,
14122        selection: Selection,
14123        graphql_client: DynGraphQLClient,
14124    ) -> Self {
14125        Self {
14126            proc,
14127            selection,
14128            graphql_client,
14129        }
14130    }
14131}
14132impl ListTypeDef {
14133    /// A unique identifier for this ListTypeDef.
14134    pub async fn id(&self) -> Result<Id, DaggerError> {
14135        let query = self.selection.select("id");
14136        query.execute(self.graphql_client.clone()).await
14137    }
14138    /// The type of the elements in the list.
14139    pub fn element_type_def(&self) -> TypeDef {
14140        let query = self.selection.select("elementTypeDef");
14141        TypeDef {
14142            proc: self.proc.clone(),
14143            selection: query,
14144            graphql_client: self.graphql_client.clone(),
14145        }
14146    }
14147}
14148impl Node for ListTypeDef {
14149    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14150        let query = self.selection.select("id");
14151        let graphql_client = self.graphql_client.clone();
14152        async move { query.execute(graphql_client).await }
14153    }
14154}
14155#[derive(Clone)]
14156pub struct Module {
14157    pub proc: Option<Arc<DaggerSessionProc>>,
14158    pub selection: Selection,
14159    pub graphql_client: DynGraphQLClient,
14160}
14161#[derive(Builder, Debug, PartialEq)]
14162pub struct ModuleServeOpts {
14163    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
14164    #[builder(setter(into, strip_option), default)]
14165    pub entrypoint: Option<bool>,
14166    /// Expose the dependencies of this module to the client
14167    #[builder(setter(into, strip_option), default)]
14168    pub include_dependencies: Option<bool>,
14169}
14170impl IntoID<Id> for Module {
14171    fn into_id(
14172        self,
14173    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14174        Box::pin(async move { self.id().await })
14175    }
14176}
14177impl Loadable for Module {
14178    fn graphql_type() -> &'static str {
14179        "Module"
14180    }
14181    fn from_query(
14182        proc: Option<Arc<DaggerSessionProc>>,
14183        selection: Selection,
14184        graphql_client: DynGraphQLClient,
14185    ) -> Self {
14186        Self {
14187            proc,
14188            selection,
14189            graphql_client,
14190        }
14191    }
14192}
14193impl Module {
14194    /// A unique identifier for this Module.
14195    pub async fn id(&self) -> Result<Id, DaggerError> {
14196        let query = self.selection.select("id");
14197        query.execute(self.graphql_client.clone()).await
14198    }
14199    /// The source used to resolve contextual files and directories, when different from source.
14200    pub async fn context_source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14201        let query = self.selection.select("contextSource");
14202        let query = query.select("id");
14203        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14204        Ok(id.map(|id| ModuleSource {
14205            proc: self.proc.clone(),
14206            selection: query
14207                .root()
14208                .select("node")
14209                .arg("id", &id.0)
14210                .inline_fragment("ModuleSource"),
14211            graphql_client: self.graphql_client.clone(),
14212        }))
14213    }
14214    /// Forces evaluation of the module, including any loading into the engine and associated validation.
14215    pub async fn sync(&self) -> Result<Module, DaggerError> {
14216        let query = self.selection.select("sync");
14217        let id: Id = query.execute(self.graphql_client.clone()).await?;
14218        Ok(Module {
14219            proc: self.proc.clone(),
14220            selection: query
14221                .root()
14222                .select("node")
14223                .arg("id", &id.0)
14224                .inline_fragment("Module"),
14225            graphql_client: self.graphql_client.clone(),
14226        })
14227    }
14228    /// The dependencies of the module.
14229    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
14230        let query = self.selection.select("dependencies");
14231        let query = query.select("id");
14232        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14233        Ok(ids
14234            .into_iter()
14235            .map(|id| Module {
14236                proc: self.proc.clone(),
14237                selection: crate::querybuilder::query()
14238                    .select("node")
14239                    .arg("id", &id.0)
14240                    .inline_fragment("Module"),
14241                graphql_client: self.graphql_client.clone(),
14242            })
14243            .collect())
14244    }
14245    /// The introspection schema JSON file for this module.
14246    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
14247    /// Note: this is in the context of a module, so some core types may be hidden.
14248    pub fn introspection_schema_json(&self) -> File {
14249        let query = self.selection.select("introspectionSchemaJSON");
14250        File {
14251            proc: self.proc.clone(),
14252            selection: query,
14253            graphql_client: self.graphql_client.clone(),
14254        }
14255    }
14256    /// The generated files and directories made on top of the module source's context directory.
14257    pub fn generated_context_directory(&self) -> Directory {
14258        let query = self.selection.select("generatedContextDirectory");
14259        Directory {
14260            proc: self.proc.clone(),
14261            selection: query,
14262            graphql_client: self.graphql_client.clone(),
14263        }
14264    }
14265    /// User-defined default values, loaded from local .env files.
14266    pub fn user_defaults(&self) -> EnvFile {
14267        let query = self.selection.select("userDefaults");
14268        EnvFile {
14269            proc: self.proc.clone(),
14270            selection: query,
14271            graphql_client: self.graphql_client.clone(),
14272        }
14273    }
14274    /// Retrieves the module with the given description
14275    ///
14276    /// # Arguments
14277    ///
14278    /// * `description` - The description to set
14279    pub fn with_description(&self, description: impl Into<String>) -> Module {
14280        let mut query = self.selection.select("withDescription");
14281        query = query.arg("description", description.into());
14282        Module {
14283            proc: self.proc.clone(),
14284            selection: query,
14285            graphql_client: self.graphql_client.clone(),
14286        }
14287    }
14288    /// This module plus the given Object type and associated functions.
14289    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
14290        let mut query = self.selection.select("withObject");
14291        query = query.arg_lazy(
14292            "object",
14293            Box::new(move || {
14294                let object = object.clone();
14295                Box::pin(async move { object.into_id().await.unwrap().quote() })
14296            }),
14297        );
14298        Module {
14299            proc: self.proc.clone(),
14300            selection: query,
14301            graphql_client: self.graphql_client.clone(),
14302        }
14303    }
14304    /// This module plus the given Interface type and associated functions
14305    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
14306        let mut query = self.selection.select("withInterface");
14307        query = query.arg_lazy(
14308            "iface",
14309            Box::new(move || {
14310                let iface = iface.clone();
14311                Box::pin(async move { iface.into_id().await.unwrap().quote() })
14312            }),
14313        );
14314        Module {
14315            proc: self.proc.clone(),
14316            selection: query,
14317            graphql_client: self.graphql_client.clone(),
14318        }
14319    }
14320    /// This module plus the given Enum type and associated values
14321    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
14322        let mut query = self.selection.select("withEnum");
14323        query = query.arg_lazy(
14324            "enum",
14325            Box::new(move || {
14326                let r#enum = r#enum.clone();
14327                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
14328            }),
14329        );
14330        Module {
14331            proc: self.proc.clone(),
14332            selection: query,
14333            graphql_client: self.graphql_client.clone(),
14334        }
14335    }
14336    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
14337    pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
14338        let query = self.selection.select("runtime");
14339        let query = query.select("id");
14340        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14341        Ok(id.map(|id| Container {
14342            proc: self.proc.clone(),
14343            selection: query
14344                .root()
14345                .select("node")
14346                .arg("id", &id.0)
14347                .inline_fragment("Container"),
14348            graphql_client: self.graphql_client.clone(),
14349        }))
14350    }
14351    /// Serve a module's API in the current session.
14352    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14353    ///
14354    /// # Arguments
14355    ///
14356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14357    pub async fn serve(&self) -> Result<Void, DaggerError> {
14358        let query = self.selection.select("serve");
14359        query.execute(self.graphql_client.clone()).await
14360    }
14361    /// Serve a module's API in the current session.
14362    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
14363    ///
14364    /// # Arguments
14365    ///
14366    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14367    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
14368        let mut query = self.selection.select("serve");
14369        if let Some(include_dependencies) = opts.include_dependencies {
14370            query = query.arg("includeDependencies", include_dependencies);
14371        }
14372        if let Some(entrypoint) = opts.entrypoint {
14373            query = query.arg("entrypoint", entrypoint);
14374        }
14375        query.execute(self.graphql_client.clone()).await
14376    }
14377    /// The source for the module.
14378    pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14379        let query = self.selection.select("source");
14380        let query = query.select("id");
14381        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14382        Ok(id.map(|id| ModuleSource {
14383            proc: self.proc.clone(),
14384            selection: query
14385                .root()
14386                .select("node")
14387                .arg("id", &id.0)
14388                .inline_fragment("ModuleSource"),
14389            graphql_client: self.graphql_client.clone(),
14390        }))
14391    }
14392    /// The name of the module
14393    pub async fn name(&self) -> Result<String, DaggerError> {
14394        let query = self.selection.select("name");
14395        query.execute(self.graphql_client.clone()).await
14396    }
14397    /// The SDK config used by this module.
14398    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
14399        let query = self.selection.select("sdk");
14400        let query = query.select("id");
14401        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14402        Ok(id.map(|id| SdkConfig {
14403            proc: self.proc.clone(),
14404            selection: query
14405                .root()
14406                .select("node")
14407                .arg("id", &id.0)
14408                .inline_fragment("SDKConfig"),
14409            graphql_client: self.graphql_client.clone(),
14410        }))
14411    }
14412    /// The doc string of the module, if any
14413    pub async fn description(&self) -> Result<String, DaggerError> {
14414        let query = self.selection.select("description");
14415        query.execute(self.graphql_client.clone()).await
14416    }
14417    /// Objects served by this module.
14418    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
14419        let query = self.selection.select("objects");
14420        let query = query.select("id");
14421        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14422        Ok(ids
14423            .into_iter()
14424            .map(|id| TypeDef {
14425                proc: self.proc.clone(),
14426                selection: crate::querybuilder::query()
14427                    .select("node")
14428                    .arg("id", &id.0)
14429                    .inline_fragment("TypeDef"),
14430                graphql_client: self.graphql_client.clone(),
14431            })
14432            .collect())
14433    }
14434    /// Interfaces served by this module.
14435    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
14436        let query = self.selection.select("interfaces");
14437        let query = query.select("id");
14438        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14439        Ok(ids
14440            .into_iter()
14441            .map(|id| TypeDef {
14442                proc: self.proc.clone(),
14443                selection: crate::querybuilder::query()
14444                    .select("node")
14445                    .arg("id", &id.0)
14446                    .inline_fragment("TypeDef"),
14447                graphql_client: self.graphql_client.clone(),
14448            })
14449            .collect())
14450    }
14451    /// Enumerations served by this module.
14452    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
14453        let query = self.selection.select("enums");
14454        let query = query.select("id");
14455        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14456        Ok(ids
14457            .into_iter()
14458            .map(|id| TypeDef {
14459                proc: self.proc.clone(),
14460                selection: crate::querybuilder::query()
14461                    .select("node")
14462                    .arg("id", &id.0)
14463                    .inline_fragment("TypeDef"),
14464                graphql_client: self.graphql_client.clone(),
14465            })
14466            .collect())
14467    }
14468}
14469impl Node for Module {
14470    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14471        let query = self.selection.select("id");
14472        let graphql_client = self.graphql_client.clone();
14473        async move { query.execute(graphql_client).await }
14474    }
14475}
14476impl Syncer for Module {
14477    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14478        let query = self.selection.select("id");
14479        let graphql_client = self.graphql_client.clone();
14480        async move { query.execute(graphql_client).await }
14481    }
14482    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
14483        let query = self.selection.select("sync");
14484        let proc = self.proc.clone();
14485        let graphql_client = self.graphql_client.clone();
14486        async move {
14487            let id: Id = query.execute(graphql_client.clone()).await?;
14488            Ok(Self {
14489                proc,
14490                selection: query
14491                    .root()
14492                    .select("node")
14493                    .arg("id", &id.0)
14494                    .inline_fragment("Module"),
14495                graphql_client,
14496            })
14497        }
14498    }
14499}
14500#[derive(Clone)]
14501pub struct ModuleConfigClient {
14502    pub proc: Option<Arc<DaggerSessionProc>>,
14503    pub selection: Selection,
14504    pub graphql_client: DynGraphQLClient,
14505}
14506impl IntoID<Id> for ModuleConfigClient {
14507    fn into_id(
14508        self,
14509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14510        Box::pin(async move { self.id().await })
14511    }
14512}
14513impl Loadable for ModuleConfigClient {
14514    fn graphql_type() -> &'static str {
14515        "ModuleConfigClient"
14516    }
14517    fn from_query(
14518        proc: Option<Arc<DaggerSessionProc>>,
14519        selection: Selection,
14520        graphql_client: DynGraphQLClient,
14521    ) -> Self {
14522        Self {
14523            proc,
14524            selection,
14525            graphql_client,
14526        }
14527    }
14528}
14529impl ModuleConfigClient {
14530    /// A unique identifier for this ModuleConfigClient.
14531    pub async fn id(&self) -> Result<Id, DaggerError> {
14532        let query = self.selection.select("id");
14533        query.execute(self.graphql_client.clone()).await
14534    }
14535    /// The generator to use
14536    pub async fn generator(&self) -> Result<String, DaggerError> {
14537        let query = self.selection.select("generator");
14538        query.execute(self.graphql_client.clone()).await
14539    }
14540    /// The directory the client is generated in.
14541    pub async fn directory(&self) -> Result<String, DaggerError> {
14542        let query = self.selection.select("directory");
14543        query.execute(self.graphql_client.clone()).await
14544    }
14545}
14546impl Node for ModuleConfigClient {
14547    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14548        let query = self.selection.select("id");
14549        let graphql_client = self.graphql_client.clone();
14550        async move { query.execute(graphql_client).await }
14551    }
14552}
14553#[derive(Clone)]
14554pub struct ModuleSource {
14555    pub proc: Option<Arc<DaggerSessionProc>>,
14556    pub selection: Selection,
14557    pub graphql_client: DynGraphQLClient,
14558}
14559impl IntoID<Id> for ModuleSource {
14560    fn into_id(
14561        self,
14562    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14563        Box::pin(async move { self.id().await })
14564    }
14565}
14566impl Loadable for ModuleSource {
14567    fn graphql_type() -> &'static str {
14568        "ModuleSource"
14569    }
14570    fn from_query(
14571        proc: Option<Arc<DaggerSessionProc>>,
14572        selection: Selection,
14573        graphql_client: DynGraphQLClient,
14574    ) -> Self {
14575        Self {
14576            proc,
14577            selection,
14578            graphql_client,
14579        }
14580    }
14581}
14582impl ModuleSource {
14583    /// A unique identifier for this ModuleSource.
14584    pub async fn id(&self) -> Result<Id, DaggerError> {
14585        let query = self.selection.select("id");
14586        query.execute(self.graphql_client.clone()).await
14587    }
14588    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
14589    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
14590        let query = self.selection.select("sync");
14591        let id: Id = query.execute(self.graphql_client.clone()).await?;
14592        Ok(ModuleSource {
14593            proc: self.proc.clone(),
14594            selection: query
14595                .root()
14596                .select("node")
14597                .arg("id", &id.0)
14598                .inline_fragment("ModuleSource"),
14599            graphql_client: self.graphql_client.clone(),
14600        })
14601    }
14602    /// The path to the directory containing the module's source code, relative to the context directory.
14603    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
14604        let query = self.selection.select("sourceSubpath");
14605        query.execute(self.graphql_client.clone()).await
14606    }
14607    /// The original subpath used when instantiating this module source, relative to the context directory.
14608    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
14609        let query = self.selection.select("originalSubpath");
14610        query.execute(self.graphql_client.clone()).await
14611    }
14612    /// 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.
14613    pub async fn digest(&self) -> Result<String, DaggerError> {
14614        let query = self.selection.select("digest");
14615        query.execute(self.graphql_client.clone()).await
14616    }
14617    /// Update the module source with a new source subpath.
14618    ///
14619    /// # Arguments
14620    ///
14621    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
14622    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
14623        let mut query = self.selection.select("withSourceSubpath");
14624        query = query.arg("path", path.into());
14625        ModuleSource {
14626            proc: self.proc.clone(),
14627            selection: query,
14628            graphql_client: self.graphql_client.clone(),
14629        }
14630    }
14631    /// Update the module source with a new name.
14632    ///
14633    /// # Arguments
14634    ///
14635    /// * `name` - The name to set.
14636    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
14637        let mut query = self.selection.select("withName");
14638        query = query.arg("name", name.into());
14639        ModuleSource {
14640            proc: self.proc.clone(),
14641            selection: query,
14642            graphql_client: self.graphql_client.clone(),
14643        }
14644    }
14645    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
14646    ///
14647    /// # Arguments
14648    ///
14649    /// * `patterns` - The new additional include patterns.
14650    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
14651        let mut query = self.selection.select("withIncludes");
14652        query = query.arg(
14653            "patterns",
14654            patterns
14655                .into_iter()
14656                .map(|i| i.into())
14657                .collect::<Vec<String>>(),
14658        );
14659        ModuleSource {
14660            proc: self.proc.clone(),
14661            selection: query,
14662            graphql_client: self.graphql_client.clone(),
14663        }
14664    }
14665    /// Update the module source with a new SDK.
14666    ///
14667    /// # Arguments
14668    ///
14669    /// * `source` - The SDK source to set.
14670    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
14671        let mut query = self.selection.select("withSDK");
14672        query = query.arg("source", source.into());
14673        ModuleSource {
14674            proc: self.proc.clone(),
14675            selection: query,
14676            graphql_client: self.graphql_client.clone(),
14677        }
14678    }
14679    /// Upgrade the engine version of the module to the given value.
14680    ///
14681    /// # Arguments
14682    ///
14683    /// * `version` - The engine version to upgrade to.
14684    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
14685        let mut query = self.selection.select("withEngineVersion");
14686        query = query.arg("version", version.into());
14687        ModuleSource {
14688            proc: self.proc.clone(),
14689            selection: query,
14690            graphql_client: self.graphql_client.clone(),
14691        }
14692    }
14693    /// Append the provided dependencies to the module source's dependency list.
14694    ///
14695    /// # Arguments
14696    ///
14697    /// * `dependencies` - The dependencies to append.
14698    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
14699        let mut query = self.selection.select("withDependencies");
14700        query = query.arg("dependencies", dependencies);
14701        ModuleSource {
14702            proc: self.proc.clone(),
14703            selection: query,
14704            graphql_client: self.graphql_client.clone(),
14705        }
14706    }
14707    /// Update one or more module dependencies.
14708    ///
14709    /// # Arguments
14710    ///
14711    /// * `dependencies` - The dependencies to update.
14712    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14713        let mut query = self.selection.select("withUpdateDependencies");
14714        query = query.arg(
14715            "dependencies",
14716            dependencies
14717                .into_iter()
14718                .map(|i| i.into())
14719                .collect::<Vec<String>>(),
14720        );
14721        ModuleSource {
14722            proc: self.proc.clone(),
14723            selection: query,
14724            graphql_client: self.graphql_client.clone(),
14725        }
14726    }
14727    /// Remove the provided dependencies from the module source's dependency list.
14728    ///
14729    /// # Arguments
14730    ///
14731    /// * `dependencies` - The dependencies to remove.
14732    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14733        let mut query = self.selection.select("withoutDependencies");
14734        query = query.arg(
14735            "dependencies",
14736            dependencies
14737                .into_iter()
14738                .map(|i| i.into())
14739                .collect::<Vec<String>>(),
14740        );
14741        ModuleSource {
14742            proc: self.proc.clone(),
14743            selection: query,
14744            graphql_client: self.graphql_client.clone(),
14745        }
14746    }
14747    /// Set a blueprint for the module source.
14748    ///
14749    /// # Arguments
14750    ///
14751    /// * `blueprint` - The blueprint module to set.
14752    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
14753        let mut query = self.selection.select("withBlueprint");
14754        query = query.arg_lazy(
14755            "blueprint",
14756            Box::new(move || {
14757                let blueprint = blueprint.clone();
14758                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
14759            }),
14760        );
14761        ModuleSource {
14762            proc: self.proc.clone(),
14763            selection: query,
14764            graphql_client: self.graphql_client.clone(),
14765        }
14766    }
14767    /// Add toolchains to the module source.
14768    ///
14769    /// # Arguments
14770    ///
14771    /// * `toolchains` - The toolchain modules to add.
14772    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
14773        let mut query = self.selection.select("withToolchains");
14774        query = query.arg("toolchains", toolchains);
14775        ModuleSource {
14776            proc: self.proc.clone(),
14777            selection: query,
14778            graphql_client: self.graphql_client.clone(),
14779        }
14780    }
14781    /// Update one or more toolchains.
14782    ///
14783    /// # Arguments
14784    ///
14785    /// * `toolchains` - The toolchains to update.
14786    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14787        let mut query = self.selection.select("withUpdateToolchains");
14788        query = query.arg(
14789            "toolchains",
14790            toolchains
14791                .into_iter()
14792                .map(|i| i.into())
14793                .collect::<Vec<String>>(),
14794        );
14795        ModuleSource {
14796            proc: self.proc.clone(),
14797            selection: query,
14798            graphql_client: self.graphql_client.clone(),
14799        }
14800    }
14801    /// Remove the provided toolchains from the module source.
14802    ///
14803    /// # Arguments
14804    ///
14805    /// * `toolchains` - The toolchains to remove.
14806    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14807        let mut query = self.selection.select("withoutToolchains");
14808        query = query.arg(
14809            "toolchains",
14810            toolchains
14811                .into_iter()
14812                .map(|i| i.into())
14813                .collect::<Vec<String>>(),
14814        );
14815        ModuleSource {
14816            proc: self.proc.clone(),
14817            selection: query,
14818            graphql_client: self.graphql_client.clone(),
14819        }
14820    }
14821    /// Update the blueprint module to the latest version.
14822    pub fn with_update_blueprint(&self) -> ModuleSource {
14823        let query = self.selection.select("withUpdateBlueprint");
14824        ModuleSource {
14825            proc: self.proc.clone(),
14826            selection: query,
14827            graphql_client: self.graphql_client.clone(),
14828        }
14829    }
14830    /// Remove the current blueprint from the module source.
14831    pub fn without_blueprint(&self) -> ModuleSource {
14832        let query = self.selection.select("withoutBlueprint");
14833        ModuleSource {
14834            proc: self.proc.clone(),
14835            selection: query,
14836            graphql_client: self.graphql_client.clone(),
14837        }
14838    }
14839    /// Enable the experimental features for the module source.
14840    ///
14841    /// # Arguments
14842    ///
14843    /// * `features` - The experimental features to enable.
14844    pub fn with_experimental_features(
14845        &self,
14846        features: Vec<ModuleSourceExperimentalFeature>,
14847    ) -> ModuleSource {
14848        let mut query = self.selection.select("withExperimentalFeatures");
14849        query = query.arg("features", features);
14850        ModuleSource {
14851            proc: self.proc.clone(),
14852            selection: query,
14853            graphql_client: self.graphql_client.clone(),
14854        }
14855    }
14856    /// Disable experimental features for the module source.
14857    ///
14858    /// # Arguments
14859    ///
14860    /// * `features` - The experimental features to disable.
14861    pub fn without_experimental_features(
14862        &self,
14863        features: Vec<ModuleSourceExperimentalFeature>,
14864    ) -> ModuleSource {
14865        let mut query = self.selection.select("withoutExperimentalFeatures");
14866        query = query.arg("features", features);
14867        ModuleSource {
14868            proc: self.proc.clone(),
14869            selection: query,
14870            graphql_client: self.graphql_client.clone(),
14871        }
14872    }
14873    /// The generated files and directories made on top of the module source's context directory.
14874    pub fn generated_context_directory(&self) -> Directory {
14875        let query = self.selection.select("generatedContextDirectory");
14876        Directory {
14877            proc: self.proc.clone(),
14878            selection: query,
14879            graphql_client: self.graphql_client.clone(),
14880        }
14881    }
14882    /// The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.
14883    /// 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.
14884    pub fn updated_config_directory(&self) -> Directory {
14885        let query = self.selection.select("updatedConfigDirectory");
14886        Directory {
14887            proc: self.proc.clone(),
14888            selection: query,
14889            graphql_client: self.graphql_client.clone(),
14890        }
14891    }
14892    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
14893    pub fn generated_context_changeset(&self) -> Changeset {
14894        let query = self.selection.select("generatedContextChangeset");
14895        Changeset {
14896            proc: self.proc.clone(),
14897            selection: query,
14898            graphql_client: self.graphql_client.clone(),
14899        }
14900    }
14901    /// Return the supplied workspace with this module's generated context applied.
14902    /// The workspace change baseline is preserved, so a later Workspace.changes call includes this generation together with any other edits made by the caller.
14903    ///
14904    /// # Arguments
14905    ///
14906    /// * `workspace` - The workspace to apply generated files to.
14907    pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
14908        let mut query = self.selection.select("generate");
14909        query = query.arg_lazy(
14910            "workspace",
14911            Box::new(move || {
14912                let workspace = workspace.clone();
14913                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
14914            }),
14915        );
14916        Workspace {
14917            proc: self.proc.clone(),
14918            selection: query,
14919            graphql_client: self.graphql_client.clone(),
14920        }
14921    }
14922    /// A human readable ref string representation of this module source.
14923    pub async fn as_string(&self) -> Result<String, DaggerError> {
14924        let query = self.selection.select("asString");
14925        query.execute(self.graphql_client.clone()).await
14926    }
14927    /// The pinned version of this module source.
14928    pub async fn pin(&self) -> Result<String, DaggerError> {
14929        let query = self.selection.select("pin");
14930        query.execute(self.graphql_client.clone()).await
14931    }
14932    /// 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.
14933    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
14934        let query = self.selection.select("localContextDirectoryPath");
14935        query.execute(self.graphql_client.clone()).await
14936    }
14937    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
14938    pub fn as_module(&self) -> Module {
14939        let query = self.selection.select("asModule");
14940        Module {
14941            proc: self.proc.clone(),
14942            selection: query,
14943            graphql_client: self.graphql_client.clone(),
14944        }
14945    }
14946    /// The introspection schema JSON file for this module source.
14947    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
14948    /// Note: this is in the context of a module, so some core types may be hidden.
14949    pub fn introspection_schema_json(&self) -> File {
14950        let query = self.selection.select("introspectionSchemaJSON");
14951        File {
14952            proc: self.proc.clone(),
14953            selection: query,
14954            graphql_client: self.graphql_client.clone(),
14955        }
14956    }
14957    /// The client-facing introspection schema JSON file for this module source.
14958    /// 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.
14959    pub fn client_schema_introspection_json(&self) -> File {
14960        let query = self.selection.select("clientSchemaIntrospectionJSON");
14961        File {
14962            proc: self.proc.clone(),
14963            selection: query,
14964            graphql_client: self.graphql_client.clone(),
14965        }
14966    }
14967    /// The directory containing the module configuration and source code (source code may be in a subdir).
14968    ///
14969    /// # Arguments
14970    ///
14971    /// * `path` - A subpath from the source directory to select.
14972    pub fn directory(&self, path: impl Into<String>) -> Directory {
14973        let mut query = self.selection.select("directory");
14974        query = query.arg("path", path.into());
14975        Directory {
14976            proc: self.proc.clone(),
14977            selection: query,
14978            graphql_client: self.graphql_client.clone(),
14979        }
14980    }
14981    /// The ref to clone the root of the git repo from. Only valid for git sources.
14982    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
14983        let query = self.selection.select("cloneRef");
14984        query.execute(self.graphql_client.clone()).await
14985    }
14986    /// The URL to the source's git repo in a web browser. Only valid for git sources.
14987    pub async fn html_url(&self) -> Result<String, DaggerError> {
14988        let query = self.selection.select("htmlURL");
14989        query.execute(self.graphql_client.clone()).await
14990    }
14991    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
14992    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
14993        let query = self.selection.select("htmlRepoURL");
14994        query.execute(self.graphql_client.clone()).await
14995    }
14996    /// The specified version of the git repo this source points to.
14997    pub async fn version(&self) -> Result<String, DaggerError> {
14998        let query = self.selection.select("version");
14999        query.execute(self.graphql_client.clone()).await
15000    }
15001    /// The resolved commit of the git repo this source points to.
15002    pub async fn commit(&self) -> Result<String, DaggerError> {
15003        let query = self.selection.select("commit");
15004        query.execute(self.graphql_client.clone()).await
15005    }
15006    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
15007    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
15008        let query = self.selection.select("repoRootPath");
15009        query.execute(self.graphql_client.clone()).await
15010    }
15011    /// Update the module source with a new client to generate.
15012    ///
15013    /// # Arguments
15014    ///
15015    /// * `generator` - The generator to use
15016    /// * `output_dir` - The output directory for the generated client.
15017    pub fn with_client(
15018        &self,
15019        generator: impl Into<String>,
15020        output_dir: impl Into<String>,
15021    ) -> ModuleSource {
15022        let mut query = self.selection.select("withClient");
15023        query = query.arg("generator", generator.into());
15024        query = query.arg("outputDir", output_dir.into());
15025        ModuleSource {
15026            proc: self.proc.clone(),
15027            selection: query,
15028            graphql_client: self.graphql_client.clone(),
15029        }
15030    }
15031    /// Update one or more clients.
15032    ///
15033    /// # Arguments
15034    ///
15035    /// * `clients` - The clients to update
15036    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
15037        let mut query = self.selection.select("withUpdatedClients");
15038        query = query.arg(
15039            "clients",
15040            clients
15041                .into_iter()
15042                .map(|i| i.into())
15043                .collect::<Vec<String>>(),
15044        );
15045        ModuleSource {
15046            proc: self.proc.clone(),
15047            selection: query,
15048            graphql_client: self.graphql_client.clone(),
15049        }
15050    }
15051    /// Remove a client from the module source.
15052    ///
15053    /// # Arguments
15054    ///
15055    /// * `path` - The path of the client to remove.
15056    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
15057        let mut query = self.selection.select("withoutClient");
15058        query = query.arg("path", path.into());
15059        ModuleSource {
15060            proc: self.proc.clone(),
15061            selection: query,
15062            graphql_client: self.graphql_client.clone(),
15063        }
15064    }
15065    /// Whether an existing module config file was found.
15066    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
15067        let query = self.selection.select("configExists");
15068        query.execute(self.graphql_client.clone()).await
15069    }
15070    /// The name of the module, including any setting via the withName API.
15071    pub async fn module_name(&self) -> Result<String, DaggerError> {
15072        let query = self.selection.select("moduleName");
15073        query.execute(self.graphql_client.clone()).await
15074    }
15075    /// The original name of the module as read from the module config file (or set for the first time with the withName API).
15076    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
15077        let query = self.selection.select("moduleOriginalName");
15078        query.execute(self.graphql_client.clone()).await
15079    }
15080    /// The engine version of the module.
15081    pub async fn engine_version(&self) -> Result<String, DaggerError> {
15082        let query = self.selection.select("engineVersion");
15083        query.execute(self.graphql_client.clone()).await
15084    }
15085    /// The SDK configuration of the module.
15086    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
15087        let query = self.selection.select("sdk");
15088        let query = query.select("id");
15089        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15090        Ok(id.map(|id| SdkConfig {
15091            proc: self.proc.clone(),
15092            selection: query
15093                .root()
15094                .select("node")
15095                .arg("id", &id.0)
15096                .inline_fragment("SDKConfig"),
15097            graphql_client: self.graphql_client.clone(),
15098        }))
15099    }
15100    /// The dependencies of the module source.
15101    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15102        let query = self.selection.select("dependencies");
15103        let query = query.select("id");
15104        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15105        Ok(ids
15106            .into_iter()
15107            .map(|id| ModuleSource {
15108                proc: self.proc.clone(),
15109                selection: crate::querybuilder::query()
15110                    .select("node")
15111                    .arg("id", &id.0)
15112                    .inline_fragment("ModuleSource"),
15113                graphql_client: self.graphql_client.clone(),
15114            })
15115            .collect())
15116    }
15117    /// The blueprint referenced by the module source.
15118    pub fn blueprint(&self) -> ModuleSource {
15119        let query = self.selection.select("blueprint");
15120        ModuleSource {
15121            proc: self.proc.clone(),
15122            selection: query,
15123            graphql_client: self.graphql_client.clone(),
15124        }
15125    }
15126    /// The toolchains referenced by the module source.
15127    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15128        let query = self.selection.select("toolchains");
15129        let query = query.select("id");
15130        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15131        Ok(ids
15132            .into_iter()
15133            .map(|id| ModuleSource {
15134                proc: self.proc.clone(),
15135                selection: crate::querybuilder::query()
15136                    .select("node")
15137                    .arg("id", &id.0)
15138                    .inline_fragment("ModuleSource"),
15139                graphql_client: self.graphql_client.clone(),
15140            })
15141            .collect())
15142    }
15143    /// User-defined defaults read from local .env files
15144    pub fn user_defaults(&self) -> EnvFile {
15145        let query = self.selection.select("userDefaults");
15146        EnvFile {
15147            proc: self.proc.clone(),
15148            selection: query,
15149            graphql_client: self.graphql_client.clone(),
15150        }
15151    }
15152    /// The clients generated for the module.
15153    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
15154        let query = self.selection.select("configClients");
15155        let query = query.select("id");
15156        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15157        Ok(ids
15158            .into_iter()
15159            .map(|id| ModuleConfigClient {
15160                proc: self.proc.clone(),
15161                selection: crate::querybuilder::query()
15162                    .select("node")
15163                    .arg("id", &id.0)
15164                    .inline_fragment("ModuleConfigClient"),
15165                graphql_client: self.graphql_client.clone(),
15166            })
15167            .collect())
15168    }
15169    /// The path, relative to the context directory, that contains the module config.
15170    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
15171        let query = self.selection.select("sourceRootSubpath");
15172        query.execute(self.graphql_client.clone()).await
15173    }
15174    /// The full directory loaded for the module source, including the source code as a subdirectory.
15175    pub fn context_directory(&self) -> Directory {
15176        let query = self.selection.select("contextDirectory");
15177        Directory {
15178            proc: self.proc.clone(),
15179            selection: query,
15180            graphql_client: self.graphql_client.clone(),
15181        }
15182    }
15183    /// The kind of module source (currently local, git or dir).
15184    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
15185        let query = self.selection.select("kind");
15186        query.execute(self.graphql_client.clone()).await
15187    }
15188}
15189impl Node for ModuleSource {
15190    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15191        let query = self.selection.select("id");
15192        let graphql_client = self.graphql_client.clone();
15193        async move { query.execute(graphql_client).await }
15194    }
15195}
15196impl Syncer for ModuleSource {
15197    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15198        let query = self.selection.select("id");
15199        let graphql_client = self.graphql_client.clone();
15200        async move { query.execute(graphql_client).await }
15201    }
15202    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15203        let query = self.selection.select("sync");
15204        let proc = self.proc.clone();
15205        let graphql_client = self.graphql_client.clone();
15206        async move {
15207            let id: Id = query.execute(graphql_client.clone()).await?;
15208            Ok(Self {
15209                proc,
15210                selection: query
15211                    .root()
15212                    .select("node")
15213                    .arg("id", &id.0)
15214                    .inline_fragment("ModuleSource"),
15215                graphql_client,
15216            })
15217        }
15218    }
15219}
15220#[derive(Clone)]
15221pub struct ObjectTypeDef {
15222    pub proc: Option<Arc<DaggerSessionProc>>,
15223    pub selection: Selection,
15224    pub graphql_client: DynGraphQLClient,
15225}
15226impl IntoID<Id> for ObjectTypeDef {
15227    fn into_id(
15228        self,
15229    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15230        Box::pin(async move { self.id().await })
15231    }
15232}
15233impl Loadable for ObjectTypeDef {
15234    fn graphql_type() -> &'static str {
15235        "ObjectTypeDef"
15236    }
15237    fn from_query(
15238        proc: Option<Arc<DaggerSessionProc>>,
15239        selection: Selection,
15240        graphql_client: DynGraphQLClient,
15241    ) -> Self {
15242        Self {
15243            proc,
15244            selection,
15245            graphql_client,
15246        }
15247    }
15248}
15249impl ObjectTypeDef {
15250    /// A unique identifier for this ObjectTypeDef.
15251    pub async fn id(&self) -> Result<Id, DaggerError> {
15252        let query = self.selection.select("id");
15253        query.execute(self.graphql_client.clone()).await
15254    }
15255    /// The name of the object.
15256    pub async fn name(&self) -> Result<String, DaggerError> {
15257        let query = self.selection.select("name");
15258        query.execute(self.graphql_client.clone()).await
15259    }
15260    /// The doc string for the object, if any.
15261    pub async fn description(&self) -> Result<String, DaggerError> {
15262        let query = self.selection.select("description");
15263        query.execute(self.graphql_client.clone()).await
15264    }
15265    /// The location of this object declaration.
15266    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
15267        let query = self.selection.select("sourceMap");
15268        let query = query.select("id");
15269        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15270        Ok(id.map(|id| SourceMap {
15271            proc: self.proc.clone(),
15272            selection: query
15273                .root()
15274                .select("node")
15275                .arg("id", &id.0)
15276                .inline_fragment("SourceMap"),
15277            graphql_client: self.graphql_client.clone(),
15278        }))
15279    }
15280    /// The reason this enum member is deprecated, if any.
15281    pub async fn deprecated(&self) -> Result<String, DaggerError> {
15282        let query = self.selection.select("deprecated");
15283        query.execute(self.graphql_client.clone()).await
15284    }
15285    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
15286    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15287        let query = self.selection.select("sourceModuleName");
15288        query.execute(self.graphql_client.clone()).await
15289    }
15290    /// Static fields defined on this object, if any.
15291    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
15292        let query = self.selection.select("fields");
15293        let query = query.select("id");
15294        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15295        Ok(ids
15296            .into_iter()
15297            .map(|id| FieldTypeDef {
15298                proc: self.proc.clone(),
15299                selection: crate::querybuilder::query()
15300                    .select("node")
15301                    .arg("id", &id.0)
15302                    .inline_fragment("FieldTypeDef"),
15303                graphql_client: self.graphql_client.clone(),
15304            })
15305            .collect())
15306    }
15307    /// Functions defined on this object, if any.
15308    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
15309        let query = self.selection.select("functions");
15310        let query = query.select("id");
15311        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15312        Ok(ids
15313            .into_iter()
15314            .map(|id| Function {
15315                proc: self.proc.clone(),
15316                selection: crate::querybuilder::query()
15317                    .select("node")
15318                    .arg("id", &id.0)
15319                    .inline_fragment("Function"),
15320                graphql_client: self.graphql_client.clone(),
15321            })
15322            .collect())
15323    }
15324    /// The function used to construct new instances of this object, if any.
15325    pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
15326        let query = self.selection.select("constructor");
15327        let query = query.select("id");
15328        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15329        Ok(id.map(|id| Function {
15330            proc: self.proc.clone(),
15331            selection: query
15332                .root()
15333                .select("node")
15334                .arg("id", &id.0)
15335                .inline_fragment("Function"),
15336            graphql_client: self.graphql_client.clone(),
15337        }))
15338    }
15339}
15340impl Node for ObjectTypeDef {
15341    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15342        let query = self.selection.select("id");
15343        let graphql_client = self.graphql_client.clone();
15344        async move { query.execute(graphql_client).await }
15345    }
15346}
15347#[derive(Clone)]
15348pub struct Port {
15349    pub proc: Option<Arc<DaggerSessionProc>>,
15350    pub selection: Selection,
15351    pub graphql_client: DynGraphQLClient,
15352}
15353impl IntoID<Id> for Port {
15354    fn into_id(
15355        self,
15356    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15357        Box::pin(async move { self.id().await })
15358    }
15359}
15360impl Loadable for Port {
15361    fn graphql_type() -> &'static str {
15362        "Port"
15363    }
15364    fn from_query(
15365        proc: Option<Arc<DaggerSessionProc>>,
15366        selection: Selection,
15367        graphql_client: DynGraphQLClient,
15368    ) -> Self {
15369        Self {
15370            proc,
15371            selection,
15372            graphql_client,
15373        }
15374    }
15375}
15376impl Port {
15377    /// A unique identifier for this Port.
15378    pub async fn id(&self) -> Result<Id, DaggerError> {
15379        let query = self.selection.select("id");
15380        query.execute(self.graphql_client.clone()).await
15381    }
15382    /// The port number.
15383    pub async fn port(&self) -> Result<isize, DaggerError> {
15384        let query = self.selection.select("port");
15385        query.execute(self.graphql_client.clone()).await
15386    }
15387    /// The transport layer protocol.
15388    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
15389        let query = self.selection.select("protocol");
15390        query.execute(self.graphql_client.clone()).await
15391    }
15392    /// The port description.
15393    pub async fn description(&self) -> Result<String, DaggerError> {
15394        let query = self.selection.select("description");
15395        query.execute(self.graphql_client.clone()).await
15396    }
15397    /// Skip the health check when run as a service.
15398    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
15399        let query = self.selection.select("experimentalSkipHealthcheck");
15400        query.execute(self.graphql_client.clone()).await
15401    }
15402}
15403impl Node for Port {
15404    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15405        let query = self.selection.select("id");
15406        let graphql_client = self.graphql_client.clone();
15407        async move { query.execute(graphql_client).await }
15408    }
15409}
15410#[derive(Clone)]
15411pub struct Query {
15412    pub proc: Option<Arc<DaggerSessionProc>>,
15413    pub selection: Selection,
15414    pub graphql_client: DynGraphQLClient,
15415}
15416#[derive(Builder, Debug, PartialEq)]
15417pub struct QueryFileOpts {
15418    /// Permissions of the new file. Example: 0600
15419    #[builder(setter(into, strip_option), default)]
15420    pub permissions: Option<isize>,
15421}
15422#[derive(Builder, Debug, PartialEq)]
15423pub struct QueryBlobOpts {
15424    /// Permissions of the new file. Example: 0600
15425    #[builder(setter(into, strip_option), default)]
15426    pub permissions: Option<isize>,
15427}
15428#[derive(Builder, Debug, PartialEq)]
15429pub struct QueryGitOpts<'a> {
15430    /// A service which must be started before the repo is fetched.
15431    #[builder(setter(into, strip_option), default)]
15432    pub experimental_service_host: Option<Id>,
15433    /// Secret used to populate the Authorization HTTP header
15434    #[builder(setter(into, strip_option), default)]
15435    pub http_auth_header: Option<Id>,
15436    /// Secret used to populate the password during basic HTTP Authorization
15437    #[builder(setter(into, strip_option), default)]
15438    pub http_auth_token: Option<Id>,
15439    /// Username used to populate the password during basic HTTP Authorization
15440    #[builder(setter(into, strip_option), default)]
15441    pub http_auth_username: Option<&'a str>,
15442    /// DEPRECATED: Set to true to keep .git directory.
15443    #[builder(setter(into, strip_option), default)]
15444    pub keep_git_dir: Option<bool>,
15445    /// Set SSH auth socket
15446    #[builder(setter(into, strip_option), default)]
15447    pub ssh_auth_socket: Option<Id>,
15448    /// Set SSH known hosts
15449    #[builder(setter(into, strip_option), default)]
15450    pub ssh_known_hosts: Option<&'a str>,
15451}
15452#[derive(Builder, Debug, PartialEq)]
15453pub struct QueryContainerOpts {
15454    /// Platform to initialize the container with. Defaults to the native platform of the current engine
15455    #[builder(setter(into, strip_option), default)]
15456    pub platform: Option<Platform>,
15457}
15458#[derive(Builder, Debug, PartialEq)]
15459pub struct QueryCacheVolumeOpts<'a> {
15460    /// A user:group to set for the cache volume root.
15461    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
15462    /// If the group is omitted, it defaults to the same as the user.
15463    #[builder(setter(into, strip_option), default)]
15464    pub owner: Option<&'a str>,
15465    /// Sharing mode of the cache volume.
15466    #[builder(setter(into, strip_option), default)]
15467    pub sharing: Option<CacheSharingMode>,
15468    /// Identifier of the directory to use as the cache volume's root.
15469    #[builder(setter(into, strip_option), default)]
15470    pub source: Option<Id>,
15471}
15472#[derive(Builder, Debug, PartialEq)]
15473pub struct QueryEngineVolumeOpts<'a> {
15474    /// Optional existing subdirectory within the volume payload to mount.
15475    #[builder(setter(into, strip_option), default)]
15476    pub subdir: Option<&'a str>,
15477}
15478#[derive(Builder, Debug, PartialEq)]
15479pub struct QuerySshfsVolumeOpts<'a> {
15480    /// Optional cache equivalence key. If set, volumes with the same cacheKey may be considered equivalent for cache lookups, still subject to their resource dependencies.
15481    #[builder(setter(into, strip_option), default)]
15482    pub cache_key: Option<&'a str>,
15483    /// Service to use as the SSHFS network endpoint while verifying the original host key.
15484    #[builder(setter(into, strip_option), default)]
15485    pub experimental_service_host: Option<Id>,
15486    /// Disable SSH host key verification. This is insecure and must be explicitly opted into.
15487    #[builder(setter(into, strip_option), default)]
15488    pub insecure_skip_host_key_check: Option<bool>,
15489    /// known_hosts material used to verify the remote host key. Required unless insecureSkipHostKeyCheck is true.
15490    #[builder(setter(into, strip_option), default)]
15491    pub known_hosts: Option<Id>,
15492}
15493#[derive(Builder, Debug, PartialEq)]
15494pub struct QuerySecretOpts<'a> {
15495    /// 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.
15496    /// 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.
15497    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
15498    #[builder(setter(into, strip_option), default)]
15499    pub cache_key: Option<&'a str>,
15500}
15501#[derive(Builder, Debug, PartialEq)]
15502pub struct QueryHttpOpts<'a> {
15503    /// Secret used to populate the Authorization HTTP header
15504    #[builder(setter(into, strip_option), default)]
15505    pub auth_header: Option<Id>,
15506    /// Expected digest of the downloaded content (e.g., "sha256:...").
15507    #[builder(setter(into, strip_option), default)]
15508    pub checksum: Option<&'a str>,
15509    /// A service which must be started before the URL is fetched.
15510    #[builder(setter(into, strip_option), default)]
15511    pub experimental_service_host: Option<Id>,
15512    /// File name to use for the file. Defaults to the last part of the URL.
15513    #[builder(setter(into, strip_option), default)]
15514    pub name: Option<&'a str>,
15515    /// Permissions to set on the file.
15516    #[builder(setter(into, strip_option), default)]
15517    pub permissions: Option<isize>,
15518}
15519#[derive(Builder, Debug, PartialEq)]
15520pub struct QueryModuleSourceOpts<'a> {
15521    /// 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.
15522    #[builder(setter(into, strip_option), default)]
15523    pub allow_not_exists: Option<bool>,
15524    /// 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.
15525    #[builder(setter(into, strip_option), default)]
15526    pub disable_find_up: Option<bool>,
15527    /// The pinned version of the module source
15528    #[builder(setter(into, strip_option), default)]
15529    pub ref_pin: Option<&'a str>,
15530    /// If set, error out if the ref string is not of the provided requireKind.
15531    #[builder(setter(into, strip_option), default)]
15532    pub require_kind: Option<ModuleSourceKind>,
15533    /// Version query for a Git module source.
15534    #[builder(setter(into, strip_option), default)]
15535    pub version: Option<&'a str>,
15536}
15537#[derive(Builder, Debug, PartialEq)]
15538pub struct QueryCurrentTypeDefsOpts {
15539    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
15540    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
15541    #[builder(setter(into, strip_option), default)]
15542    pub hide_core: Option<bool>,
15543    /// Return the full referenced typedef closure instead of only top-level served typedefs.
15544    #[builder(setter(into, strip_option), default)]
15545    pub return_all_types: Option<bool>,
15546}
15547#[derive(Builder, Debug, PartialEq)]
15548pub struct QueryServeModuleOpts<'a> {
15549    /// The pinned version of a remote module address.
15550    #[builder(setter(into, strip_option), default)]
15551    pub ref_pin: Option<&'a str>,
15552}
15553#[derive(Builder, Debug, PartialEq)]
15554pub struct QueryLlmOpts<'a> {
15555    /// The model to converse with, e.g. "claude-sonnet-4-5" or "gpt-5.4". Defaults to the configured default model.
15556    #[builder(setter(into, strip_option), default)]
15557    pub model: Option<&'a str>,
15558    /// 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.
15559    #[builder(setter(into, strip_option), default)]
15560    pub provider: Option<&'a str>,
15561}
15562#[derive(Builder, Debug, PartialEq)]
15563pub struct QueryEnvFileOpts {
15564    /// Replace "${VAR}" or "$VAR" with the value of other vars
15565    #[builder(setter(into, strip_option), default)]
15566    pub expand: Option<bool>,
15567}
15568impl IntoID<Id> for Query {
15569    fn into_id(
15570        self,
15571    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15572        Box::pin(async move { self.id().await })
15573    }
15574}
15575impl Loadable for Query {
15576    fn graphql_type() -> &'static str {
15577        "Query"
15578    }
15579    fn from_query(
15580        proc: Option<Arc<DaggerSessionProc>>,
15581        selection: Selection,
15582        graphql_client: DynGraphQLClient,
15583    ) -> Self {
15584        Self {
15585            proc,
15586            selection,
15587            graphql_client,
15588        }
15589    }
15590}
15591impl Query {
15592    /// A unique identifier for this Query.
15593    pub async fn id(&self) -> Result<Id, DaggerError> {
15594        let query = self.selection.select("id");
15595        query.execute(self.graphql_client.clone()).await
15596    }
15597    /// Load any object by its ID.
15598    pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
15599        let mut query = self.selection.select("node");
15600        query = query.arg_lazy(
15601            "id",
15602            Box::new(move || {
15603                let id = id.clone();
15604                Box::pin(async move { id.into_id().await.unwrap().quote() })
15605            }),
15606        );
15607        let query = query.select("id");
15608        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15609        Ok(id.map(|id| NodeClient {
15610            proc: self.proc.clone(),
15611            selection: query
15612                .root()
15613                .select("node")
15614                .arg("id", &id.0)
15615                .inline_fragment("Node"),
15616            graphql_client: self.graphql_client.clone(),
15617        }))
15618    }
15619    /// Get the current Dagger Engine version.
15620    pub async fn version(&self) -> Result<String, DaggerError> {
15621        let query = self.selection.select("version");
15622        query.execute(self.graphql_client.clone()).await
15623    }
15624    /// The current UTC time in RFC3339 format. Never cached.
15625    pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
15626        let query = self.selection.select("currentTimestamp");
15627        query.execute(self.graphql_client.clone()).await
15628    }
15629    /// Name the current session.
15630    /// 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.
15631    ///
15632    /// # Arguments
15633    ///
15634    /// * `title` - The title, sanitized to a single printable line.
15635    pub async fn set_session_title(&self, title: impl Into<String>) -> Result<Void, DaggerError> {
15636        let mut query = self.selection.select("setSessionTitle");
15637        query = query.arg("title", title.into());
15638        query.execute(self.graphql_client.clone()).await
15639    }
15640    /// Creates an empty directory.
15641    pub fn directory(&self) -> Directory {
15642        let query = self.selection.select("directory");
15643        Directory {
15644            proc: self.proc.clone(),
15645            selection: query,
15646            graphql_client: self.graphql_client.clone(),
15647        }
15648    }
15649    /// Creates an empty changeset
15650    pub fn changeset(&self) -> Changeset {
15651        let query = self.selection.select("changeset");
15652        Changeset {
15653            proc: self.proc.clone(),
15654            selection: query,
15655            graphql_client: self.graphql_client.clone(),
15656        }
15657    }
15658    /// Creates a file with the specified contents.
15659    ///
15660    /// # Arguments
15661    ///
15662    /// * `name` - Name of the new file. Example: "foo.txt"
15663    /// * `contents` - Contents of the new file. Example: "Hello world!"
15664    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15665    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
15666        let mut query = self.selection.select("file");
15667        query = query.arg("name", name.into());
15668        query = query.arg("contents", contents.into());
15669        File {
15670            proc: self.proc.clone(),
15671            selection: query,
15672            graphql_client: self.graphql_client.clone(),
15673        }
15674    }
15675    /// Creates a file with the specified contents.
15676    ///
15677    /// # Arguments
15678    ///
15679    /// * `name` - Name of the new file. Example: "foo.txt"
15680    /// * `contents` - Contents of the new file. Example: "Hello world!"
15681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15682    pub fn file_opts(
15683        &self,
15684        name: impl Into<String>,
15685        contents: impl Into<String>,
15686        opts: QueryFileOpts,
15687    ) -> File {
15688        let mut query = self.selection.select("file");
15689        query = query.arg("name", name.into());
15690        query = query.arg("contents", contents.into());
15691        if let Some(permissions) = opts.permissions {
15692            query = query.arg("permissions", permissions);
15693        }
15694        File {
15695            proc: self.proc.clone(),
15696            selection: query,
15697            graphql_client: self.graphql_client.clone(),
15698        }
15699    }
15700    /// Creates a file from arbitrary binary contents.
15701    ///
15702    /// # Arguments
15703    ///
15704    /// * `name` - Name of the new file. Example: "archive.tar"
15705    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
15706    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15707    pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
15708        let mut query = self.selection.select("blob");
15709        query = query.arg("name", name.into());
15710        query = query.arg("contents", contents);
15711        File {
15712            proc: self.proc.clone(),
15713            selection: query,
15714            graphql_client: self.graphql_client.clone(),
15715        }
15716    }
15717    /// Creates a file from arbitrary binary contents.
15718    ///
15719    /// # Arguments
15720    ///
15721    /// * `name` - Name of the new file. Example: "archive.tar"
15722    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
15723    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15724    pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
15725        let mut query = self.selection.select("blob");
15726        query = query.arg("name", name.into());
15727        query = query.arg("contents", contents);
15728        if let Some(permissions) = opts.permissions {
15729            query = query.arg("permissions", permissions);
15730        }
15731        File {
15732            proc: self.proc.clone(),
15733            selection: query,
15734            graphql_client: self.graphql_client.clone(),
15735        }
15736    }
15737    /// Queries a Git repository.
15738    ///
15739    /// # Arguments
15740    ///
15741    /// * `url` - URL of the git repository.
15742    ///
15743    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
15744    ///
15745    /// Suffix ".git" is optional.
15746    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15747    pub fn git(&self, url: impl Into<String>) -> GitRepository {
15748        let mut query = self.selection.select("git");
15749        query = query.arg("url", url.into());
15750        GitRepository {
15751            proc: self.proc.clone(),
15752            selection: query,
15753            graphql_client: self.graphql_client.clone(),
15754        }
15755    }
15756    /// Queries a Git repository.
15757    ///
15758    /// # Arguments
15759    ///
15760    /// * `url` - URL of the git repository.
15761    ///
15762    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
15763    ///
15764    /// Suffix ".git" is optional.
15765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15766    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
15767        let mut query = self.selection.select("git");
15768        query = query.arg("url", url.into());
15769        if let Some(keep_git_dir) = opts.keep_git_dir {
15770            query = query.arg("keepGitDir", keep_git_dir);
15771        }
15772        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
15773            query = query.arg("sshKnownHosts", ssh_known_hosts);
15774        }
15775        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
15776            query = query.arg("sshAuthSocket", ssh_auth_socket);
15777        }
15778        if let Some(http_auth_username) = opts.http_auth_username {
15779            query = query.arg("httpAuthUsername", http_auth_username);
15780        }
15781        if let Some(http_auth_token) = opts.http_auth_token {
15782            query = query.arg("httpAuthToken", http_auth_token);
15783        }
15784        if let Some(http_auth_header) = opts.http_auth_header {
15785            query = query.arg("httpAuthHeader", http_auth_header);
15786        }
15787        if let Some(experimental_service_host) = opts.experimental_service_host {
15788            query = query.arg("experimentalServiceHost", experimental_service_host);
15789        }
15790        GitRepository {
15791            proc: self.proc.clone(),
15792            selection: query,
15793            graphql_client: self.graphql_client.clone(),
15794        }
15795    }
15796    /// Creates a scratch container, with no image or metadata.
15797    /// To pull an image, follow up with the "from" function.
15798    ///
15799    /// # Arguments
15800    ///
15801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15802    pub fn container(&self) -> Container {
15803        let query = self.selection.select("container");
15804        Container {
15805            proc: self.proc.clone(),
15806            selection: query,
15807            graphql_client: self.graphql_client.clone(),
15808        }
15809    }
15810    /// Creates a scratch container, with no image or metadata.
15811    /// To pull an image, follow up with the "from" function.
15812    ///
15813    /// # Arguments
15814    ///
15815    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15816    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
15817        let mut query = self.selection.select("container");
15818        if let Some(platform) = opts.platform {
15819            query = query.arg("platform", platform);
15820        }
15821        Container {
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(&self, key: impl Into<String>) -> CacheVolume {
15834        let mut query = self.selection.select("cacheVolume");
15835        query = query.arg("key", key.into());
15836        CacheVolume {
15837            proc: self.proc.clone(),
15838            selection: query,
15839            graphql_client: self.graphql_client.clone(),
15840        }
15841    }
15842    /// Constructs a cache volume for a given cache key.
15843    ///
15844    /// # Arguments
15845    ///
15846    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
15847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15848    pub fn cache_volume_opts<'a>(
15849        &self,
15850        key: impl Into<String>,
15851        opts: QueryCacheVolumeOpts<'a>,
15852    ) -> CacheVolume {
15853        let mut query = self.selection.select("cacheVolume");
15854        query = query.arg("key", key.into());
15855        if let Some(source) = opts.source {
15856            query = query.arg("source", source);
15857        }
15858        if let Some(sharing) = opts.sharing {
15859            query = query.arg("sharing", sharing);
15860        }
15861        if let Some(owner) = opts.owner {
15862            query = query.arg("owner", owner);
15863        }
15864        CacheVolume {
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(&self, name: impl Into<String>) -> Volume {
15877        let mut query = self.selection.select("engineVolume");
15878        query = query.arg("name", name.into());
15879        Volume {
15880            proc: self.proc.clone(),
15881            selection: query,
15882            graphql_client: self.graphql_client.clone(),
15883        }
15884    }
15885    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
15886    ///
15887    /// # Arguments
15888    ///
15889    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
15890    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15891    pub fn engine_volume_opts<'a>(
15892        &self,
15893        name: impl Into<String>,
15894        opts: QueryEngineVolumeOpts<'a>,
15895    ) -> Volume {
15896        let mut query = self.selection.select("engineVolume");
15897        query = query.arg("name", name.into());
15898        if let Some(subdir) = opts.subdir {
15899            query = query.arg("subdir", subdir);
15900        }
15901        Volume {
15902            proc: self.proc.clone(),
15903            selection: query,
15904            graphql_client: self.graphql_client.clone(),
15905        }
15906    }
15907    /// Constructs an SSHFS volume.
15908    ///
15909    /// # Arguments
15910    ///
15911    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
15912    /// * `private_key` - Private key secret used to authenticate to the remote host.
15913    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15914    pub fn sshfs_volume(
15915        &self,
15916        endpoint: impl Into<String>,
15917        private_key: impl IntoID<Id>,
15918    ) -> Volume {
15919        let mut query = self.selection.select("sshfsVolume");
15920        query = query.arg("endpoint", endpoint.into());
15921        query = query.arg_lazy(
15922            "privateKey",
15923            Box::new(move || {
15924                let private_key = private_key.clone();
15925                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15926            }),
15927        );
15928        Volume {
15929            proc: self.proc.clone(),
15930            selection: query,
15931            graphql_client: self.graphql_client.clone(),
15932        }
15933    }
15934    /// Constructs an SSHFS volume.
15935    ///
15936    /// # Arguments
15937    ///
15938    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
15939    /// * `private_key` - Private key secret used to authenticate to the remote host.
15940    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15941    pub fn sshfs_volume_opts<'a>(
15942        &self,
15943        endpoint: impl Into<String>,
15944        private_key: impl IntoID<Id>,
15945        opts: QuerySshfsVolumeOpts<'a>,
15946    ) -> Volume {
15947        let mut query = self.selection.select("sshfsVolume");
15948        query = query.arg("endpoint", endpoint.into());
15949        query = query.arg_lazy(
15950            "privateKey",
15951            Box::new(move || {
15952                let private_key = private_key.clone();
15953                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15954            }),
15955        );
15956        if let Some(known_hosts) = opts.known_hosts {
15957            query = query.arg("knownHosts", known_hosts);
15958        }
15959        if let Some(cache_key) = opts.cache_key {
15960            query = query.arg("cacheKey", cache_key);
15961        }
15962        if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
15963            query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
15964        }
15965        if let Some(experimental_service_host) = opts.experimental_service_host {
15966            query = query.arg("experimentalServiceHost", experimental_service_host);
15967        }
15968        Volume {
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(&self, uri: impl Into<String>) -> Secret {
15981        let mut query = self.selection.select("secret");
15982        query = query.arg("uri", uri.into());
15983        Secret {
15984            proc: self.proc.clone(),
15985            selection: query,
15986            graphql_client: self.graphql_client.clone(),
15987        }
15988    }
15989    /// Creates a new secret.
15990    ///
15991    /// # Arguments
15992    ///
15993    /// * `uri` - The URI of the secret store
15994    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15995    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
15996        let mut query = self.selection.select("secret");
15997        query = query.arg("uri", uri.into());
15998        if let Some(cache_key) = opts.cache_key {
15999            query = query.arg("cacheKey", cache_key);
16000        }
16001        Secret {
16002            proc: self.proc.clone(),
16003            selection: query,
16004            graphql_client: self.graphql_client.clone(),
16005        }
16006    }
16007    /// Sets a secret given a user defined name to its plaintext and returns the secret.
16008    /// The plaintext value is limited to a size of 128000 bytes.
16009    ///
16010    /// # Arguments
16011    ///
16012    /// * `name` - The user defined name for this secret
16013    /// * `plaintext` - The plaintext of the secret
16014    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
16015        let mut query = self.selection.select("setSecret");
16016        query = query.arg("name", name.into());
16017        query = query.arg("plaintext", plaintext.into());
16018        Secret {
16019            proc: self.proc.clone(),
16020            selection: query,
16021            graphql_client: self.graphql_client.clone(),
16022        }
16023    }
16024    /// Queries the host environment.
16025    pub fn host(&self) -> Host {
16026        let query = self.selection.select("host");
16027        Host {
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(&self, url: impl Into<String>) -> File {
16040        let mut query = self.selection.select("http");
16041        query = query.arg("url", url.into());
16042        File {
16043            proc: self.proc.clone(),
16044            selection: query,
16045            graphql_client: self.graphql_client.clone(),
16046        }
16047    }
16048    /// Returns a file containing an http remote url content.
16049    ///
16050    /// # Arguments
16051    ///
16052    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
16053    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16054    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
16055        let mut query = self.selection.select("http");
16056        query = query.arg("url", url.into());
16057        if let Some(name) = opts.name {
16058            query = query.arg("name", name);
16059        }
16060        if let Some(permissions) = opts.permissions {
16061            query = query.arg("permissions", permissions);
16062        }
16063        if let Some(checksum) = opts.checksum {
16064            query = query.arg("checksum", checksum);
16065        }
16066        if let Some(auth_header) = opts.auth_header {
16067            query = query.arg("authHeader", auth_header);
16068        }
16069        if let Some(experimental_service_host) = opts.experimental_service_host {
16070            query = query.arg("experimentalServiceHost", experimental_service_host);
16071        }
16072        File {
16073            proc: self.proc.clone(),
16074            selection: query,
16075            graphql_client: self.graphql_client.clone(),
16076        }
16077    }
16078    /// The default platform of the engine.
16079    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
16080        let query = self.selection.select("defaultPlatform");
16081        query.execute(self.graphql_client.clone()).await
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(&self, ref_string: impl Into<String>) -> ModuleSource {
16090        let mut query = self.selection.select("moduleSource");
16091        query = query.arg("refString", ref_string.into());
16092        ModuleSource {
16093            proc: self.proc.clone(),
16094            selection: query,
16095            graphql_client: self.graphql_client.clone(),
16096        }
16097    }
16098    /// Create a new module source instance from a source ref string
16099    ///
16100    /// # Arguments
16101    ///
16102    /// * `ref_string` - The string ref representation of the module source
16103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16104    pub fn module_source_opts<'a>(
16105        &self,
16106        ref_string: impl Into<String>,
16107        opts: QueryModuleSourceOpts<'a>,
16108    ) -> ModuleSource {
16109        let mut query = self.selection.select("moduleSource");
16110        query = query.arg("refString", ref_string.into());
16111        if let Some(version) = opts.version {
16112            query = query.arg("version", version);
16113        }
16114        if let Some(ref_pin) = opts.ref_pin {
16115            query = query.arg("refPin", ref_pin);
16116        }
16117        if let Some(disable_find_up) = opts.disable_find_up {
16118            query = query.arg("disableFindUp", disable_find_up);
16119        }
16120        if let Some(allow_not_exists) = opts.allow_not_exists {
16121            query = query.arg("allowNotExists", allow_not_exists);
16122        }
16123        if let Some(require_kind) = opts.require_kind {
16124            query = query.arg("requireKind", require_kind);
16125        }
16126        ModuleSource {
16127            proc: self.proc.clone(),
16128            selection: query,
16129            graphql_client: self.graphql_client.clone(),
16130        }
16131    }
16132    /// Create a new module.
16133    pub fn module(&self) -> Module {
16134        let query = self.selection.select("module");
16135        Module {
16136            proc: self.proc.clone(),
16137            selection: query,
16138            graphql_client: self.graphql_client.clone(),
16139        }
16140    }
16141    /// Create a new TypeDef.
16142    pub fn type_def(&self) -> TypeDef {
16143        let query = self.selection.select("typeDef");
16144        TypeDef {
16145            proc: self.proc.clone(),
16146            selection: query,
16147            graphql_client: self.graphql_client.clone(),
16148        }
16149    }
16150    /// Create a code generation result, given a directory containing the generated code.
16151    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
16152        let mut query = self.selection.select("generatedCode");
16153        query = query.arg_lazy(
16154            "code",
16155            Box::new(move || {
16156                let code = code.clone();
16157                Box::pin(async move { code.into_id().await.unwrap().quote() })
16158            }),
16159        );
16160        GeneratedCode {
16161            proc: self.proc.clone(),
16162            selection: query,
16163            graphql_client: self.graphql_client.clone(),
16164        }
16165    }
16166    /// Creates a function.
16167    ///
16168    /// # Arguments
16169    ///
16170    /// * `name` - Name of the function, in its original format from the implementation language.
16171    /// * `return_type` - Return type of the function.
16172    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
16173        let mut query = self.selection.select("function");
16174        query = query.arg("name", name.into());
16175        query = query.arg_lazy(
16176            "returnType",
16177            Box::new(move || {
16178                let return_type = return_type.clone();
16179                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
16180            }),
16181        );
16182        Function {
16183            proc: self.proc.clone(),
16184            selection: query,
16185            graphql_client: self.graphql_client.clone(),
16186        }
16187    }
16188    /// Creates source map metadata.
16189    ///
16190    /// # Arguments
16191    ///
16192    /// * `filename` - The filename from the module source.
16193    /// * `line` - The line number within the filename.
16194    /// * `column` - The column number within the line.
16195    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
16196        let mut query = self.selection.select("sourceMap");
16197        query = query.arg("filename", filename.into());
16198        query = query.arg("line", line);
16199        query = query.arg("column", column);
16200        SourceMap {
16201            proc: self.proc.clone(),
16202            selection: query,
16203            graphql_client: self.graphql_client.clone(),
16204        }
16205    }
16206    /// The module currently being served in the session, if any.
16207    pub fn current_module(&self) -> CurrentModule {
16208        let query = self.selection.select("currentModule");
16209        CurrentModule {
16210            proc: self.proc.clone(),
16211            selection: query,
16212            graphql_client: self.graphql_client.clone(),
16213        }
16214    }
16215    /// The TypeDef representations of the objects currently being served in the session.
16216    ///
16217    /// # Arguments
16218    ///
16219    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16220    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
16221        let query = self.selection.select("currentTypeDefs");
16222        let query = query.select("id");
16223        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16224        Ok(ids
16225            .into_iter()
16226            .map(|id| TypeDef {
16227                proc: self.proc.clone(),
16228                selection: crate::querybuilder::query()
16229                    .select("node")
16230                    .arg("id", &id.0)
16231                    .inline_fragment("TypeDef"),
16232                graphql_client: self.graphql_client.clone(),
16233            })
16234            .collect())
16235    }
16236    /// The TypeDef representations of the objects currently being served in the session.
16237    ///
16238    /// # Arguments
16239    ///
16240    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16241    pub async fn current_type_defs_opts(
16242        &self,
16243        opts: QueryCurrentTypeDefsOpts,
16244    ) -> Result<Vec<TypeDef>, DaggerError> {
16245        let mut query = self.selection.select("currentTypeDefs");
16246        if let Some(return_all_types) = opts.return_all_types {
16247            query = query.arg("returnAllTypes", return_all_types);
16248        }
16249        if let Some(hide_core) = opts.hide_core {
16250            query = query.arg("hideCore", hide_core);
16251        }
16252        let query = query.select("id");
16253        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16254        Ok(ids
16255            .into_iter()
16256            .map(|id| TypeDef {
16257                proc: self.proc.clone(),
16258                selection: crate::querybuilder::query()
16259                    .select("node")
16260                    .arg("id", &id.0)
16261                    .inline_fragment("TypeDef"),
16262                graphql_client: self.graphql_client.clone(),
16263            })
16264            .collect())
16265    }
16266    /// The FunctionCall context that the SDK caller is currently executing in.
16267    /// If the caller is not currently executing in a function, this will return an error.
16268    pub fn current_function_call(&self) -> FunctionCall {
16269        let query = self.selection.select("currentFunctionCall");
16270        FunctionCall {
16271            proc: self.proc.clone(),
16272            selection: query,
16273            graphql_client: self.graphql_client.clone(),
16274        }
16275    }
16276    /// Load the module at the given address and serve its API in the current session.
16277    /// 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.
16278    ///
16279    /// # Arguments
16280    ///
16281    /// * `address` - A module address, or an explicit path into the caller's workspace.
16282    ///
16283    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16284    ///
16285    /// Installed module names are not accepted.
16286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16287    pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
16288        let mut query = self.selection.select("serveModule");
16289        query = query.arg("address", address.into());
16290        query.execute(self.graphql_client.clone()).await
16291    }
16292    /// Load the module at the given address and serve its API in the current session.
16293    /// 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.
16294    ///
16295    /// # Arguments
16296    ///
16297    /// * `address` - A module address, or an explicit path into the caller's workspace.
16298    ///
16299    /// Absolute paths (e.g. "/.dagger/modules/hello") resolve from the workspace root, relative ones (e.g. "./hello") from the workspace cwd.
16300    ///
16301    /// Installed module names are not accepted.
16302    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16303    pub async fn serve_module_opts<'a>(
16304        &self,
16305        address: impl Into<String>,
16306        opts: QueryServeModuleOpts<'a>,
16307    ) -> Result<Void, DaggerError> {
16308        let mut query = self.selection.select("serveModule");
16309        query = query.arg("address", address.into());
16310        if let Some(ref_pin) = opts.ref_pin {
16311            query = query.arg("refPin", ref_pin);
16312        }
16313        query.execute(self.graphql_client.clone()).await
16314    }
16315    /// 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).
16316    pub fn current_node(&self) -> NodeClient {
16317        let query = self.selection.select("currentNode");
16318        NodeClient {
16319            proc: self.proc.clone(),
16320            selection: query,
16321            graphql_client: self.graphql_client.clone(),
16322        }
16323    }
16324    /// Create a new error.
16325    ///
16326    /// # Arguments
16327    ///
16328    /// * `message` - A brief description of the error.
16329    pub fn error(&self, message: impl Into<String>) -> Error {
16330        let mut query = self.selection.select("error");
16331        query = query.arg("message", message.into());
16332        Error {
16333            proc: self.proc.clone(),
16334            selection: query,
16335            graphql_client: self.graphql_client.clone(),
16336        }
16337    }
16338    /// The Dagger engine container configuration and state
16339    pub fn engine(&self) -> Engine {
16340        let query = self.selection.select("engine");
16341        Engine {
16342            proc: self.proc.clone(),
16343            selection: query,
16344            graphql_client: self.graphql_client.clone(),
16345        }
16346    }
16347    /// Dagger Cloud configuration and state
16348    pub fn cloud(&self) -> Cloud {
16349        let query = self.selection.select("cloud");
16350        Cloud {
16351            proc: self.proc.clone(),
16352            selection: query,
16353            graphql_client: self.graphql_client.clone(),
16354        }
16355    }
16356    /// Initialize a new LLM conversation.
16357    ///
16358    /// # Arguments
16359    ///
16360    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16361    pub fn llm(&self) -> Llm {
16362        let query = self.selection.select("llm");
16363        Llm {
16364            proc: self.proc.clone(),
16365            selection: query,
16366            graphql_client: self.graphql_client.clone(),
16367        }
16368    }
16369    /// Initialize a new LLM conversation.
16370    ///
16371    /// # Arguments
16372    ///
16373    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16374    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
16375        let mut query = self.selection.select("llm");
16376        if let Some(model) = opts.model {
16377            query = query.arg("model", model);
16378        }
16379        if let Some(provider) = opts.provider {
16380            query = query.arg("provider", provider);
16381        }
16382        Llm {
16383            proc: self.proc.clone(),
16384            selection: query,
16385            graphql_client: self.graphql_client.clone(),
16386        }
16387    }
16388    /// Start an empty run of text and media content, independent of any conversation.
16389    /// 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.
16390    pub fn llm_content(&self) -> LlmContent {
16391        let query = self.selection.select("llmContent");
16392        LlmContent {
16393            proc: self.proc.clone(),
16394            selection: query,
16395            graphql_client: self.graphql_client.clone(),
16396        }
16397    }
16398    /// Initialize a JSON value
16399    pub fn json(&self) -> JsonValue {
16400        let query = self.selection.select("json");
16401        JsonValue {
16402            proc: self.proc.clone(),
16403            selection: query,
16404            graphql_client: self.graphql_client.clone(),
16405        }
16406    }
16407    /// Load a GraphQL introspection schema for merging.
16408    ///
16409    /// # Arguments
16410    ///
16411    /// * `json` - The introspection schema JSON to load.
16412    pub fn schema(&self, json: Json) -> Schema {
16413        let mut query = self.selection.select("schema");
16414        query = query.arg("json", json);
16415        Schema {
16416            proc: self.proc.clone(),
16417            selection: query,
16418            graphql_client: self.graphql_client.clone(),
16419        }
16420    }
16421    /// Initialize an environment file
16422    ///
16423    /// # Arguments
16424    ///
16425    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16426    pub fn env_file(&self) -> EnvFile {
16427        let query = self.selection.select("envFile");
16428        EnvFile {
16429            proc: self.proc.clone(),
16430            selection: query,
16431            graphql_client: self.graphql_client.clone(),
16432        }
16433    }
16434    /// Initialize an environment file
16435    ///
16436    /// # Arguments
16437    ///
16438    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16439    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
16440        let mut query = self.selection.select("envFile");
16441        if let Some(expand) = opts.expand {
16442            query = query.arg("expand", expand);
16443        }
16444        EnvFile {
16445            proc: self.proc.clone(),
16446            selection: query,
16447            graphql_client: self.graphql_client.clone(),
16448        }
16449    }
16450    /// Resolve external references only.
16451    pub fn address(&self, value: impl Into<String>) -> Address {
16452        let mut query = self.selection.select("address");
16453        query = query.arg("value", value.into());
16454        Address {
16455            proc: self.proc.clone(),
16456            selection: query,
16457            graphql_client: self.graphql_client.clone(),
16458        }
16459    }
16460    /// Detect and return the current workspace.
16461    pub fn current_workspace(&self) -> Workspace {
16462        let query = self.selection.select("currentWorkspace");
16463        Workspace {
16464            proc: self.proc.clone(),
16465            selection: query,
16466            graphql_client: self.graphql_client.clone(),
16467        }
16468    }
16469}
16470impl Node for Query {
16471    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16472        let query = self.selection.select("id");
16473        let graphql_client = self.graphql_client.clone();
16474        async move { query.execute(graphql_client).await }
16475    }
16476}
16477#[derive(Clone)]
16478pub struct RemoteGitMirror {
16479    pub proc: Option<Arc<DaggerSessionProc>>,
16480    pub selection: Selection,
16481    pub graphql_client: DynGraphQLClient,
16482}
16483impl IntoID<Id> for RemoteGitMirror {
16484    fn into_id(
16485        self,
16486    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16487        Box::pin(async move { self.id().await })
16488    }
16489}
16490impl Loadable for RemoteGitMirror {
16491    fn graphql_type() -> &'static str {
16492        "RemoteGitMirror"
16493    }
16494    fn from_query(
16495        proc: Option<Arc<DaggerSessionProc>>,
16496        selection: Selection,
16497        graphql_client: DynGraphQLClient,
16498    ) -> Self {
16499        Self {
16500            proc,
16501            selection,
16502            graphql_client,
16503        }
16504    }
16505}
16506impl RemoteGitMirror {
16507    /// A unique identifier for this RemoteGitMirror.
16508    pub async fn id(&self) -> Result<Id, DaggerError> {
16509        let query = self.selection.select("id");
16510        query.execute(self.graphql_client.clone()).await
16511    }
16512}
16513impl Node for RemoteGitMirror {
16514    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16515        let query = self.selection.select("id");
16516        let graphql_client = self.graphql_client.clone();
16517        async move { query.execute(graphql_client).await }
16518    }
16519}
16520#[derive(Clone)]
16521pub struct SdkConfig {
16522    pub proc: Option<Arc<DaggerSessionProc>>,
16523    pub selection: Selection,
16524    pub graphql_client: DynGraphQLClient,
16525}
16526impl IntoID<Id> for SdkConfig {
16527    fn into_id(
16528        self,
16529    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16530        Box::pin(async move { self.id().await })
16531    }
16532}
16533impl Loadable for SdkConfig {
16534    fn graphql_type() -> &'static str {
16535        "SDKConfig"
16536    }
16537    fn from_query(
16538        proc: Option<Arc<DaggerSessionProc>>,
16539        selection: Selection,
16540        graphql_client: DynGraphQLClient,
16541    ) -> Self {
16542        Self {
16543            proc,
16544            selection,
16545            graphql_client,
16546        }
16547    }
16548}
16549impl SdkConfig {
16550    /// A unique identifier for this SDKConfig.
16551    pub async fn id(&self) -> Result<Id, DaggerError> {
16552        let query = self.selection.select("id");
16553        query.execute(self.graphql_client.clone()).await
16554    }
16555    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
16556    pub async fn source(&self) -> Result<String, DaggerError> {
16557        let query = self.selection.select("source");
16558        query.execute(self.graphql_client.clone()).await
16559    }
16560    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
16561    pub async fn debug(&self) -> Result<bool, DaggerError> {
16562        let query = self.selection.select("debug");
16563        query.execute(self.graphql_client.clone()).await
16564    }
16565}
16566impl Node for SdkConfig {
16567    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16568        let query = self.selection.select("id");
16569        let graphql_client = self.graphql_client.clone();
16570        async move { query.execute(graphql_client).await }
16571    }
16572}
16573#[derive(Clone)]
16574pub struct ScalarTypeDef {
16575    pub proc: Option<Arc<DaggerSessionProc>>,
16576    pub selection: Selection,
16577    pub graphql_client: DynGraphQLClient,
16578}
16579impl IntoID<Id> for ScalarTypeDef {
16580    fn into_id(
16581        self,
16582    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16583        Box::pin(async move { self.id().await })
16584    }
16585}
16586impl Loadable for ScalarTypeDef {
16587    fn graphql_type() -> &'static str {
16588        "ScalarTypeDef"
16589    }
16590    fn from_query(
16591        proc: Option<Arc<DaggerSessionProc>>,
16592        selection: Selection,
16593        graphql_client: DynGraphQLClient,
16594    ) -> Self {
16595        Self {
16596            proc,
16597            selection,
16598            graphql_client,
16599        }
16600    }
16601}
16602impl ScalarTypeDef {
16603    /// A unique identifier for this ScalarTypeDef.
16604    pub async fn id(&self) -> Result<Id, DaggerError> {
16605        let query = self.selection.select("id");
16606        query.execute(self.graphql_client.clone()).await
16607    }
16608    /// The name of the scalar.
16609    pub async fn name(&self) -> Result<String, DaggerError> {
16610        let query = self.selection.select("name");
16611        query.execute(self.graphql_client.clone()).await
16612    }
16613    /// A doc string for the scalar, if any.
16614    pub async fn description(&self) -> Result<String, DaggerError> {
16615        let query = self.selection.select("description");
16616        query.execute(self.graphql_client.clone()).await
16617    }
16618    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
16619    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
16620        let query = self.selection.select("sourceModuleName");
16621        query.execute(self.graphql_client.clone()).await
16622    }
16623}
16624impl Node for ScalarTypeDef {
16625    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16626        let query = self.selection.select("id");
16627        let graphql_client = self.graphql_client.clone();
16628        async move { query.execute(graphql_client).await }
16629    }
16630}
16631#[derive(Clone)]
16632pub struct Schema {
16633    pub proc: Option<Arc<DaggerSessionProc>>,
16634    pub selection: Selection,
16635    pub graphql_client: DynGraphQLClient,
16636}
16637impl IntoID<Id> for Schema {
16638    fn into_id(
16639        self,
16640    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16641        Box::pin(async move { self.id().await })
16642    }
16643}
16644impl Loadable for Schema {
16645    fn graphql_type() -> &'static str {
16646        "Schema"
16647    }
16648    fn from_query(
16649        proc: Option<Arc<DaggerSessionProc>>,
16650        selection: Selection,
16651        graphql_client: DynGraphQLClient,
16652    ) -> Self {
16653        Self {
16654            proc,
16655            selection,
16656            graphql_client,
16657        }
16658    }
16659}
16660impl Schema {
16661    /// A unique identifier for this Schema.
16662    pub async fn id(&self) -> Result<Id, DaggerError> {
16663        let query = self.selection.select("id");
16664        query.execute(self.graphql_client.clone()).await
16665    }
16666    /// Serialize the schema back to introspection JSON.
16667    pub async fn contents(&self) -> Result<Json, DaggerError> {
16668        let query = self.selection.select("contents");
16669        query.execute(self.graphql_client.clone()).await
16670    }
16671    /// Merge a module's introspection-shaped type definitions into the schema, returning the combined schema.
16672    ///
16673    /// # Arguments
16674    ///
16675    /// * `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.
16676    /// * `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.
16677    pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
16678        let mut query = self.selection.select("merge");
16679        query = query.arg("moduleTypes", module_types);
16680        query = query.arg("moduleName", module_name.into());
16681        Schema {
16682            proc: self.proc.clone(),
16683            selection: query,
16684            graphql_client: self.graphql_client.clone(),
16685        }
16686    }
16687}
16688impl Node for Schema {
16689    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16690        let query = self.selection.select("id");
16691        let graphql_client = self.graphql_client.clone();
16692        async move { query.execute(graphql_client).await }
16693    }
16694}
16695#[derive(Clone)]
16696pub struct SearchResult {
16697    pub proc: Option<Arc<DaggerSessionProc>>,
16698    pub selection: Selection,
16699    pub graphql_client: DynGraphQLClient,
16700}
16701impl IntoID<Id> for SearchResult {
16702    fn into_id(
16703        self,
16704    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16705        Box::pin(async move { self.id().await })
16706    }
16707}
16708impl Loadable for SearchResult {
16709    fn graphql_type() -> &'static str {
16710        "SearchResult"
16711    }
16712    fn from_query(
16713        proc: Option<Arc<DaggerSessionProc>>,
16714        selection: Selection,
16715        graphql_client: DynGraphQLClient,
16716    ) -> Self {
16717        Self {
16718            proc,
16719            selection,
16720            graphql_client,
16721        }
16722    }
16723}
16724impl SearchResult {
16725    /// A unique identifier for this SearchResult.
16726    pub async fn id(&self) -> Result<Id, DaggerError> {
16727        let query = self.selection.select("id");
16728        query.execute(self.graphql_client.clone()).await
16729    }
16730    /// The path to the file that matched.
16731    pub async fn file_path(&self) -> Result<String, DaggerError> {
16732        let query = self.selection.select("filePath");
16733        query.execute(self.graphql_client.clone()).await
16734    }
16735    /// The first line that matched.
16736    pub async fn line_number(&self) -> Result<isize, DaggerError> {
16737        let query = self.selection.select("lineNumber");
16738        query.execute(self.graphql_client.clone()).await
16739    }
16740    /// The byte offset of this line within the file.
16741    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
16742        let query = self.selection.select("absoluteOffset");
16743        query.execute(self.graphql_client.clone()).await
16744    }
16745    /// The line content that matched.
16746    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
16747        let query = self.selection.select("matchedLines");
16748        query.execute(self.graphql_client.clone()).await
16749    }
16750    /// Sub-match positions and content within the matched lines.
16751    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
16752        let query = self.selection.select("submatches");
16753        let query = query.select("id");
16754        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16755        Ok(ids
16756            .into_iter()
16757            .map(|id| SearchSubmatch {
16758                proc: self.proc.clone(),
16759                selection: crate::querybuilder::query()
16760                    .select("node")
16761                    .arg("id", &id.0)
16762                    .inline_fragment("SearchSubmatch"),
16763                graphql_client: self.graphql_client.clone(),
16764            })
16765            .collect())
16766    }
16767}
16768impl Node for SearchResult {
16769    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16770        let query = self.selection.select("id");
16771        let graphql_client = self.graphql_client.clone();
16772        async move { query.execute(graphql_client).await }
16773    }
16774}
16775#[derive(Clone)]
16776pub struct SearchSubmatch {
16777    pub proc: Option<Arc<DaggerSessionProc>>,
16778    pub selection: Selection,
16779    pub graphql_client: DynGraphQLClient,
16780}
16781impl IntoID<Id> for SearchSubmatch {
16782    fn into_id(
16783        self,
16784    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16785        Box::pin(async move { self.id().await })
16786    }
16787}
16788impl Loadable for SearchSubmatch {
16789    fn graphql_type() -> &'static str {
16790        "SearchSubmatch"
16791    }
16792    fn from_query(
16793        proc: Option<Arc<DaggerSessionProc>>,
16794        selection: Selection,
16795        graphql_client: DynGraphQLClient,
16796    ) -> Self {
16797        Self {
16798            proc,
16799            selection,
16800            graphql_client,
16801        }
16802    }
16803}
16804impl SearchSubmatch {
16805    /// A unique identifier for this SearchSubmatch.
16806    pub async fn id(&self) -> Result<Id, DaggerError> {
16807        let query = self.selection.select("id");
16808        query.execute(self.graphql_client.clone()).await
16809    }
16810    /// The matched text.
16811    pub async fn text(&self) -> Result<String, DaggerError> {
16812        let query = self.selection.select("text");
16813        query.execute(self.graphql_client.clone()).await
16814    }
16815    /// The match's start offset within the matched lines.
16816    pub async fn start(&self) -> Result<isize, DaggerError> {
16817        let query = self.selection.select("start");
16818        query.execute(self.graphql_client.clone()).await
16819    }
16820    /// The match's end offset within the matched lines.
16821    pub async fn end(&self) -> Result<isize, DaggerError> {
16822        let query = self.selection.select("end");
16823        query.execute(self.graphql_client.clone()).await
16824    }
16825}
16826impl Node for SearchSubmatch {
16827    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16828        let query = self.selection.select("id");
16829        let graphql_client = self.graphql_client.clone();
16830        async move { query.execute(graphql_client).await }
16831    }
16832}
16833#[derive(Clone)]
16834pub struct Secret {
16835    pub proc: Option<Arc<DaggerSessionProc>>,
16836    pub selection: Selection,
16837    pub graphql_client: DynGraphQLClient,
16838}
16839impl IntoID<Id> for Secret {
16840    fn into_id(
16841        self,
16842    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16843        Box::pin(async move { self.id().await })
16844    }
16845}
16846impl Loadable for Secret {
16847    fn graphql_type() -> &'static str {
16848        "Secret"
16849    }
16850    fn from_query(
16851        proc: Option<Arc<DaggerSessionProc>>,
16852        selection: Selection,
16853        graphql_client: DynGraphQLClient,
16854    ) -> Self {
16855        Self {
16856            proc,
16857            selection,
16858            graphql_client,
16859        }
16860    }
16861}
16862impl Secret {
16863    /// A unique identifier for this Secret.
16864    pub async fn id(&self) -> Result<Id, DaggerError> {
16865        let query = self.selection.select("id");
16866        query.execute(self.graphql_client.clone()).await
16867    }
16868    /// The name of this secret.
16869    pub async fn name(&self) -> Result<String, DaggerError> {
16870        let query = self.selection.select("name");
16871        query.execute(self.graphql_client.clone()).await
16872    }
16873    /// The URI of this secret.
16874    pub async fn uri(&self) -> Result<String, DaggerError> {
16875        let query = self.selection.select("uri");
16876        query.execute(self.graphql_client.clone()).await
16877    }
16878    /// The value of this secret.
16879    pub async fn plaintext(&self) -> Result<String, DaggerError> {
16880        let query = self.selection.select("plaintext");
16881        query.execute(self.graphql_client.clone()).await
16882    }
16883}
16884impl Node for Secret {
16885    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16886        let query = self.selection.select("id");
16887        let graphql_client = self.graphql_client.clone();
16888        async move { query.execute(graphql_client).await }
16889    }
16890}
16891#[derive(Clone)]
16892pub struct Service {
16893    pub proc: Option<Arc<DaggerSessionProc>>,
16894    pub selection: Selection,
16895    pub graphql_client: DynGraphQLClient,
16896}
16897#[derive(Builder, Debug, PartialEq)]
16898pub struct ServicePortsOpts {
16899    /// Return only container ports declared before startup. Other service types return an empty list.
16900    #[builder(setter(into, strip_option), default)]
16901    pub declared: Option<bool>,
16902}
16903#[derive(Builder, Debug, PartialEq)]
16904pub struct ServiceEndpointOpts<'a> {
16905    /// The exposed port number for the endpoint
16906    #[builder(setter(into, strip_option), default)]
16907    pub port: Option<isize>,
16908    /// Return a URL with the given scheme, eg. http for http://
16909    #[builder(setter(into, strip_option), default)]
16910    pub scheme: Option<&'a str>,
16911}
16912#[derive(Builder, Debug, PartialEq)]
16913pub struct ServiceUpOpts {
16914    /// List of frontend/backend port mappings to forward.
16915    /// Frontend is the port accepting traffic on the host, backend is the service port.
16916    #[builder(setter(into, strip_option), default)]
16917    pub ports: Option<Vec<PortForward>>,
16918    /// Bind each tunnel port to a random port on the host.
16919    #[builder(setter(into, strip_option), default)]
16920    pub random: Option<bool>,
16921}
16922#[derive(Builder, Debug, PartialEq)]
16923pub struct ServiceStopOpts {
16924    /// Immediately kill the service without waiting for a graceful exit
16925    #[builder(setter(into, strip_option), default)]
16926    pub kill: Option<bool>,
16927}
16928#[derive(Builder, Debug, PartialEq)]
16929pub struct ServiceTerminalOpts<'a> {
16930    #[builder(setter(into, strip_option), default)]
16931    pub cmd: Option<Vec<&'a str>>,
16932}
16933impl IntoID<Id> for Service {
16934    fn into_id(
16935        self,
16936    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16937        Box::pin(async move { self.id().await })
16938    }
16939}
16940impl Loadable for Service {
16941    fn graphql_type() -> &'static str {
16942        "Service"
16943    }
16944    fn from_query(
16945        proc: Option<Arc<DaggerSessionProc>>,
16946        selection: Selection,
16947        graphql_client: DynGraphQLClient,
16948    ) -> Self {
16949        Self {
16950            proc,
16951            selection,
16952            graphql_client,
16953        }
16954    }
16955}
16956impl Service {
16957    /// A unique identifier for this Service.
16958    pub async fn id(&self) -> Result<Id, DaggerError> {
16959        let query = self.selection.select("id");
16960        query.execute(self.graphql_client.clone()).await
16961    }
16962    /// Forces evaluation of the pipeline in the engine.
16963    pub async fn sync(&self) -> Result<Service, DaggerError> {
16964        let query = self.selection.select("sync");
16965        let id: Id = query.execute(self.graphql_client.clone()).await?;
16966        Ok(Service {
16967            proc: self.proc.clone(),
16968            selection: query
16969                .root()
16970                .select("node")
16971                .arg("id", &id.0)
16972                .inline_fragment("Service"),
16973            graphql_client: self.graphql_client.clone(),
16974        })
16975    }
16976    /// Retrieves a hostname which can be used by clients to reach this container.
16977    pub async fn hostname(&self) -> Result<String, DaggerError> {
16978        let query = self.selection.select("hostname");
16979        query.execute(self.graphql_client.clone()).await
16980    }
16981    /// Configures a hostname which can be used by clients within the session to reach this container.
16982    ///
16983    /// # Arguments
16984    ///
16985    /// * `hostname` - The hostname to use.
16986    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
16987        let mut query = self.selection.select("withHostname");
16988        query = query.arg("hostname", hostname.into());
16989        Service {
16990            proc: self.proc.clone(),
16991            selection: query,
16992            graphql_client: self.graphql_client.clone(),
16993        }
16994    }
16995    /// Retrieves the list of ports provided by the service.
16996    ///
16997    /// # Arguments
16998    ///
16999    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17000    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
17001        let query = self.selection.select("ports");
17002        let query = query.select("id");
17003        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17004        Ok(ids
17005            .into_iter()
17006            .map(|id| Port {
17007                proc: self.proc.clone(),
17008                selection: crate::querybuilder::query()
17009                    .select("node")
17010                    .arg("id", &id.0)
17011                    .inline_fragment("Port"),
17012                graphql_client: self.graphql_client.clone(),
17013            })
17014            .collect())
17015    }
17016    /// Retrieves the list of ports provided by the service.
17017    ///
17018    /// # Arguments
17019    ///
17020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17021    pub async fn ports_opts(&self, opts: ServicePortsOpts) -> Result<Vec<Port>, DaggerError> {
17022        let mut query = self.selection.select("ports");
17023        if let Some(declared) = opts.declared {
17024            query = query.arg("declared", declared);
17025        }
17026        let query = query.select("id");
17027        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17028        Ok(ids
17029            .into_iter()
17030            .map(|id| Port {
17031                proc: self.proc.clone(),
17032                selection: crate::querybuilder::query()
17033                    .select("node")
17034                    .arg("id", &id.0)
17035                    .inline_fragment("Port"),
17036                graphql_client: self.graphql_client.clone(),
17037            })
17038            .collect())
17039    }
17040    /// Retrieves an endpoint that clients can use to reach this container.
17041    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17042    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17043    ///
17044    /// # Arguments
17045    ///
17046    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17047    pub async fn endpoint(&self) -> Result<String, DaggerError> {
17048        let query = self.selection.select("endpoint");
17049        query.execute(self.graphql_client.clone()).await
17050    }
17051    /// Retrieves an endpoint that clients can use to reach this container.
17052    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
17053    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
17054    ///
17055    /// # Arguments
17056    ///
17057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17058    pub async fn endpoint_opts<'a>(
17059        &self,
17060        opts: ServiceEndpointOpts<'a>,
17061    ) -> Result<String, DaggerError> {
17062        let mut query = self.selection.select("endpoint");
17063        if let Some(port) = opts.port {
17064            query = query.arg("port", port);
17065        }
17066        if let Some(scheme) = opts.scheme {
17067            query = query.arg("scheme", scheme);
17068        }
17069        query.execute(self.graphql_client.clone()).await
17070    }
17071    /// Start the service and wait for its health checks to succeed.
17072    /// Services bound to a Container do not need to be manually started.
17073    pub async fn start(&self) -> Result<Service, DaggerError> {
17074        let query = self.selection.select("start");
17075        let id: Id = query.execute(self.graphql_client.clone()).await?;
17076        Ok(Service {
17077            proc: self.proc.clone(),
17078            selection: query
17079                .root()
17080                .select("node")
17081                .arg("id", &id.0)
17082                .inline_fragment("Service"),
17083            graphql_client: self.graphql_client.clone(),
17084        })
17085    }
17086    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17087    ///
17088    /// # Arguments
17089    ///
17090    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17091    pub async fn up(&self) -> Result<Void, DaggerError> {
17092        let query = self.selection.select("up");
17093        query.execute(self.graphql_client.clone()).await
17094    }
17095    /// Creates a tunnel that forwards traffic from the caller's network to this service.
17096    ///
17097    /// # Arguments
17098    ///
17099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17100    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
17101        let mut query = self.selection.select("up");
17102        if let Some(ports) = opts.ports {
17103            query = query.arg("ports", ports);
17104        }
17105        if let Some(random) = opts.random {
17106            query = query.arg("random", random);
17107        }
17108        query.execute(self.graphql_client.clone()).await
17109    }
17110    /// Stop the service.
17111    ///
17112    /// # Arguments
17113    ///
17114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17115    pub async fn stop(&self) -> Result<Service, DaggerError> {
17116        let query = self.selection.select("stop");
17117        let id: Id = query.execute(self.graphql_client.clone()).await?;
17118        Ok(Service {
17119            proc: self.proc.clone(),
17120            selection: query
17121                .root()
17122                .select("node")
17123                .arg("id", &id.0)
17124                .inline_fragment("Service"),
17125            graphql_client: self.graphql_client.clone(),
17126        })
17127    }
17128    /// Stop the service.
17129    ///
17130    /// # Arguments
17131    ///
17132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17133    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
17134        let mut query = self.selection.select("stop");
17135        if let Some(kill) = opts.kill {
17136            query = query.arg("kill", kill);
17137        }
17138        let id: Id = query.execute(self.graphql_client.clone()).await?;
17139        Ok(Service {
17140            proc: self.proc.clone(),
17141            selection: query
17142                .root()
17143                .select("node")
17144                .arg("id", &id.0)
17145                .inline_fragment("Service"),
17146            graphql_client: self.graphql_client.clone(),
17147        })
17148    }
17149    ///
17150    /// # Arguments
17151    ///
17152    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17153    pub fn terminal(&self) -> Service {
17154        let query = self.selection.select("terminal");
17155        Service {
17156            proc: self.proc.clone(),
17157            selection: query,
17158            graphql_client: self.graphql_client.clone(),
17159        }
17160    }
17161    ///
17162    /// # Arguments
17163    ///
17164    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17165    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
17166        let mut query = self.selection.select("terminal");
17167        if let Some(cmd) = opts.cmd {
17168            query = query.arg("cmd", cmd);
17169        }
17170        Service {
17171            proc: self.proc.clone(),
17172            selection: query,
17173            graphql_client: self.graphql_client.clone(),
17174        }
17175    }
17176}
17177impl Node for Service {
17178    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17179        let query = self.selection.select("id");
17180        let graphql_client = self.graphql_client.clone();
17181        async move { query.execute(graphql_client).await }
17182    }
17183}
17184impl Syncer for Service {
17185    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17186        let query = self.selection.select("id");
17187        let graphql_client = self.graphql_client.clone();
17188        async move { query.execute(graphql_client).await }
17189    }
17190    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17191        let query = self.selection.select("sync");
17192        let proc = self.proc.clone();
17193        let graphql_client = self.graphql_client.clone();
17194        async move {
17195            let id: Id = query.execute(graphql_client.clone()).await?;
17196            Ok(Self {
17197                proc,
17198                selection: query
17199                    .root()
17200                    .select("node")
17201                    .arg("id", &id.0)
17202                    .inline_fragment("Service"),
17203                graphql_client,
17204            })
17205        }
17206    }
17207}
17208#[derive(Clone)]
17209pub struct Socket {
17210    pub proc: Option<Arc<DaggerSessionProc>>,
17211    pub selection: Selection,
17212    pub graphql_client: DynGraphQLClient,
17213}
17214impl IntoID<Id> for Socket {
17215    fn into_id(
17216        self,
17217    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17218        Box::pin(async move { self.id().await })
17219    }
17220}
17221impl Loadable for Socket {
17222    fn graphql_type() -> &'static str {
17223        "Socket"
17224    }
17225    fn from_query(
17226        proc: Option<Arc<DaggerSessionProc>>,
17227        selection: Selection,
17228        graphql_client: DynGraphQLClient,
17229    ) -> Self {
17230        Self {
17231            proc,
17232            selection,
17233            graphql_client,
17234        }
17235    }
17236}
17237impl Socket {
17238    /// A unique identifier for this Socket.
17239    pub async fn id(&self) -> Result<Id, DaggerError> {
17240        let query = self.selection.select("id");
17241        query.execute(self.graphql_client.clone()).await
17242    }
17243}
17244impl Node for Socket {
17245    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17246        let query = self.selection.select("id");
17247        let graphql_client = self.graphql_client.clone();
17248        async move { query.execute(graphql_client).await }
17249    }
17250}
17251#[derive(Clone)]
17252pub struct SourceMap {
17253    pub proc: Option<Arc<DaggerSessionProc>>,
17254    pub selection: Selection,
17255    pub graphql_client: DynGraphQLClient,
17256}
17257impl IntoID<Id> for SourceMap {
17258    fn into_id(
17259        self,
17260    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17261        Box::pin(async move { self.id().await })
17262    }
17263}
17264impl Loadable for SourceMap {
17265    fn graphql_type() -> &'static str {
17266        "SourceMap"
17267    }
17268    fn from_query(
17269        proc: Option<Arc<DaggerSessionProc>>,
17270        selection: Selection,
17271        graphql_client: DynGraphQLClient,
17272    ) -> Self {
17273        Self {
17274            proc,
17275            selection,
17276            graphql_client,
17277        }
17278    }
17279}
17280impl SourceMap {
17281    /// A unique identifier for this SourceMap.
17282    pub async fn id(&self) -> Result<Id, DaggerError> {
17283        let query = self.selection.select("id");
17284        query.execute(self.graphql_client.clone()).await
17285    }
17286    /// The module dependency this was declared in.
17287    pub async fn module(&self) -> Result<String, DaggerError> {
17288        let query = self.selection.select("module");
17289        query.execute(self.graphql_client.clone()).await
17290    }
17291    /// The filename from the module source.
17292    pub async fn filename(&self) -> Result<String, DaggerError> {
17293        let query = self.selection.select("filename");
17294        query.execute(self.graphql_client.clone()).await
17295    }
17296    /// The line number within the filename.
17297    pub async fn line(&self) -> Result<isize, DaggerError> {
17298        let query = self.selection.select("line");
17299        query.execute(self.graphql_client.clone()).await
17300    }
17301    /// The column number within the line.
17302    pub async fn column(&self) -> Result<isize, DaggerError> {
17303        let query = self.selection.select("column");
17304        query.execute(self.graphql_client.clone()).await
17305    }
17306    /// The URL to the file, if any. This can be used to link to the source map in the browser.
17307    pub async fn url(&self) -> Result<String, DaggerError> {
17308        let query = self.selection.select("url");
17309        query.execute(self.graphql_client.clone()).await
17310    }
17311}
17312impl Node for SourceMap {
17313    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17314        let query = self.selection.select("id");
17315        let graphql_client = self.graphql_client.clone();
17316        async move { query.execute(graphql_client).await }
17317    }
17318}
17319#[derive(Clone)]
17320pub struct Stat {
17321    pub proc: Option<Arc<DaggerSessionProc>>,
17322    pub selection: Selection,
17323    pub graphql_client: DynGraphQLClient,
17324}
17325impl IntoID<Id> for Stat {
17326    fn into_id(
17327        self,
17328    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17329        Box::pin(async move { self.id().await })
17330    }
17331}
17332impl Loadable for Stat {
17333    fn graphql_type() -> &'static str {
17334        "Stat"
17335    }
17336    fn from_query(
17337        proc: Option<Arc<DaggerSessionProc>>,
17338        selection: Selection,
17339        graphql_client: DynGraphQLClient,
17340    ) -> Self {
17341        Self {
17342            proc,
17343            selection,
17344            graphql_client,
17345        }
17346    }
17347}
17348impl Stat {
17349    /// A unique identifier for this Stat.
17350    pub async fn id(&self) -> Result<Id, DaggerError> {
17351        let query = self.selection.select("id");
17352        query.execute(self.graphql_client.clone()).await
17353    }
17354    /// file size
17355    pub async fn size(&self) -> Result<isize, DaggerError> {
17356        let query = self.selection.select("size");
17357        query.execute(self.graphql_client.clone()).await
17358    }
17359    /// file name
17360    pub async fn name(&self) -> Result<String, DaggerError> {
17361        let query = self.selection.select("name");
17362        query.execute(self.graphql_client.clone()).await
17363    }
17364    /// file type
17365    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
17366        let query = self.selection.select("fileType");
17367        query.execute(self.graphql_client.clone()).await
17368    }
17369    /// permission bits
17370    pub async fn permissions(&self) -> Result<isize, DaggerError> {
17371        let query = self.selection.select("permissions");
17372        query.execute(self.graphql_client.clone()).await
17373    }
17374}
17375impl Node for Stat {
17376    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17377        let query = self.selection.select("id");
17378        let graphql_client = self.graphql_client.clone();
17379        async move { query.execute(graphql_client).await }
17380    }
17381}
17382#[derive(Clone)]
17383pub struct Terminal {
17384    pub proc: Option<Arc<DaggerSessionProc>>,
17385    pub selection: Selection,
17386    pub graphql_client: DynGraphQLClient,
17387}
17388impl IntoID<Id> for Terminal {
17389    fn into_id(
17390        self,
17391    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17392        Box::pin(async move { self.id().await })
17393    }
17394}
17395impl Loadable for Terminal {
17396    fn graphql_type() -> &'static str {
17397        "Terminal"
17398    }
17399    fn from_query(
17400        proc: Option<Arc<DaggerSessionProc>>,
17401        selection: Selection,
17402        graphql_client: DynGraphQLClient,
17403    ) -> Self {
17404        Self {
17405            proc,
17406            selection,
17407            graphql_client,
17408        }
17409    }
17410}
17411impl Terminal {
17412    /// A unique identifier for this Terminal.
17413    pub async fn id(&self) -> Result<Id, DaggerError> {
17414        let query = self.selection.select("id");
17415        query.execute(self.graphql_client.clone()).await
17416    }
17417    /// Forces evaluation of the pipeline in the engine.
17418    /// It doesn't run the default command if no exec has been set.
17419    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
17420        let query = self.selection.select("sync");
17421        let id: Id = query.execute(self.graphql_client.clone()).await?;
17422        Ok(Terminal {
17423            proc: self.proc.clone(),
17424            selection: query
17425                .root()
17426                .select("node")
17427                .arg("id", &id.0)
17428                .inline_fragment("Terminal"),
17429            graphql_client: self.graphql_client.clone(),
17430        })
17431    }
17432}
17433impl Node for Terminal {
17434    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17435        let query = self.selection.select("id");
17436        let graphql_client = self.graphql_client.clone();
17437        async move { query.execute(graphql_client).await }
17438    }
17439}
17440impl Syncer for Terminal {
17441    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17442        let query = self.selection.select("id");
17443        let graphql_client = self.graphql_client.clone();
17444        async move { query.execute(graphql_client).await }
17445    }
17446    fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17447        let query = self.selection.select("sync");
17448        let proc = self.proc.clone();
17449        let graphql_client = self.graphql_client.clone();
17450        async move {
17451            let id: Id = query.execute(graphql_client.clone()).await?;
17452            Ok(Self {
17453                proc,
17454                selection: query
17455                    .root()
17456                    .select("node")
17457                    .arg("id", &id.0)
17458                    .inline_fragment("Terminal"),
17459                graphql_client,
17460            })
17461        }
17462    }
17463}
17464#[derive(Clone)]
17465pub struct TypeDef {
17466    pub proc: Option<Arc<DaggerSessionProc>>,
17467    pub selection: Selection,
17468    pub graphql_client: DynGraphQLClient,
17469}
17470#[derive(Builder, Debug, PartialEq)]
17471pub struct TypeDefWithScalarOpts<'a> {
17472    #[builder(setter(into, strip_option), default)]
17473    pub description: Option<&'a str>,
17474}
17475#[derive(Builder, Debug, PartialEq)]
17476pub struct TypeDefWithObjectOpts<'a> {
17477    #[builder(setter(into, strip_option), default)]
17478    pub deprecated: Option<&'a str>,
17479    #[builder(setter(into, strip_option), default)]
17480    pub description: Option<&'a str>,
17481    #[builder(setter(into, strip_option), default)]
17482    pub source_map: Option<Id>,
17483}
17484#[derive(Builder, Debug, PartialEq)]
17485pub struct TypeDefWithInterfaceOpts<'a> {
17486    #[builder(setter(into, strip_option), default)]
17487    pub description: Option<&'a str>,
17488    #[builder(setter(into, strip_option), default)]
17489    pub source_map: Option<Id>,
17490}
17491#[derive(Builder, Debug, PartialEq)]
17492pub struct TypeDefWithFieldOpts<'a> {
17493    /// If deprecated, the reason or migration path.
17494    #[builder(setter(into, strip_option), default)]
17495    pub deprecated: Option<&'a str>,
17496    /// A doc string for the field, if any
17497    #[builder(setter(into, strip_option), default)]
17498    pub description: Option<&'a str>,
17499    /// The source map for the field definition.
17500    #[builder(setter(into, strip_option), default)]
17501    pub source_map: Option<Id>,
17502}
17503#[derive(Builder, Debug, PartialEq)]
17504pub struct TypeDefWithEnumOpts<'a> {
17505    /// A doc string for the enum, if any
17506    #[builder(setter(into, strip_option), default)]
17507    pub description: Option<&'a str>,
17508    /// The source map for the enum definition.
17509    #[builder(setter(into, strip_option), default)]
17510    pub source_map: Option<Id>,
17511}
17512#[derive(Builder, Debug, PartialEq)]
17513pub struct TypeDefWithEnumValueOpts<'a> {
17514    /// If deprecated, the reason or migration path.
17515    #[builder(setter(into, strip_option), default)]
17516    pub deprecated: Option<&'a str>,
17517    /// A doc string for the value, if any
17518    #[builder(setter(into, strip_option), default)]
17519    pub description: Option<&'a str>,
17520    /// The source map for the enum value definition.
17521    #[builder(setter(into, strip_option), default)]
17522    pub source_map: Option<Id>,
17523}
17524#[derive(Builder, Debug, PartialEq)]
17525pub struct TypeDefWithEnumMemberOpts<'a> {
17526    /// If deprecated, the reason or migration path.
17527    #[builder(setter(into, strip_option), default)]
17528    pub deprecated: Option<&'a str>,
17529    /// A doc string for the member, if any
17530    #[builder(setter(into, strip_option), default)]
17531    pub description: Option<&'a str>,
17532    /// The source map for the enum member definition.
17533    #[builder(setter(into, strip_option), default)]
17534    pub source_map: Option<Id>,
17535    /// The value of the member in the enum
17536    #[builder(setter(into, strip_option), default)]
17537    pub value: Option<&'a str>,
17538}
17539impl IntoID<Id> for TypeDef {
17540    fn into_id(
17541        self,
17542    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17543        Box::pin(async move { self.id().await })
17544    }
17545}
17546impl Loadable for TypeDef {
17547    fn graphql_type() -> &'static str {
17548        "TypeDef"
17549    }
17550    fn from_query(
17551        proc: Option<Arc<DaggerSessionProc>>,
17552        selection: Selection,
17553        graphql_client: DynGraphQLClient,
17554    ) -> Self {
17555        Self {
17556            proc,
17557            selection,
17558            graphql_client,
17559        }
17560    }
17561}
17562impl TypeDef {
17563    /// A unique identifier for this TypeDef.
17564    pub async fn id(&self) -> Result<Id, DaggerError> {
17565        let query = self.selection.select("id");
17566        query.execute(self.graphql_client.clone()).await
17567    }
17568    /// Mark this object as a collection.
17569    pub fn with_collection(&self) -> TypeDef {
17570        let query = self.selection.select("withCollection");
17571        TypeDef {
17572            proc: self.proc.clone(),
17573            selection: query,
17574            graphql_client: self.graphql_client.clone(),
17575        }
17576    }
17577    /// Select the stored keys field for this collection.
17578    pub fn with_collection_keys(&self, name: impl Into<String>) -> TypeDef {
17579        let mut query = self.selection.select("withCollectionKeys");
17580        query = query.arg("name", name.into());
17581        TypeDef {
17582            proc: self.proc.clone(),
17583            selection: query,
17584            graphql_client: self.graphql_client.clone(),
17585        }
17586    }
17587    /// Select the item lookup function for this collection.
17588    pub fn with_collection_get(&self, name: impl Into<String>) -> TypeDef {
17589        let mut query = self.selection.select("withCollectionGet");
17590        query = query.arg("name", name.into());
17591        TypeDef {
17592            proc: self.proc.clone(),
17593            selection: query,
17594            graphql_client: self.graphql_client.clone(),
17595        }
17596    }
17597    /// Select the field that receives changes from the original collection.
17598    pub fn with_collection_delta(&self, name: impl Into<String>) -> TypeDef {
17599        let mut query = self.selection.select("withCollectionDelta");
17600        query = query.arg("name", name.into());
17601        TypeDef {
17602            proc: self.proc.clone(),
17603            selection: query,
17604            graphql_client: self.graphql_client.clone(),
17605        }
17606    }
17607    /// Collection metadata, or null if this object is not a collection.
17608    pub async fn as_collection(&self) -> Result<Option<CollectionTypeDef>, DaggerError> {
17609        let query = self.selection.select("asCollection");
17610        let query = query.select("id");
17611        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
17612        Ok(id.map(|id| CollectionTypeDef {
17613            proc: self.proc.clone(),
17614            selection: query
17615                .root()
17616                .select("node")
17617                .arg("id", &id.0)
17618                .inline_fragment("CollectionTypeDef"),
17619            graphql_client: self.graphql_client.clone(),
17620        }))
17621    }
17622    /// The canonical non-optional name of the type.
17623    pub async fn name(&self) -> Result<String, DaggerError> {
17624        let query = self.selection.select("name");
17625        query.execute(self.graphql_client.clone()).await
17626    }
17627    /// The kind of type this is (e.g. primitive, list, object).
17628    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
17629        let query = self.selection.select("kind");
17630        query.execute(self.graphql_client.clone()).await
17631    }
17632    /// Whether this type can be set to null. Defaults to false.
17633    pub async fn optional(&self) -> Result<bool, DaggerError> {
17634        let query = self.selection.select("optional");
17635        query.execute(self.graphql_client.clone()).await
17636    }
17637    /// Sets whether this type can be set to null.
17638    pub fn with_optional(&self, optional: bool) -> TypeDef {
17639        let mut query = self.selection.select("withOptional");
17640        query = query.arg("optional", optional);
17641        TypeDef {
17642            proc: self.proc.clone(),
17643            selection: query,
17644            graphql_client: self.graphql_client.clone(),
17645        }
17646    }
17647    /// Sets the kind of the type.
17648    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
17649        let mut query = self.selection.select("withKind");
17650        query = query.arg("kind", kind);
17651        TypeDef {
17652            proc: self.proc.clone(),
17653            selection: query,
17654            graphql_client: self.graphql_client.clone(),
17655        }
17656    }
17657    /// Returns a TypeDef of kind Scalar with the provided name.
17658    ///
17659    /// # Arguments
17660    ///
17661    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17662    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
17663        let mut query = self.selection.select("withScalar");
17664        query = query.arg("name", name.into());
17665        TypeDef {
17666            proc: self.proc.clone(),
17667            selection: query,
17668            graphql_client: self.graphql_client.clone(),
17669        }
17670    }
17671    /// Returns a TypeDef of kind Scalar with the provided name.
17672    ///
17673    /// # Arguments
17674    ///
17675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17676    pub fn with_scalar_opts<'a>(
17677        &self,
17678        name: impl Into<String>,
17679        opts: TypeDefWithScalarOpts<'a>,
17680    ) -> TypeDef {
17681        let mut query = self.selection.select("withScalar");
17682        query = query.arg("name", name.into());
17683        if let Some(description) = opts.description {
17684            query = query.arg("description", description);
17685        }
17686        TypeDef {
17687            proc: self.proc.clone(),
17688            selection: query,
17689            graphql_client: self.graphql_client.clone(),
17690        }
17691    }
17692    /// Returns a TypeDef of kind List with the provided type for its elements.
17693    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
17694        let mut query = self.selection.select("withListOf");
17695        query = query.arg_lazy(
17696            "elementType",
17697            Box::new(move || {
17698                let element_type = element_type.clone();
17699                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
17700            }),
17701        );
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(&self, name: impl Into<String>) -> TypeDef {
17715        let mut query = self.selection.select("withObject");
17716        query = query.arg("name", name.into());
17717        TypeDef {
17718            proc: self.proc.clone(),
17719            selection: query,
17720            graphql_client: self.graphql_client.clone(),
17721        }
17722    }
17723    /// Returns a TypeDef of kind Object with the provided name.
17724    /// 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.
17725    ///
17726    /// # Arguments
17727    ///
17728    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17729    pub fn with_object_opts<'a>(
17730        &self,
17731        name: impl Into<String>,
17732        opts: TypeDefWithObjectOpts<'a>,
17733    ) -> TypeDef {
17734        let mut query = self.selection.select("withObject");
17735        query = query.arg("name", name.into());
17736        if let Some(description) = opts.description {
17737            query = query.arg("description", description);
17738        }
17739        if let Some(source_map) = opts.source_map {
17740            query = query.arg("sourceMap", source_map);
17741        }
17742        if let Some(deprecated) = opts.deprecated {
17743            query = query.arg("deprecated", deprecated);
17744        }
17745        TypeDef {
17746            proc: self.proc.clone(),
17747            selection: query,
17748            graphql_client: self.graphql_client.clone(),
17749        }
17750    }
17751    /// Returns a TypeDef of kind Interface with the provided name.
17752    ///
17753    /// # Arguments
17754    ///
17755    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17756    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
17757        let mut query = self.selection.select("withInterface");
17758        query = query.arg("name", name.into());
17759        TypeDef {
17760            proc: self.proc.clone(),
17761            selection: query,
17762            graphql_client: self.graphql_client.clone(),
17763        }
17764    }
17765    /// Returns a TypeDef of kind Interface with the provided name.
17766    ///
17767    /// # Arguments
17768    ///
17769    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17770    pub fn with_interface_opts<'a>(
17771        &self,
17772        name: impl Into<String>,
17773        opts: TypeDefWithInterfaceOpts<'a>,
17774    ) -> TypeDef {
17775        let mut query = self.selection.select("withInterface");
17776        query = query.arg("name", name.into());
17777        if let Some(description) = opts.description {
17778            query = query.arg("description", description);
17779        }
17780        if let Some(source_map) = opts.source_map {
17781            query = query.arg("sourceMap", source_map);
17782        }
17783        TypeDef {
17784            proc: self.proc.clone(),
17785            selection: query,
17786            graphql_client: self.graphql_client.clone(),
17787        }
17788    }
17789    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
17790    ///
17791    /// # Arguments
17792    ///
17793    /// * `name` - The name of the field in the object
17794    /// * `type_def` - The type of the field
17795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17796    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
17797        let mut query = self.selection.select("withField");
17798        query = query.arg("name", name.into());
17799        query = query.arg_lazy(
17800            "typeDef",
17801            Box::new(move || {
17802                let type_def = type_def.clone();
17803                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17804            }),
17805        );
17806        TypeDef {
17807            proc: self.proc.clone(),
17808            selection: query,
17809            graphql_client: self.graphql_client.clone(),
17810        }
17811    }
17812    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
17813    ///
17814    /// # Arguments
17815    ///
17816    /// * `name` - The name of the field in the object
17817    /// * `type_def` - The type of the field
17818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17819    pub fn with_field_opts<'a>(
17820        &self,
17821        name: impl Into<String>,
17822        type_def: impl IntoID<Id>,
17823        opts: TypeDefWithFieldOpts<'a>,
17824    ) -> TypeDef {
17825        let mut query = self.selection.select("withField");
17826        query = query.arg("name", name.into());
17827        query = query.arg_lazy(
17828            "typeDef",
17829            Box::new(move || {
17830                let type_def = type_def.clone();
17831                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17832            }),
17833        );
17834        if let Some(description) = opts.description {
17835            query = query.arg("description", description);
17836        }
17837        if let Some(source_map) = opts.source_map {
17838            query = query.arg("sourceMap", source_map);
17839        }
17840        if let Some(deprecated) = opts.deprecated {
17841            query = query.arg("deprecated", deprecated);
17842        }
17843        TypeDef {
17844            proc: self.proc.clone(),
17845            selection: query,
17846            graphql_client: self.graphql_client.clone(),
17847        }
17848    }
17849    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
17850    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
17851        let mut query = self.selection.select("withFunction");
17852        query = query.arg_lazy(
17853            "function",
17854            Box::new(move || {
17855                let function = function.clone();
17856                Box::pin(async move { function.into_id().await.unwrap().quote() })
17857            }),
17858        );
17859        TypeDef {
17860            proc: self.proc.clone(),
17861            selection: query,
17862            graphql_client: self.graphql_client.clone(),
17863        }
17864    }
17865    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
17866    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
17867        let mut query = self.selection.select("withConstructor");
17868        query = query.arg_lazy(
17869            "function",
17870            Box::new(move || {
17871                let function = function.clone();
17872                Box::pin(async move { function.into_id().await.unwrap().quote() })
17873            }),
17874        );
17875        TypeDef {
17876            proc: self.proc.clone(),
17877            selection: query,
17878            graphql_client: self.graphql_client.clone(),
17879        }
17880    }
17881    /// Returns a TypeDef of kind Enum with the provided name.
17882    /// 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.
17883    ///
17884    /// # Arguments
17885    ///
17886    /// * `name` - The name of the enum
17887    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17888    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
17889        let mut query = self.selection.select("withEnum");
17890        query = query.arg("name", name.into());
17891        TypeDef {
17892            proc: self.proc.clone(),
17893            selection: query,
17894            graphql_client: self.graphql_client.clone(),
17895        }
17896    }
17897    /// Returns a TypeDef of kind Enum with the provided name.
17898    /// 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.
17899    ///
17900    /// # Arguments
17901    ///
17902    /// * `name` - The name of the enum
17903    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17904    pub fn with_enum_opts<'a>(
17905        &self,
17906        name: impl Into<String>,
17907        opts: TypeDefWithEnumOpts<'a>,
17908    ) -> TypeDef {
17909        let mut query = self.selection.select("withEnum");
17910        query = query.arg("name", name.into());
17911        if let Some(description) = opts.description {
17912            query = query.arg("description", description);
17913        }
17914        if let Some(source_map) = opts.source_map {
17915            query = query.arg("sourceMap", source_map);
17916        }
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(&self, value: impl Into<String>) -> TypeDef {
17930        let mut query = self.selection.select("withEnumValue");
17931        query = query.arg("value", value.into());
17932        TypeDef {
17933            proc: self.proc.clone(),
17934            selection: query,
17935            graphql_client: self.graphql_client.clone(),
17936        }
17937    }
17938    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17939    ///
17940    /// # Arguments
17941    ///
17942    /// * `value` - The name of the value in the enum
17943    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17944    pub fn with_enum_value_opts<'a>(
17945        &self,
17946        value: impl Into<String>,
17947        opts: TypeDefWithEnumValueOpts<'a>,
17948    ) -> TypeDef {
17949        let mut query = self.selection.select("withEnumValue");
17950        query = query.arg("value", value.into());
17951        if let Some(description) = opts.description {
17952            query = query.arg("description", description);
17953        }
17954        if let Some(source_map) = opts.source_map {
17955            query = query.arg("sourceMap", source_map);
17956        }
17957        if let Some(deprecated) = opts.deprecated {
17958            query = query.arg("deprecated", deprecated);
17959        }
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(&self, name: impl Into<String>) -> TypeDef {
17973        let mut query = self.selection.select("withEnumMember");
17974        query = query.arg("name", name.into());
17975        TypeDef {
17976            proc: self.proc.clone(),
17977            selection: query,
17978            graphql_client: self.graphql_client.clone(),
17979        }
17980    }
17981    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
17982    ///
17983    /// # Arguments
17984    ///
17985    /// * `name` - The name of the member in the enum
17986    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17987    pub fn with_enum_member_opts<'a>(
17988        &self,
17989        name: impl Into<String>,
17990        opts: TypeDefWithEnumMemberOpts<'a>,
17991    ) -> TypeDef {
17992        let mut query = self.selection.select("withEnumMember");
17993        query = query.arg("name", name.into());
17994        if let Some(value) = opts.value {
17995            query = query.arg("value", value);
17996        }
17997        if let Some(description) = opts.description {
17998            query = query.arg("description", description);
17999        }
18000        if let Some(source_map) = opts.source_map {
18001            query = query.arg("sourceMap", source_map);
18002        }
18003        if let Some(deprecated) = opts.deprecated {
18004            query = query.arg("deprecated", deprecated);
18005        }
18006        TypeDef {
18007            proc: self.proc.clone(),
18008            selection: query,
18009            graphql_client: self.graphql_client.clone(),
18010        }
18011    }
18012    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
18013    pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
18014        let query = self.selection.select("asList");
18015        let query = query.select("id");
18016        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18017        Ok(id.map(|id| ListTypeDef {
18018            proc: self.proc.clone(),
18019            selection: query
18020                .root()
18021                .select("node")
18022                .arg("id", &id.0)
18023                .inline_fragment("ListTypeDef"),
18024            graphql_client: self.graphql_client.clone(),
18025        }))
18026    }
18027    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
18028    pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
18029        let query = self.selection.select("asObject");
18030        let query = query.select("id");
18031        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18032        Ok(id.map(|id| ObjectTypeDef {
18033            proc: self.proc.clone(),
18034            selection: query
18035                .root()
18036                .select("node")
18037                .arg("id", &id.0)
18038                .inline_fragment("ObjectTypeDef"),
18039            graphql_client: self.graphql_client.clone(),
18040        }))
18041    }
18042    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
18043    pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
18044        let query = self.selection.select("asInterface");
18045        let query = query.select("id");
18046        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18047        Ok(id.map(|id| InterfaceTypeDef {
18048            proc: self.proc.clone(),
18049            selection: query
18050                .root()
18051                .select("node")
18052                .arg("id", &id.0)
18053                .inline_fragment("InterfaceTypeDef"),
18054            graphql_client: self.graphql_client.clone(),
18055        }))
18056    }
18057    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
18058    pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
18059        let query = self.selection.select("asInput");
18060        let query = query.select("id");
18061        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18062        Ok(id.map(|id| InputTypeDef {
18063            proc: self.proc.clone(),
18064            selection: query
18065                .root()
18066                .select("node")
18067                .arg("id", &id.0)
18068                .inline_fragment("InputTypeDef"),
18069            graphql_client: self.graphql_client.clone(),
18070        }))
18071    }
18072    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
18073    pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
18074        let query = self.selection.select("asScalar");
18075        let query = query.select("id");
18076        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18077        Ok(id.map(|id| ScalarTypeDef {
18078            proc: self.proc.clone(),
18079            selection: query
18080                .root()
18081                .select("node")
18082                .arg("id", &id.0)
18083                .inline_fragment("ScalarTypeDef"),
18084            graphql_client: self.graphql_client.clone(),
18085        }))
18086    }
18087    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
18088    pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
18089        let query = self.selection.select("asEnum");
18090        let query = query.select("id");
18091        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18092        Ok(id.map(|id| EnumTypeDef {
18093            proc: self.proc.clone(),
18094            selection: query
18095                .root()
18096                .select("node")
18097                .arg("id", &id.0)
18098                .inline_fragment("EnumTypeDef"),
18099            graphql_client: self.graphql_client.clone(),
18100        }))
18101    }
18102}
18103impl Node for TypeDef {
18104    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18105        let query = self.selection.select("id");
18106        let graphql_client = self.graphql_client.clone();
18107        async move { query.execute(graphql_client).await }
18108    }
18109}
18110#[derive(Clone)]
18111pub struct Volume {
18112    pub proc: Option<Arc<DaggerSessionProc>>,
18113    pub selection: Selection,
18114    pub graphql_client: DynGraphQLClient,
18115}
18116impl IntoID<Id> for Volume {
18117    fn into_id(
18118        self,
18119    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18120        Box::pin(async move { self.id().await })
18121    }
18122}
18123impl Loadable for Volume {
18124    fn graphql_type() -> &'static str {
18125        "Volume"
18126    }
18127    fn from_query(
18128        proc: Option<Arc<DaggerSessionProc>>,
18129        selection: Selection,
18130        graphql_client: DynGraphQLClient,
18131    ) -> Self {
18132        Self {
18133            proc,
18134            selection,
18135            graphql_client,
18136        }
18137    }
18138}
18139impl Volume {
18140    /// A unique identifier for this Volume.
18141    pub async fn id(&self) -> Result<Id, DaggerError> {
18142        let query = self.selection.select("id");
18143        query.execute(self.graphql_client.clone()).await
18144    }
18145}
18146impl Node for Volume {
18147    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18148        let query = self.selection.select("id");
18149        let graphql_client = self.graphql_client.clone();
18150        async move { query.execute(graphql_client).await }
18151    }
18152}
18153#[derive(Clone)]
18154pub struct Workspace {
18155    pub proc: Option<Arc<DaggerSessionProc>>,
18156    pub selection: Selection,
18157    pub graphql_client: DynGraphQLClient,
18158}
18159#[derive(Builder, Debug, PartialEq)]
18160pub struct WorkspaceMigrateModuleOpts<'a> {
18161    /// Module directory. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18162    #[builder(setter(into, strip_option), default)]
18163    pub path: Option<&'a str>,
18164}
18165#[derive(Builder, Debug, PartialEq)]
18166pub struct WorkspaceCompareCommitsFromOpts<'a> {
18167    /// 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.
18168    #[builder(setter(into, strip_option), default)]
18169    pub commits: Option<Vec<&'a str>>,
18170    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18171    #[builder(setter(into, strip_option), default)]
18172    pub max_commits: Option<isize>,
18173}
18174#[derive(Builder, Debug, PartialEq)]
18175pub struct WorkspaceWithCommitsFromOpts<'a> {
18176    /// 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.
18177    #[builder(setter(into, strip_option), default)]
18178    pub commits: Option<Vec<&'a str>>,
18179    /// Maximum commits in either differing history, from 1 to 1000. Exceeding the limit fails; nothing is silently omitted.
18180    #[builder(setter(into, strip_option), default)]
18181    pub max_commits: Option<isize>,
18182}
18183#[derive(Builder, Debug, PartialEq)]
18184pub struct WorkspaceWithCommitOpts<'a> {
18185    /// Author and committer email. Defaults to git config user.email in the calling client's working directory, otherwise dagger@localhost.
18186    #[builder(setter(into, strip_option), default)]
18187    pub author_email: Option<&'a str>,
18188    /// Author and committer name. Defaults to git config user.name in the calling client's working directory, otherwise Dagger.
18189    #[builder(setter(into, strip_option), default)]
18190    pub author_name: Option<&'a str>,
18191    /// Add a Signed-off-by trailer using the commit author's name and email.
18192    #[builder(setter(into, strip_option), default)]
18193    pub signoff: Option<bool>,
18194}
18195#[derive(Builder, Debug, PartialEq)]
18196pub struct WorkspaceWithResetOpts {
18197    /// Discard uncommitted changes, resetting the working tree to the commit.
18198    #[builder(setter(into, strip_option), default)]
18199    pub hard: Option<bool>,
18200}
18201#[derive(Builder, Debug, PartialEq)]
18202pub struct WorkspaceDirectoryOpts<'a> {
18203    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
18204    #[builder(setter(into, strip_option), default)]
18205    pub exclude: Option<Vec<&'a str>>,
18206    /// Apply .gitignore filter rules inside the directory.
18207    #[builder(setter(into, strip_option), default)]
18208    pub gitignore: Option<bool>,
18209    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
18210    #[builder(setter(into, strip_option), default)]
18211    pub include: Option<Vec<&'a str>>,
18212}
18213#[derive(Builder, Debug, PartialEq)]
18214pub struct WorkspaceSearchOpts<'a> {
18215    /// Allow the . pattern to match newlines in multiline mode.
18216    #[builder(setter(into, strip_option), default)]
18217    pub dotall: Option<bool>,
18218    /// Only return matching files, not lines and content
18219    #[builder(setter(into, strip_option), default)]
18220    pub files_only: Option<bool>,
18221    /// Glob patterns to match (e.g., "*.md")
18222    #[builder(setter(into, strip_option), default)]
18223    pub globs: Option<Vec<&'a str>>,
18224    /// Enable case-insensitive matching.
18225    #[builder(setter(into, strip_option), default)]
18226    pub insensitive: Option<bool>,
18227    /// Limit the number of results to return
18228    #[builder(setter(into, strip_option), default)]
18229    pub limit: Option<isize>,
18230    /// Interpret the pattern as a literal string instead of a regular expression.
18231    #[builder(setter(into, strip_option), default)]
18232    pub literal: Option<bool>,
18233    /// Enable searching across multiple lines.
18234    #[builder(setter(into, strip_option), default)]
18235    pub multiline: Option<bool>,
18236    /// Directory or file paths to search
18237    #[builder(setter(into, strip_option), default)]
18238    pub paths: Option<Vec<&'a str>>,
18239    /// Skip hidden files (files starting with .).
18240    #[builder(setter(into, strip_option), default)]
18241    pub skip_hidden: Option<bool>,
18242    /// Honor .gitignore, .ignore, and .rgignore files.
18243    #[builder(setter(into, strip_option), default)]
18244    pub skip_ignored: Option<bool>,
18245}
18246#[derive(Builder, Debug, PartialEq)]
18247pub struct WorkspaceFindUpOpts<'a> {
18248    /// Path to start the search from. Relative paths resolve from the workspace cwd; absolute paths resolve from the workspace root.
18249    #[builder(setter(into, strip_option), default)]
18250    pub from: Option<&'a str>,
18251}
18252#[derive(Builder, Debug, PartialEq)]
18253pub struct WorkspaceFindRootsOpts<'a> {
18254    /// Glob patterns pruning the walk below start (e.g. ["**/node_modules/**"]).
18255    #[builder(setter(into, strip_option), default)]
18256    pub exclude: Option<Vec<&'a str>>,
18257    /// Directory to start from. Relative paths resolve from the workspace cwd.
18258    #[builder(setter(into, strip_option), default)]
18259    pub start: Option<&'a str>,
18260}
18261#[derive(Builder, Debug, PartialEq)]
18262pub struct WorkspaceWithNewFileOpts {
18263    /// Permissions of the new file.
18264    #[builder(setter(into, strip_option), default)]
18265    pub permissions: Option<isize>,
18266}
18267#[derive(Builder, Debug, PartialEq)]
18268pub struct WorkspaceWithFileOpts {
18269    /// Permissions of the added file. Defaults to the source file permissions.
18270    #[builder(setter(into, strip_option), default)]
18271    pub permissions: Option<isize>,
18272}
18273#[derive(Builder, Debug, PartialEq)]
18274pub struct WorkspaceWithPatchFileOpts {
18275    /// 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.
18276    #[builder(setter(into, strip_option), default)]
18277    pub on_conflict: Option<PatchConflict>,
18278}
18279#[derive(Builder, Debug, PartialEq)]
18280pub struct WorkspaceWithModuleOpts<'a> {
18281    /// Write to the workspace config directory at the workspace cwd.
18282    #[builder(setter(into, strip_option), default)]
18283    pub here: Option<bool>,
18284    /// Override name for the installed module entry.
18285    #[builder(setter(into, strip_option), default)]
18286    pub name: Option<&'a str>,
18287}
18288#[derive(Builder, Debug, PartialEq)]
18289pub struct WorkspaceWithoutModuleOpts {
18290    /// Write to the workspace config directory at the workspace cwd.
18291    #[builder(setter(into, strip_option), default)]
18292    pub here: Option<bool>,
18293}
18294#[derive(Builder, Debug, PartialEq)]
18295pub struct WorkspaceWithSdkOpts<'a> {
18296    /// Optional override for the SDK name conventionally derived from the installed module name.
18297    #[builder(setter(into, strip_option), default)]
18298    pub as_sdk_name: Option<&'a str>,
18299    /// Write to the workspace config directory at the workspace cwd.
18300    #[builder(setter(into, strip_option), default)]
18301    pub here: Option<bool>,
18302    /// Override name for the installed SDK entry.
18303    #[builder(setter(into, strip_option), default)]
18304    pub name: Option<&'a str>,
18305}
18306#[derive(Builder, Debug, PartialEq)]
18307pub struct WorkspaceWithoutSdkOpts {
18308    /// Write to the workspace config directory at the workspace cwd.
18309    #[builder(setter(into, strip_option), default)]
18310    pub here: Option<bool>,
18311}
18312#[derive(Builder, Debug, PartialEq)]
18313pub struct WorkspaceWithInitModuleOpts<'a> {
18314    /// 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.
18315    #[builder(setter(into, strip_option), default)]
18316    pub entrypoint: Option<bool>,
18317    /// Install the module. When omitted, install only if path is omitted.
18318    #[builder(setter(into, strip_option), default)]
18319    pub install: Option<bool>,
18320    /// Module name. The engine infers it from path, the active config file, or the workspace root when omitted.
18321    #[builder(setter(into, strip_option), default)]
18322    pub name: Option<&'a str>,
18323    /// Module path relative to the workspace cwd, or an absolute workspace path. Defaults to .dagger/modules/<name> beside the active workspace config.
18324    #[builder(setter(into, strip_option), default)]
18325    pub path: Option<&'a str>,
18326    /// Explicit SDK-module constructor setting overrides for this scope.
18327    #[builder(setter(into, strip_option), default)]
18328    pub settings: Option<Json>,
18329}
18330#[derive(Builder, Debug, PartialEq)]
18331pub struct WorkspaceWithClientOpts<'a> {
18332    /// Optional SDK name. Inspect all installed SDKs when omitted.
18333    #[builder(setter(into, strip_option), default)]
18334    pub sdk: Option<&'a str>,
18335    /// Explicit SDK-module constructor setting overrides for this scope. Requires an explicit SDK name.
18336    #[builder(setter(into, strip_option), default)]
18337    pub settings: Option<Json>,
18338}
18339#[derive(Builder, Debug, PartialEq)]
18340pub struct WorkspaceWithoutClientOpts<'a> {
18341    /// Optional SDK name. Search all installed SDKs when omitted.
18342    #[builder(setter(into, strip_option), default)]
18343    pub sdk: Option<&'a str>,
18344}
18345#[derive(Builder, Debug, PartialEq)]
18346pub struct WorkspaceWithUpdatedClientsOpts<'a> {
18347    /// Select clients in every scope instead of only the scopes containing the workspace cwd.
18348    #[builder(setter(into, strip_option), default)]
18349    pub all: Option<bool>,
18350    /// Recorded client targets to update. All targets in the selected scopes are updated when omitted.
18351    #[builder(setter(into, strip_option), default)]
18352    pub modules: Option<Vec<&'a str>>,
18353    /// Optional SDK name. All installed SDK modules are selected when omitted.
18354    #[builder(setter(into, strip_option), default)]
18355    pub sdk: Option<&'a str>,
18356}
18357#[derive(Builder, Debug, PartialEq)]
18358pub struct WorkspaceWithConfigValueOpts<'a> {
18359    /// Write to the workspace config directory at the workspace cwd.
18360    #[builder(setter(into, strip_option), default)]
18361    pub here: Option<bool>,
18362    /// List value to set. Elements are stored verbatim, with no auto-detection. Mutually exclusive with value.
18363    #[builder(setter(into, strip_option), default)]
18364    pub values: Option<Vec<&'a str>>,
18365}
18366#[derive(Builder, Debug, PartialEq)]
18367pub struct WorkspaceWithoutConfigValueOpts {
18368    /// Write to the workspace config directory at the workspace cwd.
18369    #[builder(setter(into, strip_option), default)]
18370    pub here: Option<bool>,
18371}
18372#[derive(Builder, Debug, PartialEq)]
18373pub struct WorkspaceWithConfigEnvOpts {
18374    /// Write to the workspace config directory at the workspace cwd.
18375    #[builder(setter(into, strip_option), default)]
18376    pub here: Option<bool>,
18377}
18378#[derive(Builder, Debug, PartialEq)]
18379pub struct WorkspaceWithoutConfigEnvOpts {
18380    /// Write to the workspace config directory at the workspace cwd.
18381    #[builder(setter(into, strip_option), default)]
18382    pub here: Option<bool>,
18383}
18384#[derive(Builder, Debug, PartialEq)]
18385pub struct WorkspaceWithUpdatedLockOpts {
18386    /// Do not regenerate SDK client scopes.
18387    #[builder(setter(into, strip_option), default)]
18388    pub no_generate: Option<bool>,
18389}
18390#[derive(Builder, Debug, PartialEq)]
18391pub struct WorkspaceWithUpdatedModulesOpts<'a> {
18392    /// Installed module names or sources. A version suffix sets a new request. An empty list refreshes all installed modules.
18393    #[builder(setter(into, strip_option), default)]
18394    pub names: Option<Vec<&'a str>>,
18395    /// New source for exactly one selected module. Resolved like an install source. Cannot be combined with a version or a version suffix.
18396    #[builder(setter(into, strip_option), default)]
18397    pub source: Option<&'a str>,
18398    /// New version request for exactly one selected module. Cannot be combined with a version suffix.
18399    #[builder(setter(into, strip_option), default)]
18400    pub version: Option<&'a str>,
18401}
18402#[derive(Builder, Debug, PartialEq)]
18403pub struct WorkspaceChangesOpts {
18404    /// An earlier workspace state to compare against.
18405    #[builder(setter(into, strip_option), default)]
18406    pub from: Option<Id>,
18407}
18408#[derive(Builder, Debug, PartialEq)]
18409pub struct WorkspaceExportOpts<'a> {
18410    /// 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.
18411    #[builder(setter(into, strip_option), default)]
18412    pub from: Option<Id>,
18413    /// 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.
18414    #[builder(setter(into, strip_option), default)]
18415    pub path: Option<&'a str>,
18416}
18417#[derive(Builder, Debug, PartialEq)]
18418pub struct WorkspaceConfigReadOpts<'a> {
18419    /// Include the selected environment, user overrides, and legacy workspace settings.
18420    #[builder(setter(into, strip_option), default)]
18421    pub effective: Option<bool>,
18422    /// Dotted key path (e.g. modules.greeter.source). Empty for full config.
18423    #[builder(setter(into, strip_option), default)]
18424    pub key: Option<&'a str>,
18425}
18426#[derive(Builder, Debug, PartialEq)]
18427pub struct WorkspaceArtifactsOpts<'a> {
18428    /// Only include artifacts matching these path patterns, as with checks and services. A path selects that path and its children.
18429    #[builder(setter(into, strip_option), default)]
18430    pub include: Option<Vec<&'a str>>,
18431}
18432#[derive(Builder, Debug, PartialEq)]
18433pub struct WorkspaceMigrateOpts<'a> {
18434    /// Additional local modules to migrate. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
18435    #[builder(setter(into, strip_option), default)]
18436    pub modules: Option<Vec<&'a str>>,
18437}
18438impl IntoID<Id> for Workspace {
18439    fn into_id(
18440        self,
18441    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18442        Box::pin(async move { self.id().await })
18443    }
18444}
18445impl Loadable for Workspace {
18446    fn graphql_type() -> &'static str {
18447        "Workspace"
18448    }
18449    fn from_query(
18450        proc: Option<Arc<DaggerSessionProc>>,
18451        selection: Selection,
18452        graphql_client: DynGraphQLClient,
18453    ) -> Self {
18454        Self {
18455            proc,
18456            selection,
18457            graphql_client,
18458        }
18459    }
18460}
18461impl Workspace {
18462    /// A unique identifier for this Workspace.
18463    pub async fn id(&self) -> Result<Id, DaggerError> {
18464        let query = self.selection.select("id");
18465        query.execute(self.graphql_client.clone()).await
18466    }
18467    /// Resolve an address in this workspace.
18468    /// 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.
18469    /// A value without the dag:// scheme keeps its external meaning, such as a container image reference.
18470    /// The Address retains this workspace across module calls and ID reloads.
18471    ///
18472    /// # Arguments
18473    ///
18474    /// * `value` - A DAG address, or an external reference.
18475    pub fn resolve(&self, value: impl Into<String>) -> Address {
18476        let mut query = self.selection.select("resolve");
18477        query = query.arg("value", value.into());
18478        Address {
18479            proc: self.proc.clone(),
18480            selection: query,
18481            graphql_client: self.graphql_client.clone(),
18482        }
18483    }
18484    /// Return this workspace with a native configuration, without changing an existing configuration.
18485    /// Fail if legacy configuration needs workspace migration.
18486    pub fn with_initialized(&self) -> Workspace {
18487        let query = self.selection.select("withInitialized");
18488        Workspace {
18489            proc: self.proc.clone(),
18490            selection: query,
18491            graphql_client: self.graphql_client.clone(),
18492        }
18493    }
18494    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18495    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18496    ///
18497    /// # Arguments
18498    ///
18499    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18500    pub fn migrate_module(&self) -> WorkspaceMigration {
18501        let query = self.selection.select("migrateModule");
18502        WorkspaceMigration {
18503            proc: self.proc.clone(),
18504            selection: query,
18505            graphql_client: self.graphql_client.clone(),
18506        }
18507    }
18508    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
18509    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
18510    ///
18511    /// # Arguments
18512    ///
18513    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18514    pub fn migrate_module_opts<'a>(
18515        &self,
18516        opts: WorkspaceMigrateModuleOpts<'a>,
18517    ) -> WorkspaceMigration {
18518        let mut query = self.selection.select("migrateModule");
18519        if let Some(path) = opts.path {
18520            query = query.arg("path", path);
18521        }
18522        WorkspaceMigration {
18523            proc: self.proc.clone(),
18524            selection: query,
18525            graphql_client: self.graphql_client.clone(),
18526        }
18527    }
18528    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18529    /// 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.
18530    /// 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.
18531    ///
18532    /// # Arguments
18533    ///
18534    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18535    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18536    pub async fn compare_commits_from(
18537        &self,
18538        source: impl IntoID<Id>,
18539    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18540        let mut query = self.selection.select("compareCommitsFrom");
18541        query = query.arg_lazy(
18542            "source",
18543            Box::new(move || {
18544                let source = source.clone();
18545                Box::pin(async move { source.into_id().await.unwrap().quote() })
18546            }),
18547        );
18548        let query = query.select("id");
18549        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18550        Ok(ids
18551            .into_iter()
18552            .map(|id| WorkspaceCommitPick {
18553                proc: self.proc.clone(),
18554                selection: crate::querybuilder::query()
18555                    .select("node")
18556                    .arg("id", &id.0)
18557                    .inline_fragment("WorkspaceCommitPick"),
18558                graphql_client: self.graphql_client.clone(),
18559            })
18560            .collect())
18561    }
18562    /// Preview which source commits withCommitsFrom would apply, skip, or report as conflicting.
18563    /// 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.
18564    /// 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.
18565    ///
18566    /// # Arguments
18567    ///
18568    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18569    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18570    pub async fn compare_commits_from_opts<'a>(
18571        &self,
18572        source: impl IntoID<Id>,
18573        opts: WorkspaceCompareCommitsFromOpts<'a>,
18574    ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18575        let mut query = self.selection.select("compareCommitsFrom");
18576        query = query.arg_lazy(
18577            "source",
18578            Box::new(move || {
18579                let source = source.clone();
18580                Box::pin(async move { source.into_id().await.unwrap().quote() })
18581            }),
18582        );
18583        if let Some(commits) = opts.commits {
18584            query = query.arg("commits", commits);
18585        }
18586        if let Some(max_commits) = opts.max_commits {
18587            query = query.arg("maxCommits", max_commits);
18588        }
18589        let query = query.select("id");
18590        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18591        Ok(ids
18592            .into_iter()
18593            .map(|id| WorkspaceCommitPick {
18594                proc: self.proc.clone(),
18595                selection: crate::querybuilder::query()
18596                    .select("node")
18597                    .arg("id", &id.0)
18598                    .inline_fragment("WorkspaceCommitPick"),
18599                graphql_client: self.graphql_client.clone(),
18600            })
18601            .collect())
18602    }
18603    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
18604    /// 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.
18605    /// 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.
18606    /// 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.
18607    ///
18608    /// # Arguments
18609    ///
18610    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18611    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18612    pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
18613        let mut query = self.selection.select("withCommitsFrom");
18614        query = query.arg_lazy(
18615            "source",
18616            Box::new(move || {
18617                let source = source.clone();
18618                Box::pin(async move { source.into_id().await.unwrap().quote() })
18619            }),
18620        );
18621        Workspace {
18622            proc: self.proc.clone(),
18623            selection: query,
18624            graphql_client: self.graphql_client.clone(),
18625        }
18626    }
18627    /// Integrate source commits into this workspace and return the result, preserving this workspace's uncommitted changes and metadata.
18628    /// 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.
18629    /// 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.
18630    /// 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.
18631    ///
18632    /// # Arguments
18633    ///
18634    /// * `source` - Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.
18635    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18636    pub fn with_commits_from_opts<'a>(
18637        &self,
18638        source: impl IntoID<Id>,
18639        opts: WorkspaceWithCommitsFromOpts<'a>,
18640    ) -> Workspace {
18641        let mut query = self.selection.select("withCommitsFrom");
18642        query = query.arg_lazy(
18643            "source",
18644            Box::new(move || {
18645                let source = source.clone();
18646                Box::pin(async move { source.into_id().await.unwrap().quote() })
18647            }),
18648        );
18649        if let Some(commits) = opts.commits {
18650            query = query.arg("commits", commits);
18651        }
18652        if let Some(max_commits) = opts.max_commits {
18653            query = query.arg("maxCommits", max_commits);
18654        }
18655        Workspace {
18656            proc: self.proc.clone(),
18657            selection: query,
18658            graphql_client: self.graphql_client.clone(),
18659        }
18660    }
18661    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
18662    /// 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.
18663    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
18664    /// 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.
18665    ///
18666    /// # Arguments
18667    ///
18668    /// * `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.
18669    /// * `message` - Commit message.
18670    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
18671    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18672    pub fn with_commit(
18673        &self,
18674        changes: impl IntoID<Id>,
18675        message: impl Into<String>,
18676        date: impl Into<String>,
18677    ) -> Workspace {
18678        let mut query = self.selection.select("withCommit");
18679        query = query.arg_lazy(
18680            "changes",
18681            Box::new(move || {
18682                let changes = changes.clone();
18683                Box::pin(async move { changes.into_id().await.unwrap().quote() })
18684            }),
18685        );
18686        query = query.arg("message", message.into());
18687        query = query.arg("date", date.into());
18688        Workspace {
18689            proc: self.proc.clone(),
18690            selection: query,
18691            graphql_client: self.graphql_client.clone(),
18692        }
18693    }
18694    /// Create a Git commit from a changeset and return a stable workspace with HEAD advanced.
18695    /// 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.
18696    /// A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified.
18697    /// 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.
18698    ///
18699    /// # Arguments
18700    ///
18701    /// * `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.
18702    /// * `message` - Commit message.
18703    /// * `date` - RFC3339 author and committer date. Required for reproducible commits.
18704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18705    pub fn with_commit_opts<'a>(
18706        &self,
18707        changes: impl IntoID<Id>,
18708        message: impl Into<String>,
18709        date: impl Into<String>,
18710        opts: WorkspaceWithCommitOpts<'a>,
18711    ) -> Workspace {
18712        let mut query = self.selection.select("withCommit");
18713        query = query.arg_lazy(
18714            "changes",
18715            Box::new(move || {
18716                let changes = changes.clone();
18717                Box::pin(async move { changes.into_id().await.unwrap().quote() })
18718            }),
18719        );
18720        query = query.arg("message", message.into());
18721        query = query.arg("date", date.into());
18722        if let Some(author_name) = opts.author_name {
18723            query = query.arg("authorName", author_name);
18724        }
18725        if let Some(author_email) = opts.author_email {
18726            query = query.arg("authorEmail", author_email);
18727        }
18728        if let Some(signoff) = opts.signoff {
18729            query = query.arg("signoff", signoff);
18730        }
18731        Workspace {
18732            proc: self.proc.clone(),
18733            selection: query,
18734            graphql_client: self.graphql_client.clone(),
18735        }
18736    }
18737    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18738    /// 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.
18739    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18740    /// 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.
18741    ///
18742    /// # Arguments
18743    ///
18744    /// * `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.
18745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18746    pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
18747        let mut query = self.selection.select("withReset");
18748        query = query.arg("commit", commit.into());
18749        Workspace {
18750            proc: self.proc.clone(),
18751            selection: query,
18752            graphql_client: self.graphql_client.clone(),
18753        }
18754    }
18755    /// Move this workspace's Git HEAD to a commit and return the resulting stable workspace.
18756    /// 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.
18757    /// With hard, the working tree is reset to the commit and every uncommitted change is discarded.
18758    /// 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.
18759    ///
18760    /// # Arguments
18761    ///
18762    /// * `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.
18763    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18764    pub fn with_reset_opts(
18765        &self,
18766        commit: impl Into<String>,
18767        opts: WorkspaceWithResetOpts,
18768    ) -> Workspace {
18769        let mut query = self.selection.select("withReset");
18770        query = query.arg("commit", commit.into());
18771        if let Some(hard) = opts.hard {
18772            query = query.arg("hard", hard);
18773        }
18774        Workspace {
18775            proc: self.proc.clone(),
18776            selection: query,
18777            graphql_client: self.graphql_client.clone(),
18778        }
18779    }
18780    /// Return a snapshot of this workspace as a stable value.
18781    /// 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.
18782    /// 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.
18783    /// 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.
18784    /// The recipe is portable when a remote can serve its base; otherwise it is frozen for this session only.
18785    pub fn snapshot(&self) -> Workspace {
18786        let query = self.selection.select("snapshot");
18787        Workspace {
18788            proc: self.proc.clone(),
18789            selection: query,
18790            graphql_client: self.graphql_client.clone(),
18791        }
18792    }
18793    /// Select workspace-root-relative config and lockfile paths. Empty paths clear the selection.
18794    ///
18795    /// # Arguments
18796    ///
18797    /// * `config_file` - Config file path.
18798    /// * `lock_file` - Lockfile path.
18799    pub fn with_config_paths(
18800        &self,
18801        config_file: impl Into<String>,
18802        lock_file: impl Into<String>,
18803    ) -> Workspace {
18804        let mut query = self.selection.select("withConfigPaths");
18805        query = query.arg("configFile", config_file.into());
18806        query = query.arg("lockFile", lock_file.into());
18807        Workspace {
18808            proc: self.proc.clone(),
18809            selection: query,
18810            graphql_client: self.graphql_client.clone(),
18811        }
18812    }
18813    /// Select the config environment carried by this workspace.
18814    ///
18815    /// # Arguments
18816    ///
18817    /// * `name` - Environment name, or empty to clear the selection.
18818    pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
18819        let mut query = self.selection.select("withConfigEnvironment");
18820        query = query.arg("name", name.into());
18821        Workspace {
18822            proc: self.proc.clone(),
18823            selection: query,
18824            graphql_client: self.graphql_client.clone(),
18825        }
18826    }
18827    /// Return this workspace with the calling client's user-level config re-read and applied.
18828    /// 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.
18829    /// 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.
18830    pub fn with_user_config(&self) -> Workspace {
18831        let query = self.selection.select("withUserConfig");
18832        Workspace {
18833            proc: self.proc.clone(),
18834            selection: query,
18835            graphql_client: self.graphql_client.clone(),
18836        }
18837    }
18838    /// Selected native workspace config file relative to the workspace cwd, if any.
18839    pub async fn config_file(&self) -> Result<String, DaggerError> {
18840        let query = self.selection.select("configFile");
18841        query.execute(self.graphql_client.clone()).await
18842    }
18843    /// Returns a Directory from the workspace.
18844    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18845    ///
18846    /// # Arguments
18847    ///
18848    /// * `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.
18849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18850    pub fn directory(&self, path: impl Into<String>) -> Directory {
18851        let mut query = self.selection.select("directory");
18852        query = query.arg("path", path.into());
18853        Directory {
18854            proc: self.proc.clone(),
18855            selection: query,
18856            graphql_client: self.graphql_client.clone(),
18857        }
18858    }
18859    /// Returns a Directory from the workspace.
18860    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18861    ///
18862    /// # Arguments
18863    ///
18864    /// * `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.
18865    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18866    pub fn directory_opts<'a>(
18867        &self,
18868        path: impl Into<String>,
18869        opts: WorkspaceDirectoryOpts<'a>,
18870    ) -> Directory {
18871        let mut query = self.selection.select("directory");
18872        query = query.arg("path", path.into());
18873        if let Some(exclude) = opts.exclude {
18874            query = query.arg("exclude", exclude);
18875        }
18876        if let Some(include) = opts.include {
18877            query = query.arg("include", include);
18878        }
18879        if let Some(gitignore) = opts.gitignore {
18880            query = query.arg("gitignore", gitignore);
18881        }
18882        Directory {
18883            proc: self.proc.clone(),
18884            selection: query,
18885            graphql_client: self.graphql_client.clone(),
18886        }
18887    }
18888    /// Returns a File from the workspace.
18889    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
18890    ///
18891    /// # Arguments
18892    ///
18893    /// * `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.
18894    pub fn file(&self, path: impl Into<String>) -> File {
18895        let mut query = self.selection.select("file");
18896        query = query.arg("path", path.into());
18897        File {
18898            proc: self.proc.clone(),
18899            selection: query,
18900            graphql_client: self.graphql_client.clone(),
18901        }
18902    }
18903    /// Returns a list of files and directories that match the given pattern.
18904    /// Patterns match paths relative to the workspace root.
18905    ///
18906    /// # Arguments
18907    ///
18908    /// * `pattern` - Pattern to match (e.g., "*.md").
18909    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
18910        let mut query = self.selection.select("glob");
18911        query = query.arg("pattern", pattern.into());
18912        query.execute(self.graphql_client.clone()).await
18913    }
18914    /// Searches for content matching the given regular expression or literal string.
18915    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
18916    /// Runs ripgrep on the client host, falling back to grep if unavailable.
18917    ///
18918    /// # Arguments
18919    ///
18920    /// * `pattern` - The text to match.
18921    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18922    pub async fn search(
18923        &self,
18924        pattern: impl Into<String>,
18925    ) -> Result<Vec<SearchResult>, DaggerError> {
18926        let mut query = self.selection.select("search");
18927        query = query.arg("pattern", pattern.into());
18928        let query = query.select("id");
18929        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18930        Ok(ids
18931            .into_iter()
18932            .map(|id| SearchResult {
18933                proc: self.proc.clone(),
18934                selection: crate::querybuilder::query()
18935                    .select("node")
18936                    .arg("id", &id.0)
18937                    .inline_fragment("SearchResult"),
18938                graphql_client: self.graphql_client.clone(),
18939            })
18940            .collect())
18941    }
18942    /// Searches for content matching the given regular expression or literal string.
18943    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
18944    /// Runs ripgrep on the client host, falling back to grep if unavailable.
18945    ///
18946    /// # Arguments
18947    ///
18948    /// * `pattern` - The text to match.
18949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
18950    pub async fn search_opts<'a>(
18951        &self,
18952        pattern: impl Into<String>,
18953        opts: WorkspaceSearchOpts<'a>,
18954    ) -> Result<Vec<SearchResult>, DaggerError> {
18955        let mut query = self.selection.select("search");
18956        query = query.arg("pattern", pattern.into());
18957        if let Some(paths) = opts.paths {
18958            query = query.arg("paths", paths);
18959        }
18960        if let Some(globs) = opts.globs {
18961            query = query.arg("globs", globs);
18962        }
18963        if let Some(literal) = opts.literal {
18964            query = query.arg("literal", literal);
18965        }
18966        if let Some(multiline) = opts.multiline {
18967            query = query.arg("multiline", multiline);
18968        }
18969        if let Some(dotall) = opts.dotall {
18970            query = query.arg("dotall", dotall);
18971        }
18972        if let Some(insensitive) = opts.insensitive {
18973            query = query.arg("insensitive", insensitive);
18974        }
18975        if let Some(skip_ignored) = opts.skip_ignored {
18976            query = query.arg("skipIgnored", skip_ignored);
18977        }
18978        if let Some(skip_hidden) = opts.skip_hidden {
18979            query = query.arg("skipHidden", skip_hidden);
18980        }
18981        if let Some(files_only) = opts.files_only {
18982            query = query.arg("filesOnly", files_only);
18983        }
18984        if let Some(limit) = opts.limit {
18985            query = query.arg("limit", limit);
18986        }
18987        let query = query.select("id");
18988        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18989        Ok(ids
18990            .into_iter()
18991            .map(|id| SearchResult {
18992                proc: self.proc.clone(),
18993                selection: crate::querybuilder::query()
18994                    .select("node")
18995                    .arg("id", &id.0)
18996                    .inline_fragment("SearchResult"),
18997                graphql_client: self.graphql_client.clone(),
18998            })
18999            .collect())
19000    }
19001    /// Search for a file or directory by walking up from the start path within the workspace.
19002    /// Returns the absolute workspace path if found, or null if not found.
19003    /// Relative start paths resolve from the workspace cwd.
19004    /// The search stops at the workspace root and will not traverse above it.
19005    ///
19006    /// # Arguments
19007    ///
19008    /// * `name` - The name of the file or directory to search for.
19009    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19010    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
19011        let mut query = self.selection.select("findUp");
19012        query = query.arg("name", name.into());
19013        query.execute(self.graphql_client.clone()).await
19014    }
19015    /// Search for a file or directory by walking up from the start path within the workspace.
19016    /// Returns the absolute workspace path if found, or null if not found.
19017    /// Relative start paths resolve from the workspace cwd.
19018    /// The search stops at the workspace root and will not traverse above it.
19019    ///
19020    /// # Arguments
19021    ///
19022    /// * `name` - The name of the file or directory to search for.
19023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19024    pub async fn find_up_opts<'a>(
19025        &self,
19026        name: impl Into<String>,
19027        opts: WorkspaceFindUpOpts<'a>,
19028    ) -> Result<String, DaggerError> {
19029        let mut query = self.selection.select("findUp");
19030        query = query.arg("name", name.into());
19031        if let Some(from) = opts.from {
19032            query = query.arg("from", from);
19033        }
19034        query.execute(self.graphql_client.clone()).await
19035    }
19036    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19037    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19038    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19039    ///
19040    /// # Arguments
19041    ///
19042    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19043    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19044    pub async fn find_roots(
19045        &self,
19046        markers: Vec<impl Into<String>>,
19047    ) -> Result<Vec<String>, DaggerError> {
19048        let mut query = self.selection.select("findRoots");
19049        query = query.arg(
19050            "markers",
19051            markers
19052                .into_iter()
19053                .map(|i| i.into())
19054                .collect::<Vec<String>>(),
19055        );
19056        query.execute(self.graphql_client.clone()).await
19057    }
19058    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
19059    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
19060    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
19061    ///
19062    /// # Arguments
19063    ///
19064    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
19065    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19066    pub async fn find_roots_opts<'a>(
19067        &self,
19068        markers: Vec<impl Into<String>>,
19069        opts: WorkspaceFindRootsOpts<'a>,
19070    ) -> Result<Vec<String>, DaggerError> {
19071        let mut query = self.selection.select("findRoots");
19072        query = query.arg(
19073            "markers",
19074            markers
19075                .into_iter()
19076                .map(|i| i.into())
19077                .collect::<Vec<String>>(),
19078        );
19079        if let Some(start) = opts.start {
19080            query = query.arg("start", start);
19081        }
19082        if let Some(exclude) = opts.exclude {
19083            query = query.arg("exclude", exclude);
19084        }
19085        query.execute(self.graphql_client.clone()).await
19086    }
19087    /// Git state for this workspace. Errors if the workspace is not in a git repository.
19088    pub fn git(&self) -> WorkspaceGit {
19089        let query = self.selection.select("git");
19090        WorkspaceGit {
19091            proc: self.proc.clone(),
19092            selection: query,
19093            graphql_client: self.graphql_client.clone(),
19094        }
19095    }
19096    /// Return this workspace with a new or replaced file, without mutating the source.
19097    ///
19098    /// # Arguments
19099    ///
19100    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19101    /// * `contents` - Contents of the new file.
19102    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19103    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
19104        let mut query = self.selection.select("withNewFile");
19105        query = query.arg("path", path.into());
19106        query = query.arg("contents", contents.into());
19107        Workspace {
19108            proc: self.proc.clone(),
19109            selection: query,
19110            graphql_client: self.graphql_client.clone(),
19111        }
19112    }
19113    /// Return this workspace with a new or replaced file, without mutating the source.
19114    ///
19115    /// # Arguments
19116    ///
19117    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
19118    /// * `contents` - Contents of the new file.
19119    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19120    pub fn with_new_file_opts(
19121        &self,
19122        path: impl Into<String>,
19123        contents: impl Into<String>,
19124        opts: WorkspaceWithNewFileOpts,
19125    ) -> Workspace {
19126        let mut query = self.selection.select("withNewFile");
19127        query = query.arg("path", path.into());
19128        query = query.arg("contents", contents.into());
19129        if let Some(permissions) = opts.permissions {
19130            query = query.arg("permissions", permissions);
19131        }
19132        Workspace {
19133            proc: self.proc.clone(),
19134            selection: query,
19135            graphql_client: self.graphql_client.clone(),
19136        }
19137    }
19138    /// Return this workspace with a file added or replaced, without mutating the source.
19139    ///
19140    /// # Arguments
19141    ///
19142    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19143    /// * `source` - File to add.
19144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19145    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19146        let mut query = self.selection.select("withFile");
19147        query = query.arg("path", path.into());
19148        query = query.arg_lazy(
19149            "source",
19150            Box::new(move || {
19151                let source = source.clone();
19152                Box::pin(async move { source.into_id().await.unwrap().quote() })
19153            }),
19154        );
19155        Workspace {
19156            proc: self.proc.clone(),
19157            selection: query,
19158            graphql_client: self.graphql_client.clone(),
19159        }
19160    }
19161    /// Return this workspace with a file added or replaced, without mutating the source.
19162    ///
19163    /// # Arguments
19164    ///
19165    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
19166    /// * `source` - File to add.
19167    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19168    pub fn with_file_opts(
19169        &self,
19170        path: impl Into<String>,
19171        source: impl IntoID<Id>,
19172        opts: WorkspaceWithFileOpts,
19173    ) -> Workspace {
19174        let mut query = self.selection.select("withFile");
19175        query = query.arg("path", path.into());
19176        query = query.arg_lazy(
19177            "source",
19178            Box::new(move || {
19179                let source = source.clone();
19180                Box::pin(async move { source.into_id().await.unwrap().quote() })
19181            }),
19182        );
19183        if let Some(permissions) = opts.permissions {
19184            query = query.arg("permissions", permissions);
19185        }
19186        Workspace {
19187            proc: self.proc.clone(),
19188            selection: query,
19189            graphql_client: self.graphql_client.clone(),
19190        }
19191    }
19192    /// Return this workspace with the given path replaced by a directory, without mutating the source.
19193    /// 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.
19194    ///
19195    /// # Arguments
19196    ///
19197    /// * `path` - Path to replace. Relative paths resolve from the workspace cwd.
19198    /// * `source` - Directory to write there.
19199    pub fn with_new_directory(
19200        &self,
19201        path: impl Into<String>,
19202        source: impl IntoID<Id>,
19203    ) -> Workspace {
19204        let mut query = self.selection.select("withNewDirectory");
19205        query = query.arg("path", path.into());
19206        query = query.arg_lazy(
19207            "source",
19208            Box::new(move || {
19209                let source = source.clone();
19210                Box::pin(async move { source.into_id().await.unwrap().quote() })
19211            }),
19212        );
19213        Workspace {
19214            proc: self.proc.clone(),
19215            selection: query,
19216            graphql_client: self.graphql_client.clone(),
19217        }
19218    }
19219    /// Return this workspace with a directory merged into the given path, without mutating the source.
19220    /// Anything already at the path stays, and files the source carries win, as with Directory.withDirectory. Use withNewDirectory to replace the path instead.
19221    ///
19222    /// # Arguments
19223    ///
19224    /// * `path` - Path to merge into. Relative paths resolve from the workspace cwd.
19225    /// * `source` - Directory to merge there.
19226    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19227        let mut query = self.selection.select("withDirectory");
19228        query = query.arg("path", path.into());
19229        query = query.arg_lazy(
19230            "source",
19231            Box::new(move || {
19232                let source = source.clone();
19233                Box::pin(async move { source.into_id().await.unwrap().quote() })
19234            }),
19235        );
19236        Workspace {
19237            proc: self.proc.clone(),
19238            selection: query,
19239            graphql_client: self.graphql_client.clone(),
19240        }
19241    }
19242    /// Return this workspace with a file removed, without mutating the source.
19243    ///
19244    /// # Arguments
19245    ///
19246    /// * `path` - Path of the file to remove. Relative paths resolve from the workspace cwd.
19247    pub fn without_file(&self, path: impl Into<String>) -> Workspace {
19248        let mut query = self.selection.select("withoutFile");
19249        query = query.arg("path", path.into());
19250        Workspace {
19251            proc: self.proc.clone(),
19252            selection: query,
19253            graphql_client: self.graphql_client.clone(),
19254        }
19255    }
19256    /// Return this workspace with files removed, without mutating the source.
19257    ///
19258    /// # Arguments
19259    ///
19260    /// * `paths` - Paths of the files to remove. Relative paths resolve from the workspace cwd.
19261    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Workspace {
19262        let mut query = self.selection.select("withoutFiles");
19263        query = query.arg(
19264            "paths",
19265            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
19266        );
19267        Workspace {
19268            proc: self.proc.clone(),
19269            selection: query,
19270            graphql_client: self.graphql_client.clone(),
19271        }
19272    }
19273    /// Return this workspace with a directory removed, without mutating the source.
19274    ///
19275    /// # Arguments
19276    ///
19277    /// * `path` - Path of the directory to remove. Relative paths resolve from the workspace cwd.
19278    pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
19279        let mut query = self.selection.select("withoutDirectory");
19280        query = query.arg("path", path.into());
19281        Workspace {
19282            proc: self.proc.clone(),
19283            selection: query,
19284            graphql_client: self.graphql_client.clone(),
19285        }
19286    }
19287    /// Return this workspace with a changeset applied, without mutating the source.
19288    ///
19289    /// # Arguments
19290    ///
19291    /// * `changes` - Changes to apply.
19292    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
19293        let mut query = self.selection.select("withChanges");
19294        query = query.arg_lazy(
19295            "changes",
19296            Box::new(move || {
19297                let changes = changes.clone();
19298                Box::pin(async move { changes.into_id().await.unwrap().quote() })
19299            }),
19300        );
19301        Workspace {
19302            proc: self.proc.clone(),
19303            selection: query,
19304            graphql_client: self.graphql_client.clone(),
19305        }
19306    }
19307    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19308    /// 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.
19309    ///
19310    /// # Arguments
19311    ///
19312    /// * `patch` - File containing the patch to apply
19313    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19314    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Workspace {
19315        let mut query = self.selection.select("withPatchFile");
19316        query = query.arg_lazy(
19317            "patch",
19318            Box::new(move || {
19319                let patch = patch.clone();
19320                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19321            }),
19322        );
19323        Workspace {
19324            proc: self.proc.clone(),
19325            selection: query,
19326            graphql_client: self.graphql_client.clone(),
19327        }
19328    }
19329    /// Return this workspace with the given Git-compatible patch file applied, without mutating the source.
19330    /// 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.
19331    ///
19332    /// # Arguments
19333    ///
19334    /// * `patch` - File containing the patch to apply
19335    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19336    pub fn with_patch_file_opts(
19337        &self,
19338        patch: impl IntoID<Id>,
19339        opts: WorkspaceWithPatchFileOpts,
19340    ) -> Workspace {
19341        let mut query = self.selection.select("withPatchFile");
19342        query = query.arg_lazy(
19343            "patch",
19344            Box::new(move || {
19345                let patch = patch.clone();
19346                Box::pin(async move { patch.into_id().await.unwrap().quote() })
19347            }),
19348        );
19349        if let Some(on_conflict) = opts.on_conflict {
19350            query = query.arg("onConflict", on_conflict);
19351        }
19352        Workspace {
19353            proc: self.proc.clone(),
19354            selection: query,
19355            graphql_client: self.graphql_client.clone(),
19356        }
19357    }
19358    /// Return this workspace with its working directory pointed at the given workspace-relative path.
19359    ///
19360    /// # Arguments
19361    ///
19362    /// * `path` - Workspace-relative path to use as the working directory.
19363    pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
19364        let mut query = self.selection.select("withWorkdir");
19365        query = query.arg("path", path.into());
19366        Workspace {
19367            proc: self.proc.clone(),
19368            selection: query,
19369            graphql_client: self.graphql_client.clone(),
19370        }
19371    }
19372    /// Return this workspace with a directory mounted read-only at the given path, without mutating the source.
19373    /// 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.
19374    ///
19375    /// # Arguments
19376    ///
19377    /// * `path` - Location of the mounted directory. Relative paths resolve from the workspace cwd.
19378    /// * `source` - Directory to mount.
19379    pub fn with_mounted_directory(
19380        &self,
19381        path: impl Into<String>,
19382        source: impl IntoID<Id>,
19383    ) -> Workspace {
19384        let mut query = self.selection.select("withMountedDirectory");
19385        query = query.arg("path", path.into());
19386        query = query.arg_lazy(
19387            "source",
19388            Box::new(move || {
19389                let source = source.clone();
19390                Box::pin(async move { source.into_id().await.unwrap().quote() })
19391            }),
19392        );
19393        Workspace {
19394            proc: self.proc.clone(),
19395            selection: query,
19396            graphql_client: self.graphql_client.clone(),
19397        }
19398    }
19399    /// Return this workspace with a file mounted read-only at the given path, without mutating the source.
19400    /// 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.
19401    ///
19402    /// # Arguments
19403    ///
19404    /// * `path` - Location of the mounted file. Relative paths resolve from the workspace cwd.
19405    /// * `source` - File to mount.
19406    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19407        let mut query = self.selection.select("withMountedFile");
19408        query = query.arg("path", path.into());
19409        query = query.arg_lazy(
19410            "source",
19411            Box::new(move || {
19412                let source = source.clone();
19413                Box::pin(async move { source.into_id().await.unwrap().quote() })
19414            }),
19415        );
19416        Workspace {
19417            proc: self.proc.clone(),
19418            selection: query,
19419            graphql_client: self.graphql_client.clone(),
19420        }
19421    }
19422    /// Return this workspace with the content mounted at the given path unmounted.
19423    /// Removes directory and file mounts at or below the path, revealing the underlying workspace content. Other mounts and pending changes are preserved.
19424    ///
19425    /// # Arguments
19426    ///
19427    /// * `path` - Location of the mount to remove. Relative paths resolve from the workspace cwd. Use / to remove all mounts.
19428    pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
19429        let mut query = self.selection.select("withoutMount");
19430        query = query.arg("path", path.into());
19431        Workspace {
19432            proc: self.proc.clone(),
19433            selection: query,
19434            graphql_client: self.graphql_client.clone(),
19435        }
19436    }
19437    /// Return this workspace with a module installed in its config.
19438    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19439    ///
19440    /// # Arguments
19441    ///
19442    /// * `r#ref` - Module reference to install.
19443    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19444    pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
19445        let mut query = self.selection.select("withModule");
19446        query = query.arg("ref", r#ref.into());
19447        Workspace {
19448            proc: self.proc.clone(),
19449            selection: query,
19450            graphql_client: self.graphql_client.clone(),
19451        }
19452    }
19453    /// Return this workspace with a module installed in its config.
19454    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
19455    ///
19456    /// # Arguments
19457    ///
19458    /// * `r#ref` - Module reference to install.
19459    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19460    pub fn with_module_opts<'a>(
19461        &self,
19462        r#ref: impl Into<String>,
19463        opts: WorkspaceWithModuleOpts<'a>,
19464    ) -> Workspace {
19465        let mut query = self.selection.select("withModule");
19466        query = query.arg("ref", r#ref.into());
19467        if let Some(name) = opts.name {
19468            query = query.arg("name", name);
19469        }
19470        if let Some(here) = opts.here {
19471            query = query.arg("here", here);
19472        }
19473        Workspace {
19474            proc: self.proc.clone(),
19475            selection: query,
19476            graphql_client: self.graphql_client.clone(),
19477        }
19478    }
19479    /// Return this workspace with a module removed from its config.
19480    /// When the session selects an env, only that env's overlay entry is removed.
19481    ///
19482    /// # Arguments
19483    ///
19484    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19485    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19486    pub fn without_module(&self, name: impl Into<String>) -> Workspace {
19487        let mut query = self.selection.select("withoutModule");
19488        query = query.arg("name", name.into());
19489        Workspace {
19490            proc: self.proc.clone(),
19491            selection: query,
19492            graphql_client: self.graphql_client.clone(),
19493        }
19494    }
19495    /// Return this workspace with a module removed from its config.
19496    /// When the session selects an env, only that env's overlay entry is removed.
19497    ///
19498    /// # Arguments
19499    ///
19500    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
19501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19502    pub fn without_module_opts(
19503        &self,
19504        name: impl Into<String>,
19505        opts: WorkspaceWithoutModuleOpts,
19506    ) -> Workspace {
19507        let mut query = self.selection.select("withoutModule");
19508        query = query.arg("name", name.into());
19509        if let Some(here) = opts.here {
19510            query = query.arg("here", here);
19511        }
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(&self, r#ref: impl Into<String>) -> Workspace {
19525        let mut query = self.selection.select("withSDK");
19526        query = query.arg("ref", r#ref.into());
19527        Workspace {
19528            proc: self.proc.clone(),
19529            selection: query,
19530            graphql_client: self.graphql_client.clone(),
19531        }
19532    }
19533    /// Return this workspace with an SDK installed in its config.
19534    ///
19535    /// # Arguments
19536    ///
19537    /// * `r#ref` - SDK module reference to install.
19538    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19539    pub fn with_sdk_opts<'a>(
19540        &self,
19541        r#ref: impl Into<String>,
19542        opts: WorkspaceWithSdkOpts<'a>,
19543    ) -> Workspace {
19544        let mut query = self.selection.select("withSDK");
19545        query = query.arg("ref", r#ref.into());
19546        if let Some(name) = opts.name {
19547            query = query.arg("name", name);
19548        }
19549        if let Some(here) = opts.here {
19550            query = query.arg("here", here);
19551        }
19552        if let Some(as_sdk_name) = opts.as_sdk_name {
19553            query = query.arg("asSdkName", as_sdk_name);
19554        }
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(&self, name: impl Into<String>) -> Workspace {
19568        let mut query = self.selection.select("withoutSDK");
19569        query = query.arg("name", name.into());
19570        Workspace {
19571            proc: self.proc.clone(),
19572            selection: query,
19573            graphql_client: self.graphql_client.clone(),
19574        }
19575    }
19576    /// Return this workspace with an SDK removed from its config.
19577    ///
19578    /// # Arguments
19579    ///
19580    /// * `name` - Name of the installed SDK entry to remove.
19581    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19582    pub fn without_sdk_opts(
19583        &self,
19584        name: impl Into<String>,
19585        opts: WorkspaceWithoutSdkOpts,
19586    ) -> Workspace {
19587        let mut query = self.selection.select("withoutSDK");
19588        query = query.arg("name", name.into());
19589        if let Some(here) = opts.here {
19590            query = query.arg("here", here);
19591        }
19592        Workspace {
19593            proc: self.proc.clone(),
19594            selection: query,
19595            graphql_client: self.graphql_client.clone(),
19596        }
19597    }
19598    /// Return this workspace with an installed module selected as its entrypoint.
19599    /// Every other entrypoint selection is cleared. Entrypoints live in the base workspace config.
19600    ///
19601    /// # Arguments
19602    ///
19603    /// * `name` - Exact installed module name.
19604    pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
19605        let mut query = self.selection.select("withEntrypoint");
19606        query = query.arg("name", name.into());
19607        Workspace {
19608            proc: self.proc.clone(),
19609            selection: query,
19610            graphql_client: self.graphql_client.clone(),
19611        }
19612    }
19613    /// Return this workspace with no module selected as its entrypoint.
19614    pub fn without_entrypoint(&self) -> Workspace {
19615        let query = self.selection.select("withoutEntrypoint");
19616        Workspace {
19617            proc: self.proc.clone(),
19618            selection: query,
19619            graphql_client: self.graphql_client.clone(),
19620        }
19621    }
19622    /// Return this workspace with a location initialized as a module scope.
19623    /// The selected SDK module records the scope and generates the module source.
19624    ///
19625    /// # Arguments
19626    ///
19627    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
19628    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19629    pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
19630        let mut query = self.selection.select("withInitModule");
19631        query = query.arg("sdk", sdk.into());
19632        Workspace {
19633            proc: self.proc.clone(),
19634            selection: query,
19635            graphql_client: self.graphql_client.clone(),
19636        }
19637    }
19638    /// Return this workspace with a location initialized as a module scope.
19639    /// The selected SDK module records the scope and generates the module source.
19640    ///
19641    /// # Arguments
19642    ///
19643    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
19644    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19645    pub fn with_init_module_opts<'a>(
19646        &self,
19647        sdk: impl Into<String>,
19648        opts: WorkspaceWithInitModuleOpts<'a>,
19649    ) -> Workspace {
19650        let mut query = self.selection.select("withInitModule");
19651        query = query.arg("sdk", sdk.into());
19652        if let Some(name) = opts.name {
19653            query = query.arg("name", name);
19654        }
19655        if let Some(path) = opts.path {
19656            query = query.arg("path", path);
19657        }
19658        if let Some(install) = opts.install {
19659            query = query.arg("install", install);
19660        }
19661        if let Some(entrypoint) = opts.entrypoint {
19662            query = query.arg("entrypoint", entrypoint);
19663        }
19664        if let Some(settings) = opts.settings {
19665            query = query.arg("settings", settings);
19666        }
19667        Workspace {
19668            proc: self.proc.clone(),
19669            selection: query,
19670            graphql_client: self.graphql_client.clone(),
19671        }
19672    }
19673    /// Return the selected SDK module's current scope at this workspace location.
19674    ///
19675    /// # Arguments
19676    ///
19677    /// * `sdk` - SDK name to probe. Required.
19678    pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
19679        let mut query = self.selection.select("detectScope");
19680        query = query.arg("sdk", sdk.into());
19681        query.execute(self.graphql_client.clone()).await
19682    }
19683    /// Return this workspace with a generated module client added to one SDK scope.
19684    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
19685    ///
19686    /// # Arguments
19687    ///
19688    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
19689    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19690    pub fn with_client(&self, module: impl Into<String>) -> Workspace {
19691        let mut query = self.selection.select("withClient");
19692        query = query.arg("module", module.into());
19693        Workspace {
19694            proc: self.proc.clone(),
19695            selection: query,
19696            graphql_client: self.graphql_client.clone(),
19697        }
19698    }
19699    /// Return this workspace with a generated module client added to one SDK scope.
19700    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
19701    ///
19702    /// # Arguments
19703    ///
19704    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
19705    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19706    pub fn with_client_opts<'a>(
19707        &self,
19708        module: impl Into<String>,
19709        opts: WorkspaceWithClientOpts<'a>,
19710    ) -> Workspace {
19711        let mut query = self.selection.select("withClient");
19712        query = query.arg("module", module.into());
19713        if let Some(sdk) = opts.sdk {
19714            query = query.arg("sdk", sdk);
19715        }
19716        if let Some(settings) = opts.settings {
19717            query = query.arg("settings", settings);
19718        }
19719        Workspace {
19720            proc: self.proc.clone(),
19721            selection: query,
19722            graphql_client: self.graphql_client.clone(),
19723        }
19724    }
19725    /// Return this workspace with a module client removed from the deepest matching recorded scope.
19726    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
19727    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
19728    ///
19729    /// # Arguments
19730    ///
19731    /// * `module` - The recorded target to remove.
19732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19733    pub fn without_client(&self, module: impl Into<String>) -> Workspace {
19734        let mut query = self.selection.select("withoutClient");
19735        query = query.arg("module", module.into());
19736        Workspace {
19737            proc: self.proc.clone(),
19738            selection: query,
19739            graphql_client: self.graphql_client.clone(),
19740        }
19741    }
19742    /// Return this workspace with a module client removed from the deepest matching recorded scope.
19743    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
19744    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
19745    ///
19746    /// # Arguments
19747    ///
19748    /// * `module` - The recorded target to remove.
19749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19750    pub fn without_client_opts<'a>(
19751        &self,
19752        module: impl Into<String>,
19753        opts: WorkspaceWithoutClientOpts<'a>,
19754    ) -> Workspace {
19755        let mut query = self.selection.select("withoutClient");
19756        query = query.arg("module", module.into());
19757        if let Some(sdk) = opts.sdk {
19758            query = query.arg("sdk", sdk);
19759        }
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(&self) -> Workspace {
19774        let query = self.selection.select("withUpdatedClients");
19775        Workspace {
19776            proc: self.proc.clone(),
19777            selection: query,
19778            graphql_client: self.graphql_client.clone(),
19779        }
19780    }
19781    /// Return this workspace with the selected module clients updated.
19782    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
19783    /// The selected SDK module then regenerates every scope that owns one of the targets.
19784    ///
19785    /// # Arguments
19786    ///
19787    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19788    pub fn with_updated_clients_opts<'a>(
19789        &self,
19790        opts: WorkspaceWithUpdatedClientsOpts<'a>,
19791    ) -> Workspace {
19792        let mut query = self.selection.select("withUpdatedClients");
19793        if let Some(modules) = opts.modules {
19794            query = query.arg("modules", modules);
19795        }
19796        if let Some(all) = opts.all {
19797            query = query.arg("all", all);
19798        }
19799        if let Some(sdk) = opts.sdk {
19800            query = query.arg("sdk", sdk);
19801        }
19802        Workspace {
19803            proc: self.proc.clone(),
19804            selection: query,
19805            graphql_client: self.graphql_client.clone(),
19806        }
19807    }
19808    /// Return this workspace with a configuration value written.
19809    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
19810    ///
19811    /// # Arguments
19812    ///
19813    /// * `key` - Dotted key path.
19814    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
19815    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19816    pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
19817        let mut query = self.selection.select("withConfigValue");
19818        query = query.arg("key", key.into());
19819        query = query.arg("value", value.into());
19820        Workspace {
19821            proc: self.proc.clone(),
19822            selection: query,
19823            graphql_client: self.graphql_client.clone(),
19824        }
19825    }
19826    /// Return this workspace with a configuration value written.
19827    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
19828    ///
19829    /// # Arguments
19830    ///
19831    /// * `key` - Dotted key path.
19832    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
19833    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19834    pub fn with_config_value_opts<'a>(
19835        &self,
19836        key: impl Into<String>,
19837        value: impl Into<String>,
19838        opts: WorkspaceWithConfigValueOpts<'a>,
19839    ) -> Workspace {
19840        let mut query = self.selection.select("withConfigValue");
19841        query = query.arg("key", key.into());
19842        query = query.arg("value", value.into());
19843        if let Some(values) = opts.values {
19844            query = query.arg("values", values);
19845        }
19846        if let Some(here) = opts.here {
19847            query = query.arg("here", here);
19848        }
19849        Workspace {
19850            proc: self.proc.clone(),
19851            selection: query,
19852            graphql_client: self.graphql_client.clone(),
19853        }
19854    }
19855    /// Return this workspace with a configuration value removed.
19856    /// Errors when the key is not currently set.
19857    /// When the session selects an env, the key is scoped to that env's overlay.
19858    ///
19859    /// # Arguments
19860    ///
19861    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
19862    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19863    pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
19864        let mut query = self.selection.select("withoutConfigValue");
19865        query = query.arg("key", key.into());
19866        Workspace {
19867            proc: self.proc.clone(),
19868            selection: query,
19869            graphql_client: self.graphql_client.clone(),
19870        }
19871    }
19872    /// Return this workspace with a configuration value removed.
19873    /// Errors when the key is not currently set.
19874    /// When the session selects an env, the key is scoped to that env's overlay.
19875    ///
19876    /// # Arguments
19877    ///
19878    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
19879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19880    pub fn without_config_value_opts(
19881        &self,
19882        key: impl Into<String>,
19883        opts: WorkspaceWithoutConfigValueOpts,
19884    ) -> Workspace {
19885        let mut query = self.selection.select("withoutConfigValue");
19886        query = query.arg("key", key.into());
19887        if let Some(here) = opts.here {
19888            query = query.arg("here", here);
19889        }
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(&self, name: impl Into<String>) -> Workspace {
19903        let mut query = self.selection.select("withConfigEnv");
19904        query = query.arg("name", name.into());
19905        Workspace {
19906            proc: self.proc.clone(),
19907            selection: query,
19908            graphql_client: self.graphql_client.clone(),
19909        }
19910    }
19911    /// Return this workspace with a named config environment created.
19912    ///
19913    /// # Arguments
19914    ///
19915    /// * `name` - Environment name.
19916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19917    pub fn with_config_env_opts(
19918        &self,
19919        name: impl Into<String>,
19920        opts: WorkspaceWithConfigEnvOpts,
19921    ) -> Workspace {
19922        let mut query = self.selection.select("withConfigEnv");
19923        query = query.arg("name", name.into());
19924        if let Some(here) = opts.here {
19925            query = query.arg("here", here);
19926        }
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(&self, name: impl Into<String>) -> Workspace {
19940        let mut query = self.selection.select("withoutConfigEnv");
19941        query = query.arg("name", name.into());
19942        Workspace {
19943            proc: self.proc.clone(),
19944            selection: query,
19945            graphql_client: self.graphql_client.clone(),
19946        }
19947    }
19948    /// Return this workspace with a named config environment removed.
19949    ///
19950    /// # Arguments
19951    ///
19952    /// * `name` - Environment name.
19953    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19954    pub fn without_config_env_opts(
19955        &self,
19956        name: impl Into<String>,
19957        opts: WorkspaceWithoutConfigEnvOpts,
19958    ) -> Workspace {
19959        let mut query = self.selection.select("withoutConfigEnv");
19960        query = query.arg("name", name.into());
19961        if let Some(here) = opts.here {
19962            query = query.arg("here", here);
19963        }
19964        Workspace {
19965            proc: self.proc.clone(),
19966            selection: query,
19967            graphql_client: self.graphql_client.clone(),
19968        }
19969    }
19970    /// Return this workspace with refreshed lockfile state.
19971    /// SDK client scopes are regenerated unless noGenerate is true.
19972    ///
19973    /// # Arguments
19974    ///
19975    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19976    pub fn with_updated_lock(&self) -> Workspace {
19977        let query = self.selection.select("withUpdatedLock");
19978        Workspace {
19979            proc: self.proc.clone(),
19980            selection: query,
19981            graphql_client: self.graphql_client.clone(),
19982        }
19983    }
19984    /// Return this workspace with refreshed lockfile state.
19985    /// SDK client scopes are regenerated unless noGenerate is true.
19986    ///
19987    /// # Arguments
19988    ///
19989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
19990    pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
19991        let mut query = self.selection.select("withUpdatedLock");
19992        if let Some(no_generate) = opts.no_generate {
19993            query = query.arg("noGenerate", no_generate);
19994        }
19995        Workspace {
19996            proc: self.proc.clone(),
19997            selection: query,
19998            graphql_client: self.graphql_client.clone(),
19999        }
20000    }
20001    /// Return this workspace with updated module sources, versions and lockfile state.
20002    /// An SDK client scope is regenerated when it targets an updated module.
20003    ///
20004    /// # Arguments
20005    ///
20006    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20007    pub fn with_updated_modules(&self) -> Workspace {
20008        let query = self.selection.select("withUpdatedModules");
20009        Workspace {
20010            proc: self.proc.clone(),
20011            selection: query,
20012            graphql_client: self.graphql_client.clone(),
20013        }
20014    }
20015    /// Return this workspace with updated module sources, versions and lockfile state.
20016    /// An SDK client scope is regenerated when it targets an updated module.
20017    ///
20018    /// # Arguments
20019    ///
20020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20021    pub fn with_updated_modules_opts<'a>(
20022        &self,
20023        opts: WorkspaceWithUpdatedModulesOpts<'a>,
20024    ) -> Workspace {
20025        let mut query = self.selection.select("withUpdatedModules");
20026        if let Some(names) = opts.names {
20027            query = query.arg("names", names);
20028        }
20029        if let Some(version) = opts.version {
20030            query = query.arg("version", version);
20031        }
20032        if let Some(source) = opts.source {
20033            query = query.arg("source", source);
20034        }
20035        Workspace {
20036            proc: self.proc.clone(),
20037            selection: query,
20038            graphql_client: self.graphql_client.clone(),
20039        }
20040    }
20041    /// Installed SDKs.
20042    pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
20043        let query = self.selection.select("sdks");
20044        let query = query.select("id");
20045        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20046        Ok(ids
20047            .into_iter()
20048            .map(|id| WorkspaceSdk {
20049                proc: self.proc.clone(),
20050                selection: crate::querybuilder::query()
20051                    .select("node")
20052                    .arg("id", &id.0)
20053                    .inline_fragment("WorkspaceSDK"),
20054                graphql_client: self.graphql_client.clone(),
20055            })
20056            .collect())
20057    }
20058    /// An installed SDK, by name.
20059    ///
20060    /// # Arguments
20061    ///
20062    /// * `name` - SDK name to look up.
20063    pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
20064        let mut query = self.selection.select("sdk");
20065        query = query.arg("name", name.into());
20066        WorkspaceSdk {
20067            proc: self.proc.clone(),
20068            selection: query,
20069            graphql_client: self.graphql_client.clone(),
20070        }
20071    }
20072    /// Return this workspace's changes, with paths relative to its working directory.
20073    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20074    ///
20075    /// # Arguments
20076    ///
20077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20078    pub fn changes(&self) -> Changeset {
20079        let query = self.selection.select("changes");
20080        Changeset {
20081            proc: self.proc.clone(),
20082            selection: query,
20083            graphql_client: self.graphql_client.clone(),
20084        }
20085    }
20086    /// Return this workspace's changes, with paths relative to its working directory.
20087    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
20088    ///
20089    /// # Arguments
20090    ///
20091    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20092    pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
20093        let mut query = self.selection.select("changes");
20094        if let Some(from) = opts.from {
20095            query = query.arg("from", from);
20096        }
20097        Changeset {
20098            proc: self.proc.clone(),
20099            selection: query,
20100            graphql_client: self.graphql_client.clone(),
20101        }
20102    }
20103    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20104    /// 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.
20105    /// 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.
20106    /// 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.
20107    ///
20108    /// # Arguments
20109    ///
20110    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20111    pub async fn export(&self) -> Result<Void, DaggerError> {
20112        let query = self.selection.select("export");
20113        query.execute(self.graphql_client.clone()).await
20114    }
20115    /// Write this workspace's commits and pending changes to a checkout on the calling client.
20116    /// 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.
20117    /// 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.
20118    /// 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.
20119    ///
20120    /// # Arguments
20121    ///
20122    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20123    pub async fn export_opts<'a>(
20124        &self,
20125        opts: WorkspaceExportOpts<'a>,
20126    ) -> Result<Void, DaggerError> {
20127        let mut query = self.selection.select("export");
20128        if let Some(path) = opts.path {
20129            query = query.arg("path", path);
20130        }
20131        if let Some(from) = opts.from {
20132            query = query.arg("from", from);
20133        }
20134        query.execute(self.graphql_client.clone()).await
20135    }
20136    /// Read a configuration value from dagger.toml.
20137    /// If key is empty, returns the full config.
20138    /// If key points to a scalar, returns the value.
20139    /// If key points to a table, returns flattened dotted-key output.
20140    ///
20141    /// # Arguments
20142    ///
20143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20144    pub async fn config_read(&self) -> Result<String, DaggerError> {
20145        let query = self.selection.select("configRead");
20146        query.execute(self.graphql_client.clone()).await
20147    }
20148    /// Read a configuration value from dagger.toml.
20149    /// If key is empty, returns the full config.
20150    /// If key points to a scalar, returns the value.
20151    /// If key points to a table, returns flattened dotted-key output.
20152    ///
20153    /// # Arguments
20154    ///
20155    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20156    pub async fn config_read_opts<'a>(
20157        &self,
20158        opts: WorkspaceConfigReadOpts<'a>,
20159    ) -> Result<String, DaggerError> {
20160        let mut query = self.selection.select("configRead");
20161        if let Some(key) = opts.key {
20162            query = query.arg("key", key);
20163        }
20164        if let Some(effective) = opts.effective {
20165            query = query.arg("effective", effective);
20166        }
20167        query.execute(self.graphql_client.clone()).await
20168    }
20169    /// Installed name of the module selected as the workspace entrypoint, or an empty string when none is selected.
20170    /// Reflects the selected env's effective view. Fails if several modules are selected.
20171    pub async fn entrypoint(&self) -> Result<String, DaggerError> {
20172        let query = self.selection.select("entrypoint");
20173        query.execute(self.graphql_client.clone()).await
20174    }
20175    /// List named environments defined in the workspace configuration.
20176    pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
20177        let query = self.selection.select("envList");
20178        query.execute(self.graphql_client.clone()).await
20179    }
20180    /// List modules defined in the workspace configuration.
20181    /// Reflects the selected env's effective view.
20182    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20183        let query = self.selection.select("modules");
20184        let query = query.select("id");
20185        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20186        Ok(ids
20187            .into_iter()
20188            .map(|id| WorkspaceModule {
20189                proc: self.proc.clone(),
20190                selection: crate::querybuilder::query()
20191                    .select("node")
20192                    .arg("id", &id.0)
20193                    .inline_fragment("WorkspaceModule"),
20194                graphql_client: self.graphql_client.clone(),
20195            })
20196            .collect())
20197    }
20198    /// Return a module defined in the workspace configuration.
20199    /// Reflects the selected env's effective view.
20200    ///
20201    /// # Arguments
20202    ///
20203    /// * `name` - Module name to inspect.
20204    pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
20205        let mut query = self.selection.select("module");
20206        query = query.arg("name", name.into());
20207        WorkspaceModule {
20208            proc: self.proc.clone(),
20209            selection: query,
20210            graphql_client: self.graphql_client.clone(),
20211        }
20212    }
20213    /// Load a module source from a path within the workspace.
20214    /// Relative paths (e.g., "foo") resolve from the workspace cwd; absolute paths (e.g., "/foo") resolve from the workspace root.
20215    /// Fails if the path does not point to an initialized module.
20216    ///
20217    /// # Arguments
20218    ///
20219    /// * `path` - Location of the module source to load, relative to the workspace cwd or absolute from the workspace root.
20220    pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
20221        let mut query = self.selection.select("moduleSource");
20222        query = query.arg("path", path.into());
20223        ModuleSource {
20224            proc: self.proc.clone(),
20225            selection: query,
20226            graphql_client: self.graphql_client.clone(),
20227        }
20228    }
20229    /// Current location within the workspace root.
20230    /// The workspace root is returned as "/".
20231    /// Relative paths in workspace APIs resolve from here.
20232    pub async fn cwd(&self) -> Result<String, DaggerError> {
20233        let query = self.selection.select("cwd");
20234        query.execute(self.graphql_client.clone()).await
20235    }
20236    /// Discover static object artifacts from workspace modules without evaluating their values.
20237    ///
20238    /// # Arguments
20239    ///
20240    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20241    pub fn artifacts(&self) -> Artifacts {
20242        let query = self.selection.select("artifacts");
20243        Artifacts {
20244            proc: self.proc.clone(),
20245            selection: query,
20246            graphql_client: self.graphql_client.clone(),
20247        }
20248    }
20249    /// Discover static object artifacts from workspace modules without evaluating their values.
20250    ///
20251    /// # Arguments
20252    ///
20253    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20254    pub fn artifacts_opts<'a>(&self, opts: WorkspaceArtifactsOpts<'a>) -> Artifacts {
20255        let mut query = self.selection.select("artifacts");
20256        if let Some(include) = opts.include {
20257            query = query.arg("include", include);
20258        }
20259        Artifacts {
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(&self) -> WorkspaceMigration {
20273        let query = self.selection.select("migrate");
20274        WorkspaceMigration {
20275            proc: self.proc.clone(),
20276            selection: query,
20277            graphql_client: self.graphql_client.clone(),
20278        }
20279    }
20280    /// Plan the explicit migration needed for the current workspace.
20281    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
20282    /// The returned plan has an empty changeset and no steps when no migration is needed.
20283    ///
20284    /// # Arguments
20285    ///
20286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
20287    pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
20288        let mut query = self.selection.select("migrate");
20289        if let Some(modules) = opts.modules {
20290            query = query.arg("modules", modules);
20291        }
20292        WorkspaceMigration {
20293            proc: self.proc.clone(),
20294            selection: query,
20295            graphql_client: self.graphql_client.clone(),
20296        }
20297    }
20298    /// Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
20299    pub async fn address(&self) -> Result<String, DaggerError> {
20300        let query = self.selection.select("address");
20301        query.execute(self.graphql_client.clone()).await
20302    }
20303}
20304impl Node for Workspace {
20305    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20306        let query = self.selection.select("id");
20307        let graphql_client = self.graphql_client.clone();
20308        async move { query.execute(graphql_client).await }
20309    }
20310}
20311#[derive(Clone)]
20312pub struct WorkspaceCommitPick {
20313    pub proc: Option<Arc<DaggerSessionProc>>,
20314    pub selection: Selection,
20315    pub graphql_client: DynGraphQLClient,
20316}
20317impl IntoID<Id> for WorkspaceCommitPick {
20318    fn into_id(
20319        self,
20320    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20321        Box::pin(async move { self.id().await })
20322    }
20323}
20324impl Loadable for WorkspaceCommitPick {
20325    fn graphql_type() -> &'static str {
20326        "WorkspaceCommitPick"
20327    }
20328    fn from_query(
20329        proc: Option<Arc<DaggerSessionProc>>,
20330        selection: Selection,
20331        graphql_client: DynGraphQLClient,
20332    ) -> Self {
20333        Self {
20334            proc,
20335            selection,
20336            graphql_client,
20337        }
20338    }
20339}
20340impl WorkspaceCommitPick {
20341    /// A unique identifier for this WorkspaceCommitPick.
20342    pub async fn id(&self) -> Result<Id, DaggerError> {
20343        let query = self.selection.select("id");
20344        query.execute(self.graphql_client.clone()).await
20345    }
20346    /// The commit in the source workspace.
20347    pub fn commit(&self) -> GitCommit {
20348        let query = self.selection.select("commit");
20349        GitCommit {
20350            proc: self.proc.clone(),
20351            selection: query,
20352            graphql_client: self.graphql_client.clone(),
20353        }
20354    }
20355    /// Whether this commit can be applied.
20356    pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
20357        let query = self.selection.select("status");
20358        query.execute(self.graphql_client.clone()).await
20359    }
20360    /// Why the commit conflicts, or NONE.
20361    pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
20362        let query = self.selection.select("reason");
20363        query.execute(self.graphql_client.clone()).await
20364    }
20365    /// Workspace-root-relative conflicting paths. Empty unless the status is CONFLICT.
20366    pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
20367        let query = self.selection.select("conflictPaths");
20368        query.execute(self.graphql_client.clone()).await
20369    }
20370}
20371impl Node for WorkspaceCommitPick {
20372    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20373        let query = self.selection.select("id");
20374        let graphql_client = self.graphql_client.clone();
20375        async move { query.execute(graphql_client).await }
20376    }
20377}
20378#[derive(Clone)]
20379pub struct WorkspaceGit {
20380    pub proc: Option<Arc<DaggerSessionProc>>,
20381    pub selection: Selection,
20382    pub graphql_client: DynGraphQLClient,
20383}
20384impl IntoID<Id> for WorkspaceGit {
20385    fn into_id(
20386        self,
20387    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20388        Box::pin(async move { self.id().await })
20389    }
20390}
20391impl Loadable for WorkspaceGit {
20392    fn graphql_type() -> &'static str {
20393        "WorkspaceGit"
20394    }
20395    fn from_query(
20396        proc: Option<Arc<DaggerSessionProc>>,
20397        selection: Selection,
20398        graphql_client: DynGraphQLClient,
20399    ) -> Self {
20400        Self {
20401            proc,
20402            selection,
20403            graphql_client,
20404        }
20405    }
20406}
20407impl WorkspaceGit {
20408    /// A unique identifier for this WorkspaceGit.
20409    pub async fn id(&self) -> Result<Id, DaggerError> {
20410        let query = self.selection.select("id");
20411        query.execute(self.graphql_client.clone()).await
20412    }
20413    /// The checked-out HEAD of this workspace.
20414    pub fn head(&self) -> GitRef {
20415        let query = self.selection.select("head");
20416        GitRef {
20417            proc: self.proc.clone(),
20418            selection: query,
20419            graphql_client: self.graphql_client.clone(),
20420        }
20421    }
20422    /// Return a self-contained Git metadata directory for this workspace's HEAD, including its full reachable history and an index matching HEAD.
20423    /// 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.
20424    /// 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.
20425    pub fn directory(&self) -> Directory {
20426        let query = self.selection.select("directory");
20427        Directory {
20428            proc: self.proc.clone(),
20429            selection: query,
20430            graphql_client: self.graphql_client.clone(),
20431        }
20432    }
20433    /// Uncommitted changes in this workspace, using the same rules as GitRepository.uncommitted.
20434    pub fn uncommitted(&self) -> Changeset {
20435        let query = self.selection.select("uncommitted");
20436        Changeset {
20437            proc: self.proc.clone(),
20438            selection: query,
20439            graphql_client: self.graphql_client.clone(),
20440        }
20441    }
20442}
20443impl Node for WorkspaceGit {
20444    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20445        let query = self.selection.select("id");
20446        let graphql_client = self.graphql_client.clone();
20447        async move { query.execute(graphql_client).await }
20448    }
20449}
20450#[derive(Clone)]
20451pub struct WorkspaceMigration {
20452    pub proc: Option<Arc<DaggerSessionProc>>,
20453    pub selection: Selection,
20454    pub graphql_client: DynGraphQLClient,
20455}
20456impl IntoID<Id> for WorkspaceMigration {
20457    fn into_id(
20458        self,
20459    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20460        Box::pin(async move { self.id().await })
20461    }
20462}
20463impl Loadable for WorkspaceMigration {
20464    fn graphql_type() -> &'static str {
20465        "WorkspaceMigration"
20466    }
20467    fn from_query(
20468        proc: Option<Arc<DaggerSessionProc>>,
20469        selection: Selection,
20470        graphql_client: DynGraphQLClient,
20471    ) -> Self {
20472        Self {
20473            proc,
20474            selection,
20475            graphql_client,
20476        }
20477    }
20478}
20479impl WorkspaceMigration {
20480    /// A unique identifier for this WorkspaceMigration.
20481    pub async fn id(&self) -> Result<Id, DaggerError> {
20482        let query = self.selection.select("id");
20483        query.execute(self.graphql_client.clone()).await
20484    }
20485    /// Filesystem changes for the full migration plan.
20486    pub fn changes(&self) -> Changeset {
20487        let query = self.selection.select("changes");
20488        Changeset {
20489            proc: self.proc.clone(),
20490            selection: query,
20491            graphql_client: self.graphql_client.clone(),
20492        }
20493    }
20494    /// Logical migration steps, each identified by a stable code.
20495    pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
20496        let query = self.selection.select("steps");
20497        let query = query.select("id");
20498        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20499        Ok(ids
20500            .into_iter()
20501            .map(|id| WorkspaceMigrationStep {
20502                proc: self.proc.clone(),
20503                selection: crate::querybuilder::query()
20504                    .select("node")
20505                    .arg("id", &id.0)
20506                    .inline_fragment("WorkspaceMigrationStep"),
20507                graphql_client: self.graphql_client.clone(),
20508            })
20509            .collect())
20510    }
20511    /// Unselected legacy module directories relative to the workspace root. Candidates can include fixtures.
20512    pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
20513        let query = self.selection.select("moduleCandidates");
20514        query.execute(self.graphql_client.clone()).await
20515    }
20516    /// Native workspace config path after migration, relative to the workspace root. Empty if no workspace config exists.
20517    pub async fn config_file(&self) -> Result<String, DaggerError> {
20518        let query = self.selection.select("configFile");
20519        query.execute(self.graphql_client.clone()).await
20520    }
20521}
20522impl Node for WorkspaceMigration {
20523    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20524        let query = self.selection.select("id");
20525        let graphql_client = self.graphql_client.clone();
20526        async move { query.execute(graphql_client).await }
20527    }
20528}
20529#[derive(Clone)]
20530pub struct WorkspaceMigrationStep {
20531    pub proc: Option<Arc<DaggerSessionProc>>,
20532    pub selection: Selection,
20533    pub graphql_client: DynGraphQLClient,
20534}
20535impl IntoID<Id> for WorkspaceMigrationStep {
20536    fn into_id(
20537        self,
20538    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20539        Box::pin(async move { self.id().await })
20540    }
20541}
20542impl Loadable for WorkspaceMigrationStep {
20543    fn graphql_type() -> &'static str {
20544        "WorkspaceMigrationStep"
20545    }
20546    fn from_query(
20547        proc: Option<Arc<DaggerSessionProc>>,
20548        selection: Selection,
20549        graphql_client: DynGraphQLClient,
20550    ) -> Self {
20551        Self {
20552            proc,
20553            selection,
20554            graphql_client,
20555        }
20556    }
20557}
20558impl WorkspaceMigrationStep {
20559    /// A unique identifier for this WorkspaceMigrationStep.
20560    pub async fn id(&self) -> Result<Id, DaggerError> {
20561        let query = self.selection.select("id");
20562        query.execute(self.graphql_client.clone()).await
20563    }
20564    /// Stable code identifying this logical migration step.
20565    pub async fn code(&self) -> Result<String, DaggerError> {
20566        let query = self.selection.select("code");
20567        query.execute(self.graphql_client.clone()).await
20568    }
20569    /// Generic summary of this step's purpose and impact.
20570    pub async fn description(&self) -> Result<String, DaggerError> {
20571        let query = self.selection.select("description");
20572        query.execute(self.graphql_client.clone()).await
20573    }
20574    /// Non-fatal warnings raised while planning this step.
20575    pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
20576        let query = self.selection.select("warnings");
20577        query.execute(self.graphql_client.clone()).await
20578    }
20579    /// Filesystem changes for this step.
20580    pub fn changes(&self) -> Changeset {
20581        let query = self.selection.select("changes");
20582        Changeset {
20583            proc: self.proc.clone(),
20584            selection: query,
20585            graphql_client: self.graphql_client.clone(),
20586        }
20587    }
20588}
20589impl Node for WorkspaceMigrationStep {
20590    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20591        let query = self.selection.select("id");
20592        let graphql_client = self.graphql_client.clone();
20593        async move { query.execute(graphql_client).await }
20594    }
20595}
20596#[derive(Clone)]
20597pub struct WorkspaceModule {
20598    pub proc: Option<Arc<DaggerSessionProc>>,
20599    pub selection: Selection,
20600    pub graphql_client: DynGraphQLClient,
20601}
20602impl IntoID<Id> for WorkspaceModule {
20603    fn into_id(
20604        self,
20605    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20606        Box::pin(async move { self.id().await })
20607    }
20608}
20609impl Loadable for WorkspaceModule {
20610    fn graphql_type() -> &'static str {
20611        "WorkspaceModule"
20612    }
20613    fn from_query(
20614        proc: Option<Arc<DaggerSessionProc>>,
20615        selection: Selection,
20616        graphql_client: DynGraphQLClient,
20617    ) -> Self {
20618        Self {
20619            proc,
20620            selection,
20621            graphql_client,
20622        }
20623    }
20624}
20625impl WorkspaceModule {
20626    /// A unique identifier for this WorkspaceModule.
20627    pub async fn id(&self) -> Result<Id, DaggerError> {
20628        let query = self.selection.select("id");
20629        query.execute(self.graphql_client.clone()).await
20630    }
20631    /// List constructor-backed settings for this module.
20632    pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
20633        let query = self.selection.select("settings");
20634        let query = query.select("id");
20635        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20636        Ok(ids
20637            .into_iter()
20638            .map(|id| WorkspaceModuleSetting {
20639                proc: self.proc.clone(),
20640                selection: crate::querybuilder::query()
20641                    .select("node")
20642                    .arg("id", &id.0)
20643                    .inline_fragment("WorkspaceModuleSetting"),
20644                graphql_client: self.graphql_client.clone(),
20645            })
20646            .collect())
20647    }
20648    /// List the functions of this module's main object, in GraphQL field form.
20649    pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
20650        let query = self.selection.select("functions");
20651        query.execute(self.graphql_client.clone()).await
20652    }
20653    /// The module name.
20654    pub async fn name(&self) -> Result<String, DaggerError> {
20655        let query = self.selection.select("name");
20656        query.execute(self.graphql_client.clone()).await
20657    }
20658    /// Whether the module is the workspace entrypoint (functions aliased to Query root).
20659    pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
20660        let query = self.selection.select("entrypoint");
20661        query.execute(self.graphql_client.clone()).await
20662    }
20663    /// The module source path.
20664    pub async fn source(&self) -> Result<String, DaggerError> {
20665        let query = self.selection.select("source");
20666        query.execute(self.graphql_client.clone()).await
20667    }
20668}
20669impl Node for WorkspaceModule {
20670    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20671        let query = self.selection.select("id");
20672        let graphql_client = self.graphql_client.clone();
20673        async move { query.execute(graphql_client).await }
20674    }
20675}
20676#[derive(Clone)]
20677pub struct WorkspaceModuleSetting {
20678    pub proc: Option<Arc<DaggerSessionProc>>,
20679    pub selection: Selection,
20680    pub graphql_client: DynGraphQLClient,
20681}
20682impl IntoID<Id> for WorkspaceModuleSetting {
20683    fn into_id(
20684        self,
20685    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20686        Box::pin(async move { self.id().await })
20687    }
20688}
20689impl Loadable for WorkspaceModuleSetting {
20690    fn graphql_type() -> &'static str {
20691        "WorkspaceModuleSetting"
20692    }
20693    fn from_query(
20694        proc: Option<Arc<DaggerSessionProc>>,
20695        selection: Selection,
20696        graphql_client: DynGraphQLClient,
20697    ) -> Self {
20698        Self {
20699            proc,
20700            selection,
20701            graphql_client,
20702        }
20703    }
20704}
20705impl WorkspaceModuleSetting {
20706    /// A unique identifier for this WorkspaceModuleSetting.
20707    pub async fn id(&self) -> Result<Id, DaggerError> {
20708        let query = self.selection.select("id");
20709        query.execute(self.graphql_client.clone()).await
20710    }
20711    /// The setting key.
20712    pub async fn key(&self) -> Result<String, DaggerError> {
20713        let query = self.selection.select("key");
20714        query.execute(self.graphql_client.clone()).await
20715    }
20716    /// The value stored in workspace config after applying the selected workspace environment, or empty when unset.
20717    pub async fn value(&self) -> Result<String, DaggerError> {
20718        let query = self.selection.select("value");
20719        query.execute(self.graphql_client.clone()).await
20720    }
20721    /// The constructor argument description.
20722    pub async fn description(&self) -> Result<String, DaggerError> {
20723        let query = self.selection.select("description");
20724        query.execute(self.graphql_client.clone()).await
20725    }
20726    /// The constructor argument's declared default, formatted like value, or empty when the argument has no default.
20727    pub async fn default_value(&self) -> Result<String, DaggerError> {
20728        let query = self.selection.select("defaultValue");
20729        query.execute(self.graphql_client.clone()).await
20730    }
20731    /// Whether the setting is a string argument, stored as a TOML string even when the value reads as a number or boolean.
20732    pub async fn is_string(&self) -> Result<bool, DaggerError> {
20733        let query = self.selection.select("isString");
20734        query.execute(self.graphql_client.clone()).await
20735    }
20736    /// Whether the setting accepts a list of values.
20737    pub async fn is_list(&self) -> Result<bool, DaggerError> {
20738        let query = self.selection.select("isList");
20739        query.execute(self.graphql_client.clone()).await
20740    }
20741    /// Whether the setting is an object type resolved from an address string (Container, Directory, File, Secret, Service, ...), which may be a module reference.
20742    pub async fn is_object(&self) -> Result<bool, DaggerError> {
20743        let query = self.selection.select("isObject");
20744        query.execute(self.graphql_client.clone()).await
20745    }
20746}
20747impl Node for WorkspaceModuleSetting {
20748    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20749        let query = self.selection.select("id");
20750        let graphql_client = self.graphql_client.clone();
20751        async move { query.execute(graphql_client).await }
20752    }
20753}
20754#[derive(Clone)]
20755pub struct WorkspaceSdk {
20756    pub proc: Option<Arc<DaggerSessionProc>>,
20757    pub selection: Selection,
20758    pub graphql_client: DynGraphQLClient,
20759}
20760impl IntoID<Id> for WorkspaceSdk {
20761    fn into_id(
20762        self,
20763    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20764        Box::pin(async move { self.id().await })
20765    }
20766}
20767impl Loadable for WorkspaceSdk {
20768    fn graphql_type() -> &'static str {
20769        "WorkspaceSDK"
20770    }
20771    fn from_query(
20772        proc: Option<Arc<DaggerSessionProc>>,
20773        selection: Selection,
20774        graphql_client: DynGraphQLClient,
20775    ) -> Self {
20776        Self {
20777            proc,
20778            selection,
20779            graphql_client,
20780        }
20781    }
20782}
20783impl WorkspaceSdk {
20784    /// A unique identifier for this WorkspaceSDK.
20785    pub async fn id(&self) -> Result<Id, DaggerError> {
20786        let query = self.selection.select("id");
20787        query.execute(self.graphql_client.clone()).await
20788    }
20789    /// Generate the modules and clients managed by this SDK.
20790    pub fn generate(&self) -> Changeset {
20791        let query = self.selection.select("generate");
20792        Changeset {
20793            proc: self.proc.clone(),
20794            selection: query,
20795            graphql_client: self.graphql_client.clone(),
20796        }
20797    }
20798    /// The user-facing SDK name.
20799    pub async fn name(&self) -> Result<String, DaggerError> {
20800        let query = self.selection.select("name");
20801        query.execute(self.graphql_client.clone()).await
20802    }
20803    /// The module reference this SDK was installed from.
20804    pub async fn r#ref(&self) -> Result<String, DaggerError> {
20805        let query = self.selection.select("ref");
20806        query.execute(self.graphql_client.clone()).await
20807    }
20808    /// Modules authored with this SDK.
20809    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20810        let query = self.selection.select("modules");
20811        let query = query.select("id");
20812        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20813        Ok(ids
20814            .into_iter()
20815            .map(|id| WorkspaceModule {
20816                proc: self.proc.clone(),
20817                selection: crate::querybuilder::query()
20818                    .select("node")
20819                    .arg("id", &id.0)
20820                    .inline_fragment("WorkspaceModule"),
20821                graphql_client: self.graphql_client.clone(),
20822            })
20823            .collect())
20824    }
20825    /// Clients generated with this SDK.
20826    pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20827        let query = self.selection.select("clients");
20828        let query = query.select("id");
20829        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20830        Ok(ids
20831            .into_iter()
20832            .map(|id| WorkspaceModule {
20833                proc: self.proc.clone(),
20834                selection: crate::querybuilder::query()
20835                    .select("node")
20836                    .arg("id", &id.0)
20837                    .inline_fragment("WorkspaceModule"),
20838                graphql_client: self.graphql_client.clone(),
20839            })
20840            .collect())
20841    }
20842}
20843impl Node for WorkspaceSdk {
20844    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20845        let query = self.selection.select("id");
20846        let graphql_client = self.graphql_client.clone();
20847        async move { query.execute(graphql_client).await }
20848    }
20849}
20850#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20851pub enum AgentMessageDelivery {
20852    #[serde(rename = "QUEUED")]
20853    Queued,
20854    #[serde(rename = "STARTED")]
20855    Started,
20856    #[serde(rename = "STEERED")]
20857    Steered,
20858}
20859#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20860pub enum AgentState {
20861    #[serde(rename = "FAILED")]
20862    Failed,
20863    #[serde(rename = "IDLE")]
20864    Idle,
20865    #[serde(rename = "PAUSED")]
20866    Paused,
20867    #[serde(rename = "RUNNING")]
20868    Running,
20869    #[serde(rename = "STOPPED")]
20870    Stopped,
20871    #[serde(rename = "WAITING_INPUT")]
20872    WaitingInput,
20873}
20874#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20875pub enum ArtifactDimensionKind {
20876    #[serde(rename = "COLLECTION")]
20877    Collection,
20878    #[serde(rename = "MODULE")]
20879    Module,
20880    #[serde(rename = "TYPE")]
20881    Type,
20882}
20883#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20884pub enum CacheSharingMode {
20885    #[serde(rename = "LOCKED")]
20886    Locked,
20887    #[serde(rename = "PRIVATE")]
20888    Private,
20889    #[serde(rename = "SHARED")]
20890    Shared,
20891}
20892#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20893pub enum ChangesetMergeConflict {
20894    #[serde(rename = "FAIL")]
20895    Fail,
20896    #[serde(rename = "FAIL_EARLY")]
20897    FailEarly,
20898    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
20899    LeaveConflictMarkers,
20900    #[serde(rename = "PREFER_OURS")]
20901    PreferOurs,
20902    #[serde(rename = "PREFER_THEIRS")]
20903    PreferTheirs,
20904}
20905#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20906pub enum ChangesetsMergeConflict {
20907    #[serde(rename = "FAIL")]
20908    Fail,
20909    #[serde(rename = "FAIL_EARLY")]
20910    FailEarly,
20911}
20912#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20913pub enum DiffStatKind {
20914    #[serde(rename = "ADDED")]
20915    Added,
20916    #[serde(rename = "MODIFIED")]
20917    Modified,
20918    #[serde(rename = "REMOVED")]
20919    Removed,
20920    #[serde(rename = "RENAMED")]
20921    Renamed,
20922}
20923#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20924pub enum ExistsType {
20925    #[serde(rename = "DIRECTORY_TYPE")]
20926    DirectoryType,
20927    #[serde(rename = "REGULAR_TYPE")]
20928    RegularType,
20929    #[serde(rename = "SYMLINK_TYPE")]
20930    SymlinkType,
20931}
20932#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20933pub enum FileType {
20934    #[serde(rename = "DIRECTORY")]
20935    Directory,
20936    #[serde(rename = "DIRECTORY_TYPE")]
20937    DirectoryType,
20938    #[serde(rename = "REGULAR")]
20939    Regular,
20940    #[serde(rename = "REGULAR_TYPE")]
20941    RegularType,
20942    #[serde(rename = "SYMLINK")]
20943    Symlink,
20944    #[serde(rename = "SYMLINK_TYPE")]
20945    SymlinkType,
20946    #[serde(rename = "UNKNOWN")]
20947    Unknown,
20948}
20949#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20950pub enum FunctionCachePolicy {
20951    #[serde(rename = "Default")]
20952    Default,
20953    #[serde(rename = "Never")]
20954    Never,
20955    #[serde(rename = "PerSession")]
20956    PerSession,
20957}
20958#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20959pub enum GitPushDisposition {
20960    #[serde(rename = "CREATED")]
20961    Created,
20962    #[serde(rename = "FAST_FORWARD")]
20963    FastForward,
20964    #[serde(rename = "FORCED")]
20965    Forced,
20966    #[serde(rename = "UP_TO_DATE")]
20967    UpToDate,
20968}
20969#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20970pub enum ImageLayerCompression {
20971    #[serde(rename = "EStarGZ")]
20972    EStarGz,
20973    #[serde(rename = "ESTARGZ")]
20974    Estargz,
20975    #[serde(rename = "Gzip")]
20976    Gzip,
20977    #[serde(rename = "Uncompressed")]
20978    Uncompressed,
20979    #[serde(rename = "Zstd")]
20980    Zstd,
20981}
20982#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20983pub enum ImageMediaTypes {
20984    #[serde(rename = "DOCKER")]
20985    Docker,
20986    #[serde(rename = "DockerMediaTypes")]
20987    DockerMediaTypes,
20988    #[serde(rename = "OCI")]
20989    Oci,
20990    #[serde(rename = "OCIMediaTypes")]
20991    OciMediaTypes,
20992}
20993#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20994pub enum LlmContentBlockKind {
20995    #[serde(rename = "AUDIO")]
20996    Audio,
20997    #[serde(rename = "DOCUMENT")]
20998    Document,
20999    #[serde(rename = "IMAGE")]
21000    Image,
21001    #[serde(rename = "TEXT")]
21002    Text,
21003    #[serde(rename = "THINKING")]
21004    Thinking,
21005    #[serde(rename = "TOOL_CALL")]
21006    ToolCall,
21007    #[serde(rename = "TOOL_RESULT")]
21008    ToolResult,
21009}
21010#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21011pub enum LlmMessageOriginKind {
21012    #[serde(rename = "AGENT")]
21013    Agent,
21014    #[serde(rename = "EVENT")]
21015    Event,
21016    #[serde(rename = "USER")]
21017    User,
21018}
21019#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21020pub enum LlmMessageRole {
21021    #[serde(rename = "ASSISTANT")]
21022    Assistant,
21023    #[serde(rename = "SYSTEM")]
21024    System,
21025    #[serde(rename = "USER")]
21026    User,
21027}
21028#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21029pub enum ModuleSourceExperimentalFeature {
21030    #[serde(rename = "SELF_CALLS")]
21031    SelfCalls,
21032}
21033#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21034pub enum ModuleSourceKind {
21035    #[serde(rename = "DIR")]
21036    Dir,
21037    #[serde(rename = "DIR_SOURCE")]
21038    DirSource,
21039    #[serde(rename = "GIT")]
21040    Git,
21041    #[serde(rename = "GIT_SOURCE")]
21042    GitSource,
21043    #[serde(rename = "LOCAL")]
21044    Local,
21045    #[serde(rename = "LOCAL_SOURCE")]
21046    LocalSource,
21047}
21048#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21049pub enum NetworkProtocol {
21050    #[serde(rename = "TCP")]
21051    Tcp,
21052    #[serde(rename = "UDP")]
21053    Udp,
21054}
21055#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21056pub enum PatchConflict {
21057    #[serde(rename = "FAIL")]
21058    Fail,
21059    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21060    LeaveConflictMarkers,
21061}
21062#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21063pub enum RegistryProtocol {
21064    #[serde(rename = "HTTP")]
21065    Http,
21066    #[serde(rename = "HTTPS")]
21067    Https,
21068}
21069#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21070pub enum ReturnType {
21071    #[serde(rename = "ANY")]
21072    Any,
21073    #[serde(rename = "FAILURE")]
21074    Failure,
21075    #[serde(rename = "SUCCESS")]
21076    Success,
21077}
21078#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21079pub enum TypeDefKind {
21080    #[serde(rename = "BOOLEAN")]
21081    Boolean,
21082    #[serde(rename = "BOOLEAN_KIND")]
21083    BooleanKind,
21084    #[serde(rename = "ENUM")]
21085    Enum,
21086    #[serde(rename = "ENUM_KIND")]
21087    EnumKind,
21088    #[serde(rename = "FLOAT")]
21089    Float,
21090    #[serde(rename = "FLOAT_KIND")]
21091    FloatKind,
21092    #[serde(rename = "INPUT")]
21093    Input,
21094    #[serde(rename = "INPUT_KIND")]
21095    InputKind,
21096    #[serde(rename = "INTEGER")]
21097    Integer,
21098    #[serde(rename = "INTEGER_KIND")]
21099    IntegerKind,
21100    #[serde(rename = "INTERFACE")]
21101    Interface,
21102    #[serde(rename = "INTERFACE_KIND")]
21103    InterfaceKind,
21104    #[serde(rename = "LIST")]
21105    List,
21106    #[serde(rename = "LIST_KIND")]
21107    ListKind,
21108    #[serde(rename = "OBJECT")]
21109    Object,
21110    #[serde(rename = "OBJECT_KIND")]
21111    ObjectKind,
21112    #[serde(rename = "SCALAR")]
21113    Scalar,
21114    #[serde(rename = "SCALAR_KIND")]
21115    ScalarKind,
21116    #[serde(rename = "STRING")]
21117    String,
21118    #[serde(rename = "STRING_KIND")]
21119    StringKind,
21120    #[serde(rename = "VOID")]
21121    Void,
21122    #[serde(rename = "VOID_KIND")]
21123    VoidKind,
21124}
21125#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21126pub enum WorkspaceCommitPickReason {
21127    #[serde(rename = "CONTENT")]
21128    Content,
21129    #[serde(rename = "DIRTY")]
21130    Dirty,
21131    #[serde(rename = "NONE")]
21132    None,
21133}
21134#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21135pub enum WorkspaceCommitPickStatus {
21136    #[serde(rename = "CONFLICT")]
21137    Conflict,
21138    #[serde(rename = "PICKABLE")]
21139    Pickable,
21140    #[serde(rename = "PICKED")]
21141    Picked,
21142    #[serde(rename = "REDUNDANT")]
21143    Redundant,
21144}