Skip to main content

dagger_sdk/
gen.rs

1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::loadable::Loadable;
8use crate::querybuilder::Selection;
9use derive_builder::Builder;
10use serde::{Deserialize, Serialize};
11use std::sync::Arc;
12
13#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
14pub struct Bytes(pub String);
15impl From<&str> for Bytes {
16    fn from(value: &str) -> Self {
17        Self(value.to_string())
18    }
19}
20impl From<String> for Bytes {
21    fn from(value: String) -> Self {
22        Self(value)
23    }
24}
25impl Bytes {
26    fn quote(&self) -> String {
27        format!("\"{}\"", self.0.clone())
28    }
29}
30#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
31pub struct Id(pub String);
32impl From<&str> for Id {
33    fn from(value: &str) -> Self {
34        Self(value.to_string())
35    }
36}
37impl From<String> for Id {
38    fn from(value: String) -> Self {
39        Self(value)
40    }
41}
42impl IntoID<Id> for Id {
43    fn into_id(
44        self,
45    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
46        Box::pin(async move { Ok::<Id, DaggerError>(self) })
47    }
48}
49impl Id {
50    fn quote(&self) -> String {
51        format!("\"{}\"", self.0.clone())
52    }
53}
54#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
55pub struct Json(pub String);
56impl From<&str> for Json {
57    fn from(value: &str) -> Self {
58        Self(value.to_string())
59    }
60}
61impl From<String> for Json {
62    fn from(value: String) -> Self {
63        Self(value)
64    }
65}
66impl Json {
67    fn quote(&self) -> String {
68        format!("\"{}\"", self.0.clone())
69    }
70}
71#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
72pub struct Platform(pub String);
73impl From<&str> for Platform {
74    fn from(value: &str) -> Self {
75        Self(value.to_string())
76    }
77}
78impl From<String> for Platform {
79    fn from(value: String) -> Self {
80        Self(value)
81    }
82}
83impl Platform {
84    fn quote(&self) -> String {
85        format!("\"{}\"", self.0.clone())
86    }
87}
88#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
89pub struct Void(pub String);
90impl From<&str> for Void {
91    fn from(value: &str) -> Self {
92        Self(value.to_string())
93    }
94}
95impl From<String> for Void {
96    fn from(value: String) -> Self {
97        Self(value)
98    }
99}
100impl Void {
101    fn quote(&self) -> String {
102        format!("\"{}\"", self.0.clone())
103    }
104}
105#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
106pub struct BuildArg {
107    pub name: String,
108    pub value: String,
109}
110#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
111pub struct LlmContentBlockInput {
112    pub arguments: Json,
113    pub call_id: String,
114    pub errored: bool,
115    pub kind: LlmContentBlockKind,
116    pub signature: String,
117    pub text: String,
118    pub tool_name: String,
119}
120#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
121pub struct PipelineLabel {
122    pub name: String,
123    pub value: String,
124}
125#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
126pub struct PortForward {
127    pub backend: isize,
128    pub frontend: isize,
129    pub protocol: NetworkProtocol,
130}
131/// An object that can be exported to the host.
132/// Calling export writes the object to a path on the host filesystem and returns the path that was written.
133pub trait Exportable {
134    fn export(
135        &self,
136        path: impl Into<String>,
137    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
138    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
139}
140#[derive(Clone)]
141pub struct ExportableClient {
142    pub proc: Option<Arc<DaggerSessionProc>>,
143    pub selection: Selection,
144    pub graphql_client: DynGraphQLClient,
145}
146impl IntoID<Id> for ExportableClient {
147    fn into_id(
148        self,
149    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
150        Box::pin(async move { self.id().await })
151    }
152}
153impl ExportableClient {
154    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
155        let mut query = self.selection.select("export");
156        query = query.arg("path", path.into());
157        query.execute(self.graphql_client.clone()).await
158    }
159    pub async fn id(&self) -> Result<Id, DaggerError> {
160        let query = self.selection.select("id");
161        query.execute(self.graphql_client.clone()).await
162    }
163}
164impl Loadable for ExportableClient {
165    fn graphql_type() -> &'static str {
166        "Exportable"
167    }
168    fn from_query(
169        proc: Option<Arc<DaggerSessionProc>>,
170        selection: Selection,
171        graphql_client: DynGraphQLClient,
172    ) -> Self {
173        Self {
174            proc,
175            selection,
176            graphql_client,
177        }
178    }
179}
180impl Exportable for ExportableClient {
181    fn export(
182        &self,
183        path: impl Into<String>,
184    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
185        let mut query = self.selection.select("export");
186        query = query.arg("path", path.into());
187        let graphql_client = self.graphql_client.clone();
188        async move { query.execute(graphql_client).await }
189    }
190    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
191        let query = self.selection.select("id");
192        let graphql_client = self.graphql_client.clone();
193        async move { query.execute(graphql_client).await }
194    }
195}
196/// An object with a globally unique ID.
197pub trait Node {
198    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
199}
200#[derive(Clone)]
201pub struct NodeClient {
202    pub proc: Option<Arc<DaggerSessionProc>>,
203    pub selection: Selection,
204    pub graphql_client: DynGraphQLClient,
205}
206impl IntoID<Id> for NodeClient {
207    fn into_id(
208        self,
209    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
210        Box::pin(async move { self.id().await })
211    }
212}
213impl NodeClient {
214    pub async fn id(&self) -> Result<Id, DaggerError> {
215        let query = self.selection.select("id");
216        query.execute(self.graphql_client.clone()).await
217    }
218}
219impl Loadable for NodeClient {
220    fn graphql_type() -> &'static str {
221        "Node"
222    }
223    fn from_query(
224        proc: Option<Arc<DaggerSessionProc>>,
225        selection: Selection,
226        graphql_client: DynGraphQLClient,
227    ) -> Self {
228        Self {
229            proc,
230            selection,
231            graphql_client,
232        }
233    }
234}
235impl Node for NodeClient {
236    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
237        let query = self.selection.select("id");
238        let graphql_client = self.graphql_client.clone();
239        async move { query.execute(graphql_client).await }
240    }
241}
242/// An object that can be force-evaluated.
243/// Calling sync ensures that the object's entire dependency DAG has been evaluated, returning the object's ID once complete.
244pub trait Syncer {
245    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
246    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
247}
248#[derive(Clone)]
249pub struct SyncerClient {
250    pub proc: Option<Arc<DaggerSessionProc>>,
251    pub selection: Selection,
252    pub graphql_client: DynGraphQLClient,
253}
254impl IntoID<Id> for SyncerClient {
255    fn into_id(
256        self,
257    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
258        Box::pin(async move { self.id().await })
259    }
260}
261impl SyncerClient {
262    pub async fn id(&self) -> Result<Id, DaggerError> {
263        let query = self.selection.select("id");
264        query.execute(self.graphql_client.clone()).await
265    }
266    pub async fn sync(&self) -> Result<Id, DaggerError> {
267        let query = self.selection.select("sync");
268        query.execute(self.graphql_client.clone()).await
269    }
270}
271impl Loadable for SyncerClient {
272    fn graphql_type() -> &'static str {
273        "Syncer"
274    }
275    fn from_query(
276        proc: Option<Arc<DaggerSessionProc>>,
277        selection: Selection,
278        graphql_client: DynGraphQLClient,
279    ) -> Self {
280        Self {
281            proc,
282            selection,
283            graphql_client,
284        }
285    }
286}
287impl Syncer for SyncerClient {
288    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
289        let query = self.selection.select("id");
290        let graphql_client = self.graphql_client.clone();
291        async move { query.execute(graphql_client).await }
292    }
293    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
294        let query = self.selection.select("sync");
295        let graphql_client = self.graphql_client.clone();
296        async move { query.execute(graphql_client).await }
297    }
298}
299#[derive(Clone)]
300pub struct Address {
301    pub proc: Option<Arc<DaggerSessionProc>>,
302    pub selection: Selection,
303    pub graphql_client: DynGraphQLClient,
304}
305#[derive(Builder, Debug, PartialEq)]
306pub struct AddressDirectoryOpts<'a> {
307    #[builder(setter(into, strip_option), default)]
308    pub exclude: Option<Vec<&'a str>>,
309    #[builder(setter(into, strip_option), default)]
310    pub gitignore: Option<bool>,
311    #[builder(setter(into, strip_option), default)]
312    pub include: Option<Vec<&'a str>>,
313    #[builder(setter(into, strip_option), default)]
314    pub no_cache: Option<bool>,
315}
316#[derive(Builder, Debug, PartialEq)]
317pub struct AddressFileOpts<'a> {
318    #[builder(setter(into, strip_option), default)]
319    pub exclude: Option<Vec<&'a str>>,
320    #[builder(setter(into, strip_option), default)]
321    pub gitignore: Option<bool>,
322    #[builder(setter(into, strip_option), default)]
323    pub include: Option<Vec<&'a str>>,
324    #[builder(setter(into, strip_option), default)]
325    pub no_cache: Option<bool>,
326}
327impl IntoID<Id> for Address {
328    fn into_id(
329        self,
330    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
331        Box::pin(async move { self.id().await })
332    }
333}
334impl Loadable for Address {
335    fn graphql_type() -> &'static str {
336        "Address"
337    }
338    fn from_query(
339        proc: Option<Arc<DaggerSessionProc>>,
340        selection: Selection,
341        graphql_client: DynGraphQLClient,
342    ) -> Self {
343        Self {
344            proc,
345            selection,
346            graphql_client,
347        }
348    }
349}
350impl Address {
351    /// Load a container from the address.
352    pub fn container(&self) -> Container {
353        let query = self.selection.select("container");
354        Container {
355            proc: self.proc.clone(),
356            selection: query,
357            graphql_client: self.graphql_client.clone(),
358        }
359    }
360    /// Load a directory from the address.
361    ///
362    /// # Arguments
363    ///
364    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
365    pub fn directory(&self) -> Directory {
366        let query = self.selection.select("directory");
367        Directory {
368            proc: self.proc.clone(),
369            selection: query,
370            graphql_client: self.graphql_client.clone(),
371        }
372    }
373    /// Load a directory from the address.
374    ///
375    /// # Arguments
376    ///
377    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
378    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
379        let mut query = self.selection.select("directory");
380        if let Some(exclude) = opts.exclude {
381            query = query.arg("exclude", exclude);
382        }
383        if let Some(include) = opts.include {
384            query = query.arg("include", include);
385        }
386        if let Some(gitignore) = opts.gitignore {
387            query = query.arg("gitignore", gitignore);
388        }
389        if let Some(no_cache) = opts.no_cache {
390            query = query.arg("noCache", no_cache);
391        }
392        Directory {
393            proc: self.proc.clone(),
394            selection: query,
395            graphql_client: self.graphql_client.clone(),
396        }
397    }
398    /// Load a file from the address.
399    ///
400    /// # Arguments
401    ///
402    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
403    pub fn file(&self) -> File {
404        let query = self.selection.select("file");
405        File {
406            proc: self.proc.clone(),
407            selection: query,
408            graphql_client: self.graphql_client.clone(),
409        }
410    }
411    /// Load a file from the address.
412    ///
413    /// # Arguments
414    ///
415    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
416    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
417        let mut query = self.selection.select("file");
418        if let Some(exclude) = opts.exclude {
419            query = query.arg("exclude", exclude);
420        }
421        if let Some(include) = opts.include {
422            query = query.arg("include", include);
423        }
424        if let Some(gitignore) = opts.gitignore {
425            query = query.arg("gitignore", gitignore);
426        }
427        if let Some(no_cache) = opts.no_cache {
428            query = query.arg("noCache", no_cache);
429        }
430        File {
431            proc: self.proc.clone(),
432            selection: query,
433            graphql_client: self.graphql_client.clone(),
434        }
435    }
436    /// Load a git ref (branch, tag or commit) from the address.
437    pub fn git_ref(&self) -> GitRef {
438        let query = self.selection.select("gitRef");
439        GitRef {
440            proc: self.proc.clone(),
441            selection: query,
442            graphql_client: self.graphql_client.clone(),
443        }
444    }
445    /// Load a git repository from the address.
446    pub fn git_repository(&self) -> GitRepository {
447        let query = self.selection.select("gitRepository");
448        GitRepository {
449            proc: self.proc.clone(),
450            selection: query,
451            graphql_client: self.graphql_client.clone(),
452        }
453    }
454    /// A unique identifier for this Address.
455    pub async fn id(&self) -> Result<Id, DaggerError> {
456        let query = self.selection.select("id");
457        query.execute(self.graphql_client.clone()).await
458    }
459    /// Load a secret from the address.
460    pub fn secret(&self) -> Secret {
461        let query = self.selection.select("secret");
462        Secret {
463            proc: self.proc.clone(),
464            selection: query,
465            graphql_client: self.graphql_client.clone(),
466        }
467    }
468    /// Load a service from the address.
469    pub fn service(&self) -> Service {
470        let query = self.selection.select("service");
471        Service {
472            proc: self.proc.clone(),
473            selection: query,
474            graphql_client: self.graphql_client.clone(),
475        }
476    }
477    /// Load a local socket from the address.
478    pub fn socket(&self) -> Socket {
479        let query = self.selection.select("socket");
480        Socket {
481            proc: self.proc.clone(),
482            selection: query,
483            graphql_client: self.graphql_client.clone(),
484        }
485    }
486    /// The address value
487    pub async fn value(&self) -> Result<String, DaggerError> {
488        let query = self.selection.select("value");
489        query.execute(self.graphql_client.clone()).await
490    }
491    /// Load a volume from the address.
492    pub fn volume(&self) -> Volume {
493        let query = self.selection.select("volume");
494        Volume {
495            proc: self.proc.clone(),
496            selection: query,
497            graphql_client: self.graphql_client.clone(),
498        }
499    }
500    /// Load a workspace from a module reference.
501    pub fn workspace(&self) -> Workspace {
502        let query = self.selection.select("workspace");
503        Workspace {
504            proc: self.proc.clone(),
505            selection: query,
506            graphql_client: self.graphql_client.clone(),
507        }
508    }
509}
510impl Node for Address {
511    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
512        let query = self.selection.select("id");
513        let graphql_client = self.graphql_client.clone();
514        async move { query.execute(graphql_client).await }
515    }
516}
517#[derive(Clone)]
518pub struct Agent {
519    pub proc: Option<Arc<DaggerSessionProc>>,
520    pub selection: Selection,
521    pub graphql_client: DynGraphQLClient,
522}
523impl IntoID<Id> for Agent {
524    fn into_id(
525        self,
526    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
527        Box::pin(async move { self.id().await })
528    }
529}
530impl Loadable for Agent {
531    fn graphql_type() -> &'static str {
532        "Agent"
533    }
534    fn from_query(
535        proc: Option<Arc<DaggerSessionProc>>,
536        selection: Selection,
537        graphql_client: DynGraphQLClient,
538    ) -> Self {
539        Self {
540            proc,
541            selection,
542            graphql_client,
543        }
544    }
545}
546impl Agent {
547    /// The description of the agent
548    pub async fn description(&self) -> Result<String, DaggerError> {
549        let query = self.selection.select("description");
550        query.execute(self.graphql_client.clone()).await
551    }
552    /// A unique identifier for this Agent.
553    pub async fn id(&self) -> Result<Id, DaggerError> {
554        let query = self.selection.select("id");
555        query.execute(self.graphql_client.clone()).await
556    }
557    /// Return the command name of the agent. Entrypoint targets omit the module prefix.
558    pub async fn name(&self) -> Result<String, DaggerError> {
559        let query = self.selection.select("name");
560        query.execute(self.graphql_client.clone()).await
561    }
562    /// The original module in which the agent has been defined
563    pub fn original_module(&self) -> Module {
564        let query = self.selection.select("originalModule");
565        Module {
566            proc: self.proc.clone(),
567            selection: query,
568            graphql_client: self.graphql_client.clone(),
569        }
570    }
571    /// The path of the agent within its module
572    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
573        let query = self.selection.select("path");
574        query.execute(self.graphql_client.clone()).await
575    }
576}
577impl Node for Agent {
578    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
579        let query = self.selection.select("id");
580        let graphql_client = self.graphql_client.clone();
581        async move { query.execute(graphql_client).await }
582    }
583}
584#[derive(Clone)]
585pub struct AgentGroup {
586    pub proc: Option<Arc<DaggerSessionProc>>,
587    pub selection: Selection,
588    pub graphql_client: DynGraphQLClient,
589}
590#[derive(Builder, Debug, PartialEq)]
591pub struct AgentGroupComposeOpts {
592    /// The base LLM to compose onto. Defaults to a fresh workspace-bound LLM.
593    #[builder(setter(into, strip_option), default)]
594    pub base: Option<Id>,
595}
596impl IntoID<Id> for AgentGroup {
597    fn into_id(
598        self,
599    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
600        Box::pin(async move { self.id().await })
601    }
602}
603impl Loadable for AgentGroup {
604    fn graphql_type() -> &'static str {
605        "AgentGroup"
606    }
607    fn from_query(
608        proc: Option<Arc<DaggerSessionProc>>,
609        selection: Selection,
610        graphql_client: DynGraphQLClient,
611    ) -> Self {
612        Self {
613            proc,
614            selection,
615            graphql_client,
616        }
617    }
618}
619impl AgentGroup {
620    /// Compose all selected agent middlewares onto a base LLM, in alphabetical module:fn order, and return the composed LLM.
621    ///
622    /// # Arguments
623    ///
624    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
625    pub fn compose(&self) -> Llm {
626        let query = self.selection.select("compose");
627        Llm {
628            proc: self.proc.clone(),
629            selection: query,
630            graphql_client: self.graphql_client.clone(),
631        }
632    }
633    /// Compose all selected agent middlewares onto a base LLM, in alphabetical module:fn order, and return the composed LLM.
634    ///
635    /// # Arguments
636    ///
637    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
638    pub fn compose_opts(&self, opts: AgentGroupComposeOpts) -> Llm {
639        let mut query = self.selection.select("compose");
640        if let Some(base) = opts.base {
641            query = query.arg("base", base);
642        }
643        Llm {
644            proc: self.proc.clone(),
645            selection: query,
646            graphql_client: self.graphql_client.clone(),
647        }
648    }
649    /// A unique identifier for this AgentGroup.
650    pub async fn id(&self) -> Result<Id, DaggerError> {
651        let query = self.selection.select("id");
652        query.execute(self.graphql_client.clone()).await
653    }
654    /// Return a list of individual agents and their details
655    pub async fn list(&self) -> Result<Vec<Agent>, DaggerError> {
656        let query = self.selection.select("list");
657        let query = query.select("id");
658        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
659        Ok(ids
660            .into_iter()
661            .map(|id| Agent {
662                proc: self.proc.clone(),
663                selection: crate::querybuilder::query()
664                    .select("node")
665                    .arg("id", &id.0)
666                    .inline_fragment("Agent"),
667                graphql_client: self.graphql_client.clone(),
668            })
669            .collect())
670    }
671}
672impl Node for AgentGroup {
673    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
674        let query = self.selection.select("id");
675        let graphql_client = self.graphql_client.clone();
676        async move { query.execute(graphql_client).await }
677    }
678}
679#[derive(Clone)]
680pub struct CacheVolume {
681    pub proc: Option<Arc<DaggerSessionProc>>,
682    pub selection: Selection,
683    pub graphql_client: DynGraphQLClient,
684}
685impl IntoID<Id> for CacheVolume {
686    fn into_id(
687        self,
688    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
689        Box::pin(async move { self.id().await })
690    }
691}
692impl Loadable for CacheVolume {
693    fn graphql_type() -> &'static str {
694        "CacheVolume"
695    }
696    fn from_query(
697        proc: Option<Arc<DaggerSessionProc>>,
698        selection: Selection,
699        graphql_client: DynGraphQLClient,
700    ) -> Self {
701        Self {
702            proc,
703            selection,
704            graphql_client,
705        }
706    }
707}
708impl CacheVolume {
709    /// A unique identifier for this CacheVolume.
710    pub async fn id(&self) -> Result<Id, DaggerError> {
711        let query = self.selection.select("id");
712        query.execute(self.graphql_client.clone()).await
713    }
714}
715impl Node for CacheVolume {
716    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
717        let query = self.selection.select("id");
718        let graphql_client = self.graphql_client.clone();
719        async move { query.execute(graphql_client).await }
720    }
721}
722#[derive(Clone)]
723pub struct Changeset {
724    pub proc: Option<Arc<DaggerSessionProc>>,
725    pub selection: Selection,
726    pub graphql_client: DynGraphQLClient,
727}
728#[derive(Builder, Debug, PartialEq)]
729pub struct ChangesetWithChangesetOpts {
730    /// What to do on a merge conflict
731    #[builder(setter(into, strip_option), default)]
732    pub on_conflict: Option<ChangesetMergeConflict>,
733}
734#[derive(Builder, Debug, PartialEq)]
735pub struct ChangesetWithChangesetsOpts {
736    /// What to do on a merge conflict
737    #[builder(setter(into, strip_option), default)]
738    pub on_conflict: Option<ChangesetsMergeConflict>,
739}
740impl IntoID<Id> for Changeset {
741    fn into_id(
742        self,
743    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
744        Box::pin(async move { self.id().await })
745    }
746}
747impl Loadable for Changeset {
748    fn graphql_type() -> &'static str {
749        "Changeset"
750    }
751    fn from_query(
752        proc: Option<Arc<DaggerSessionProc>>,
753        selection: Selection,
754        graphql_client: DynGraphQLClient,
755    ) -> Self {
756        Self {
757            proc,
758            selection,
759            graphql_client,
760        }
761    }
762}
763impl Changeset {
764    /// Files and directories that were added in the newer directory.
765    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
766        let query = self.selection.select("addedPaths");
767        query.execute(self.graphql_client.clone()).await
768    }
769    /// The newer/upper snapshot.
770    pub fn after(&self) -> Directory {
771        let query = self.selection.select("after");
772        Directory {
773            proc: self.proc.clone(),
774            selection: query,
775            graphql_client: self.graphql_client.clone(),
776        }
777    }
778    /// Return a Git-compatible patch of the changes
779    pub fn as_patch(&self) -> File {
780        let query = self.selection.select("asPatch");
781        File {
782            proc: self.proc.clone(),
783            selection: query,
784            graphql_client: self.graphql_client.clone(),
785        }
786    }
787    /// The older/lower snapshot to compare against.
788    pub fn before(&self) -> Directory {
789        let query = self.selection.select("before");
790        Directory {
791            proc: self.proc.clone(),
792            selection: query,
793            graphql_client: self.graphql_client.clone(),
794        }
795    }
796    /// Structured per-path diff statistics (kind and line counts) for this changeset.
797    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
798        let query = self.selection.select("diffStats");
799        let query = query.select("id");
800        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
801        Ok(ids
802            .into_iter()
803            .map(|id| DiffStat {
804                proc: self.proc.clone(),
805                selection: crate::querybuilder::query()
806                    .select("node")
807                    .arg("id", &id.0)
808                    .inline_fragment("DiffStat"),
809                graphql_client: self.graphql_client.clone(),
810            })
811            .collect())
812    }
813    /// Applies the diff represented by this changeset to a path on the host.
814    ///
815    /// # Arguments
816    ///
817    /// * `path` - Location of the copied directory (e.g., "logs/").
818    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
819        let mut query = self.selection.select("export");
820        query = query.arg("path", path.into());
821        query.execute(self.graphql_client.clone()).await
822    }
823    /// A unique identifier for this Changeset.
824    pub async fn id(&self) -> Result<Id, DaggerError> {
825        let query = self.selection.select("id");
826        query.execute(self.graphql_client.clone()).await
827    }
828    /// Returns true if the changeset is empty (i.e. there are no changes).
829    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
830        let query = self.selection.select("isEmpty");
831        query.execute(self.graphql_client.clone()).await
832    }
833    /// Return a snapshot containing only the created and modified files
834    pub fn layer(&self) -> Directory {
835        let query = self.selection.select("layer");
836        Directory {
837            proc: self.proc.clone(),
838            selection: query,
839            graphql_client: self.graphql_client.clone(),
840        }
841    }
842    /// Files and directories that existed before and were updated in the newer directory.
843    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
844        let query = self.selection.select("modifiedPaths");
845        query.execute(self.graphql_client.clone()).await
846    }
847    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
848    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
849        let query = self.selection.select("removedPaths");
850        query.execute(self.graphql_client.clone()).await
851    }
852    /// Force evaluation in the engine.
853    pub async fn sync(&self) -> Result<Changeset, DaggerError> {
854        let query = self.selection.select("sync");
855        let id: Id = query.execute(self.graphql_client.clone()).await?;
856        Ok(Changeset {
857            proc: self.proc.clone(),
858            selection: query
859                .root()
860                .select("node")
861                .arg("id", &id.0)
862                .inline_fragment("Changeset"),
863            graphql_client: self.graphql_client.clone(),
864        })
865    }
866    /// Add changes to an existing changeset
867    /// 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
868    ///
869    /// # Arguments
870    ///
871    /// * `changes` - Changes to merge into the actual changeset
872    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
873    pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
874        let mut query = self.selection.select("withChangeset");
875        query = query.arg_lazy(
876            "changes",
877            Box::new(move || {
878                let changes = changes.clone();
879                Box::pin(async move { changes.into_id().await.unwrap().quote() })
880            }),
881        );
882        Changeset {
883            proc: self.proc.clone(),
884            selection: query,
885            graphql_client: self.graphql_client.clone(),
886        }
887    }
888    /// Add changes to an existing changeset
889    /// 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
890    ///
891    /// # Arguments
892    ///
893    /// * `changes` - Changes to merge into the actual changeset
894    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
895    pub fn with_changeset_opts(
896        &self,
897        changes: impl IntoID<Id>,
898        opts: ChangesetWithChangesetOpts,
899    ) -> Changeset {
900        let mut query = self.selection.select("withChangeset");
901        query = query.arg_lazy(
902            "changes",
903            Box::new(move || {
904                let changes = changes.clone();
905                Box::pin(async move { changes.into_id().await.unwrap().quote() })
906            }),
907        );
908        if let Some(on_conflict) = opts.on_conflict {
909            query = query.arg("onConflict", on_conflict);
910        }
911        Changeset {
912            proc: self.proc.clone(),
913            selection: query,
914            graphql_client: self.graphql_client.clone(),
915        }
916    }
917    /// Add changes from multiple changesets using git octopus merge strategy
918    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
919    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
920    ///
921    /// # Arguments
922    ///
923    /// * `changes` - List of changesets to merge into the actual changeset
924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
925    pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
926        let mut query = self.selection.select("withChangesets");
927        query = query.arg("changes", changes);
928        Changeset {
929            proc: self.proc.clone(),
930            selection: query,
931            graphql_client: self.graphql_client.clone(),
932        }
933    }
934    /// Add changes from multiple changesets using git octopus merge strategy
935    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
936    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
937    ///
938    /// # Arguments
939    ///
940    /// * `changes` - List of changesets to merge into the actual changeset
941    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
942    pub fn with_changesets_opts(
943        &self,
944        changes: Vec<Id>,
945        opts: ChangesetWithChangesetsOpts,
946    ) -> Changeset {
947        let mut query = self.selection.select("withChangesets");
948        query = query.arg("changes", changes);
949        if let Some(on_conflict) = opts.on_conflict {
950            query = query.arg("onConflict", on_conflict);
951        }
952        Changeset {
953            proc: self.proc.clone(),
954            selection: query,
955            graphql_client: self.graphql_client.clone(),
956        }
957    }
958}
959impl Exportable for Changeset {
960    fn export(
961        &self,
962        path: impl Into<String>,
963    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
964        let mut query = self.selection.select("export");
965        query = query.arg("path", path.into());
966        let graphql_client = self.graphql_client.clone();
967        async move { query.execute(graphql_client).await }
968    }
969    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
970        let query = self.selection.select("id");
971        let graphql_client = self.graphql_client.clone();
972        async move { query.execute(graphql_client).await }
973    }
974}
975impl Node for Changeset {
976    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
977        let query = self.selection.select("id");
978        let graphql_client = self.graphql_client.clone();
979        async move { query.execute(graphql_client).await }
980    }
981}
982impl Syncer for Changeset {
983    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
984        let query = self.selection.select("id");
985        let graphql_client = self.graphql_client.clone();
986        async move { query.execute(graphql_client).await }
987    }
988    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
989        let query = self.selection.select("sync");
990        let graphql_client = self.graphql_client.clone();
991        async move { query.execute(graphql_client).await }
992    }
993}
994#[derive(Clone)]
995pub struct Check {
996    pub proc: Option<Arc<DaggerSessionProc>>,
997    pub selection: Selection,
998    pub graphql_client: DynGraphQLClient,
999}
1000impl IntoID<Id> for Check {
1001    fn into_id(
1002        self,
1003    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1004        Box::pin(async move { self.id().await })
1005    }
1006}
1007impl Loadable for Check {
1008    fn graphql_type() -> &'static str {
1009        "Check"
1010    }
1011    fn from_query(
1012        proc: Option<Arc<DaggerSessionProc>>,
1013        selection: Selection,
1014        graphql_client: DynGraphQLClient,
1015    ) -> Self {
1016        Self {
1017            proc,
1018            selection,
1019            graphql_client,
1020        }
1021    }
1022}
1023impl Check {
1024    /// The type of check: 'check' for annotated checks, 'generate' for generate-as-checks
1025    pub async fn check_type(&self) -> Result<String, DaggerError> {
1026        let query = self.selection.select("checkType");
1027        query.execute(self.graphql_client.clone()).await
1028    }
1029    /// Whether the check completed
1030    pub async fn completed(&self) -> Result<bool, DaggerError> {
1031        let query = self.selection.select("completed");
1032        query.execute(self.graphql_client.clone()).await
1033    }
1034    /// The description of the check
1035    pub async fn description(&self) -> Result<String, DaggerError> {
1036        let query = self.selection.select("description");
1037        query.execute(self.graphql_client.clone()).await
1038    }
1039    /// If the check failed, this is the error
1040    pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1041        let query = self.selection.select("error");
1042        let query = query.select("id");
1043        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1044        Ok(id.map(|id| Error {
1045            proc: self.proc.clone(),
1046            selection: query
1047                .root()
1048                .select("node")
1049                .arg("id", &id.0)
1050                .inline_fragment("Error"),
1051            graphql_client: self.graphql_client.clone(),
1052        }))
1053    }
1054    /// A unique identifier for this Check.
1055    pub async fn id(&self) -> Result<Id, DaggerError> {
1056        let query = self.selection.select("id");
1057        query.execute(self.graphql_client.clone()).await
1058    }
1059    /// Return the command name of the check. Entrypoint targets omit the module prefix.
1060    pub async fn name(&self) -> Result<String, DaggerError> {
1061        let query = self.selection.select("name");
1062        query.execute(self.graphql_client.clone()).await
1063    }
1064    /// The original module in which the check has been defined
1065    pub fn original_module(&self) -> Module {
1066        let query = self.selection.select("originalModule");
1067        Module {
1068            proc: self.proc.clone(),
1069            selection: query,
1070            graphql_client: self.graphql_client.clone(),
1071        }
1072    }
1073    /// Whether the check passed
1074    pub async fn passed(&self) -> Result<bool, DaggerError> {
1075        let query = self.selection.select("passed");
1076        query.execute(self.graphql_client.clone()).await
1077    }
1078    /// The path of the check within its module
1079    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1080        let query = self.selection.select("path");
1081        query.execute(self.graphql_client.clone()).await
1082    }
1083    /// An emoji representing the result of the check
1084    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1085        let query = self.selection.select("resultEmoji");
1086        query.execute(self.graphql_client.clone()).await
1087    }
1088    /// Execute the check
1089    pub fn run(&self) -> Check {
1090        let query = self.selection.select("run");
1091        Check {
1092            proc: self.proc.clone(),
1093            selection: query,
1094            graphql_client: self.graphql_client.clone(),
1095        }
1096    }
1097}
1098impl Node for Check {
1099    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1100        let query = self.selection.select("id");
1101        let graphql_client = self.graphql_client.clone();
1102        async move { query.execute(graphql_client).await }
1103    }
1104}
1105#[derive(Clone)]
1106pub struct CheckGroup {
1107    pub proc: Option<Arc<DaggerSessionProc>>,
1108    pub selection: Selection,
1109    pub graphql_client: DynGraphQLClient,
1110}
1111#[derive(Builder, Debug, PartialEq)]
1112pub struct CheckGroupRunOpts {
1113    /// If true, stop running checks as soon as any check fails.
1114    #[builder(setter(into, strip_option), default)]
1115    pub fail_fast: Option<bool>,
1116}
1117impl IntoID<Id> for CheckGroup {
1118    fn into_id(
1119        self,
1120    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1121        Box::pin(async move { self.id().await })
1122    }
1123}
1124impl Loadable for CheckGroup {
1125    fn graphql_type() -> &'static str {
1126        "CheckGroup"
1127    }
1128    fn from_query(
1129        proc: Option<Arc<DaggerSessionProc>>,
1130        selection: Selection,
1131        graphql_client: DynGraphQLClient,
1132    ) -> Self {
1133        Self {
1134            proc,
1135            selection,
1136            graphql_client,
1137        }
1138    }
1139}
1140impl CheckGroup {
1141    /// A unique identifier for this CheckGroup.
1142    pub async fn id(&self) -> Result<Id, DaggerError> {
1143        let query = self.selection.select("id");
1144        query.execute(self.graphql_client.clone()).await
1145    }
1146    /// Return a list of individual checks and their details
1147    pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1148        let query = self.selection.select("list");
1149        let query = query.select("id");
1150        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1151        Ok(ids
1152            .into_iter()
1153            .map(|id| Check {
1154                proc: self.proc.clone(),
1155                selection: crate::querybuilder::query()
1156                    .select("node")
1157                    .arg("id", &id.0)
1158                    .inline_fragment("Check"),
1159                graphql_client: self.graphql_client.clone(),
1160            })
1161            .collect())
1162    }
1163    /// Generate a markdown report
1164    pub fn report(&self) -> File {
1165        let query = self.selection.select("report");
1166        File {
1167            proc: self.proc.clone(),
1168            selection: query,
1169            graphql_client: self.graphql_client.clone(),
1170        }
1171    }
1172    /// Execute all selected checks
1173    ///
1174    /// # Arguments
1175    ///
1176    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1177    pub fn run(&self) -> CheckGroup {
1178        let query = self.selection.select("run");
1179        CheckGroup {
1180            proc: self.proc.clone(),
1181            selection: query,
1182            graphql_client: self.graphql_client.clone(),
1183        }
1184    }
1185    /// Execute all selected checks
1186    ///
1187    /// # Arguments
1188    ///
1189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1190    pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1191        let mut query = self.selection.select("run");
1192        if let Some(fail_fast) = opts.fail_fast {
1193            query = query.arg("failFast", fail_fast);
1194        }
1195        CheckGroup {
1196            proc: self.proc.clone(),
1197            selection: query,
1198            graphql_client: self.graphql_client.clone(),
1199        }
1200    }
1201}
1202impl Node for CheckGroup {
1203    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1204        let query = self.selection.select("id");
1205        let graphql_client = self.graphql_client.clone();
1206        async move { query.execute(graphql_client).await }
1207    }
1208}
1209#[derive(Clone)]
1210pub struct ClientFilesyncMirror {
1211    pub proc: Option<Arc<DaggerSessionProc>>,
1212    pub selection: Selection,
1213    pub graphql_client: DynGraphQLClient,
1214}
1215impl IntoID<Id> for ClientFilesyncMirror {
1216    fn into_id(
1217        self,
1218    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1219        Box::pin(async move { self.id().await })
1220    }
1221}
1222impl Loadable for ClientFilesyncMirror {
1223    fn graphql_type() -> &'static str {
1224        "ClientFilesyncMirror"
1225    }
1226    fn from_query(
1227        proc: Option<Arc<DaggerSessionProc>>,
1228        selection: Selection,
1229        graphql_client: DynGraphQLClient,
1230    ) -> Self {
1231        Self {
1232            proc,
1233            selection,
1234            graphql_client,
1235        }
1236    }
1237}
1238impl ClientFilesyncMirror {
1239    /// A unique identifier for this ClientFilesyncMirror.
1240    pub async fn id(&self) -> Result<Id, DaggerError> {
1241        let query = self.selection.select("id");
1242        query.execute(self.graphql_client.clone()).await
1243    }
1244}
1245impl Node for ClientFilesyncMirror {
1246    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1247        let query = self.selection.select("id");
1248        let graphql_client = self.graphql_client.clone();
1249        async move { query.execute(graphql_client).await }
1250    }
1251}
1252#[derive(Clone)]
1253pub struct Cloud {
1254    pub proc: Option<Arc<DaggerSessionProc>>,
1255    pub selection: Selection,
1256    pub graphql_client: DynGraphQLClient,
1257}
1258impl IntoID<Id> for Cloud {
1259    fn into_id(
1260        self,
1261    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1262        Box::pin(async move { self.id().await })
1263    }
1264}
1265impl Loadable for Cloud {
1266    fn graphql_type() -> &'static str {
1267        "Cloud"
1268    }
1269    fn from_query(
1270        proc: Option<Arc<DaggerSessionProc>>,
1271        selection: Selection,
1272        graphql_client: DynGraphQLClient,
1273    ) -> Self {
1274        Self {
1275            proc,
1276            selection,
1277            graphql_client,
1278        }
1279    }
1280}
1281impl Cloud {
1282    /// A unique identifier for this Cloud.
1283    pub async fn id(&self) -> Result<Id, DaggerError> {
1284        let query = self.selection.select("id");
1285        query.execute(self.graphql_client.clone()).await
1286    }
1287    /// The trace URL for the current session
1288    pub async fn trace_url(&self) -> Result<String, DaggerError> {
1289        let query = self.selection.select("traceURL");
1290        query.execute(self.graphql_client.clone()).await
1291    }
1292}
1293impl Node for Cloud {
1294    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1295        let query = self.selection.select("id");
1296        let graphql_client = self.graphql_client.clone();
1297        async move { query.execute(graphql_client).await }
1298    }
1299}
1300#[derive(Clone)]
1301pub struct Container {
1302    pub proc: Option<Arc<DaggerSessionProc>>,
1303    pub selection: Selection,
1304    pub graphql_client: DynGraphQLClient,
1305}
1306#[derive(Builder, Debug, PartialEq)]
1307pub struct ContainerAsServiceOpts<'a> {
1308    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1309    /// If empty, the container's default command is used.
1310    #[builder(setter(into, strip_option), default)]
1311    pub args: Option<Vec<&'a str>>,
1312    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1313    #[builder(setter(into, strip_option), default)]
1314    pub expand: Option<bool>,
1315    /// Provides Dagger access to the executed command.
1316    #[builder(setter(into, strip_option), default)]
1317    pub experimental_privileged_nesting: Option<bool>,
1318    /// 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.
1319    #[builder(setter(into, strip_option), default)]
1320    pub insecure_root_capabilities: Option<bool>,
1321    /// If set, skip the automatic init process injected into containers by default.
1322    /// 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.
1323    #[builder(setter(into, strip_option), default)]
1324    pub no_init: Option<bool>,
1325    /// If the container has an entrypoint, prepend it to the args.
1326    #[builder(setter(into, strip_option), default)]
1327    pub use_entrypoint: Option<bool>,
1328}
1329#[derive(Builder, Debug, PartialEq)]
1330pub struct ContainerAsTarballOpts {
1331    /// Force each layer of the image to use the specified compression algorithm.
1332    /// 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.
1333    #[builder(setter(into, strip_option), default)]
1334    pub forced_compression: Option<ImageLayerCompression>,
1335    /// Use the specified media types for the image's layers.
1336    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1337    #[builder(setter(into, strip_option), default)]
1338    pub media_types: Option<ImageMediaTypes>,
1339    /// Identifiers for other platform specific containers.
1340    /// Used for multi-platform images.
1341    #[builder(setter(into, strip_option), default)]
1342    pub platform_variants: Option<Vec<Id>>,
1343}
1344#[derive(Builder, Debug, PartialEq)]
1345pub struct ContainerDirectoryOpts {
1346    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1347    #[builder(setter(into, strip_option), default)]
1348    pub expand: Option<bool>,
1349}
1350#[derive(Builder, Debug, PartialEq)]
1351pub struct ContainerExistsOpts {
1352    /// If specified, do not follow symlinks.
1353    #[builder(setter(into, strip_option), default)]
1354    pub do_not_follow_symlinks: Option<bool>,
1355    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1356    #[builder(setter(into, strip_option), default)]
1357    pub expand: Option<bool>,
1358    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
1359    #[builder(setter(into, strip_option), default)]
1360    pub expected_type: Option<ExistsType>,
1361}
1362#[derive(Builder, Debug, PartialEq)]
1363pub struct ContainerExportOpts {
1364    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1365    #[builder(setter(into, strip_option), default)]
1366    pub expand: Option<bool>,
1367    /// Force each layer of the exported image to use the specified compression algorithm.
1368    /// 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.
1369    #[builder(setter(into, strip_option), default)]
1370    pub forced_compression: Option<ImageLayerCompression>,
1371    /// Use the specified media types for the exported image's layers.
1372    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1373    #[builder(setter(into, strip_option), default)]
1374    pub media_types: Option<ImageMediaTypes>,
1375    /// Identifiers for other platform specific containers.
1376    /// Used for multi-platform image.
1377    #[builder(setter(into, strip_option), default)]
1378    pub platform_variants: Option<Vec<Id>>,
1379}
1380#[derive(Builder, Debug, PartialEq)]
1381pub struct ContainerExportImageOpts {
1382    /// Force each layer of the exported image to use the specified compression algorithm.
1383    /// 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.
1384    #[builder(setter(into, strip_option), default)]
1385    pub forced_compression: Option<ImageLayerCompression>,
1386    /// Use the specified media types for the exported image's layers.
1387    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1388    #[builder(setter(into, strip_option), default)]
1389    pub media_types: Option<ImageMediaTypes>,
1390    /// Identifiers for other platform specific containers.
1391    /// Used for multi-platform image.
1392    #[builder(setter(into, strip_option), default)]
1393    pub platform_variants: Option<Vec<Id>>,
1394}
1395#[derive(Builder, Debug, PartialEq)]
1396pub struct ContainerFileOpts {
1397    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1398    #[builder(setter(into, strip_option), default)]
1399    pub expand: Option<bool>,
1400}
1401#[derive(Builder, Debug, PartialEq)]
1402pub struct ContainerFromOpts<'a> {
1403    /// Allow HTTPS registry communication without verifying the server certificate.
1404    #[builder(setter(into, strip_option), default)]
1405    pub insecure_skip_tls_verify: Option<bool>,
1406    /// Protocol to use for registry communication.
1407    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
1408    #[builder(setter(into, strip_option), default)]
1409    pub protocol: Option<RegistryProtocol>,
1410    /// Service to use as the registry endpoint for the image address.
1411    /// The service will be started only for this pull.
1412    #[builder(setter(into, strip_option), default)]
1413    pub registry_service: Option<Id>,
1414    /// Version query used to select an image tag. The address must not contain a tag or digest.
1415    #[builder(setter(into, strip_option), default)]
1416    pub version: Option<&'a str>,
1417}
1418#[derive(Builder, Debug, PartialEq)]
1419pub struct ContainerImportOpts<'a> {
1420    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1421    #[builder(setter(into, strip_option), default)]
1422    pub tag: Option<&'a str>,
1423}
1424#[derive(Builder, Debug, PartialEq)]
1425pub struct ContainerLayerOpts {
1426    /// Force each layer of the image to use the specified compression algorithm.
1427    /// 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.
1428    #[builder(setter(into, strip_option), default)]
1429    pub forced_compression: Option<ImageLayerCompression>,
1430    /// Media types to use for image layers. Defaults to OCI.
1431    #[builder(setter(into, strip_option), default)]
1432    pub media_types: Option<ImageMediaTypes>,
1433}
1434#[derive(Builder, Debug, PartialEq)]
1435pub struct ContainerManifestOpts {
1436    /// Force each layer of the image to use the specified compression algorithm.
1437    /// 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.
1438    #[builder(setter(into, strip_option), default)]
1439    pub forced_compression: Option<ImageLayerCompression>,
1440    /// Media types to use for image layers. Defaults to OCI.
1441    #[builder(setter(into, strip_option), default)]
1442    pub media_types: Option<ImageMediaTypes>,
1443}
1444#[derive(Builder, Debug, PartialEq)]
1445pub struct ContainerPublishOpts {
1446    /// Force each layer of the published image to use the specified compression algorithm.
1447    /// 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.
1448    #[builder(setter(into, strip_option), default)]
1449    pub forced_compression: Option<ImageLayerCompression>,
1450    /// Allow HTTPS registry communication without verifying the server certificate.
1451    #[builder(setter(into, strip_option), default)]
1452    pub insecure_skip_tls_verify: Option<bool>,
1453    /// Use the specified media types for the published image's layers.
1454    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1455    #[builder(setter(into, strip_option), default)]
1456    pub media_types: Option<ImageMediaTypes>,
1457    /// Identifiers for other platform specific containers.
1458    /// Used for multi-platform image.
1459    #[builder(setter(into, strip_option), default)]
1460    pub platform_variants: Option<Vec<Id>>,
1461    /// Protocol to use for registry communication.
1462    /// Defaults to "HTTPS". Use "HTTP" only for plain HTTP registries.
1463    #[builder(setter(into, strip_option), default)]
1464    pub protocol: Option<RegistryProtocol>,
1465    /// Service to use as the registry endpoint for the image address.
1466    /// The service will be started only for this push.
1467    #[builder(setter(into, strip_option), default)]
1468    pub registry_service: Option<Id>,
1469}
1470#[derive(Builder, Debug, PartialEq)]
1471pub struct ContainerStatOpts {
1472    /// If specified, do not follow symlinks.
1473    #[builder(setter(into, strip_option), default)]
1474    pub do_not_follow_symlinks: Option<bool>,
1475}
1476#[derive(Builder, Debug, PartialEq)]
1477pub struct ContainerTerminalOpts<'a> {
1478    /// If set, override the container's default terminal command and invoke these command arguments instead.
1479    #[builder(setter(into, strip_option), default)]
1480    pub cmd: Option<Vec<&'a str>>,
1481    /// Provides Dagger access to the executed command.
1482    #[builder(setter(into, strip_option), default)]
1483    pub experimental_privileged_nesting: Option<bool>,
1484    /// 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.
1485    #[builder(setter(into, strip_option), default)]
1486    pub insecure_root_capabilities: Option<bool>,
1487}
1488#[derive(Builder, Debug, PartialEq)]
1489pub struct ContainerUpOpts<'a> {
1490    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1491    /// If empty, the container's default command is used.
1492    #[builder(setter(into, strip_option), default)]
1493    pub args: Option<Vec<&'a str>>,
1494    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1495    #[builder(setter(into, strip_option), default)]
1496    pub expand: Option<bool>,
1497    /// Provides Dagger access to the executed command.
1498    #[builder(setter(into, strip_option), default)]
1499    pub experimental_privileged_nesting: Option<bool>,
1500    /// 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.
1501    #[builder(setter(into, strip_option), default)]
1502    pub insecure_root_capabilities: Option<bool>,
1503    /// If set, skip the automatic init process injected into containers by default.
1504    /// 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.
1505    #[builder(setter(into, strip_option), default)]
1506    pub no_init: Option<bool>,
1507    /// List of frontend/backend port mappings to forward.
1508    /// Frontend is the port accepting traffic on the host, backend is the service port.
1509    #[builder(setter(into, strip_option), default)]
1510    pub ports: Option<Vec<PortForward>>,
1511    /// Bind each tunnel port to a random port on the host.
1512    #[builder(setter(into, strip_option), default)]
1513    pub random: Option<bool>,
1514    /// If the container has an entrypoint, prepend it to the args.
1515    #[builder(setter(into, strip_option), default)]
1516    pub use_entrypoint: Option<bool>,
1517}
1518#[derive(Builder, Debug, PartialEq)]
1519pub struct ContainerWithDefaultTerminalCmdOpts {
1520    /// Provides Dagger access to the executed command.
1521    #[builder(setter(into, strip_option), default)]
1522    pub experimental_privileged_nesting: Option<bool>,
1523    /// 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.
1524    #[builder(setter(into, strip_option), default)]
1525    pub insecure_root_capabilities: Option<bool>,
1526}
1527#[derive(Builder, Debug, PartialEq)]
1528pub struct ContainerWithDirectoryOpts<'a> {
1529    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
1530    #[builder(setter(into, strip_option), default)]
1531    pub exclude: Option<Vec<&'a str>>,
1532    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1533    #[builder(setter(into, strip_option), default)]
1534    pub expand: Option<bool>,
1535    /// Apply .gitignore rules when writing the directory.
1536    #[builder(setter(into, strip_option), default)]
1537    pub gitignore: Option<bool>,
1538    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
1539    #[builder(setter(into, strip_option), default)]
1540    pub include: Option<Vec<&'a str>>,
1541    /// Set the owner to the container's current user.
1542    #[builder(setter(into, strip_option), default)]
1543    pub inherit_owner: Option<bool>,
1544    /// A user:group to set for the directory and its contents.
1545    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1546    /// If the group is omitted, it defaults to the same as the user.
1547    #[builder(setter(into, strip_option), default)]
1548    pub owner: Option<&'a str>,
1549    #[builder(setter(into, strip_option), default)]
1550    pub permissions: Option<isize>,
1551}
1552#[derive(Builder, Debug, PartialEq)]
1553pub struct ContainerWithDockerHealthcheckOpts<'a> {
1554    /// Interval between running healthcheck. Example: "30s"
1555    #[builder(setter(into, strip_option), default)]
1556    pub interval: Option<&'a str>,
1557    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
1558    #[builder(setter(into, strip_option), default)]
1559    pub retries: Option<isize>,
1560    /// When true, command must be a single element, which is run using the container's shell
1561    #[builder(setter(into, strip_option), default)]
1562    pub shell: Option<bool>,
1563    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
1564    #[builder(setter(into, strip_option), default)]
1565    pub start_interval: Option<&'a str>,
1566    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
1567    #[builder(setter(into, strip_option), default)]
1568    pub start_period: Option<&'a str>,
1569    /// Healthcheck timeout. Example: "3s"
1570    #[builder(setter(into, strip_option), default)]
1571    pub timeout: Option<&'a str>,
1572}
1573#[derive(Builder, Debug, PartialEq)]
1574pub struct ContainerWithEntrypointOpts {
1575    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
1576    #[builder(setter(into, strip_option), default)]
1577    pub keep_default_args: Option<bool>,
1578}
1579#[derive(Builder, Debug, PartialEq)]
1580pub struct ContainerWithEnvVariableOpts {
1581    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
1582    #[builder(setter(into, strip_option), default)]
1583    pub expand: Option<bool>,
1584}
1585#[derive(Builder, Debug, PartialEq)]
1586pub struct ContainerWithExecOpts<'a> {
1587    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1588    #[builder(setter(into, strip_option), default)]
1589    pub expand: Option<bool>,
1590    /// Exit codes this command is allowed to exit with without error
1591    #[builder(setter(into, strip_option), default)]
1592    pub expect: Option<ReturnType>,
1593    /// Provides Dagger access to the executed command.
1594    #[builder(setter(into, strip_option), default)]
1595    pub experimental_privileged_nesting: Option<bool>,
1596    /// Execute the command with all root capabilities. Like --privileged in Docker
1597    /// 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.
1598    #[builder(setter(into, strip_option), default)]
1599    pub insecure_root_capabilities: Option<bool>,
1600    /// Skip the automatic init process injected into containers by default.
1601    /// 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.
1602    #[builder(setter(into, strip_option), default)]
1603    pub no_init: Option<bool>,
1604    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
1605    #[builder(setter(into, strip_option), default)]
1606    pub redirect_stderr: Option<&'a str>,
1607    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
1608    #[builder(setter(into, strip_option), default)]
1609    pub redirect_stdin: Option<&'a str>,
1610    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
1611    #[builder(setter(into, strip_option), default)]
1612    pub redirect_stdout: Option<&'a str>,
1613    /// Content to write to the command's standard input. Example: "Hello world")
1614    #[builder(setter(into, strip_option), default)]
1615    pub stdin: Option<&'a str>,
1616    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
1617    #[builder(setter(into, strip_option), default)]
1618    pub use_entrypoint: Option<bool>,
1619}
1620#[derive(Builder, Debug, PartialEq)]
1621pub struct ContainerWithExposedPortOpts<'a> {
1622    /// Port description. Example: "payment API endpoint"
1623    #[builder(setter(into, strip_option), default)]
1624    pub description: Option<&'a str>,
1625    /// Skip the health check when run as a service.
1626    #[builder(setter(into, strip_option), default)]
1627    pub experimental_skip_healthcheck: Option<bool>,
1628    /// Network protocol. Example: "tcp"
1629    #[builder(setter(into, strip_option), default)]
1630    pub protocol: Option<NetworkProtocol>,
1631}
1632#[derive(Builder, Debug, PartialEq)]
1633pub struct ContainerWithFileOpts<'a> {
1634    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1635    #[builder(setter(into, strip_option), default)]
1636    pub expand: Option<bool>,
1637    /// Set the owner to the container's current user.
1638    #[builder(setter(into, strip_option), default)]
1639    pub inherit_owner: Option<bool>,
1640    /// A user:group to set for the file.
1641    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1642    /// If the group is omitted, it defaults to the same as the user.
1643    #[builder(setter(into, strip_option), default)]
1644    pub owner: Option<&'a str>,
1645    /// Permissions of the new file. Example: 0600
1646    #[builder(setter(into, strip_option), default)]
1647    pub permissions: Option<isize>,
1648}
1649#[derive(Builder, Debug, PartialEq)]
1650pub struct ContainerWithFilesOpts<'a> {
1651    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1652    #[builder(setter(into, strip_option), default)]
1653    pub expand: Option<bool>,
1654    /// Set the owner to the container's current user.
1655    #[builder(setter(into, strip_option), default)]
1656    pub inherit_owner: Option<bool>,
1657    /// A user:group to set for the files.
1658    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1659    /// If the group is omitted, it defaults to the same as the user.
1660    #[builder(setter(into, strip_option), default)]
1661    pub owner: Option<&'a str>,
1662    /// Permission given to the copied files (e.g., 0600).
1663    #[builder(setter(into, strip_option), default)]
1664    pub permissions: Option<isize>,
1665}
1666#[derive(Builder, Debug, PartialEq)]
1667pub struct ContainerWithMountedCacheOpts<'a> {
1668    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1669    #[builder(setter(into, strip_option), default)]
1670    pub expand: Option<bool>,
1671    /// Set the owner to the container's current user.
1672    #[builder(setter(into, strip_option), default)]
1673    pub inherit_owner: Option<bool>,
1674    /// A user:group to set for the mounted cache directory.
1675    /// 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.
1676    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1677    /// If the group is omitted, it defaults to the same as the user.
1678    #[builder(setter(into, strip_option), default)]
1679    pub owner: Option<&'a str>,
1680    /// Sharing mode of the cache volume.
1681    #[builder(setter(into, strip_option), default)]
1682    pub sharing: Option<CacheSharingMode>,
1683    /// Identifier of the directory to use as the cache volume's root.
1684    #[builder(setter(into, strip_option), default)]
1685    pub source: Option<Id>,
1686}
1687#[derive(Builder, Debug, PartialEq)]
1688pub struct ContainerWithMountedDirectoryOpts<'a> {
1689    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1690    #[builder(setter(into, strip_option), default)]
1691    pub expand: Option<bool>,
1692    /// Set the owner to the container's current user.
1693    #[builder(setter(into, strip_option), default)]
1694    pub inherit_owner: Option<bool>,
1695    /// A user:group to set for the mounted directory and its contents.
1696    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1697    /// If the group is omitted, it defaults to the same as the user.
1698    #[builder(setter(into, strip_option), default)]
1699    pub owner: Option<&'a str>,
1700    /// Mount the directory read-only.
1701    #[builder(setter(into, strip_option), default)]
1702    pub read_only: Option<bool>,
1703}
1704#[derive(Builder, Debug, PartialEq)]
1705pub struct ContainerWithMountedFileOpts<'a> {
1706    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1707    #[builder(setter(into, strip_option), default)]
1708    pub expand: Option<bool>,
1709    /// Set the owner to the container's current user.
1710    #[builder(setter(into, strip_option), default)]
1711    pub inherit_owner: Option<bool>,
1712    /// A user or user:group to set for the mounted file.
1713    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1714    /// If the group is omitted, it defaults to the same as the user.
1715    #[builder(setter(into, strip_option), default)]
1716    pub owner: Option<&'a str>,
1717}
1718#[derive(Builder, Debug, PartialEq)]
1719pub struct ContainerWithMountedSecretOpts<'a> {
1720    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1721    #[builder(setter(into, strip_option), default)]
1722    pub expand: Option<bool>,
1723    /// Set the owner to the container's current user.
1724    #[builder(setter(into, strip_option), default)]
1725    pub inherit_owner: Option<bool>,
1726    /// Permission given to the mounted secret (e.g., 0600).
1727    /// This option requires an owner to be set to be active.
1728    #[builder(setter(into, strip_option), default)]
1729    pub mode: Option<isize>,
1730    /// A user:group to set for the mounted secret.
1731    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1732    /// If the group is omitted, it defaults to the same as the user.
1733    #[builder(setter(into, strip_option), default)]
1734    pub owner: Option<&'a str>,
1735}
1736#[derive(Builder, Debug, PartialEq)]
1737pub struct ContainerWithMountedTempOpts {
1738    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1739    #[builder(setter(into, strip_option), default)]
1740    pub expand: Option<bool>,
1741    /// Size of the temporary directory in bytes.
1742    #[builder(setter(into, strip_option), default)]
1743    pub size: Option<isize>,
1744}
1745#[derive(Builder, Debug, PartialEq)]
1746pub struct ContainerWithMountedVolumeOpts {
1747    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1748    #[builder(setter(into, strip_option), default)]
1749    pub expand: Option<bool>,
1750    /// Mount the volume read-only.
1751    #[builder(setter(into, strip_option), default)]
1752    pub read_only: Option<bool>,
1753}
1754#[derive(Builder, Debug, PartialEq)]
1755pub struct ContainerWithNewFileOpts<'a> {
1756    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1757    #[builder(setter(into, strip_option), default)]
1758    pub expand: Option<bool>,
1759    /// Set the owner to the container's current user.
1760    #[builder(setter(into, strip_option), default)]
1761    pub inherit_owner: Option<bool>,
1762    /// A user:group to set for the file.
1763    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1764    /// If the group is omitted, it defaults to the same as the user.
1765    #[builder(setter(into, strip_option), default)]
1766    pub owner: Option<&'a str>,
1767    /// Permissions of the new file. Example: 0600
1768    #[builder(setter(into, strip_option), default)]
1769    pub permissions: Option<isize>,
1770}
1771#[derive(Builder, Debug, PartialEq)]
1772pub struct ContainerWithSymlinkOpts {
1773    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1774    #[builder(setter(into, strip_option), default)]
1775    pub expand: Option<bool>,
1776}
1777#[derive(Builder, Debug, PartialEq)]
1778pub struct ContainerWithUnixSocketOpts<'a> {
1779    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1780    #[builder(setter(into, strip_option), default)]
1781    pub expand: Option<bool>,
1782    /// Set the owner to the container's current user.
1783    #[builder(setter(into, strip_option), default)]
1784    pub inherit_owner: Option<bool>,
1785    /// A user:group to set for the mounted socket.
1786    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1787    /// If the group is omitted, it defaults to the same as the user.
1788    #[builder(setter(into, strip_option), default)]
1789    pub owner: Option<&'a str>,
1790}
1791#[derive(Builder, Debug, PartialEq)]
1792pub struct ContainerWithWorkdirOpts {
1793    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1794    #[builder(setter(into, strip_option), default)]
1795    pub expand: Option<bool>,
1796}
1797#[derive(Builder, Debug, PartialEq)]
1798pub struct ContainerWithoutDirectoryOpts {
1799    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1800    #[builder(setter(into, strip_option), default)]
1801    pub expand: Option<bool>,
1802}
1803#[derive(Builder, Debug, PartialEq)]
1804pub struct ContainerWithoutEntrypointOpts {
1805    /// Don't remove the default arguments when unsetting the entrypoint.
1806    #[builder(setter(into, strip_option), default)]
1807    pub keep_default_args: Option<bool>,
1808}
1809#[derive(Builder, Debug, PartialEq)]
1810pub struct ContainerWithoutExposedPortOpts {
1811    /// Port protocol to unexpose
1812    #[builder(setter(into, strip_option), default)]
1813    pub protocol: Option<NetworkProtocol>,
1814}
1815#[derive(Builder, Debug, PartialEq)]
1816pub struct ContainerWithoutFileOpts {
1817    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1818    #[builder(setter(into, strip_option), default)]
1819    pub expand: Option<bool>,
1820}
1821#[derive(Builder, Debug, PartialEq)]
1822pub struct ContainerWithoutFilesOpts {
1823    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1824    #[builder(setter(into, strip_option), default)]
1825    pub expand: Option<bool>,
1826}
1827#[derive(Builder, Debug, PartialEq)]
1828pub struct ContainerWithoutMountOpts {
1829    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1830    #[builder(setter(into, strip_option), default)]
1831    pub expand: Option<bool>,
1832}
1833#[derive(Builder, Debug, PartialEq)]
1834pub struct ContainerWithoutUnixSocketOpts {
1835    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1836    #[builder(setter(into, strip_option), default)]
1837    pub expand: Option<bool>,
1838}
1839impl IntoID<Id> for Container {
1840    fn into_id(
1841        self,
1842    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1843        Box::pin(async move { self.id().await })
1844    }
1845}
1846impl Loadable for Container {
1847    fn graphql_type() -> &'static str {
1848        "Container"
1849    }
1850    fn from_query(
1851        proc: Option<Arc<DaggerSessionProc>>,
1852        selection: Selection,
1853        graphql_client: DynGraphQLClient,
1854    ) -> Self {
1855        Self {
1856            proc,
1857            selection,
1858            graphql_client,
1859        }
1860    }
1861}
1862impl Container {
1863    /// Turn the container into a Service.
1864    /// Be sure to set any exposed ports before this conversion.
1865    ///
1866    /// # Arguments
1867    ///
1868    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1869    pub fn as_service(&self) -> Service {
1870        let query = self.selection.select("asService");
1871        Service {
1872            proc: self.proc.clone(),
1873            selection: query,
1874            graphql_client: self.graphql_client.clone(),
1875        }
1876    }
1877    /// Turn the container into a Service.
1878    /// Be sure to set any exposed ports before this conversion.
1879    ///
1880    /// # Arguments
1881    ///
1882    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1883    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1884        let mut query = self.selection.select("asService");
1885        if let Some(args) = opts.args {
1886            query = query.arg("args", args);
1887        }
1888        if let Some(use_entrypoint) = opts.use_entrypoint {
1889            query = query.arg("useEntrypoint", use_entrypoint);
1890        }
1891        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1892            query = query.arg(
1893                "experimentalPrivilegedNesting",
1894                experimental_privileged_nesting,
1895            );
1896        }
1897        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
1898            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
1899        }
1900        if let Some(expand) = opts.expand {
1901            query = query.arg("expand", expand);
1902        }
1903        if let Some(no_init) = opts.no_init {
1904            query = query.arg("noInit", no_init);
1905        }
1906        Service {
1907            proc: self.proc.clone(),
1908            selection: query,
1909            graphql_client: self.graphql_client.clone(),
1910        }
1911    }
1912    /// Package the container state as an OCI image, and return it as a tar archive
1913    ///
1914    /// # Arguments
1915    ///
1916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1917    pub fn as_tarball(&self) -> File {
1918        let query = self.selection.select("asTarball");
1919        File {
1920            proc: self.proc.clone(),
1921            selection: query,
1922            graphql_client: self.graphql_client.clone(),
1923        }
1924    }
1925    /// Package the container state as an OCI image, and return it as a tar archive
1926    ///
1927    /// # Arguments
1928    ///
1929    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1930    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
1931        let mut query = self.selection.select("asTarball");
1932        if let Some(platform_variants) = opts.platform_variants {
1933            query = query.arg("platformVariants", platform_variants);
1934        }
1935        if let Some(forced_compression) = opts.forced_compression {
1936            query = query.arg("forcedCompression", forced_compression);
1937        }
1938        if let Some(media_types) = opts.media_types {
1939            query = query.arg("mediaTypes", media_types);
1940        }
1941        File {
1942            proc: self.proc.clone(),
1943            selection: query,
1944            graphql_client: self.graphql_client.clone(),
1945        }
1946    }
1947    /// The combined buffered standard output and standard error stream of the last executed command
1948    /// Returns an error if no command was executed
1949    pub async fn combined_output(&self) -> Result<String, DaggerError> {
1950        let query = self.selection.select("combinedOutput");
1951        query.execute(self.graphql_client.clone()).await
1952    }
1953    /// Return the container's default arguments.
1954    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
1955        let query = self.selection.select("defaultArgs");
1956        query.execute(self.graphql_client.clone()).await
1957    }
1958    /// Retrieve a directory from the container's root filesystem
1959    /// Mounts are included.
1960    ///
1961    /// # Arguments
1962    ///
1963    /// * `path` - The path of the directory to retrieve (e.g., "./src").
1964    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1965    pub fn directory(&self, path: impl Into<String>) -> Directory {
1966        let mut query = self.selection.select("directory");
1967        query = query.arg("path", path.into());
1968        Directory {
1969            proc: self.proc.clone(),
1970            selection: query,
1971            graphql_client: self.graphql_client.clone(),
1972        }
1973    }
1974    /// Retrieve a directory from the container's root filesystem
1975    /// Mounts are included.
1976    ///
1977    /// # Arguments
1978    ///
1979    /// * `path` - The path of the directory to retrieve (e.g., "./src").
1980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1981    pub fn directory_opts(
1982        &self,
1983        path: impl Into<String>,
1984        opts: ContainerDirectoryOpts,
1985    ) -> Directory {
1986        let mut query = self.selection.select("directory");
1987        query = query.arg("path", path.into());
1988        if let Some(expand) = opts.expand {
1989            query = query.arg("expand", expand);
1990        }
1991        Directory {
1992            proc: self.proc.clone(),
1993            selection: query,
1994            graphql_client: self.graphql_client.clone(),
1995        }
1996    }
1997    /// Retrieves this container's configured docker healthcheck.
1998    pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
1999        let query = self.selection.select("dockerHealthcheck");
2000        let query = query.select("id");
2001        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2002        Ok(id.map(|id| HealthcheckConfig {
2003            proc: self.proc.clone(),
2004            selection: query
2005                .root()
2006                .select("node")
2007                .arg("id", &id.0)
2008                .inline_fragment("HealthcheckConfig"),
2009            graphql_client: self.graphql_client.clone(),
2010        }))
2011    }
2012    /// Return the container's OCI entrypoint.
2013    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2014        let query = self.selection.select("entrypoint");
2015        query.execute(self.graphql_client.clone()).await
2016    }
2017    /// Retrieves the value of the specified persistent environment variable.
2018    ///
2019    /// # Arguments
2020    ///
2021    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2022    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2023        let mut query = self.selection.select("envVariable");
2024        query = query.arg("name", name.into());
2025        query.execute(self.graphql_client.clone()).await
2026    }
2027    /// Retrieves the list of persistent environment variables configured on the container.
2028    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2029        let query = self.selection.select("envVariables");
2030        let query = query.select("id");
2031        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2032        Ok(ids
2033            .into_iter()
2034            .map(|id| EnvVariable {
2035                proc: self.proc.clone(),
2036                selection: crate::querybuilder::query()
2037                    .select("node")
2038                    .arg("id", &id.0)
2039                    .inline_fragment("EnvVariable"),
2040                graphql_client: self.graphql_client.clone(),
2041            })
2042            .collect())
2043    }
2044    /// check if a file or directory exists
2045    ///
2046    /// # Arguments
2047    ///
2048    /// * `path` - Path to check (e.g., "/file.txt").
2049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2050    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2051        let mut query = self.selection.select("exists");
2052        query = query.arg("path", path.into());
2053        query.execute(self.graphql_client.clone()).await
2054    }
2055    /// check if a file or directory exists
2056    ///
2057    /// # Arguments
2058    ///
2059    /// * `path` - Path to check (e.g., "/file.txt").
2060    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2061    pub async fn exists_opts(
2062        &self,
2063        path: impl Into<String>,
2064        opts: ContainerExistsOpts,
2065    ) -> Result<bool, DaggerError> {
2066        let mut query = self.selection.select("exists");
2067        query = query.arg("path", path.into());
2068        if let Some(expected_type) = opts.expected_type {
2069            query = query.arg("expectedType", expected_type);
2070        }
2071        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2072            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2073        }
2074        if let Some(expand) = opts.expand {
2075            query = query.arg("expand", expand);
2076        }
2077        query.execute(self.graphql_client.clone()).await
2078    }
2079    /// The exit code of the last executed command
2080    /// Returns an error if no command was executed
2081    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2082        let query = self.selection.select("exitCode");
2083        query.execute(self.graphql_client.clone()).await
2084    }
2085    /// EXPERIMENTAL API! Subject to change/removal at any time.
2086    /// Configures all available GPUs on the host to be accessible to this container.
2087    /// This currently works for Nvidia devices only.
2088    pub fn experimental_with_all_gp_us(&self) -> Container {
2089        let query = self.selection.select("experimentalWithAllGPUs");
2090        Container {
2091            proc: self.proc.clone(),
2092            selection: query,
2093            graphql_client: self.graphql_client.clone(),
2094        }
2095    }
2096    /// EXPERIMENTAL API! Subject to change/removal at any time.
2097    /// Configures the provided list of devices to be accessible to this container.
2098    /// This currently works for Nvidia devices only.
2099    ///
2100    /// # Arguments
2101    ///
2102    /// * `devices` - List of devices to be accessible to this container.
2103    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2104        let mut query = self.selection.select("experimentalWithGPU");
2105        query = query.arg(
2106            "devices",
2107            devices
2108                .into_iter()
2109                .map(|i| i.into())
2110                .collect::<Vec<String>>(),
2111        );
2112        Container {
2113            proc: self.proc.clone(),
2114            selection: query,
2115            graphql_client: self.graphql_client.clone(),
2116        }
2117    }
2118    /// Writes the container as an OCI tarball to the destination file path on the host.
2119    /// It can also export platform variants.
2120    ///
2121    /// # Arguments
2122    ///
2123    /// * `path` - Host's destination path (e.g., "./tarball").
2124    ///
2125    /// Path can be relative to the engine's workdir or absolute.
2126    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2127    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2128        let mut query = self.selection.select("export");
2129        query = query.arg("path", path.into());
2130        query.execute(self.graphql_client.clone()).await
2131    }
2132    /// Writes the container as an OCI tarball to the destination file path on the host.
2133    /// It can also export platform variants.
2134    ///
2135    /// # Arguments
2136    ///
2137    /// * `path` - Host's destination path (e.g., "./tarball").
2138    ///
2139    /// Path can be relative to the engine's workdir or absolute.
2140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2141    pub async fn export_opts(
2142        &self,
2143        path: impl Into<String>,
2144        opts: ContainerExportOpts,
2145    ) -> Result<String, DaggerError> {
2146        let mut query = self.selection.select("export");
2147        query = query.arg("path", path.into());
2148        if let Some(platform_variants) = opts.platform_variants {
2149            query = query.arg("platformVariants", platform_variants);
2150        }
2151        if let Some(forced_compression) = opts.forced_compression {
2152            query = query.arg("forcedCompression", forced_compression);
2153        }
2154        if let Some(media_types) = opts.media_types {
2155            query = query.arg("mediaTypes", media_types);
2156        }
2157        if let Some(expand) = opts.expand {
2158            query = query.arg("expand", expand);
2159        }
2160        query.execute(self.graphql_client.clone()).await
2161    }
2162    /// Exports the container as an image to the host's container image store.
2163    ///
2164    /// # Arguments
2165    ///
2166    /// * `name` - Name of image to export to in the host's store
2167    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2168    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2169        let mut query = self.selection.select("exportImage");
2170        query = query.arg("name", name.into());
2171        query.execute(self.graphql_client.clone()).await
2172    }
2173    /// Exports the container as an image to the host's container image store.
2174    ///
2175    /// # Arguments
2176    ///
2177    /// * `name` - Name of image to export to in the host's store
2178    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2179    pub async fn export_image_opts(
2180        &self,
2181        name: impl Into<String>,
2182        opts: ContainerExportImageOpts,
2183    ) -> Result<Void, DaggerError> {
2184        let mut query = self.selection.select("exportImage");
2185        query = query.arg("name", name.into());
2186        if let Some(platform_variants) = opts.platform_variants {
2187            query = query.arg("platformVariants", platform_variants);
2188        }
2189        if let Some(forced_compression) = opts.forced_compression {
2190            query = query.arg("forcedCompression", forced_compression);
2191        }
2192        if let Some(media_types) = opts.media_types {
2193            query = query.arg("mediaTypes", media_types);
2194        }
2195        query.execute(self.graphql_client.clone()).await
2196    }
2197    /// Retrieves the list of exposed ports.
2198    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2199    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2200        let query = self.selection.select("exposedPorts");
2201        let query = query.select("id");
2202        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2203        Ok(ids
2204            .into_iter()
2205            .map(|id| Port {
2206                proc: self.proc.clone(),
2207                selection: crate::querybuilder::query()
2208                    .select("node")
2209                    .arg("id", &id.0)
2210                    .inline_fragment("Port"),
2211                graphql_client: self.graphql_client.clone(),
2212            })
2213            .collect())
2214    }
2215    /// Retrieves a file at the given path.
2216    /// Mounts are included.
2217    ///
2218    /// # Arguments
2219    ///
2220    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2221    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2222    pub fn file(&self, path: impl Into<String>) -> File {
2223        let mut query = self.selection.select("file");
2224        query = query.arg("path", path.into());
2225        File {
2226            proc: self.proc.clone(),
2227            selection: query,
2228            graphql_client: self.graphql_client.clone(),
2229        }
2230    }
2231    /// Retrieves a file at the given path.
2232    /// Mounts are included.
2233    ///
2234    /// # Arguments
2235    ///
2236    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2237    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2238    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2239        let mut query = self.selection.select("file");
2240        query = query.arg("path", path.into());
2241        if let Some(expand) = opts.expand {
2242            query = query.arg("expand", expand);
2243        }
2244        File {
2245            proc: self.proc.clone(),
2246            selection: query,
2247            graphql_client: self.graphql_client.clone(),
2248        }
2249    }
2250    /// Download a container image, and apply it to the container state. All previous state will be lost.
2251    ///
2252    /// # Arguments
2253    ///
2254    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
2255    ///
2256    /// 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.
2257    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2258    pub fn from(&self, address: impl Into<String>) -> Container {
2259        let mut query = self.selection.select("from");
2260        query = query.arg("address", address.into());
2261        Container {
2262            proc: self.proc.clone(),
2263            selection: query,
2264            graphql_client: self.graphql_client.clone(),
2265        }
2266    }
2267    /// Download a container image, and apply it to the container state. All previous state will be lost.
2268    ///
2269    /// # Arguments
2270    ///
2271    /// * `address` - Address of the container image to download, in standard OCI ref format. Example: "registry.dagger.io/engine:latest".
2272    ///
2273    /// 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.
2274    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2275    pub fn from_opts<'a>(
2276        &self,
2277        address: impl Into<String>,
2278        opts: ContainerFromOpts<'a>,
2279    ) -> Container {
2280        let mut query = self.selection.select("from");
2281        query = query.arg("address", address.into());
2282        if let Some(version) = opts.version {
2283            query = query.arg("version", version);
2284        }
2285        if let Some(registry_service) = opts.registry_service {
2286            query = query.arg("registryService", registry_service);
2287        }
2288        if let Some(protocol) = opts.protocol {
2289            query = query.arg("protocol", protocol);
2290        }
2291        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
2292            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
2293        }
2294        Container {
2295            proc: self.proc.clone(),
2296            selection: query,
2297            graphql_client: self.graphql_client.clone(),
2298        }
2299    }
2300    /// A unique identifier for this Container.
2301    pub async fn id(&self) -> Result<Id, DaggerError> {
2302        let query = self.selection.select("id");
2303        query.execute(self.graphql_client.clone()).await
2304    }
2305    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2306    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2307        let query = self.selection.select("imageRef");
2308        query.execute(self.graphql_client.clone()).await
2309    }
2310    /// Reads the container from an OCI tarball.
2311    ///
2312    /// # Arguments
2313    ///
2314    /// * `source` - File to read the container from.
2315    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2316    pub fn import(&self, source: impl IntoID<Id>) -> Container {
2317        let mut query = self.selection.select("import");
2318        query = query.arg_lazy(
2319            "source",
2320            Box::new(move || {
2321                let source = source.clone();
2322                Box::pin(async move { source.into_id().await.unwrap().quote() })
2323            }),
2324        );
2325        Container {
2326            proc: self.proc.clone(),
2327            selection: query,
2328            graphql_client: self.graphql_client.clone(),
2329        }
2330    }
2331    /// Reads the container from an OCI tarball.
2332    ///
2333    /// # Arguments
2334    ///
2335    /// * `source` - File to read the container from.
2336    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2337    pub fn import_opts<'a>(
2338        &self,
2339        source: impl IntoID<Id>,
2340        opts: ContainerImportOpts<'a>,
2341    ) -> Container {
2342        let mut query = self.selection.select("import");
2343        query = query.arg_lazy(
2344            "source",
2345            Box::new(move || {
2346                let source = source.clone();
2347                Box::pin(async move { source.into_id().await.unwrap().quote() })
2348            }),
2349        );
2350        if let Some(tag) = opts.tag {
2351            query = query.arg("tag", tag);
2352        }
2353        Container {
2354            proc: self.proc.clone(),
2355            selection: query,
2356            graphql_client: self.graphql_client.clone(),
2357        }
2358    }
2359    /// Retrieves the value of the specified label.
2360    ///
2361    /// # Arguments
2362    ///
2363    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2364    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2365        let mut query = self.selection.select("label");
2366        query = query.arg("name", name.into());
2367        query.execute(self.graphql_client.clone()).await
2368    }
2369    /// Retrieves the list of labels passed to container.
2370    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2371        let query = self.selection.select("labels");
2372        let query = query.select("id");
2373        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2374        Ok(ids
2375            .into_iter()
2376            .map(|id| Label {
2377                proc: self.proc.clone(),
2378                selection: crate::querybuilder::query()
2379                    .select("node")
2380                    .arg("id", &id.0)
2381                    .inline_fragment("Label"),
2382                graphql_client: self.graphql_client.clone(),
2383            })
2384            .collect())
2385    }
2386    /// Returns the image layer or configuration blob with the given digest as a File.
2387    ///
2388    /// # Arguments
2389    ///
2390    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
2391    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2392    pub fn layer(&self, id: impl Into<String>) -> File {
2393        let mut query = self.selection.select("layer");
2394        query = query.arg("id", id.into());
2395        File {
2396            proc: self.proc.clone(),
2397            selection: query,
2398            graphql_client: self.graphql_client.clone(),
2399        }
2400    }
2401    /// Returns the image layer or configuration blob with the given digest as a File.
2402    ///
2403    /// # Arguments
2404    ///
2405    /// * `id` - Digest of the layer or configuration blob (e.g. "sha256:abc123...").
2406    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2407    pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
2408        let mut query = self.selection.select("layer");
2409        query = query.arg("id", id.into());
2410        if let Some(forced_compression) = opts.forced_compression {
2411            query = query.arg("forcedCompression", forced_compression);
2412        }
2413        if let Some(media_types) = opts.media_types {
2414            query = query.arg("mediaTypes", media_types);
2415        }
2416        File {
2417            proc: self.proc.clone(),
2418            selection: query,
2419            graphql_client: self.graphql_client.clone(),
2420        }
2421    }
2422    /// Computes and returns the manifest for this container as a File.
2423    ///
2424    /// # Arguments
2425    ///
2426    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2427    pub fn manifest(&self) -> File {
2428        let query = self.selection.select("manifest");
2429        File {
2430            proc: self.proc.clone(),
2431            selection: query,
2432            graphql_client: self.graphql_client.clone(),
2433        }
2434    }
2435    /// Computes and returns the manifest for this container as a File.
2436    ///
2437    /// # Arguments
2438    ///
2439    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2440    pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
2441        let mut query = self.selection.select("manifest");
2442        if let Some(forced_compression) = opts.forced_compression {
2443            query = query.arg("forcedCompression", forced_compression);
2444        }
2445        if let Some(media_types) = opts.media_types {
2446            query = query.arg("mediaTypes", media_types);
2447        }
2448        File {
2449            proc: self.proc.clone(),
2450            selection: query,
2451            graphql_client: self.graphql_client.clone(),
2452        }
2453    }
2454    /// Retrieves the list of paths where a directory is mounted.
2455    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2456        let query = self.selection.select("mounts");
2457        query.execute(self.graphql_client.clone()).await
2458    }
2459    /// The platform this container executes and publishes as.
2460    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2461        let query = self.selection.select("platform");
2462        query.execute(self.graphql_client.clone()).await
2463    }
2464    /// Package the container state as an OCI image, and publish it to a registry
2465    /// Returns the fully qualified address of the published image, with digest
2466    ///
2467    /// # Arguments
2468    ///
2469    /// * `address` - The OCI address to publish to
2470    ///
2471    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2472    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2473    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2474        let mut query = self.selection.select("publish");
2475        query = query.arg("address", address.into());
2476        query.execute(self.graphql_client.clone()).await
2477    }
2478    /// Package the container state as an OCI image, and publish it to a registry
2479    /// Returns the fully qualified address of the published image, with digest
2480    ///
2481    /// # Arguments
2482    ///
2483    /// * `address` - The OCI address to publish to
2484    ///
2485    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2486    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2487    pub async fn publish_opts(
2488        &self,
2489        address: impl Into<String>,
2490        opts: ContainerPublishOpts,
2491    ) -> Result<String, DaggerError> {
2492        let mut query = self.selection.select("publish");
2493        query = query.arg("address", address.into());
2494        if let Some(platform_variants) = opts.platform_variants {
2495            query = query.arg("platformVariants", platform_variants);
2496        }
2497        if let Some(forced_compression) = opts.forced_compression {
2498            query = query.arg("forcedCompression", forced_compression);
2499        }
2500        if let Some(media_types) = opts.media_types {
2501            query = query.arg("mediaTypes", media_types);
2502        }
2503        if let Some(registry_service) = opts.registry_service {
2504            query = query.arg("registryService", registry_service);
2505        }
2506        if let Some(protocol) = opts.protocol {
2507            query = query.arg("protocol", protocol);
2508        }
2509        if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
2510            query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
2511        }
2512        query.execute(self.graphql_client.clone()).await
2513    }
2514    /// 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.
2515    pub fn rootfs(&self) -> Directory {
2516        let query = self.selection.select("rootfs");
2517        Directory {
2518            proc: self.proc.clone(),
2519            selection: query,
2520            graphql_client: self.graphql_client.clone(),
2521        }
2522    }
2523    /// Return file status
2524    ///
2525    /// # Arguments
2526    ///
2527    /// * `path` - Path to check (e.g., "/file.txt").
2528    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2529    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
2530        let mut query = self.selection.select("stat");
2531        query = query.arg("path", path.into());
2532        let query = query.select("id");
2533        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2534        Ok(id.map(|id| Stat {
2535            proc: self.proc.clone(),
2536            selection: query
2537                .root()
2538                .select("node")
2539                .arg("id", &id.0)
2540                .inline_fragment("Stat"),
2541            graphql_client: self.graphql_client.clone(),
2542        }))
2543    }
2544    /// Return file status
2545    ///
2546    /// # Arguments
2547    ///
2548    /// * `path` - Path to check (e.g., "/file.txt").
2549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2550    pub async fn stat_opts(
2551        &self,
2552        path: impl Into<String>,
2553        opts: ContainerStatOpts,
2554    ) -> Result<Option<Stat>, DaggerError> {
2555        let mut query = self.selection.select("stat");
2556        query = query.arg("path", path.into());
2557        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2558            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2559        }
2560        let query = query.select("id");
2561        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2562        Ok(id.map(|id| Stat {
2563            proc: self.proc.clone(),
2564            selection: query
2565                .root()
2566                .select("node")
2567                .arg("id", &id.0)
2568                .inline_fragment("Stat"),
2569            graphql_client: self.graphql_client.clone(),
2570        }))
2571    }
2572    /// The buffered standard error stream of the last executed command
2573    /// Returns an error if no command was executed
2574    pub async fn stderr(&self) -> Result<String, DaggerError> {
2575        let query = self.selection.select("stderr");
2576        query.execute(self.graphql_client.clone()).await
2577    }
2578    /// The buffered standard output stream of the last executed command
2579    /// Returns an error if no command was executed
2580    pub async fn stdout(&self) -> Result<String, DaggerError> {
2581        let query = self.selection.select("stdout");
2582        query.execute(self.graphql_client.clone()).await
2583    }
2584    /// Forces evaluation of the pipeline in the engine.
2585    /// It doesn't run the default command if no exec has been set.
2586    pub async fn sync(&self) -> Result<Container, DaggerError> {
2587        let query = self.selection.select("sync");
2588        let id: Id = query.execute(self.graphql_client.clone()).await?;
2589        Ok(Container {
2590            proc: self.proc.clone(),
2591            selection: query
2592                .root()
2593                .select("node")
2594                .arg("id", &id.0)
2595                .inline_fragment("Container"),
2596            graphql_client: self.graphql_client.clone(),
2597        })
2598    }
2599    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2600    ///
2601    /// # Arguments
2602    ///
2603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2604    pub fn terminal(&self) -> Container {
2605        let query = self.selection.select("terminal");
2606        Container {
2607            proc: self.proc.clone(),
2608            selection: query,
2609            graphql_client: self.graphql_client.clone(),
2610        }
2611    }
2612    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2613    ///
2614    /// # Arguments
2615    ///
2616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2617    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2618        let mut query = self.selection.select("terminal");
2619        if let Some(cmd) = opts.cmd {
2620            query = query.arg("cmd", cmd);
2621        }
2622        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2623            query = query.arg(
2624                "experimentalPrivilegedNesting",
2625                experimental_privileged_nesting,
2626            );
2627        }
2628        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2629            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2630        }
2631        Container {
2632            proc: self.proc.clone(),
2633            selection: query,
2634            graphql_client: self.graphql_client.clone(),
2635        }
2636    }
2637    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2638    /// Be sure to set any exposed ports before calling this api.
2639    ///
2640    /// # Arguments
2641    ///
2642    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2643    pub async fn up(&self) -> Result<Void, DaggerError> {
2644        let query = self.selection.select("up");
2645        query.execute(self.graphql_client.clone()).await
2646    }
2647    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2648    /// Be sure to set any exposed ports before calling this api.
2649    ///
2650    /// # Arguments
2651    ///
2652    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2653    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2654        let mut query = self.selection.select("up");
2655        if let Some(random) = opts.random {
2656            query = query.arg("random", random);
2657        }
2658        if let Some(ports) = opts.ports {
2659            query = query.arg("ports", ports);
2660        }
2661        if let Some(args) = opts.args {
2662            query = query.arg("args", args);
2663        }
2664        if let Some(use_entrypoint) = opts.use_entrypoint {
2665            query = query.arg("useEntrypoint", use_entrypoint);
2666        }
2667        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2668            query = query.arg(
2669                "experimentalPrivilegedNesting",
2670                experimental_privileged_nesting,
2671            );
2672        }
2673        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2674            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2675        }
2676        if let Some(expand) = opts.expand {
2677            query = query.arg("expand", expand);
2678        }
2679        if let Some(no_init) = opts.no_init {
2680            query = query.arg("noInit", no_init);
2681        }
2682        query.execute(self.graphql_client.clone()).await
2683    }
2684    /// Retrieves the user to be set for all commands.
2685    pub async fn user(&self) -> Result<String, DaggerError> {
2686        let query = self.selection.select("user");
2687        query.execute(self.graphql_client.clone()).await
2688    }
2689    /// Retrieves this container plus the given OCI annotation.
2690    ///
2691    /// # Arguments
2692    ///
2693    /// * `name` - The name of the annotation.
2694    /// * `value` - The value of the annotation.
2695    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2696        let mut query = self.selection.select("withAnnotation");
2697        query = query.arg("name", name.into());
2698        query = query.arg("value", value.into());
2699        Container {
2700            proc: self.proc.clone(),
2701            selection: query,
2702            graphql_client: self.graphql_client.clone(),
2703        }
2704    }
2705    /// Configures default arguments for future commands. Like CMD in Dockerfile.
2706    ///
2707    /// # Arguments
2708    ///
2709    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
2710    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2711        let mut query = self.selection.select("withDefaultArgs");
2712        query = query.arg(
2713            "args",
2714            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2715        );
2716        Container {
2717            proc: self.proc.clone(),
2718            selection: query,
2719            graphql_client: self.graphql_client.clone(),
2720        }
2721    }
2722    /// Set the default command to invoke for the container's terminal API.
2723    ///
2724    /// # Arguments
2725    ///
2726    /// * `args` - The args of the command.
2727    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2728    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2729        let mut query = self.selection.select("withDefaultTerminalCmd");
2730        query = query.arg(
2731            "args",
2732            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2733        );
2734        Container {
2735            proc: self.proc.clone(),
2736            selection: query,
2737            graphql_client: self.graphql_client.clone(),
2738        }
2739    }
2740    /// Set the default command to invoke for the container's terminal API.
2741    ///
2742    /// # Arguments
2743    ///
2744    /// * `args` - The args of the command.
2745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2746    pub fn with_default_terminal_cmd_opts(
2747        &self,
2748        args: Vec<impl Into<String>>,
2749        opts: ContainerWithDefaultTerminalCmdOpts,
2750    ) -> Container {
2751        let mut query = self.selection.select("withDefaultTerminalCmd");
2752        query = query.arg(
2753            "args",
2754            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2755        );
2756        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2757            query = query.arg(
2758                "experimentalPrivilegedNesting",
2759                experimental_privileged_nesting,
2760            );
2761        }
2762        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2763            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2764        }
2765        Container {
2766            proc: self.proc.clone(),
2767            selection: query,
2768            graphql_client: self.graphql_client.clone(),
2769        }
2770    }
2771    /// Return a new container snapshot, with a directory added to its filesystem
2772    ///
2773    /// # Arguments
2774    ///
2775    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2776    /// * `source` - Identifier of the directory to write
2777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2778    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2779        let mut query = self.selection.select("withDirectory");
2780        query = query.arg("path", path.into());
2781        query = query.arg_lazy(
2782            "source",
2783            Box::new(move || {
2784                let source = source.clone();
2785                Box::pin(async move { source.into_id().await.unwrap().quote() })
2786            }),
2787        );
2788        Container {
2789            proc: self.proc.clone(),
2790            selection: query,
2791            graphql_client: self.graphql_client.clone(),
2792        }
2793    }
2794    /// Return a new container snapshot, with a directory added to its filesystem
2795    ///
2796    /// # Arguments
2797    ///
2798    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2799    /// * `source` - Identifier of the directory to write
2800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2801    pub fn with_directory_opts<'a>(
2802        &self,
2803        path: impl Into<String>,
2804        source: impl IntoID<Id>,
2805        opts: ContainerWithDirectoryOpts<'a>,
2806    ) -> Container {
2807        let mut query = self.selection.select("withDirectory");
2808        query = query.arg("path", path.into());
2809        query = query.arg_lazy(
2810            "source",
2811            Box::new(move || {
2812                let source = source.clone();
2813                Box::pin(async move { source.into_id().await.unwrap().quote() })
2814            }),
2815        );
2816        if let Some(exclude) = opts.exclude {
2817            query = query.arg("exclude", exclude);
2818        }
2819        if let Some(include) = opts.include {
2820            query = query.arg("include", include);
2821        }
2822        if let Some(gitignore) = opts.gitignore {
2823            query = query.arg("gitignore", gitignore);
2824        }
2825        if let Some(owner) = opts.owner {
2826            query = query.arg("owner", owner);
2827        }
2828        if let Some(inherit_owner) = opts.inherit_owner {
2829            query = query.arg("inheritOwner", inherit_owner);
2830        }
2831        if let Some(expand) = opts.expand {
2832            query = query.arg("expand", expand);
2833        }
2834        if let Some(permissions) = opts.permissions {
2835            query = query.arg("permissions", permissions);
2836        }
2837        Container {
2838            proc: self.proc.clone(),
2839            selection: query,
2840            graphql_client: self.graphql_client.clone(),
2841        }
2842    }
2843    /// Retrieves this container with the specificed docker healtcheck command set.
2844    ///
2845    /// # Arguments
2846    ///
2847    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2848    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2849    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2850        let mut query = self.selection.select("withDockerHealthcheck");
2851        query = query.arg(
2852            "args",
2853            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2854        );
2855        Container {
2856            proc: self.proc.clone(),
2857            selection: query,
2858            graphql_client: self.graphql_client.clone(),
2859        }
2860    }
2861    /// Retrieves this container with the specificed docker healtcheck command set.
2862    ///
2863    /// # Arguments
2864    ///
2865    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2866    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2867    pub fn with_docker_healthcheck_opts<'a>(
2868        &self,
2869        args: Vec<impl Into<String>>,
2870        opts: ContainerWithDockerHealthcheckOpts<'a>,
2871    ) -> Container {
2872        let mut query = self.selection.select("withDockerHealthcheck");
2873        query = query.arg(
2874            "args",
2875            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2876        );
2877        if let Some(shell) = opts.shell {
2878            query = query.arg("shell", shell);
2879        }
2880        if let Some(interval) = opts.interval {
2881            query = query.arg("interval", interval);
2882        }
2883        if let Some(timeout) = opts.timeout {
2884            query = query.arg("timeout", timeout);
2885        }
2886        if let Some(start_period) = opts.start_period {
2887            query = query.arg("startPeriod", start_period);
2888        }
2889        if let Some(start_interval) = opts.start_interval {
2890            query = query.arg("startInterval", start_interval);
2891        }
2892        if let Some(retries) = opts.retries {
2893            query = query.arg("retries", retries);
2894        }
2895        Container {
2896            proc: self.proc.clone(),
2897            selection: query,
2898            graphql_client: self.graphql_client.clone(),
2899        }
2900    }
2901    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2902    ///
2903    /// # Arguments
2904    ///
2905    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2906    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2907    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2908        let mut query = self.selection.select("withEntrypoint");
2909        query = query.arg(
2910            "args",
2911            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2912        );
2913        Container {
2914            proc: self.proc.clone(),
2915            selection: query,
2916            graphql_client: self.graphql_client.clone(),
2917        }
2918    }
2919    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2920    ///
2921    /// # Arguments
2922    ///
2923    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2925    pub fn with_entrypoint_opts(
2926        &self,
2927        args: Vec<impl Into<String>>,
2928        opts: ContainerWithEntrypointOpts,
2929    ) -> Container {
2930        let mut query = self.selection.select("withEntrypoint");
2931        query = query.arg(
2932            "args",
2933            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2934        );
2935        if let Some(keep_default_args) = opts.keep_default_args {
2936            query = query.arg("keepDefaultArgs", keep_default_args);
2937        }
2938        Container {
2939            proc: self.proc.clone(),
2940            selection: query,
2941            graphql_client: self.graphql_client.clone(),
2942        }
2943    }
2944    /// Export environment variables from an env-file to the container.
2945    ///
2946    /// # Arguments
2947    ///
2948    /// * `source` - Identifier of the envfile
2949    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2950        let mut query = self.selection.select("withEnvFileVariables");
2951        query = query.arg_lazy(
2952            "source",
2953            Box::new(move || {
2954                let source = source.clone();
2955                Box::pin(async move { source.into_id().await.unwrap().quote() })
2956            }),
2957        );
2958        Container {
2959            proc: self.proc.clone(),
2960            selection: query,
2961            graphql_client: self.graphql_client.clone(),
2962        }
2963    }
2964    /// Set a new environment variable in the container.
2965    ///
2966    /// # Arguments
2967    ///
2968    /// * `name` - Name of the environment variable (e.g., "HOST").
2969    /// * `value` - Value of the environment variable. (e.g., "localhost").
2970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2971    pub fn with_env_variable(
2972        &self,
2973        name: impl Into<String>,
2974        value: impl Into<String>,
2975    ) -> Container {
2976        let mut query = self.selection.select("withEnvVariable");
2977        query = query.arg("name", name.into());
2978        query = query.arg("value", value.into());
2979        Container {
2980            proc: self.proc.clone(),
2981            selection: query,
2982            graphql_client: self.graphql_client.clone(),
2983        }
2984    }
2985    /// Set a new environment variable in the container.
2986    ///
2987    /// # Arguments
2988    ///
2989    /// * `name` - Name of the environment variable (e.g., "HOST").
2990    /// * `value` - Value of the environment variable. (e.g., "localhost").
2991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2992    pub fn with_env_variable_opts(
2993        &self,
2994        name: impl Into<String>,
2995        value: impl Into<String>,
2996        opts: ContainerWithEnvVariableOpts,
2997    ) -> Container {
2998        let mut query = self.selection.select("withEnvVariable");
2999        query = query.arg("name", name.into());
3000        query = query.arg("value", value.into());
3001        if let Some(expand) = opts.expand {
3002            query = query.arg("expand", expand);
3003        }
3004        Container {
3005            proc: self.proc.clone(),
3006            selection: query,
3007            graphql_client: self.graphql_client.clone(),
3008        }
3009    }
3010    /// Raise an error.
3011    ///
3012    /// # Arguments
3013    ///
3014    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
3015    pub fn with_error(&self, err: impl Into<String>) -> Container {
3016        let mut query = self.selection.select("withError");
3017        query = query.arg("err", err.into());
3018        Container {
3019            proc: self.proc.clone(),
3020            selection: query,
3021            graphql_client: self.graphql_client.clone(),
3022        }
3023    }
3024    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3025    ///
3026    /// # Arguments
3027    ///
3028    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3029    ///
3030    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3031    ///
3032    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3033    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3034    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3035        let mut query = self.selection.select("withExec");
3036        query = query.arg(
3037            "args",
3038            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3039        );
3040        Container {
3041            proc: self.proc.clone(),
3042            selection: query,
3043            graphql_client: self.graphql_client.clone(),
3044        }
3045    }
3046    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3047    ///
3048    /// # Arguments
3049    ///
3050    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3051    ///
3052    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3053    ///
3054    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3055    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3056    pub fn with_exec_opts<'a>(
3057        &self,
3058        args: Vec<impl Into<String>>,
3059        opts: ContainerWithExecOpts<'a>,
3060    ) -> Container {
3061        let mut query = self.selection.select("withExec");
3062        query = query.arg(
3063            "args",
3064            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3065        );
3066        if let Some(use_entrypoint) = opts.use_entrypoint {
3067            query = query.arg("useEntrypoint", use_entrypoint);
3068        }
3069        if let Some(stdin) = opts.stdin {
3070            query = query.arg("stdin", stdin);
3071        }
3072        if let Some(redirect_stdin) = opts.redirect_stdin {
3073            query = query.arg("redirectStdin", redirect_stdin);
3074        }
3075        if let Some(redirect_stdout) = opts.redirect_stdout {
3076            query = query.arg("redirectStdout", redirect_stdout);
3077        }
3078        if let Some(redirect_stderr) = opts.redirect_stderr {
3079            query = query.arg("redirectStderr", redirect_stderr);
3080        }
3081        if let Some(expect) = opts.expect {
3082            query = query.arg("expect", expect);
3083        }
3084        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3085            query = query.arg(
3086                "experimentalPrivilegedNesting",
3087                experimental_privileged_nesting,
3088            );
3089        }
3090        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3091            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3092        }
3093        if let Some(expand) = opts.expand {
3094            query = query.arg("expand", expand);
3095        }
3096        if let Some(no_init) = opts.no_init {
3097            query = query.arg("noInit", no_init);
3098        }
3099        Container {
3100            proc: self.proc.clone(),
3101            selection: query,
3102            graphql_client: self.graphql_client.clone(),
3103        }
3104    }
3105    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3106    /// Exposed ports serve two purposes:
3107    /// - For health checks and introspection, when running services
3108    /// - For setting the EXPOSE OCI field when publishing the container
3109    ///
3110    /// # Arguments
3111    ///
3112    /// * `port` - Port number to expose. Example: 8080
3113    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3114    pub fn with_exposed_port(&self, port: isize) -> Container {
3115        let mut query = self.selection.select("withExposedPort");
3116        query = query.arg("port", port);
3117        Container {
3118            proc: self.proc.clone(),
3119            selection: query,
3120            graphql_client: self.graphql_client.clone(),
3121        }
3122    }
3123    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3124    /// Exposed ports serve two purposes:
3125    /// - For health checks and introspection, when running services
3126    /// - For setting the EXPOSE OCI field when publishing the container
3127    ///
3128    /// # Arguments
3129    ///
3130    /// * `port` - Port number to expose. Example: 8080
3131    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3132    pub fn with_exposed_port_opts<'a>(
3133        &self,
3134        port: isize,
3135        opts: ContainerWithExposedPortOpts<'a>,
3136    ) -> Container {
3137        let mut query = self.selection.select("withExposedPort");
3138        query = query.arg("port", port);
3139        if let Some(protocol) = opts.protocol {
3140            query = query.arg("protocol", protocol);
3141        }
3142        if let Some(description) = opts.description {
3143            query = query.arg("description", description);
3144        }
3145        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3146            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3147        }
3148        Container {
3149            proc: self.proc.clone(),
3150            selection: query,
3151            graphql_client: self.graphql_client.clone(),
3152        }
3153    }
3154    /// Return a container snapshot with a file added
3155    ///
3156    /// # Arguments
3157    ///
3158    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3159    /// * `source` - File to add
3160    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3161    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3162        let mut query = self.selection.select("withFile");
3163        query = query.arg("path", path.into());
3164        query = query.arg_lazy(
3165            "source",
3166            Box::new(move || {
3167                let source = source.clone();
3168                Box::pin(async move { source.into_id().await.unwrap().quote() })
3169            }),
3170        );
3171        Container {
3172            proc: self.proc.clone(),
3173            selection: query,
3174            graphql_client: self.graphql_client.clone(),
3175        }
3176    }
3177    /// Return a container snapshot with a file added
3178    ///
3179    /// # Arguments
3180    ///
3181    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3182    /// * `source` - File to add
3183    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3184    pub fn with_file_opts<'a>(
3185        &self,
3186        path: impl Into<String>,
3187        source: impl IntoID<Id>,
3188        opts: ContainerWithFileOpts<'a>,
3189    ) -> Container {
3190        let mut query = self.selection.select("withFile");
3191        query = query.arg("path", path.into());
3192        query = query.arg_lazy(
3193            "source",
3194            Box::new(move || {
3195                let source = source.clone();
3196                Box::pin(async move { source.into_id().await.unwrap().quote() })
3197            }),
3198        );
3199        if let Some(permissions) = opts.permissions {
3200            query = query.arg("permissions", permissions);
3201        }
3202        if let Some(owner) = opts.owner {
3203            query = query.arg("owner", owner);
3204        }
3205        if let Some(inherit_owner) = opts.inherit_owner {
3206            query = query.arg("inheritOwner", inherit_owner);
3207        }
3208        if let Some(expand) = opts.expand {
3209            query = query.arg("expand", expand);
3210        }
3211        Container {
3212            proc: self.proc.clone(),
3213            selection: query,
3214            graphql_client: self.graphql_client.clone(),
3215        }
3216    }
3217    /// Retrieves this container plus the contents of the given files copied to the given path.
3218    ///
3219    /// # Arguments
3220    ///
3221    /// * `path` - Location where copied files should be placed (e.g., "/src").
3222    /// * `sources` - Identifiers of the files to copy.
3223    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3224    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3225        let mut query = self.selection.select("withFiles");
3226        query = query.arg("path", path.into());
3227        query = query.arg("sources", sources);
3228        Container {
3229            proc: self.proc.clone(),
3230            selection: query,
3231            graphql_client: self.graphql_client.clone(),
3232        }
3233    }
3234    /// Retrieves this container plus the contents of the given files copied to the given path.
3235    ///
3236    /// # Arguments
3237    ///
3238    /// * `path` - Location where copied files should be placed (e.g., "/src").
3239    /// * `sources` - Identifiers of the files to copy.
3240    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3241    pub fn with_files_opts<'a>(
3242        &self,
3243        path: impl Into<String>,
3244        sources: Vec<Id>,
3245        opts: ContainerWithFilesOpts<'a>,
3246    ) -> Container {
3247        let mut query = self.selection.select("withFiles");
3248        query = query.arg("path", path.into());
3249        query = query.arg("sources", sources);
3250        if let Some(permissions) = opts.permissions {
3251            query = query.arg("permissions", permissions);
3252        }
3253        if let Some(owner) = opts.owner {
3254            query = query.arg("owner", owner);
3255        }
3256        if let Some(inherit_owner) = opts.inherit_owner {
3257            query = query.arg("inheritOwner", inherit_owner);
3258        }
3259        if let Some(expand) = opts.expand {
3260            query = query.arg("expand", expand);
3261        }
3262        Container {
3263            proc: self.proc.clone(),
3264            selection: query,
3265            graphql_client: self.graphql_client.clone(),
3266        }
3267    }
3268    /// Retrieves this container plus the given label.
3269    ///
3270    /// # Arguments
3271    ///
3272    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3273    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3274    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3275        let mut query = self.selection.select("withLabel");
3276        query = query.arg("name", name.into());
3277        query = query.arg("value", value.into());
3278        Container {
3279            proc: self.proc.clone(),
3280            selection: query,
3281            graphql_client: self.graphql_client.clone(),
3282        }
3283    }
3284    /// Retrieves this container plus a cache volume mounted at the given path.
3285    ///
3286    /// # Arguments
3287    ///
3288    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3289    /// * `cache` - Identifier of the cache volume to mount.
3290    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3291    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3292        let mut query = self.selection.select("withMountedCache");
3293        query = query.arg("path", path.into());
3294        query = query.arg_lazy(
3295            "cache",
3296            Box::new(move || {
3297                let cache = cache.clone();
3298                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3299            }),
3300        );
3301        Container {
3302            proc: self.proc.clone(),
3303            selection: query,
3304            graphql_client: self.graphql_client.clone(),
3305        }
3306    }
3307    /// Retrieves this container plus a cache volume mounted at the given path.
3308    ///
3309    /// # Arguments
3310    ///
3311    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3312    /// * `cache` - Identifier of the cache volume to mount.
3313    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3314    pub fn with_mounted_cache_opts<'a>(
3315        &self,
3316        path: impl Into<String>,
3317        cache: impl IntoID<Id>,
3318        opts: ContainerWithMountedCacheOpts<'a>,
3319    ) -> Container {
3320        let mut query = self.selection.select("withMountedCache");
3321        query = query.arg("path", path.into());
3322        query = query.arg_lazy(
3323            "cache",
3324            Box::new(move || {
3325                let cache = cache.clone();
3326                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3327            }),
3328        );
3329        if let Some(source) = opts.source {
3330            query = query.arg("source", source);
3331        }
3332        if let Some(sharing) = opts.sharing {
3333            query = query.arg("sharing", sharing);
3334        }
3335        if let Some(owner) = opts.owner {
3336            query = query.arg("owner", owner);
3337        }
3338        if let Some(inherit_owner) = opts.inherit_owner {
3339            query = query.arg("inheritOwner", inherit_owner);
3340        }
3341        if let Some(expand) = opts.expand {
3342            query = query.arg("expand", expand);
3343        }
3344        Container {
3345            proc: self.proc.clone(),
3346            selection: query,
3347            graphql_client: self.graphql_client.clone(),
3348        }
3349    }
3350    /// Retrieves this container plus a directory mounted at the given path.
3351    ///
3352    /// # Arguments
3353    ///
3354    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3355    /// * `source` - Identifier of the mounted directory.
3356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3357    pub fn with_mounted_directory(
3358        &self,
3359        path: impl Into<String>,
3360        source: impl IntoID<Id>,
3361    ) -> Container {
3362        let mut query = self.selection.select("withMountedDirectory");
3363        query = query.arg("path", path.into());
3364        query = query.arg_lazy(
3365            "source",
3366            Box::new(move || {
3367                let source = source.clone();
3368                Box::pin(async move { source.into_id().await.unwrap().quote() })
3369            }),
3370        );
3371        Container {
3372            proc: self.proc.clone(),
3373            selection: query,
3374            graphql_client: self.graphql_client.clone(),
3375        }
3376    }
3377    /// Retrieves this container plus a directory mounted at the given path.
3378    ///
3379    /// # Arguments
3380    ///
3381    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3382    /// * `source` - Identifier of the mounted directory.
3383    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3384    pub fn with_mounted_directory_opts<'a>(
3385        &self,
3386        path: impl Into<String>,
3387        source: impl IntoID<Id>,
3388        opts: ContainerWithMountedDirectoryOpts<'a>,
3389    ) -> Container {
3390        let mut query = self.selection.select("withMountedDirectory");
3391        query = query.arg("path", path.into());
3392        query = query.arg_lazy(
3393            "source",
3394            Box::new(move || {
3395                let source = source.clone();
3396                Box::pin(async move { source.into_id().await.unwrap().quote() })
3397            }),
3398        );
3399        if let Some(owner) = opts.owner {
3400            query = query.arg("owner", owner);
3401        }
3402        if let Some(inherit_owner) = opts.inherit_owner {
3403            query = query.arg("inheritOwner", inherit_owner);
3404        }
3405        if let Some(read_only) = opts.read_only {
3406            query = query.arg("readOnly", read_only);
3407        }
3408        if let Some(expand) = opts.expand {
3409            query = query.arg("expand", expand);
3410        }
3411        Container {
3412            proc: self.proc.clone(),
3413            selection: query,
3414            graphql_client: self.graphql_client.clone(),
3415        }
3416    }
3417    /// Retrieves this container plus a file mounted at the given path.
3418    ///
3419    /// # Arguments
3420    ///
3421    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3422    /// * `source` - Identifier of the mounted file.
3423    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3424    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3425        let mut query = self.selection.select("withMountedFile");
3426        query = query.arg("path", path.into());
3427        query = query.arg_lazy(
3428            "source",
3429            Box::new(move || {
3430                let source = source.clone();
3431                Box::pin(async move { source.into_id().await.unwrap().quote() })
3432            }),
3433        );
3434        Container {
3435            proc: self.proc.clone(),
3436            selection: query,
3437            graphql_client: self.graphql_client.clone(),
3438        }
3439    }
3440    /// Retrieves this container plus a file mounted at the given path.
3441    ///
3442    /// # Arguments
3443    ///
3444    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3445    /// * `source` - Identifier of the mounted file.
3446    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3447    pub fn with_mounted_file_opts<'a>(
3448        &self,
3449        path: impl Into<String>,
3450        source: impl IntoID<Id>,
3451        opts: ContainerWithMountedFileOpts<'a>,
3452    ) -> Container {
3453        let mut query = self.selection.select("withMountedFile");
3454        query = query.arg("path", path.into());
3455        query = query.arg_lazy(
3456            "source",
3457            Box::new(move || {
3458                let source = source.clone();
3459                Box::pin(async move { source.into_id().await.unwrap().quote() })
3460            }),
3461        );
3462        if let Some(owner) = opts.owner {
3463            query = query.arg("owner", owner);
3464        }
3465        if let Some(inherit_owner) = opts.inherit_owner {
3466            query = query.arg("inheritOwner", inherit_owner);
3467        }
3468        if let Some(expand) = opts.expand {
3469            query = query.arg("expand", expand);
3470        }
3471        Container {
3472            proc: self.proc.clone(),
3473            selection: query,
3474            graphql_client: self.graphql_client.clone(),
3475        }
3476    }
3477    /// Retrieves this container plus a secret mounted into a file at the given path.
3478    ///
3479    /// # Arguments
3480    ///
3481    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3482    /// * `source` - Identifier of the secret to mount.
3483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3484    pub fn with_mounted_secret(
3485        &self,
3486        path: impl Into<String>,
3487        source: impl IntoID<Id>,
3488    ) -> Container {
3489        let mut query = self.selection.select("withMountedSecret");
3490        query = query.arg("path", path.into());
3491        query = query.arg_lazy(
3492            "source",
3493            Box::new(move || {
3494                let source = source.clone();
3495                Box::pin(async move { source.into_id().await.unwrap().quote() })
3496            }),
3497        );
3498        Container {
3499            proc: self.proc.clone(),
3500            selection: query,
3501            graphql_client: self.graphql_client.clone(),
3502        }
3503    }
3504    /// Retrieves this container plus a secret mounted into a file at the given path.
3505    ///
3506    /// # Arguments
3507    ///
3508    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3509    /// * `source` - Identifier of the secret to mount.
3510    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3511    pub fn with_mounted_secret_opts<'a>(
3512        &self,
3513        path: impl Into<String>,
3514        source: impl IntoID<Id>,
3515        opts: ContainerWithMountedSecretOpts<'a>,
3516    ) -> Container {
3517        let mut query = self.selection.select("withMountedSecret");
3518        query = query.arg("path", path.into());
3519        query = query.arg_lazy(
3520            "source",
3521            Box::new(move || {
3522                let source = source.clone();
3523                Box::pin(async move { source.into_id().await.unwrap().quote() })
3524            }),
3525        );
3526        if let Some(owner) = opts.owner {
3527            query = query.arg("owner", owner);
3528        }
3529        if let Some(inherit_owner) = opts.inherit_owner {
3530            query = query.arg("inheritOwner", inherit_owner);
3531        }
3532        if let Some(mode) = opts.mode {
3533            query = query.arg("mode", mode);
3534        }
3535        if let Some(expand) = opts.expand {
3536            query = query.arg("expand", expand);
3537        }
3538        Container {
3539            proc: self.proc.clone(),
3540            selection: query,
3541            graphql_client: self.graphql_client.clone(),
3542        }
3543    }
3544    /// 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.
3545    ///
3546    /// # Arguments
3547    ///
3548    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3550    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3551        let mut query = self.selection.select("withMountedTemp");
3552        query = query.arg("path", path.into());
3553        Container {
3554            proc: self.proc.clone(),
3555            selection: query,
3556            graphql_client: self.graphql_client.clone(),
3557        }
3558    }
3559    /// 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.
3560    ///
3561    /// # Arguments
3562    ///
3563    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3564    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3565    pub fn with_mounted_temp_opts(
3566        &self,
3567        path: impl Into<String>,
3568        opts: ContainerWithMountedTempOpts,
3569    ) -> Container {
3570        let mut query = self.selection.select("withMountedTemp");
3571        query = query.arg("path", path.into());
3572        if let Some(size) = opts.size {
3573            query = query.arg("size", size);
3574        }
3575        if let Some(expand) = opts.expand {
3576            query = query.arg("expand", expand);
3577        }
3578        Container {
3579            proc: self.proc.clone(),
3580            selection: query,
3581            graphql_client: self.graphql_client.clone(),
3582        }
3583    }
3584    /// Retrieves this container plus a volume mounted at the given path.
3585    ///
3586    /// # Arguments
3587    ///
3588    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
3589    /// * `volume` - Identifier of the volume to mount.
3590    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3591    pub fn with_mounted_volume(
3592        &self,
3593        path: impl Into<String>,
3594        volume: impl IntoID<Id>,
3595    ) -> Container {
3596        let mut query = self.selection.select("withMountedVolume");
3597        query = query.arg("path", path.into());
3598        query = query.arg_lazy(
3599            "volume",
3600            Box::new(move || {
3601                let volume = volume.clone();
3602                Box::pin(async move { volume.into_id().await.unwrap().quote() })
3603            }),
3604        );
3605        Container {
3606            proc: self.proc.clone(),
3607            selection: query,
3608            graphql_client: self.graphql_client.clone(),
3609        }
3610    }
3611    /// Retrieves this container plus a volume mounted at the given path.
3612    ///
3613    /// # Arguments
3614    ///
3615    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
3616    /// * `volume` - Identifier of the volume to mount.
3617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3618    pub fn with_mounted_volume_opts(
3619        &self,
3620        path: impl Into<String>,
3621        volume: impl IntoID<Id>,
3622        opts: ContainerWithMountedVolumeOpts,
3623    ) -> Container {
3624        let mut query = self.selection.select("withMountedVolume");
3625        query = query.arg("path", path.into());
3626        query = query.arg_lazy(
3627            "volume",
3628            Box::new(move || {
3629                let volume = volume.clone();
3630                Box::pin(async move { volume.into_id().await.unwrap().quote() })
3631            }),
3632        );
3633        if let Some(read_only) = opts.read_only {
3634            query = query.arg("readOnly", read_only);
3635        }
3636        if let Some(expand) = opts.expand {
3637            query = query.arg("expand", expand);
3638        }
3639        Container {
3640            proc: self.proc.clone(),
3641            selection: query,
3642            graphql_client: self.graphql_client.clone(),
3643        }
3644    }
3645    /// Return a new container snapshot, with a file added to its filesystem with text content
3646    ///
3647    /// # Arguments
3648    ///
3649    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3650    /// * `contents` - Contents of the new file. Example: "Hello world!"
3651    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3652    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3653        let mut query = self.selection.select("withNewFile");
3654        query = query.arg("path", path.into());
3655        query = query.arg("contents", contents.into());
3656        Container {
3657            proc: self.proc.clone(),
3658            selection: query,
3659            graphql_client: self.graphql_client.clone(),
3660        }
3661    }
3662    /// Return a new container snapshot, with a file added to its filesystem with text content
3663    ///
3664    /// # Arguments
3665    ///
3666    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3667    /// * `contents` - Contents of the new file. Example: "Hello world!"
3668    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3669    pub fn with_new_file_opts<'a>(
3670        &self,
3671        path: impl Into<String>,
3672        contents: impl Into<String>,
3673        opts: ContainerWithNewFileOpts<'a>,
3674    ) -> Container {
3675        let mut query = self.selection.select("withNewFile");
3676        query = query.arg("path", path.into());
3677        query = query.arg("contents", contents.into());
3678        if let Some(permissions) = opts.permissions {
3679            query = query.arg("permissions", permissions);
3680        }
3681        if let Some(owner) = opts.owner {
3682            query = query.arg("owner", owner);
3683        }
3684        if let Some(inherit_owner) = opts.inherit_owner {
3685            query = query.arg("inheritOwner", inherit_owner);
3686        }
3687        if let Some(expand) = opts.expand {
3688            query = query.arg("expand", expand);
3689        }
3690        Container {
3691            proc: self.proc.clone(),
3692            selection: query,
3693            graphql_client: self.graphql_client.clone(),
3694        }
3695    }
3696    /// Attach credentials for future publishing to a registry. Use in combination with publish
3697    ///
3698    /// # Arguments
3699    ///
3700    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
3701    /// * `username` - The username to authenticate with. Example: "alice"
3702    /// * `secret` - The API key, password or token to authenticate to this registry
3703    pub fn with_registry_auth(
3704        &self,
3705        address: impl Into<String>,
3706        username: impl Into<String>,
3707        secret: impl IntoID<Id>,
3708    ) -> Container {
3709        let mut query = self.selection.select("withRegistryAuth");
3710        query = query.arg("address", address.into());
3711        query = query.arg("username", username.into());
3712        query = query.arg_lazy(
3713            "secret",
3714            Box::new(move || {
3715                let secret = secret.clone();
3716                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3717            }),
3718        );
3719        Container {
3720            proc: self.proc.clone(),
3721            selection: query,
3722            graphql_client: self.graphql_client.clone(),
3723        }
3724    }
3725    /// Change the container's root filesystem. The previous root filesystem will be lost.
3726    ///
3727    /// # Arguments
3728    ///
3729    /// * `directory` - The new root filesystem.
3730    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3731        let mut query = self.selection.select("withRootfs");
3732        query = query.arg_lazy(
3733            "directory",
3734            Box::new(move || {
3735                let directory = directory.clone();
3736                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3737            }),
3738        );
3739        Container {
3740            proc: self.proc.clone(),
3741            selection: query,
3742            graphql_client: self.graphql_client.clone(),
3743        }
3744    }
3745    /// Set a new environment variable, using a secret value
3746    ///
3747    /// # Arguments
3748    ///
3749    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3750    /// * `secret` - Identifier of the secret value.
3751    pub fn with_secret_variable(
3752        &self,
3753        name: impl Into<String>,
3754        secret: impl IntoID<Id>,
3755    ) -> Container {
3756        let mut query = self.selection.select("withSecretVariable");
3757        query = query.arg("name", name.into());
3758        query = query.arg_lazy(
3759            "secret",
3760            Box::new(move || {
3761                let secret = secret.clone();
3762                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3763            }),
3764        );
3765        Container {
3766            proc: self.proc.clone(),
3767            selection: query,
3768            graphql_client: self.graphql_client.clone(),
3769        }
3770    }
3771    /// Establish a runtime dependency from a container to a network service.
3772    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3773    /// The service will be reachable from the container via the provided hostname alias.
3774    /// The service dependency will also convey to any files or directories produced by the container.
3775    ///
3776    /// # Arguments
3777    ///
3778    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
3779    /// * `service` - The target service
3780    pub fn with_service_binding(
3781        &self,
3782        alias: impl Into<String>,
3783        service: impl IntoID<Id>,
3784    ) -> Container {
3785        let mut query = self.selection.select("withServiceBinding");
3786        query = query.arg("alias", alias.into());
3787        query = query.arg_lazy(
3788            "service",
3789            Box::new(move || {
3790                let service = service.clone();
3791                Box::pin(async move { service.into_id().await.unwrap().quote() })
3792            }),
3793        );
3794        Container {
3795            proc: self.proc.clone(),
3796            selection: query,
3797            graphql_client: self.graphql_client.clone(),
3798        }
3799    }
3800    /// Return a snapshot with a symlink
3801    ///
3802    /// # Arguments
3803    ///
3804    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3805    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3806    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3807    pub fn with_symlink(
3808        &self,
3809        target: impl Into<String>,
3810        link_name: impl Into<String>,
3811    ) -> Container {
3812        let mut query = self.selection.select("withSymlink");
3813        query = query.arg("target", target.into());
3814        query = query.arg("linkName", link_name.into());
3815        Container {
3816            proc: self.proc.clone(),
3817            selection: query,
3818            graphql_client: self.graphql_client.clone(),
3819        }
3820    }
3821    /// Return a snapshot with a symlink
3822    ///
3823    /// # Arguments
3824    ///
3825    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3826    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3827    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3828    pub fn with_symlink_opts(
3829        &self,
3830        target: impl Into<String>,
3831        link_name: impl Into<String>,
3832        opts: ContainerWithSymlinkOpts,
3833    ) -> Container {
3834        let mut query = self.selection.select("withSymlink");
3835        query = query.arg("target", target.into());
3836        query = query.arg("linkName", link_name.into());
3837        if let Some(expand) = opts.expand {
3838            query = query.arg("expand", expand);
3839        }
3840        Container {
3841            proc: self.proc.clone(),
3842            selection: query,
3843            graphql_client: self.graphql_client.clone(),
3844        }
3845    }
3846    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3847    ///
3848    /// # Arguments
3849    ///
3850    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3851    /// * `source` - Identifier of the socket to forward.
3852    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3853    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3854        let mut query = self.selection.select("withUnixSocket");
3855        query = query.arg("path", path.into());
3856        query = query.arg_lazy(
3857            "source",
3858            Box::new(move || {
3859                let source = source.clone();
3860                Box::pin(async move { source.into_id().await.unwrap().quote() })
3861            }),
3862        );
3863        Container {
3864            proc: self.proc.clone(),
3865            selection: query,
3866            graphql_client: self.graphql_client.clone(),
3867        }
3868    }
3869    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3870    ///
3871    /// # Arguments
3872    ///
3873    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3874    /// * `source` - Identifier of the socket to forward.
3875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3876    pub fn with_unix_socket_opts<'a>(
3877        &self,
3878        path: impl Into<String>,
3879        source: impl IntoID<Id>,
3880        opts: ContainerWithUnixSocketOpts<'a>,
3881    ) -> Container {
3882        let mut query = self.selection.select("withUnixSocket");
3883        query = query.arg("path", path.into());
3884        query = query.arg_lazy(
3885            "source",
3886            Box::new(move || {
3887                let source = source.clone();
3888                Box::pin(async move { source.into_id().await.unwrap().quote() })
3889            }),
3890        );
3891        if let Some(owner) = opts.owner {
3892            query = query.arg("owner", owner);
3893        }
3894        if let Some(inherit_owner) = opts.inherit_owner {
3895            query = query.arg("inheritOwner", inherit_owner);
3896        }
3897        if let Some(expand) = opts.expand {
3898            query = query.arg("expand", expand);
3899        }
3900        Container {
3901            proc: self.proc.clone(),
3902            selection: query,
3903            graphql_client: self.graphql_client.clone(),
3904        }
3905    }
3906    /// Retrieves this container with a different command user.
3907    ///
3908    /// # Arguments
3909    ///
3910    /// * `name` - The user to set (e.g., "root").
3911    pub fn with_user(&self, name: impl Into<String>) -> Container {
3912        let mut query = self.selection.select("withUser");
3913        query = query.arg("name", name.into());
3914        Container {
3915            proc: self.proc.clone(),
3916            selection: query,
3917            graphql_client: self.graphql_client.clone(),
3918        }
3919    }
3920    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
3921    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
3922    ///
3923    /// # Arguments
3924    ///
3925    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
3926    /// * `value` - Value of the volatile variable.
3927    pub fn with_volatile_variable(
3928        &self,
3929        name: impl Into<String>,
3930        value: impl Into<String>,
3931    ) -> Container {
3932        let mut query = self.selection.select("withVolatileVariable");
3933        query = query.arg("name", name.into());
3934        query = query.arg("value", value.into());
3935        Container {
3936            proc: self.proc.clone(),
3937            selection: query,
3938            graphql_client: self.graphql_client.clone(),
3939        }
3940    }
3941    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3942    ///
3943    /// # Arguments
3944    ///
3945    /// * `path` - The path to set as the working directory (e.g., "/app").
3946    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3947    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3948        let mut query = self.selection.select("withWorkdir");
3949        query = query.arg("path", path.into());
3950        Container {
3951            proc: self.proc.clone(),
3952            selection: query,
3953            graphql_client: self.graphql_client.clone(),
3954        }
3955    }
3956    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3957    ///
3958    /// # Arguments
3959    ///
3960    /// * `path` - The path to set as the working directory (e.g., "/app").
3961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3962    pub fn with_workdir_opts(
3963        &self,
3964        path: impl Into<String>,
3965        opts: ContainerWithWorkdirOpts,
3966    ) -> Container {
3967        let mut query = self.selection.select("withWorkdir");
3968        query = query.arg("path", path.into());
3969        if let Some(expand) = opts.expand {
3970            query = query.arg("expand", expand);
3971        }
3972        Container {
3973            proc: self.proc.clone(),
3974            selection: query,
3975            graphql_client: self.graphql_client.clone(),
3976        }
3977    }
3978    /// Retrieves this container minus the given OCI annotation.
3979    ///
3980    /// # Arguments
3981    ///
3982    /// * `name` - The name of the annotation.
3983    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3984        let mut query = self.selection.select("withoutAnnotation");
3985        query = query.arg("name", name.into());
3986        Container {
3987            proc: self.proc.clone(),
3988            selection: query,
3989            graphql_client: self.graphql_client.clone(),
3990        }
3991    }
3992    /// Remove the container's default arguments.
3993    pub fn without_default_args(&self) -> Container {
3994        let query = self.selection.select("withoutDefaultArgs");
3995        Container {
3996            proc: self.proc.clone(),
3997            selection: query,
3998            graphql_client: self.graphql_client.clone(),
3999        }
4000    }
4001    /// Return a new container snapshot, with a directory removed from its filesystem
4002    ///
4003    /// # Arguments
4004    ///
4005    /// * `path` - Location of the directory to remove (e.g., ".github/").
4006    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4007    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4008        let mut query = self.selection.select("withoutDirectory");
4009        query = query.arg("path", path.into());
4010        Container {
4011            proc: self.proc.clone(),
4012            selection: query,
4013            graphql_client: self.graphql_client.clone(),
4014        }
4015    }
4016    /// Return a new container snapshot, with a directory removed from its filesystem
4017    ///
4018    /// # Arguments
4019    ///
4020    /// * `path` - Location of the directory to remove (e.g., ".github/").
4021    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4022    pub fn without_directory_opts(
4023        &self,
4024        path: impl Into<String>,
4025        opts: ContainerWithoutDirectoryOpts,
4026    ) -> Container {
4027        let mut query = self.selection.select("withoutDirectory");
4028        query = query.arg("path", path.into());
4029        if let Some(expand) = opts.expand {
4030            query = query.arg("expand", expand);
4031        }
4032        Container {
4033            proc: self.proc.clone(),
4034            selection: query,
4035            graphql_client: self.graphql_client.clone(),
4036        }
4037    }
4038    /// Retrieves this container without a configured docker healtcheck command.
4039    pub fn without_docker_healthcheck(&self) -> Container {
4040        let query = self.selection.select("withoutDockerHealthcheck");
4041        Container {
4042            proc: self.proc.clone(),
4043            selection: query,
4044            graphql_client: self.graphql_client.clone(),
4045        }
4046    }
4047    /// Reset the container's OCI entrypoint.
4048    ///
4049    /// # Arguments
4050    ///
4051    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4052    pub fn without_entrypoint(&self) -> Container {
4053        let query = self.selection.select("withoutEntrypoint");
4054        Container {
4055            proc: self.proc.clone(),
4056            selection: query,
4057            graphql_client: self.graphql_client.clone(),
4058        }
4059    }
4060    /// Reset the container's OCI entrypoint.
4061    ///
4062    /// # Arguments
4063    ///
4064    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4065    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4066        let mut query = self.selection.select("withoutEntrypoint");
4067        if let Some(keep_default_args) = opts.keep_default_args {
4068            query = query.arg("keepDefaultArgs", keep_default_args);
4069        }
4070        Container {
4071            proc: self.proc.clone(),
4072            selection: query,
4073            graphql_client: self.graphql_client.clone(),
4074        }
4075    }
4076    /// Retrieves this container minus the given environment variable.
4077    ///
4078    /// # Arguments
4079    ///
4080    /// * `name` - The name of the environment variable (e.g., "HOST").
4081    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4082        let mut query = self.selection.select("withoutEnvVariable");
4083        query = query.arg("name", name.into());
4084        Container {
4085            proc: self.proc.clone(),
4086            selection: query,
4087            graphql_client: self.graphql_client.clone(),
4088        }
4089    }
4090    /// Unexpose a previously exposed port.
4091    ///
4092    /// # Arguments
4093    ///
4094    /// * `port` - Port number to unexpose
4095    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4096    pub fn without_exposed_port(&self, port: isize) -> Container {
4097        let mut query = self.selection.select("withoutExposedPort");
4098        query = query.arg("port", port);
4099        Container {
4100            proc: self.proc.clone(),
4101            selection: query,
4102            graphql_client: self.graphql_client.clone(),
4103        }
4104    }
4105    /// Unexpose a previously exposed port.
4106    ///
4107    /// # Arguments
4108    ///
4109    /// * `port` - Port number to unexpose
4110    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4111    pub fn without_exposed_port_opts(
4112        &self,
4113        port: isize,
4114        opts: ContainerWithoutExposedPortOpts,
4115    ) -> Container {
4116        let mut query = self.selection.select("withoutExposedPort");
4117        query = query.arg("port", port);
4118        if let Some(protocol) = opts.protocol {
4119            query = query.arg("protocol", protocol);
4120        }
4121        Container {
4122            proc: self.proc.clone(),
4123            selection: query,
4124            graphql_client: self.graphql_client.clone(),
4125        }
4126    }
4127    /// Retrieves this container with the file at the given path removed.
4128    ///
4129    /// # Arguments
4130    ///
4131    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4133    pub fn without_file(&self, path: impl Into<String>) -> Container {
4134        let mut query = self.selection.select("withoutFile");
4135        query = query.arg("path", path.into());
4136        Container {
4137            proc: self.proc.clone(),
4138            selection: query,
4139            graphql_client: self.graphql_client.clone(),
4140        }
4141    }
4142    /// Retrieves this container with the file at the given path removed.
4143    ///
4144    /// # Arguments
4145    ///
4146    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4147    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4148    pub fn without_file_opts(
4149        &self,
4150        path: impl Into<String>,
4151        opts: ContainerWithoutFileOpts,
4152    ) -> Container {
4153        let mut query = self.selection.select("withoutFile");
4154        query = query.arg("path", path.into());
4155        if let Some(expand) = opts.expand {
4156            query = query.arg("expand", expand);
4157        }
4158        Container {
4159            proc: self.proc.clone(),
4160            selection: query,
4161            graphql_client: self.graphql_client.clone(),
4162        }
4163    }
4164    /// Return a new container spanshot with specified files removed
4165    ///
4166    /// # Arguments
4167    ///
4168    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4169    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4170    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4171        let mut query = self.selection.select("withoutFiles");
4172        query = query.arg(
4173            "paths",
4174            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4175        );
4176        Container {
4177            proc: self.proc.clone(),
4178            selection: query,
4179            graphql_client: self.graphql_client.clone(),
4180        }
4181    }
4182    /// Return a new container spanshot with specified files removed
4183    ///
4184    /// # Arguments
4185    ///
4186    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4187    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4188    pub fn without_files_opts(
4189        &self,
4190        paths: Vec<impl Into<String>>,
4191        opts: ContainerWithoutFilesOpts,
4192    ) -> Container {
4193        let mut query = self.selection.select("withoutFiles");
4194        query = query.arg(
4195            "paths",
4196            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4197        );
4198        if let Some(expand) = opts.expand {
4199            query = query.arg("expand", expand);
4200        }
4201        Container {
4202            proc: self.proc.clone(),
4203            selection: query,
4204            graphql_client: self.graphql_client.clone(),
4205        }
4206    }
4207    /// Retrieves this container minus the given environment label.
4208    ///
4209    /// # Arguments
4210    ///
4211    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4212    pub fn without_label(&self, name: impl Into<String>) -> Container {
4213        let mut query = self.selection.select("withoutLabel");
4214        query = query.arg("name", name.into());
4215        Container {
4216            proc: self.proc.clone(),
4217            selection: query,
4218            graphql_client: self.graphql_client.clone(),
4219        }
4220    }
4221    /// Retrieves this container after unmounting everything at the given path.
4222    ///
4223    /// # Arguments
4224    ///
4225    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4226    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4227    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4228        let mut query = self.selection.select("withoutMount");
4229        query = query.arg("path", path.into());
4230        Container {
4231            proc: self.proc.clone(),
4232            selection: query,
4233            graphql_client: self.graphql_client.clone(),
4234        }
4235    }
4236    /// Retrieves this container after unmounting everything at the given path.
4237    ///
4238    /// # Arguments
4239    ///
4240    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4241    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4242    pub fn without_mount_opts(
4243        &self,
4244        path: impl Into<String>,
4245        opts: ContainerWithoutMountOpts,
4246    ) -> Container {
4247        let mut query = self.selection.select("withoutMount");
4248        query = query.arg("path", path.into());
4249        if let Some(expand) = opts.expand {
4250            query = query.arg("expand", expand);
4251        }
4252        Container {
4253            proc: self.proc.clone(),
4254            selection: query,
4255            graphql_client: self.graphql_client.clone(),
4256        }
4257    }
4258    /// Retrieves this container without the registry authentication of a given address.
4259    ///
4260    /// # Arguments
4261    ///
4262    /// * `address` - Registry's address to remove the authentication from.
4263    ///
4264    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4265    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4266        let mut query = self.selection.select("withoutRegistryAuth");
4267        query = query.arg("address", address.into());
4268        Container {
4269            proc: self.proc.clone(),
4270            selection: query,
4271            graphql_client: self.graphql_client.clone(),
4272        }
4273    }
4274    /// Retrieves this container minus the given environment variable containing the secret.
4275    ///
4276    /// # Arguments
4277    ///
4278    /// * `name` - The name of the environment variable (e.g., "HOST").
4279    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4280        let mut query = self.selection.select("withoutSecretVariable");
4281        query = query.arg("name", name.into());
4282        Container {
4283            proc: self.proc.clone(),
4284            selection: query,
4285            graphql_client: self.graphql_client.clone(),
4286        }
4287    }
4288    /// Retrieves this container with a previously added Unix socket removed.
4289    ///
4290    /// # Arguments
4291    ///
4292    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4293    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4294    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4295        let mut query = self.selection.select("withoutUnixSocket");
4296        query = query.arg("path", path.into());
4297        Container {
4298            proc: self.proc.clone(),
4299            selection: query,
4300            graphql_client: self.graphql_client.clone(),
4301        }
4302    }
4303    /// Retrieves this container with a previously added Unix socket removed.
4304    ///
4305    /// # Arguments
4306    ///
4307    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4309    pub fn without_unix_socket_opts(
4310        &self,
4311        path: impl Into<String>,
4312        opts: ContainerWithoutUnixSocketOpts,
4313    ) -> Container {
4314        let mut query = self.selection.select("withoutUnixSocket");
4315        query = query.arg("path", path.into());
4316        if let Some(expand) = opts.expand {
4317            query = query.arg("expand", expand);
4318        }
4319        Container {
4320            proc: self.proc.clone(),
4321            selection: query,
4322            graphql_client: self.graphql_client.clone(),
4323        }
4324    }
4325    /// Retrieves this container with an unset command user.
4326    /// Should default to root.
4327    pub fn without_user(&self) -> Container {
4328        let query = self.selection.select("withoutUser");
4329        Container {
4330            proc: self.proc.clone(),
4331            selection: query,
4332            graphql_client: self.graphql_client.clone(),
4333        }
4334    }
4335    /// Retrieves this container minus the given volatile environment variable.
4336    ///
4337    /// # Arguments
4338    ///
4339    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4340    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4341        let mut query = self.selection.select("withoutVolatileVariable");
4342        query = query.arg("name", name.into());
4343        Container {
4344            proc: self.proc.clone(),
4345            selection: query,
4346            graphql_client: self.graphql_client.clone(),
4347        }
4348    }
4349    /// Unset the container's working directory.
4350    /// Should default to "/".
4351    pub fn without_workdir(&self) -> Container {
4352        let query = self.selection.select("withoutWorkdir");
4353        Container {
4354            proc: self.proc.clone(),
4355            selection: query,
4356            graphql_client: self.graphql_client.clone(),
4357        }
4358    }
4359    /// Retrieves the working directory for all commands.
4360    pub async fn workdir(&self) -> Result<String, DaggerError> {
4361        let query = self.selection.select("workdir");
4362        query.execute(self.graphql_client.clone()).await
4363    }
4364}
4365impl Exportable for Container {
4366    fn export(
4367        &self,
4368        path: impl Into<String>,
4369    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4370        let mut query = self.selection.select("export");
4371        query = query.arg("path", path.into());
4372        let graphql_client = self.graphql_client.clone();
4373        async move { query.execute(graphql_client).await }
4374    }
4375    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4376        let query = self.selection.select("id");
4377        let graphql_client = self.graphql_client.clone();
4378        async move { query.execute(graphql_client).await }
4379    }
4380}
4381impl Node for Container {
4382    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4383        let query = self.selection.select("id");
4384        let graphql_client = self.graphql_client.clone();
4385        async move { query.execute(graphql_client).await }
4386    }
4387}
4388impl Syncer for Container {
4389    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4390        let query = self.selection.select("id");
4391        let graphql_client = self.graphql_client.clone();
4392        async move { query.execute(graphql_client).await }
4393    }
4394    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4395        let query = self.selection.select("sync");
4396        let graphql_client = self.graphql_client.clone();
4397        async move { query.execute(graphql_client).await }
4398    }
4399}
4400#[derive(Clone)]
4401pub struct CurrentModule {
4402    pub proc: Option<Arc<DaggerSessionProc>>,
4403    pub selection: Selection,
4404    pub graphql_client: DynGraphQLClient,
4405}
4406#[derive(Builder, Debug, PartialEq)]
4407pub struct CurrentModuleGeneratorsOpts<'a> {
4408    /// Only include generators matching the specified patterns
4409    #[builder(setter(into, strip_option), default)]
4410    pub include: Option<Vec<&'a str>>,
4411}
4412#[derive(Builder, Debug, PartialEq)]
4413pub struct CurrentModuleWorkdirOpts<'a> {
4414    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4415    #[builder(setter(into, strip_option), default)]
4416    pub exclude: Option<Vec<&'a str>>,
4417    /// Apply .gitignore filter rules inside the directory
4418    #[builder(setter(into, strip_option), default)]
4419    pub gitignore: Option<bool>,
4420    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4421    #[builder(setter(into, strip_option), default)]
4422    pub include: Option<Vec<&'a str>>,
4423}
4424impl IntoID<Id> for CurrentModule {
4425    fn into_id(
4426        self,
4427    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4428        Box::pin(async move { self.id().await })
4429    }
4430}
4431impl Loadable for CurrentModule {
4432    fn graphql_type() -> &'static str {
4433        "CurrentModule"
4434    }
4435    fn from_query(
4436        proc: Option<Arc<DaggerSessionProc>>,
4437        selection: Selection,
4438        graphql_client: DynGraphQLClient,
4439    ) -> Self {
4440        Self {
4441            proc,
4442            selection,
4443            graphql_client,
4444        }
4445    }
4446}
4447impl CurrentModule {
4448    /// The dependencies of the module.
4449    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4450        let query = self.selection.select("dependencies");
4451        let query = query.select("id");
4452        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4453        Ok(ids
4454            .into_iter()
4455            .map(|id| Module {
4456                proc: self.proc.clone(),
4457                selection: crate::querybuilder::query()
4458                    .select("node")
4459                    .arg("id", &id.0)
4460                    .inline_fragment("Module"),
4461                graphql_client: self.graphql_client.clone(),
4462            })
4463            .collect())
4464    }
4465    /// The generated files and directories made on top of the module source's context directory.
4466    pub fn generated_context_directory(&self) -> Directory {
4467        let query = self.selection.select("generatedContextDirectory");
4468        Directory {
4469            proc: self.proc.clone(),
4470            selection: query,
4471            graphql_client: self.graphql_client.clone(),
4472        }
4473    }
4474    /// Return all generators defined by the module
4475    ///
4476    /// # Arguments
4477    ///
4478    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4479    pub fn generators(&self) -> GeneratorGroup {
4480        let query = self.selection.select("generators");
4481        GeneratorGroup {
4482            proc: self.proc.clone(),
4483            selection: query,
4484            graphql_client: self.graphql_client.clone(),
4485        }
4486    }
4487    /// Return all generators defined by the module
4488    ///
4489    /// # Arguments
4490    ///
4491    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4492    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4493        let mut query = self.selection.select("generators");
4494        if let Some(include) = opts.include {
4495            query = query.arg("include", include);
4496        }
4497        GeneratorGroup {
4498            proc: self.proc.clone(),
4499            selection: query,
4500            graphql_client: self.graphql_client.clone(),
4501        }
4502    }
4503    /// A unique identifier for this CurrentModule.
4504    pub async fn id(&self) -> Result<Id, DaggerError> {
4505        let query = self.selection.select("id");
4506        query.execute(self.graphql_client.clone()).await
4507    }
4508    /// The name of the module being executed in
4509    pub async fn name(&self) -> Result<String, DaggerError> {
4510        let query = self.selection.select("name");
4511        query.execute(self.graphql_client.clone()).await
4512    }
4513    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4514    pub fn source(&self) -> Directory {
4515        let query = self.selection.select("source");
4516        Directory {
4517            proc: self.proc.clone(),
4518            selection: query,
4519            graphql_client: self.graphql_client.clone(),
4520        }
4521    }
4522    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4523    ///
4524    /// # Arguments
4525    ///
4526    /// * `path` - Location of the directory to access (e.g., ".").
4527    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4528    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4529        let mut query = self.selection.select("workdir");
4530        query = query.arg("path", path.into());
4531        Directory {
4532            proc: self.proc.clone(),
4533            selection: query,
4534            graphql_client: self.graphql_client.clone(),
4535        }
4536    }
4537    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4538    ///
4539    /// # Arguments
4540    ///
4541    /// * `path` - Location of the directory to access (e.g., ".").
4542    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4543    pub fn workdir_opts<'a>(
4544        &self,
4545        path: impl Into<String>,
4546        opts: CurrentModuleWorkdirOpts<'a>,
4547    ) -> Directory {
4548        let mut query = self.selection.select("workdir");
4549        query = query.arg("path", path.into());
4550        if let Some(exclude) = opts.exclude {
4551            query = query.arg("exclude", exclude);
4552        }
4553        if let Some(include) = opts.include {
4554            query = query.arg("include", include);
4555        }
4556        if let Some(gitignore) = opts.gitignore {
4557            query = query.arg("gitignore", gitignore);
4558        }
4559        Directory {
4560            proc: self.proc.clone(),
4561            selection: query,
4562            graphql_client: self.graphql_client.clone(),
4563        }
4564    }
4565    /// 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.
4566    ///
4567    /// # Arguments
4568    ///
4569    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4570    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4571        let mut query = self.selection.select("workdirFile");
4572        query = query.arg("path", path.into());
4573        File {
4574            proc: self.proc.clone(),
4575            selection: query,
4576            graphql_client: self.graphql_client.clone(),
4577        }
4578    }
4579}
4580impl Node for CurrentModule {
4581    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4582        let query = self.selection.select("id");
4583        let graphql_client = self.graphql_client.clone();
4584        async move { query.execute(graphql_client).await }
4585    }
4586}
4587#[derive(Clone)]
4588pub struct DiffStat {
4589    pub proc: Option<Arc<DaggerSessionProc>>,
4590    pub selection: Selection,
4591    pub graphql_client: DynGraphQLClient,
4592}
4593impl IntoID<Id> for DiffStat {
4594    fn into_id(
4595        self,
4596    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4597        Box::pin(async move { self.id().await })
4598    }
4599}
4600impl Loadable for DiffStat {
4601    fn graphql_type() -> &'static str {
4602        "DiffStat"
4603    }
4604    fn from_query(
4605        proc: Option<Arc<DaggerSessionProc>>,
4606        selection: Selection,
4607        graphql_client: DynGraphQLClient,
4608    ) -> Self {
4609        Self {
4610            proc,
4611            selection,
4612            graphql_client,
4613        }
4614    }
4615}
4616impl DiffStat {
4617    /// Number of added lines for this path.
4618    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4619        let query = self.selection.select("addedLines");
4620        query.execute(self.graphql_client.clone()).await
4621    }
4622    /// A unique identifier for this DiffStat.
4623    pub async fn id(&self) -> Result<Id, DaggerError> {
4624        let query = self.selection.select("id");
4625        query.execute(self.graphql_client.clone()).await
4626    }
4627    /// Type of change.
4628    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4629        let query = self.selection.select("kind");
4630        query.execute(self.graphql_client.clone()).await
4631    }
4632    /// Previous path of the file, set only for renames.
4633    pub async fn old_path(&self) -> Result<String, DaggerError> {
4634        let query = self.selection.select("oldPath");
4635        query.execute(self.graphql_client.clone()).await
4636    }
4637    /// Path of the changed file or directory.
4638    pub async fn path(&self) -> Result<String, DaggerError> {
4639        let query = self.selection.select("path");
4640        query.execute(self.graphql_client.clone()).await
4641    }
4642    /// Number of removed lines for this path.
4643    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4644        let query = self.selection.select("removedLines");
4645        query.execute(self.graphql_client.clone()).await
4646    }
4647}
4648impl Node for DiffStat {
4649    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4650        let query = self.selection.select("id");
4651        let graphql_client = self.graphql_client.clone();
4652        async move { query.execute(graphql_client).await }
4653    }
4654}
4655#[derive(Clone)]
4656pub struct Directory {
4657    pub proc: Option<Arc<DaggerSessionProc>>,
4658    pub selection: Selection,
4659    pub graphql_client: DynGraphQLClient,
4660}
4661#[derive(Builder, Debug, PartialEq)]
4662pub struct DirectoryAsModuleOpts<'a> {
4663    /// An optional subpath of the directory which contains the module's configuration file.
4664    /// If not set, the module source code is loaded from the root of the directory.
4665    #[builder(setter(into, strip_option), default)]
4666    pub source_root_path: Option<&'a str>,
4667}
4668#[derive(Builder, Debug, PartialEq)]
4669pub struct DirectoryAsModuleSourceOpts<'a> {
4670    /// An optional subpath of the directory which contains the module's configuration file.
4671    /// If not set, the module source code is loaded from the root of the directory.
4672    #[builder(setter(into, strip_option), default)]
4673    pub source_root_path: Option<&'a str>,
4674}
4675#[derive(Builder, Debug, PartialEq)]
4676pub struct DirectoryAsWorkspaceOpts<'a> {
4677    /// Current working directory inside the workspace root. Defaults to the workspace root.
4678    #[builder(setter(into, strip_option), default)]
4679    pub cwd: Option<&'a str>,
4680}
4681#[derive(Builder, Debug, PartialEq)]
4682pub struct DirectoryDockerBuildOpts<'a> {
4683    /// Build arguments to use in the build.
4684    #[builder(setter(into, strip_option), default)]
4685    pub build_args: Option<Vec<BuildArg>>,
4686    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4687    #[builder(setter(into, strip_option), default)]
4688    pub dockerfile: Option<&'a str>,
4689    /// If set, skip the automatic init process injected into containers created by RUN statements.
4690    /// 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.
4691    #[builder(setter(into, strip_option), default)]
4692    pub no_init: Option<bool>,
4693    /// The platform to build.
4694    #[builder(setter(into, strip_option), default)]
4695    pub platform: Option<Platform>,
4696    /// Secrets to pass to the build.
4697    /// They will be mounted at /run/secrets/[secret-name].
4698    #[builder(setter(into, strip_option), default)]
4699    pub secrets: Option<Vec<Id>>,
4700    /// A socket to use for SSH authentication during the build
4701    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
4702    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
4703    #[builder(setter(into, strip_option), default)]
4704    pub ssh: Option<Id>,
4705    /// Target build stage to build.
4706    #[builder(setter(into, strip_option), default)]
4707    pub target: Option<&'a str>,
4708}
4709#[derive(Builder, Debug, PartialEq)]
4710pub struct DirectoryEntriesOpts<'a> {
4711    /// Location of the directory to look at (e.g., "/src").
4712    #[builder(setter(into, strip_option), default)]
4713    pub path: Option<&'a str>,
4714}
4715#[derive(Builder, Debug, PartialEq)]
4716pub struct DirectoryExistsOpts {
4717    /// If specified, do not follow symlinks.
4718    #[builder(setter(into, strip_option), default)]
4719    pub do_not_follow_symlinks: Option<bool>,
4720    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4721    #[builder(setter(into, strip_option), default)]
4722    pub expected_type: Option<ExistsType>,
4723}
4724#[derive(Builder, Debug, PartialEq)]
4725pub struct DirectoryExportOpts {
4726    /// 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.
4727    #[builder(setter(into, strip_option), default)]
4728    pub wipe: Option<bool>,
4729}
4730#[derive(Builder, Debug, PartialEq)]
4731pub struct DirectoryFilterOpts<'a> {
4732    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4733    #[builder(setter(into, strip_option), default)]
4734    pub exclude: Option<Vec<&'a str>>,
4735    /// If set, apply .gitignore rules when filtering the directory.
4736    #[builder(setter(into, strip_option), default)]
4737    pub gitignore: Option<bool>,
4738    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4739    #[builder(setter(into, strip_option), default)]
4740    pub include: Option<Vec<&'a str>>,
4741}
4742#[derive(Builder, Debug, PartialEq)]
4743pub struct DirectorySearchOpts<'a> {
4744    /// Allow the . pattern to match newlines in multiline mode.
4745    #[builder(setter(into, strip_option), default)]
4746    pub dotall: Option<bool>,
4747    /// Only return matching files, not lines and content
4748    #[builder(setter(into, strip_option), default)]
4749    pub files_only: Option<bool>,
4750    /// Glob patterns to match (e.g., "*.md")
4751    #[builder(setter(into, strip_option), default)]
4752    pub globs: Option<Vec<&'a str>>,
4753    /// Enable case-insensitive matching.
4754    #[builder(setter(into, strip_option), default)]
4755    pub insensitive: Option<bool>,
4756    /// Limit the number of results to return
4757    #[builder(setter(into, strip_option), default)]
4758    pub limit: Option<isize>,
4759    /// Interpret the pattern as a literal string instead of a regular expression.
4760    #[builder(setter(into, strip_option), default)]
4761    pub literal: Option<bool>,
4762    /// Enable searching across multiple lines.
4763    #[builder(setter(into, strip_option), default)]
4764    pub multiline: Option<bool>,
4765    /// Directory or file paths to search
4766    #[builder(setter(into, strip_option), default)]
4767    pub paths: Option<Vec<&'a str>>,
4768    /// Skip hidden files (files starting with .).
4769    #[builder(setter(into, strip_option), default)]
4770    pub skip_hidden: Option<bool>,
4771    /// Honor .gitignore, .ignore, and .rgignore files.
4772    #[builder(setter(into, strip_option), default)]
4773    pub skip_ignored: Option<bool>,
4774}
4775#[derive(Builder, Debug, PartialEq)]
4776pub struct DirectoryStatOpts {
4777    /// If specified, do not follow symlinks.
4778    #[builder(setter(into, strip_option), default)]
4779    pub do_not_follow_symlinks: Option<bool>,
4780}
4781#[derive(Builder, Debug, PartialEq)]
4782pub struct DirectoryTerminalOpts<'a> {
4783    /// If set, override the container's default terminal command and invoke these command arguments instead.
4784    #[builder(setter(into, strip_option), default)]
4785    pub cmd: Option<Vec<&'a str>>,
4786    /// If set, override the default container used for the terminal.
4787    #[builder(setter(into, strip_option), default)]
4788    pub container: Option<Id>,
4789    /// Provides Dagger access to the executed command.
4790    #[builder(setter(into, strip_option), default)]
4791    pub experimental_privileged_nesting: Option<bool>,
4792    /// 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.
4793    #[builder(setter(into, strip_option), default)]
4794    pub insecure_root_capabilities: Option<bool>,
4795}
4796#[derive(Builder, Debug, PartialEq)]
4797pub struct DirectoryWithDirectoryOpts<'a> {
4798    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4799    #[builder(setter(into, strip_option), default)]
4800    pub exclude: Option<Vec<&'a str>>,
4801    /// Apply .gitignore filter rules inside the directory
4802    #[builder(setter(into, strip_option), default)]
4803    pub gitignore: Option<bool>,
4804    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4805    #[builder(setter(into, strip_option), default)]
4806    pub include: Option<Vec<&'a str>>,
4807    /// A user:group to set for the copied directory and its contents.
4808    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4809    /// If the group is omitted, it defaults to the same as the user.
4810    #[builder(setter(into, strip_option), default)]
4811    pub owner: Option<&'a str>,
4812    /// Permission given to the copied directory and contents (e.g., 0755).
4813    #[builder(setter(into, strip_option), default)]
4814    pub permissions: Option<isize>,
4815}
4816#[derive(Builder, Debug, PartialEq)]
4817pub struct DirectoryWithFileOpts<'a> {
4818    /// A user:group to set for the copied directory and its contents.
4819    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4820    /// If the group is omitted, it defaults to the same as the user.
4821    #[builder(setter(into, strip_option), default)]
4822    pub owner: Option<&'a str>,
4823    /// Permission given to the copied file (e.g., 0600).
4824    #[builder(setter(into, strip_option), default)]
4825    pub permissions: Option<isize>,
4826}
4827#[derive(Builder, Debug, PartialEq)]
4828pub struct DirectoryWithFilesOpts {
4829    /// Permission given to the copied files (e.g., 0600).
4830    #[builder(setter(into, strip_option), default)]
4831    pub permissions: Option<isize>,
4832}
4833#[derive(Builder, Debug, PartialEq)]
4834pub struct DirectoryWithNewDirectoryOpts {
4835    /// Permission granted to the created directory (e.g., 0777).
4836    #[builder(setter(into, strip_option), default)]
4837    pub permissions: Option<isize>,
4838}
4839#[derive(Builder, Debug, PartialEq)]
4840pub struct DirectoryWithNewFileOpts {
4841    /// Permissions of the new file. Example: 0600
4842    #[builder(setter(into, strip_option), default)]
4843    pub permissions: Option<isize>,
4844}
4845#[derive(Builder, Debug, PartialEq)]
4846pub struct DirectoryWithPatchOpts {
4847    /// 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.
4848    #[builder(setter(into, strip_option), default)]
4849    pub on_conflict: Option<PatchConflict>,
4850}
4851#[derive(Builder, Debug, PartialEq)]
4852pub struct DirectoryWithPatchFileOpts {
4853    /// 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.
4854    #[builder(setter(into, strip_option), default)]
4855    pub on_conflict: Option<PatchConflict>,
4856}
4857impl IntoID<Id> for Directory {
4858    fn into_id(
4859        self,
4860    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4861        Box::pin(async move { self.id().await })
4862    }
4863}
4864impl Loadable for Directory {
4865    fn graphql_type() -> &'static str {
4866        "Directory"
4867    }
4868    fn from_query(
4869        proc: Option<Arc<DaggerSessionProc>>,
4870        selection: Selection,
4871        graphql_client: DynGraphQLClient,
4872    ) -> Self {
4873        Self {
4874            proc,
4875            selection,
4876            graphql_client,
4877        }
4878    }
4879}
4880impl Directory {
4881    /// Converts this directory to a local git repository
4882    pub fn as_git(&self) -> GitRepository {
4883        let query = self.selection.select("asGit");
4884        GitRepository {
4885            proc: self.proc.clone(),
4886            selection: query,
4887            graphql_client: self.graphql_client.clone(),
4888        }
4889    }
4890    /// Load the directory as a Dagger module source
4891    ///
4892    /// # Arguments
4893    ///
4894    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4895    pub fn as_module(&self) -> Module {
4896        let query = self.selection.select("asModule");
4897        Module {
4898            proc: self.proc.clone(),
4899            selection: query,
4900            graphql_client: self.graphql_client.clone(),
4901        }
4902    }
4903    /// Load the directory as a Dagger module source
4904    ///
4905    /// # Arguments
4906    ///
4907    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4908    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4909        let mut query = self.selection.select("asModule");
4910        if let Some(source_root_path) = opts.source_root_path {
4911            query = query.arg("sourceRootPath", source_root_path);
4912        }
4913        Module {
4914            proc: self.proc.clone(),
4915            selection: query,
4916            graphql_client: self.graphql_client.clone(),
4917        }
4918    }
4919    /// Load the directory as a Dagger module source
4920    ///
4921    /// # Arguments
4922    ///
4923    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4924    pub fn as_module_source(&self) -> ModuleSource {
4925        let query = self.selection.select("asModuleSource");
4926        ModuleSource {
4927            proc: self.proc.clone(),
4928            selection: query,
4929            graphql_client: self.graphql_client.clone(),
4930        }
4931    }
4932    /// Load the directory as a Dagger module source
4933    ///
4934    /// # Arguments
4935    ///
4936    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4937    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4938        let mut query = self.selection.select("asModuleSource");
4939        if let Some(source_root_path) = opts.source_root_path {
4940            query = query.arg("sourceRootPath", source_root_path);
4941        }
4942        ModuleSource {
4943            proc: self.proc.clone(),
4944            selection: query,
4945            graphql_client: self.graphql_client.clone(),
4946        }
4947    }
4948    /// Creates a synthetic workspace from this directory.
4949    ///
4950    /// # Arguments
4951    ///
4952    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4953    pub fn as_workspace(&self) -> Workspace {
4954        let query = self.selection.select("asWorkspace");
4955        Workspace {
4956            proc: self.proc.clone(),
4957            selection: query,
4958            graphql_client: self.graphql_client.clone(),
4959        }
4960    }
4961    /// Creates a synthetic workspace from this directory.
4962    ///
4963    /// # Arguments
4964    ///
4965    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4966    pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
4967        let mut query = self.selection.select("asWorkspace");
4968        if let Some(cwd) = opts.cwd {
4969            query = query.arg("cwd", cwd);
4970        }
4971        Workspace {
4972            proc: self.proc.clone(),
4973            selection: query,
4974            graphql_client: self.graphql_client.clone(),
4975        }
4976    }
4977    /// Return the difference between this directory and another directory, typically an older snapshot.
4978    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
4979    ///
4980    /// # Arguments
4981    ///
4982    /// * `from` - The base directory snapshot to compare against
4983    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4984        let mut query = self.selection.select("changes");
4985        query = query.arg_lazy(
4986            "from",
4987            Box::new(move || {
4988                let from = from.clone();
4989                Box::pin(async move { from.into_id().await.unwrap().quote() })
4990            }),
4991        );
4992        Changeset {
4993            proc: self.proc.clone(),
4994            selection: query,
4995            graphql_client: self.graphql_client.clone(),
4996        }
4997    }
4998    /// Change the owner of the directory contents recursively.
4999    ///
5000    /// # Arguments
5001    ///
5002    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5003    /// * `owner` - A user:group to set for the mounted directory and its contents.
5004    ///
5005    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
5006    ///
5007    /// If the group is omitted, it defaults to the same as the user.
5008    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5009        let mut query = self.selection.select("chown");
5010        query = query.arg("path", path.into());
5011        query = query.arg("owner", owner.into());
5012        Directory {
5013            proc: self.proc.clone(),
5014            selection: query,
5015            graphql_client: self.graphql_client.clone(),
5016        }
5017    }
5018    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5019    ///
5020    /// # Arguments
5021    ///
5022    /// * `other` - The directory to compare against
5023    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
5024        let mut query = self.selection.select("diff");
5025        query = query.arg_lazy(
5026            "other",
5027            Box::new(move || {
5028                let other = other.clone();
5029                Box::pin(async move { other.into_id().await.unwrap().quote() })
5030            }),
5031        );
5032        Directory {
5033            proc: self.proc.clone(),
5034            selection: query,
5035            graphql_client: self.graphql_client.clone(),
5036        }
5037    }
5038    /// 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.
5039    pub async fn digest(&self) -> Result<String, DaggerError> {
5040        let query = self.selection.select("digest");
5041        query.execute(self.graphql_client.clone()).await
5042    }
5043    /// Retrieves a directory at the given path.
5044    ///
5045    /// # Arguments
5046    ///
5047    /// * `path` - Location of the directory to retrieve. Example: "/src"
5048    pub fn directory(&self, path: impl Into<String>) -> Directory {
5049        let mut query = self.selection.select("directory");
5050        query = query.arg("path", path.into());
5051        Directory {
5052            proc: self.proc.clone(),
5053            selection: query,
5054            graphql_client: self.graphql_client.clone(),
5055        }
5056    }
5057    /// 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.
5058    ///
5059    /// # Arguments
5060    ///
5061    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5062    pub fn docker_build(&self) -> Container {
5063        let query = self.selection.select("dockerBuild");
5064        Container {
5065            proc: self.proc.clone(),
5066            selection: query,
5067            graphql_client: self.graphql_client.clone(),
5068        }
5069    }
5070    /// 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.
5071    ///
5072    /// # Arguments
5073    ///
5074    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5075    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5076        let mut query = self.selection.select("dockerBuild");
5077        if let Some(dockerfile) = opts.dockerfile {
5078            query = query.arg("dockerfile", dockerfile);
5079        }
5080        if let Some(platform) = opts.platform {
5081            query = query.arg("platform", platform);
5082        }
5083        if let Some(build_args) = opts.build_args {
5084            query = query.arg("buildArgs", build_args);
5085        }
5086        if let Some(target) = opts.target {
5087            query = query.arg("target", target);
5088        }
5089        if let Some(secrets) = opts.secrets {
5090            query = query.arg("secrets", secrets);
5091        }
5092        if let Some(no_init) = opts.no_init {
5093            query = query.arg("noInit", no_init);
5094        }
5095        if let Some(ssh) = opts.ssh {
5096            query = query.arg("ssh", ssh);
5097        }
5098        Container {
5099            proc: self.proc.clone(),
5100            selection: query,
5101            graphql_client: self.graphql_client.clone(),
5102        }
5103    }
5104    /// Returns a list of files and directories at the given path.
5105    ///
5106    /// # Arguments
5107    ///
5108    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5109    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5110        let query = self.selection.select("entries");
5111        query.execute(self.graphql_client.clone()).await
5112    }
5113    /// Returns a list of files and directories at the given path.
5114    ///
5115    /// # Arguments
5116    ///
5117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5118    pub async fn entries_opts<'a>(
5119        &self,
5120        opts: DirectoryEntriesOpts<'a>,
5121    ) -> Result<Vec<String>, DaggerError> {
5122        let mut query = self.selection.select("entries");
5123        if let Some(path) = opts.path {
5124            query = query.arg("path", path);
5125        }
5126        query.execute(self.graphql_client.clone()).await
5127    }
5128    /// check if a file or directory exists
5129    ///
5130    /// # Arguments
5131    ///
5132    /// * `path` - Path to check (e.g., "/file.txt").
5133    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5134    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5135        let mut query = self.selection.select("exists");
5136        query = query.arg("path", path.into());
5137        query.execute(self.graphql_client.clone()).await
5138    }
5139    /// check if a file or directory exists
5140    ///
5141    /// # Arguments
5142    ///
5143    /// * `path` - Path to check (e.g., "/file.txt").
5144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5145    pub async fn exists_opts(
5146        &self,
5147        path: impl Into<String>,
5148        opts: DirectoryExistsOpts,
5149    ) -> Result<bool, DaggerError> {
5150        let mut query = self.selection.select("exists");
5151        query = query.arg("path", path.into());
5152        if let Some(expected_type) = opts.expected_type {
5153            query = query.arg("expectedType", expected_type);
5154        }
5155        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5156            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5157        }
5158        query.execute(self.graphql_client.clone()).await
5159    }
5160    /// Writes the contents of the directory to a path on the host.
5161    ///
5162    /// # Arguments
5163    ///
5164    /// * `path` - Location of the copied directory (e.g., "logs/").
5165    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5166    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5167        let mut query = self.selection.select("export");
5168        query = query.arg("path", path.into());
5169        query.execute(self.graphql_client.clone()).await
5170    }
5171    /// Writes the contents of the directory to a path on the host.
5172    ///
5173    /// # Arguments
5174    ///
5175    /// * `path` - Location of the copied directory (e.g., "logs/").
5176    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5177    pub async fn export_opts(
5178        &self,
5179        path: impl Into<String>,
5180        opts: DirectoryExportOpts,
5181    ) -> Result<String, DaggerError> {
5182        let mut query = self.selection.select("export");
5183        query = query.arg("path", path.into());
5184        if let Some(wipe) = opts.wipe {
5185            query = query.arg("wipe", wipe);
5186        }
5187        query.execute(self.graphql_client.clone()).await
5188    }
5189    /// Retrieve a file at the given path.
5190    ///
5191    /// # Arguments
5192    ///
5193    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5194    pub fn file(&self, path: impl Into<String>) -> File {
5195        let mut query = self.selection.select("file");
5196        query = query.arg("path", path.into());
5197        File {
5198            proc: self.proc.clone(),
5199            selection: query,
5200            graphql_client: self.graphql_client.clone(),
5201        }
5202    }
5203    /// Return a snapshot with some paths included or excluded
5204    ///
5205    /// # Arguments
5206    ///
5207    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5208    pub fn filter(&self) -> Directory {
5209        let query = self.selection.select("filter");
5210        Directory {
5211            proc: self.proc.clone(),
5212            selection: query,
5213            graphql_client: self.graphql_client.clone(),
5214        }
5215    }
5216    /// Return a snapshot with some paths included or excluded
5217    ///
5218    /// # Arguments
5219    ///
5220    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5221    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5222        let mut query = self.selection.select("filter");
5223        if let Some(exclude) = opts.exclude {
5224            query = query.arg("exclude", exclude);
5225        }
5226        if let Some(include) = opts.include {
5227            query = query.arg("include", include);
5228        }
5229        if let Some(gitignore) = opts.gitignore {
5230            query = query.arg("gitignore", gitignore);
5231        }
5232        Directory {
5233            proc: self.proc.clone(),
5234            selection: query,
5235            graphql_client: self.graphql_client.clone(),
5236        }
5237    }
5238    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5239    ///
5240    /// # Arguments
5241    ///
5242    /// * `name` - The name of the file or directory to search for
5243    /// * `start` - The path to start the search from
5244    pub async fn find_up(
5245        &self,
5246        name: impl Into<String>,
5247        start: impl Into<String>,
5248    ) -> Result<String, DaggerError> {
5249        let mut query = self.selection.select("findUp");
5250        query = query.arg("name", name.into());
5251        query = query.arg("start", start.into());
5252        query.execute(self.graphql_client.clone()).await
5253    }
5254    /// Returns a list of files and directories that matche the given pattern.
5255    ///
5256    /// # Arguments
5257    ///
5258    /// * `pattern` - Pattern to match (e.g., "*.md").
5259    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5260        let mut query = self.selection.select("glob");
5261        query = query.arg("pattern", pattern.into());
5262        query.execute(self.graphql_client.clone()).await
5263    }
5264    /// A unique identifier for this Directory.
5265    pub async fn id(&self) -> Result<Id, DaggerError> {
5266        let query = self.selection.select("id");
5267        query.execute(self.graphql_client.clone()).await
5268    }
5269    /// Returns the name of the directory.
5270    pub async fn name(&self) -> Result<String, DaggerError> {
5271        let query = self.selection.select("name");
5272        query.execute(self.graphql_client.clone()).await
5273    }
5274    /// Searches for content matching the given regular expression or literal string.
5275    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5276    ///
5277    /// # Arguments
5278    ///
5279    /// * `pattern` - The text to match.
5280    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5281    pub async fn search(
5282        &self,
5283        pattern: impl Into<String>,
5284    ) -> Result<Vec<SearchResult>, DaggerError> {
5285        let mut query = self.selection.select("search");
5286        query = query.arg("pattern", pattern.into());
5287        let query = query.select("id");
5288        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5289        Ok(ids
5290            .into_iter()
5291            .map(|id| SearchResult {
5292                proc: self.proc.clone(),
5293                selection: crate::querybuilder::query()
5294                    .select("node")
5295                    .arg("id", &id.0)
5296                    .inline_fragment("SearchResult"),
5297                graphql_client: self.graphql_client.clone(),
5298            })
5299            .collect())
5300    }
5301    /// Searches for content matching the given regular expression or literal string.
5302    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5303    ///
5304    /// # Arguments
5305    ///
5306    /// * `pattern` - The text to match.
5307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5308    pub async fn search_opts<'a>(
5309        &self,
5310        pattern: impl Into<String>,
5311        opts: DirectorySearchOpts<'a>,
5312    ) -> Result<Vec<SearchResult>, DaggerError> {
5313        let mut query = self.selection.select("search");
5314        query = query.arg("pattern", pattern.into());
5315        if let Some(paths) = opts.paths {
5316            query = query.arg("paths", paths);
5317        }
5318        if let Some(globs) = opts.globs {
5319            query = query.arg("globs", globs);
5320        }
5321        if let Some(literal) = opts.literal {
5322            query = query.arg("literal", literal);
5323        }
5324        if let Some(multiline) = opts.multiline {
5325            query = query.arg("multiline", multiline);
5326        }
5327        if let Some(dotall) = opts.dotall {
5328            query = query.arg("dotall", dotall);
5329        }
5330        if let Some(insensitive) = opts.insensitive {
5331            query = query.arg("insensitive", insensitive);
5332        }
5333        if let Some(skip_ignored) = opts.skip_ignored {
5334            query = query.arg("skipIgnored", skip_ignored);
5335        }
5336        if let Some(skip_hidden) = opts.skip_hidden {
5337            query = query.arg("skipHidden", skip_hidden);
5338        }
5339        if let Some(files_only) = opts.files_only {
5340            query = query.arg("filesOnly", files_only);
5341        }
5342        if let Some(limit) = opts.limit {
5343            query = query.arg("limit", limit);
5344        }
5345        let query = query.select("id");
5346        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5347        Ok(ids
5348            .into_iter()
5349            .map(|id| SearchResult {
5350                proc: self.proc.clone(),
5351                selection: crate::querybuilder::query()
5352                    .select("node")
5353                    .arg("id", &id.0)
5354                    .inline_fragment("SearchResult"),
5355                graphql_client: self.graphql_client.clone(),
5356            })
5357            .collect())
5358    }
5359    /// Return file status
5360    ///
5361    /// # Arguments
5362    ///
5363    /// * `path` - Path to stat (e.g., "/file.txt").
5364    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5365    pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5366        let mut query = self.selection.select("stat");
5367        query = query.arg("path", path.into());
5368        let query = query.select("id");
5369        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5370        Ok(id.map(|id| Stat {
5371            proc: self.proc.clone(),
5372            selection: query
5373                .root()
5374                .select("node")
5375                .arg("id", &id.0)
5376                .inline_fragment("Stat"),
5377            graphql_client: self.graphql_client.clone(),
5378        }))
5379    }
5380    /// Return file status
5381    ///
5382    /// # Arguments
5383    ///
5384    /// * `path` - Path to stat (e.g., "/file.txt").
5385    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5386    pub async fn stat_opts(
5387        &self,
5388        path: impl Into<String>,
5389        opts: DirectoryStatOpts,
5390    ) -> Result<Option<Stat>, DaggerError> {
5391        let mut query = self.selection.select("stat");
5392        query = query.arg("path", path.into());
5393        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5394            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5395        }
5396        let query = query.select("id");
5397        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5398        Ok(id.map(|id| Stat {
5399            proc: self.proc.clone(),
5400            selection: query
5401                .root()
5402                .select("node")
5403                .arg("id", &id.0)
5404                .inline_fragment("Stat"),
5405            graphql_client: self.graphql_client.clone(),
5406        }))
5407    }
5408    /// Force evaluation in the engine.
5409    pub async fn sync(&self) -> Result<Directory, DaggerError> {
5410        let query = self.selection.select("sync");
5411        let id: Id = query.execute(self.graphql_client.clone()).await?;
5412        Ok(Directory {
5413            proc: self.proc.clone(),
5414            selection: query
5415                .root()
5416                .select("node")
5417                .arg("id", &id.0)
5418                .inline_fragment("Directory"),
5419            graphql_client: self.graphql_client.clone(),
5420        })
5421    }
5422    /// Opens an interactive terminal in new container with this directory mounted inside.
5423    ///
5424    /// # Arguments
5425    ///
5426    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5427    pub fn terminal(&self) -> Directory {
5428        let query = self.selection.select("terminal");
5429        Directory {
5430            proc: self.proc.clone(),
5431            selection: query,
5432            graphql_client: self.graphql_client.clone(),
5433        }
5434    }
5435    /// Opens an interactive terminal in new container with this directory mounted inside.
5436    ///
5437    /// # Arguments
5438    ///
5439    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5440    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5441        let mut query = self.selection.select("terminal");
5442        if let Some(container) = opts.container {
5443            query = query.arg("container", container);
5444        }
5445        if let Some(cmd) = opts.cmd {
5446            query = query.arg("cmd", cmd);
5447        }
5448        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5449            query = query.arg(
5450                "experimentalPrivilegedNesting",
5451                experimental_privileged_nesting,
5452            );
5453        }
5454        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5455            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5456        }
5457        Directory {
5458            proc: self.proc.clone(),
5459            selection: query,
5460            graphql_client: self.graphql_client.clone(),
5461        }
5462    }
5463    /// Return a directory with changes from another directory applied to it.
5464    ///
5465    /// # Arguments
5466    ///
5467    /// * `changes` - Changes to apply to the directory
5468    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5469        let mut query = self.selection.select("withChanges");
5470        query = query.arg_lazy(
5471            "changes",
5472            Box::new(move || {
5473                let changes = changes.clone();
5474                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5475            }),
5476        );
5477        Directory {
5478            proc: self.proc.clone(),
5479            selection: query,
5480            graphql_client: self.graphql_client.clone(),
5481        }
5482    }
5483    /// Return a snapshot with a directory added
5484    ///
5485    /// # Arguments
5486    ///
5487    /// * `path` - Location of the written directory (e.g., "/src/").
5488    /// * `source` - Identifier of the directory to copy.
5489    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5490    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5491        let mut query = self.selection.select("withDirectory");
5492        query = query.arg("path", path.into());
5493        query = query.arg_lazy(
5494            "source",
5495            Box::new(move || {
5496                let source = source.clone();
5497                Box::pin(async move { source.into_id().await.unwrap().quote() })
5498            }),
5499        );
5500        Directory {
5501            proc: self.proc.clone(),
5502            selection: query,
5503            graphql_client: self.graphql_client.clone(),
5504        }
5505    }
5506    /// Return a snapshot with a directory added
5507    ///
5508    /// # Arguments
5509    ///
5510    /// * `path` - Location of the written directory (e.g., "/src/").
5511    /// * `source` - Identifier of the directory to copy.
5512    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5513    pub fn with_directory_opts<'a>(
5514        &self,
5515        path: impl Into<String>,
5516        source: impl IntoID<Id>,
5517        opts: DirectoryWithDirectoryOpts<'a>,
5518    ) -> Directory {
5519        let mut query = self.selection.select("withDirectory");
5520        query = query.arg("path", path.into());
5521        query = query.arg_lazy(
5522            "source",
5523            Box::new(move || {
5524                let source = source.clone();
5525                Box::pin(async move { source.into_id().await.unwrap().quote() })
5526            }),
5527        );
5528        if let Some(exclude) = opts.exclude {
5529            query = query.arg("exclude", exclude);
5530        }
5531        if let Some(include) = opts.include {
5532            query = query.arg("include", include);
5533        }
5534        if let Some(gitignore) = opts.gitignore {
5535            query = query.arg("gitignore", gitignore);
5536        }
5537        if let Some(owner) = opts.owner {
5538            query = query.arg("owner", owner);
5539        }
5540        if let Some(permissions) = opts.permissions {
5541            query = query.arg("permissions", permissions);
5542        }
5543        Directory {
5544            proc: self.proc.clone(),
5545            selection: query,
5546            graphql_client: self.graphql_client.clone(),
5547        }
5548    }
5549    /// Raise an error.
5550    ///
5551    /// # Arguments
5552    ///
5553    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5554    pub fn with_error(&self, err: impl Into<String>) -> Directory {
5555        let mut query = self.selection.select("withError");
5556        query = query.arg("err", err.into());
5557        Directory {
5558            proc: self.proc.clone(),
5559            selection: query,
5560            graphql_client: self.graphql_client.clone(),
5561        }
5562    }
5563    /// Retrieves this directory plus the contents of the given file copied to the given path.
5564    ///
5565    /// # Arguments
5566    ///
5567    /// * `path` - Location of the copied file (e.g., "/file.txt").
5568    /// * `source` - Identifier of the file to copy.
5569    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5570    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5571        let mut query = self.selection.select("withFile");
5572        query = query.arg("path", path.into());
5573        query = query.arg_lazy(
5574            "source",
5575            Box::new(move || {
5576                let source = source.clone();
5577                Box::pin(async move { source.into_id().await.unwrap().quote() })
5578            }),
5579        );
5580        Directory {
5581            proc: self.proc.clone(),
5582            selection: query,
5583            graphql_client: self.graphql_client.clone(),
5584        }
5585    }
5586    /// Retrieves this directory plus the contents of the given file copied to the given path.
5587    ///
5588    /// # Arguments
5589    ///
5590    /// * `path` - Location of the copied file (e.g., "/file.txt").
5591    /// * `source` - Identifier of the file to copy.
5592    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5593    pub fn with_file_opts<'a>(
5594        &self,
5595        path: impl Into<String>,
5596        source: impl IntoID<Id>,
5597        opts: DirectoryWithFileOpts<'a>,
5598    ) -> Directory {
5599        let mut query = self.selection.select("withFile");
5600        query = query.arg("path", path.into());
5601        query = query.arg_lazy(
5602            "source",
5603            Box::new(move || {
5604                let source = source.clone();
5605                Box::pin(async move { source.into_id().await.unwrap().quote() })
5606            }),
5607        );
5608        if let Some(permissions) = opts.permissions {
5609            query = query.arg("permissions", permissions);
5610        }
5611        if let Some(owner) = opts.owner {
5612            query = query.arg("owner", owner);
5613        }
5614        Directory {
5615            proc: self.proc.clone(),
5616            selection: query,
5617            graphql_client: self.graphql_client.clone(),
5618        }
5619    }
5620    /// Retrieves this directory plus the contents of the given files copied to the given path.
5621    ///
5622    /// # Arguments
5623    ///
5624    /// * `path` - Location where copied files should be placed (e.g., "/src").
5625    /// * `sources` - Identifiers of the files to copy.
5626    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5627    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5628        let mut query = self.selection.select("withFiles");
5629        query = query.arg("path", path.into());
5630        query = query.arg("sources", sources);
5631        Directory {
5632            proc: self.proc.clone(),
5633            selection: query,
5634            graphql_client: self.graphql_client.clone(),
5635        }
5636    }
5637    /// Retrieves this directory plus the contents of the given files copied to the given path.
5638    ///
5639    /// # Arguments
5640    ///
5641    /// * `path` - Location where copied files should be placed (e.g., "/src").
5642    /// * `sources` - Identifiers of the files to copy.
5643    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5644    pub fn with_files_opts(
5645        &self,
5646        path: impl Into<String>,
5647        sources: Vec<Id>,
5648        opts: DirectoryWithFilesOpts,
5649    ) -> Directory {
5650        let mut query = self.selection.select("withFiles");
5651        query = query.arg("path", path.into());
5652        query = query.arg("sources", sources);
5653        if let Some(permissions) = opts.permissions {
5654            query = query.arg("permissions", permissions);
5655        }
5656        Directory {
5657            proc: self.proc.clone(),
5658            selection: query,
5659            graphql_client: self.graphql_client.clone(),
5660        }
5661    }
5662    /// Retrieves this directory plus a new directory created at the given path.
5663    ///
5664    /// # Arguments
5665    ///
5666    /// * `path` - Location of the directory created (e.g., "/logs").
5667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5668    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5669        let mut query = self.selection.select("withNewDirectory");
5670        query = query.arg("path", path.into());
5671        Directory {
5672            proc: self.proc.clone(),
5673            selection: query,
5674            graphql_client: self.graphql_client.clone(),
5675        }
5676    }
5677    /// Retrieves this directory plus a new directory created at the given path.
5678    ///
5679    /// # Arguments
5680    ///
5681    /// * `path` - Location of the directory created (e.g., "/logs").
5682    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5683    pub fn with_new_directory_opts(
5684        &self,
5685        path: impl Into<String>,
5686        opts: DirectoryWithNewDirectoryOpts,
5687    ) -> Directory {
5688        let mut query = self.selection.select("withNewDirectory");
5689        query = query.arg("path", path.into());
5690        if let Some(permissions) = opts.permissions {
5691            query = query.arg("permissions", permissions);
5692        }
5693        Directory {
5694            proc: self.proc.clone(),
5695            selection: query,
5696            graphql_client: self.graphql_client.clone(),
5697        }
5698    }
5699    /// Return a snapshot with a new file added
5700    ///
5701    /// # Arguments
5702    ///
5703    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5704    /// * `contents` - Contents of the new file. Example: "Hello world!"
5705    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5706    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5707        let mut query = self.selection.select("withNewFile");
5708        query = query.arg("path", path.into());
5709        query = query.arg("contents", contents.into());
5710        Directory {
5711            proc: self.proc.clone(),
5712            selection: query,
5713            graphql_client: self.graphql_client.clone(),
5714        }
5715    }
5716    /// Return a snapshot with a new file added
5717    ///
5718    /// # Arguments
5719    ///
5720    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5721    /// * `contents` - Contents of the new file. Example: "Hello world!"
5722    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5723    pub fn with_new_file_opts(
5724        &self,
5725        path: impl Into<String>,
5726        contents: impl Into<String>,
5727        opts: DirectoryWithNewFileOpts,
5728    ) -> Directory {
5729        let mut query = self.selection.select("withNewFile");
5730        query = query.arg("path", path.into());
5731        query = query.arg("contents", contents.into());
5732        if let Some(permissions) = opts.permissions {
5733            query = query.arg("permissions", permissions);
5734        }
5735        Directory {
5736            proc: self.proc.clone(),
5737            selection: query,
5738            graphql_client: self.graphql_client.clone(),
5739        }
5740    }
5741    /// Retrieves this directory with the given Git-compatible patch applied.
5742    ///
5743    /// # Arguments
5744    ///
5745    /// * `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").
5746    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5747    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5748        let mut query = self.selection.select("withPatch");
5749        query = query.arg("patch", patch.into());
5750        Directory {
5751            proc: self.proc.clone(),
5752            selection: query,
5753            graphql_client: self.graphql_client.clone(),
5754        }
5755    }
5756    /// Retrieves this directory with the given Git-compatible patch applied.
5757    ///
5758    /// # Arguments
5759    ///
5760    /// * `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").
5761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5762    pub fn with_patch_opts(
5763        &self,
5764        patch: impl Into<String>,
5765        opts: DirectoryWithPatchOpts,
5766    ) -> Directory {
5767        let mut query = self.selection.select("withPatch");
5768        query = query.arg("patch", patch.into());
5769        if let Some(on_conflict) = opts.on_conflict {
5770            query = query.arg("onConflict", on_conflict);
5771        }
5772        Directory {
5773            proc: self.proc.clone(),
5774            selection: query,
5775            graphql_client: self.graphql_client.clone(),
5776        }
5777    }
5778    /// Retrieves this directory with the given Git-compatible patch file applied.
5779    ///
5780    /// # Arguments
5781    ///
5782    /// * `patch` - File containing the patch to apply
5783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5784    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5785        let mut query = self.selection.select("withPatchFile");
5786        query = query.arg_lazy(
5787            "patch",
5788            Box::new(move || {
5789                let patch = patch.clone();
5790                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5791            }),
5792        );
5793        Directory {
5794            proc: self.proc.clone(),
5795            selection: query,
5796            graphql_client: self.graphql_client.clone(),
5797        }
5798    }
5799    /// Retrieves this directory with the given Git-compatible patch file applied.
5800    ///
5801    /// # Arguments
5802    ///
5803    /// * `patch` - File containing the patch to apply
5804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5805    pub fn with_patch_file_opts(
5806        &self,
5807        patch: impl IntoID<Id>,
5808        opts: DirectoryWithPatchFileOpts,
5809    ) -> Directory {
5810        let mut query = self.selection.select("withPatchFile");
5811        query = query.arg_lazy(
5812            "patch",
5813            Box::new(move || {
5814                let patch = patch.clone();
5815                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5816            }),
5817        );
5818        if let Some(on_conflict) = opts.on_conflict {
5819            query = query.arg("onConflict", on_conflict);
5820        }
5821        Directory {
5822            proc: self.proc.clone(),
5823            selection: query,
5824            graphql_client: self.graphql_client.clone(),
5825        }
5826    }
5827    /// Return a snapshot with a symlink
5828    ///
5829    /// # Arguments
5830    ///
5831    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5832    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5833    pub fn with_symlink(
5834        &self,
5835        target: impl Into<String>,
5836        link_name: impl Into<String>,
5837    ) -> Directory {
5838        let mut query = self.selection.select("withSymlink");
5839        query = query.arg("target", target.into());
5840        query = query.arg("linkName", link_name.into());
5841        Directory {
5842            proc: self.proc.clone(),
5843            selection: query,
5844            graphql_client: self.graphql_client.clone(),
5845        }
5846    }
5847    /// Retrieves this directory with all file/dir timestamps set to the given time.
5848    ///
5849    /// # Arguments
5850    ///
5851    /// * `timestamp` - Timestamp to set dir/files in.
5852    ///
5853    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5854    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5855        let mut query = self.selection.select("withTimestamps");
5856        query = query.arg("timestamp", timestamp);
5857        Directory {
5858            proc: self.proc.clone(),
5859            selection: query,
5860            graphql_client: self.graphql_client.clone(),
5861        }
5862    }
5863    /// Return a snapshot with a subdirectory removed
5864    ///
5865    /// # Arguments
5866    ///
5867    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5868    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5869        let mut query = self.selection.select("withoutDirectory");
5870        query = query.arg("path", path.into());
5871        Directory {
5872            proc: self.proc.clone(),
5873            selection: query,
5874            graphql_client: self.graphql_client.clone(),
5875        }
5876    }
5877    /// Return a snapshot with a file removed
5878    ///
5879    /// # Arguments
5880    ///
5881    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5882    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5883        let mut query = self.selection.select("withoutFile");
5884        query = query.arg("path", path.into());
5885        Directory {
5886            proc: self.proc.clone(),
5887            selection: query,
5888            graphql_client: self.graphql_client.clone(),
5889        }
5890    }
5891    /// Return a snapshot with files removed
5892    ///
5893    /// # Arguments
5894    ///
5895    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5896    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5897        let mut query = self.selection.select("withoutFiles");
5898        query = query.arg(
5899            "paths",
5900            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5901        );
5902        Directory {
5903            proc: self.proc.clone(),
5904            selection: query,
5905            graphql_client: self.graphql_client.clone(),
5906        }
5907    }
5908}
5909impl Exportable for Directory {
5910    fn export(
5911        &self,
5912        path: impl Into<String>,
5913    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5914        let mut query = self.selection.select("export");
5915        query = query.arg("path", path.into());
5916        let graphql_client = self.graphql_client.clone();
5917        async move { query.execute(graphql_client).await }
5918    }
5919    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5920        let query = self.selection.select("id");
5921        let graphql_client = self.graphql_client.clone();
5922        async move { query.execute(graphql_client).await }
5923    }
5924}
5925impl Node for Directory {
5926    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5927        let query = self.selection.select("id");
5928        let graphql_client = self.graphql_client.clone();
5929        async move { query.execute(graphql_client).await }
5930    }
5931}
5932impl Syncer for Directory {
5933    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5934        let query = self.selection.select("id");
5935        let graphql_client = self.graphql_client.clone();
5936        async move { query.execute(graphql_client).await }
5937    }
5938    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5939        let query = self.selection.select("sync");
5940        let graphql_client = self.graphql_client.clone();
5941        async move { query.execute(graphql_client).await }
5942    }
5943}
5944#[derive(Clone)]
5945pub struct Engine {
5946    pub proc: Option<Arc<DaggerSessionProc>>,
5947    pub selection: Selection,
5948    pub graphql_client: DynGraphQLClient,
5949}
5950impl IntoID<Id> for Engine {
5951    fn into_id(
5952        self,
5953    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5954        Box::pin(async move { self.id().await })
5955    }
5956}
5957impl Loadable for Engine {
5958    fn graphql_type() -> &'static str {
5959        "Engine"
5960    }
5961    fn from_query(
5962        proc: Option<Arc<DaggerSessionProc>>,
5963        selection: Selection,
5964        graphql_client: DynGraphQLClient,
5965    ) -> Self {
5966        Self {
5967            proc,
5968            selection,
5969            graphql_client,
5970        }
5971    }
5972}
5973impl Engine {
5974    /// The list of connected client IDs
5975    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5976        let query = self.selection.select("clients");
5977        query.execute(self.graphql_client.clone()).await
5978    }
5979    /// A unique identifier for this Engine.
5980    pub async fn id(&self) -> Result<Id, DaggerError> {
5981        let query = self.selection.select("id");
5982        query.execute(self.graphql_client.clone()).await
5983    }
5984    /// The local engine cache state tracked by dagql
5985    pub fn local_cache(&self) -> EngineCache {
5986        let query = self.selection.select("localCache");
5987        EngineCache {
5988            proc: self.proc.clone(),
5989            selection: query,
5990            graphql_client: self.graphql_client.clone(),
5991        }
5992    }
5993    /// The name of the engine instance.
5994    pub async fn name(&self) -> Result<String, DaggerError> {
5995        let query = self.selection.select("name");
5996        query.execute(self.graphql_client.clone()).await
5997    }
5998}
5999impl Node for Engine {
6000    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6001        let query = self.selection.select("id");
6002        let graphql_client = self.graphql_client.clone();
6003        async move { query.execute(graphql_client).await }
6004    }
6005}
6006#[derive(Clone)]
6007pub struct EngineCache {
6008    pub proc: Option<Arc<DaggerSessionProc>>,
6009    pub selection: Selection,
6010    pub graphql_client: DynGraphQLClient,
6011}
6012#[derive(Builder, Debug, PartialEq)]
6013pub struct EngineCacheEntrySetOpts<'a> {
6014    #[builder(setter(into, strip_option), default)]
6015    pub key: Option<&'a str>,
6016}
6017#[derive(Builder, Debug, PartialEq)]
6018pub struct EngineCachePruneOpts<'a> {
6019    /// Override the maximum structural metadata estimate in absolute bytes. Explicit values must be positive; the configured/default value is used when omitted.
6020    #[builder(setter(into, strip_option), default)]
6021    pub max_estimated_bytes: Option<isize>,
6022    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
6023    #[builder(setter(into, strip_option), default)]
6024    pub max_used_space: Option<&'a str>,
6025    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
6026    #[builder(setter(into, strip_option), default)]
6027    pub min_free_space: Option<&'a str>,
6028    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
6029    #[builder(setter(into, strip_option), default)]
6030    pub reserved_space: Option<&'a str>,
6031    /// 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.
6032    #[builder(setter(into, strip_option), default)]
6033    pub target_estimated_bytes: Option<isize>,
6034    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
6035    #[builder(setter(into, strip_option), default)]
6036    pub target_space: Option<&'a str>,
6037    /// 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.
6038    #[builder(setter(into, strip_option), default)]
6039    pub use_default_policy: Option<bool>,
6040}
6041impl IntoID<Id> for EngineCache {
6042    fn into_id(
6043        self,
6044    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6045        Box::pin(async move { self.id().await })
6046    }
6047}
6048impl Loadable for EngineCache {
6049    fn graphql_type() -> &'static str {
6050        "EngineCache"
6051    }
6052    fn from_query(
6053        proc: Option<Arc<DaggerSessionProc>>,
6054        selection: Selection,
6055        graphql_client: DynGraphQLClient,
6056    ) -> Self {
6057        Self {
6058            proc,
6059            selection,
6060            graphql_client,
6061        }
6062    }
6063}
6064impl EngineCache {
6065    /// The current set of entries in the cache
6066    ///
6067    /// # Arguments
6068    ///
6069    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6070    pub fn entry_set(&self) -> EngineCacheEntrySet {
6071        let query = self.selection.select("entrySet");
6072        EngineCacheEntrySet {
6073            proc: self.proc.clone(),
6074            selection: query,
6075            graphql_client: self.graphql_client.clone(),
6076        }
6077    }
6078    /// The current set of entries in the cache
6079    ///
6080    /// # Arguments
6081    ///
6082    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6083    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6084        let mut query = self.selection.select("entrySet");
6085        if let Some(key) = opts.key {
6086            query = query.arg("key", key);
6087        }
6088        EngineCacheEntrySet {
6089            proc: self.proc.clone(),
6090            selection: query,
6091            graphql_client: self.graphql_client.clone(),
6092        }
6093    }
6094    /// A unique identifier for this EngineCache.
6095    pub async fn id(&self) -> Result<Id, DaggerError> {
6096        let query = self.selection.select("id");
6097        query.execute(self.graphql_client.clone()).await
6098    }
6099    /// The maximum bytes to keep in the cache without pruning.
6100    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6101        let query = self.selection.select("maxUsedSpace");
6102        query.execute(self.graphql_client.clone()).await
6103    }
6104    /// The target amount of free disk space the garbage collector will attempt to leave.
6105    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6106        let query = self.selection.select("minFreeSpace");
6107        query.execute(self.graphql_client.clone()).await
6108    }
6109    /// Prune the cache of releaseable entries
6110    ///
6111    /// # Arguments
6112    ///
6113    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6114    pub async fn prune(&self) -> Result<Void, DaggerError> {
6115        let query = self.selection.select("prune");
6116        query.execute(self.graphql_client.clone()).await
6117    }
6118    /// Prune the cache of releaseable entries
6119    ///
6120    /// # Arguments
6121    ///
6122    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6123    pub async fn prune_opts<'a>(
6124        &self,
6125        opts: EngineCachePruneOpts<'a>,
6126    ) -> Result<Void, DaggerError> {
6127        let mut query = self.selection.select("prune");
6128        if let Some(use_default_policy) = opts.use_default_policy {
6129            query = query.arg("useDefaultPolicy", use_default_policy);
6130        }
6131        if let Some(max_used_space) = opts.max_used_space {
6132            query = query.arg("maxUsedSpace", max_used_space);
6133        }
6134        if let Some(reserved_space) = opts.reserved_space {
6135            query = query.arg("reservedSpace", reserved_space);
6136        }
6137        if let Some(min_free_space) = opts.min_free_space {
6138            query = query.arg("minFreeSpace", min_free_space);
6139        }
6140        if let Some(target_space) = opts.target_space {
6141            query = query.arg("targetSpace", target_space);
6142        }
6143        if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
6144            query = query.arg("maxEstimatedBytes", max_estimated_bytes);
6145        }
6146        if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
6147            query = query.arg("targetEstimatedBytes", target_estimated_bytes);
6148        }
6149        query.execute(self.graphql_client.clone()).await
6150    }
6151    /// The minimum amount of disk space this policy is guaranteed to retain.
6152    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6153        let query = self.selection.select("reservedSpace");
6154        query.execute(self.graphql_client.clone()).await
6155    }
6156    /// The target number of bytes to keep when pruning.
6157    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6158        let query = self.selection.select("targetSpace");
6159        query.execute(self.graphql_client.clone()).await
6160    }
6161}
6162impl Node for EngineCache {
6163    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6164        let query = self.selection.select("id");
6165        let graphql_client = self.graphql_client.clone();
6166        async move { query.execute(graphql_client).await }
6167    }
6168}
6169#[derive(Clone)]
6170pub struct EngineCacheEntry {
6171    pub proc: Option<Arc<DaggerSessionProc>>,
6172    pub selection: Selection,
6173    pub graphql_client: DynGraphQLClient,
6174}
6175impl IntoID<Id> for EngineCacheEntry {
6176    fn into_id(
6177        self,
6178    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6179        Box::pin(async move { self.id().await })
6180    }
6181}
6182impl Loadable for EngineCacheEntry {
6183    fn graphql_type() -> &'static str {
6184        "EngineCacheEntry"
6185    }
6186    fn from_query(
6187        proc: Option<Arc<DaggerSessionProc>>,
6188        selection: Selection,
6189        graphql_client: DynGraphQLClient,
6190    ) -> Self {
6191        Self {
6192            proc,
6193            selection,
6194            graphql_client,
6195        }
6196    }
6197}
6198impl EngineCacheEntry {
6199    /// Whether the cache entry is actively being used.
6200    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6201        let query = self.selection.select("activelyUsed");
6202        query.execute(self.graphql_client.clone()).await
6203    }
6204    /// The time the cache entry was created, in Unix nanoseconds.
6205    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6206        let query = self.selection.select("createdTimeUnixNano");
6207        query.execute(self.graphql_client.clone()).await
6208    }
6209    /// The DagQL call that produced this cache entry.
6210    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
6211        let query = self.selection.select("dagqlCall");
6212        query.execute(self.graphql_client.clone()).await
6213    }
6214    /// The description of the cache entry.
6215    pub async fn description(&self) -> Result<String, DaggerError> {
6216        let query = self.selection.select("description");
6217        query.execute(self.graphql_client.clone()).await
6218    }
6219    /// The disk space used by the cache entry.
6220    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6221        let query = self.selection.select("diskSpaceBytes");
6222        query.execute(self.graphql_client.clone()).await
6223    }
6224    /// A unique identifier for this EngineCacheEntry.
6225    pub async fn id(&self) -> Result<Id, DaggerError> {
6226        let query = self.selection.select("id");
6227        query.execute(self.graphql_client.clone()).await
6228    }
6229    /// The most recent time the cache entry was used, in Unix nanoseconds.
6230    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6231        let query = self.selection.select("mostRecentUseTimeUnixNano");
6232        query.execute(self.graphql_client.clone()).await
6233    }
6234    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
6235    pub async fn record_type(&self) -> Result<String, DaggerError> {
6236        let query = self.selection.select("recordType");
6237        query.execute(self.graphql_client.clone()).await
6238    }
6239    /// The storage record types represented by this cache entry.
6240    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
6241        let query = self.selection.select("recordTypes");
6242        query.execute(self.graphql_client.clone()).await
6243    }
6244}
6245impl Node for EngineCacheEntry {
6246    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6247        let query = self.selection.select("id");
6248        let graphql_client = self.graphql_client.clone();
6249        async move { query.execute(graphql_client).await }
6250    }
6251}
6252#[derive(Clone)]
6253pub struct EngineCacheEntrySet {
6254    pub proc: Option<Arc<DaggerSessionProc>>,
6255    pub selection: Selection,
6256    pub graphql_client: DynGraphQLClient,
6257}
6258impl IntoID<Id> for EngineCacheEntrySet {
6259    fn into_id(
6260        self,
6261    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6262        Box::pin(async move { self.id().await })
6263    }
6264}
6265impl Loadable for EngineCacheEntrySet {
6266    fn graphql_type() -> &'static str {
6267        "EngineCacheEntrySet"
6268    }
6269    fn from_query(
6270        proc: Option<Arc<DaggerSessionProc>>,
6271        selection: Selection,
6272        graphql_client: DynGraphQLClient,
6273    ) -> Self {
6274        Self {
6275            proc,
6276            selection,
6277            graphql_client,
6278        }
6279    }
6280}
6281impl EngineCacheEntrySet {
6282    /// The total disk space used by the cache entries in this set.
6283    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6284        let query = self.selection.select("diskSpaceBytes");
6285        query.execute(self.graphql_client.clone()).await
6286    }
6287    /// The list of individual cache entries in the set
6288    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6289        let query = self.selection.select("entries");
6290        let query = query.select("id");
6291        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6292        Ok(ids
6293            .into_iter()
6294            .map(|id| EngineCacheEntry {
6295                proc: self.proc.clone(),
6296                selection: crate::querybuilder::query()
6297                    .select("node")
6298                    .arg("id", &id.0)
6299                    .inline_fragment("EngineCacheEntry"),
6300                graphql_client: self.graphql_client.clone(),
6301            })
6302            .collect())
6303    }
6304    /// The number of cache entries in this set.
6305    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6306        let query = self.selection.select("entryCount");
6307        query.execute(self.graphql_client.clone()).await
6308    }
6309    /// A unique identifier for this EngineCacheEntrySet.
6310    pub async fn id(&self) -> Result<Id, DaggerError> {
6311        let query = self.selection.select("id");
6312        query.execute(self.graphql_client.clone()).await
6313    }
6314}
6315impl Node for EngineCacheEntrySet {
6316    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6317        let query = self.selection.select("id");
6318        let graphql_client = self.graphql_client.clone();
6319        async move { query.execute(graphql_client).await }
6320    }
6321}
6322#[derive(Clone)]
6323pub struct EnumTypeDef {
6324    pub proc: Option<Arc<DaggerSessionProc>>,
6325    pub selection: Selection,
6326    pub graphql_client: DynGraphQLClient,
6327}
6328impl IntoID<Id> for EnumTypeDef {
6329    fn into_id(
6330        self,
6331    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6332        Box::pin(async move { self.id().await })
6333    }
6334}
6335impl Loadable for EnumTypeDef {
6336    fn graphql_type() -> &'static str {
6337        "EnumTypeDef"
6338    }
6339    fn from_query(
6340        proc: Option<Arc<DaggerSessionProc>>,
6341        selection: Selection,
6342        graphql_client: DynGraphQLClient,
6343    ) -> Self {
6344        Self {
6345            proc,
6346            selection,
6347            graphql_client,
6348        }
6349    }
6350}
6351impl EnumTypeDef {
6352    /// A doc string for the enum, if any.
6353    pub async fn description(&self) -> Result<String, DaggerError> {
6354        let query = self.selection.select("description");
6355        query.execute(self.graphql_client.clone()).await
6356    }
6357    /// A unique identifier for this EnumTypeDef.
6358    pub async fn id(&self) -> Result<Id, DaggerError> {
6359        let query = self.selection.select("id");
6360        query.execute(self.graphql_client.clone()).await
6361    }
6362    /// The members of the enum.
6363    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6364        let query = self.selection.select("members");
6365        let query = query.select("id");
6366        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6367        Ok(ids
6368            .into_iter()
6369            .map(|id| EnumValueTypeDef {
6370                proc: self.proc.clone(),
6371                selection: crate::querybuilder::query()
6372                    .select("node")
6373                    .arg("id", &id.0)
6374                    .inline_fragment("EnumValueTypeDef"),
6375                graphql_client: self.graphql_client.clone(),
6376            })
6377            .collect())
6378    }
6379    /// The name of the enum.
6380    pub async fn name(&self) -> Result<String, DaggerError> {
6381        let query = self.selection.select("name");
6382        query.execute(self.graphql_client.clone()).await
6383    }
6384    /// The location of this enum declaration.
6385    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6386        let query = self.selection.select("sourceMap");
6387        let query = query.select("id");
6388        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6389        Ok(id.map(|id| SourceMap {
6390            proc: self.proc.clone(),
6391            selection: query
6392                .root()
6393                .select("node")
6394                .arg("id", &id.0)
6395                .inline_fragment("SourceMap"),
6396            graphql_client: self.graphql_client.clone(),
6397        }))
6398    }
6399    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6400    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6401        let query = self.selection.select("sourceModuleName");
6402        query.execute(self.graphql_client.clone()).await
6403    }
6404    /// The members of the enum.
6405    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6406        let query = self.selection.select("values");
6407        let query = query.select("id");
6408        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6409        Ok(ids
6410            .into_iter()
6411            .map(|id| EnumValueTypeDef {
6412                proc: self.proc.clone(),
6413                selection: crate::querybuilder::query()
6414                    .select("node")
6415                    .arg("id", &id.0)
6416                    .inline_fragment("EnumValueTypeDef"),
6417                graphql_client: self.graphql_client.clone(),
6418            })
6419            .collect())
6420    }
6421}
6422impl Node for EnumTypeDef {
6423    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6424        let query = self.selection.select("id");
6425        let graphql_client = self.graphql_client.clone();
6426        async move { query.execute(graphql_client).await }
6427    }
6428}
6429#[derive(Clone)]
6430pub struct EnumValueTypeDef {
6431    pub proc: Option<Arc<DaggerSessionProc>>,
6432    pub selection: Selection,
6433    pub graphql_client: DynGraphQLClient,
6434}
6435impl IntoID<Id> for EnumValueTypeDef {
6436    fn into_id(
6437        self,
6438    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6439        Box::pin(async move { self.id().await })
6440    }
6441}
6442impl Loadable for EnumValueTypeDef {
6443    fn graphql_type() -> &'static str {
6444        "EnumValueTypeDef"
6445    }
6446    fn from_query(
6447        proc: Option<Arc<DaggerSessionProc>>,
6448        selection: Selection,
6449        graphql_client: DynGraphQLClient,
6450    ) -> Self {
6451        Self {
6452            proc,
6453            selection,
6454            graphql_client,
6455        }
6456    }
6457}
6458impl EnumValueTypeDef {
6459    /// The reason this enum member is deprecated, if any.
6460    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6461        let query = self.selection.select("deprecated");
6462        query.execute(self.graphql_client.clone()).await
6463    }
6464    /// A doc string for the enum member, if any.
6465    pub async fn description(&self) -> Result<String, DaggerError> {
6466        let query = self.selection.select("description");
6467        query.execute(self.graphql_client.clone()).await
6468    }
6469    /// A unique identifier for this EnumValueTypeDef.
6470    pub async fn id(&self) -> Result<Id, DaggerError> {
6471        let query = self.selection.select("id");
6472        query.execute(self.graphql_client.clone()).await
6473    }
6474    /// The name of the enum member.
6475    pub async fn name(&self) -> Result<String, DaggerError> {
6476        let query = self.selection.select("name");
6477        query.execute(self.graphql_client.clone()).await
6478    }
6479    /// The location of this enum member declaration.
6480    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6481        let query = self.selection.select("sourceMap");
6482        let query = query.select("id");
6483        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6484        Ok(id.map(|id| SourceMap {
6485            proc: self.proc.clone(),
6486            selection: query
6487                .root()
6488                .select("node")
6489                .arg("id", &id.0)
6490                .inline_fragment("SourceMap"),
6491            graphql_client: self.graphql_client.clone(),
6492        }))
6493    }
6494    /// The value of the enum member
6495    pub async fn value(&self) -> Result<String, DaggerError> {
6496        let query = self.selection.select("value");
6497        query.execute(self.graphql_client.clone()).await
6498    }
6499}
6500impl Node for EnumValueTypeDef {
6501    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6502        let query = self.selection.select("id");
6503        let graphql_client = self.graphql_client.clone();
6504        async move { query.execute(graphql_client).await }
6505    }
6506}
6507#[derive(Clone)]
6508pub struct EnvFile {
6509    pub proc: Option<Arc<DaggerSessionProc>>,
6510    pub selection: Selection,
6511    pub graphql_client: DynGraphQLClient,
6512}
6513#[derive(Builder, Debug, PartialEq)]
6514pub struct EnvFileGetOpts {
6515    /// Return the value exactly as written to the file. No quote removal or variable expansion
6516    #[builder(setter(into, strip_option), default)]
6517    pub raw: Option<bool>,
6518}
6519#[derive(Builder, Debug, PartialEq)]
6520pub struct EnvFileVariablesOpts {
6521    /// Return values exactly as written to the file. No quote removal or variable expansion
6522    #[builder(setter(into, strip_option), default)]
6523    pub raw: Option<bool>,
6524}
6525impl IntoID<Id> for EnvFile {
6526    fn into_id(
6527        self,
6528    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6529        Box::pin(async move { self.id().await })
6530    }
6531}
6532impl Loadable for EnvFile {
6533    fn graphql_type() -> &'static str {
6534        "EnvFile"
6535    }
6536    fn from_query(
6537        proc: Option<Arc<DaggerSessionProc>>,
6538        selection: Selection,
6539        graphql_client: DynGraphQLClient,
6540    ) -> Self {
6541        Self {
6542            proc,
6543            selection,
6544            graphql_client,
6545        }
6546    }
6547}
6548impl EnvFile {
6549    /// Return as a file
6550    pub fn as_file(&self) -> File {
6551        let query = self.selection.select("asFile");
6552        File {
6553            proc: self.proc.clone(),
6554            selection: query,
6555            graphql_client: self.graphql_client.clone(),
6556        }
6557    }
6558    /// Check if a variable exists
6559    ///
6560    /// # Arguments
6561    ///
6562    /// * `name` - Variable name
6563    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
6564        let mut query = self.selection.select("exists");
6565        query = query.arg("name", name.into());
6566        query.execute(self.graphql_client.clone()).await
6567    }
6568    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
6569    ///
6570    /// # Arguments
6571    ///
6572    /// * `name` - Variable name
6573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6574    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
6575        let mut query = self.selection.select("get");
6576        query = query.arg("name", name.into());
6577        query.execute(self.graphql_client.clone()).await
6578    }
6579    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
6580    ///
6581    /// # Arguments
6582    ///
6583    /// * `name` - Variable name
6584    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6585    pub async fn get_opts(
6586        &self,
6587        name: impl Into<String>,
6588        opts: EnvFileGetOpts,
6589    ) -> Result<String, DaggerError> {
6590        let mut query = self.selection.select("get");
6591        query = query.arg("name", name.into());
6592        if let Some(raw) = opts.raw {
6593            query = query.arg("raw", raw);
6594        }
6595        query.execute(self.graphql_client.clone()).await
6596    }
6597    /// A unique identifier for this EnvFile.
6598    pub async fn id(&self) -> Result<Id, DaggerError> {
6599        let query = self.selection.select("id");
6600        query.execute(self.graphql_client.clone()).await
6601    }
6602    /// 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
6603    ///
6604    /// # Arguments
6605    ///
6606    /// * `prefix` - The prefix to filter by
6607    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
6608        let mut query = self.selection.select("namespace");
6609        query = query.arg("prefix", prefix.into());
6610        EnvFile {
6611            proc: self.proc.clone(),
6612            selection: query,
6613            graphql_client: self.graphql_client.clone(),
6614        }
6615    }
6616    /// Return all variables
6617    ///
6618    /// # Arguments
6619    ///
6620    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6621    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
6622        let query = self.selection.select("variables");
6623        let query = query.select("id");
6624        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6625        Ok(ids
6626            .into_iter()
6627            .map(|id| EnvVariable {
6628                proc: self.proc.clone(),
6629                selection: crate::querybuilder::query()
6630                    .select("node")
6631                    .arg("id", &id.0)
6632                    .inline_fragment("EnvVariable"),
6633                graphql_client: self.graphql_client.clone(),
6634            })
6635            .collect())
6636    }
6637    /// Return all variables
6638    ///
6639    /// # Arguments
6640    ///
6641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6642    pub async fn variables_opts(
6643        &self,
6644        opts: EnvFileVariablesOpts,
6645    ) -> Result<Vec<EnvVariable>, DaggerError> {
6646        let mut query = self.selection.select("variables");
6647        if let Some(raw) = opts.raw {
6648            query = query.arg("raw", raw);
6649        }
6650        let query = query.select("id");
6651        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6652        Ok(ids
6653            .into_iter()
6654            .map(|id| EnvVariable {
6655                proc: self.proc.clone(),
6656                selection: crate::querybuilder::query()
6657                    .select("node")
6658                    .arg("id", &id.0)
6659                    .inline_fragment("EnvVariable"),
6660                graphql_client: self.graphql_client.clone(),
6661            })
6662            .collect())
6663    }
6664    /// Add a variable
6665    ///
6666    /// # Arguments
6667    ///
6668    /// * `name` - Variable name
6669    /// * `value` - Variable value
6670    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
6671        let mut query = self.selection.select("withVariable");
6672        query = query.arg("name", name.into());
6673        query = query.arg("value", value.into());
6674        EnvFile {
6675            proc: self.proc.clone(),
6676            selection: query,
6677            graphql_client: self.graphql_client.clone(),
6678        }
6679    }
6680    /// Remove all occurrences of the named variable
6681    ///
6682    /// # Arguments
6683    ///
6684    /// * `name` - Variable name
6685    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
6686        let mut query = self.selection.select("withoutVariable");
6687        query = query.arg("name", name.into());
6688        EnvFile {
6689            proc: self.proc.clone(),
6690            selection: query,
6691            graphql_client: self.graphql_client.clone(),
6692        }
6693    }
6694}
6695impl Node for EnvFile {
6696    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6697        let query = self.selection.select("id");
6698        let graphql_client = self.graphql_client.clone();
6699        async move { query.execute(graphql_client).await }
6700    }
6701}
6702#[derive(Clone)]
6703pub struct EnvVariable {
6704    pub proc: Option<Arc<DaggerSessionProc>>,
6705    pub selection: Selection,
6706    pub graphql_client: DynGraphQLClient,
6707}
6708impl IntoID<Id> for EnvVariable {
6709    fn into_id(
6710        self,
6711    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6712        Box::pin(async move { self.id().await })
6713    }
6714}
6715impl Loadable for EnvVariable {
6716    fn graphql_type() -> &'static str {
6717        "EnvVariable"
6718    }
6719    fn from_query(
6720        proc: Option<Arc<DaggerSessionProc>>,
6721        selection: Selection,
6722        graphql_client: DynGraphQLClient,
6723    ) -> Self {
6724        Self {
6725            proc,
6726            selection,
6727            graphql_client,
6728        }
6729    }
6730}
6731impl EnvVariable {
6732    /// A unique identifier for this EnvVariable.
6733    pub async fn id(&self) -> Result<Id, DaggerError> {
6734        let query = self.selection.select("id");
6735        query.execute(self.graphql_client.clone()).await
6736    }
6737    /// The environment variable name.
6738    pub async fn name(&self) -> Result<String, DaggerError> {
6739        let query = self.selection.select("name");
6740        query.execute(self.graphql_client.clone()).await
6741    }
6742    /// The environment variable value.
6743    pub async fn value(&self) -> Result<String, DaggerError> {
6744        let query = self.selection.select("value");
6745        query.execute(self.graphql_client.clone()).await
6746    }
6747}
6748impl Node for EnvVariable {
6749    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6750        let query = self.selection.select("id");
6751        let graphql_client = self.graphql_client.clone();
6752        async move { query.execute(graphql_client).await }
6753    }
6754}
6755#[derive(Clone)]
6756pub struct Error {
6757    pub proc: Option<Arc<DaggerSessionProc>>,
6758    pub selection: Selection,
6759    pub graphql_client: DynGraphQLClient,
6760}
6761impl IntoID<Id> for Error {
6762    fn into_id(
6763        self,
6764    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6765        Box::pin(async move { self.id().await })
6766    }
6767}
6768impl Loadable for Error {
6769    fn graphql_type() -> &'static str {
6770        "Error"
6771    }
6772    fn from_query(
6773        proc: Option<Arc<DaggerSessionProc>>,
6774        selection: Selection,
6775        graphql_client: DynGraphQLClient,
6776    ) -> Self {
6777        Self {
6778            proc,
6779            selection,
6780            graphql_client,
6781        }
6782    }
6783}
6784impl Error {
6785    /// A unique identifier for this Error.
6786    pub async fn id(&self) -> Result<Id, DaggerError> {
6787        let query = self.selection.select("id");
6788        query.execute(self.graphql_client.clone()).await
6789    }
6790    /// A description of the error.
6791    pub async fn message(&self) -> Result<String, DaggerError> {
6792        let query = self.selection.select("message");
6793        query.execute(self.graphql_client.clone()).await
6794    }
6795    /// The extensions of the error.
6796    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
6797        let query = self.selection.select("values");
6798        let query = query.select("id");
6799        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6800        Ok(ids
6801            .into_iter()
6802            .map(|id| ErrorValue {
6803                proc: self.proc.clone(),
6804                selection: crate::querybuilder::query()
6805                    .select("node")
6806                    .arg("id", &id.0)
6807                    .inline_fragment("ErrorValue"),
6808                graphql_client: self.graphql_client.clone(),
6809            })
6810            .collect())
6811    }
6812    /// Add a value to the error.
6813    ///
6814    /// # Arguments
6815    ///
6816    /// * `name` - The name of the value.
6817    /// * `value` - The value to store on the error.
6818    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
6819        let mut query = self.selection.select("withValue");
6820        query = query.arg("name", name.into());
6821        query = query.arg("value", value);
6822        Error {
6823            proc: self.proc.clone(),
6824            selection: query,
6825            graphql_client: self.graphql_client.clone(),
6826        }
6827    }
6828}
6829impl Node for Error {
6830    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6831        let query = self.selection.select("id");
6832        let graphql_client = self.graphql_client.clone();
6833        async move { query.execute(graphql_client).await }
6834    }
6835}
6836#[derive(Clone)]
6837pub struct ErrorValue {
6838    pub proc: Option<Arc<DaggerSessionProc>>,
6839    pub selection: Selection,
6840    pub graphql_client: DynGraphQLClient,
6841}
6842impl IntoID<Id> for ErrorValue {
6843    fn into_id(
6844        self,
6845    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6846        Box::pin(async move { self.id().await })
6847    }
6848}
6849impl Loadable for ErrorValue {
6850    fn graphql_type() -> &'static str {
6851        "ErrorValue"
6852    }
6853    fn from_query(
6854        proc: Option<Arc<DaggerSessionProc>>,
6855        selection: Selection,
6856        graphql_client: DynGraphQLClient,
6857    ) -> Self {
6858        Self {
6859            proc,
6860            selection,
6861            graphql_client,
6862        }
6863    }
6864}
6865impl ErrorValue {
6866    /// A unique identifier for this ErrorValue.
6867    pub async fn id(&self) -> Result<Id, DaggerError> {
6868        let query = self.selection.select("id");
6869        query.execute(self.graphql_client.clone()).await
6870    }
6871    /// The name of the value.
6872    pub async fn name(&self) -> Result<String, DaggerError> {
6873        let query = self.selection.select("name");
6874        query.execute(self.graphql_client.clone()).await
6875    }
6876    /// The value.
6877    pub async fn value(&self) -> Result<Json, DaggerError> {
6878        let query = self.selection.select("value");
6879        query.execute(self.graphql_client.clone()).await
6880    }
6881}
6882impl Node for ErrorValue {
6883    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6884        let query = self.selection.select("id");
6885        let graphql_client = self.graphql_client.clone();
6886        async move { query.execute(graphql_client).await }
6887    }
6888}
6889#[derive(Clone)]
6890pub struct FieldTypeDef {
6891    pub proc: Option<Arc<DaggerSessionProc>>,
6892    pub selection: Selection,
6893    pub graphql_client: DynGraphQLClient,
6894}
6895impl IntoID<Id> for FieldTypeDef {
6896    fn into_id(
6897        self,
6898    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6899        Box::pin(async move { self.id().await })
6900    }
6901}
6902impl Loadable for FieldTypeDef {
6903    fn graphql_type() -> &'static str {
6904        "FieldTypeDef"
6905    }
6906    fn from_query(
6907        proc: Option<Arc<DaggerSessionProc>>,
6908        selection: Selection,
6909        graphql_client: DynGraphQLClient,
6910    ) -> Self {
6911        Self {
6912            proc,
6913            selection,
6914            graphql_client,
6915        }
6916    }
6917}
6918impl FieldTypeDef {
6919    /// The reason this enum member is deprecated, if any.
6920    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6921        let query = self.selection.select("deprecated");
6922        query.execute(self.graphql_client.clone()).await
6923    }
6924    /// A doc string for the field, if any.
6925    pub async fn description(&self) -> Result<String, DaggerError> {
6926        let query = self.selection.select("description");
6927        query.execute(self.graphql_client.clone()).await
6928    }
6929    /// A unique identifier for this FieldTypeDef.
6930    pub async fn id(&self) -> Result<Id, DaggerError> {
6931        let query = self.selection.select("id");
6932        query.execute(self.graphql_client.clone()).await
6933    }
6934    /// The name of the field in lowerCamelCase format.
6935    pub async fn name(&self) -> Result<String, DaggerError> {
6936        let query = self.selection.select("name");
6937        query.execute(self.graphql_client.clone()).await
6938    }
6939    /// The location of this field declaration.
6940    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6941        let query = self.selection.select("sourceMap");
6942        let query = query.select("id");
6943        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6944        Ok(id.map(|id| SourceMap {
6945            proc: self.proc.clone(),
6946            selection: query
6947                .root()
6948                .select("node")
6949                .arg("id", &id.0)
6950                .inline_fragment("SourceMap"),
6951            graphql_client: self.graphql_client.clone(),
6952        }))
6953    }
6954    /// The type of the field.
6955    pub fn type_def(&self) -> TypeDef {
6956        let query = self.selection.select("typeDef");
6957        TypeDef {
6958            proc: self.proc.clone(),
6959            selection: query,
6960            graphql_client: self.graphql_client.clone(),
6961        }
6962    }
6963}
6964impl Node for FieldTypeDef {
6965    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6966        let query = self.selection.select("id");
6967        let graphql_client = self.graphql_client.clone();
6968        async move { query.execute(graphql_client).await }
6969    }
6970}
6971#[derive(Clone)]
6972pub struct File {
6973    pub proc: Option<Arc<DaggerSessionProc>>,
6974    pub selection: Selection,
6975    pub graphql_client: DynGraphQLClient,
6976}
6977#[derive(Builder, Debug, PartialEq)]
6978pub struct FileAsEnvFileOpts {
6979    /// Replace "${VAR}" or "$VAR" with the value of other vars
6980    #[builder(setter(into, strip_option), default)]
6981    pub expand: Option<bool>,
6982}
6983#[derive(Builder, Debug, PartialEq)]
6984pub struct FileContentsOpts {
6985    /// Maximum number of lines to read
6986    #[builder(setter(into, strip_option), default)]
6987    pub limit_lines: Option<isize>,
6988    /// Start reading after this line
6989    #[builder(setter(into, strip_option), default)]
6990    pub offset_lines: Option<isize>,
6991}
6992#[derive(Builder, Debug, PartialEq)]
6993pub struct FileDigestOpts {
6994    /// If true, exclude metadata from the digest.
6995    #[builder(setter(into, strip_option), default)]
6996    pub exclude_metadata: Option<bool>,
6997}
6998#[derive(Builder, Debug, PartialEq)]
6999pub struct FileExportOpts {
7000    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
7001    #[builder(setter(into, strip_option), default)]
7002    pub allow_parent_dir_path: Option<bool>,
7003}
7004#[derive(Builder, Debug, PartialEq)]
7005pub struct FileSearchOpts<'a> {
7006    /// Allow the . pattern to match newlines in multiline mode.
7007    #[builder(setter(into, strip_option), default)]
7008    pub dotall: Option<bool>,
7009    /// Only return matching files, not lines and content
7010    #[builder(setter(into, strip_option), default)]
7011    pub files_only: Option<bool>,
7012    #[builder(setter(into, strip_option), default)]
7013    pub globs: Option<Vec<&'a str>>,
7014    /// Enable case-insensitive matching.
7015    #[builder(setter(into, strip_option), default)]
7016    pub insensitive: Option<bool>,
7017    /// Limit the number of results to return
7018    #[builder(setter(into, strip_option), default)]
7019    pub limit: Option<isize>,
7020    /// Interpret the pattern as a literal string instead of a regular expression.
7021    #[builder(setter(into, strip_option), default)]
7022    pub literal: Option<bool>,
7023    /// Enable searching across multiple lines.
7024    #[builder(setter(into, strip_option), default)]
7025    pub multiline: Option<bool>,
7026    #[builder(setter(into, strip_option), default)]
7027    pub paths: Option<Vec<&'a str>>,
7028    /// Skip hidden files (files starting with .).
7029    #[builder(setter(into, strip_option), default)]
7030    pub skip_hidden: Option<bool>,
7031    /// Honor .gitignore, .ignore, and .rgignore files.
7032    #[builder(setter(into, strip_option), default)]
7033    pub skip_ignored: Option<bool>,
7034}
7035#[derive(Builder, Debug, PartialEq)]
7036pub struct FileWithReplacedOpts {
7037    /// Replace all occurrences of the pattern.
7038    #[builder(setter(into, strip_option), default)]
7039    pub all: Option<bool>,
7040    /// Replace the first match starting from the specified line.
7041    #[builder(setter(into, strip_option), default)]
7042    pub first_from: Option<isize>,
7043}
7044impl IntoID<Id> for File {
7045    fn into_id(
7046        self,
7047    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7048        Box::pin(async move { self.id().await })
7049    }
7050}
7051impl Loadable for File {
7052    fn graphql_type() -> &'static str {
7053        "File"
7054    }
7055    fn from_query(
7056        proc: Option<Arc<DaggerSessionProc>>,
7057        selection: Selection,
7058        graphql_client: DynGraphQLClient,
7059    ) -> Self {
7060        Self {
7061            proc,
7062            selection,
7063            graphql_client,
7064        }
7065    }
7066}
7067impl File {
7068    /// Parse as an env file
7069    ///
7070    /// # Arguments
7071    ///
7072    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7073    pub fn as_env_file(&self) -> EnvFile {
7074        let query = self.selection.select("asEnvFile");
7075        EnvFile {
7076            proc: self.proc.clone(),
7077            selection: query,
7078            graphql_client: self.graphql_client.clone(),
7079        }
7080    }
7081    /// Parse as an env file
7082    ///
7083    /// # Arguments
7084    ///
7085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7086    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7087        let mut query = self.selection.select("asEnvFile");
7088        if let Some(expand) = opts.expand {
7089            query = query.arg("expand", expand);
7090        }
7091        EnvFile {
7092            proc: self.proc.clone(),
7093            selection: query,
7094            graphql_client: self.graphql_client.clone(),
7095        }
7096    }
7097    /// Interpret this file as a Git bundle by lazily parsing its header.
7098    pub fn as_git_bundle(&self) -> GitBundle {
7099        let query = self.selection.select("asGitBundle");
7100        GitBundle {
7101            proc: self.proc.clone(),
7102            selection: query,
7103            graphql_client: self.graphql_client.clone(),
7104        }
7105    }
7106    /// Parse the file contents as JSON.
7107    pub fn as_json(&self) -> JsonValue {
7108        let query = self.selection.select("asJSON");
7109        JsonValue {
7110            proc: self.proc.clone(),
7111            selection: query,
7112            graphql_client: self.graphql_client.clone(),
7113        }
7114    }
7115    /// Change the owner of the file recursively.
7116    ///
7117    /// # Arguments
7118    ///
7119    /// * `owner` - A user:group to set for the file.
7120    ///
7121    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
7122    ///
7123    /// If the group is omitted, it defaults to the same as the user.
7124    pub fn chown(&self, owner: impl Into<String>) -> File {
7125        let mut query = self.selection.select("chown");
7126        query = query.arg("owner", owner.into());
7127        File {
7128            proc: self.proc.clone(),
7129            selection: query,
7130            graphql_client: self.graphql_client.clone(),
7131        }
7132    }
7133    /// Retrieves the contents of the file.
7134    ///
7135    /// # Arguments
7136    ///
7137    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7138    pub async fn contents(&self) -> Result<String, DaggerError> {
7139        let query = self.selection.select("contents");
7140        query.execute(self.graphql_client.clone()).await
7141    }
7142    /// Retrieves the contents of the file.
7143    ///
7144    /// # Arguments
7145    ///
7146    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7147    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7148        let mut query = self.selection.select("contents");
7149        if let Some(offset_lines) = opts.offset_lines {
7150            query = query.arg("offsetLines", offset_lines);
7151        }
7152        if let Some(limit_lines) = opts.limit_lines {
7153            query = query.arg("limitLines", limit_lines);
7154        }
7155        query.execute(self.graphql_client.clone()).await
7156    }
7157    /// 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.
7158    ///
7159    /// # Arguments
7160    ///
7161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7162    pub async fn digest(&self) -> Result<String, DaggerError> {
7163        let query = self.selection.select("digest");
7164        query.execute(self.graphql_client.clone()).await
7165    }
7166    /// 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.
7167    ///
7168    /// # Arguments
7169    ///
7170    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7171    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7172        let mut query = self.selection.select("digest");
7173        if let Some(exclude_metadata) = opts.exclude_metadata {
7174            query = query.arg("excludeMetadata", exclude_metadata);
7175        }
7176        query.execute(self.graphql_client.clone()).await
7177    }
7178    /// Writes the file to a file path on the host.
7179    ///
7180    /// # Arguments
7181    ///
7182    /// * `path` - Location of the written directory (e.g., "output.txt").
7183    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7184    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7185        let mut query = self.selection.select("export");
7186        query = query.arg("path", path.into());
7187        query.execute(self.graphql_client.clone()).await
7188    }
7189    /// Writes the file to a file path on the host.
7190    ///
7191    /// # Arguments
7192    ///
7193    /// * `path` - Location of the written directory (e.g., "output.txt").
7194    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7195    pub async fn export_opts(
7196        &self,
7197        path: impl Into<String>,
7198        opts: FileExportOpts,
7199    ) -> Result<String, DaggerError> {
7200        let mut query = self.selection.select("export");
7201        query = query.arg("path", path.into());
7202        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7203            query = query.arg("allowParentDirPath", allow_parent_dir_path);
7204        }
7205        query.execute(self.graphql_client.clone()).await
7206    }
7207    /// A unique identifier for this File.
7208    pub async fn id(&self) -> Result<Id, DaggerError> {
7209        let query = self.selection.select("id");
7210        query.execute(self.graphql_client.clone()).await
7211    }
7212    /// Retrieves the name of the file.
7213    pub async fn name(&self) -> Result<String, DaggerError> {
7214        let query = self.selection.select("name");
7215        query.execute(self.graphql_client.clone()).await
7216    }
7217    /// Searches for content matching the given regular expression or literal string.
7218    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7219    ///
7220    /// # Arguments
7221    ///
7222    /// * `pattern` - The text to match.
7223    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7224    pub async fn search(
7225        &self,
7226        pattern: impl Into<String>,
7227    ) -> Result<Vec<SearchResult>, DaggerError> {
7228        let mut query = self.selection.select("search");
7229        query = query.arg("pattern", pattern.into());
7230        let query = query.select("id");
7231        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7232        Ok(ids
7233            .into_iter()
7234            .map(|id| SearchResult {
7235                proc: self.proc.clone(),
7236                selection: crate::querybuilder::query()
7237                    .select("node")
7238                    .arg("id", &id.0)
7239                    .inline_fragment("SearchResult"),
7240                graphql_client: self.graphql_client.clone(),
7241            })
7242            .collect())
7243    }
7244    /// Searches for content matching the given regular expression or literal string.
7245    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7246    ///
7247    /// # Arguments
7248    ///
7249    /// * `pattern` - The text to match.
7250    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7251    pub async fn search_opts<'a>(
7252        &self,
7253        pattern: impl Into<String>,
7254        opts: FileSearchOpts<'a>,
7255    ) -> Result<Vec<SearchResult>, DaggerError> {
7256        let mut query = self.selection.select("search");
7257        query = query.arg("pattern", pattern.into());
7258        if let Some(literal) = opts.literal {
7259            query = query.arg("literal", literal);
7260        }
7261        if let Some(multiline) = opts.multiline {
7262            query = query.arg("multiline", multiline);
7263        }
7264        if let Some(dotall) = opts.dotall {
7265            query = query.arg("dotall", dotall);
7266        }
7267        if let Some(insensitive) = opts.insensitive {
7268            query = query.arg("insensitive", insensitive);
7269        }
7270        if let Some(skip_ignored) = opts.skip_ignored {
7271            query = query.arg("skipIgnored", skip_ignored);
7272        }
7273        if let Some(skip_hidden) = opts.skip_hidden {
7274            query = query.arg("skipHidden", skip_hidden);
7275        }
7276        if let Some(files_only) = opts.files_only {
7277            query = query.arg("filesOnly", files_only);
7278        }
7279        if let Some(limit) = opts.limit {
7280            query = query.arg("limit", limit);
7281        }
7282        if let Some(paths) = opts.paths {
7283            query = query.arg("paths", paths);
7284        }
7285        if let Some(globs) = opts.globs {
7286            query = query.arg("globs", globs);
7287        }
7288        let query = query.select("id");
7289        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7290        Ok(ids
7291            .into_iter()
7292            .map(|id| SearchResult {
7293                proc: self.proc.clone(),
7294                selection: crate::querybuilder::query()
7295                    .select("node")
7296                    .arg("id", &id.0)
7297                    .inline_fragment("SearchResult"),
7298                graphql_client: self.graphql_client.clone(),
7299            })
7300            .collect())
7301    }
7302    /// Retrieves the size of the file, in bytes.
7303    pub async fn size(&self) -> Result<isize, DaggerError> {
7304        let query = self.selection.select("size");
7305        query.execute(self.graphql_client.clone()).await
7306    }
7307    /// Return file status
7308    pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
7309        let query = self.selection.select("stat");
7310        let query = query.select("id");
7311        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7312        Ok(id.map(|id| Stat {
7313            proc: self.proc.clone(),
7314            selection: query
7315                .root()
7316                .select("node")
7317                .arg("id", &id.0)
7318                .inline_fragment("Stat"),
7319            graphql_client: self.graphql_client.clone(),
7320        }))
7321    }
7322    /// Force evaluation in the engine.
7323    pub async fn sync(&self) -> Result<File, DaggerError> {
7324        let query = self.selection.select("sync");
7325        let id: Id = query.execute(self.graphql_client.clone()).await?;
7326        Ok(File {
7327            proc: self.proc.clone(),
7328            selection: query
7329                .root()
7330                .select("node")
7331                .arg("id", &id.0)
7332                .inline_fragment("File"),
7333            graphql_client: self.graphql_client.clone(),
7334        })
7335    }
7336    /// Retrieves this file with its name set to the given name.
7337    ///
7338    /// # Arguments
7339    ///
7340    /// * `name` - Name to set file to.
7341    pub fn with_name(&self, name: impl Into<String>) -> File {
7342        let mut query = self.selection.select("withName");
7343        query = query.arg("name", name.into());
7344        File {
7345            proc: self.proc.clone(),
7346            selection: query,
7347            graphql_client: self.graphql_client.clone(),
7348        }
7349    }
7350    /// Retrieves the file with content replaced with the given text.
7351    /// If 'all' is true, all occurrences of the pattern will be replaced.
7352    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7353    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7354    /// If there are no matches for the pattern, this will error.
7355    ///
7356    /// # Arguments
7357    ///
7358    /// * `search` - The text to match.
7359    /// * `replacement` - The text to match.
7360    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7361    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7362        let mut query = self.selection.select("withReplaced");
7363        query = query.arg("search", search.into());
7364        query = query.arg("replacement", replacement.into());
7365        File {
7366            proc: self.proc.clone(),
7367            selection: query,
7368            graphql_client: self.graphql_client.clone(),
7369        }
7370    }
7371    /// Retrieves the file with content replaced with the given text.
7372    /// If 'all' is true, all occurrences of the pattern will be replaced.
7373    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7374    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7375    /// If there are no matches for the pattern, this will error.
7376    ///
7377    /// # Arguments
7378    ///
7379    /// * `search` - The text to match.
7380    /// * `replacement` - The text to match.
7381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7382    pub fn with_replaced_opts(
7383        &self,
7384        search: impl Into<String>,
7385        replacement: impl Into<String>,
7386        opts: FileWithReplacedOpts,
7387    ) -> File {
7388        let mut query = self.selection.select("withReplaced");
7389        query = query.arg("search", search.into());
7390        query = query.arg("replacement", replacement.into());
7391        if let Some(all) = opts.all {
7392            query = query.arg("all", all);
7393        }
7394        if let Some(first_from) = opts.first_from {
7395            query = query.arg("firstFrom", first_from);
7396        }
7397        File {
7398            proc: self.proc.clone(),
7399            selection: query,
7400            graphql_client: self.graphql_client.clone(),
7401        }
7402    }
7403    /// Retrieves this file with its created/modified timestamps set to the given time.
7404    ///
7405    /// # Arguments
7406    ///
7407    /// * `timestamp` - Timestamp to set dir/files in.
7408    ///
7409    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7410    pub fn with_timestamps(&self, timestamp: isize) -> File {
7411        let mut query = self.selection.select("withTimestamps");
7412        query = query.arg("timestamp", timestamp);
7413        File {
7414            proc: self.proc.clone(),
7415            selection: query,
7416            graphql_client: self.graphql_client.clone(),
7417        }
7418    }
7419}
7420impl Exportable for File {
7421    fn export(
7422        &self,
7423        path: impl Into<String>,
7424    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7425        let mut query = self.selection.select("export");
7426        query = query.arg("path", path.into());
7427        let graphql_client = self.graphql_client.clone();
7428        async move { query.execute(graphql_client).await }
7429    }
7430    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7431        let query = self.selection.select("id");
7432        let graphql_client = self.graphql_client.clone();
7433        async move { query.execute(graphql_client).await }
7434    }
7435}
7436impl Node for File {
7437    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7438        let query = self.selection.select("id");
7439        let graphql_client = self.graphql_client.clone();
7440        async move { query.execute(graphql_client).await }
7441    }
7442}
7443impl Syncer for File {
7444    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7445        let query = self.selection.select("id");
7446        let graphql_client = self.graphql_client.clone();
7447        async move { query.execute(graphql_client).await }
7448    }
7449    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7450        let query = self.selection.select("sync");
7451        let graphql_client = self.graphql_client.clone();
7452        async move { query.execute(graphql_client).await }
7453    }
7454}
7455#[derive(Clone)]
7456pub struct Function {
7457    pub proc: Option<Arc<DaggerSessionProc>>,
7458    pub selection: Selection,
7459    pub graphql_client: DynGraphQLClient,
7460}
7461#[derive(Builder, Debug, PartialEq)]
7462pub struct FunctionWithArgOpts<'a> {
7463    #[builder(setter(into, strip_option), default)]
7464    pub default_address: Option<&'a str>,
7465    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
7466    #[builder(setter(into, strip_option), default)]
7467    pub default_path: Option<&'a str>,
7468    /// A default value to use for this argument if not explicitly set by the caller, if any
7469    #[builder(setter(into, strip_option), default)]
7470    pub default_value: Option<Json>,
7471    /// If deprecated, the reason or migration path.
7472    #[builder(setter(into, strip_option), default)]
7473    pub deprecated: Option<&'a str>,
7474    /// A doc string for the argument, if any
7475    #[builder(setter(into, strip_option), default)]
7476    pub description: Option<&'a str>,
7477    /// Patterns to ignore when loading the contextual argument value.
7478    #[builder(setter(into, strip_option), default)]
7479    pub ignore: Option<Vec<&'a str>>,
7480    /// The source map for the argument definition.
7481    #[builder(setter(into, strip_option), default)]
7482    pub source_map: Option<Id>,
7483}
7484#[derive(Builder, Debug, PartialEq)]
7485pub struct FunctionWithCachePolicyOpts<'a> {
7486    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
7487    #[builder(setter(into, strip_option), default)]
7488    pub time_to_live: Option<&'a str>,
7489}
7490#[derive(Builder, Debug, PartialEq)]
7491pub struct FunctionWithDeprecatedOpts<'a> {
7492    /// Reason or migration path describing the deprecation.
7493    #[builder(setter(into, strip_option), default)]
7494    pub reason: Option<&'a str>,
7495}
7496impl IntoID<Id> for Function {
7497    fn into_id(
7498        self,
7499    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7500        Box::pin(async move { self.id().await })
7501    }
7502}
7503impl Loadable for Function {
7504    fn graphql_type() -> &'static str {
7505        "Function"
7506    }
7507    fn from_query(
7508        proc: Option<Arc<DaggerSessionProc>>,
7509        selection: Selection,
7510        graphql_client: DynGraphQLClient,
7511    ) -> Self {
7512        Self {
7513            proc,
7514            selection,
7515            graphql_client,
7516        }
7517    }
7518}
7519impl Function {
7520    /// Arguments accepted by the function, if any.
7521    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
7522        let query = self.selection.select("args");
7523        let query = query.select("id");
7524        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7525        Ok(ids
7526            .into_iter()
7527            .map(|id| FunctionArg {
7528                proc: self.proc.clone(),
7529                selection: crate::querybuilder::query()
7530                    .select("node")
7531                    .arg("id", &id.0)
7532                    .inline_fragment("FunctionArg"),
7533                graphql_client: self.graphql_client.clone(),
7534            })
7535            .collect())
7536    }
7537    /// The reason this function is deprecated, if any.
7538    pub async fn deprecated(&self) -> Result<String, DaggerError> {
7539        let query = self.selection.select("deprecated");
7540        query.execute(self.graphql_client.clone()).await
7541    }
7542    /// A doc string for the function, if any.
7543    pub async fn description(&self) -> Result<String, DaggerError> {
7544        let query = self.selection.select("description");
7545        query.execute(self.graphql_client.clone()).await
7546    }
7547    /// A unique identifier for this Function.
7548    pub async fn id(&self) -> Result<Id, DaggerError> {
7549        let query = self.selection.select("id");
7550        query.execute(self.graphql_client.clone()).await
7551    }
7552    /// The name of the function.
7553    pub async fn name(&self) -> Result<String, DaggerError> {
7554        let query = self.selection.select("name");
7555        query.execute(self.graphql_client.clone()).await
7556    }
7557    /// The type returned by the function.
7558    pub fn return_type(&self) -> TypeDef {
7559        let query = self.selection.select("returnType");
7560        TypeDef {
7561            proc: self.proc.clone(),
7562            selection: query,
7563            graphql_client: self.graphql_client.clone(),
7564        }
7565    }
7566    /// The location of this function declaration.
7567    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7568        let query = self.selection.select("sourceMap");
7569        let query = query.select("id");
7570        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7571        Ok(id.map(|id| SourceMap {
7572            proc: self.proc.clone(),
7573            selection: query
7574                .root()
7575                .select("node")
7576                .arg("id", &id.0)
7577                .inline_fragment("SourceMap"),
7578            graphql_client: self.graphql_client.clone(),
7579        }))
7580    }
7581    /// If this function is provided by a module, the name of the module. Unset otherwise.
7582    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7583        let query = self.selection.select("sourceModuleName");
7584        query.execute(self.graphql_client.clone()).await
7585    }
7586    /// Returns the function with a flag indicating it is an agent middleware.
7587    pub fn with_agent(&self) -> Function {
7588        let query = self.selection.select("withAgent");
7589        Function {
7590            proc: self.proc.clone(),
7591            selection: query,
7592            graphql_client: self.graphql_client.clone(),
7593        }
7594    }
7595    /// Returns the function with the provided argument
7596    ///
7597    /// # Arguments
7598    ///
7599    /// * `name` - The name of the argument
7600    /// * `type_def` - The type of the argument
7601    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7602    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
7603        let mut query = self.selection.select("withArg");
7604        query = query.arg("name", name.into());
7605        query = query.arg_lazy(
7606            "typeDef",
7607            Box::new(move || {
7608                let type_def = type_def.clone();
7609                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7610            }),
7611        );
7612        Function {
7613            proc: self.proc.clone(),
7614            selection: query,
7615            graphql_client: self.graphql_client.clone(),
7616        }
7617    }
7618    /// Returns the function with the provided argument
7619    ///
7620    /// # Arguments
7621    ///
7622    /// * `name` - The name of the argument
7623    /// * `type_def` - The type of the argument
7624    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7625    pub fn with_arg_opts<'a>(
7626        &self,
7627        name: impl Into<String>,
7628        type_def: impl IntoID<Id>,
7629        opts: FunctionWithArgOpts<'a>,
7630    ) -> Function {
7631        let mut query = self.selection.select("withArg");
7632        query = query.arg("name", name.into());
7633        query = query.arg_lazy(
7634            "typeDef",
7635            Box::new(move || {
7636                let type_def = type_def.clone();
7637                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7638            }),
7639        );
7640        if let Some(description) = opts.description {
7641            query = query.arg("description", description);
7642        }
7643        if let Some(default_value) = opts.default_value {
7644            query = query.arg("defaultValue", default_value);
7645        }
7646        if let Some(default_path) = opts.default_path {
7647            query = query.arg("defaultPath", default_path);
7648        }
7649        if let Some(ignore) = opts.ignore {
7650            query = query.arg("ignore", ignore);
7651        }
7652        if let Some(source_map) = opts.source_map {
7653            query = query.arg("sourceMap", source_map);
7654        }
7655        if let Some(deprecated) = opts.deprecated {
7656            query = query.arg("deprecated", deprecated);
7657        }
7658        if let Some(default_address) = opts.default_address {
7659            query = query.arg("defaultAddress", default_address);
7660        }
7661        Function {
7662            proc: self.proc.clone(),
7663            selection: query,
7664            graphql_client: self.graphql_client.clone(),
7665        }
7666    }
7667    /// Returns the function updated to use the provided cache policy.
7668    ///
7669    /// # Arguments
7670    ///
7671    /// * `policy` - The cache policy to use.
7672    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7673    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
7674        let mut query = self.selection.select("withCachePolicy");
7675        query = query.arg("policy", policy);
7676        Function {
7677            proc: self.proc.clone(),
7678            selection: query,
7679            graphql_client: self.graphql_client.clone(),
7680        }
7681    }
7682    /// Returns the function updated to use the provided cache policy.
7683    ///
7684    /// # Arguments
7685    ///
7686    /// * `policy` - The cache policy to use.
7687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7688    pub fn with_cache_policy_opts<'a>(
7689        &self,
7690        policy: FunctionCachePolicy,
7691        opts: FunctionWithCachePolicyOpts<'a>,
7692    ) -> Function {
7693        let mut query = self.selection.select("withCachePolicy");
7694        query = query.arg("policy", policy);
7695        if let Some(time_to_live) = opts.time_to_live {
7696            query = query.arg("timeToLive", time_to_live);
7697        }
7698        Function {
7699            proc: self.proc.clone(),
7700            selection: query,
7701            graphql_client: self.graphql_client.clone(),
7702        }
7703    }
7704    /// Returns the function with a flag indicating it's a check.
7705    pub fn with_check(&self) -> Function {
7706        let query = self.selection.select("withCheck");
7707        Function {
7708            proc: self.proc.clone(),
7709            selection: query,
7710            graphql_client: self.graphql_client.clone(),
7711        }
7712    }
7713    /// Returns the function with the provided deprecation reason.
7714    ///
7715    /// # Arguments
7716    ///
7717    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7718    pub fn with_deprecated(&self) -> Function {
7719        let query = self.selection.select("withDeprecated");
7720        Function {
7721            proc: self.proc.clone(),
7722            selection: query,
7723            graphql_client: self.graphql_client.clone(),
7724        }
7725    }
7726    /// Returns the function with the provided deprecation reason.
7727    ///
7728    /// # Arguments
7729    ///
7730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7731    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
7732        let mut query = self.selection.select("withDeprecated");
7733        if let Some(reason) = opts.reason {
7734            query = query.arg("reason", reason);
7735        }
7736        Function {
7737            proc: self.proc.clone(),
7738            selection: query,
7739            graphql_client: self.graphql_client.clone(),
7740        }
7741    }
7742    /// Returns the function with the given doc string.
7743    ///
7744    /// # Arguments
7745    ///
7746    /// * `description` - The doc string to set.
7747    pub fn with_description(&self, description: impl Into<String>) -> Function {
7748        let mut query = self.selection.select("withDescription");
7749        query = query.arg("description", description.into());
7750        Function {
7751            proc: self.proc.clone(),
7752            selection: query,
7753            graphql_client: self.graphql_client.clone(),
7754        }
7755    }
7756    /// Returns the function with a flag indicating it's a generator.
7757    pub fn with_generator(&self) -> Function {
7758        let query = self.selection.select("withGenerator");
7759        Function {
7760            proc: self.proc.clone(),
7761            selection: query,
7762            graphql_client: self.graphql_client.clone(),
7763        }
7764    }
7765    /// Returns the function with the given source map.
7766    ///
7767    /// # Arguments
7768    ///
7769    /// * `source_map` - The source map for the function definition.
7770    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
7771        let mut query = self.selection.select("withSourceMap");
7772        query = query.arg_lazy(
7773            "sourceMap",
7774            Box::new(move || {
7775                let source_map = source_map.clone();
7776                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
7777            }),
7778        );
7779        Function {
7780            proc: self.proc.clone(),
7781            selection: query,
7782            graphql_client: self.graphql_client.clone(),
7783        }
7784    }
7785    /// Returns the function with a flag indicating it returns a service for dagger up.
7786    pub fn with_up(&self) -> Function {
7787        let query = self.selection.select("withUp");
7788        Function {
7789            proc: self.proc.clone(),
7790            selection: query,
7791            graphql_client: self.graphql_client.clone(),
7792        }
7793    }
7794}
7795impl Node for Function {
7796    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7797        let query = self.selection.select("id");
7798        let graphql_client = self.graphql_client.clone();
7799        async move { query.execute(graphql_client).await }
7800    }
7801}
7802#[derive(Clone)]
7803pub struct FunctionArg {
7804    pub proc: Option<Arc<DaggerSessionProc>>,
7805    pub selection: Selection,
7806    pub graphql_client: DynGraphQLClient,
7807}
7808impl IntoID<Id> for FunctionArg {
7809    fn into_id(
7810        self,
7811    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7812        Box::pin(async move { self.id().await })
7813    }
7814}
7815impl Loadable for FunctionArg {
7816    fn graphql_type() -> &'static str {
7817        "FunctionArg"
7818    }
7819    fn from_query(
7820        proc: Option<Arc<DaggerSessionProc>>,
7821        selection: Selection,
7822        graphql_client: DynGraphQLClient,
7823    ) -> Self {
7824        Self {
7825            proc,
7826            selection,
7827            graphql_client,
7828        }
7829    }
7830}
7831impl FunctionArg {
7832    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
7833    pub async fn default_address(&self) -> Result<String, DaggerError> {
7834        let query = self.selection.select("defaultAddress");
7835        query.execute(self.graphql_client.clone()).await
7836    }
7837    /// 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
7838    pub async fn default_path(&self) -> Result<String, DaggerError> {
7839        let query = self.selection.select("defaultPath");
7840        query.execute(self.graphql_client.clone()).await
7841    }
7842    /// A default value to use for this argument when not explicitly set by the caller, if any.
7843    pub async fn default_value(&self) -> Result<Json, DaggerError> {
7844        let query = self.selection.select("defaultValue");
7845        query.execute(self.graphql_client.clone()).await
7846    }
7847    /// The reason this function is deprecated, if any.
7848    pub async fn deprecated(&self) -> Result<String, DaggerError> {
7849        let query = self.selection.select("deprecated");
7850        query.execute(self.graphql_client.clone()).await
7851    }
7852    /// A doc string for the argument, if any.
7853    pub async fn description(&self) -> Result<String, DaggerError> {
7854        let query = self.selection.select("description");
7855        query.execute(self.graphql_client.clone()).await
7856    }
7857    /// A unique identifier for this FunctionArg.
7858    pub async fn id(&self) -> Result<Id, DaggerError> {
7859        let query = self.selection.select("id");
7860        query.execute(self.graphql_client.clone()).await
7861    }
7862    /// 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.
7863    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
7864        let query = self.selection.select("ignore");
7865        query.execute(self.graphql_client.clone()).await
7866    }
7867    /// The name of the argument in lowerCamelCase format.
7868    pub async fn name(&self) -> Result<String, DaggerError> {
7869        let query = self.selection.select("name");
7870        query.execute(self.graphql_client.clone()).await
7871    }
7872    /// The location of this arg declaration.
7873    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7874        let query = self.selection.select("sourceMap");
7875        let query = query.select("id");
7876        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7877        Ok(id.map(|id| SourceMap {
7878            proc: self.proc.clone(),
7879            selection: query
7880                .root()
7881                .select("node")
7882                .arg("id", &id.0)
7883                .inline_fragment("SourceMap"),
7884            graphql_client: self.graphql_client.clone(),
7885        }))
7886    }
7887    /// The type of the argument.
7888    pub fn type_def(&self) -> TypeDef {
7889        let query = self.selection.select("typeDef");
7890        TypeDef {
7891            proc: self.proc.clone(),
7892            selection: query,
7893            graphql_client: self.graphql_client.clone(),
7894        }
7895    }
7896}
7897impl Node for FunctionArg {
7898    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7899        let query = self.selection.select("id");
7900        let graphql_client = self.graphql_client.clone();
7901        async move { query.execute(graphql_client).await }
7902    }
7903}
7904#[derive(Clone)]
7905pub struct FunctionCall {
7906    pub proc: Option<Arc<DaggerSessionProc>>,
7907    pub selection: Selection,
7908    pub graphql_client: DynGraphQLClient,
7909}
7910impl IntoID<Id> for FunctionCall {
7911    fn into_id(
7912        self,
7913    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7914        Box::pin(async move { self.id().await })
7915    }
7916}
7917impl Loadable for FunctionCall {
7918    fn graphql_type() -> &'static str {
7919        "FunctionCall"
7920    }
7921    fn from_query(
7922        proc: Option<Arc<DaggerSessionProc>>,
7923        selection: Selection,
7924        graphql_client: DynGraphQLClient,
7925    ) -> Self {
7926        Self {
7927            proc,
7928            selection,
7929            graphql_client,
7930        }
7931    }
7932}
7933impl FunctionCall {
7934    /// A unique identifier for this FunctionCall.
7935    pub async fn id(&self) -> Result<Id, DaggerError> {
7936        let query = self.selection.select("id");
7937        query.execute(self.graphql_client.clone()).await
7938    }
7939    /// The argument values the function is being invoked with.
7940    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
7941        let query = self.selection.select("inputArgs");
7942        let query = query.select("id");
7943        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7944        Ok(ids
7945            .into_iter()
7946            .map(|id| FunctionCallArgValue {
7947                proc: self.proc.clone(),
7948                selection: crate::querybuilder::query()
7949                    .select("node")
7950                    .arg("id", &id.0)
7951                    .inline_fragment("FunctionCallArgValue"),
7952                graphql_client: self.graphql_client.clone(),
7953            })
7954            .collect())
7955    }
7956    /// The name of the function being called.
7957    pub async fn name(&self) -> Result<String, DaggerError> {
7958        let query = self.selection.select("name");
7959        query.execute(self.graphql_client.clone()).await
7960    }
7961    /// 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.
7962    pub async fn parent(&self) -> Result<Json, DaggerError> {
7963        let query = self.selection.select("parent");
7964        query.execute(self.graphql_client.clone()).await
7965    }
7966    /// 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.
7967    pub async fn parent_name(&self) -> Result<String, DaggerError> {
7968        let query = self.selection.select("parentName");
7969        query.execute(self.graphql_client.clone()).await
7970    }
7971    /// Return an error from the function.
7972    ///
7973    /// # Arguments
7974    ///
7975    /// * `error` - The error to return.
7976    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
7977        let mut query = self.selection.select("returnError");
7978        query = query.arg_lazy(
7979            "error",
7980            Box::new(move || {
7981                let error = error.clone();
7982                Box::pin(async move { error.into_id().await.unwrap().quote() })
7983            }),
7984        );
7985        query.execute(self.graphql_client.clone()).await
7986    }
7987    /// Set the return value of the function call to the provided value.
7988    ///
7989    /// # Arguments
7990    ///
7991    /// * `value` - JSON serialization of the return value.
7992    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
7993        let mut query = self.selection.select("returnValue");
7994        query = query.arg("value", value);
7995        query.execute(self.graphql_client.clone()).await
7996    }
7997}
7998impl Node for FunctionCall {
7999    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8000        let query = self.selection.select("id");
8001        let graphql_client = self.graphql_client.clone();
8002        async move { query.execute(graphql_client).await }
8003    }
8004}
8005#[derive(Clone)]
8006pub struct FunctionCallArgValue {
8007    pub proc: Option<Arc<DaggerSessionProc>>,
8008    pub selection: Selection,
8009    pub graphql_client: DynGraphQLClient,
8010}
8011impl IntoID<Id> for FunctionCallArgValue {
8012    fn into_id(
8013        self,
8014    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8015        Box::pin(async move { self.id().await })
8016    }
8017}
8018impl Loadable for FunctionCallArgValue {
8019    fn graphql_type() -> &'static str {
8020        "FunctionCallArgValue"
8021    }
8022    fn from_query(
8023        proc: Option<Arc<DaggerSessionProc>>,
8024        selection: Selection,
8025        graphql_client: DynGraphQLClient,
8026    ) -> Self {
8027        Self {
8028            proc,
8029            selection,
8030            graphql_client,
8031        }
8032    }
8033}
8034impl FunctionCallArgValue {
8035    /// A unique identifier for this FunctionCallArgValue.
8036    pub async fn id(&self) -> Result<Id, DaggerError> {
8037        let query = self.selection.select("id");
8038        query.execute(self.graphql_client.clone()).await
8039    }
8040    /// The name of the argument.
8041    pub async fn name(&self) -> Result<String, DaggerError> {
8042        let query = self.selection.select("name");
8043        query.execute(self.graphql_client.clone()).await
8044    }
8045    /// The value of the argument represented as a JSON serialized string.
8046    pub async fn value(&self) -> Result<Json, DaggerError> {
8047        let query = self.selection.select("value");
8048        query.execute(self.graphql_client.clone()).await
8049    }
8050}
8051impl Node for FunctionCallArgValue {
8052    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8053        let query = self.selection.select("id");
8054        let graphql_client = self.graphql_client.clone();
8055        async move { query.execute(graphql_client).await }
8056    }
8057}
8058#[derive(Clone)]
8059pub struct GeneratedCode {
8060    pub proc: Option<Arc<DaggerSessionProc>>,
8061    pub selection: Selection,
8062    pub graphql_client: DynGraphQLClient,
8063}
8064impl IntoID<Id> for GeneratedCode {
8065    fn into_id(
8066        self,
8067    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8068        Box::pin(async move { self.id().await })
8069    }
8070}
8071impl Loadable for GeneratedCode {
8072    fn graphql_type() -> &'static str {
8073        "GeneratedCode"
8074    }
8075    fn from_query(
8076        proc: Option<Arc<DaggerSessionProc>>,
8077        selection: Selection,
8078        graphql_client: DynGraphQLClient,
8079    ) -> Self {
8080        Self {
8081            proc,
8082            selection,
8083            graphql_client,
8084        }
8085    }
8086}
8087impl GeneratedCode {
8088    /// The directory containing the generated code.
8089    pub fn code(&self) -> Directory {
8090        let query = self.selection.select("code");
8091        Directory {
8092            proc: self.proc.clone(),
8093            selection: query,
8094            graphql_client: self.graphql_client.clone(),
8095        }
8096    }
8097    /// A unique identifier for this GeneratedCode.
8098    pub async fn id(&self) -> Result<Id, DaggerError> {
8099        let query = self.selection.select("id");
8100        query.execute(self.graphql_client.clone()).await
8101    }
8102    /// List of paths to mark generated in version control (i.e. .gitattributes).
8103    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8104        let query = self.selection.select("vcsGeneratedPaths");
8105        query.execute(self.graphql_client.clone()).await
8106    }
8107    /// List of paths to ignore in version control (i.e. .gitignore).
8108    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8109        let query = self.selection.select("vcsIgnoredPaths");
8110        query.execute(self.graphql_client.clone()).await
8111    }
8112    /// Set the list of paths to mark generated in version control.
8113    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8114        let mut query = self.selection.select("withVCSGeneratedPaths");
8115        query = query.arg(
8116            "paths",
8117            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8118        );
8119        GeneratedCode {
8120            proc: self.proc.clone(),
8121            selection: query,
8122            graphql_client: self.graphql_client.clone(),
8123        }
8124    }
8125    /// Set the list of paths to ignore in version control.
8126    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8127        let mut query = self.selection.select("withVCSIgnoredPaths");
8128        query = query.arg(
8129            "paths",
8130            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8131        );
8132        GeneratedCode {
8133            proc: self.proc.clone(),
8134            selection: query,
8135            graphql_client: self.graphql_client.clone(),
8136        }
8137    }
8138}
8139impl Node for GeneratedCode {
8140    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8141        let query = self.selection.select("id");
8142        let graphql_client = self.graphql_client.clone();
8143        async move { query.execute(graphql_client).await }
8144    }
8145}
8146#[derive(Clone)]
8147pub struct Generator {
8148    pub proc: Option<Arc<DaggerSessionProc>>,
8149    pub selection: Selection,
8150    pub graphql_client: DynGraphQLClient,
8151}
8152impl IntoID<Id> for Generator {
8153    fn into_id(
8154        self,
8155    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8156        Box::pin(async move { self.id().await })
8157    }
8158}
8159impl Loadable for Generator {
8160    fn graphql_type() -> &'static str {
8161        "Generator"
8162    }
8163    fn from_query(
8164        proc: Option<Arc<DaggerSessionProc>>,
8165        selection: Selection,
8166        graphql_client: DynGraphQLClient,
8167    ) -> Self {
8168        Self {
8169            proc,
8170            selection,
8171            graphql_client,
8172        }
8173    }
8174}
8175impl Generator {
8176    /// The generated changeset from the last run
8177    pub fn changes(&self) -> Changeset {
8178        let query = self.selection.select("changes");
8179        Changeset {
8180            proc: self.proc.clone(),
8181            selection: query,
8182            graphql_client: self.graphql_client.clone(),
8183        }
8184    }
8185    /// Whether the generator complete
8186    pub async fn completed(&self) -> Result<bool, DaggerError> {
8187        let query = self.selection.select("completed");
8188        query.execute(self.graphql_client.clone()).await
8189    }
8190    /// Return the description of the generator
8191    pub async fn description(&self) -> Result<String, DaggerError> {
8192        let query = self.selection.select("description");
8193        query.execute(self.graphql_client.clone()).await
8194    }
8195    /// A unique identifier for this Generator.
8196    pub async fn id(&self) -> Result<Id, DaggerError> {
8197        let query = self.selection.select("id");
8198        query.execute(self.graphql_client.clone()).await
8199    }
8200    /// Whether changeset from the last generator run is empty or not
8201    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8202        let query = self.selection.select("isEmpty");
8203        query.execute(self.graphql_client.clone()).await
8204    }
8205    /// Return the command name of the generator. Entrypoint targets omit the module prefix.
8206    pub async fn name(&self) -> Result<String, DaggerError> {
8207        let query = self.selection.select("name");
8208        query.execute(self.graphql_client.clone()).await
8209    }
8210    /// The module that defined the generator, or null for an engine-defined generator
8211    pub async fn original_module(&self) -> Result<Option<Module>, DaggerError> {
8212        let query = self.selection.select("originalModule");
8213        let query = query.select("id");
8214        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8215        Ok(id.map(|id| Module {
8216            proc: self.proc.clone(),
8217            selection: query
8218                .root()
8219                .select("node")
8220                .arg("id", &id.0)
8221                .inline_fragment("Module"),
8222            graphql_client: self.graphql_client.clone(),
8223        }))
8224    }
8225    /// The path of the generator within its module
8226    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8227        let query = self.selection.select("path");
8228        query.execute(self.graphql_client.clone()).await
8229    }
8230    /// Execute the generator
8231    pub fn run(&self) -> Generator {
8232        let query = self.selection.select("run");
8233        Generator {
8234            proc: self.proc.clone(),
8235            selection: query,
8236            graphql_client: self.graphql_client.clone(),
8237        }
8238    }
8239}
8240impl Node for Generator {
8241    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8242        let query = self.selection.select("id");
8243        let graphql_client = self.graphql_client.clone();
8244        async move { query.execute(graphql_client).await }
8245    }
8246}
8247#[derive(Clone)]
8248pub struct GeneratorGroup {
8249    pub proc: Option<Arc<DaggerSessionProc>>,
8250    pub selection: Selection,
8251    pub graphql_client: DynGraphQLClient,
8252}
8253#[derive(Builder, Debug, PartialEq)]
8254pub struct GeneratorGroupChangesOpts {
8255    /// Strategy to apply on conflicts between generators
8256    #[builder(setter(into, strip_option), default)]
8257    pub on_conflict: Option<ChangesetsMergeConflict>,
8258}
8259#[derive(Builder, Debug, PartialEq)]
8260pub struct GeneratorGroupWorkspaceOpts {
8261    /// Strategy to apply on conflicts between generators
8262    #[builder(setter(into, strip_option), default)]
8263    pub on_conflict: Option<ChangesetsMergeConflict>,
8264}
8265impl IntoID<Id> for GeneratorGroup {
8266    fn into_id(
8267        self,
8268    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8269        Box::pin(async move { self.id().await })
8270    }
8271}
8272impl Loadable for GeneratorGroup {
8273    fn graphql_type() -> &'static str {
8274        "GeneratorGroup"
8275    }
8276    fn from_query(
8277        proc: Option<Arc<DaggerSessionProc>>,
8278        selection: Selection,
8279        graphql_client: DynGraphQLClient,
8280    ) -> Self {
8281        Self {
8282            proc,
8283            selection,
8284            graphql_client,
8285        }
8286    }
8287}
8288impl GeneratorGroup {
8289    /// The combined changes from the last run of the generators
8290    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
8291    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
8292    ///
8293    /// # Arguments
8294    ///
8295    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8296    pub fn changes(&self) -> Changeset {
8297        let query = self.selection.select("changes");
8298        Changeset {
8299            proc: self.proc.clone(),
8300            selection: query,
8301            graphql_client: self.graphql_client.clone(),
8302        }
8303    }
8304    /// The combined changes from the last run of the generators
8305    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
8306    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
8307    ///
8308    /// # Arguments
8309    ///
8310    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8311    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
8312        let mut query = self.selection.select("changes");
8313        if let Some(on_conflict) = opts.on_conflict {
8314            query = query.arg("onConflict", on_conflict);
8315        }
8316        Changeset {
8317            proc: self.proc.clone(),
8318            selection: query,
8319            graphql_client: self.graphql_client.clone(),
8320        }
8321    }
8322    /// A unique identifier for this GeneratorGroup.
8323    pub async fn id(&self) -> Result<Id, DaggerError> {
8324        let query = self.selection.select("id");
8325        query.execute(self.graphql_client.clone()).await
8326    }
8327    /// Whether the generated changeset from the last run is empty or not
8328    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8329        let query = self.selection.select("isEmpty");
8330        query.execute(self.graphql_client.clone()).await
8331    }
8332    /// Return a list of individual generators and their details
8333    pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
8334        let query = self.selection.select("list");
8335        let query = query.select("id");
8336        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8337        Ok(ids
8338            .into_iter()
8339            .map(|id| Generator {
8340                proc: self.proc.clone(),
8341                selection: crate::querybuilder::query()
8342                    .select("node")
8343                    .arg("id", &id.0)
8344                    .inline_fragment("Generator"),
8345                graphql_client: self.graphql_client.clone(),
8346            })
8347            .collect())
8348    }
8349    /// Load failures tolerated while collecting the generators.
8350    /// Empty unless a workspace module could not be loaded during an unscoped 'dagger generate' (no selector), where load failures are tolerated so the modules that do load still generate. Each entry is a human-readable error message. An explicit selector keeps failing hard instead.
8351    pub async fn load_failures(&self) -> Result<Vec<String>, DaggerError> {
8352        let query = self.selection.select("loadFailures");
8353        query.execute(self.graphql_client.clone()).await
8354    }
8355    /// Execute all selected generators
8356    pub fn run(&self) -> GeneratorGroup {
8357        let query = self.selection.select("run");
8358        GeneratorGroup {
8359            proc: self.proc.clone(),
8360            selection: query,
8361            graphql_client: self.graphql_client.clone(),
8362        }
8363    }
8364    /// The workspace with the combined output from the last generator run
8365    ///
8366    /// # Arguments
8367    ///
8368    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8369    pub fn workspace(&self) -> Workspace {
8370        let query = self.selection.select("workspace");
8371        Workspace {
8372            proc: self.proc.clone(),
8373            selection: query,
8374            graphql_client: self.graphql_client.clone(),
8375        }
8376    }
8377    /// The workspace with the combined output from the last generator run
8378    ///
8379    /// # Arguments
8380    ///
8381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8382    pub fn workspace_opts(&self, opts: GeneratorGroupWorkspaceOpts) -> Workspace {
8383        let mut query = self.selection.select("workspace");
8384        if let Some(on_conflict) = opts.on_conflict {
8385            query = query.arg("onConflict", on_conflict);
8386        }
8387        Workspace {
8388            proc: self.proc.clone(),
8389            selection: query,
8390            graphql_client: self.graphql_client.clone(),
8391        }
8392    }
8393}
8394impl Node for GeneratorGroup {
8395    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8396        let query = self.selection.select("id");
8397        let graphql_client = self.graphql_client.clone();
8398        async move { query.execute(graphql_client).await }
8399    }
8400}
8401#[derive(Clone)]
8402pub struct GitBundle {
8403    pub proc: Option<Arc<DaggerSessionProc>>,
8404    pub selection: Selection,
8405    pub graphql_client: DynGraphQLClient,
8406}
8407impl IntoID<Id> for GitBundle {
8408    fn into_id(
8409        self,
8410    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8411        Box::pin(async move { self.id().await })
8412    }
8413}
8414impl Loadable for GitBundle {
8415    fn graphql_type() -> &'static str {
8416        "GitBundle"
8417    }
8418    fn from_query(
8419        proc: Option<Arc<DaggerSessionProc>>,
8420        selection: Selection,
8421        graphql_client: DynGraphQLClient,
8422    ) -> Self {
8423        Self {
8424            proc,
8425            selection,
8426            graphql_client,
8427        }
8428    }
8429}
8430impl GitBundle {
8431    /// Return the bundle bytes as a File.
8432    pub fn as_file(&self) -> File {
8433        let query = self.selection.select("asFile");
8434        File {
8435            proc: self.proc.clone(),
8436            selection: query,
8437            graphql_client: self.graphql_client.clone(),
8438        }
8439    }
8440    /// A unique identifier for this GitBundle.
8441    pub async fn id(&self) -> Result<Id, DaggerError> {
8442        let query = self.selection.select("id");
8443        query.execute(self.graphql_client.clone()).await
8444    }
8445    /// Object format capability: sha1 or sha256.
8446    pub async fn object_format(&self) -> Result<String, DaggerError> {
8447        let query = self.selection.select("objectFormat");
8448        query.execute(self.graphql_client.clone()).await
8449    }
8450    /// Commits that must already exist wherever this bundle is applied.
8451    pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
8452        let query = self.selection.select("prerequisiteSHAs");
8453        query.execute(self.graphql_client.clone()).await
8454    }
8455    /// Refs advertised by the bundle and the object IDs they resolve to.
8456    pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
8457        let query = self.selection.select("refs");
8458        let query = query.select("id");
8459        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8460        Ok(ids
8461            .into_iter()
8462            .map(|id| GitBundleRef {
8463                proc: self.proc.clone(),
8464                selection: crate::querybuilder::query()
8465                    .select("node")
8466                    .arg("id", &id.0)
8467                    .inline_fragment("GitBundleRef"),
8468                graphql_client: self.graphql_client.clone(),
8469            })
8470            .collect())
8471    }
8472    /// Perform full structural verification of the bundle and error if it is malformed.
8473    pub fn validate(&self) -> GitBundle {
8474        let query = self.selection.select("validate");
8475        GitBundle {
8476            proc: self.proc.clone(),
8477            selection: query,
8478            graphql_client: self.graphql_client.clone(),
8479        }
8480    }
8481    /// Bundle format version (2 or 3).
8482    pub async fn version(&self) -> Result<isize, DaggerError> {
8483        let query = self.selection.select("version");
8484        query.execute(self.graphql_client.clone()).await
8485    }
8486}
8487impl Node for GitBundle {
8488    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8489        let query = self.selection.select("id");
8490        let graphql_client = self.graphql_client.clone();
8491        async move { query.execute(graphql_client).await }
8492    }
8493}
8494#[derive(Clone)]
8495pub struct GitBundleRef {
8496    pub proc: Option<Arc<DaggerSessionProc>>,
8497    pub selection: Selection,
8498    pub graphql_client: DynGraphQLClient,
8499}
8500impl IntoID<Id> for GitBundleRef {
8501    fn into_id(
8502        self,
8503    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8504        Box::pin(async move { self.id().await })
8505    }
8506}
8507impl Loadable for GitBundleRef {
8508    fn graphql_type() -> &'static str {
8509        "GitBundleRef"
8510    }
8511    fn from_query(
8512        proc: Option<Arc<DaggerSessionProc>>,
8513        selection: Selection,
8514        graphql_client: DynGraphQLClient,
8515    ) -> Self {
8516        Self {
8517            proc,
8518            selection,
8519            graphql_client,
8520        }
8521    }
8522}
8523impl GitBundleRef {
8524    /// A unique identifier for this GitBundleRef.
8525    pub async fn id(&self) -> Result<Id, DaggerError> {
8526        let query = self.selection.select("id");
8527        query.execute(self.graphql_client.clone()).await
8528    }
8529    /// The advertised ref name.
8530    pub async fn name(&self) -> Result<String, DaggerError> {
8531        let query = self.selection.select("name");
8532        query.execute(self.graphql_client.clone()).await
8533    }
8534    /// The object ID the advertised ref resolves to.
8535    pub async fn sha(&self) -> Result<String, DaggerError> {
8536        let query = self.selection.select("sha");
8537        query.execute(self.graphql_client.clone()).await
8538    }
8539}
8540impl Node for GitBundleRef {
8541    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8542        let query = self.selection.select("id");
8543        let graphql_client = self.graphql_client.clone();
8544        async move { query.execute(graphql_client).await }
8545    }
8546}
8547#[derive(Clone)]
8548pub struct GitCommit {
8549    pub proc: Option<Arc<DaggerSessionProc>>,
8550    pub selection: Selection,
8551    pub graphql_client: DynGraphQLClient,
8552}
8553#[derive(Builder, Debug, PartialEq)]
8554pub struct GitCommitAncestorReleaseTagOpts {
8555    /// Include pre-release tags when choosing the latest tag.
8556    #[builder(setter(into, strip_option), default)]
8557    pub include_pre_release: Option<bool>,
8558}
8559#[derive(Builder, Debug, PartialEq)]
8560pub struct GitCommitReleaseTagOpts {
8561    /// Include pre-release tags when choosing the latest tag.
8562    #[builder(setter(into, strip_option), default)]
8563    pub include_pre_release: Option<bool>,
8564}
8565#[derive(Builder, Debug, PartialEq)]
8566pub struct GitCommitTreeOpts {
8567    /// The depth of the tree to fetch.
8568    #[builder(setter(into, strip_option), default)]
8569    pub depth: Option<isize>,
8570    /// Set to true to discard .git directory.
8571    #[builder(setter(into, strip_option), default)]
8572    pub discard_git_dir: Option<bool>,
8573    /// Set to true to populate tag refs in the local checkout .git.
8574    #[builder(setter(into, strip_option), default)]
8575    pub include_tags: Option<bool>,
8576}
8577impl IntoID<Id> for GitCommit {
8578    fn into_id(
8579        self,
8580    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8581        Box::pin(async move { self.id().await })
8582    }
8583}
8584impl Loadable for GitCommit {
8585    fn graphql_type() -> &'static str {
8586        "GitCommit"
8587    }
8588    fn from_query(
8589        proc: Option<Arc<DaggerSessionProc>>,
8590        selection: Selection,
8591        graphql_client: DynGraphQLClient,
8592    ) -> Self {
8593        Self {
8594            proc,
8595            selection,
8596            graphql_client,
8597        }
8598    }
8599}
8600impl GitCommit {
8601    /// The latest semver release tag reachable from this commit.
8602    ///
8603    /// # Arguments
8604    ///
8605    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8606    pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
8607        let query = self.selection.select("ancestorReleaseTag");
8608        let query = query.select("id");
8609        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8610        Ok(id.map(|id| GitRef {
8611            proc: self.proc.clone(),
8612            selection: query
8613                .root()
8614                .select("node")
8615                .arg("id", &id.0)
8616                .inline_fragment("GitRef"),
8617            graphql_client: self.graphql_client.clone(),
8618        }))
8619    }
8620    /// The latest semver release tag reachable from this commit.
8621    ///
8622    /// # Arguments
8623    ///
8624    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8625    pub async fn ancestor_release_tag_opts(
8626        &self,
8627        opts: GitCommitAncestorReleaseTagOpts,
8628    ) -> Result<Option<GitRef>, DaggerError> {
8629        let mut query = self.selection.select("ancestorReleaseTag");
8630        if let Some(include_pre_release) = opts.include_pre_release {
8631            query = query.arg("includePreRelease", include_pre_release);
8632        }
8633        let query = query.select("id");
8634        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8635        Ok(id.map(|id| GitRef {
8636            proc: self.proc.clone(),
8637            selection: query
8638                .root()
8639                .select("node")
8640                .arg("id", &id.0)
8641                .inline_fragment("GitRef"),
8642            graphql_client: self.graphql_client.clone(),
8643        }))
8644    }
8645    /// Git author email.
8646    pub async fn author_email(&self) -> Result<String, DaggerError> {
8647        let query = self.selection.select("authorEmail");
8648        query.execute(self.graphql_client.clone()).await
8649    }
8650    /// Git author name.
8651    pub async fn author_name(&self) -> Result<String, DaggerError> {
8652        let query = self.selection.select("authorName");
8653        query.execute(self.graphql_client.clone()).await
8654    }
8655    /// Git author date, in RFC3339 format.
8656    pub async fn authored_date(&self) -> Result<String, DaggerError> {
8657        let query = self.selection.select("authoredDate");
8658        query.execute(self.graphql_client.clone()).await
8659    }
8660    /// Git committer date, in RFC3339 format.
8661    pub async fn committed_date(&self) -> Result<String, DaggerError> {
8662        let query = self.selection.select("committedDate");
8663        query.execute(self.graphql_client.clone()).await
8664    }
8665    /// Git committer email.
8666    pub async fn committer_email(&self) -> Result<String, DaggerError> {
8667        let query = self.selection.select("committerEmail");
8668        query.execute(self.graphql_client.clone()).await
8669    }
8670    /// Git committer name.
8671    pub async fn committer_name(&self) -> Result<String, DaggerError> {
8672        let query = self.selection.select("committerName");
8673        query.execute(self.graphql_client.clone()).await
8674    }
8675    /// A unique identifier for this GitCommit.
8676    pub async fn id(&self) -> Result<Id, DaggerError> {
8677        let query = self.selection.select("id");
8678        query.execute(self.graphql_client.clone()).await
8679    }
8680    /// Full commit message.
8681    pub async fn message(&self) -> Result<String, DaggerError> {
8682        let query = self.selection.select("message");
8683        query.execute(self.graphql_client.clone()).await
8684    }
8685    /// Commit message body, excluding the headline.
8686    pub async fn message_body(&self) -> Result<String, DaggerError> {
8687        let query = self.selection.select("messageBody");
8688        query.execute(self.graphql_client.clone()).await
8689    }
8690    /// First line of the commit message.
8691    pub async fn message_headline(&self) -> Result<String, DaggerError> {
8692        let query = self.selection.select("messageHeadline");
8693        query.execute(self.graphql_client.clone()).await
8694    }
8695    /// Parent commit SHAs.
8696    pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
8697        let query = self.selection.select("parentShas");
8698        query.execute(self.graphql_client.clone()).await
8699    }
8700    /// The latest semver release tag that points directly at this commit.
8701    ///
8702    /// # Arguments
8703    ///
8704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8705    pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
8706        let query = self.selection.select("releaseTag");
8707        let query = query.select("id");
8708        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8709        Ok(id.map(|id| GitRef {
8710            proc: self.proc.clone(),
8711            selection: query
8712                .root()
8713                .select("node")
8714                .arg("id", &id.0)
8715                .inline_fragment("GitRef"),
8716            graphql_client: self.graphql_client.clone(),
8717        }))
8718    }
8719    /// The latest semver release tag that points directly at this commit.
8720    ///
8721    /// # Arguments
8722    ///
8723    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8724    pub async fn release_tag_opts(
8725        &self,
8726        opts: GitCommitReleaseTagOpts,
8727    ) -> Result<Option<GitRef>, DaggerError> {
8728        let mut query = self.selection.select("releaseTag");
8729        if let Some(include_pre_release) = opts.include_pre_release {
8730            query = query.arg("includePreRelease", include_pre_release);
8731        }
8732        let query = query.select("id");
8733        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8734        Ok(id.map(|id| GitRef {
8735            proc: self.proc.clone(),
8736            selection: query
8737                .root()
8738                .select("node")
8739                .arg("id", &id.0)
8740                .inline_fragment("GitRef"),
8741            graphql_client: self.graphql_client.clone(),
8742        }))
8743    }
8744    /// The full commit SHA.
8745    pub async fn sha(&self) -> Result<String, DaggerError> {
8746        let query = self.selection.select("sha");
8747        query.execute(self.graphql_client.clone()).await
8748    }
8749    /// The abbreviated commit SHA.
8750    pub async fn short_sha(&self) -> Result<String, DaggerError> {
8751        let query = self.selection.select("shortSha");
8752        query.execute(self.graphql_client.clone()).await
8753    }
8754    /// The filesystem tree at this commit.
8755    ///
8756    /// # Arguments
8757    ///
8758    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8759    pub fn tree(&self) -> Directory {
8760        let query = self.selection.select("tree");
8761        Directory {
8762            proc: self.proc.clone(),
8763            selection: query,
8764            graphql_client: self.graphql_client.clone(),
8765        }
8766    }
8767    /// The filesystem tree at this commit.
8768    ///
8769    /// # Arguments
8770    ///
8771    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8772    pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
8773        let mut query = self.selection.select("tree");
8774        if let Some(discard_git_dir) = opts.discard_git_dir {
8775            query = query.arg("discardGitDir", discard_git_dir);
8776        }
8777        if let Some(depth) = opts.depth {
8778            query = query.arg("depth", depth);
8779        }
8780        if let Some(include_tags) = opts.include_tags {
8781            query = query.arg("includeTags", include_tags);
8782        }
8783        Directory {
8784            proc: self.proc.clone(),
8785            selection: query,
8786            graphql_client: self.graphql_client.clone(),
8787        }
8788    }
8789}
8790impl Node for GitCommit {
8791    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8792        let query = self.selection.select("id");
8793        let graphql_client = self.graphql_client.clone();
8794        async move { query.execute(graphql_client).await }
8795    }
8796}
8797#[derive(Clone)]
8798pub struct GitRef {
8799    pub proc: Option<Arc<DaggerSessionProc>>,
8800    pub selection: Selection,
8801    pub graphql_client: DynGraphQLClient,
8802}
8803#[derive(Builder, Debug, PartialEq)]
8804pub struct GitRefAsWorkspaceOpts<'a> {
8805    /// Current working directory inside the workspace root. Defaults to the workspace root.
8806    #[builder(setter(into, strip_option), default)]
8807    pub cwd: Option<&'a str>,
8808}
8809#[derive(Builder, Debug, PartialEq)]
8810pub struct GitRefLogOpts<'a> {
8811    /// Exclude commits reachable from this ref, i.e. only list commits added on top of it.
8812    #[builder(setter(into, strip_option), default)]
8813    pub base: Option<Id>,
8814    /// Maximum number of commits to return.
8815    #[builder(setter(into, strip_option), default)]
8816    pub limit: Option<isize>,
8817    /// Only include commits touching these paths, relative to the root of the repository.
8818    #[builder(setter(into, strip_option), default)]
8819    pub paths: Option<Vec<&'a str>>,
8820}
8821#[derive(Builder, Debug, PartialEq)]
8822pub struct GitRefTreeOpts {
8823    /// The depth of the tree to fetch.
8824    #[builder(setter(into, strip_option), default)]
8825    pub depth: Option<isize>,
8826    /// Set to true to discard .git directory.
8827    #[builder(setter(into, strip_option), default)]
8828    pub discard_git_dir: Option<bool>,
8829    /// Set to true to populate tag refs in the local checkout .git.
8830    #[builder(setter(into, strip_option), default)]
8831    pub include_tags: Option<bool>,
8832}
8833impl IntoID<Id> for GitRef {
8834    fn into_id(
8835        self,
8836    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8837        Box::pin(async move { self.id().await })
8838    }
8839}
8840impl Loadable for GitRef {
8841    fn graphql_type() -> &'static str {
8842        "GitRef"
8843    }
8844    fn from_query(
8845        proc: Option<Arc<DaggerSessionProc>>,
8846        selection: Selection,
8847        graphql_client: DynGraphQLClient,
8848    ) -> Self {
8849        Self {
8850            proc,
8851            selection,
8852            graphql_client,
8853        }
8854    }
8855}
8856impl GitRef {
8857    /// Creates a synthetic workspace from this git ref.
8858    ///
8859    /// # Arguments
8860    ///
8861    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8862    pub fn as_workspace(&self) -> Workspace {
8863        let query = self.selection.select("asWorkspace");
8864        Workspace {
8865            proc: self.proc.clone(),
8866            selection: query,
8867            graphql_client: self.graphql_client.clone(),
8868        }
8869    }
8870    /// Creates a synthetic workspace from this git ref.
8871    ///
8872    /// # Arguments
8873    ///
8874    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8875    pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
8876        let mut query = self.selection.select("asWorkspace");
8877        if let Some(cwd) = opts.cwd {
8878            query = query.arg("cwd", cwd);
8879        }
8880        Workspace {
8881            proc: self.proc.clone(),
8882            selection: query,
8883            graphql_client: self.graphql_client.clone(),
8884        }
8885    }
8886    /// The resolved commit id at this ref.
8887    pub async fn commit(&self) -> Result<String, DaggerError> {
8888        let query = self.selection.select("commit");
8889        query.execute(self.graphql_client.clone()).await
8890    }
8891    /// The resolved commit SHA at this ref.
8892    pub async fn commit_sha(&self) -> Result<String, DaggerError> {
8893        let query = self.selection.select("commitSHA");
8894        query.execute(self.graphql_client.clone()).await
8895    }
8896    /// Find the best common ancestor between this ref and another ref.
8897    ///
8898    /// # Arguments
8899    ///
8900    /// * `other` - The other ref to compare against.
8901    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
8902        let mut query = self.selection.select("commonAncestor");
8903        query = query.arg_lazy(
8904            "other",
8905            Box::new(move || {
8906                let other = other.clone();
8907                Box::pin(async move { other.into_id().await.unwrap().quote() })
8908            }),
8909        );
8910        GitRef {
8911            proc: self.proc.clone(),
8912            selection: query,
8913            graphql_client: self.graphql_client.clone(),
8914        }
8915    }
8916    /// A unique identifier for this GitRef.
8917    pub async fn id(&self) -> Result<Id, DaggerError> {
8918        let query = self.selection.select("id");
8919        query.execute(self.graphql_client.clone()).await
8920    }
8921    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
8922    ///
8923    /// # Arguments
8924    ///
8925    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8926    pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
8927        let query = self.selection.select("log");
8928        let query = query.select("id");
8929        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8930        Ok(ids
8931            .into_iter()
8932            .map(|id| GitCommit {
8933                proc: self.proc.clone(),
8934                selection: crate::querybuilder::query()
8935                    .select("node")
8936                    .arg("id", &id.0)
8937                    .inline_fragment("GitCommit"),
8938                graphql_client: self.graphql_client.clone(),
8939            })
8940            .collect())
8941    }
8942    /// Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
8943    ///
8944    /// # Arguments
8945    ///
8946    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8947    pub async fn log_opts<'a>(
8948        &self,
8949        opts: GitRefLogOpts<'a>,
8950    ) -> Result<Vec<GitCommit>, DaggerError> {
8951        let mut query = self.selection.select("log");
8952        if let Some(limit) = opts.limit {
8953            query = query.arg("limit", limit);
8954        }
8955        if let Some(paths) = opts.paths {
8956            query = query.arg("paths", paths);
8957        }
8958        if let Some(base) = opts.base {
8959            query = query.arg("base", base);
8960        }
8961        let query = query.select("id");
8962        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8963        Ok(ids
8964            .into_iter()
8965            .map(|id| GitCommit {
8966                proc: self.proc.clone(),
8967                selection: crate::querybuilder::query()
8968                    .select("node")
8969                    .arg("id", &id.0)
8970                    .inline_fragment("GitCommit"),
8971                graphql_client: self.graphql_client.clone(),
8972            })
8973            .collect())
8974    }
8975    /// The resolved name of this ref.
8976    pub async fn name(&self) -> Result<String, DaggerError> {
8977        let query = self.selection.select("name");
8978        query.execute(self.graphql_client.clone()).await
8979    }
8980    /// The resolved ref name at this ref.
8981    pub async fn r#ref(&self) -> Result<String, DaggerError> {
8982        let query = self.selection.select("ref");
8983        query.execute(self.graphql_client.clone()).await
8984    }
8985    /// The commit this ref resolves to.
8986    pub fn target_commit(&self) -> GitCommit {
8987        let query = self.selection.select("targetCommit");
8988        GitCommit {
8989            proc: self.proc.clone(),
8990            selection: query,
8991            graphql_client: self.graphql_client.clone(),
8992        }
8993    }
8994    /// The filesystem tree at this ref.
8995    ///
8996    /// # Arguments
8997    ///
8998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8999    pub fn tree(&self) -> Directory {
9000        let query = self.selection.select("tree");
9001        Directory {
9002            proc: self.proc.clone(),
9003            selection: query,
9004            graphql_client: self.graphql_client.clone(),
9005        }
9006    }
9007    /// The filesystem tree at this ref.
9008    ///
9009    /// # Arguments
9010    ///
9011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9012    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9013        let mut query = self.selection.select("tree");
9014        if let Some(discard_git_dir) = opts.discard_git_dir {
9015            query = query.arg("discardGitDir", discard_git_dir);
9016        }
9017        if let Some(depth) = opts.depth {
9018            query = query.arg("depth", depth);
9019        }
9020        if let Some(include_tags) = opts.include_tags {
9021            query = query.arg("includeTags", include_tags);
9022        }
9023        Directory {
9024            proc: self.proc.clone(),
9025            selection: query,
9026            graphql_client: self.graphql_client.clone(),
9027        }
9028    }
9029}
9030impl Node for GitRef {
9031    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9032        let query = self.selection.select("id");
9033        let graphql_client = self.graphql_client.clone();
9034        async move { query.execute(graphql_client).await }
9035    }
9036}
9037#[derive(Clone)]
9038pub struct GitRepository {
9039    pub proc: Option<Arc<DaggerSessionProc>>,
9040    pub selection: Selection,
9041    pub graphql_client: DynGraphQLClient,
9042}
9043#[derive(Builder, Debug, PartialEq)]
9044pub struct GitRepositoryAsWorkspaceOpts<'a> {
9045    /// Current working directory inside the workspace root. Defaults to the workspace root.
9046    #[builder(setter(into, strip_option), default)]
9047    pub cwd: Option<&'a str>,
9048}
9049#[derive(Builder, Debug, PartialEq)]
9050pub struct GitRepositoryBranchesOpts<'a> {
9051    /// Glob patterns (e.g., "refs/tags/v*").
9052    #[builder(setter(into, strip_option), default)]
9053    pub patterns: Option<Vec<&'a str>>,
9054}
9055#[derive(Builder, Debug, PartialEq)]
9056pub struct GitRepositoryBundleOpts {
9057    /// A Git ref whose reachable objects are omitted and recorded as a prerequisite.
9058    #[builder(setter(into, strip_option), default)]
9059    pub base: Option<Id>,
9060}
9061#[derive(Builder, Debug, PartialEq)]
9062pub struct GitRepositoryLatestOpts<'a> {
9063    /// Version query used to select the greatest matching release ref.
9064    #[builder(setter(into, strip_option), default)]
9065    pub version: Option<&'a str>,
9066}
9067#[derive(Builder, Debug, PartialEq)]
9068pub struct GitRepositoryTagsOpts<'a> {
9069    /// Glob patterns (e.g., "refs/tags/v*").
9070    #[builder(setter(into, strip_option), default)]
9071    pub patterns: Option<Vec<&'a str>>,
9072}
9073#[derive(Builder, Debug, PartialEq)]
9074pub struct GitRepositoryWithBundleOpts<'a> {
9075    /// An optional remote ref hint for fetching a prerequisite when the remote does not allow fetches by object ID.
9076    #[builder(setter(into, strip_option), default)]
9077    pub prerequisite_ref: Option<&'a str>,
9078}
9079impl IntoID<Id> for GitRepository {
9080    fn into_id(
9081        self,
9082    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9083        Box::pin(async move { self.id().await })
9084    }
9085}
9086impl Loadable for GitRepository {
9087    fn graphql_type() -> &'static str {
9088        "GitRepository"
9089    }
9090    fn from_query(
9091        proc: Option<Arc<DaggerSessionProc>>,
9092        selection: Selection,
9093        graphql_client: DynGraphQLClient,
9094    ) -> Self {
9095        Self {
9096            proc,
9097            selection,
9098            graphql_client,
9099        }
9100    }
9101}
9102impl GitRepository {
9103    /// Creates a synthetic workspace from this git repository.
9104    ///
9105    /// # Arguments
9106    ///
9107    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9108    pub fn as_workspace(&self) -> Workspace {
9109        let query = self.selection.select("asWorkspace");
9110        Workspace {
9111            proc: self.proc.clone(),
9112            selection: query,
9113            graphql_client: self.graphql_client.clone(),
9114        }
9115    }
9116    /// Creates a synthetic workspace from this git repository.
9117    ///
9118    /// # Arguments
9119    ///
9120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9121    pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
9122        let mut query = self.selection.select("asWorkspace");
9123        if let Some(cwd) = opts.cwd {
9124            query = query.arg("cwd", cwd);
9125        }
9126        Workspace {
9127            proc: self.proc.clone(),
9128            selection: query,
9129            graphql_client: self.graphql_client.clone(),
9130        }
9131    }
9132    /// Returns details of a branch.
9133    ///
9134    /// # Arguments
9135    ///
9136    /// * `name` - Branch's name (e.g., "main").
9137    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9138        let mut query = self.selection.select("branch");
9139        query = query.arg("name", name.into());
9140        GitRef {
9141            proc: self.proc.clone(),
9142            selection: query,
9143            graphql_client: self.graphql_client.clone(),
9144        }
9145    }
9146    /// branches that match any of the given glob patterns.
9147    ///
9148    /// # Arguments
9149    ///
9150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9151    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9152        let query = self.selection.select("branches");
9153        query.execute(self.graphql_client.clone()).await
9154    }
9155    /// branches that match any of the given glob patterns.
9156    ///
9157    /// # Arguments
9158    ///
9159    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9160    pub async fn branches_opts<'a>(
9161        &self,
9162        opts: GitRepositoryBranchesOpts<'a>,
9163    ) -> Result<Vec<String>, DaggerError> {
9164        let mut query = self.selection.select("branches");
9165        if let Some(patterns) = opts.patterns {
9166            query = query.arg("patterns", patterns);
9167        }
9168        query.execute(self.graphql_client.clone()).await
9169    }
9170    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
9171    ///
9172    /// # Arguments
9173    ///
9174    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
9175    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9176    pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
9177        let mut query = self.selection.select("bundle");
9178        query = query.arg(
9179            "refs",
9180            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9181        );
9182        GitBundle {
9183            proc: self.proc.clone(),
9184            selection: query,
9185            graphql_client: self.graphql_client.clone(),
9186        }
9187    }
9188    /// Pack the given refs and the objects needed to reconstruct them into a Git bundle.
9189    ///
9190    /// # Arguments
9191    ///
9192    /// * `refs` - Refs to advertise in the bundle. At least one named ref is required.
9193    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9194    pub fn bundle_opts(
9195        &self,
9196        refs: Vec<impl Into<String>>,
9197        opts: GitRepositoryBundleOpts,
9198    ) -> GitBundle {
9199        let mut query = self.selection.select("bundle");
9200        query = query.arg(
9201            "refs",
9202            refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9203        );
9204        if let Some(base) = opts.base {
9205            query = query.arg("base", base);
9206        }
9207        GitBundle {
9208            proc: self.proc.clone(),
9209            selection: query,
9210            graphql_client: self.graphql_client.clone(),
9211        }
9212    }
9213    /// Returns details of a commit.
9214    ///
9215    /// # Arguments
9216    ///
9217    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
9218    pub fn commit(&self, id: impl Into<String>) -> GitCommit {
9219        let mut query = self.selection.select("commit");
9220        query = query.arg("id", id.into());
9221        GitCommit {
9222            proc: self.proc.clone(),
9223            selection: query,
9224            graphql_client: self.graphql_client.clone(),
9225        }
9226    }
9227    /// Returns details for HEAD.
9228    pub fn head(&self) -> GitRef {
9229        let query = self.selection.select("head");
9230        GitRef {
9231            proc: self.proc.clone(),
9232            selection: query,
9233            graphql_client: self.graphql_client.clone(),
9234        }
9235    }
9236    /// A unique identifier for this GitRepository.
9237    pub async fn id(&self) -> Result<Id, DaggerError> {
9238        let query = self.selection.select("id");
9239        query.execute(self.graphql_client.clone()).await
9240    }
9241    /// Return the latest stable release tag, falling back to HEAD when no release exists.
9242    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned.
9243    ///
9244    /// # Arguments
9245    ///
9246    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9247    pub fn latest(&self) -> GitRef {
9248        let query = self.selection.select("latest");
9249        GitRef {
9250            proc: self.proc.clone(),
9251            selection: query,
9252            graphql_client: self.graphql_client.clone(),
9253        }
9254    }
9255    /// Return the latest stable release tag, falling back to HEAD when no release exists.
9256    /// Release selection accepts an optional "v" prefix, incomplete versions, and zero-padded numeric components. This operation is pinned.
9257    ///
9258    /// # Arguments
9259    ///
9260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9261    pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
9262        let mut query = self.selection.select("latest");
9263        if let Some(version) = opts.version {
9264            query = query.arg("version", version);
9265        }
9266        GitRef {
9267            proc: self.proc.clone(),
9268            selection: query,
9269            graphql_client: self.graphql_client.clone(),
9270        }
9271    }
9272    /// Returns details of a ref.
9273    ///
9274    /// # Arguments
9275    ///
9276    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
9277    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
9278        let mut query = self.selection.select("ref");
9279        query = query.arg("name", name.into());
9280        GitRef {
9281            proc: self.proc.clone(),
9282            selection: query,
9283            graphql_client: self.graphql_client.clone(),
9284        }
9285    }
9286    /// Returns details of a tag.
9287    ///
9288    /// # Arguments
9289    ///
9290    /// * `name` - Tag's name (e.g., "v0.3.9").
9291    pub fn tag(&self, name: impl Into<String>) -> GitRef {
9292        let mut query = self.selection.select("tag");
9293        query = query.arg("name", name.into());
9294        GitRef {
9295            proc: self.proc.clone(),
9296            selection: query,
9297            graphql_client: self.graphql_client.clone(),
9298        }
9299    }
9300    /// tags that match any of the given glob patterns.
9301    ///
9302    /// # Arguments
9303    ///
9304    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9305    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
9306        let query = self.selection.select("tags");
9307        query.execute(self.graphql_client.clone()).await
9308    }
9309    /// tags that match any of the given glob patterns.
9310    ///
9311    /// # Arguments
9312    ///
9313    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9314    pub async fn tags_opts<'a>(
9315        &self,
9316        opts: GitRepositoryTagsOpts<'a>,
9317    ) -> Result<Vec<String>, DaggerError> {
9318        let mut query = self.selection.select("tags");
9319        if let Some(patterns) = opts.patterns {
9320            query = query.arg("patterns", patterns);
9321        }
9322        query.execute(self.graphql_client.clone()).await
9323    }
9324    /// Returns the changeset of uncommitted changes in the git repository.
9325    pub fn uncommitted(&self) -> Changeset {
9326        let query = self.selection.select("uncommitted");
9327        Changeset {
9328            proc: self.proc.clone(),
9329            selection: query,
9330            graphql_client: self.graphql_client.clone(),
9331        }
9332    }
9333    /// The URL of the git repository.
9334    pub async fn url(&self) -> Result<String, DaggerError> {
9335        let query = self.selection.select("url");
9336        query.execute(self.graphql_client.clone()).await
9337    }
9338    /// Import a Git bundle after fetching and verifying all of its prerequisites.
9339    ///
9340    /// # Arguments
9341    ///
9342    /// * `bundle` - The Git bundle to import.
9343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9344    pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
9345        let mut query = self.selection.select("withBundle");
9346        query = query.arg_lazy(
9347            "bundle",
9348            Box::new(move || {
9349                let bundle = bundle.clone();
9350                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
9351            }),
9352        );
9353        GitRepository {
9354            proc: self.proc.clone(),
9355            selection: query,
9356            graphql_client: self.graphql_client.clone(),
9357        }
9358    }
9359    /// Import a Git bundle after fetching and verifying all of its prerequisites.
9360    ///
9361    /// # Arguments
9362    ///
9363    /// * `bundle` - The Git bundle to import.
9364    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9365    pub fn with_bundle_opts<'a>(
9366        &self,
9367        bundle: impl IntoID<Id>,
9368        opts: GitRepositoryWithBundleOpts<'a>,
9369    ) -> GitRepository {
9370        let mut query = self.selection.select("withBundle");
9371        query = query.arg_lazy(
9372            "bundle",
9373            Box::new(move || {
9374                let bundle = bundle.clone();
9375                Box::pin(async move { bundle.into_id().await.unwrap().quote() })
9376            }),
9377        );
9378        if let Some(prerequisite_ref) = opts.prerequisite_ref {
9379            query = query.arg("prerequisiteRef", prerequisite_ref);
9380        }
9381        GitRepository {
9382            proc: self.proc.clone(),
9383            selection: query,
9384            graphql_client: self.graphql_client.clone(),
9385        }
9386    }
9387}
9388impl Node for GitRepository {
9389    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9390        let query = self.selection.select("id");
9391        let graphql_client = self.graphql_client.clone();
9392        async move { query.execute(graphql_client).await }
9393    }
9394}
9395#[derive(Clone)]
9396pub struct HttpState {
9397    pub proc: Option<Arc<DaggerSessionProc>>,
9398    pub selection: Selection,
9399    pub graphql_client: DynGraphQLClient,
9400}
9401impl IntoID<Id> for HttpState {
9402    fn into_id(
9403        self,
9404    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9405        Box::pin(async move { self.id().await })
9406    }
9407}
9408impl Loadable for HttpState {
9409    fn graphql_type() -> &'static str {
9410        "HTTPState"
9411    }
9412    fn from_query(
9413        proc: Option<Arc<DaggerSessionProc>>,
9414        selection: Selection,
9415        graphql_client: DynGraphQLClient,
9416    ) -> Self {
9417        Self {
9418            proc,
9419            selection,
9420            graphql_client,
9421        }
9422    }
9423}
9424impl HttpState {
9425    /// A unique identifier for this HTTPState.
9426    pub async fn id(&self) -> Result<Id, DaggerError> {
9427        let query = self.selection.select("id");
9428        query.execute(self.graphql_client.clone()).await
9429    }
9430}
9431impl Node for HttpState {
9432    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9433        let query = self.selection.select("id");
9434        let graphql_client = self.graphql_client.clone();
9435        async move { query.execute(graphql_client).await }
9436    }
9437}
9438#[derive(Clone)]
9439pub struct HealthcheckConfig {
9440    pub proc: Option<Arc<DaggerSessionProc>>,
9441    pub selection: Selection,
9442    pub graphql_client: DynGraphQLClient,
9443}
9444impl IntoID<Id> for HealthcheckConfig {
9445    fn into_id(
9446        self,
9447    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9448        Box::pin(async move { self.id().await })
9449    }
9450}
9451impl Loadable for HealthcheckConfig {
9452    fn graphql_type() -> &'static str {
9453        "HealthcheckConfig"
9454    }
9455    fn from_query(
9456        proc: Option<Arc<DaggerSessionProc>>,
9457        selection: Selection,
9458        graphql_client: DynGraphQLClient,
9459    ) -> Self {
9460        Self {
9461            proc,
9462            selection,
9463            graphql_client,
9464        }
9465    }
9466}
9467impl HealthcheckConfig {
9468    /// Healthcheck command arguments.
9469    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
9470        let query = self.selection.select("args");
9471        query.execute(self.graphql_client.clone()).await
9472    }
9473    /// A unique identifier for this HealthcheckConfig.
9474    pub async fn id(&self) -> Result<Id, DaggerError> {
9475        let query = self.selection.select("id");
9476        query.execute(self.graphql_client.clone()).await
9477    }
9478    /// Interval between running healthcheck. Example:30s
9479    pub async fn interval(&self) -> Result<String, DaggerError> {
9480        let query = self.selection.select("interval");
9481        query.execute(self.graphql_client.clone()).await
9482    }
9483    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
9484    pub async fn retries(&self) -> Result<isize, DaggerError> {
9485        let query = self.selection.select("retries");
9486        query.execute(self.graphql_client.clone()).await
9487    }
9488    /// Healthcheck command is a shell command.
9489    pub async fn shell(&self) -> Result<bool, DaggerError> {
9490        let query = self.selection.select("shell");
9491        query.execute(self.graphql_client.clone()).await
9492    }
9493    /// StartInterval configures the duration between checks during the startup phase. Example:5s
9494    pub async fn start_interval(&self) -> Result<String, DaggerError> {
9495        let query = self.selection.select("startInterval");
9496        query.execute(self.graphql_client.clone()).await
9497    }
9498    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
9499    pub async fn start_period(&self) -> Result<String, DaggerError> {
9500        let query = self.selection.select("startPeriod");
9501        query.execute(self.graphql_client.clone()).await
9502    }
9503    /// Healthcheck timeout. Example:3s
9504    pub async fn timeout(&self) -> Result<String, DaggerError> {
9505        let query = self.selection.select("timeout");
9506        query.execute(self.graphql_client.clone()).await
9507    }
9508}
9509impl Node for HealthcheckConfig {
9510    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9511        let query = self.selection.select("id");
9512        let graphql_client = self.graphql_client.clone();
9513        async move { query.execute(graphql_client).await }
9514    }
9515}
9516#[derive(Clone)]
9517pub struct Host {
9518    pub proc: Option<Arc<DaggerSessionProc>>,
9519    pub selection: Selection,
9520    pub graphql_client: DynGraphQLClient,
9521}
9522#[derive(Builder, Debug, PartialEq)]
9523pub struct HostDirectoryOpts<'a> {
9524    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
9525    #[builder(setter(into, strip_option), default)]
9526    pub exclude: Option<Vec<&'a str>>,
9527    /// Apply .gitignore filter rules inside the directory
9528    #[builder(setter(into, strip_option), default)]
9529    pub gitignore: Option<bool>,
9530    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
9531    #[builder(setter(into, strip_option), default)]
9532    pub include: Option<Vec<&'a str>>,
9533    /// If true, the directory will always be reloaded from the host.
9534    #[builder(setter(into, strip_option), default)]
9535    pub no_cache: Option<bool>,
9536}
9537#[derive(Builder, Debug, PartialEq)]
9538pub struct HostFileOpts {
9539    /// If true, the file will always be reloaded from the host.
9540    #[builder(setter(into, strip_option), default)]
9541    pub no_cache: Option<bool>,
9542}
9543#[derive(Builder, Debug, PartialEq)]
9544pub struct HostFindUpOpts {
9545    #[builder(setter(into, strip_option), default)]
9546    pub no_cache: Option<bool>,
9547}
9548#[derive(Builder, Debug, PartialEq)]
9549pub struct HostServiceOpts<'a> {
9550    /// Upstream host to forward traffic to.
9551    #[builder(setter(into, strip_option), default)]
9552    pub host: Option<&'a str>,
9553}
9554#[derive(Builder, Debug, PartialEq)]
9555pub struct HostTunnelOpts {
9556    /// Map each service port to the same port on the host, as if the service were running natively.
9557    /// Note: enabling may result in port conflicts.
9558    #[builder(setter(into, strip_option), default)]
9559    pub native: Option<bool>,
9560    /// Configure explicit port forwarding rules for the tunnel.
9561    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
9562    /// 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.
9563    /// If ports are given and native is true, the ports are additive.
9564    #[builder(setter(into, strip_option), default)]
9565    pub ports: Option<Vec<PortForward>>,
9566}
9567impl IntoID<Id> for Host {
9568    fn into_id(
9569        self,
9570    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9571        Box::pin(async move { self.id().await })
9572    }
9573}
9574impl Loadable for Host {
9575    fn graphql_type() -> &'static str {
9576        "Host"
9577    }
9578    fn from_query(
9579        proc: Option<Arc<DaggerSessionProc>>,
9580        selection: Selection,
9581        graphql_client: DynGraphQLClient,
9582    ) -> Self {
9583        Self {
9584            proc,
9585            selection,
9586            graphql_client,
9587        }
9588    }
9589}
9590impl Host {
9591    /// Accesses a container image on the host.
9592    ///
9593    /// # Arguments
9594    ///
9595    /// * `name` - Name of the image to access.
9596    pub fn container_image(&self, name: impl Into<String>) -> Container {
9597        let mut query = self.selection.select("containerImage");
9598        query = query.arg("name", name.into());
9599        Container {
9600            proc: self.proc.clone(),
9601            selection: query,
9602            graphql_client: self.graphql_client.clone(),
9603        }
9604    }
9605    /// Accesses a directory on the host.
9606    ///
9607    /// # Arguments
9608    ///
9609    /// * `path` - Location of the directory to access (e.g., ".").
9610    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9611    pub fn directory(&self, path: impl Into<String>) -> Directory {
9612        let mut query = self.selection.select("directory");
9613        query = query.arg("path", path.into());
9614        Directory {
9615            proc: self.proc.clone(),
9616            selection: query,
9617            graphql_client: self.graphql_client.clone(),
9618        }
9619    }
9620    /// Accesses a directory on the host.
9621    ///
9622    /// # Arguments
9623    ///
9624    /// * `path` - Location of the directory to access (e.g., ".").
9625    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9626    pub fn directory_opts<'a>(
9627        &self,
9628        path: impl Into<String>,
9629        opts: HostDirectoryOpts<'a>,
9630    ) -> Directory {
9631        let mut query = self.selection.select("directory");
9632        query = query.arg("path", path.into());
9633        if let Some(exclude) = opts.exclude {
9634            query = query.arg("exclude", exclude);
9635        }
9636        if let Some(include) = opts.include {
9637            query = query.arg("include", include);
9638        }
9639        if let Some(no_cache) = opts.no_cache {
9640            query = query.arg("noCache", no_cache);
9641        }
9642        if let Some(gitignore) = opts.gitignore {
9643            query = query.arg("gitignore", gitignore);
9644        }
9645        Directory {
9646            proc: self.proc.clone(),
9647            selection: query,
9648            graphql_client: self.graphql_client.clone(),
9649        }
9650    }
9651    /// Accesses a file on the host.
9652    ///
9653    /// # Arguments
9654    ///
9655    /// * `path` - Location of the file to retrieve (e.g., "README.md").
9656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9657    pub fn file(&self, path: impl Into<String>) -> File {
9658        let mut query = self.selection.select("file");
9659        query = query.arg("path", path.into());
9660        File {
9661            proc: self.proc.clone(),
9662            selection: query,
9663            graphql_client: self.graphql_client.clone(),
9664        }
9665    }
9666    /// Accesses a file on the host.
9667    ///
9668    /// # Arguments
9669    ///
9670    /// * `path` - Location of the file to retrieve (e.g., "README.md").
9671    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9672    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
9673        let mut query = self.selection.select("file");
9674        query = query.arg("path", path.into());
9675        if let Some(no_cache) = opts.no_cache {
9676            query = query.arg("noCache", no_cache);
9677        }
9678        File {
9679            proc: self.proc.clone(),
9680            selection: query,
9681            graphql_client: self.graphql_client.clone(),
9682        }
9683    }
9684    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
9685    ///
9686    /// # Arguments
9687    ///
9688    /// * `name` - name of the file or directory to search for
9689    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9690    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
9691        let mut query = self.selection.select("findUp");
9692        query = query.arg("name", name.into());
9693        query.execute(self.graphql_client.clone()).await
9694    }
9695    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
9696    ///
9697    /// # Arguments
9698    ///
9699    /// * `name` - name of the file or directory to search for
9700    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9701    pub async fn find_up_opts(
9702        &self,
9703        name: impl Into<String>,
9704        opts: HostFindUpOpts,
9705    ) -> Result<String, DaggerError> {
9706        let mut query = self.selection.select("findUp");
9707        query = query.arg("name", name.into());
9708        if let Some(no_cache) = opts.no_cache {
9709            query = query.arg("noCache", no_cache);
9710        }
9711        query.execute(self.graphql_client.clone()).await
9712    }
9713    /// A unique identifier for this Host.
9714    pub async fn id(&self) -> Result<Id, DaggerError> {
9715        let query = self.selection.select("id");
9716        query.execute(self.graphql_client.clone()).await
9717    }
9718    /// Creates a service that forwards traffic to a specified address via the host.
9719    ///
9720    /// # Arguments
9721    ///
9722    /// * `ports` - Ports to expose via the service, forwarding through the host network.
9723    ///
9724    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
9725    ///
9726    /// An empty set of ports is not valid; an error will be returned.
9727    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9728    pub fn service(&self, ports: Vec<PortForward>) -> Service {
9729        let mut query = self.selection.select("service");
9730        query = query.arg("ports", ports);
9731        Service {
9732            proc: self.proc.clone(),
9733            selection: query,
9734            graphql_client: self.graphql_client.clone(),
9735        }
9736    }
9737    /// Creates a service that forwards traffic to a specified address via the host.
9738    ///
9739    /// # Arguments
9740    ///
9741    /// * `ports` - Ports to expose via the service, forwarding through the host network.
9742    ///
9743    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
9744    ///
9745    /// An empty set of ports is not valid; an error will be returned.
9746    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9747    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
9748        let mut query = self.selection.select("service");
9749        query = query.arg("ports", ports);
9750        if let Some(host) = opts.host {
9751            query = query.arg("host", host);
9752        }
9753        Service {
9754            proc: self.proc.clone(),
9755            selection: query,
9756            graphql_client: self.graphql_client.clone(),
9757        }
9758    }
9759    /// Creates a tunnel that forwards traffic from the host to a service.
9760    ///
9761    /// # Arguments
9762    ///
9763    /// * `service` - Service to send traffic from the tunnel.
9764    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9765    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
9766        let mut query = self.selection.select("tunnel");
9767        query = query.arg_lazy(
9768            "service",
9769            Box::new(move || {
9770                let service = service.clone();
9771                Box::pin(async move { service.into_id().await.unwrap().quote() })
9772            }),
9773        );
9774        Service {
9775            proc: self.proc.clone(),
9776            selection: query,
9777            graphql_client: self.graphql_client.clone(),
9778        }
9779    }
9780    /// Creates a tunnel that forwards traffic from the host to a service.
9781    ///
9782    /// # Arguments
9783    ///
9784    /// * `service` - Service to send traffic from the tunnel.
9785    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9786    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
9787        let mut query = self.selection.select("tunnel");
9788        query = query.arg_lazy(
9789            "service",
9790            Box::new(move || {
9791                let service = service.clone();
9792                Box::pin(async move { service.into_id().await.unwrap().quote() })
9793            }),
9794        );
9795        if let Some(native) = opts.native {
9796            query = query.arg("native", native);
9797        }
9798        if let Some(ports) = opts.ports {
9799            query = query.arg("ports", ports);
9800        }
9801        Service {
9802            proc: self.proc.clone(),
9803            selection: query,
9804            graphql_client: self.graphql_client.clone(),
9805        }
9806    }
9807    /// Accesses a Unix socket on the host.
9808    ///
9809    /// # Arguments
9810    ///
9811    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
9812    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
9813        let mut query = self.selection.select("unixSocket");
9814        query = query.arg("path", path.into());
9815        Socket {
9816            proc: self.proc.clone(),
9817            selection: query,
9818            graphql_client: self.graphql_client.clone(),
9819        }
9820    }
9821}
9822impl Node for Host {
9823    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9824        let query = self.selection.select("id");
9825        let graphql_client = self.graphql_client.clone();
9826        async move { query.execute(graphql_client).await }
9827    }
9828}
9829#[derive(Clone)]
9830pub struct InputTypeDef {
9831    pub proc: Option<Arc<DaggerSessionProc>>,
9832    pub selection: Selection,
9833    pub graphql_client: DynGraphQLClient,
9834}
9835impl IntoID<Id> for InputTypeDef {
9836    fn into_id(
9837        self,
9838    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9839        Box::pin(async move { self.id().await })
9840    }
9841}
9842impl Loadable for InputTypeDef {
9843    fn graphql_type() -> &'static str {
9844        "InputTypeDef"
9845    }
9846    fn from_query(
9847        proc: Option<Arc<DaggerSessionProc>>,
9848        selection: Selection,
9849        graphql_client: DynGraphQLClient,
9850    ) -> Self {
9851        Self {
9852            proc,
9853            selection,
9854            graphql_client,
9855        }
9856    }
9857}
9858impl InputTypeDef {
9859    /// Static fields defined on this input object, if any.
9860    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
9861        let query = self.selection.select("fields");
9862        let query = query.select("id");
9863        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9864        Ok(ids
9865            .into_iter()
9866            .map(|id| FieldTypeDef {
9867                proc: self.proc.clone(),
9868                selection: crate::querybuilder::query()
9869                    .select("node")
9870                    .arg("id", &id.0)
9871                    .inline_fragment("FieldTypeDef"),
9872                graphql_client: self.graphql_client.clone(),
9873            })
9874            .collect())
9875    }
9876    /// A unique identifier for this InputTypeDef.
9877    pub async fn id(&self) -> Result<Id, DaggerError> {
9878        let query = self.selection.select("id");
9879        query.execute(self.graphql_client.clone()).await
9880    }
9881    /// The name of the input object.
9882    pub async fn name(&self) -> Result<String, DaggerError> {
9883        let query = self.selection.select("name");
9884        query.execute(self.graphql_client.clone()).await
9885    }
9886}
9887impl Node for InputTypeDef {
9888    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9889        let query = self.selection.select("id");
9890        let graphql_client = self.graphql_client.clone();
9891        async move { query.execute(graphql_client).await }
9892    }
9893}
9894#[derive(Clone)]
9895pub struct InterfaceTypeDef {
9896    pub proc: Option<Arc<DaggerSessionProc>>,
9897    pub selection: Selection,
9898    pub graphql_client: DynGraphQLClient,
9899}
9900impl IntoID<Id> for InterfaceTypeDef {
9901    fn into_id(
9902        self,
9903    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9904        Box::pin(async move { self.id().await })
9905    }
9906}
9907impl Loadable for InterfaceTypeDef {
9908    fn graphql_type() -> &'static str {
9909        "InterfaceTypeDef"
9910    }
9911    fn from_query(
9912        proc: Option<Arc<DaggerSessionProc>>,
9913        selection: Selection,
9914        graphql_client: DynGraphQLClient,
9915    ) -> Self {
9916        Self {
9917            proc,
9918            selection,
9919            graphql_client,
9920        }
9921    }
9922}
9923impl InterfaceTypeDef {
9924    /// The doc string for the interface, if any.
9925    pub async fn description(&self) -> Result<String, DaggerError> {
9926        let query = self.selection.select("description");
9927        query.execute(self.graphql_client.clone()).await
9928    }
9929    /// Functions defined on this interface, if any.
9930    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
9931        let query = self.selection.select("functions");
9932        let query = query.select("id");
9933        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9934        Ok(ids
9935            .into_iter()
9936            .map(|id| Function {
9937                proc: self.proc.clone(),
9938                selection: crate::querybuilder::query()
9939                    .select("node")
9940                    .arg("id", &id.0)
9941                    .inline_fragment("Function"),
9942                graphql_client: self.graphql_client.clone(),
9943            })
9944            .collect())
9945    }
9946    /// A unique identifier for this InterfaceTypeDef.
9947    pub async fn id(&self) -> Result<Id, DaggerError> {
9948        let query = self.selection.select("id");
9949        query.execute(self.graphql_client.clone()).await
9950    }
9951    /// The name of the interface.
9952    pub async fn name(&self) -> Result<String, DaggerError> {
9953        let query = self.selection.select("name");
9954        query.execute(self.graphql_client.clone()).await
9955    }
9956    /// The location of this interface declaration.
9957    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9958        let query = self.selection.select("sourceMap");
9959        let query = query.select("id");
9960        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9961        Ok(id.map(|id| SourceMap {
9962            proc: self.proc.clone(),
9963            selection: query
9964                .root()
9965                .select("node")
9966                .arg("id", &id.0)
9967                .inline_fragment("SourceMap"),
9968            graphql_client: self.graphql_client.clone(),
9969        }))
9970    }
9971    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
9972    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9973        let query = self.selection.select("sourceModuleName");
9974        query.execute(self.graphql_client.clone()).await
9975    }
9976}
9977impl Node for InterfaceTypeDef {
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 JsonValue {
9986    pub proc: Option<Arc<DaggerSessionProc>>,
9987    pub selection: Selection,
9988    pub graphql_client: DynGraphQLClient,
9989}
9990#[derive(Builder, Debug, PartialEq)]
9991pub struct JsonValueContentsOpts<'a> {
9992    /// Optional line prefix
9993    #[builder(setter(into, strip_option), default)]
9994    pub indent: Option<&'a str>,
9995    /// Pretty-print
9996    #[builder(setter(into, strip_option), default)]
9997    pub pretty: Option<bool>,
9998}
9999impl IntoID<Id> for JsonValue {
10000    fn into_id(
10001        self,
10002    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10003        Box::pin(async move { self.id().await })
10004    }
10005}
10006impl Loadable for JsonValue {
10007    fn graphql_type() -> &'static str {
10008        "JSONValue"
10009    }
10010    fn from_query(
10011        proc: Option<Arc<DaggerSessionProc>>,
10012        selection: Selection,
10013        graphql_client: DynGraphQLClient,
10014    ) -> Self {
10015        Self {
10016            proc,
10017            selection,
10018            graphql_client,
10019        }
10020    }
10021}
10022impl JsonValue {
10023    /// Decode an array from json
10024    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10025        let query = self.selection.select("asArray");
10026        let query = query.select("id");
10027        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10028        Ok(ids
10029            .into_iter()
10030            .map(|id| JsonValue {
10031                proc: self.proc.clone(),
10032                selection: crate::querybuilder::query()
10033                    .select("node")
10034                    .arg("id", &id.0)
10035                    .inline_fragment("JSONValue"),
10036                graphql_client: self.graphql_client.clone(),
10037            })
10038            .collect())
10039    }
10040    /// Decode a boolean from json
10041    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10042        let query = self.selection.select("asBoolean");
10043        query.execute(self.graphql_client.clone()).await
10044    }
10045    /// Decode an integer from json
10046    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10047        let query = self.selection.select("asInteger");
10048        query.execute(self.graphql_client.clone()).await
10049    }
10050    /// Decode a string from json
10051    pub async fn as_string(&self) -> Result<String, DaggerError> {
10052        let query = self.selection.select("asString");
10053        query.execute(self.graphql_client.clone()).await
10054    }
10055    /// Return the value encoded as json
10056    ///
10057    /// # Arguments
10058    ///
10059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10060    pub async fn contents(&self) -> Result<Json, DaggerError> {
10061        let query = self.selection.select("contents");
10062        query.execute(self.graphql_client.clone()).await
10063    }
10064    /// Return the value encoded as json
10065    ///
10066    /// # Arguments
10067    ///
10068    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10069    pub async fn contents_opts<'a>(
10070        &self,
10071        opts: JsonValueContentsOpts<'a>,
10072    ) -> Result<Json, DaggerError> {
10073        let mut query = self.selection.select("contents");
10074        if let Some(pretty) = opts.pretty {
10075            query = query.arg("pretty", pretty);
10076        }
10077        if let Some(indent) = opts.indent {
10078            query = query.arg("indent", indent);
10079        }
10080        query.execute(self.graphql_client.clone()).await
10081    }
10082    /// Lookup the field at the given path, and return its value.
10083    ///
10084    /// # Arguments
10085    ///
10086    /// * `path` - Path of the field to lookup, encoded as an array of field names
10087    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10088        let mut query = self.selection.select("field");
10089        query = query.arg(
10090            "path",
10091            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10092        );
10093        JsonValue {
10094            proc: self.proc.clone(),
10095            selection: query,
10096            graphql_client: self.graphql_client.clone(),
10097        }
10098    }
10099    /// List fields of the encoded object
10100    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10101        let query = self.selection.select("fields");
10102        query.execute(self.graphql_client.clone()).await
10103    }
10104    /// A unique identifier for this JSONValue.
10105    pub async fn id(&self) -> Result<Id, DaggerError> {
10106        let query = self.selection.select("id");
10107        query.execute(self.graphql_client.clone()).await
10108    }
10109    /// Encode a boolean to json
10110    ///
10111    /// # Arguments
10112    ///
10113    /// * `value` - New boolean value
10114    pub fn new_boolean(&self, value: bool) -> JsonValue {
10115        let mut query = self.selection.select("newBoolean");
10116        query = query.arg("value", value);
10117        JsonValue {
10118            proc: self.proc.clone(),
10119            selection: query,
10120            graphql_client: self.graphql_client.clone(),
10121        }
10122    }
10123    /// Encode an integer to json
10124    ///
10125    /// # Arguments
10126    ///
10127    /// * `value` - New integer value
10128    pub fn new_integer(&self, value: isize) -> JsonValue {
10129        let mut query = self.selection.select("newInteger");
10130        query = query.arg("value", value);
10131        JsonValue {
10132            proc: self.proc.clone(),
10133            selection: query,
10134            graphql_client: self.graphql_client.clone(),
10135        }
10136    }
10137    /// Encode a string to json
10138    ///
10139    /// # Arguments
10140    ///
10141    /// * `value` - New string value
10142    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10143        let mut query = self.selection.select("newString");
10144        query = query.arg("value", value.into());
10145        JsonValue {
10146            proc: self.proc.clone(),
10147            selection: query,
10148            graphql_client: self.graphql_client.clone(),
10149        }
10150    }
10151    /// Return a new json value, decoded from the given content
10152    ///
10153    /// # Arguments
10154    ///
10155    /// * `contents` - New JSON-encoded contents
10156    pub fn with_contents(&self, contents: Json) -> JsonValue {
10157        let mut query = self.selection.select("withContents");
10158        query = query.arg("contents", contents);
10159        JsonValue {
10160            proc: self.proc.clone(),
10161            selection: query,
10162            graphql_client: self.graphql_client.clone(),
10163        }
10164    }
10165    /// Set a new field at the given path
10166    ///
10167    /// # Arguments
10168    ///
10169    /// * `path` - Path of the field to set, encoded as an array of field names
10170    /// * `value` - The new value of the field
10171    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10172        let mut query = self.selection.select("withField");
10173        query = query.arg(
10174            "path",
10175            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10176        );
10177        query = query.arg_lazy(
10178            "value",
10179            Box::new(move || {
10180                let value = value.clone();
10181                Box::pin(async move { value.into_id().await.unwrap().quote() })
10182            }),
10183        );
10184        JsonValue {
10185            proc: self.proc.clone(),
10186            selection: query,
10187            graphql_client: self.graphql_client.clone(),
10188        }
10189    }
10190}
10191impl Node for JsonValue {
10192    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10193        let query = self.selection.select("id");
10194        let graphql_client = self.graphql_client.clone();
10195        async move { query.execute(graphql_client).await }
10196    }
10197}
10198#[derive(Clone)]
10199pub struct Llm {
10200    pub proc: Option<Arc<DaggerSessionProc>>,
10201    pub selection: Selection,
10202    pub graphql_client: DynGraphQLClient,
10203}
10204#[derive(Builder, Debug, PartialEq)]
10205pub struct LlmLoopOpts {
10206    /// Cap the number of steps. The loop fails if the cap is reached before the model ends its turn.
10207    #[builder(setter(into, strip_option), default)]
10208    pub max_steps: Option<isize>,
10209    /// Cap the model's output tokens on each step. Defaults to the model's maximum.
10210    #[builder(setter(into, strip_option), default)]
10211    pub max_tokens: Option<isize>,
10212}
10213#[derive(Builder, Debug, PartialEq)]
10214pub struct LlmStepOpts {
10215    /// Cap the model's output tokens for this step. Defaults to the model's maximum.
10216    #[builder(setter(into, strip_option), default)]
10217    pub max_tokens: Option<isize>,
10218}
10219#[derive(Builder, Debug, PartialEq)]
10220pub struct LlmWithModelOpts<'a> {
10221    /// 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.
10222    #[builder(setter(into, strip_option), default)]
10223    pub provider: Option<&'a str>,
10224}
10225#[derive(Builder, Debug, PartialEq)]
10226pub struct LlmWithResponseOpts {
10227    /// Cached input tokens read
10228    #[builder(setter(into, strip_option), default)]
10229    pub cached_token_reads: Option<isize>,
10230    /// Cached input tokens written
10231    #[builder(setter(into, strip_option), default)]
10232    pub cached_token_writes: Option<isize>,
10233    /// Uncached input tokens sent
10234    #[builder(setter(into, strip_option), default)]
10235    pub input_tokens: Option<isize>,
10236    /// Tokens received from the model, including text and tool calls
10237    #[builder(setter(into, strip_option), default)]
10238    pub output_tokens: Option<isize>,
10239    /// Total tokens consumed by this response
10240    #[builder(setter(into, strip_option), default)]
10241    pub total_tokens: Option<isize>,
10242}
10243#[derive(Builder, Debug, PartialEq)]
10244pub struct LlmWithToolsOpts<'a> {
10245    /// Method names to exclude from the toolset (e.g. constructors, entrypoints).
10246    #[builder(setter(into, strip_option), default)]
10247    pub except: Option<Vec<&'a str>>,
10248}
10249impl IntoID<Id> for Llm {
10250    fn into_id(
10251        self,
10252    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10253        Box::pin(async move { self.id().await })
10254    }
10255}
10256impl Loadable for Llm {
10257    fn graphql_type() -> &'static str {
10258        "LLM"
10259    }
10260    fn from_query(
10261        proc: Option<Arc<DaggerSessionProc>>,
10262        selection: Selection,
10263        graphql_client: DynGraphQLClient,
10264    ) -> Self {
10265        Self {
10266            proc,
10267            selection,
10268            graphql_client,
10269        }
10270    }
10271}
10272impl Llm {
10273    /// estimated number of tokens currently occupying the context window; unlike tokenUsage this is not cumulative over the session
10274    pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
10275        let query = self.selection.select("contextTokens");
10276        query.execute(self.graphql_client.clone()).await
10277    }
10278    /// The model's total context window in tokens, or null if unknown (e.g. a local or uncatalogued model).
10279    pub async fn context_window(&self) -> Result<isize, DaggerError> {
10280        let query = self.selection.select("contextWindow");
10281        query.execute(self.graphql_client.clone()).await
10282    }
10283    /// Fork the conversation, so that otherwise-identical follow-ups evaluate independently instead of deduplicating to a single cached result.
10284    ///
10285    /// # Arguments
10286    ///
10287    /// * `label` - A label distinguishing this fork from its siblings, e.g. "attempt-2" when retrying a flaky evaluation.
10288    pub fn fork(&self, label: impl Into<String>) -> Llm {
10289        let mut query = self.selection.select("fork");
10290        query = query.arg("label", label.into());
10291        Llm {
10292            proc: self.proc.clone(),
10293            selection: query,
10294            graphql_client: self.graphql_client.clone(),
10295        }
10296    }
10297    /// 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.
10298    pub async fn has_pending(&self) -> Result<bool, DaggerError> {
10299        let query = self.selection.select("hasPending");
10300        query.execute(self.graphql_client.clone()).await
10301    }
10302    /// A unique identifier for this LLM.
10303    pub async fn id(&self) -> Result<Id, DaggerError> {
10304        let query = self.selection.select("id");
10305        query.execute(self.graphql_client.clone()).await
10306    }
10307    /// The text of the model's most recent reply.
10308    pub async fn last_reply(&self) -> Result<String, DaggerError> {
10309        let query = self.selection.select("lastReply");
10310        query.execute(self.graphql_client.clone()).await
10311    }
10312    /// 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.
10313    ///
10314    /// # Arguments
10315    ///
10316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10317    pub fn r#loop(&self) -> Llm {
10318        let query = self.selection.select("loop");
10319        Llm {
10320            proc: self.proc.clone(),
10321            selection: query,
10322            graphql_client: self.graphql_client.clone(),
10323        }
10324    }
10325    /// 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.
10326    ///
10327    /// # Arguments
10328    ///
10329    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10330    pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
10331        let mut query = self.selection.select("loop");
10332        if let Some(max_steps) = opts.max_steps {
10333            query = query.arg("maxSteps", max_steps);
10334        }
10335        if let Some(max_tokens) = opts.max_tokens {
10336            query = query.arg("maxTokens", max_tokens);
10337        }
10338        Llm {
10339            proc: self.proc.clone(),
10340            selection: query,
10341            graphql_client: self.graphql_client.clone(),
10342        }
10343    }
10344    /// The full message history, as structured messages.
10345    pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
10346        let query = self.selection.select("messages");
10347        let query = query.select("id");
10348        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10349        Ok(ids
10350            .into_iter()
10351            .map(|id| LlmMessage {
10352                proc: self.proc.clone(),
10353                selection: crate::querybuilder::query()
10354                    .select("node")
10355                    .arg("id", &id.0)
10356                    .inline_fragment("LLMMessage"),
10357                graphql_client: self.graphql_client.clone(),
10358            })
10359            .collect())
10360    }
10361    /// The model the conversation is running against, after resolving any configured default.
10362    pub async fn model(&self) -> Result<String, DaggerError> {
10363        let query = self.selection.select("model");
10364        query.execute(self.graphql_client.clone()).await
10365    }
10366    /// A portable, self-contained ID for the conversation that node() can resolve in any session. Unlike id, which may return an engine-local runtime handle valid only within the current session, this returns the recipe form suitable for persisting and later restoring the conversation. The recipe is flattened: bindings superseded during the session (workspace overlays recorded by each mutating tool call, and re-bound toolsets) are dropped, while the current workspace binding — including any pending, un-exported edits — is preserved.
10367    pub async fn portable_id(&self) -> Result<Id, DaggerError> {
10368        let query = self.selection.select("portableID");
10369        query.execute(self.graphql_client.clone()).await
10370    }
10371    /// The provider serving the model, e.g. "anthropic", "openai", "google", or "local".
10372    pub async fn provider(&self) -> Result<String, DaggerError> {
10373        let query = self.selection.select("provider");
10374        query.execute(self.graphql_client.clone()).await
10375    }
10376    /// The reasoning effort in use, e.g. "low", "medium", or "high". Empty or "none" when reasoning is disabled.
10377    pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
10378        let query = self.selection.select("reasoningEffort");
10379        query.execute(self.graphql_client.clone()).await
10380    }
10381    /// Re-emit telemetry spans for the full message history, so a loaded conversation displays in the TUI.
10382    pub async fn replay(&self) -> Result<Llm, DaggerError> {
10383        let query = self.selection.select("replay");
10384        let id: Id = query.execute(self.graphql_client.clone()).await?;
10385        Ok(Llm {
10386            proc: self.proc.clone(),
10387            selection: query
10388                .root()
10389                .select("node")
10390                .arg("id", &id.0)
10391                .inline_fragment("LLM"),
10392            graphql_client: self.graphql_client.clone(),
10393        })
10394    }
10395    /// 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.
10396    pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
10397        let query = self.selection.select("skills");
10398        let query = query.select("id");
10399        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10400        Ok(ids
10401            .into_iter()
10402            .map(|id| LlmSkill {
10403                proc: self.proc.clone(),
10404                selection: crate::querybuilder::query()
10405                    .select("node")
10406                    .arg("id", &id.0)
10407                    .inline_fragment("LLMSkill"),
10408                graphql_client: self.graphql_client.clone(),
10409            })
10410            .collect())
10411    }
10412    /// 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.
10413    ///
10414    /// # Arguments
10415    ///
10416    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10417    pub fn step(&self) -> Llm {
10418        let query = self.selection.select("step");
10419        Llm {
10420            proc: self.proc.clone(),
10421            selection: query,
10422            graphql_client: self.graphql_client.clone(),
10423        }
10424    }
10425    /// 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.
10426    ///
10427    /// # Arguments
10428    ///
10429    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10430    pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
10431        let mut query = self.selection.select("step");
10432        if let Some(max_tokens) = opts.max_tokens {
10433            query = query.arg("maxTokens", max_tokens);
10434        }
10435        Llm {
10436            proc: self.proc.clone(),
10437            selection: query,
10438            graphql_client: self.graphql_client.clone(),
10439        }
10440    }
10441    /// Force evaluation of the conversation's pending operations (prompts, steps, loops) in the engine.
10442    pub async fn sync(&self) -> Result<Llm, DaggerError> {
10443        let query = self.selection.select("sync");
10444        let id: Id = query.execute(self.graphql_client.clone()).await?;
10445        Ok(Llm {
10446            proc: self.proc.clone(),
10447            selection: query
10448                .root()
10449                .select("node")
10450                .arg("id", &id.0)
10451                .inline_fragment("LLM"),
10452            graphql_client: self.graphql_client.clone(),
10453        })
10454    }
10455    /// The cumulative token usage, summed across every API call in the conversation.
10456    pub fn token_usage(&self) -> LlmTokenUsage {
10457        let query = self.selection.select("tokenUsage");
10458        LlmTokenUsage {
10459            proc: self.proc.clone(),
10460            selection: query,
10461            graphql_client: self.graphql_client.clone(),
10462        }
10463    }
10464    /// Render documentation for the tools currently exposed to the model.
10465    pub async fn tools(&self) -> Result<String, DaggerError> {
10466        let query = self.selection.select("tools");
10467        query.execute(self.graphql_client.clone()).await
10468    }
10469    /// The message history rendered as a plain-text transcript, suitable for feeding back to an LLM (e.g. for summarization).
10470    pub async fn transcript(&self) -> Result<String, DaggerError> {
10471        let query = self.selection.select("transcript");
10472        query.execute(self.graphql_client.clone()).await
10473    }
10474    /// Add an external MCP server to the LLM
10475    ///
10476    /// # Arguments
10477    ///
10478    /// * `name` - The name of the MCP server
10479    /// * `service` - The MCP service to run and communicate with over stdio
10480    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
10481        let mut query = self.selection.select("withMCPServer");
10482        query = query.arg("name", name.into());
10483        query = query.arg_lazy(
10484            "service",
10485            Box::new(move || {
10486                let service = service.clone();
10487                Box::pin(async move { service.into_id().await.unwrap().quote() })
10488            }),
10489        );
10490        Llm {
10491            proc: self.proc.clone(),
10492            selection: query,
10493            graphql_client: self.graphql_client.clone(),
10494        }
10495    }
10496    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
10497    ///
10498    /// # Arguments
10499    ///
10500    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
10501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10502    pub fn with_model(&self, model: impl Into<String>) -> Llm {
10503        let mut query = self.selection.select("withModel");
10504        query = query.arg("model", model.into());
10505        Llm {
10506            proc: self.proc.clone(),
10507            selection: query,
10508            graphql_client: self.graphql_client.clone(),
10509        }
10510    }
10511    /// Change the model for the rest of the conversation. The message history is preserved; the new model takes effect on the next step.
10512    ///
10513    /// # Arguments
10514    ///
10515    /// * `model` - The model to use, e.g. "claude-sonnet-4-5" or "gpt-5.4".
10516    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10517    pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
10518        let mut query = self.selection.select("withModel");
10519        query = query.arg("model", model.into());
10520        if let Some(provider) = opts.provider {
10521            query = query.arg("provider", provider);
10522        }
10523        Llm {
10524            proc: self.proc.clone(),
10525            selection: query,
10526            graphql_client: self.graphql_client.clone(),
10527        }
10528    }
10529    /// Queue a user prompt, to be sent to the model on the next step or loop.
10530    ///
10531    /// # Arguments
10532    ///
10533    /// * `prompt` - The prompt to send
10534    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
10535        let mut query = self.selection.select("withPrompt");
10536        query = query.arg("prompt", prompt.into());
10537        Llm {
10538            proc: self.proc.clone(),
10539            selection: query,
10540            graphql_client: self.graphql_client.clone(),
10541        }
10542    }
10543    /// Queue a file's contents as a user prompt, like withPrompt.
10544    ///
10545    /// # Arguments
10546    ///
10547    /// * `file` - The file to read the prompt from
10548    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
10549        let mut query = self.selection.select("withPromptFile");
10550        query = query.arg_lazy(
10551            "file",
10552            Box::new(move || {
10553                let file = file.clone();
10554                Box::pin(async move { file.into_id().await.unwrap().quote() })
10555            }),
10556        );
10557        Llm {
10558            proc: self.proc.clone(),
10559            selection: query,
10560            graphql_client: self.graphql_client.clone(),
10561        }
10562    }
10563    /// 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.
10564    ///
10565    /// # Arguments
10566    ///
10567    /// * `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".
10568    pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
10569        let mut query = self.selection.select("withReasoningEffort");
10570        query = query.arg("effort", effort.into());
10571        Llm {
10572            proc: self.proc.clone(),
10573            selection: query,
10574            graphql_client: self.graphql_client.clone(),
10575        }
10576    }
10577    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
10578    ///
10579    /// # Arguments
10580    ///
10581    /// * `content` - The response content
10582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10583    pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
10584        let mut query = self.selection.select("withResponse");
10585        query = query.arg("content", content);
10586        Llm {
10587            proc: self.proc.clone(),
10588            selection: query,
10589            graphql_client: self.graphql_client.clone(),
10590        }
10591    }
10592    /// Append an assistant response to the message history without calling the model, e.g. to reconstruct a conversation from another source.
10593    ///
10594    /// # Arguments
10595    ///
10596    /// * `content` - The response content
10597    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10598    pub fn with_response_opts(
10599        &self,
10600        content: Vec<LlmContentBlockInput>,
10601        opts: LlmWithResponseOpts,
10602    ) -> Llm {
10603        let mut query = self.selection.select("withResponse");
10604        query = query.arg("content", content);
10605        if let Some(input_tokens) = opts.input_tokens {
10606            query = query.arg("inputTokens", input_tokens);
10607        }
10608        if let Some(output_tokens) = opts.output_tokens {
10609            query = query.arg("outputTokens", output_tokens);
10610        }
10611        if let Some(cached_token_reads) = opts.cached_token_reads {
10612            query = query.arg("cachedTokenReads", cached_token_reads);
10613        }
10614        if let Some(cached_token_writes) = opts.cached_token_writes {
10615            query = query.arg("cachedTokenWrites", cached_token_writes);
10616        }
10617        if let Some(total_tokens) = opts.total_tokens {
10618            query = query.arg("totalTokens", total_tokens);
10619        }
10620        Llm {
10621            proc: self.proc.clone(),
10622            selection: query,
10623            graphql_client: self.graphql_client.clone(),
10624        }
10625    }
10626    /// 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.
10627    ///
10628    /// # Arguments
10629    ///
10630    /// * `directory` - A directory containing skills, each a subdirectory holding a SKILL.md.
10631    pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
10632        let mut query = self.selection.select("withSkills");
10633        query = query.arg_lazy(
10634            "directory",
10635            Box::new(move || {
10636                let directory = directory.clone();
10637                Box::pin(async move { directory.into_id().await.unwrap().quote() })
10638            }),
10639        );
10640        Llm {
10641            proc: self.proc.clone(),
10642            selection: query,
10643            graphql_client: self.graphql_client.clone(),
10644        }
10645    }
10646    /// Add a system prompt, instructing the model across the whole conversation.
10647    ///
10648    /// # Arguments
10649    ///
10650    /// * `prompt` - The system prompt to send
10651    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
10652        let mut query = self.selection.select("withSystemPrompt");
10653        query = query.arg("prompt", prompt.into());
10654        Llm {
10655            proc: self.proc.clone(),
10656            selection: query,
10657            graphql_client: self.graphql_client.clone(),
10658        }
10659    }
10660    /// Append the result of a tool call to the message history.
10661    ///
10662    /// # Arguments
10663    ///
10664    /// * `call_id` - The ID of the tool call this result responds to
10665    /// * `content` - The content returned by the tool
10666    /// * `errored` - Whether the tool call resulted in an error
10667    pub fn with_tool_result(
10668        &self,
10669        call_id: impl Into<String>,
10670        content: impl Into<String>,
10671        errored: bool,
10672    ) -> Llm {
10673        let mut query = self.selection.select("withToolResult");
10674        query = query.arg("callId", call_id.into());
10675        query = query.arg("content", content.into());
10676        query = query.arg("errored", errored);
10677        Llm {
10678            proc: self.proc.clone(),
10679            selection: query,
10680            graphql_client: self.graphql_client.clone(),
10681        }
10682    }
10683    /// 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.
10684    ///
10685    /// # Arguments
10686    ///
10687    /// * `object` - The object whose methods become tools.
10688    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10689    pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
10690        let mut query = self.selection.select("withTools");
10691        query = query.arg_lazy(
10692            "object",
10693            Box::new(move || {
10694                let object = object.clone();
10695                Box::pin(async move { object.into_id().await.unwrap().quote() })
10696            }),
10697        );
10698        Llm {
10699            proc: self.proc.clone(),
10700            selection: query,
10701            graphql_client: self.graphql_client.clone(),
10702        }
10703    }
10704    /// 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.
10705    ///
10706    /// # Arguments
10707    ///
10708    /// * `object` - The object whose methods become tools.
10709    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10710    pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
10711        let mut query = self.selection.select("withTools");
10712        query = query.arg_lazy(
10713            "object",
10714            Box::new(move || {
10715                let object = object.clone();
10716                Box::pin(async move { object.into_id().await.unwrap().quote() })
10717            }),
10718        );
10719        if let Some(except) = opts.except {
10720            query = query.arg("except", except);
10721        }
10722        Llm {
10723            proc: self.proc.clone(),
10724            selection: query,
10725            graphql_client: self.graphql_client.clone(),
10726        }
10727    }
10728    /// Bind the LLM to a workspace, exposing its modules as tools exactly as the Dagger CLI would serve them for that workspace.
10729    ///
10730    /// # Arguments
10731    ///
10732    /// * `workspace` - The workspace to work in.
10733    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
10734        let mut query = self.selection.select("withWorkspace");
10735        query = query.arg_lazy(
10736            "workspace",
10737            Box::new(move || {
10738                let workspace = workspace.clone();
10739                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
10740            }),
10741        );
10742        Llm {
10743            proc: self.proc.clone(),
10744            selection: query,
10745            graphql_client: self.graphql_client.clone(),
10746        }
10747    }
10748    /// Disable the default system prompt
10749    pub fn without_default_system_prompt(&self) -> Llm {
10750        let query = self.selection.select("withoutDefaultSystemPrompt");
10751        Llm {
10752            proc: self.proc.clone(),
10753            selection: query,
10754            graphql_client: self.graphql_client.clone(),
10755        }
10756    }
10757    /// Clear the message history, keeping only the system prompts.
10758    pub fn without_message_history(&self) -> Llm {
10759        let query = self.selection.select("withoutMessageHistory");
10760        Llm {
10761            proc: self.proc.clone(),
10762            selection: query,
10763            graphql_client: self.graphql_client.clone(),
10764        }
10765    }
10766    /// Clear the user-added system prompts, keeping only the default system prompt.
10767    pub fn without_system_prompts(&self) -> Llm {
10768        let query = self.selection.select("withoutSystemPrompts");
10769        Llm {
10770            proc: self.proc.clone(),
10771            selection: query,
10772            graphql_client: self.graphql_client.clone(),
10773        }
10774    }
10775    /// Return the workspace the LLM is bound to.
10776    pub fn workspace(&self) -> Workspace {
10777        let query = self.selection.select("workspace");
10778        Workspace {
10779            proc: self.proc.clone(),
10780            selection: query,
10781            graphql_client: self.graphql_client.clone(),
10782        }
10783    }
10784}
10785impl Node for Llm {
10786    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10787        let query = self.selection.select("id");
10788        let graphql_client = self.graphql_client.clone();
10789        async move { query.execute(graphql_client).await }
10790    }
10791}
10792impl Syncer for Llm {
10793    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10794        let query = self.selection.select("id");
10795        let graphql_client = self.graphql_client.clone();
10796        async move { query.execute(graphql_client).await }
10797    }
10798    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10799        let query = self.selection.select("sync");
10800        let graphql_client = self.graphql_client.clone();
10801        async move { query.execute(graphql_client).await }
10802    }
10803}
10804#[derive(Clone)]
10805pub struct LlmContentBlock {
10806    pub proc: Option<Arc<DaggerSessionProc>>,
10807    pub selection: Selection,
10808    pub graphql_client: DynGraphQLClient,
10809}
10810impl IntoID<Id> for LlmContentBlock {
10811    fn into_id(
10812        self,
10813    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10814        Box::pin(async move { self.id().await })
10815    }
10816}
10817impl Loadable for LlmContentBlock {
10818    fn graphql_type() -> &'static str {
10819        "LLMContentBlock"
10820    }
10821    fn from_query(
10822        proc: Option<Arc<DaggerSessionProc>>,
10823        selection: Selection,
10824        graphql_client: DynGraphQLClient,
10825    ) -> Self {
10826        Self {
10827            proc,
10828            selection,
10829            graphql_client,
10830        }
10831    }
10832}
10833impl LlmContentBlock {
10834    /// The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).
10835    pub async fn arguments(&self) -> Result<Json, DaggerError> {
10836        let query = self.selection.select("arguments");
10837        query.execute(self.graphql_client.clone()).await
10838    }
10839    /// The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
10840    pub async fn call_id(&self) -> Result<String, DaggerError> {
10841        let query = self.selection.select("callId");
10842        query.execute(self.graphql_client.clone()).await
10843    }
10844    /// Whether the tool call resulted in an error (for TOOL_RESULT kind).
10845    pub async fn errored(&self) -> Result<bool, DaggerError> {
10846        let query = self.selection.select("errored");
10847        query.execute(self.graphql_client.clone()).await
10848    }
10849    /// A unique identifier for this LLMContentBlock.
10850    pub async fn id(&self) -> Result<Id, DaggerError> {
10851        let query = self.selection.select("id");
10852        query.execute(self.graphql_client.clone()).await
10853    }
10854    /// The kind of content block, which determines the other populated fields.
10855    pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
10856        let query = self.selection.select("kind");
10857        query.execute(self.graphql_client.clone()).await
10858    }
10859    /// Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.
10860    pub async fn signature(&self) -> Result<String, DaggerError> {
10861        let query = self.selection.select("signature");
10862        query.execute(self.graphql_client.clone()).await
10863    }
10864    /// Text content (for TEXT, THINKING, or TOOL_RESULT kinds).
10865    pub async fn text(&self) -> Result<String, DaggerError> {
10866        let query = self.selection.select("text");
10867        query.execute(self.graphql_client.clone()).await
10868    }
10869    /// The name of the tool called (for TOOL_CALL kind).
10870    pub async fn tool_name(&self) -> Result<String, DaggerError> {
10871        let query = self.selection.select("toolName");
10872        query.execute(self.graphql_client.clone()).await
10873    }
10874}
10875impl Node for LlmContentBlock {
10876    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10877        let query = self.selection.select("id");
10878        let graphql_client = self.graphql_client.clone();
10879        async move { query.execute(graphql_client).await }
10880    }
10881}
10882#[derive(Clone)]
10883pub struct LlmMessage {
10884    pub proc: Option<Arc<DaggerSessionProc>>,
10885    pub selection: Selection,
10886    pub graphql_client: DynGraphQLClient,
10887}
10888impl IntoID<Id> for LlmMessage {
10889    fn into_id(
10890        self,
10891    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10892        Box::pin(async move { self.id().await })
10893    }
10894}
10895impl Loadable for LlmMessage {
10896    fn graphql_type() -> &'static str {
10897        "LLMMessage"
10898    }
10899    fn from_query(
10900        proc: Option<Arc<DaggerSessionProc>>,
10901        selection: Selection,
10902        graphql_client: DynGraphQLClient,
10903    ) -> Self {
10904        Self {
10905            proc,
10906            selection,
10907            graphql_client,
10908        }
10909    }
10910}
10911impl LlmMessage {
10912    /// The message's content blocks, in the order the model produced them.
10913    pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
10914        let query = self.selection.select("content");
10915        let query = query.select("id");
10916        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10917        Ok(ids
10918            .into_iter()
10919            .map(|id| LlmContentBlock {
10920                proc: self.proc.clone(),
10921                selection: crate::querybuilder::query()
10922                    .select("node")
10923                    .arg("id", &id.0)
10924                    .inline_fragment("LLMContentBlock"),
10925                graphql_client: self.graphql_client.clone(),
10926            })
10927            .collect())
10928    }
10929    /// A unique identifier for this LLMMessage.
10930    pub async fn id(&self) -> Result<Id, DaggerError> {
10931        let query = self.selection.select("id");
10932        query.execute(self.graphql_client.clone()).await
10933    }
10934    /// The role that produced this message.
10935    pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
10936        let query = self.selection.select("role");
10937        query.execute(self.graphql_client.clone()).await
10938    }
10939    /// Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.
10940    pub fn token_usage(&self) -> LlmTokenUsage {
10941        let query = self.selection.select("tokenUsage");
10942        LlmTokenUsage {
10943            proc: self.proc.clone(),
10944            selection: query,
10945            graphql_client: self.graphql_client.clone(),
10946        }
10947    }
10948}
10949impl Node for LlmMessage {
10950    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10951        let query = self.selection.select("id");
10952        let graphql_client = self.graphql_client.clone();
10953        async move { query.execute(graphql_client).await }
10954    }
10955}
10956#[derive(Clone)]
10957pub struct LlmSkill {
10958    pub proc: Option<Arc<DaggerSessionProc>>,
10959    pub selection: Selection,
10960    pub graphql_client: DynGraphQLClient,
10961}
10962impl IntoID<Id> for LlmSkill {
10963    fn into_id(
10964        self,
10965    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10966        Box::pin(async move { self.id().await })
10967    }
10968}
10969impl Loadable for LlmSkill {
10970    fn graphql_type() -> &'static str {
10971        "LLMSkill"
10972    }
10973    fn from_query(
10974        proc: Option<Arc<DaggerSessionProc>>,
10975        selection: Selection,
10976        graphql_client: DynGraphQLClient,
10977    ) -> Self {
10978        Self {
10979            proc,
10980            selection,
10981            graphql_client,
10982        }
10983    }
10984}
10985impl LlmSkill {
10986    /// The one-line description from the SKILL.md frontmatter.
10987    pub async fn description(&self) -> Result<String, DaggerError> {
10988        let query = self.selection.select("description");
10989        query.execute(self.graphql_client.clone()).await
10990    }
10991    /// A unique identifier for this LLMSkill.
10992    pub async fn id(&self) -> Result<Id, DaggerError> {
10993        let query = self.selection.select("id");
10994        query.execute(self.graphql_client.clone()).await
10995    }
10996    /// The skill name, as passed to ReadSkill.
10997    pub async fn name(&self) -> Result<String, DaggerError> {
10998        let query = self.selection.select("name");
10999        query.execute(self.graphql_client.clone()).await
11000    }
11001}
11002impl Node for LlmSkill {
11003    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11004        let query = self.selection.select("id");
11005        let graphql_client = self.graphql_client.clone();
11006        async move { query.execute(graphql_client).await }
11007    }
11008}
11009#[derive(Clone)]
11010pub struct LlmTokenUsage {
11011    pub proc: Option<Arc<DaggerSessionProc>>,
11012    pub selection: Selection,
11013    pub graphql_client: DynGraphQLClient,
11014}
11015impl IntoID<Id> for LlmTokenUsage {
11016    fn into_id(
11017        self,
11018    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11019        Box::pin(async move { self.id().await })
11020    }
11021}
11022impl Loadable for LlmTokenUsage {
11023    fn graphql_type() -> &'static str {
11024        "LLMTokenUsage"
11025    }
11026    fn from_query(
11027        proc: Option<Arc<DaggerSessionProc>>,
11028        selection: Selection,
11029        graphql_client: DynGraphQLClient,
11030    ) -> Self {
11031        Self {
11032            proc,
11033            selection,
11034            graphql_client,
11035        }
11036    }
11037}
11038impl LlmTokenUsage {
11039    /// Input tokens served from the provider's prompt cache.
11040    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11041        let query = self.selection.select("cachedTokenReads");
11042        query.execute(self.graphql_client.clone()).await
11043    }
11044    /// Input tokens written to the provider's prompt cache.
11045    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11046        let query = self.selection.select("cachedTokenWrites");
11047        query.execute(self.graphql_client.clone()).await
11048    }
11049    /// A unique identifier for this LLMTokenUsage.
11050    pub async fn id(&self) -> Result<Id, DaggerError> {
11051        let query = self.selection.select("id");
11052        query.execute(self.graphql_client.clone()).await
11053    }
11054    /// Uncached input tokens sent to the model.
11055    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11056        let query = self.selection.select("inputTokens");
11057        query.execute(self.graphql_client.clone()).await
11058    }
11059    /// Tokens received from the model, including text and tool calls.
11060    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11061        let query = self.selection.select("outputTokens");
11062        query.execute(self.graphql_client.clone()).await
11063    }
11064    /// Total tokens consumed, as reported by the provider.
11065    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11066        let query = self.selection.select("totalTokens");
11067        query.execute(self.graphql_client.clone()).await
11068    }
11069}
11070impl Node for LlmTokenUsage {
11071    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11072        let query = self.selection.select("id");
11073        let graphql_client = self.graphql_client.clone();
11074        async move { query.execute(graphql_client).await }
11075    }
11076}
11077#[derive(Clone)]
11078pub struct Label {
11079    pub proc: Option<Arc<DaggerSessionProc>>,
11080    pub selection: Selection,
11081    pub graphql_client: DynGraphQLClient,
11082}
11083impl IntoID<Id> for Label {
11084    fn into_id(
11085        self,
11086    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11087        Box::pin(async move { self.id().await })
11088    }
11089}
11090impl Loadable for Label {
11091    fn graphql_type() -> &'static str {
11092        "Label"
11093    }
11094    fn from_query(
11095        proc: Option<Arc<DaggerSessionProc>>,
11096        selection: Selection,
11097        graphql_client: DynGraphQLClient,
11098    ) -> Self {
11099        Self {
11100            proc,
11101            selection,
11102            graphql_client,
11103        }
11104    }
11105}
11106impl Label {
11107    /// A unique identifier for this Label.
11108    pub async fn id(&self) -> Result<Id, DaggerError> {
11109        let query = self.selection.select("id");
11110        query.execute(self.graphql_client.clone()).await
11111    }
11112    /// The label name.
11113    pub async fn name(&self) -> Result<String, DaggerError> {
11114        let query = self.selection.select("name");
11115        query.execute(self.graphql_client.clone()).await
11116    }
11117    /// The label value.
11118    pub async fn value(&self) -> Result<String, DaggerError> {
11119        let query = self.selection.select("value");
11120        query.execute(self.graphql_client.clone()).await
11121    }
11122}
11123impl Node for Label {
11124    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11125        let query = self.selection.select("id");
11126        let graphql_client = self.graphql_client.clone();
11127        async move { query.execute(graphql_client).await }
11128    }
11129}
11130#[derive(Clone)]
11131pub struct ListTypeDef {
11132    pub proc: Option<Arc<DaggerSessionProc>>,
11133    pub selection: Selection,
11134    pub graphql_client: DynGraphQLClient,
11135}
11136impl IntoID<Id> for ListTypeDef {
11137    fn into_id(
11138        self,
11139    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11140        Box::pin(async move { self.id().await })
11141    }
11142}
11143impl Loadable for ListTypeDef {
11144    fn graphql_type() -> &'static str {
11145        "ListTypeDef"
11146    }
11147    fn from_query(
11148        proc: Option<Arc<DaggerSessionProc>>,
11149        selection: Selection,
11150        graphql_client: DynGraphQLClient,
11151    ) -> Self {
11152        Self {
11153            proc,
11154            selection,
11155            graphql_client,
11156        }
11157    }
11158}
11159impl ListTypeDef {
11160    /// The type of the elements in the list.
11161    pub fn element_type_def(&self) -> TypeDef {
11162        let query = self.selection.select("elementTypeDef");
11163        TypeDef {
11164            proc: self.proc.clone(),
11165            selection: query,
11166            graphql_client: self.graphql_client.clone(),
11167        }
11168    }
11169    /// A unique identifier for this ListTypeDef.
11170    pub async fn id(&self) -> Result<Id, DaggerError> {
11171        let query = self.selection.select("id");
11172        query.execute(self.graphql_client.clone()).await
11173    }
11174}
11175impl Node for ListTypeDef {
11176    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11177        let query = self.selection.select("id");
11178        let graphql_client = self.graphql_client.clone();
11179        async move { query.execute(graphql_client).await }
11180    }
11181}
11182#[derive(Clone)]
11183pub struct Module {
11184    pub proc: Option<Arc<DaggerSessionProc>>,
11185    pub selection: Selection,
11186    pub graphql_client: DynGraphQLClient,
11187}
11188#[derive(Builder, Debug, PartialEq)]
11189pub struct ModuleChecksOpts<'a> {
11190    /// Only include checks matching the specified patterns
11191    #[builder(setter(into, strip_option), default)]
11192    pub include: Option<Vec<&'a str>>,
11193    /// When true, only return annotated check functions; exclude generate-as-checks
11194    #[builder(setter(into, strip_option), default)]
11195    pub no_generate: Option<bool>,
11196}
11197#[derive(Builder, Debug, PartialEq)]
11198pub struct ModuleGeneratorsOpts<'a> {
11199    /// Only include generators matching the specified patterns
11200    #[builder(setter(into, strip_option), default)]
11201    pub include: Option<Vec<&'a str>>,
11202}
11203#[derive(Builder, Debug, PartialEq)]
11204pub struct ModuleServeOpts {
11205    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
11206    #[builder(setter(into, strip_option), default)]
11207    pub entrypoint: Option<bool>,
11208    /// Expose the dependencies of this module to the client
11209    #[builder(setter(into, strip_option), default)]
11210    pub include_dependencies: Option<bool>,
11211}
11212#[derive(Builder, Debug, PartialEq)]
11213pub struct ModuleServicesOpts<'a> {
11214    /// Only include services matching the specified patterns
11215    #[builder(setter(into, strip_option), default)]
11216    pub include: Option<Vec<&'a str>>,
11217}
11218impl IntoID<Id> for Module {
11219    fn into_id(
11220        self,
11221    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11222        Box::pin(async move { self.id().await })
11223    }
11224}
11225impl Loadable for Module {
11226    fn graphql_type() -> &'static str {
11227        "Module"
11228    }
11229    fn from_query(
11230        proc: Option<Arc<DaggerSessionProc>>,
11231        selection: Selection,
11232        graphql_client: DynGraphQLClient,
11233    ) -> Self {
11234        Self {
11235            proc,
11236            selection,
11237            graphql_client,
11238        }
11239    }
11240}
11241impl Module {
11242    /// Return the check defined by the module with the given name. Must match to exactly one check.
11243    ///
11244    /// # Arguments
11245    ///
11246    /// * `name` - The name of the check to retrieve
11247    pub fn check(&self, name: impl Into<String>) -> Check {
11248        let mut query = self.selection.select("check");
11249        query = query.arg("name", name.into());
11250        Check {
11251            proc: self.proc.clone(),
11252            selection: query,
11253            graphql_client: self.graphql_client.clone(),
11254        }
11255    }
11256    /// Return all checks defined by the module
11257    ///
11258    /// # Arguments
11259    ///
11260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11261    pub fn checks(&self) -> CheckGroup {
11262        let query = self.selection.select("checks");
11263        CheckGroup {
11264            proc: self.proc.clone(),
11265            selection: query,
11266            graphql_client: self.graphql_client.clone(),
11267        }
11268    }
11269    /// Return all checks defined by the module
11270    ///
11271    /// # Arguments
11272    ///
11273    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11274    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11275        let mut query = self.selection.select("checks");
11276        if let Some(include) = opts.include {
11277            query = query.arg("include", include);
11278        }
11279        if let Some(no_generate) = opts.no_generate {
11280            query = query.arg("noGenerate", no_generate);
11281        }
11282        CheckGroup {
11283            proc: self.proc.clone(),
11284            selection: query,
11285            graphql_client: self.graphql_client.clone(),
11286        }
11287    }
11288    /// The dependencies of the module.
11289    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11290        let query = self.selection.select("dependencies");
11291        let query = query.select("id");
11292        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11293        Ok(ids
11294            .into_iter()
11295            .map(|id| Module {
11296                proc: self.proc.clone(),
11297                selection: crate::querybuilder::query()
11298                    .select("node")
11299                    .arg("id", &id.0)
11300                    .inline_fragment("Module"),
11301                graphql_client: self.graphql_client.clone(),
11302            })
11303            .collect())
11304    }
11305    /// The doc string of the module, if any
11306    pub async fn description(&self) -> Result<String, DaggerError> {
11307        let query = self.selection.select("description");
11308        query.execute(self.graphql_client.clone()).await
11309    }
11310    /// Enumerations served by this module.
11311    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11312        let query = self.selection.select("enums");
11313        let query = query.select("id");
11314        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11315        Ok(ids
11316            .into_iter()
11317            .map(|id| TypeDef {
11318                proc: self.proc.clone(),
11319                selection: crate::querybuilder::query()
11320                    .select("node")
11321                    .arg("id", &id.0)
11322                    .inline_fragment("TypeDef"),
11323                graphql_client: self.graphql_client.clone(),
11324            })
11325            .collect())
11326    }
11327    /// The generated files and directories made on top of the module source's context directory.
11328    pub fn generated_context_directory(&self) -> Directory {
11329        let query = self.selection.select("generatedContextDirectory");
11330        Directory {
11331            proc: self.proc.clone(),
11332            selection: query,
11333            graphql_client: self.graphql_client.clone(),
11334        }
11335    }
11336    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11337    ///
11338    /// # Arguments
11339    ///
11340    /// * `name` - The name of the generator to retrieve
11341    pub fn generator(&self, name: impl Into<String>) -> Generator {
11342        let mut query = self.selection.select("generator");
11343        query = query.arg("name", name.into());
11344        Generator {
11345            proc: self.proc.clone(),
11346            selection: query,
11347            graphql_client: self.graphql_client.clone(),
11348        }
11349    }
11350    /// Return all generators defined by the module
11351    ///
11352    /// # Arguments
11353    ///
11354    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11355    pub fn generators(&self) -> GeneratorGroup {
11356        let query = self.selection.select("generators");
11357        GeneratorGroup {
11358            proc: self.proc.clone(),
11359            selection: query,
11360            graphql_client: self.graphql_client.clone(),
11361        }
11362    }
11363    /// Return all generators defined by the module
11364    ///
11365    /// # Arguments
11366    ///
11367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11368    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11369        let mut query = self.selection.select("generators");
11370        if let Some(include) = opts.include {
11371            query = query.arg("include", include);
11372        }
11373        GeneratorGroup {
11374            proc: self.proc.clone(),
11375            selection: query,
11376            graphql_client: self.graphql_client.clone(),
11377        }
11378    }
11379    /// A unique identifier for this Module.
11380    pub async fn id(&self) -> Result<Id, DaggerError> {
11381        let query = self.selection.select("id");
11382        query.execute(self.graphql_client.clone()).await
11383    }
11384    /// Interfaces served by this module.
11385    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11386        let query = self.selection.select("interfaces");
11387        let query = query.select("id");
11388        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11389        Ok(ids
11390            .into_iter()
11391            .map(|id| TypeDef {
11392                proc: self.proc.clone(),
11393                selection: crate::querybuilder::query()
11394                    .select("node")
11395                    .arg("id", &id.0)
11396                    .inline_fragment("TypeDef"),
11397                graphql_client: self.graphql_client.clone(),
11398            })
11399            .collect())
11400    }
11401    /// The introspection schema JSON file for this module.
11402    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11403    /// Note: this is in the context of a module, so some core types may be hidden.
11404    pub fn introspection_schema_json(&self) -> File {
11405        let query = self.selection.select("introspectionSchemaJSON");
11406        File {
11407            proc: self.proc.clone(),
11408            selection: query,
11409            graphql_client: self.graphql_client.clone(),
11410        }
11411    }
11412    /// The name of the module
11413    pub async fn name(&self) -> Result<String, DaggerError> {
11414        let query = self.selection.select("name");
11415        query.execute(self.graphql_client.clone()).await
11416    }
11417    /// Objects served by this module.
11418    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11419        let query = self.selection.select("objects");
11420        let query = query.select("id");
11421        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11422        Ok(ids
11423            .into_iter()
11424            .map(|id| TypeDef {
11425                proc: self.proc.clone(),
11426                selection: crate::querybuilder::query()
11427                    .select("node")
11428                    .arg("id", &id.0)
11429                    .inline_fragment("TypeDef"),
11430                graphql_client: self.graphql_client.clone(),
11431            })
11432            .collect())
11433    }
11434    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11435    pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
11436        let query = self.selection.select("runtime");
11437        let query = query.select("id");
11438        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11439        Ok(id.map(|id| Container {
11440            proc: self.proc.clone(),
11441            selection: query
11442                .root()
11443                .select("node")
11444                .arg("id", &id.0)
11445                .inline_fragment("Container"),
11446            graphql_client: self.graphql_client.clone(),
11447        }))
11448    }
11449    /// The SDK config used by this module.
11450    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
11451        let query = self.selection.select("sdk");
11452        let query = query.select("id");
11453        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11454        Ok(id.map(|id| SdkConfig {
11455            proc: self.proc.clone(),
11456            selection: query
11457                .root()
11458                .select("node")
11459                .arg("id", &id.0)
11460                .inline_fragment("SDKConfig"),
11461            graphql_client: self.graphql_client.clone(),
11462        }))
11463    }
11464    /// Serve a module's API in the current session.
11465    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11466    ///
11467    /// # Arguments
11468    ///
11469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11470    pub async fn serve(&self) -> Result<Void, DaggerError> {
11471        let query = self.selection.select("serve");
11472        query.execute(self.graphql_client.clone()).await
11473    }
11474    /// Serve a module's API in the current session.
11475    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11476    ///
11477    /// # Arguments
11478    ///
11479    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11480    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11481        let mut query = self.selection.select("serve");
11482        if let Some(include_dependencies) = opts.include_dependencies {
11483            query = query.arg("includeDependencies", include_dependencies);
11484        }
11485        if let Some(entrypoint) = opts.entrypoint {
11486            query = query.arg("entrypoint", entrypoint);
11487        }
11488        query.execute(self.graphql_client.clone()).await
11489    }
11490    /// Return all services defined by the module
11491    ///
11492    /// # Arguments
11493    ///
11494    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11495    pub fn services(&self) -> UpGroup {
11496        let query = self.selection.select("services");
11497        UpGroup {
11498            proc: self.proc.clone(),
11499            selection: query,
11500            graphql_client: self.graphql_client.clone(),
11501        }
11502    }
11503    /// Return all services defined by the module
11504    ///
11505    /// # Arguments
11506    ///
11507    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11508    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11509        let mut query = self.selection.select("services");
11510        if let Some(include) = opts.include {
11511            query = query.arg("include", include);
11512        }
11513        UpGroup {
11514            proc: self.proc.clone(),
11515            selection: query,
11516            graphql_client: self.graphql_client.clone(),
11517        }
11518    }
11519    /// The source for the module.
11520    pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
11521        let query = self.selection.select("source");
11522        let query = query.select("id");
11523        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11524        Ok(id.map(|id| ModuleSource {
11525            proc: self.proc.clone(),
11526            selection: query
11527                .root()
11528                .select("node")
11529                .arg("id", &id.0)
11530                .inline_fragment("ModuleSource"),
11531            graphql_client: self.graphql_client.clone(),
11532        }))
11533    }
11534    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11535    pub async fn sync(&self) -> Result<Module, DaggerError> {
11536        let query = self.selection.select("sync");
11537        let id: Id = query.execute(self.graphql_client.clone()).await?;
11538        Ok(Module {
11539            proc: self.proc.clone(),
11540            selection: query
11541                .root()
11542                .select("node")
11543                .arg("id", &id.0)
11544                .inline_fragment("Module"),
11545            graphql_client: self.graphql_client.clone(),
11546        })
11547    }
11548    /// User-defined default values, loaded from local .env files.
11549    pub fn user_defaults(&self) -> EnvFile {
11550        let query = self.selection.select("userDefaults");
11551        EnvFile {
11552            proc: self.proc.clone(),
11553            selection: query,
11554            graphql_client: self.graphql_client.clone(),
11555        }
11556    }
11557    /// Retrieves the module with the given description
11558    ///
11559    /// # Arguments
11560    ///
11561    /// * `description` - The description to set
11562    pub fn with_description(&self, description: impl Into<String>) -> Module {
11563        let mut query = self.selection.select("withDescription");
11564        query = query.arg("description", description.into());
11565        Module {
11566            proc: self.proc.clone(),
11567            selection: query,
11568            graphql_client: self.graphql_client.clone(),
11569        }
11570    }
11571    /// This module plus the given Enum type and associated values
11572    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11573        let mut query = self.selection.select("withEnum");
11574        query = query.arg_lazy(
11575            "enum",
11576            Box::new(move || {
11577                let r#enum = r#enum.clone();
11578                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11579            }),
11580        );
11581        Module {
11582            proc: self.proc.clone(),
11583            selection: query,
11584            graphql_client: self.graphql_client.clone(),
11585        }
11586    }
11587    /// This module plus the given Interface type and associated functions
11588    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11589        let mut query = self.selection.select("withInterface");
11590        query = query.arg_lazy(
11591            "iface",
11592            Box::new(move || {
11593                let iface = iface.clone();
11594                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11595            }),
11596        );
11597        Module {
11598            proc: self.proc.clone(),
11599            selection: query,
11600            graphql_client: self.graphql_client.clone(),
11601        }
11602    }
11603    /// This module plus the given Object type and associated functions.
11604    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11605        let mut query = self.selection.select("withObject");
11606        query = query.arg_lazy(
11607            "object",
11608            Box::new(move || {
11609                let object = object.clone();
11610                Box::pin(async move { object.into_id().await.unwrap().quote() })
11611            }),
11612        );
11613        Module {
11614            proc: self.proc.clone(),
11615            selection: query,
11616            graphql_client: self.graphql_client.clone(),
11617        }
11618    }
11619}
11620impl Node for Module {
11621    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11622        let query = self.selection.select("id");
11623        let graphql_client = self.graphql_client.clone();
11624        async move { query.execute(graphql_client).await }
11625    }
11626}
11627impl Syncer for Module {
11628    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11629        let query = self.selection.select("id");
11630        let graphql_client = self.graphql_client.clone();
11631        async move { query.execute(graphql_client).await }
11632    }
11633    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11634        let query = self.selection.select("sync");
11635        let graphql_client = self.graphql_client.clone();
11636        async move { query.execute(graphql_client).await }
11637    }
11638}
11639#[derive(Clone)]
11640pub struct ModuleConfigClient {
11641    pub proc: Option<Arc<DaggerSessionProc>>,
11642    pub selection: Selection,
11643    pub graphql_client: DynGraphQLClient,
11644}
11645impl IntoID<Id> for ModuleConfigClient {
11646    fn into_id(
11647        self,
11648    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11649        Box::pin(async move { self.id().await })
11650    }
11651}
11652impl Loadable for ModuleConfigClient {
11653    fn graphql_type() -> &'static str {
11654        "ModuleConfigClient"
11655    }
11656    fn from_query(
11657        proc: Option<Arc<DaggerSessionProc>>,
11658        selection: Selection,
11659        graphql_client: DynGraphQLClient,
11660    ) -> Self {
11661        Self {
11662            proc,
11663            selection,
11664            graphql_client,
11665        }
11666    }
11667}
11668impl ModuleConfigClient {
11669    /// The directory the client is generated in.
11670    pub async fn directory(&self) -> Result<String, DaggerError> {
11671        let query = self.selection.select("directory");
11672        query.execute(self.graphql_client.clone()).await
11673    }
11674    /// The generator to use
11675    pub async fn generator(&self) -> Result<String, DaggerError> {
11676        let query = self.selection.select("generator");
11677        query.execute(self.graphql_client.clone()).await
11678    }
11679    /// A unique identifier for this ModuleConfigClient.
11680    pub async fn id(&self) -> Result<Id, DaggerError> {
11681        let query = self.selection.select("id");
11682        query.execute(self.graphql_client.clone()).await
11683    }
11684}
11685impl Node for ModuleConfigClient {
11686    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11687        let query = self.selection.select("id");
11688        let graphql_client = self.graphql_client.clone();
11689        async move { query.execute(graphql_client).await }
11690    }
11691}
11692#[derive(Clone)]
11693pub struct ModuleSource {
11694    pub proc: Option<Arc<DaggerSessionProc>>,
11695    pub selection: Selection,
11696    pub graphql_client: DynGraphQLClient,
11697}
11698impl IntoID<Id> for ModuleSource {
11699    fn into_id(
11700        self,
11701    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11702        Box::pin(async move { self.id().await })
11703    }
11704}
11705impl Loadable for ModuleSource {
11706    fn graphql_type() -> &'static str {
11707        "ModuleSource"
11708    }
11709    fn from_query(
11710        proc: Option<Arc<DaggerSessionProc>>,
11711        selection: Selection,
11712        graphql_client: DynGraphQLClient,
11713    ) -> Self {
11714        Self {
11715            proc,
11716            selection,
11717            graphql_client,
11718        }
11719    }
11720}
11721impl ModuleSource {
11722    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
11723    pub fn as_module(&self) -> Module {
11724        let query = self.selection.select("asModule");
11725        Module {
11726            proc: self.proc.clone(),
11727            selection: query,
11728            graphql_client: self.graphql_client.clone(),
11729        }
11730    }
11731    /// A human readable ref string representation of this module source.
11732    pub async fn as_string(&self) -> Result<String, DaggerError> {
11733        let query = self.selection.select("asString");
11734        query.execute(self.graphql_client.clone()).await
11735    }
11736    /// The blueprint referenced by the module source.
11737    pub fn blueprint(&self) -> ModuleSource {
11738        let query = self.selection.select("blueprint");
11739        ModuleSource {
11740            proc: self.proc.clone(),
11741            selection: query,
11742            graphql_client: self.graphql_client.clone(),
11743        }
11744    }
11745    /// The client-facing introspection schema JSON file for this module source.
11746    /// 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.
11747    pub fn client_schema_introspection_json(&self) -> File {
11748        let query = self.selection.select("clientSchemaIntrospectionJSON");
11749        File {
11750            proc: self.proc.clone(),
11751            selection: query,
11752            graphql_client: self.graphql_client.clone(),
11753        }
11754    }
11755    /// The ref to clone the root of the git repo from. Only valid for git sources.
11756    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11757        let query = self.selection.select("cloneRef");
11758        query.execute(self.graphql_client.clone()).await
11759    }
11760    /// The resolved commit of the git repo this source points to.
11761    pub async fn commit(&self) -> Result<String, DaggerError> {
11762        let query = self.selection.select("commit");
11763        query.execute(self.graphql_client.clone()).await
11764    }
11765    /// The clients generated for the module.
11766    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11767        let query = self.selection.select("configClients");
11768        let query = query.select("id");
11769        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11770        Ok(ids
11771            .into_iter()
11772            .map(|id| ModuleConfigClient {
11773                proc: self.proc.clone(),
11774                selection: crate::querybuilder::query()
11775                    .select("node")
11776                    .arg("id", &id.0)
11777                    .inline_fragment("ModuleConfigClient"),
11778                graphql_client: self.graphql_client.clone(),
11779            })
11780            .collect())
11781    }
11782    /// Whether an existing module config file was found.
11783    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11784        let query = self.selection.select("configExists");
11785        query.execute(self.graphql_client.clone()).await
11786    }
11787    /// The full directory loaded for the module source, including the source code as a subdirectory.
11788    pub fn context_directory(&self) -> Directory {
11789        let query = self.selection.select("contextDirectory");
11790        Directory {
11791            proc: self.proc.clone(),
11792            selection: query,
11793            graphql_client: self.graphql_client.clone(),
11794        }
11795    }
11796    /// The dependencies of the module source.
11797    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
11798        let query = self.selection.select("dependencies");
11799        let query = query.select("id");
11800        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11801        Ok(ids
11802            .into_iter()
11803            .map(|id| ModuleSource {
11804                proc: self.proc.clone(),
11805                selection: crate::querybuilder::query()
11806                    .select("node")
11807                    .arg("id", &id.0)
11808                    .inline_fragment("ModuleSource"),
11809                graphql_client: self.graphql_client.clone(),
11810            })
11811            .collect())
11812    }
11813    /// 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.
11814    pub async fn digest(&self) -> Result<String, DaggerError> {
11815        let query = self.selection.select("digest");
11816        query.execute(self.graphql_client.clone()).await
11817    }
11818    /// The directory containing the module configuration and source code (source code may be in a subdir).
11819    ///
11820    /// # Arguments
11821    ///
11822    /// * `path` - A subpath from the source directory to select.
11823    pub fn directory(&self, path: impl Into<String>) -> Directory {
11824        let mut query = self.selection.select("directory");
11825        query = query.arg("path", path.into());
11826        Directory {
11827            proc: self.proc.clone(),
11828            selection: query,
11829            graphql_client: self.graphql_client.clone(),
11830        }
11831    }
11832    /// The engine version of the module.
11833    pub async fn engine_version(&self) -> Result<String, DaggerError> {
11834        let query = self.selection.select("engineVersion");
11835        query.execute(self.graphql_client.clone()).await
11836    }
11837    /// Return the supplied workspace with this module's generated context applied.
11838    /// The workspace change baseline is preserved, so a later Workspace.changes call includes this generation together with any other edits made by the caller.
11839    ///
11840    /// # Arguments
11841    ///
11842    /// * `workspace` - The workspace to apply generated files to.
11843    pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
11844        let mut query = self.selection.select("generate");
11845        query = query.arg_lazy(
11846            "workspace",
11847            Box::new(move || {
11848                let workspace = workspace.clone();
11849                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
11850            }),
11851        );
11852        Workspace {
11853            proc: self.proc.clone(),
11854            selection: query,
11855            graphql_client: self.graphql_client.clone(),
11856        }
11857    }
11858    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
11859    pub fn generated_context_changeset(&self) -> Changeset {
11860        let query = self.selection.select("generatedContextChangeset");
11861        Changeset {
11862            proc: self.proc.clone(),
11863            selection: query,
11864            graphql_client: self.graphql_client.clone(),
11865        }
11866    }
11867    /// The generated files and directories made on top of the module source's context directory.
11868    pub fn generated_context_directory(&self) -> Directory {
11869        let query = self.selection.select("generatedContextDirectory");
11870        Directory {
11871            proc: self.proc.clone(),
11872            selection: query,
11873            graphql_client: self.graphql_client.clone(),
11874        }
11875    }
11876    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
11877    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
11878        let query = self.selection.select("htmlRepoURL");
11879        query.execute(self.graphql_client.clone()).await
11880    }
11881    /// The URL to the source's git repo in a web browser. Only valid for git sources.
11882    pub async fn html_url(&self) -> Result<String, DaggerError> {
11883        let query = self.selection.select("htmlURL");
11884        query.execute(self.graphql_client.clone()).await
11885    }
11886    /// A unique identifier for this ModuleSource.
11887    pub async fn id(&self) -> Result<Id, DaggerError> {
11888        let query = self.selection.select("id");
11889        query.execute(self.graphql_client.clone()).await
11890    }
11891    /// The introspection schema JSON file for this module source.
11892    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11893    /// Note: this is in the context of a module, so some core types may be hidden.
11894    pub fn introspection_schema_json(&self) -> File {
11895        let query = self.selection.select("introspectionSchemaJSON");
11896        File {
11897            proc: self.proc.clone(),
11898            selection: query,
11899            graphql_client: self.graphql_client.clone(),
11900        }
11901    }
11902    /// The kind of module source (currently local, git or dir).
11903    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
11904        let query = self.selection.select("kind");
11905        query.execute(self.graphql_client.clone()).await
11906    }
11907    /// 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.
11908    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
11909        let query = self.selection.select("localContextDirectoryPath");
11910        query.execute(self.graphql_client.clone()).await
11911    }
11912    /// The name of the module, including any setting via the withName API.
11913    pub async fn module_name(&self) -> Result<String, DaggerError> {
11914        let query = self.selection.select("moduleName");
11915        query.execute(self.graphql_client.clone()).await
11916    }
11917    /// The original name of the module as read from the module config file (or set for the first time with the withName API).
11918    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
11919        let query = self.selection.select("moduleOriginalName");
11920        query.execute(self.graphql_client.clone()).await
11921    }
11922    /// The original subpath used when instantiating this module source, relative to the context directory.
11923    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
11924        let query = self.selection.select("originalSubpath");
11925        query.execute(self.graphql_client.clone()).await
11926    }
11927    /// The pinned version of this module source.
11928    pub async fn pin(&self) -> Result<String, DaggerError> {
11929        let query = self.selection.select("pin");
11930        query.execute(self.graphql_client.clone()).await
11931    }
11932    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
11933    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
11934        let query = self.selection.select("repoRootPath");
11935        query.execute(self.graphql_client.clone()).await
11936    }
11937    /// The SDK configuration of the module.
11938    pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
11939        let query = self.selection.select("sdk");
11940        let query = query.select("id");
11941        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11942        Ok(id.map(|id| SdkConfig {
11943            proc: self.proc.clone(),
11944            selection: query
11945                .root()
11946                .select("node")
11947                .arg("id", &id.0)
11948                .inline_fragment("SDKConfig"),
11949            graphql_client: self.graphql_client.clone(),
11950        }))
11951    }
11952    /// The path, relative to the context directory, that contains the module config.
11953    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
11954        let query = self.selection.select("sourceRootSubpath");
11955        query.execute(self.graphql_client.clone()).await
11956    }
11957    /// The path to the directory containing the module's source code, relative to the context directory.
11958    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
11959        let query = self.selection.select("sourceSubpath");
11960        query.execute(self.graphql_client.clone()).await
11961    }
11962    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
11963    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
11964        let query = self.selection.select("sync");
11965        let id: Id = query.execute(self.graphql_client.clone()).await?;
11966        Ok(ModuleSource {
11967            proc: self.proc.clone(),
11968            selection: query
11969                .root()
11970                .select("node")
11971                .arg("id", &id.0)
11972                .inline_fragment("ModuleSource"),
11973            graphql_client: self.graphql_client.clone(),
11974        })
11975    }
11976    /// The toolchains referenced by the module source.
11977    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
11978        let query = self.selection.select("toolchains");
11979        let query = query.select("id");
11980        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11981        Ok(ids
11982            .into_iter()
11983            .map(|id| ModuleSource {
11984                proc: self.proc.clone(),
11985                selection: crate::querybuilder::query()
11986                    .select("node")
11987                    .arg("id", &id.0)
11988                    .inline_fragment("ModuleSource"),
11989                graphql_client: self.graphql_client.clone(),
11990            })
11991            .collect())
11992    }
11993    /// The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.
11994    /// 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.
11995    pub fn updated_config_directory(&self) -> Directory {
11996        let query = self.selection.select("updatedConfigDirectory");
11997        Directory {
11998            proc: self.proc.clone(),
11999            selection: query,
12000            graphql_client: self.graphql_client.clone(),
12001        }
12002    }
12003    /// User-defined defaults read from local .env files
12004    pub fn user_defaults(&self) -> EnvFile {
12005        let query = self.selection.select("userDefaults");
12006        EnvFile {
12007            proc: self.proc.clone(),
12008            selection: query,
12009            graphql_client: self.graphql_client.clone(),
12010        }
12011    }
12012    /// The specified version of the git repo this source points to.
12013    pub async fn version(&self) -> Result<String, DaggerError> {
12014        let query = self.selection.select("version");
12015        query.execute(self.graphql_client.clone()).await
12016    }
12017    /// Set a blueprint for the module source.
12018    ///
12019    /// # Arguments
12020    ///
12021    /// * `blueprint` - The blueprint module to set.
12022    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12023        let mut query = self.selection.select("withBlueprint");
12024        query = query.arg_lazy(
12025            "blueprint",
12026            Box::new(move || {
12027                let blueprint = blueprint.clone();
12028                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12029            }),
12030        );
12031        ModuleSource {
12032            proc: self.proc.clone(),
12033            selection: query,
12034            graphql_client: self.graphql_client.clone(),
12035        }
12036    }
12037    /// Update the module source with a new client to generate.
12038    ///
12039    /// # Arguments
12040    ///
12041    /// * `generator` - The generator to use
12042    /// * `output_dir` - The output directory for the generated client.
12043    pub fn with_client(
12044        &self,
12045        generator: impl Into<String>,
12046        output_dir: impl Into<String>,
12047    ) -> ModuleSource {
12048        let mut query = self.selection.select("withClient");
12049        query = query.arg("generator", generator.into());
12050        query = query.arg("outputDir", output_dir.into());
12051        ModuleSource {
12052            proc: self.proc.clone(),
12053            selection: query,
12054            graphql_client: self.graphql_client.clone(),
12055        }
12056    }
12057    /// Append the provided dependencies to the module source's dependency list.
12058    ///
12059    /// # Arguments
12060    ///
12061    /// * `dependencies` - The dependencies to append.
12062    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12063        let mut query = self.selection.select("withDependencies");
12064        query = query.arg("dependencies", dependencies);
12065        ModuleSource {
12066            proc: self.proc.clone(),
12067            selection: query,
12068            graphql_client: self.graphql_client.clone(),
12069        }
12070    }
12071    /// Upgrade the engine version of the module to the given value.
12072    ///
12073    /// # Arguments
12074    ///
12075    /// * `version` - The engine version to upgrade to.
12076    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12077        let mut query = self.selection.select("withEngineVersion");
12078        query = query.arg("version", version.into());
12079        ModuleSource {
12080            proc: self.proc.clone(),
12081            selection: query,
12082            graphql_client: self.graphql_client.clone(),
12083        }
12084    }
12085    /// Enable the experimental features for the module source.
12086    ///
12087    /// # Arguments
12088    ///
12089    /// * `features` - The experimental features to enable.
12090    pub fn with_experimental_features(
12091        &self,
12092        features: Vec<ModuleSourceExperimentalFeature>,
12093    ) -> ModuleSource {
12094        let mut query = self.selection.select("withExperimentalFeatures");
12095        query = query.arg("features", features);
12096        ModuleSource {
12097            proc: self.proc.clone(),
12098            selection: query,
12099            graphql_client: self.graphql_client.clone(),
12100        }
12101    }
12102    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
12103    ///
12104    /// # Arguments
12105    ///
12106    /// * `patterns` - The new additional include patterns.
12107    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12108        let mut query = self.selection.select("withIncludes");
12109        query = query.arg(
12110            "patterns",
12111            patterns
12112                .into_iter()
12113                .map(|i| i.into())
12114                .collect::<Vec<String>>(),
12115        );
12116        ModuleSource {
12117            proc: self.proc.clone(),
12118            selection: query,
12119            graphql_client: self.graphql_client.clone(),
12120        }
12121    }
12122    /// Update the module source with a new name.
12123    ///
12124    /// # Arguments
12125    ///
12126    /// * `name` - The name to set.
12127    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12128        let mut query = self.selection.select("withName");
12129        query = query.arg("name", name.into());
12130        ModuleSource {
12131            proc: self.proc.clone(),
12132            selection: query,
12133            graphql_client: self.graphql_client.clone(),
12134        }
12135    }
12136    /// Update the module source with a new SDK.
12137    ///
12138    /// # Arguments
12139    ///
12140    /// * `source` - The SDK source to set.
12141    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12142        let mut query = self.selection.select("withSDK");
12143        query = query.arg("source", source.into());
12144        ModuleSource {
12145            proc: self.proc.clone(),
12146            selection: query,
12147            graphql_client: self.graphql_client.clone(),
12148        }
12149    }
12150    /// Update the module source with a new source subpath.
12151    ///
12152    /// # Arguments
12153    ///
12154    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
12155    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12156        let mut query = self.selection.select("withSourceSubpath");
12157        query = query.arg("path", path.into());
12158        ModuleSource {
12159            proc: self.proc.clone(),
12160            selection: query,
12161            graphql_client: self.graphql_client.clone(),
12162        }
12163    }
12164    /// Add toolchains to the module source.
12165    ///
12166    /// # Arguments
12167    ///
12168    /// * `toolchains` - The toolchain modules to add.
12169    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12170        let mut query = self.selection.select("withToolchains");
12171        query = query.arg("toolchains", toolchains);
12172        ModuleSource {
12173            proc: self.proc.clone(),
12174            selection: query,
12175            graphql_client: self.graphql_client.clone(),
12176        }
12177    }
12178    /// Update the blueprint module to the latest version.
12179    pub fn with_update_blueprint(&self) -> ModuleSource {
12180        let query = self.selection.select("withUpdateBlueprint");
12181        ModuleSource {
12182            proc: self.proc.clone(),
12183            selection: query,
12184            graphql_client: self.graphql_client.clone(),
12185        }
12186    }
12187    /// Update one or more module dependencies.
12188    ///
12189    /// # Arguments
12190    ///
12191    /// * `dependencies` - The dependencies to update.
12192    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12193        let mut query = self.selection.select("withUpdateDependencies");
12194        query = query.arg(
12195            "dependencies",
12196            dependencies
12197                .into_iter()
12198                .map(|i| i.into())
12199                .collect::<Vec<String>>(),
12200        );
12201        ModuleSource {
12202            proc: self.proc.clone(),
12203            selection: query,
12204            graphql_client: self.graphql_client.clone(),
12205        }
12206    }
12207    /// Update one or more toolchains.
12208    ///
12209    /// # Arguments
12210    ///
12211    /// * `toolchains` - The toolchains to update.
12212    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12213        let mut query = self.selection.select("withUpdateToolchains");
12214        query = query.arg(
12215            "toolchains",
12216            toolchains
12217                .into_iter()
12218                .map(|i| i.into())
12219                .collect::<Vec<String>>(),
12220        );
12221        ModuleSource {
12222            proc: self.proc.clone(),
12223            selection: query,
12224            graphql_client: self.graphql_client.clone(),
12225        }
12226    }
12227    /// Update one or more clients.
12228    ///
12229    /// # Arguments
12230    ///
12231    /// * `clients` - The clients to update
12232    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12233        let mut query = self.selection.select("withUpdatedClients");
12234        query = query.arg(
12235            "clients",
12236            clients
12237                .into_iter()
12238                .map(|i| i.into())
12239                .collect::<Vec<String>>(),
12240        );
12241        ModuleSource {
12242            proc: self.proc.clone(),
12243            selection: query,
12244            graphql_client: self.graphql_client.clone(),
12245        }
12246    }
12247    /// Remove the current blueprint from the module source.
12248    pub fn without_blueprint(&self) -> ModuleSource {
12249        let query = self.selection.select("withoutBlueprint");
12250        ModuleSource {
12251            proc: self.proc.clone(),
12252            selection: query,
12253            graphql_client: self.graphql_client.clone(),
12254        }
12255    }
12256    /// Remove a client from the module source.
12257    ///
12258    /// # Arguments
12259    ///
12260    /// * `path` - The path of the client to remove.
12261    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12262        let mut query = self.selection.select("withoutClient");
12263        query = query.arg("path", path.into());
12264        ModuleSource {
12265            proc: self.proc.clone(),
12266            selection: query,
12267            graphql_client: self.graphql_client.clone(),
12268        }
12269    }
12270    /// Remove the provided dependencies from the module source's dependency list.
12271    ///
12272    /// # Arguments
12273    ///
12274    /// * `dependencies` - The dependencies to remove.
12275    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12276        let mut query = self.selection.select("withoutDependencies");
12277        query = query.arg(
12278            "dependencies",
12279            dependencies
12280                .into_iter()
12281                .map(|i| i.into())
12282                .collect::<Vec<String>>(),
12283        );
12284        ModuleSource {
12285            proc: self.proc.clone(),
12286            selection: query,
12287            graphql_client: self.graphql_client.clone(),
12288        }
12289    }
12290    /// Disable experimental features for the module source.
12291    ///
12292    /// # Arguments
12293    ///
12294    /// * `features` - The experimental features to disable.
12295    pub fn without_experimental_features(
12296        &self,
12297        features: Vec<ModuleSourceExperimentalFeature>,
12298    ) -> ModuleSource {
12299        let mut query = self.selection.select("withoutExperimentalFeatures");
12300        query = query.arg("features", features);
12301        ModuleSource {
12302            proc: self.proc.clone(),
12303            selection: query,
12304            graphql_client: self.graphql_client.clone(),
12305        }
12306    }
12307    /// Remove the provided toolchains from the module source.
12308    ///
12309    /// # Arguments
12310    ///
12311    /// * `toolchains` - The toolchains to remove.
12312    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12313        let mut query = self.selection.select("withoutToolchains");
12314        query = query.arg(
12315            "toolchains",
12316            toolchains
12317                .into_iter()
12318                .map(|i| i.into())
12319                .collect::<Vec<String>>(),
12320        );
12321        ModuleSource {
12322            proc: self.proc.clone(),
12323            selection: query,
12324            graphql_client: self.graphql_client.clone(),
12325        }
12326    }
12327}
12328impl Node for ModuleSource {
12329    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12330        let query = self.selection.select("id");
12331        let graphql_client = self.graphql_client.clone();
12332        async move { query.execute(graphql_client).await }
12333    }
12334}
12335impl Syncer for ModuleSource {
12336    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12337        let query = self.selection.select("id");
12338        let graphql_client = self.graphql_client.clone();
12339        async move { query.execute(graphql_client).await }
12340    }
12341    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12342        let query = self.selection.select("sync");
12343        let graphql_client = self.graphql_client.clone();
12344        async move { query.execute(graphql_client).await }
12345    }
12346}
12347#[derive(Clone)]
12348pub struct ObjectTypeDef {
12349    pub proc: Option<Arc<DaggerSessionProc>>,
12350    pub selection: Selection,
12351    pub graphql_client: DynGraphQLClient,
12352}
12353impl IntoID<Id> for ObjectTypeDef {
12354    fn into_id(
12355        self,
12356    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12357        Box::pin(async move { self.id().await })
12358    }
12359}
12360impl Loadable for ObjectTypeDef {
12361    fn graphql_type() -> &'static str {
12362        "ObjectTypeDef"
12363    }
12364    fn from_query(
12365        proc: Option<Arc<DaggerSessionProc>>,
12366        selection: Selection,
12367        graphql_client: DynGraphQLClient,
12368    ) -> Self {
12369        Self {
12370            proc,
12371            selection,
12372            graphql_client,
12373        }
12374    }
12375}
12376impl ObjectTypeDef {
12377    /// The function used to construct new instances of this object, if any.
12378    pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
12379        let query = self.selection.select("constructor");
12380        let query = query.select("id");
12381        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12382        Ok(id.map(|id| Function {
12383            proc: self.proc.clone(),
12384            selection: query
12385                .root()
12386                .select("node")
12387                .arg("id", &id.0)
12388                .inline_fragment("Function"),
12389            graphql_client: self.graphql_client.clone(),
12390        }))
12391    }
12392    /// The reason this enum member is deprecated, if any.
12393    pub async fn deprecated(&self) -> Result<String, DaggerError> {
12394        let query = self.selection.select("deprecated");
12395        query.execute(self.graphql_client.clone()).await
12396    }
12397    /// The doc string for the object, if any.
12398    pub async fn description(&self) -> Result<String, DaggerError> {
12399        let query = self.selection.select("description");
12400        query.execute(self.graphql_client.clone()).await
12401    }
12402    /// Static fields defined on this object, if any.
12403    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12404        let query = self.selection.select("fields");
12405        let query = query.select("id");
12406        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12407        Ok(ids
12408            .into_iter()
12409            .map(|id| FieldTypeDef {
12410                proc: self.proc.clone(),
12411                selection: crate::querybuilder::query()
12412                    .select("node")
12413                    .arg("id", &id.0)
12414                    .inline_fragment("FieldTypeDef"),
12415                graphql_client: self.graphql_client.clone(),
12416            })
12417            .collect())
12418    }
12419    /// Functions defined on this object, if any.
12420    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12421        let query = self.selection.select("functions");
12422        let query = query.select("id");
12423        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12424        Ok(ids
12425            .into_iter()
12426            .map(|id| Function {
12427                proc: self.proc.clone(),
12428                selection: crate::querybuilder::query()
12429                    .select("node")
12430                    .arg("id", &id.0)
12431                    .inline_fragment("Function"),
12432                graphql_client: self.graphql_client.clone(),
12433            })
12434            .collect())
12435    }
12436    /// A unique identifier for this ObjectTypeDef.
12437    pub async fn id(&self) -> Result<Id, DaggerError> {
12438        let query = self.selection.select("id");
12439        query.execute(self.graphql_client.clone()).await
12440    }
12441    /// The name of the object.
12442    pub async fn name(&self) -> Result<String, DaggerError> {
12443        let query = self.selection.select("name");
12444        query.execute(self.graphql_client.clone()).await
12445    }
12446    /// The location of this object declaration.
12447    pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12448        let query = self.selection.select("sourceMap");
12449        let query = query.select("id");
12450        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12451        Ok(id.map(|id| SourceMap {
12452            proc: self.proc.clone(),
12453            selection: query
12454                .root()
12455                .select("node")
12456                .arg("id", &id.0)
12457                .inline_fragment("SourceMap"),
12458            graphql_client: self.graphql_client.clone(),
12459        }))
12460    }
12461    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
12462    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12463        let query = self.selection.select("sourceModuleName");
12464        query.execute(self.graphql_client.clone()).await
12465    }
12466}
12467impl Node for ObjectTypeDef {
12468    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12469        let query = self.selection.select("id");
12470        let graphql_client = self.graphql_client.clone();
12471        async move { query.execute(graphql_client).await }
12472    }
12473}
12474#[derive(Clone)]
12475pub struct Port {
12476    pub proc: Option<Arc<DaggerSessionProc>>,
12477    pub selection: Selection,
12478    pub graphql_client: DynGraphQLClient,
12479}
12480impl IntoID<Id> for Port {
12481    fn into_id(
12482        self,
12483    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12484        Box::pin(async move { self.id().await })
12485    }
12486}
12487impl Loadable for Port {
12488    fn graphql_type() -> &'static str {
12489        "Port"
12490    }
12491    fn from_query(
12492        proc: Option<Arc<DaggerSessionProc>>,
12493        selection: Selection,
12494        graphql_client: DynGraphQLClient,
12495    ) -> Self {
12496        Self {
12497            proc,
12498            selection,
12499            graphql_client,
12500        }
12501    }
12502}
12503impl Port {
12504    /// The port description.
12505    pub async fn description(&self) -> Result<String, DaggerError> {
12506        let query = self.selection.select("description");
12507        query.execute(self.graphql_client.clone()).await
12508    }
12509    /// Skip the health check when run as a service.
12510    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12511        let query = self.selection.select("experimentalSkipHealthcheck");
12512        query.execute(self.graphql_client.clone()).await
12513    }
12514    /// A unique identifier for this Port.
12515    pub async fn id(&self) -> Result<Id, DaggerError> {
12516        let query = self.selection.select("id");
12517        query.execute(self.graphql_client.clone()).await
12518    }
12519    /// The port number.
12520    pub async fn port(&self) -> Result<isize, DaggerError> {
12521        let query = self.selection.select("port");
12522        query.execute(self.graphql_client.clone()).await
12523    }
12524    /// The transport layer protocol.
12525    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12526        let query = self.selection.select("protocol");
12527        query.execute(self.graphql_client.clone()).await
12528    }
12529}
12530impl Node for Port {
12531    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12532        let query = self.selection.select("id");
12533        let graphql_client = self.graphql_client.clone();
12534        async move { query.execute(graphql_client).await }
12535    }
12536}
12537#[derive(Clone)]
12538pub struct Query {
12539    pub proc: Option<Arc<DaggerSessionProc>>,
12540    pub selection: Selection,
12541    pub graphql_client: DynGraphQLClient,
12542}
12543#[derive(Builder, Debug, PartialEq)]
12544pub struct QueryBlobOpts {
12545    /// Permissions of the new file. Example: 0600
12546    #[builder(setter(into, strip_option), default)]
12547    pub permissions: Option<isize>,
12548}
12549#[derive(Builder, Debug, PartialEq)]
12550pub struct QueryCacheVolumeOpts<'a> {
12551    /// A user:group to set for the cache volume root.
12552    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
12553    /// If the group is omitted, it defaults to the same as the user.
12554    #[builder(setter(into, strip_option), default)]
12555    pub owner: Option<&'a str>,
12556    /// Sharing mode of the cache volume.
12557    #[builder(setter(into, strip_option), default)]
12558    pub sharing: Option<CacheSharingMode>,
12559    /// Identifier of the directory to use as the cache volume's root.
12560    #[builder(setter(into, strip_option), default)]
12561    pub source: Option<Id>,
12562}
12563#[derive(Builder, Debug, PartialEq)]
12564pub struct QueryContainerOpts {
12565    /// Platform to initialize the container with. Defaults to the native platform of the current engine
12566    #[builder(setter(into, strip_option), default)]
12567    pub platform: Option<Platform>,
12568}
12569#[derive(Builder, Debug, PartialEq)]
12570pub struct QueryCurrentTypeDefsOpts {
12571    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
12572    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
12573    #[builder(setter(into, strip_option), default)]
12574    pub hide_core: Option<bool>,
12575    /// Return the full referenced typedef closure instead of only top-level served typedefs.
12576    #[builder(setter(into, strip_option), default)]
12577    pub return_all_types: Option<bool>,
12578}
12579#[derive(Builder, Debug, PartialEq)]
12580pub struct QueryEngineVolumeOpts<'a> {
12581    /// Optional existing subdirectory within the volume payload to mount.
12582    #[builder(setter(into, strip_option), default)]
12583    pub subdir: Option<&'a str>,
12584}
12585#[derive(Builder, Debug, PartialEq)]
12586pub struct QueryEnvFileOpts {
12587    /// Replace "${VAR}" or "$VAR" with the value of other vars
12588    #[builder(setter(into, strip_option), default)]
12589    pub expand: Option<bool>,
12590}
12591#[derive(Builder, Debug, PartialEq)]
12592pub struct QueryFileOpts {
12593    /// Permissions of the new file. Example: 0600
12594    #[builder(setter(into, strip_option), default)]
12595    pub permissions: Option<isize>,
12596}
12597#[derive(Builder, Debug, PartialEq)]
12598pub struct QueryGitOpts<'a> {
12599    /// A service which must be started before the repo is fetched.
12600    #[builder(setter(into, strip_option), default)]
12601    pub experimental_service_host: Option<Id>,
12602    /// Secret used to populate the Authorization HTTP header
12603    #[builder(setter(into, strip_option), default)]
12604    pub http_auth_header: Option<Id>,
12605    /// Secret used to populate the password during basic HTTP Authorization
12606    #[builder(setter(into, strip_option), default)]
12607    pub http_auth_token: Option<Id>,
12608    /// Username used to populate the password during basic HTTP Authorization
12609    #[builder(setter(into, strip_option), default)]
12610    pub http_auth_username: Option<&'a str>,
12611    /// DEPRECATED: Set to true to keep .git directory.
12612    #[builder(setter(into, strip_option), default)]
12613    pub keep_git_dir: Option<bool>,
12614    /// Set SSH auth socket
12615    #[builder(setter(into, strip_option), default)]
12616    pub ssh_auth_socket: Option<Id>,
12617    /// Set SSH known hosts
12618    #[builder(setter(into, strip_option), default)]
12619    pub ssh_known_hosts: Option<&'a str>,
12620}
12621#[derive(Builder, Debug, PartialEq)]
12622pub struct QueryHttpOpts<'a> {
12623    /// Secret used to populate the Authorization HTTP header
12624    #[builder(setter(into, strip_option), default)]
12625    pub auth_header: Option<Id>,
12626    /// Expected digest of the downloaded content (e.g., "sha256:...").
12627    #[builder(setter(into, strip_option), default)]
12628    pub checksum: Option<&'a str>,
12629    /// A service which must be started before the URL is fetched.
12630    #[builder(setter(into, strip_option), default)]
12631    pub experimental_service_host: Option<Id>,
12632    /// File name to use for the file. Defaults to the last part of the URL.
12633    #[builder(setter(into, strip_option), default)]
12634    pub name: Option<&'a str>,
12635    /// Permissions to set on the file.
12636    #[builder(setter(into, strip_option), default)]
12637    pub permissions: Option<isize>,
12638}
12639#[derive(Builder, Debug, PartialEq)]
12640pub struct QueryLlmOpts<'a> {
12641    /// The model to converse with, e.g. "claude-sonnet-4-5" or "gpt-5.4". Defaults to the configured default model.
12642    #[builder(setter(into, strip_option), default)]
12643    pub model: Option<&'a str>,
12644    /// 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.
12645    #[builder(setter(into, strip_option), default)]
12646    pub provider: Option<&'a str>,
12647}
12648#[derive(Builder, Debug, PartialEq)]
12649pub struct QueryModuleSourceOpts<'a> {
12650    /// 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.
12651    #[builder(setter(into, strip_option), default)]
12652    pub allow_not_exists: Option<bool>,
12653    /// 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.
12654    #[builder(setter(into, strip_option), default)]
12655    pub disable_find_up: Option<bool>,
12656    /// The pinned version of the module source
12657    #[builder(setter(into, strip_option), default)]
12658    pub ref_pin: Option<&'a str>,
12659    /// If set, error out if the ref string is not of the provided requireKind.
12660    #[builder(setter(into, strip_option), default)]
12661    pub require_kind: Option<ModuleSourceKind>,
12662    /// Version query for a Git module source.
12663    #[builder(setter(into, strip_option), default)]
12664    pub version: Option<&'a str>,
12665}
12666#[derive(Builder, Debug, PartialEq)]
12667pub struct QuerySecretOpts<'a> {
12668    /// 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.
12669    /// 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.
12670    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
12671    #[builder(setter(into, strip_option), default)]
12672    pub cache_key: Option<&'a str>,
12673}
12674#[derive(Builder, Debug, PartialEq)]
12675pub struct QuerySshfsVolumeOpts<'a> {
12676    /// Optional cache equivalence key. If set, volumes with the same cacheKey may be considered equivalent for cache lookups, still subject to their resource dependencies.
12677    #[builder(setter(into, strip_option), default)]
12678    pub cache_key: Option<&'a str>,
12679    /// Service to use as the SSHFS network endpoint while verifying the original host key.
12680    #[builder(setter(into, strip_option), default)]
12681    pub experimental_service_host: Option<Id>,
12682    /// Disable SSH host key verification. This is insecure and must be explicitly opted into.
12683    #[builder(setter(into, strip_option), default)]
12684    pub insecure_skip_host_key_check: Option<bool>,
12685    /// known_hosts material used to verify the remote host key. Required unless insecureSkipHostKeyCheck is true.
12686    #[builder(setter(into, strip_option), default)]
12687    pub known_hosts: Option<Id>,
12688}
12689impl IntoID<Id> for Query {
12690    fn into_id(
12691        self,
12692    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12693        Box::pin(async move { self.id().await })
12694    }
12695}
12696impl Loadable for Query {
12697    fn graphql_type() -> &'static str {
12698        "Query"
12699    }
12700    fn from_query(
12701        proc: Option<Arc<DaggerSessionProc>>,
12702        selection: Selection,
12703        graphql_client: DynGraphQLClient,
12704    ) -> Self {
12705        Self {
12706            proc,
12707            selection,
12708            graphql_client,
12709        }
12710    }
12711}
12712impl Query {
12713    /// initialize an address to load directories, containers, secrets or other object types.
12714    pub fn address(&self, value: impl Into<String>) -> Address {
12715        let mut query = self.selection.select("address");
12716        query = query.arg("value", value.into());
12717        Address {
12718            proc: self.proc.clone(),
12719            selection: query,
12720            graphql_client: self.graphql_client.clone(),
12721        }
12722    }
12723    /// Creates a file from arbitrary binary contents.
12724    ///
12725    /// # Arguments
12726    ///
12727    /// * `name` - Name of the new file. Example: "archive.tar"
12728    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
12729    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12730    pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
12731        let mut query = self.selection.select("blob");
12732        query = query.arg("name", name.into());
12733        query = query.arg("contents", contents);
12734        File {
12735            proc: self.proc.clone(),
12736            selection: query,
12737            graphql_client: self.graphql_client.clone(),
12738        }
12739    }
12740    /// Creates a file from arbitrary binary contents.
12741    ///
12742    /// # Arguments
12743    ///
12744    /// * `name` - Name of the new file. Example: "archive.tar"
12745    /// * `contents` - Binary contents of the new file, encoded as base64 at the GraphQL boundary.
12746    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12747    pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
12748        let mut query = self.selection.select("blob");
12749        query = query.arg("name", name.into());
12750        query = query.arg("contents", contents);
12751        if let Some(permissions) = opts.permissions {
12752            query = query.arg("permissions", permissions);
12753        }
12754        File {
12755            proc: self.proc.clone(),
12756            selection: query,
12757            graphql_client: self.graphql_client.clone(),
12758        }
12759    }
12760    /// Constructs a cache volume for a given cache key.
12761    ///
12762    /// # Arguments
12763    ///
12764    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12766    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12767        let mut query = self.selection.select("cacheVolume");
12768        query = query.arg("key", key.into());
12769        CacheVolume {
12770            proc: self.proc.clone(),
12771            selection: query,
12772            graphql_client: self.graphql_client.clone(),
12773        }
12774    }
12775    /// Constructs a cache volume for a given cache key.
12776    ///
12777    /// # Arguments
12778    ///
12779    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12780    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12781    pub fn cache_volume_opts<'a>(
12782        &self,
12783        key: impl Into<String>,
12784        opts: QueryCacheVolumeOpts<'a>,
12785    ) -> CacheVolume {
12786        let mut query = self.selection.select("cacheVolume");
12787        query = query.arg("key", key.into());
12788        if let Some(source) = opts.source {
12789            query = query.arg("source", source);
12790        }
12791        if let Some(sharing) = opts.sharing {
12792            query = query.arg("sharing", sharing);
12793        }
12794        if let Some(owner) = opts.owner {
12795            query = query.arg("owner", owner);
12796        }
12797        CacheVolume {
12798            proc: self.proc.clone(),
12799            selection: query,
12800            graphql_client: self.graphql_client.clone(),
12801        }
12802    }
12803    /// Creates an empty changeset
12804    pub fn changeset(&self) -> Changeset {
12805        let query = self.selection.select("changeset");
12806        Changeset {
12807            proc: self.proc.clone(),
12808            selection: query,
12809            graphql_client: self.graphql_client.clone(),
12810        }
12811    }
12812    /// Dagger Cloud configuration and state
12813    pub fn cloud(&self) -> Cloud {
12814        let query = self.selection.select("cloud");
12815        Cloud {
12816            proc: self.proc.clone(),
12817            selection: query,
12818            graphql_client: self.graphql_client.clone(),
12819        }
12820    }
12821    /// Creates a scratch container, with no image or metadata.
12822    /// To pull an image, follow up with the "from" function.
12823    ///
12824    /// # Arguments
12825    ///
12826    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12827    pub fn container(&self) -> Container {
12828        let query = self.selection.select("container");
12829        Container {
12830            proc: self.proc.clone(),
12831            selection: query,
12832            graphql_client: self.graphql_client.clone(),
12833        }
12834    }
12835    /// Creates a scratch container, with no image or metadata.
12836    /// To pull an image, follow up with the "from" function.
12837    ///
12838    /// # Arguments
12839    ///
12840    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12841    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12842        let mut query = self.selection.select("container");
12843        if let Some(platform) = opts.platform {
12844            query = query.arg("platform", platform);
12845        }
12846        Container {
12847            proc: self.proc.clone(),
12848            selection: query,
12849            graphql_client: self.graphql_client.clone(),
12850        }
12851    }
12852    /// The FunctionCall context that the SDK caller is currently executing in.
12853    /// If the caller is not currently executing in a function, this will return an error.
12854    pub fn current_function_call(&self) -> FunctionCall {
12855        let query = self.selection.select("currentFunctionCall");
12856        FunctionCall {
12857            proc: self.proc.clone(),
12858            selection: query,
12859            graphql_client: self.graphql_client.clone(),
12860        }
12861    }
12862    /// The module currently being served in the session, if any.
12863    pub fn current_module(&self) -> CurrentModule {
12864        let query = self.selection.select("currentModule");
12865        CurrentModule {
12866            proc: self.proc.clone(),
12867            selection: query,
12868            graphql_client: self.graphql_client.clone(),
12869        }
12870    }
12871    /// 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).
12872    pub fn current_node(&self) -> NodeClient {
12873        let query = self.selection.select("currentNode");
12874        NodeClient {
12875            proc: self.proc.clone(),
12876            selection: query,
12877            graphql_client: self.graphql_client.clone(),
12878        }
12879    }
12880    /// The TypeDef representations of the objects currently being served in the session.
12881    ///
12882    /// # Arguments
12883    ///
12884    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12885    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12886        let query = self.selection.select("currentTypeDefs");
12887        let query = query.select("id");
12888        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12889        Ok(ids
12890            .into_iter()
12891            .map(|id| TypeDef {
12892                proc: self.proc.clone(),
12893                selection: crate::querybuilder::query()
12894                    .select("node")
12895                    .arg("id", &id.0)
12896                    .inline_fragment("TypeDef"),
12897                graphql_client: self.graphql_client.clone(),
12898            })
12899            .collect())
12900    }
12901    /// The TypeDef representations of the objects currently being served in the session.
12902    ///
12903    /// # Arguments
12904    ///
12905    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12906    pub async fn current_type_defs_opts(
12907        &self,
12908        opts: QueryCurrentTypeDefsOpts,
12909    ) -> Result<Vec<TypeDef>, DaggerError> {
12910        let mut query = self.selection.select("currentTypeDefs");
12911        if let Some(return_all_types) = opts.return_all_types {
12912            query = query.arg("returnAllTypes", return_all_types);
12913        }
12914        if let Some(hide_core) = opts.hide_core {
12915            query = query.arg("hideCore", hide_core);
12916        }
12917        let query = query.select("id");
12918        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12919        Ok(ids
12920            .into_iter()
12921            .map(|id| TypeDef {
12922                proc: self.proc.clone(),
12923                selection: crate::querybuilder::query()
12924                    .select("node")
12925                    .arg("id", &id.0)
12926                    .inline_fragment("TypeDef"),
12927                graphql_client: self.graphql_client.clone(),
12928            })
12929            .collect())
12930    }
12931    /// Detect and return the current workspace.
12932    pub fn current_workspace(&self) -> Workspace {
12933        let query = self.selection.select("currentWorkspace");
12934        Workspace {
12935            proc: self.proc.clone(),
12936            selection: query,
12937            graphql_client: self.graphql_client.clone(),
12938        }
12939    }
12940    /// The default platform of the engine.
12941    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
12942        let query = self.selection.select("defaultPlatform");
12943        query.execute(self.graphql_client.clone()).await
12944    }
12945    /// Creates an empty directory.
12946    pub fn directory(&self) -> Directory {
12947        let query = self.selection.select("directory");
12948        Directory {
12949            proc: self.proc.clone(),
12950            selection: query,
12951            graphql_client: self.graphql_client.clone(),
12952        }
12953    }
12954    /// The Dagger engine container configuration and state
12955    pub fn engine(&self) -> Engine {
12956        let query = self.selection.select("engine");
12957        Engine {
12958            proc: self.proc.clone(),
12959            selection: query,
12960            graphql_client: self.graphql_client.clone(),
12961        }
12962    }
12963    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
12964    ///
12965    /// # Arguments
12966    ///
12967    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
12968    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12969    pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
12970        let mut query = self.selection.select("engineVolume");
12971        query = query.arg("name", name.into());
12972        Volume {
12973            proc: self.proc.clone(),
12974            selection: query,
12975            graphql_client: self.graphql_client.clone(),
12976        }
12977    }
12978    /// Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
12979    ///
12980    /// # Arguments
12981    ///
12982    /// * `name` - Canonical slash-separated volume name beneath the engine volume namespace.
12983    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12984    pub fn engine_volume_opts<'a>(
12985        &self,
12986        name: impl Into<String>,
12987        opts: QueryEngineVolumeOpts<'a>,
12988    ) -> Volume {
12989        let mut query = self.selection.select("engineVolume");
12990        query = query.arg("name", name.into());
12991        if let Some(subdir) = opts.subdir {
12992            query = query.arg("subdir", subdir);
12993        }
12994        Volume {
12995            proc: self.proc.clone(),
12996            selection: query,
12997            graphql_client: self.graphql_client.clone(),
12998        }
12999    }
13000    /// Initialize an environment file
13001    ///
13002    /// # Arguments
13003    ///
13004    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13005    pub fn env_file(&self) -> EnvFile {
13006        let query = self.selection.select("envFile");
13007        EnvFile {
13008            proc: self.proc.clone(),
13009            selection: query,
13010            graphql_client: self.graphql_client.clone(),
13011        }
13012    }
13013    /// Initialize an environment file
13014    ///
13015    /// # Arguments
13016    ///
13017    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13018    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13019        let mut query = self.selection.select("envFile");
13020        if let Some(expand) = opts.expand {
13021            query = query.arg("expand", expand);
13022        }
13023        EnvFile {
13024            proc: self.proc.clone(),
13025            selection: query,
13026            graphql_client: self.graphql_client.clone(),
13027        }
13028    }
13029    /// Create a new error.
13030    ///
13031    /// # Arguments
13032    ///
13033    /// * `message` - A brief description of the error.
13034    pub fn error(&self, message: impl Into<String>) -> Error {
13035        let mut query = self.selection.select("error");
13036        query = query.arg("message", message.into());
13037        Error {
13038            proc: self.proc.clone(),
13039            selection: query,
13040            graphql_client: self.graphql_client.clone(),
13041        }
13042    }
13043    /// Creates a file with the specified contents.
13044    ///
13045    /// # Arguments
13046    ///
13047    /// * `name` - Name of the new file. Example: "foo.txt"
13048    /// * `contents` - Contents of the new file. Example: "Hello world!"
13049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13050    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13051        let mut query = self.selection.select("file");
13052        query = query.arg("name", name.into());
13053        query = query.arg("contents", contents.into());
13054        File {
13055            proc: self.proc.clone(),
13056            selection: query,
13057            graphql_client: self.graphql_client.clone(),
13058        }
13059    }
13060    /// Creates a file with the specified contents.
13061    ///
13062    /// # Arguments
13063    ///
13064    /// * `name` - Name of the new file. Example: "foo.txt"
13065    /// * `contents` - Contents of the new file. Example: "Hello world!"
13066    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13067    pub fn file_opts(
13068        &self,
13069        name: impl Into<String>,
13070        contents: impl Into<String>,
13071        opts: QueryFileOpts,
13072    ) -> File {
13073        let mut query = self.selection.select("file");
13074        query = query.arg("name", name.into());
13075        query = query.arg("contents", contents.into());
13076        if let Some(permissions) = opts.permissions {
13077            query = query.arg("permissions", permissions);
13078        }
13079        File {
13080            proc: self.proc.clone(),
13081            selection: query,
13082            graphql_client: self.graphql_client.clone(),
13083        }
13084    }
13085    /// Creates a function.
13086    ///
13087    /// # Arguments
13088    ///
13089    /// * `name` - Name of the function, in its original format from the implementation language.
13090    /// * `return_type` - Return type of the function.
13091    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13092        let mut query = self.selection.select("function");
13093        query = query.arg("name", name.into());
13094        query = query.arg_lazy(
13095            "returnType",
13096            Box::new(move || {
13097                let return_type = return_type.clone();
13098                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13099            }),
13100        );
13101        Function {
13102            proc: self.proc.clone(),
13103            selection: query,
13104            graphql_client: self.graphql_client.clone(),
13105        }
13106    }
13107    /// Create a code generation result, given a directory containing the generated code.
13108    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13109        let mut query = self.selection.select("generatedCode");
13110        query = query.arg_lazy(
13111            "code",
13112            Box::new(move || {
13113                let code = code.clone();
13114                Box::pin(async move { code.into_id().await.unwrap().quote() })
13115            }),
13116        );
13117        GeneratedCode {
13118            proc: self.proc.clone(),
13119            selection: query,
13120            graphql_client: self.graphql_client.clone(),
13121        }
13122    }
13123    /// Queries a Git repository.
13124    ///
13125    /// # Arguments
13126    ///
13127    /// * `url` - URL of the git repository.
13128    ///
13129    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13130    ///
13131    /// Suffix ".git" is optional.
13132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13133    pub fn git(&self, url: impl Into<String>) -> GitRepository {
13134        let mut query = self.selection.select("git");
13135        query = query.arg("url", url.into());
13136        GitRepository {
13137            proc: self.proc.clone(),
13138            selection: query,
13139            graphql_client: self.graphql_client.clone(),
13140        }
13141    }
13142    /// Queries a Git repository.
13143    ///
13144    /// # Arguments
13145    ///
13146    /// * `url` - URL of the git repository.
13147    ///
13148    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13149    ///
13150    /// Suffix ".git" is optional.
13151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13152    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13153        let mut query = self.selection.select("git");
13154        query = query.arg("url", url.into());
13155        if let Some(keep_git_dir) = opts.keep_git_dir {
13156            query = query.arg("keepGitDir", keep_git_dir);
13157        }
13158        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13159            query = query.arg("sshKnownHosts", ssh_known_hosts);
13160        }
13161        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13162            query = query.arg("sshAuthSocket", ssh_auth_socket);
13163        }
13164        if let Some(http_auth_username) = opts.http_auth_username {
13165            query = query.arg("httpAuthUsername", http_auth_username);
13166        }
13167        if let Some(http_auth_token) = opts.http_auth_token {
13168            query = query.arg("httpAuthToken", http_auth_token);
13169        }
13170        if let Some(http_auth_header) = opts.http_auth_header {
13171            query = query.arg("httpAuthHeader", http_auth_header);
13172        }
13173        if let Some(experimental_service_host) = opts.experimental_service_host {
13174            query = query.arg("experimentalServiceHost", experimental_service_host);
13175        }
13176        GitRepository {
13177            proc: self.proc.clone(),
13178            selection: query,
13179            graphql_client: self.graphql_client.clone(),
13180        }
13181    }
13182    /// Queries the host environment.
13183    pub fn host(&self) -> Host {
13184        let query = self.selection.select("host");
13185        Host {
13186            proc: self.proc.clone(),
13187            selection: query,
13188            graphql_client: self.graphql_client.clone(),
13189        }
13190    }
13191    /// Returns a file containing an http remote url content.
13192    ///
13193    /// # Arguments
13194    ///
13195    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13196    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13197    pub fn http(&self, url: impl Into<String>) -> File {
13198        let mut query = self.selection.select("http");
13199        query = query.arg("url", url.into());
13200        File {
13201            proc: self.proc.clone(),
13202            selection: query,
13203            graphql_client: self.graphql_client.clone(),
13204        }
13205    }
13206    /// Returns a file containing an http remote url content.
13207    ///
13208    /// # Arguments
13209    ///
13210    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13211    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13212    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13213        let mut query = self.selection.select("http");
13214        query = query.arg("url", url.into());
13215        if let Some(name) = opts.name {
13216            query = query.arg("name", name);
13217        }
13218        if let Some(permissions) = opts.permissions {
13219            query = query.arg("permissions", permissions);
13220        }
13221        if let Some(checksum) = opts.checksum {
13222            query = query.arg("checksum", checksum);
13223        }
13224        if let Some(auth_header) = opts.auth_header {
13225            query = query.arg("authHeader", auth_header);
13226        }
13227        if let Some(experimental_service_host) = opts.experimental_service_host {
13228            query = query.arg("experimentalServiceHost", experimental_service_host);
13229        }
13230        File {
13231            proc: self.proc.clone(),
13232            selection: query,
13233            graphql_client: self.graphql_client.clone(),
13234        }
13235    }
13236    /// A unique identifier for this Query.
13237    pub async fn id(&self) -> Result<Id, DaggerError> {
13238        let query = self.selection.select("id");
13239        query.execute(self.graphql_client.clone()).await
13240    }
13241    /// Initialize a JSON value
13242    pub fn json(&self) -> JsonValue {
13243        let query = self.selection.select("json");
13244        JsonValue {
13245            proc: self.proc.clone(),
13246            selection: query,
13247            graphql_client: self.graphql_client.clone(),
13248        }
13249    }
13250    /// Initialize a new LLM conversation.
13251    ///
13252    /// # Arguments
13253    ///
13254    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13255    pub fn llm(&self) -> Llm {
13256        let query = self.selection.select("llm");
13257        Llm {
13258            proc: self.proc.clone(),
13259            selection: query,
13260            graphql_client: self.graphql_client.clone(),
13261        }
13262    }
13263    /// Initialize a new LLM conversation.
13264    ///
13265    /// # Arguments
13266    ///
13267    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13268    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13269        let mut query = self.selection.select("llm");
13270        if let Some(model) = opts.model {
13271            query = query.arg("model", model);
13272        }
13273        if let Some(provider) = opts.provider {
13274            query = query.arg("provider", provider);
13275        }
13276        Llm {
13277            proc: self.proc.clone(),
13278            selection: query,
13279            graphql_client: self.graphql_client.clone(),
13280        }
13281    }
13282    /// Create a new module.
13283    pub fn module(&self) -> Module {
13284        let query = self.selection.select("module");
13285        Module {
13286            proc: self.proc.clone(),
13287            selection: query,
13288            graphql_client: self.graphql_client.clone(),
13289        }
13290    }
13291    /// Create a new module source instance from a source ref string
13292    ///
13293    /// # Arguments
13294    ///
13295    /// * `ref_string` - The string ref representation of the module source
13296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13297    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
13298        let mut query = self.selection.select("moduleSource");
13299        query = query.arg("refString", ref_string.into());
13300        ModuleSource {
13301            proc: self.proc.clone(),
13302            selection: query,
13303            graphql_client: self.graphql_client.clone(),
13304        }
13305    }
13306    /// Create a new module source instance from a source ref string
13307    ///
13308    /// # Arguments
13309    ///
13310    /// * `ref_string` - The string ref representation of the module source
13311    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13312    pub fn module_source_opts<'a>(
13313        &self,
13314        ref_string: impl Into<String>,
13315        opts: QueryModuleSourceOpts<'a>,
13316    ) -> ModuleSource {
13317        let mut query = self.selection.select("moduleSource");
13318        query = query.arg("refString", ref_string.into());
13319        if let Some(version) = opts.version {
13320            query = query.arg("version", version);
13321        }
13322        if let Some(ref_pin) = opts.ref_pin {
13323            query = query.arg("refPin", ref_pin);
13324        }
13325        if let Some(disable_find_up) = opts.disable_find_up {
13326            query = query.arg("disableFindUp", disable_find_up);
13327        }
13328        if let Some(allow_not_exists) = opts.allow_not_exists {
13329            query = query.arg("allowNotExists", allow_not_exists);
13330        }
13331        if let Some(require_kind) = opts.require_kind {
13332            query = query.arg("requireKind", require_kind);
13333        }
13334        ModuleSource {
13335            proc: self.proc.clone(),
13336            selection: query,
13337            graphql_client: self.graphql_client.clone(),
13338        }
13339    }
13340    /// Load any object by its ID.
13341    pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
13342        let mut query = self.selection.select("node");
13343        query = query.arg_lazy(
13344            "id",
13345            Box::new(move || {
13346                let id = id.clone();
13347                Box::pin(async move { id.into_id().await.unwrap().quote() })
13348            }),
13349        );
13350        let query = query.select("id");
13351        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13352        Ok(id.map(|id| NodeClient {
13353            proc: self.proc.clone(),
13354            selection: query
13355                .root()
13356                .select("node")
13357                .arg("id", &id.0)
13358                .inline_fragment("Node"),
13359            graphql_client: self.graphql_client.clone(),
13360        }))
13361    }
13362    /// Load a GraphQL introspection schema for merging.
13363    ///
13364    /// # Arguments
13365    ///
13366    /// * `json` - The introspection schema JSON to load.
13367    pub fn schema(&self, json: Json) -> Schema {
13368        let mut query = self.selection.select("schema");
13369        query = query.arg("json", json);
13370        Schema {
13371            proc: self.proc.clone(),
13372            selection: query,
13373            graphql_client: self.graphql_client.clone(),
13374        }
13375    }
13376    /// Creates a new secret.
13377    ///
13378    /// # Arguments
13379    ///
13380    /// * `uri` - The URI of the secret store
13381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13382    pub fn secret(&self, uri: impl Into<String>) -> Secret {
13383        let mut query = self.selection.select("secret");
13384        query = query.arg("uri", uri.into());
13385        Secret {
13386            proc: self.proc.clone(),
13387            selection: query,
13388            graphql_client: self.graphql_client.clone(),
13389        }
13390    }
13391    /// Creates a new secret.
13392    ///
13393    /// # Arguments
13394    ///
13395    /// * `uri` - The URI of the secret store
13396    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13397    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
13398        let mut query = self.selection.select("secret");
13399        query = query.arg("uri", uri.into());
13400        if let Some(cache_key) = opts.cache_key {
13401            query = query.arg("cacheKey", cache_key);
13402        }
13403        Secret {
13404            proc: self.proc.clone(),
13405            selection: query,
13406            graphql_client: self.graphql_client.clone(),
13407        }
13408    }
13409    /// Sets a secret given a user defined name to its plaintext and returns the secret.
13410    /// The plaintext value is limited to a size of 128000 bytes.
13411    ///
13412    /// # Arguments
13413    ///
13414    /// * `name` - The user defined name for this secret
13415    /// * `plaintext` - The plaintext of the secret
13416    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
13417        let mut query = self.selection.select("setSecret");
13418        query = query.arg("name", name.into());
13419        query = query.arg("plaintext", plaintext.into());
13420        Secret {
13421            proc: self.proc.clone(),
13422            selection: query,
13423            graphql_client: self.graphql_client.clone(),
13424        }
13425    }
13426    /// Creates source map metadata.
13427    ///
13428    /// # Arguments
13429    ///
13430    /// * `filename` - The filename from the module source.
13431    /// * `line` - The line number within the filename.
13432    /// * `column` - The column number within the line.
13433    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
13434        let mut query = self.selection.select("sourceMap");
13435        query = query.arg("filename", filename.into());
13436        query = query.arg("line", line);
13437        query = query.arg("column", column);
13438        SourceMap {
13439            proc: self.proc.clone(),
13440            selection: query,
13441            graphql_client: self.graphql_client.clone(),
13442        }
13443    }
13444    /// Constructs an SSHFS volume.
13445    ///
13446    /// # Arguments
13447    ///
13448    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
13449    /// * `private_key` - Private key secret used to authenticate to the remote host.
13450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13451    pub fn sshfs_volume(
13452        &self,
13453        endpoint: impl Into<String>,
13454        private_key: impl IntoID<Id>,
13455    ) -> Volume {
13456        let mut query = self.selection.select("sshfsVolume");
13457        query = query.arg("endpoint", endpoint.into());
13458        query = query.arg_lazy(
13459            "privateKey",
13460            Box::new(move || {
13461                let private_key = private_key.clone();
13462                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
13463            }),
13464        );
13465        Volume {
13466            proc: self.proc.clone(),
13467            selection: query,
13468            graphql_client: self.graphql_client.clone(),
13469        }
13470    }
13471    /// Constructs an SSHFS volume.
13472    ///
13473    /// # Arguments
13474    ///
13475    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
13476    /// * `private_key` - Private key secret used to authenticate to the remote host.
13477    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13478    pub fn sshfs_volume_opts<'a>(
13479        &self,
13480        endpoint: impl Into<String>,
13481        private_key: impl IntoID<Id>,
13482        opts: QuerySshfsVolumeOpts<'a>,
13483    ) -> Volume {
13484        let mut query = self.selection.select("sshfsVolume");
13485        query = query.arg("endpoint", endpoint.into());
13486        query = query.arg_lazy(
13487            "privateKey",
13488            Box::new(move || {
13489                let private_key = private_key.clone();
13490                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
13491            }),
13492        );
13493        if let Some(known_hosts) = opts.known_hosts {
13494            query = query.arg("knownHosts", known_hosts);
13495        }
13496        if let Some(cache_key) = opts.cache_key {
13497            query = query.arg("cacheKey", cache_key);
13498        }
13499        if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
13500            query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
13501        }
13502        if let Some(experimental_service_host) = opts.experimental_service_host {
13503            query = query.arg("experimentalServiceHost", experimental_service_host);
13504        }
13505        Volume {
13506            proc: self.proc.clone(),
13507            selection: query,
13508            graphql_client: self.graphql_client.clone(),
13509        }
13510    }
13511    /// Create a new TypeDef.
13512    pub fn type_def(&self) -> TypeDef {
13513        let query = self.selection.select("typeDef");
13514        TypeDef {
13515            proc: self.proc.clone(),
13516            selection: query,
13517            graphql_client: self.graphql_client.clone(),
13518        }
13519    }
13520    /// Get the current Dagger Engine version.
13521    pub async fn version(&self) -> Result<String, DaggerError> {
13522        let query = self.selection.select("version");
13523        query.execute(self.graphql_client.clone()).await
13524    }
13525}
13526impl Node for Query {
13527    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13528        let query = self.selection.select("id");
13529        let graphql_client = self.graphql_client.clone();
13530        async move { query.execute(graphql_client).await }
13531    }
13532}
13533#[derive(Clone)]
13534pub struct RemoteGitMirror {
13535    pub proc: Option<Arc<DaggerSessionProc>>,
13536    pub selection: Selection,
13537    pub graphql_client: DynGraphQLClient,
13538}
13539impl IntoID<Id> for RemoteGitMirror {
13540    fn into_id(
13541        self,
13542    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13543        Box::pin(async move { self.id().await })
13544    }
13545}
13546impl Loadable for RemoteGitMirror {
13547    fn graphql_type() -> &'static str {
13548        "RemoteGitMirror"
13549    }
13550    fn from_query(
13551        proc: Option<Arc<DaggerSessionProc>>,
13552        selection: Selection,
13553        graphql_client: DynGraphQLClient,
13554    ) -> Self {
13555        Self {
13556            proc,
13557            selection,
13558            graphql_client,
13559        }
13560    }
13561}
13562impl RemoteGitMirror {
13563    /// A unique identifier for this RemoteGitMirror.
13564    pub async fn id(&self) -> Result<Id, DaggerError> {
13565        let query = self.selection.select("id");
13566        query.execute(self.graphql_client.clone()).await
13567    }
13568}
13569impl Node for RemoteGitMirror {
13570    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13571        let query = self.selection.select("id");
13572        let graphql_client = self.graphql_client.clone();
13573        async move { query.execute(graphql_client).await }
13574    }
13575}
13576#[derive(Clone)]
13577pub struct SdkConfig {
13578    pub proc: Option<Arc<DaggerSessionProc>>,
13579    pub selection: Selection,
13580    pub graphql_client: DynGraphQLClient,
13581}
13582impl IntoID<Id> for SdkConfig {
13583    fn into_id(
13584        self,
13585    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13586        Box::pin(async move { self.id().await })
13587    }
13588}
13589impl Loadable for SdkConfig {
13590    fn graphql_type() -> &'static str {
13591        "SDKConfig"
13592    }
13593    fn from_query(
13594        proc: Option<Arc<DaggerSessionProc>>,
13595        selection: Selection,
13596        graphql_client: DynGraphQLClient,
13597    ) -> Self {
13598        Self {
13599            proc,
13600            selection,
13601            graphql_client,
13602        }
13603    }
13604}
13605impl SdkConfig {
13606    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
13607    pub async fn debug(&self) -> Result<bool, DaggerError> {
13608        let query = self.selection.select("debug");
13609        query.execute(self.graphql_client.clone()).await
13610    }
13611    /// A unique identifier for this SDKConfig.
13612    pub async fn id(&self) -> Result<Id, DaggerError> {
13613        let query = self.selection.select("id");
13614        query.execute(self.graphql_client.clone()).await
13615    }
13616    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
13617    pub async fn source(&self) -> Result<String, DaggerError> {
13618        let query = self.selection.select("source");
13619        query.execute(self.graphql_client.clone()).await
13620    }
13621}
13622impl Node for SdkConfig {
13623    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13624        let query = self.selection.select("id");
13625        let graphql_client = self.graphql_client.clone();
13626        async move { query.execute(graphql_client).await }
13627    }
13628}
13629#[derive(Clone)]
13630pub struct ScalarTypeDef {
13631    pub proc: Option<Arc<DaggerSessionProc>>,
13632    pub selection: Selection,
13633    pub graphql_client: DynGraphQLClient,
13634}
13635impl IntoID<Id> for ScalarTypeDef {
13636    fn into_id(
13637        self,
13638    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13639        Box::pin(async move { self.id().await })
13640    }
13641}
13642impl Loadable for ScalarTypeDef {
13643    fn graphql_type() -> &'static str {
13644        "ScalarTypeDef"
13645    }
13646    fn from_query(
13647        proc: Option<Arc<DaggerSessionProc>>,
13648        selection: Selection,
13649        graphql_client: DynGraphQLClient,
13650    ) -> Self {
13651        Self {
13652            proc,
13653            selection,
13654            graphql_client,
13655        }
13656    }
13657}
13658impl ScalarTypeDef {
13659    /// A doc string for the scalar, if any.
13660    pub async fn description(&self) -> Result<String, DaggerError> {
13661        let query = self.selection.select("description");
13662        query.execute(self.graphql_client.clone()).await
13663    }
13664    /// A unique identifier for this ScalarTypeDef.
13665    pub async fn id(&self) -> Result<Id, DaggerError> {
13666        let query = self.selection.select("id");
13667        query.execute(self.graphql_client.clone()).await
13668    }
13669    /// The name of the scalar.
13670    pub async fn name(&self) -> Result<String, DaggerError> {
13671        let query = self.selection.select("name");
13672        query.execute(self.graphql_client.clone()).await
13673    }
13674    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
13675    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
13676        let query = self.selection.select("sourceModuleName");
13677        query.execute(self.graphql_client.clone()).await
13678    }
13679}
13680impl Node for ScalarTypeDef {
13681    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13682        let query = self.selection.select("id");
13683        let graphql_client = self.graphql_client.clone();
13684        async move { query.execute(graphql_client).await }
13685    }
13686}
13687#[derive(Clone)]
13688pub struct Schema {
13689    pub proc: Option<Arc<DaggerSessionProc>>,
13690    pub selection: Selection,
13691    pub graphql_client: DynGraphQLClient,
13692}
13693impl IntoID<Id> for Schema {
13694    fn into_id(
13695        self,
13696    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13697        Box::pin(async move { self.id().await })
13698    }
13699}
13700impl Loadable for Schema {
13701    fn graphql_type() -> &'static str {
13702        "Schema"
13703    }
13704    fn from_query(
13705        proc: Option<Arc<DaggerSessionProc>>,
13706        selection: Selection,
13707        graphql_client: DynGraphQLClient,
13708    ) -> Self {
13709        Self {
13710            proc,
13711            selection,
13712            graphql_client,
13713        }
13714    }
13715}
13716impl Schema {
13717    /// Serialize the schema back to introspection JSON.
13718    pub async fn contents(&self) -> Result<Json, DaggerError> {
13719        let query = self.selection.select("contents");
13720        query.execute(self.graphql_client.clone()).await
13721    }
13722    /// A unique identifier for this Schema.
13723    pub async fn id(&self) -> Result<Id, DaggerError> {
13724        let query = self.selection.select("id");
13725        query.execute(self.graphql_client.clone()).await
13726    }
13727    /// Merge a module's introspection-shaped type definitions into the schema, returning the combined schema.
13728    ///
13729    /// # Arguments
13730    ///
13731    /// * `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.
13732    /// * `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.
13733    pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
13734        let mut query = self.selection.select("merge");
13735        query = query.arg("moduleTypes", module_types);
13736        query = query.arg("moduleName", module_name.into());
13737        Schema {
13738            proc: self.proc.clone(),
13739            selection: query,
13740            graphql_client: self.graphql_client.clone(),
13741        }
13742    }
13743}
13744impl Node for Schema {
13745    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13746        let query = self.selection.select("id");
13747        let graphql_client = self.graphql_client.clone();
13748        async move { query.execute(graphql_client).await }
13749    }
13750}
13751#[derive(Clone)]
13752pub struct SearchResult {
13753    pub proc: Option<Arc<DaggerSessionProc>>,
13754    pub selection: Selection,
13755    pub graphql_client: DynGraphQLClient,
13756}
13757impl IntoID<Id> for SearchResult {
13758    fn into_id(
13759        self,
13760    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13761        Box::pin(async move { self.id().await })
13762    }
13763}
13764impl Loadable for SearchResult {
13765    fn graphql_type() -> &'static str {
13766        "SearchResult"
13767    }
13768    fn from_query(
13769        proc: Option<Arc<DaggerSessionProc>>,
13770        selection: Selection,
13771        graphql_client: DynGraphQLClient,
13772    ) -> Self {
13773        Self {
13774            proc,
13775            selection,
13776            graphql_client,
13777        }
13778    }
13779}
13780impl SearchResult {
13781    /// The byte offset of this line within the file.
13782    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
13783        let query = self.selection.select("absoluteOffset");
13784        query.execute(self.graphql_client.clone()).await
13785    }
13786    /// The path to the file that matched.
13787    pub async fn file_path(&self) -> Result<String, DaggerError> {
13788        let query = self.selection.select("filePath");
13789        query.execute(self.graphql_client.clone()).await
13790    }
13791    /// A unique identifier for this SearchResult.
13792    pub async fn id(&self) -> Result<Id, DaggerError> {
13793        let query = self.selection.select("id");
13794        query.execute(self.graphql_client.clone()).await
13795    }
13796    /// The first line that matched.
13797    pub async fn line_number(&self) -> Result<isize, DaggerError> {
13798        let query = self.selection.select("lineNumber");
13799        query.execute(self.graphql_client.clone()).await
13800    }
13801    /// The line content that matched.
13802    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
13803        let query = self.selection.select("matchedLines");
13804        query.execute(self.graphql_client.clone()).await
13805    }
13806    /// Sub-match positions and content within the matched lines.
13807    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
13808        let query = self.selection.select("submatches");
13809        let query = query.select("id");
13810        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13811        Ok(ids
13812            .into_iter()
13813            .map(|id| SearchSubmatch {
13814                proc: self.proc.clone(),
13815                selection: crate::querybuilder::query()
13816                    .select("node")
13817                    .arg("id", &id.0)
13818                    .inline_fragment("SearchSubmatch"),
13819                graphql_client: self.graphql_client.clone(),
13820            })
13821            .collect())
13822    }
13823}
13824impl Node for SearchResult {
13825    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13826        let query = self.selection.select("id");
13827        let graphql_client = self.graphql_client.clone();
13828        async move { query.execute(graphql_client).await }
13829    }
13830}
13831#[derive(Clone)]
13832pub struct SearchSubmatch {
13833    pub proc: Option<Arc<DaggerSessionProc>>,
13834    pub selection: Selection,
13835    pub graphql_client: DynGraphQLClient,
13836}
13837impl IntoID<Id> for SearchSubmatch {
13838    fn into_id(
13839        self,
13840    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13841        Box::pin(async move { self.id().await })
13842    }
13843}
13844impl Loadable for SearchSubmatch {
13845    fn graphql_type() -> &'static str {
13846        "SearchSubmatch"
13847    }
13848    fn from_query(
13849        proc: Option<Arc<DaggerSessionProc>>,
13850        selection: Selection,
13851        graphql_client: DynGraphQLClient,
13852    ) -> Self {
13853        Self {
13854            proc,
13855            selection,
13856            graphql_client,
13857        }
13858    }
13859}
13860impl SearchSubmatch {
13861    /// The match's end offset within the matched lines.
13862    pub async fn end(&self) -> Result<isize, DaggerError> {
13863        let query = self.selection.select("end");
13864        query.execute(self.graphql_client.clone()).await
13865    }
13866    /// A unique identifier for this SearchSubmatch.
13867    pub async fn id(&self) -> Result<Id, DaggerError> {
13868        let query = self.selection.select("id");
13869        query.execute(self.graphql_client.clone()).await
13870    }
13871    /// The match's start offset within the matched lines.
13872    pub async fn start(&self) -> Result<isize, DaggerError> {
13873        let query = self.selection.select("start");
13874        query.execute(self.graphql_client.clone()).await
13875    }
13876    /// The matched text.
13877    pub async fn text(&self) -> Result<String, DaggerError> {
13878        let query = self.selection.select("text");
13879        query.execute(self.graphql_client.clone()).await
13880    }
13881}
13882impl Node for SearchSubmatch {
13883    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13884        let query = self.selection.select("id");
13885        let graphql_client = self.graphql_client.clone();
13886        async move { query.execute(graphql_client).await }
13887    }
13888}
13889#[derive(Clone)]
13890pub struct Secret {
13891    pub proc: Option<Arc<DaggerSessionProc>>,
13892    pub selection: Selection,
13893    pub graphql_client: DynGraphQLClient,
13894}
13895impl IntoID<Id> for Secret {
13896    fn into_id(
13897        self,
13898    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13899        Box::pin(async move { self.id().await })
13900    }
13901}
13902impl Loadable for Secret {
13903    fn graphql_type() -> &'static str {
13904        "Secret"
13905    }
13906    fn from_query(
13907        proc: Option<Arc<DaggerSessionProc>>,
13908        selection: Selection,
13909        graphql_client: DynGraphQLClient,
13910    ) -> Self {
13911        Self {
13912            proc,
13913            selection,
13914            graphql_client,
13915        }
13916    }
13917}
13918impl Secret {
13919    /// A unique identifier for this Secret.
13920    pub async fn id(&self) -> Result<Id, DaggerError> {
13921        let query = self.selection.select("id");
13922        query.execute(self.graphql_client.clone()).await
13923    }
13924    /// The name of this secret.
13925    pub async fn name(&self) -> Result<String, DaggerError> {
13926        let query = self.selection.select("name");
13927        query.execute(self.graphql_client.clone()).await
13928    }
13929    /// The value of this secret.
13930    pub async fn plaintext(&self) -> Result<String, DaggerError> {
13931        let query = self.selection.select("plaintext");
13932        query.execute(self.graphql_client.clone()).await
13933    }
13934    /// The URI of this secret.
13935    pub async fn uri(&self) -> Result<String, DaggerError> {
13936        let query = self.selection.select("uri");
13937        query.execute(self.graphql_client.clone()).await
13938    }
13939}
13940impl Node for Secret {
13941    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13942        let query = self.selection.select("id");
13943        let graphql_client = self.graphql_client.clone();
13944        async move { query.execute(graphql_client).await }
13945    }
13946}
13947#[derive(Clone)]
13948pub struct Service {
13949    pub proc: Option<Arc<DaggerSessionProc>>,
13950    pub selection: Selection,
13951    pub graphql_client: DynGraphQLClient,
13952}
13953#[derive(Builder, Debug, PartialEq)]
13954pub struct ServiceEndpointOpts<'a> {
13955    /// The exposed port number for the endpoint
13956    #[builder(setter(into, strip_option), default)]
13957    pub port: Option<isize>,
13958    /// Return a URL with the given scheme, eg. http for http://
13959    #[builder(setter(into, strip_option), default)]
13960    pub scheme: Option<&'a str>,
13961}
13962#[derive(Builder, Debug, PartialEq)]
13963pub struct ServiceStopOpts {
13964    /// Immediately kill the service without waiting for a graceful exit
13965    #[builder(setter(into, strip_option), default)]
13966    pub kill: Option<bool>,
13967}
13968#[derive(Builder, Debug, PartialEq)]
13969pub struct ServiceTerminalOpts<'a> {
13970    #[builder(setter(into, strip_option), default)]
13971    pub cmd: Option<Vec<&'a str>>,
13972}
13973#[derive(Builder, Debug, PartialEq)]
13974pub struct ServiceUpOpts {
13975    /// List of frontend/backend port mappings to forward.
13976    /// Frontend is the port accepting traffic on the host, backend is the service port.
13977    #[builder(setter(into, strip_option), default)]
13978    pub ports: Option<Vec<PortForward>>,
13979    /// Bind each tunnel port to a random port on the host.
13980    #[builder(setter(into, strip_option), default)]
13981    pub random: Option<bool>,
13982}
13983impl IntoID<Id> for Service {
13984    fn into_id(
13985        self,
13986    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13987        Box::pin(async move { self.id().await })
13988    }
13989}
13990impl Loadable for Service {
13991    fn graphql_type() -> &'static str {
13992        "Service"
13993    }
13994    fn from_query(
13995        proc: Option<Arc<DaggerSessionProc>>,
13996        selection: Selection,
13997        graphql_client: DynGraphQLClient,
13998    ) -> Self {
13999        Self {
14000            proc,
14001            selection,
14002            graphql_client,
14003        }
14004    }
14005}
14006impl Service {
14007    /// Retrieves an endpoint that clients can use to reach this container.
14008    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
14009    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
14010    ///
14011    /// # Arguments
14012    ///
14013    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14014    pub async fn endpoint(&self) -> Result<String, DaggerError> {
14015        let query = self.selection.select("endpoint");
14016        query.execute(self.graphql_client.clone()).await
14017    }
14018    /// Retrieves an endpoint that clients can use to reach this container.
14019    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
14020    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
14021    ///
14022    /// # Arguments
14023    ///
14024    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14025    pub async fn endpoint_opts<'a>(
14026        &self,
14027        opts: ServiceEndpointOpts<'a>,
14028    ) -> Result<String, DaggerError> {
14029        let mut query = self.selection.select("endpoint");
14030        if let Some(port) = opts.port {
14031            query = query.arg("port", port);
14032        }
14033        if let Some(scheme) = opts.scheme {
14034            query = query.arg("scheme", scheme);
14035        }
14036        query.execute(self.graphql_client.clone()).await
14037    }
14038    /// Retrieves a hostname which can be used by clients to reach this container.
14039    pub async fn hostname(&self) -> Result<String, DaggerError> {
14040        let query = self.selection.select("hostname");
14041        query.execute(self.graphql_client.clone()).await
14042    }
14043    /// A unique identifier for this Service.
14044    pub async fn id(&self) -> Result<Id, DaggerError> {
14045        let query = self.selection.select("id");
14046        query.execute(self.graphql_client.clone()).await
14047    }
14048    /// Retrieves the list of ports provided by the service.
14049    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
14050        let query = self.selection.select("ports");
14051        let query = query.select("id");
14052        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14053        Ok(ids
14054            .into_iter()
14055            .map(|id| Port {
14056                proc: self.proc.clone(),
14057                selection: crate::querybuilder::query()
14058                    .select("node")
14059                    .arg("id", &id.0)
14060                    .inline_fragment("Port"),
14061                graphql_client: self.graphql_client.clone(),
14062            })
14063            .collect())
14064    }
14065    /// Start the service and wait for its health checks to succeed.
14066    /// Services bound to a Container do not need to be manually started.
14067    pub async fn start(&self) -> Result<Service, DaggerError> {
14068        let query = self.selection.select("start");
14069        let id: Id = query.execute(self.graphql_client.clone()).await?;
14070        Ok(Service {
14071            proc: self.proc.clone(),
14072            selection: query
14073                .root()
14074                .select("node")
14075                .arg("id", &id.0)
14076                .inline_fragment("Service"),
14077            graphql_client: self.graphql_client.clone(),
14078        })
14079    }
14080    /// Stop the service.
14081    ///
14082    /// # Arguments
14083    ///
14084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14085    pub async fn stop(&self) -> Result<Service, DaggerError> {
14086        let query = self.selection.select("stop");
14087        let id: Id = query.execute(self.graphql_client.clone()).await?;
14088        Ok(Service {
14089            proc: self.proc.clone(),
14090            selection: query
14091                .root()
14092                .select("node")
14093                .arg("id", &id.0)
14094                .inline_fragment("Service"),
14095            graphql_client: self.graphql_client.clone(),
14096        })
14097    }
14098    /// Stop the service.
14099    ///
14100    /// # Arguments
14101    ///
14102    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14103    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
14104        let mut query = self.selection.select("stop");
14105        if let Some(kill) = opts.kill {
14106            query = query.arg("kill", kill);
14107        }
14108        let id: Id = query.execute(self.graphql_client.clone()).await?;
14109        Ok(Service {
14110            proc: self.proc.clone(),
14111            selection: query
14112                .root()
14113                .select("node")
14114                .arg("id", &id.0)
14115                .inline_fragment("Service"),
14116            graphql_client: self.graphql_client.clone(),
14117        })
14118    }
14119    /// Forces evaluation of the pipeline in the engine.
14120    pub async fn sync(&self) -> Result<Service, DaggerError> {
14121        let query = self.selection.select("sync");
14122        let id: Id = query.execute(self.graphql_client.clone()).await?;
14123        Ok(Service {
14124            proc: self.proc.clone(),
14125            selection: query
14126                .root()
14127                .select("node")
14128                .arg("id", &id.0)
14129                .inline_fragment("Service"),
14130            graphql_client: self.graphql_client.clone(),
14131        })
14132    }
14133    ///
14134    /// # Arguments
14135    ///
14136    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14137    pub fn terminal(&self) -> Service {
14138        let query = self.selection.select("terminal");
14139        Service {
14140            proc: self.proc.clone(),
14141            selection: query,
14142            graphql_client: self.graphql_client.clone(),
14143        }
14144    }
14145    ///
14146    /// # Arguments
14147    ///
14148    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14149    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
14150        let mut query = self.selection.select("terminal");
14151        if let Some(cmd) = opts.cmd {
14152            query = query.arg("cmd", cmd);
14153        }
14154        Service {
14155            proc: self.proc.clone(),
14156            selection: query,
14157            graphql_client: self.graphql_client.clone(),
14158        }
14159    }
14160    /// Creates a tunnel that forwards traffic from the caller's network to this service.
14161    ///
14162    /// # Arguments
14163    ///
14164    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14165    pub async fn up(&self) -> Result<Void, DaggerError> {
14166        let query = self.selection.select("up");
14167        query.execute(self.graphql_client.clone()).await
14168    }
14169    /// Creates a tunnel that forwards traffic from the caller's network to this service.
14170    ///
14171    /// # Arguments
14172    ///
14173    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14174    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
14175        let mut query = self.selection.select("up");
14176        if let Some(ports) = opts.ports {
14177            query = query.arg("ports", ports);
14178        }
14179        if let Some(random) = opts.random {
14180            query = query.arg("random", random);
14181        }
14182        query.execute(self.graphql_client.clone()).await
14183    }
14184    /// Configures a hostname which can be used by clients within the session to reach this container.
14185    ///
14186    /// # Arguments
14187    ///
14188    /// * `hostname` - The hostname to use.
14189    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
14190        let mut query = self.selection.select("withHostname");
14191        query = query.arg("hostname", hostname.into());
14192        Service {
14193            proc: self.proc.clone(),
14194            selection: query,
14195            graphql_client: self.graphql_client.clone(),
14196        }
14197    }
14198}
14199impl Node for Service {
14200    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14201        let query = self.selection.select("id");
14202        let graphql_client = self.graphql_client.clone();
14203        async move { query.execute(graphql_client).await }
14204    }
14205}
14206impl Syncer for Service {
14207    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14208        let query = self.selection.select("id");
14209        let graphql_client = self.graphql_client.clone();
14210        async move { query.execute(graphql_client).await }
14211    }
14212    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14213        let query = self.selection.select("sync");
14214        let graphql_client = self.graphql_client.clone();
14215        async move { query.execute(graphql_client).await }
14216    }
14217}
14218#[derive(Clone)]
14219pub struct Socket {
14220    pub proc: Option<Arc<DaggerSessionProc>>,
14221    pub selection: Selection,
14222    pub graphql_client: DynGraphQLClient,
14223}
14224impl IntoID<Id> for Socket {
14225    fn into_id(
14226        self,
14227    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14228        Box::pin(async move { self.id().await })
14229    }
14230}
14231impl Loadable for Socket {
14232    fn graphql_type() -> &'static str {
14233        "Socket"
14234    }
14235    fn from_query(
14236        proc: Option<Arc<DaggerSessionProc>>,
14237        selection: Selection,
14238        graphql_client: DynGraphQLClient,
14239    ) -> Self {
14240        Self {
14241            proc,
14242            selection,
14243            graphql_client,
14244        }
14245    }
14246}
14247impl Socket {
14248    /// A unique identifier for this Socket.
14249    pub async fn id(&self) -> Result<Id, DaggerError> {
14250        let query = self.selection.select("id");
14251        query.execute(self.graphql_client.clone()).await
14252    }
14253}
14254impl Node for Socket {
14255    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14256        let query = self.selection.select("id");
14257        let graphql_client = self.graphql_client.clone();
14258        async move { query.execute(graphql_client).await }
14259    }
14260}
14261#[derive(Clone)]
14262pub struct SourceMap {
14263    pub proc: Option<Arc<DaggerSessionProc>>,
14264    pub selection: Selection,
14265    pub graphql_client: DynGraphQLClient,
14266}
14267impl IntoID<Id> for SourceMap {
14268    fn into_id(
14269        self,
14270    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14271        Box::pin(async move { self.id().await })
14272    }
14273}
14274impl Loadable for SourceMap {
14275    fn graphql_type() -> &'static str {
14276        "SourceMap"
14277    }
14278    fn from_query(
14279        proc: Option<Arc<DaggerSessionProc>>,
14280        selection: Selection,
14281        graphql_client: DynGraphQLClient,
14282    ) -> Self {
14283        Self {
14284            proc,
14285            selection,
14286            graphql_client,
14287        }
14288    }
14289}
14290impl SourceMap {
14291    /// The column number within the line.
14292    pub async fn column(&self) -> Result<isize, DaggerError> {
14293        let query = self.selection.select("column");
14294        query.execute(self.graphql_client.clone()).await
14295    }
14296    /// The filename from the module source.
14297    pub async fn filename(&self) -> Result<String, DaggerError> {
14298        let query = self.selection.select("filename");
14299        query.execute(self.graphql_client.clone()).await
14300    }
14301    /// A unique identifier for this SourceMap.
14302    pub async fn id(&self) -> Result<Id, DaggerError> {
14303        let query = self.selection.select("id");
14304        query.execute(self.graphql_client.clone()).await
14305    }
14306    /// The line number within the filename.
14307    pub async fn line(&self) -> Result<isize, DaggerError> {
14308        let query = self.selection.select("line");
14309        query.execute(self.graphql_client.clone()).await
14310    }
14311    /// The module dependency this was declared in.
14312    pub async fn module(&self) -> Result<String, DaggerError> {
14313        let query = self.selection.select("module");
14314        query.execute(self.graphql_client.clone()).await
14315    }
14316    /// The URL to the file, if any. This can be used to link to the source map in the browser.
14317    pub async fn url(&self) -> Result<String, DaggerError> {
14318        let query = self.selection.select("url");
14319        query.execute(self.graphql_client.clone()).await
14320    }
14321}
14322impl Node for SourceMap {
14323    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14324        let query = self.selection.select("id");
14325        let graphql_client = self.graphql_client.clone();
14326        async move { query.execute(graphql_client).await }
14327    }
14328}
14329#[derive(Clone)]
14330pub struct Stat {
14331    pub proc: Option<Arc<DaggerSessionProc>>,
14332    pub selection: Selection,
14333    pub graphql_client: DynGraphQLClient,
14334}
14335impl IntoID<Id> for Stat {
14336    fn into_id(
14337        self,
14338    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14339        Box::pin(async move { self.id().await })
14340    }
14341}
14342impl Loadable for Stat {
14343    fn graphql_type() -> &'static str {
14344        "Stat"
14345    }
14346    fn from_query(
14347        proc: Option<Arc<DaggerSessionProc>>,
14348        selection: Selection,
14349        graphql_client: DynGraphQLClient,
14350    ) -> Self {
14351        Self {
14352            proc,
14353            selection,
14354            graphql_client,
14355        }
14356    }
14357}
14358impl Stat {
14359    /// file type
14360    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
14361        let query = self.selection.select("fileType");
14362        query.execute(self.graphql_client.clone()).await
14363    }
14364    /// A unique identifier for this Stat.
14365    pub async fn id(&self) -> Result<Id, DaggerError> {
14366        let query = self.selection.select("id");
14367        query.execute(self.graphql_client.clone()).await
14368    }
14369    /// file name
14370    pub async fn name(&self) -> Result<String, DaggerError> {
14371        let query = self.selection.select("name");
14372        query.execute(self.graphql_client.clone()).await
14373    }
14374    /// permission bits
14375    pub async fn permissions(&self) -> Result<isize, DaggerError> {
14376        let query = self.selection.select("permissions");
14377        query.execute(self.graphql_client.clone()).await
14378    }
14379    /// file size
14380    pub async fn size(&self) -> Result<isize, DaggerError> {
14381        let query = self.selection.select("size");
14382        query.execute(self.graphql_client.clone()).await
14383    }
14384}
14385impl Node for Stat {
14386    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14387        let query = self.selection.select("id");
14388        let graphql_client = self.graphql_client.clone();
14389        async move { query.execute(graphql_client).await }
14390    }
14391}
14392#[derive(Clone)]
14393pub struct Terminal {
14394    pub proc: Option<Arc<DaggerSessionProc>>,
14395    pub selection: Selection,
14396    pub graphql_client: DynGraphQLClient,
14397}
14398impl IntoID<Id> for Terminal {
14399    fn into_id(
14400        self,
14401    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14402        Box::pin(async move { self.id().await })
14403    }
14404}
14405impl Loadable for Terminal {
14406    fn graphql_type() -> &'static str {
14407        "Terminal"
14408    }
14409    fn from_query(
14410        proc: Option<Arc<DaggerSessionProc>>,
14411        selection: Selection,
14412        graphql_client: DynGraphQLClient,
14413    ) -> Self {
14414        Self {
14415            proc,
14416            selection,
14417            graphql_client,
14418        }
14419    }
14420}
14421impl Terminal {
14422    /// A unique identifier for this Terminal.
14423    pub async fn id(&self) -> Result<Id, DaggerError> {
14424        let query = self.selection.select("id");
14425        query.execute(self.graphql_client.clone()).await
14426    }
14427    /// Forces evaluation of the pipeline in the engine.
14428    /// It doesn't run the default command if no exec has been set.
14429    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
14430        let query = self.selection.select("sync");
14431        let id: Id = query.execute(self.graphql_client.clone()).await?;
14432        Ok(Terminal {
14433            proc: self.proc.clone(),
14434            selection: query
14435                .root()
14436                .select("node")
14437                .arg("id", &id.0)
14438                .inline_fragment("Terminal"),
14439            graphql_client: self.graphql_client.clone(),
14440        })
14441    }
14442}
14443impl Node for Terminal {
14444    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14445        let query = self.selection.select("id");
14446        let graphql_client = self.graphql_client.clone();
14447        async move { query.execute(graphql_client).await }
14448    }
14449}
14450impl Syncer for Terminal {
14451    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14452        let query = self.selection.select("id");
14453        let graphql_client = self.graphql_client.clone();
14454        async move { query.execute(graphql_client).await }
14455    }
14456    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14457        let query = self.selection.select("sync");
14458        let graphql_client = self.graphql_client.clone();
14459        async move { query.execute(graphql_client).await }
14460    }
14461}
14462#[derive(Clone)]
14463pub struct TerminalGroup {
14464    pub proc: Option<Arc<DaggerSessionProc>>,
14465    pub selection: Selection,
14466    pub graphql_client: DynGraphQLClient,
14467}
14468impl IntoID<Id> for TerminalGroup {
14469    fn into_id(
14470        self,
14471    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14472        Box::pin(async move { self.id().await })
14473    }
14474}
14475impl Loadable for TerminalGroup {
14476    fn graphql_type() -> &'static str {
14477        "TerminalGroup"
14478    }
14479    fn from_query(
14480        proc: Option<Arc<DaggerSessionProc>>,
14481        selection: Selection,
14482        graphql_client: DynGraphQLClient,
14483    ) -> Self {
14484        Self {
14485            proc,
14486            selection,
14487            graphql_client,
14488        }
14489    }
14490}
14491impl TerminalGroup {
14492    /// A unique identifier for this TerminalGroup.
14493    pub async fn id(&self) -> Result<Id, DaggerError> {
14494        let query = self.selection.select("id");
14495        query.execute(self.graphql_client.clone()).await
14496    }
14497    /// Return the selected terminal targets and their details
14498    pub async fn list(&self) -> Result<Vec<TerminalTarget>, DaggerError> {
14499        let query = self.selection.select("list");
14500        let query = query.select("id");
14501        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14502        Ok(ids
14503            .into_iter()
14504            .map(|id| TerminalTarget {
14505                proc: self.proc.clone(),
14506                selection: crate::querybuilder::query()
14507                    .select("node")
14508                    .arg("id", &id.0)
14509                    .inline_fragment("TerminalTarget"),
14510                graphql_client: self.graphql_client.clone(),
14511            })
14512            .collect())
14513    }
14514    /// Open the selected terminal target
14515    pub fn run(&self) -> TerminalGroup {
14516        let query = self.selection.select("run");
14517        TerminalGroup {
14518            proc: self.proc.clone(),
14519            selection: query,
14520            graphql_client: self.graphql_client.clone(),
14521        }
14522    }
14523}
14524impl Node for TerminalGroup {
14525    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14526        let query = self.selection.select("id");
14527        let graphql_client = self.graphql_client.clone();
14528        async move { query.execute(graphql_client).await }
14529    }
14530}
14531#[derive(Clone)]
14532pub struct TerminalTarget {
14533    pub proc: Option<Arc<DaggerSessionProc>>,
14534    pub selection: Selection,
14535    pub graphql_client: DynGraphQLClient,
14536}
14537impl IntoID<Id> for TerminalTarget {
14538    fn into_id(
14539        self,
14540    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14541        Box::pin(async move { self.id().await })
14542    }
14543}
14544impl Loadable for TerminalTarget {
14545    fn graphql_type() -> &'static str {
14546        "TerminalTarget"
14547    }
14548    fn from_query(
14549        proc: Option<Arc<DaggerSessionProc>>,
14550        selection: Selection,
14551        graphql_client: DynGraphQLClient,
14552    ) -> Self {
14553        Self {
14554            proc,
14555            selection,
14556            graphql_client,
14557        }
14558    }
14559}
14560impl TerminalTarget {
14561    /// The description of the terminal target
14562    pub async fn description(&self) -> Result<String, DaggerError> {
14563        let query = self.selection.select("description");
14564        query.execute(self.graphql_client.clone()).await
14565    }
14566    /// A unique identifier for this TerminalTarget.
14567    pub async fn id(&self) -> Result<Id, DaggerError> {
14568        let query = self.selection.select("id");
14569        query.execute(self.graphql_client.clone()).await
14570    }
14571    /// Return the command name of the terminal target. Entrypoint targets omit the module prefix.
14572    pub async fn name(&self) -> Result<String, DaggerError> {
14573        let query = self.selection.select("name");
14574        query.execute(self.graphql_client.clone()).await
14575    }
14576    /// The module in which the terminal target is defined
14577    pub fn original_module(&self) -> Module {
14578        let query = self.selection.select("originalModule");
14579        Module {
14580            proc: self.proc.clone(),
14581            selection: query,
14582            graphql_client: self.graphql_client.clone(),
14583        }
14584    }
14585    /// The path of the terminal target within its module
14586    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
14587        let query = self.selection.select("path");
14588        query.execute(self.graphql_client.clone()).await
14589    }
14590}
14591impl Node for TerminalTarget {
14592    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14593        let query = self.selection.select("id");
14594        let graphql_client = self.graphql_client.clone();
14595        async move { query.execute(graphql_client).await }
14596    }
14597}
14598#[derive(Clone)]
14599pub struct TypeDef {
14600    pub proc: Option<Arc<DaggerSessionProc>>,
14601    pub selection: Selection,
14602    pub graphql_client: DynGraphQLClient,
14603}
14604#[derive(Builder, Debug, PartialEq)]
14605pub struct TypeDefWithEnumOpts<'a> {
14606    /// A doc string for the enum, if any
14607    #[builder(setter(into, strip_option), default)]
14608    pub description: Option<&'a str>,
14609    /// The source map for the enum definition.
14610    #[builder(setter(into, strip_option), default)]
14611    pub source_map: Option<Id>,
14612}
14613#[derive(Builder, Debug, PartialEq)]
14614pub struct TypeDefWithEnumMemberOpts<'a> {
14615    /// If deprecated, the reason or migration path.
14616    #[builder(setter(into, strip_option), default)]
14617    pub deprecated: Option<&'a str>,
14618    /// A doc string for the member, if any
14619    #[builder(setter(into, strip_option), default)]
14620    pub description: Option<&'a str>,
14621    /// The source map for the enum member definition.
14622    #[builder(setter(into, strip_option), default)]
14623    pub source_map: Option<Id>,
14624    /// The value of the member in the enum
14625    #[builder(setter(into, strip_option), default)]
14626    pub value: Option<&'a str>,
14627}
14628#[derive(Builder, Debug, PartialEq)]
14629pub struct TypeDefWithEnumValueOpts<'a> {
14630    /// If deprecated, the reason or migration path.
14631    #[builder(setter(into, strip_option), default)]
14632    pub deprecated: Option<&'a str>,
14633    /// A doc string for the value, if any
14634    #[builder(setter(into, strip_option), default)]
14635    pub description: Option<&'a str>,
14636    /// The source map for the enum value definition.
14637    #[builder(setter(into, strip_option), default)]
14638    pub source_map: Option<Id>,
14639}
14640#[derive(Builder, Debug, PartialEq)]
14641pub struct TypeDefWithFieldOpts<'a> {
14642    /// If deprecated, the reason or migration path.
14643    #[builder(setter(into, strip_option), default)]
14644    pub deprecated: Option<&'a str>,
14645    /// A doc string for the field, if any
14646    #[builder(setter(into, strip_option), default)]
14647    pub description: Option<&'a str>,
14648    /// The source map for the field definition.
14649    #[builder(setter(into, strip_option), default)]
14650    pub source_map: Option<Id>,
14651}
14652#[derive(Builder, Debug, PartialEq)]
14653pub struct TypeDefWithInterfaceOpts<'a> {
14654    #[builder(setter(into, strip_option), default)]
14655    pub description: Option<&'a str>,
14656    #[builder(setter(into, strip_option), default)]
14657    pub source_map: Option<Id>,
14658}
14659#[derive(Builder, Debug, PartialEq)]
14660pub struct TypeDefWithObjectOpts<'a> {
14661    #[builder(setter(into, strip_option), default)]
14662    pub deprecated: Option<&'a str>,
14663    #[builder(setter(into, strip_option), default)]
14664    pub description: Option<&'a str>,
14665    #[builder(setter(into, strip_option), default)]
14666    pub source_map: Option<Id>,
14667}
14668#[derive(Builder, Debug, PartialEq)]
14669pub struct TypeDefWithScalarOpts<'a> {
14670    #[builder(setter(into, strip_option), default)]
14671    pub description: Option<&'a str>,
14672}
14673impl IntoID<Id> for TypeDef {
14674    fn into_id(
14675        self,
14676    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14677        Box::pin(async move { self.id().await })
14678    }
14679}
14680impl Loadable for TypeDef {
14681    fn graphql_type() -> &'static str {
14682        "TypeDef"
14683    }
14684    fn from_query(
14685        proc: Option<Arc<DaggerSessionProc>>,
14686        selection: Selection,
14687        graphql_client: DynGraphQLClient,
14688    ) -> Self {
14689        Self {
14690            proc,
14691            selection,
14692            graphql_client,
14693        }
14694    }
14695}
14696impl TypeDef {
14697    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
14698    pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
14699        let query = self.selection.select("asEnum");
14700        let query = query.select("id");
14701        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14702        Ok(id.map(|id| EnumTypeDef {
14703            proc: self.proc.clone(),
14704            selection: query
14705                .root()
14706                .select("node")
14707                .arg("id", &id.0)
14708                .inline_fragment("EnumTypeDef"),
14709            graphql_client: self.graphql_client.clone(),
14710        }))
14711    }
14712    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
14713    pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
14714        let query = self.selection.select("asInput");
14715        let query = query.select("id");
14716        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14717        Ok(id.map(|id| InputTypeDef {
14718            proc: self.proc.clone(),
14719            selection: query
14720                .root()
14721                .select("node")
14722                .arg("id", &id.0)
14723                .inline_fragment("InputTypeDef"),
14724            graphql_client: self.graphql_client.clone(),
14725        }))
14726    }
14727    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
14728    pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
14729        let query = self.selection.select("asInterface");
14730        let query = query.select("id");
14731        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14732        Ok(id.map(|id| InterfaceTypeDef {
14733            proc: self.proc.clone(),
14734            selection: query
14735                .root()
14736                .select("node")
14737                .arg("id", &id.0)
14738                .inline_fragment("InterfaceTypeDef"),
14739            graphql_client: self.graphql_client.clone(),
14740        }))
14741    }
14742    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
14743    pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
14744        let query = self.selection.select("asList");
14745        let query = query.select("id");
14746        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14747        Ok(id.map(|id| ListTypeDef {
14748            proc: self.proc.clone(),
14749            selection: query
14750                .root()
14751                .select("node")
14752                .arg("id", &id.0)
14753                .inline_fragment("ListTypeDef"),
14754            graphql_client: self.graphql_client.clone(),
14755        }))
14756    }
14757    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
14758    pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
14759        let query = self.selection.select("asObject");
14760        let query = query.select("id");
14761        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14762        Ok(id.map(|id| ObjectTypeDef {
14763            proc: self.proc.clone(),
14764            selection: query
14765                .root()
14766                .select("node")
14767                .arg("id", &id.0)
14768                .inline_fragment("ObjectTypeDef"),
14769            graphql_client: self.graphql_client.clone(),
14770        }))
14771    }
14772    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
14773    pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
14774        let query = self.selection.select("asScalar");
14775        let query = query.select("id");
14776        let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14777        Ok(id.map(|id| ScalarTypeDef {
14778            proc: self.proc.clone(),
14779            selection: query
14780                .root()
14781                .select("node")
14782                .arg("id", &id.0)
14783                .inline_fragment("ScalarTypeDef"),
14784            graphql_client: self.graphql_client.clone(),
14785        }))
14786    }
14787    /// A unique identifier for this TypeDef.
14788    pub async fn id(&self) -> Result<Id, DaggerError> {
14789        let query = self.selection.select("id");
14790        query.execute(self.graphql_client.clone()).await
14791    }
14792    /// The kind of type this is (e.g. primitive, list, object).
14793    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
14794        let query = self.selection.select("kind");
14795        query.execute(self.graphql_client.clone()).await
14796    }
14797    /// The canonical non-optional name of the type.
14798    pub async fn name(&self) -> Result<String, DaggerError> {
14799        let query = self.selection.select("name");
14800        query.execute(self.graphql_client.clone()).await
14801    }
14802    /// Whether this type can be set to null. Defaults to false.
14803    pub async fn optional(&self) -> Result<bool, DaggerError> {
14804        let query = self.selection.select("optional");
14805        query.execute(self.graphql_client.clone()).await
14806    }
14807    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
14808    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
14809        let mut query = self.selection.select("withConstructor");
14810        query = query.arg_lazy(
14811            "function",
14812            Box::new(move || {
14813                let function = function.clone();
14814                Box::pin(async move { function.into_id().await.unwrap().quote() })
14815            }),
14816        );
14817        TypeDef {
14818            proc: self.proc.clone(),
14819            selection: query,
14820            graphql_client: self.graphql_client.clone(),
14821        }
14822    }
14823    /// Returns a TypeDef of kind Enum with the provided name.
14824    /// 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.
14825    ///
14826    /// # Arguments
14827    ///
14828    /// * `name` - The name of the enum
14829    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14830    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
14831        let mut query = self.selection.select("withEnum");
14832        query = query.arg("name", name.into());
14833        TypeDef {
14834            proc: self.proc.clone(),
14835            selection: query,
14836            graphql_client: self.graphql_client.clone(),
14837        }
14838    }
14839    /// Returns a TypeDef of kind Enum with the provided name.
14840    /// 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.
14841    ///
14842    /// # Arguments
14843    ///
14844    /// * `name` - The name of the enum
14845    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14846    pub fn with_enum_opts<'a>(
14847        &self,
14848        name: impl Into<String>,
14849        opts: TypeDefWithEnumOpts<'a>,
14850    ) -> TypeDef {
14851        let mut query = self.selection.select("withEnum");
14852        query = query.arg("name", name.into());
14853        if let Some(description) = opts.description {
14854            query = query.arg("description", description);
14855        }
14856        if let Some(source_map) = opts.source_map {
14857            query = query.arg("sourceMap", source_map);
14858        }
14859        TypeDef {
14860            proc: self.proc.clone(),
14861            selection: query,
14862            graphql_client: self.graphql_client.clone(),
14863        }
14864    }
14865    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14866    ///
14867    /// # Arguments
14868    ///
14869    /// * `name` - The name of the member in the enum
14870    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14871    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
14872        let mut query = self.selection.select("withEnumMember");
14873        query = query.arg("name", name.into());
14874        TypeDef {
14875            proc: self.proc.clone(),
14876            selection: query,
14877            graphql_client: self.graphql_client.clone(),
14878        }
14879    }
14880    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14881    ///
14882    /// # Arguments
14883    ///
14884    /// * `name` - The name of the member in the enum
14885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14886    pub fn with_enum_member_opts<'a>(
14887        &self,
14888        name: impl Into<String>,
14889        opts: TypeDefWithEnumMemberOpts<'a>,
14890    ) -> TypeDef {
14891        let mut query = self.selection.select("withEnumMember");
14892        query = query.arg("name", name.into());
14893        if let Some(value) = opts.value {
14894            query = query.arg("value", value);
14895        }
14896        if let Some(description) = opts.description {
14897            query = query.arg("description", description);
14898        }
14899        if let Some(source_map) = opts.source_map {
14900            query = query.arg("sourceMap", source_map);
14901        }
14902        if let Some(deprecated) = opts.deprecated {
14903            query = query.arg("deprecated", deprecated);
14904        }
14905        TypeDef {
14906            proc: self.proc.clone(),
14907            selection: query,
14908            graphql_client: self.graphql_client.clone(),
14909        }
14910    }
14911    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14912    ///
14913    /// # Arguments
14914    ///
14915    /// * `value` - The name of the value in the enum
14916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14917    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
14918        let mut query = self.selection.select("withEnumValue");
14919        query = query.arg("value", value.into());
14920        TypeDef {
14921            proc: self.proc.clone(),
14922            selection: query,
14923            graphql_client: self.graphql_client.clone(),
14924        }
14925    }
14926    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14927    ///
14928    /// # Arguments
14929    ///
14930    /// * `value` - The name of the value in the enum
14931    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14932    pub fn with_enum_value_opts<'a>(
14933        &self,
14934        value: impl Into<String>,
14935        opts: TypeDefWithEnumValueOpts<'a>,
14936    ) -> TypeDef {
14937        let mut query = self.selection.select("withEnumValue");
14938        query = query.arg("value", value.into());
14939        if let Some(description) = opts.description {
14940            query = query.arg("description", description);
14941        }
14942        if let Some(source_map) = opts.source_map {
14943            query = query.arg("sourceMap", source_map);
14944        }
14945        if let Some(deprecated) = opts.deprecated {
14946            query = query.arg("deprecated", deprecated);
14947        }
14948        TypeDef {
14949            proc: self.proc.clone(),
14950            selection: query,
14951            graphql_client: self.graphql_client.clone(),
14952        }
14953    }
14954    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14955    ///
14956    /// # Arguments
14957    ///
14958    /// * `name` - The name of the field in the object
14959    /// * `type_def` - The type of the field
14960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14961    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
14962        let mut query = self.selection.select("withField");
14963        query = query.arg("name", name.into());
14964        query = query.arg_lazy(
14965            "typeDef",
14966            Box::new(move || {
14967                let type_def = type_def.clone();
14968                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14969            }),
14970        );
14971        TypeDef {
14972            proc: self.proc.clone(),
14973            selection: query,
14974            graphql_client: self.graphql_client.clone(),
14975        }
14976    }
14977    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14978    ///
14979    /// # Arguments
14980    ///
14981    /// * `name` - The name of the field in the object
14982    /// * `type_def` - The type of the field
14983    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14984    pub fn with_field_opts<'a>(
14985        &self,
14986        name: impl Into<String>,
14987        type_def: impl IntoID<Id>,
14988        opts: TypeDefWithFieldOpts<'a>,
14989    ) -> TypeDef {
14990        let mut query = self.selection.select("withField");
14991        query = query.arg("name", name.into());
14992        query = query.arg_lazy(
14993            "typeDef",
14994            Box::new(move || {
14995                let type_def = type_def.clone();
14996                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14997            }),
14998        );
14999        if let Some(description) = opts.description {
15000            query = query.arg("description", description);
15001        }
15002        if let Some(source_map) = opts.source_map {
15003            query = query.arg("sourceMap", source_map);
15004        }
15005        if let Some(deprecated) = opts.deprecated {
15006            query = query.arg("deprecated", deprecated);
15007        }
15008        TypeDef {
15009            proc: self.proc.clone(),
15010            selection: query,
15011            graphql_client: self.graphql_client.clone(),
15012        }
15013    }
15014    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
15015    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15016        let mut query = self.selection.select("withFunction");
15017        query = query.arg_lazy(
15018            "function",
15019            Box::new(move || {
15020                let function = function.clone();
15021                Box::pin(async move { function.into_id().await.unwrap().quote() })
15022            }),
15023        );
15024        TypeDef {
15025            proc: self.proc.clone(),
15026            selection: query,
15027            graphql_client: self.graphql_client.clone(),
15028        }
15029    }
15030    /// Returns a TypeDef of kind Interface with the provided name.
15031    ///
15032    /// # Arguments
15033    ///
15034    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15035    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15036        let mut query = self.selection.select("withInterface");
15037        query = query.arg("name", name.into());
15038        TypeDef {
15039            proc: self.proc.clone(),
15040            selection: query,
15041            graphql_client: self.graphql_client.clone(),
15042        }
15043    }
15044    /// Returns a TypeDef of kind Interface with the provided name.
15045    ///
15046    /// # Arguments
15047    ///
15048    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15049    pub fn with_interface_opts<'a>(
15050        &self,
15051        name: impl Into<String>,
15052        opts: TypeDefWithInterfaceOpts<'a>,
15053    ) -> TypeDef {
15054        let mut query = self.selection.select("withInterface");
15055        query = query.arg("name", name.into());
15056        if let Some(description) = opts.description {
15057            query = query.arg("description", description);
15058        }
15059        if let Some(source_map) = opts.source_map {
15060            query = query.arg("sourceMap", source_map);
15061        }
15062        TypeDef {
15063            proc: self.proc.clone(),
15064            selection: query,
15065            graphql_client: self.graphql_client.clone(),
15066        }
15067    }
15068    /// Sets the kind of the type.
15069    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15070        let mut query = self.selection.select("withKind");
15071        query = query.arg("kind", kind);
15072        TypeDef {
15073            proc: self.proc.clone(),
15074            selection: query,
15075            graphql_client: self.graphql_client.clone(),
15076        }
15077    }
15078    /// Returns a TypeDef of kind List with the provided type for its elements.
15079    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15080        let mut query = self.selection.select("withListOf");
15081        query = query.arg_lazy(
15082            "elementType",
15083            Box::new(move || {
15084                let element_type = element_type.clone();
15085                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15086            }),
15087        );
15088        TypeDef {
15089            proc: self.proc.clone(),
15090            selection: query,
15091            graphql_client: self.graphql_client.clone(),
15092        }
15093    }
15094    /// Returns a TypeDef of kind Object with the provided name.
15095    /// 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.
15096    ///
15097    /// # Arguments
15098    ///
15099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15100    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15101        let mut query = self.selection.select("withObject");
15102        query = query.arg("name", name.into());
15103        TypeDef {
15104            proc: self.proc.clone(),
15105            selection: query,
15106            graphql_client: self.graphql_client.clone(),
15107        }
15108    }
15109    /// Returns a TypeDef of kind Object with the provided name.
15110    /// 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.
15111    ///
15112    /// # Arguments
15113    ///
15114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15115    pub fn with_object_opts<'a>(
15116        &self,
15117        name: impl Into<String>,
15118        opts: TypeDefWithObjectOpts<'a>,
15119    ) -> TypeDef {
15120        let mut query = self.selection.select("withObject");
15121        query = query.arg("name", name.into());
15122        if let Some(description) = opts.description {
15123            query = query.arg("description", description);
15124        }
15125        if let Some(source_map) = opts.source_map {
15126            query = query.arg("sourceMap", source_map);
15127        }
15128        if let Some(deprecated) = opts.deprecated {
15129            query = query.arg("deprecated", deprecated);
15130        }
15131        TypeDef {
15132            proc: self.proc.clone(),
15133            selection: query,
15134            graphql_client: self.graphql_client.clone(),
15135        }
15136    }
15137    /// Sets whether this type can be set to null.
15138    pub fn with_optional(&self, optional: bool) -> TypeDef {
15139        let mut query = self.selection.select("withOptional");
15140        query = query.arg("optional", optional);
15141        TypeDef {
15142            proc: self.proc.clone(),
15143            selection: query,
15144            graphql_client: self.graphql_client.clone(),
15145        }
15146    }
15147    /// Returns a TypeDef of kind Scalar with the provided name.
15148    ///
15149    /// # Arguments
15150    ///
15151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15152    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
15153        let mut query = self.selection.select("withScalar");
15154        query = query.arg("name", name.into());
15155        TypeDef {
15156            proc: self.proc.clone(),
15157            selection: query,
15158            graphql_client: self.graphql_client.clone(),
15159        }
15160    }
15161    /// Returns a TypeDef of kind Scalar with the provided name.
15162    ///
15163    /// # Arguments
15164    ///
15165    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15166    pub fn with_scalar_opts<'a>(
15167        &self,
15168        name: impl Into<String>,
15169        opts: TypeDefWithScalarOpts<'a>,
15170    ) -> TypeDef {
15171        let mut query = self.selection.select("withScalar");
15172        query = query.arg("name", name.into());
15173        if let Some(description) = opts.description {
15174            query = query.arg("description", description);
15175        }
15176        TypeDef {
15177            proc: self.proc.clone(),
15178            selection: query,
15179            graphql_client: self.graphql_client.clone(),
15180        }
15181    }
15182}
15183impl Node for TypeDef {
15184    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15185        let query = self.selection.select("id");
15186        let graphql_client = self.graphql_client.clone();
15187        async move { query.execute(graphql_client).await }
15188    }
15189}
15190#[derive(Clone)]
15191pub struct Up {
15192    pub proc: Option<Arc<DaggerSessionProc>>,
15193    pub selection: Selection,
15194    pub graphql_client: DynGraphQLClient,
15195}
15196impl IntoID<Id> for Up {
15197    fn into_id(
15198        self,
15199    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15200        Box::pin(async move { self.id().await })
15201    }
15202}
15203impl Loadable for Up {
15204    fn graphql_type() -> &'static str {
15205        "Up"
15206    }
15207    fn from_query(
15208        proc: Option<Arc<DaggerSessionProc>>,
15209        selection: Selection,
15210        graphql_client: DynGraphQLClient,
15211    ) -> Self {
15212        Self {
15213            proc,
15214            selection,
15215            graphql_client,
15216        }
15217    }
15218}
15219impl Up {
15220    /// The description of the service
15221    pub async fn description(&self) -> Result<String, DaggerError> {
15222        let query = self.selection.select("description");
15223        query.execute(self.graphql_client.clone()).await
15224    }
15225    /// A unique identifier for this Up.
15226    pub async fn id(&self) -> Result<Id, DaggerError> {
15227        let query = self.selection.select("id");
15228        query.execute(self.graphql_client.clone()).await
15229    }
15230    /// Return the command name of the service. Entrypoint targets omit the module prefix.
15231    pub async fn name(&self) -> Result<String, DaggerError> {
15232        let query = self.selection.select("name");
15233        query.execute(self.graphql_client.clone()).await
15234    }
15235    /// The original module in which the service has been defined
15236    pub fn original_module(&self) -> Module {
15237        let query = self.selection.select("originalModule");
15238        Module {
15239            proc: self.proc.clone(),
15240            selection: query,
15241            graphql_client: self.graphql_client.clone(),
15242        }
15243    }
15244    /// The path of the service within its module
15245    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
15246        let query = self.selection.select("path");
15247        query.execute(self.graphql_client.clone()).await
15248    }
15249    /// Execute the service function
15250    pub fn run(&self) -> Up {
15251        let query = self.selection.select("run");
15252        Up {
15253            proc: self.proc.clone(),
15254            selection: query,
15255            graphql_client: self.graphql_client.clone(),
15256        }
15257    }
15258}
15259impl Node for Up {
15260    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15261        let query = self.selection.select("id");
15262        let graphql_client = self.graphql_client.clone();
15263        async move { query.execute(graphql_client).await }
15264    }
15265}
15266#[derive(Clone)]
15267pub struct UpGroup {
15268    pub proc: Option<Arc<DaggerSessionProc>>,
15269    pub selection: Selection,
15270    pub graphql_client: DynGraphQLClient,
15271}
15272impl IntoID<Id> for UpGroup {
15273    fn into_id(
15274        self,
15275    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15276        Box::pin(async move { self.id().await })
15277    }
15278}
15279impl Loadable for UpGroup {
15280    fn graphql_type() -> &'static str {
15281        "UpGroup"
15282    }
15283    fn from_query(
15284        proc: Option<Arc<DaggerSessionProc>>,
15285        selection: Selection,
15286        graphql_client: DynGraphQLClient,
15287    ) -> Self {
15288        Self {
15289            proc,
15290            selection,
15291            graphql_client,
15292        }
15293    }
15294}
15295impl UpGroup {
15296    /// A unique identifier for this UpGroup.
15297    pub async fn id(&self) -> Result<Id, DaggerError> {
15298        let query = self.selection.select("id");
15299        query.execute(self.graphql_client.clone()).await
15300    }
15301    /// Return a list of individual services and their details
15302    pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
15303        let query = self.selection.select("list");
15304        let query = query.select("id");
15305        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15306        Ok(ids
15307            .into_iter()
15308            .map(|id| Up {
15309                proc: self.proc.clone(),
15310                selection: crate::querybuilder::query()
15311                    .select("node")
15312                    .arg("id", &id.0)
15313                    .inline_fragment("Up"),
15314                graphql_client: self.graphql_client.clone(),
15315            })
15316            .collect())
15317    }
15318    /// Execute all selected service functions
15319    pub fn run(&self) -> UpGroup {
15320        let query = self.selection.select("run");
15321        UpGroup {
15322            proc: self.proc.clone(),
15323            selection: query,
15324            graphql_client: self.graphql_client.clone(),
15325        }
15326    }
15327}
15328impl Node for UpGroup {
15329    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15330        let query = self.selection.select("id");
15331        let graphql_client = self.graphql_client.clone();
15332        async move { query.execute(graphql_client).await }
15333    }
15334}
15335#[derive(Clone)]
15336pub struct Volume {
15337    pub proc: Option<Arc<DaggerSessionProc>>,
15338    pub selection: Selection,
15339    pub graphql_client: DynGraphQLClient,
15340}
15341impl IntoID<Id> for Volume {
15342    fn into_id(
15343        self,
15344    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15345        Box::pin(async move { self.id().await })
15346    }
15347}
15348impl Loadable for Volume {
15349    fn graphql_type() -> &'static str {
15350        "Volume"
15351    }
15352    fn from_query(
15353        proc: Option<Arc<DaggerSessionProc>>,
15354        selection: Selection,
15355        graphql_client: DynGraphQLClient,
15356    ) -> Self {
15357        Self {
15358            proc,
15359            selection,
15360            graphql_client,
15361        }
15362    }
15363}
15364impl Volume {
15365    /// A unique identifier for this Volume.
15366    pub async fn id(&self) -> Result<Id, DaggerError> {
15367        let query = self.selection.select("id");
15368        query.execute(self.graphql_client.clone()).await
15369    }
15370}
15371impl Node for Volume {
15372    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15373        let query = self.selection.select("id");
15374        let graphql_client = self.graphql_client.clone();
15375        async move { query.execute(graphql_client).await }
15376    }
15377}
15378#[derive(Clone)]
15379pub struct Workspace {
15380    pub proc: Option<Arc<DaggerSessionProc>>,
15381    pub selection: Selection,
15382    pub graphql_client: DynGraphQLClient,
15383}
15384#[derive(Builder, Debug, PartialEq)]
15385pub struct WorkspaceAgentsOpts<'a> {
15386    /// Only include agents matching the specified patterns
15387    #[builder(setter(into, strip_option), default)]
15388    pub include: Option<Vec<&'a str>>,
15389}
15390#[derive(Builder, Debug, PartialEq)]
15391pub struct WorkspaceChangesOpts {
15392    /// An earlier workspace state to compare against.
15393    #[builder(setter(into, strip_option), default)]
15394    pub from: Option<Id>,
15395}
15396#[derive(Builder, Debug, PartialEq)]
15397pub struct WorkspaceChecksOpts<'a> {
15398    /// Only include checks matching the specified patterns
15399    #[builder(setter(into, strip_option), default)]
15400    pub include: Option<Vec<&'a str>>,
15401    /// When true, only return annotated check functions; exclude generate-as-checks
15402    #[builder(setter(into, strip_option), default)]
15403    pub no_generate: Option<bool>,
15404    /// When true, only return generate-as-checks; exclude annotated check functions
15405    #[builder(setter(into, strip_option), default)]
15406    pub only_generate: Option<bool>,
15407    /// Skip checks matching the specified patterns
15408    #[builder(setter(into, strip_option), default)]
15409    pub skip: Option<Vec<&'a str>>,
15410}
15411#[derive(Builder, Debug, PartialEq)]
15412pub struct WorkspaceConfigReadOpts<'a> {
15413    /// Dotted key path (e.g. modules.greeter.source). Empty for full config.
15414    #[builder(setter(into, strip_option), default)]
15415    pub key: Option<&'a str>,
15416}
15417#[derive(Builder, Debug, PartialEq)]
15418pub struct WorkspaceDirectoryOpts<'a> {
15419    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
15420    #[builder(setter(into, strip_option), default)]
15421    pub exclude: Option<Vec<&'a str>>,
15422    /// Apply .gitignore filter rules inside the directory.
15423    #[builder(setter(into, strip_option), default)]
15424    pub gitignore: Option<bool>,
15425    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
15426    #[builder(setter(into, strip_option), default)]
15427    pub include: Option<Vec<&'a str>>,
15428}
15429#[derive(Builder, Debug, PartialEq)]
15430pub struct WorkspaceFindRootsOpts<'a> {
15431    /// Glob patterns pruning the walk below start (e.g. ["**/node_modules/**"]).
15432    #[builder(setter(into, strip_option), default)]
15433    pub exclude: Option<Vec<&'a str>>,
15434    /// Directory to start from. Relative paths resolve from the workspace cwd.
15435    #[builder(setter(into, strip_option), default)]
15436    pub start: Option<&'a str>,
15437}
15438#[derive(Builder, Debug, PartialEq)]
15439pub struct WorkspaceFindUpOpts<'a> {
15440    /// Path to start the search from. Relative paths resolve from the workspace cwd; absolute paths resolve from the workspace root.
15441    #[builder(setter(into, strip_option), default)]
15442    pub from: Option<&'a str>,
15443}
15444#[derive(Builder, Debug, PartialEq)]
15445pub struct WorkspaceGeneratorsOpts<'a> {
15446    /// Only include generators matching the specified patterns
15447    #[builder(setter(into, strip_option), default)]
15448    pub include: Option<Vec<&'a str>>,
15449}
15450#[derive(Builder, Debug, PartialEq)]
15451pub struct WorkspaceMigrateOpts<'a> {
15452    /// Additional local modules to migrate. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
15453    #[builder(setter(into, strip_option), default)]
15454    pub modules: Option<Vec<&'a str>>,
15455}
15456#[derive(Builder, Debug, PartialEq)]
15457pub struct WorkspaceMigrateModuleOpts<'a> {
15458    /// Module directory. Relative paths start at the workspace cwd; absolute paths start at the workspace root.
15459    #[builder(setter(into, strip_option), default)]
15460    pub path: Option<&'a str>,
15461}
15462#[derive(Builder, Debug, PartialEq)]
15463pub struct WorkspaceSearchOpts<'a> {
15464    /// Allow the . pattern to match newlines in multiline mode.
15465    #[builder(setter(into, strip_option), default)]
15466    pub dotall: Option<bool>,
15467    /// Only return matching files, not lines and content
15468    #[builder(setter(into, strip_option), default)]
15469    pub files_only: Option<bool>,
15470    /// Glob patterns to match (e.g., "*.md")
15471    #[builder(setter(into, strip_option), default)]
15472    pub globs: Option<Vec<&'a str>>,
15473    /// Enable case-insensitive matching.
15474    #[builder(setter(into, strip_option), default)]
15475    pub insensitive: Option<bool>,
15476    /// Limit the number of results to return
15477    #[builder(setter(into, strip_option), default)]
15478    pub limit: Option<isize>,
15479    /// Interpret the pattern as a literal string instead of a regular expression.
15480    #[builder(setter(into, strip_option), default)]
15481    pub literal: Option<bool>,
15482    /// Enable searching across multiple lines.
15483    #[builder(setter(into, strip_option), default)]
15484    pub multiline: Option<bool>,
15485    /// Directory or file paths to search
15486    #[builder(setter(into, strip_option), default)]
15487    pub paths: Option<Vec<&'a str>>,
15488    /// Skip hidden files (files starting with .).
15489    #[builder(setter(into, strip_option), default)]
15490    pub skip_hidden: Option<bool>,
15491    /// Honor .gitignore, .ignore, and .rgignore files.
15492    #[builder(setter(into, strip_option), default)]
15493    pub skip_ignored: Option<bool>,
15494}
15495#[derive(Builder, Debug, PartialEq)]
15496pub struct WorkspaceServicesOpts<'a> {
15497    /// Only include services matching the specified patterns
15498    #[builder(setter(into, strip_option), default)]
15499    pub include: Option<Vec<&'a str>>,
15500}
15501#[derive(Builder, Debug, PartialEq)]
15502pub struct WorkspaceTerminalsOpts<'a> {
15503    /// Only include terminal targets matching the specified patterns
15504    #[builder(setter(into, strip_option), default)]
15505    pub include: Option<Vec<&'a str>>,
15506}
15507#[derive(Builder, Debug, PartialEq)]
15508pub struct WorkspaceWithClientOpts<'a> {
15509    /// Optional SDK name. Inspect all installed SDKs when omitted.
15510    #[builder(setter(into, strip_option), default)]
15511    pub sdk: Option<&'a str>,
15512    /// Explicit SDK-module constructor setting overrides for this scope. Requires an explicit SDK name.
15513    #[builder(setter(into, strip_option), default)]
15514    pub settings: Option<Json>,
15515}
15516#[derive(Builder, Debug, PartialEq)]
15517pub struct WorkspaceWithConfigEnvOpts {
15518    /// Write to the workspace config directory at the workspace cwd.
15519    #[builder(setter(into, strip_option), default)]
15520    pub here: Option<bool>,
15521}
15522#[derive(Builder, Debug, PartialEq)]
15523pub struct WorkspaceWithConfigValueOpts<'a> {
15524    /// Write to the workspace config directory at the workspace cwd.
15525    #[builder(setter(into, strip_option), default)]
15526    pub here: Option<bool>,
15527    /// List value to set. Elements are stored verbatim, with no auto-detection. Mutually exclusive with value.
15528    #[builder(setter(into, strip_option), default)]
15529    pub values: Option<Vec<&'a str>>,
15530}
15531#[derive(Builder, Debug, PartialEq)]
15532pub struct WorkspaceWithFileOpts {
15533    /// Permissions of the added file. Defaults to the source file permissions.
15534    #[builder(setter(into, strip_option), default)]
15535    pub permissions: Option<isize>,
15536}
15537#[derive(Builder, Debug, PartialEq)]
15538pub struct WorkspaceWithInitModuleOpts<'a> {
15539    /// 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.
15540    #[builder(setter(into, strip_option), default)]
15541    pub entrypoint: Option<bool>,
15542    /// Install the module. When omitted, install only if path is omitted.
15543    #[builder(setter(into, strip_option), default)]
15544    pub install: Option<bool>,
15545    /// Module name. The engine infers it from path, the active config file, or the workspace root when omitted.
15546    #[builder(setter(into, strip_option), default)]
15547    pub name: Option<&'a str>,
15548    /// Module path relative to the workspace cwd, or an absolute workspace path. Defaults to .dagger/modules/<name> beside the active workspace config.
15549    #[builder(setter(into, strip_option), default)]
15550    pub path: Option<&'a str>,
15551    /// Explicit SDK-module constructor setting overrides for this scope.
15552    #[builder(setter(into, strip_option), default)]
15553    pub settings: Option<Json>,
15554}
15555#[derive(Builder, Debug, PartialEq)]
15556pub struct WorkspaceWithModuleOpts<'a> {
15557    /// Write to the workspace config directory at the workspace cwd.
15558    #[builder(setter(into, strip_option), default)]
15559    pub here: Option<bool>,
15560    /// Override name for the installed module entry.
15561    #[builder(setter(into, strip_option), default)]
15562    pub name: Option<&'a str>,
15563}
15564#[derive(Builder, Debug, PartialEq)]
15565pub struct WorkspaceWithNewFileOpts {
15566    /// Permissions of the new file.
15567    #[builder(setter(into, strip_option), default)]
15568    pub permissions: Option<isize>,
15569}
15570#[derive(Builder, Debug, PartialEq)]
15571pub struct WorkspaceWithSdkOpts<'a> {
15572    /// Optional override for the SDK name conventionally derived from the installed module name.
15573    #[builder(setter(into, strip_option), default)]
15574    pub as_sdk_name: Option<&'a str>,
15575    /// Write to the workspace config directory at the workspace cwd.
15576    #[builder(setter(into, strip_option), default)]
15577    pub here: Option<bool>,
15578    /// Override name for the installed SDK entry.
15579    #[builder(setter(into, strip_option), default)]
15580    pub name: Option<&'a str>,
15581}
15582#[derive(Builder, Debug, PartialEq)]
15583pub struct WorkspaceWithUpdatedClientsOpts<'a> {
15584    /// Select clients in every scope instead of only the scopes containing the workspace cwd.
15585    #[builder(setter(into, strip_option), default)]
15586    pub all: Option<bool>,
15587    /// Recorded client targets to update. All targets in the selected scopes are updated when omitted.
15588    #[builder(setter(into, strip_option), default)]
15589    pub modules: Option<Vec<&'a str>>,
15590    /// Optional SDK name. All installed SDK modules are selected when omitted.
15591    #[builder(setter(into, strip_option), default)]
15592    pub sdk: Option<&'a str>,
15593}
15594#[derive(Builder, Debug, PartialEq)]
15595pub struct WorkspaceWithUpdatedLockOpts {
15596    /// Do not regenerate SDK client scopes.
15597    #[builder(setter(into, strip_option), default)]
15598    pub no_generate: Option<bool>,
15599}
15600#[derive(Builder, Debug, PartialEq)]
15601pub struct WorkspaceWithUpdatedModulesOpts<'a> {
15602    /// Installed module names or sources. A version suffix sets a new request. An empty list refreshes all installed modules.
15603    #[builder(setter(into, strip_option), default)]
15604    pub names: Option<Vec<&'a str>>,
15605    /// New version request for exactly one selected module. Cannot be combined with a version suffix.
15606    #[builder(setter(into, strip_option), default)]
15607    pub version: Option<&'a str>,
15608}
15609#[derive(Builder, Debug, PartialEq)]
15610pub struct WorkspaceWithoutClientOpts<'a> {
15611    /// Optional SDK name. Search all installed SDKs when omitted.
15612    #[builder(setter(into, strip_option), default)]
15613    pub sdk: Option<&'a str>,
15614}
15615#[derive(Builder, Debug, PartialEq)]
15616pub struct WorkspaceWithoutConfigEnvOpts {
15617    /// Write to the workspace config directory at the workspace cwd.
15618    #[builder(setter(into, strip_option), default)]
15619    pub here: Option<bool>,
15620}
15621#[derive(Builder, Debug, PartialEq)]
15622pub struct WorkspaceWithoutConfigValueOpts {
15623    /// Write to the workspace config directory at the workspace cwd.
15624    #[builder(setter(into, strip_option), default)]
15625    pub here: Option<bool>,
15626}
15627#[derive(Builder, Debug, PartialEq)]
15628pub struct WorkspaceWithoutModuleOpts {
15629    /// Write to the workspace config directory at the workspace cwd.
15630    #[builder(setter(into, strip_option), default)]
15631    pub here: Option<bool>,
15632}
15633#[derive(Builder, Debug, PartialEq)]
15634pub struct WorkspaceWithoutSdkOpts {
15635    /// Write to the workspace config directory at the workspace cwd.
15636    #[builder(setter(into, strip_option), default)]
15637    pub here: Option<bool>,
15638}
15639impl IntoID<Id> for Workspace {
15640    fn into_id(
15641        self,
15642    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15643        Box::pin(async move { self.id().await })
15644    }
15645}
15646impl Loadable for Workspace {
15647    fn graphql_type() -> &'static str {
15648        "Workspace"
15649    }
15650    fn from_query(
15651        proc: Option<Arc<DaggerSessionProc>>,
15652        selection: Selection,
15653        graphql_client: DynGraphQLClient,
15654    ) -> Self {
15655        Self {
15656            proc,
15657            selection,
15658            graphql_client,
15659        }
15660    }
15661}
15662impl Workspace {
15663    /// Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
15664    pub async fn address(&self) -> Result<String, DaggerError> {
15665        let query = self.selection.select("address");
15666        query.execute(self.graphql_client.clone()).await
15667    }
15668    /// Return all agent middlewares from modules loaded in the workspace.
15669    ///
15670    /// # Arguments
15671    ///
15672    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15673    pub fn agents(&self) -> AgentGroup {
15674        let query = self.selection.select("agents");
15675        AgentGroup {
15676            proc: self.proc.clone(),
15677            selection: query,
15678            graphql_client: self.graphql_client.clone(),
15679        }
15680    }
15681    /// Return all agent middlewares from modules loaded in the workspace.
15682    ///
15683    /// # Arguments
15684    ///
15685    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15686    pub fn agents_opts<'a>(&self, opts: WorkspaceAgentsOpts<'a>) -> AgentGroup {
15687        let mut query = self.selection.select("agents");
15688        if let Some(include) = opts.include {
15689            query = query.arg("include", include);
15690        }
15691        AgentGroup {
15692            proc: self.proc.clone(),
15693            selection: query,
15694            graphql_client: self.graphql_client.clone(),
15695        }
15696    }
15697    /// Return this workspace's changes, with paths relative to its working directory.
15698    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
15699    ///
15700    /// # Arguments
15701    ///
15702    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15703    pub fn changes(&self) -> Changeset {
15704        let query = self.selection.select("changes");
15705        Changeset {
15706            proc: self.proc.clone(),
15707            selection: query,
15708            graphql_client: self.graphql_client.clone(),
15709        }
15710    }
15711    /// Return this workspace's changes, with paths relative to its working directory.
15712    /// Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
15713    ///
15714    /// # Arguments
15715    ///
15716    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15717    pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
15718        let mut query = self.selection.select("changes");
15719        if let Some(from) = opts.from {
15720            query = query.arg("from", from);
15721        }
15722        Changeset {
15723            proc: self.proc.clone(),
15724            selection: query,
15725            graphql_client: self.graphql_client.clone(),
15726        }
15727    }
15728    /// Return all checks from modules loaded in the workspace.
15729    ///
15730    /// # Arguments
15731    ///
15732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15733    pub fn checks(&self) -> CheckGroup {
15734        let query = self.selection.select("checks");
15735        CheckGroup {
15736            proc: self.proc.clone(),
15737            selection: query,
15738            graphql_client: self.graphql_client.clone(),
15739        }
15740    }
15741    /// Return all checks from modules loaded in the workspace.
15742    ///
15743    /// # Arguments
15744    ///
15745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15746    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
15747        let mut query = self.selection.select("checks");
15748        if let Some(include) = opts.include {
15749            query = query.arg("include", include);
15750        }
15751        if let Some(skip) = opts.skip {
15752            query = query.arg("skip", skip);
15753        }
15754        if let Some(no_generate) = opts.no_generate {
15755            query = query.arg("noGenerate", no_generate);
15756        }
15757        if let Some(only_generate) = opts.only_generate {
15758            query = query.arg("onlyGenerate", only_generate);
15759        }
15760        CheckGroup {
15761            proc: self.proc.clone(),
15762            selection: query,
15763            graphql_client: self.graphql_client.clone(),
15764        }
15765    }
15766    /// Selected native workspace config file relative to the workspace cwd, if any.
15767    pub async fn config_file(&self) -> Result<String, DaggerError> {
15768        let query = self.selection.select("configFile");
15769        query.execute(self.graphql_client.clone()).await
15770    }
15771    /// Read a configuration value from dagger.toml.
15772    /// If key is empty, returns the full config.
15773    /// If key points to a scalar, returns the value.
15774    /// If key points to a table, returns flattened dotted-key output.
15775    ///
15776    /// # Arguments
15777    ///
15778    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15779    pub async fn config_read(&self) -> Result<String, DaggerError> {
15780        let query = self.selection.select("configRead");
15781        query.execute(self.graphql_client.clone()).await
15782    }
15783    /// Read a configuration value from dagger.toml.
15784    /// If key is empty, returns the full config.
15785    /// If key points to a scalar, returns the value.
15786    /// If key points to a table, returns flattened dotted-key output.
15787    ///
15788    /// # Arguments
15789    ///
15790    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15791    pub async fn config_read_opts<'a>(
15792        &self,
15793        opts: WorkspaceConfigReadOpts<'a>,
15794    ) -> Result<String, DaggerError> {
15795        let mut query = self.selection.select("configRead");
15796        if let Some(key) = opts.key {
15797            query = query.arg("key", key);
15798        }
15799        query.execute(self.graphql_client.clone()).await
15800    }
15801    /// Current location within the workspace root.
15802    /// The workspace root is returned as "/".
15803    /// Relative paths in workspace APIs resolve from here.
15804    pub async fn cwd(&self) -> Result<String, DaggerError> {
15805        let query = self.selection.select("cwd");
15806        query.execute(self.graphql_client.clone()).await
15807    }
15808    /// Return the selected SDK module's current scope at this workspace location.
15809    ///
15810    /// # Arguments
15811    ///
15812    /// * `sdk` - SDK name to probe. Required.
15813    pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
15814        let mut query = self.selection.select("detectScope");
15815        query = query.arg("sdk", sdk.into());
15816        query.execute(self.graphql_client.clone()).await
15817    }
15818    /// Returns a Directory from the workspace.
15819    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
15820    ///
15821    /// # Arguments
15822    ///
15823    /// * `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.
15824    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15825    pub fn directory(&self, path: impl Into<String>) -> Directory {
15826        let mut query = self.selection.select("directory");
15827        query = query.arg("path", path.into());
15828        Directory {
15829            proc: self.proc.clone(),
15830            selection: query,
15831            graphql_client: self.graphql_client.clone(),
15832        }
15833    }
15834    /// Returns a Directory from the workspace.
15835    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
15836    ///
15837    /// # Arguments
15838    ///
15839    /// * `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.
15840    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15841    pub fn directory_opts<'a>(
15842        &self,
15843        path: impl Into<String>,
15844        opts: WorkspaceDirectoryOpts<'a>,
15845    ) -> Directory {
15846        let mut query = self.selection.select("directory");
15847        query = query.arg("path", path.into());
15848        if let Some(exclude) = opts.exclude {
15849            query = query.arg("exclude", exclude);
15850        }
15851        if let Some(include) = opts.include {
15852            query = query.arg("include", include);
15853        }
15854        if let Some(gitignore) = opts.gitignore {
15855            query = query.arg("gitignore", gitignore);
15856        }
15857        Directory {
15858            proc: self.proc.clone(),
15859            selection: query,
15860            graphql_client: self.graphql_client.clone(),
15861        }
15862    }
15863    /// Installed name of the module selected as the workspace entrypoint, or an empty string when none is selected.
15864    /// Reflects the selected env's effective view. Fails if several modules are selected.
15865    pub async fn entrypoint(&self) -> Result<String, DaggerError> {
15866        let query = self.selection.select("entrypoint");
15867        query.execute(self.graphql_client.clone()).await
15868    }
15869    /// List named environments defined in the workspace configuration.
15870    pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
15871        let query = self.selection.select("envList");
15872        query.execute(self.graphql_client.clone()).await
15873    }
15874    /// Write this workspace's pending changes to its local Git workspace on the current client's host.
15875    /// Like Directory.export, the write is a side effect on the client that makes the call — never on the client that created the workspace. Inside a module, this cannot reach the caller's host.
15876    pub async fn export(&self) -> Result<Void, DaggerError> {
15877        let query = self.selection.select("export");
15878        query.execute(self.graphql_client.clone()).await
15879    }
15880    /// Returns a File from the workspace.
15881    /// Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
15882    ///
15883    /// # Arguments
15884    ///
15885    /// * `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.
15886    pub fn file(&self, path: impl Into<String>) -> File {
15887        let mut query = self.selection.select("file");
15888        query = query.arg("path", path.into());
15889        File {
15890            proc: self.proc.clone(),
15891            selection: query,
15892            graphql_client: self.graphql_client.clone(),
15893        }
15894    }
15895    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
15896    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
15897    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
15898    ///
15899    /// # Arguments
15900    ///
15901    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
15902    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15903    pub async fn find_roots(
15904        &self,
15905        markers: Vec<impl Into<String>>,
15906    ) -> Result<Vec<String>, DaggerError> {
15907        let mut query = self.selection.select("findRoots");
15908        query = query.arg(
15909            "markers",
15910            markers
15911                .into_iter()
15912                .map(|i| i.into())
15913                .collect::<Vec<String>>(),
15914        );
15915        query.execute(self.graphql_client.clone()).await
15916    }
15917    /// Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd.
15918    /// Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked.
15919    /// Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
15920    ///
15921    /// # Arguments
15922    ///
15923    /// * `markers` - File basenames that mark a project root (e.g. ["go.mod"] or ["deno.json", "deno.jsonc"]).
15924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15925    pub async fn find_roots_opts<'a>(
15926        &self,
15927        markers: Vec<impl Into<String>>,
15928        opts: WorkspaceFindRootsOpts<'a>,
15929    ) -> Result<Vec<String>, DaggerError> {
15930        let mut query = self.selection.select("findRoots");
15931        query = query.arg(
15932            "markers",
15933            markers
15934                .into_iter()
15935                .map(|i| i.into())
15936                .collect::<Vec<String>>(),
15937        );
15938        if let Some(start) = opts.start {
15939            query = query.arg("start", start);
15940        }
15941        if let Some(exclude) = opts.exclude {
15942            query = query.arg("exclude", exclude);
15943        }
15944        query.execute(self.graphql_client.clone()).await
15945    }
15946    /// Search for a file or directory by walking up from the start path within the workspace.
15947    /// Returns the absolute workspace path if found, or null if not found.
15948    /// Relative start paths resolve from the workspace cwd.
15949    /// The search stops at the workspace root and will not traverse above it.
15950    ///
15951    /// # Arguments
15952    ///
15953    /// * `name` - The name of the file or directory to search for.
15954    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15955    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
15956        let mut query = self.selection.select("findUp");
15957        query = query.arg("name", name.into());
15958        query.execute(self.graphql_client.clone()).await
15959    }
15960    /// Search for a file or directory by walking up from the start path within the workspace.
15961    /// Returns the absolute workspace path if found, or null if not found.
15962    /// Relative start paths resolve from the workspace cwd.
15963    /// The search stops at the workspace root and will not traverse above it.
15964    ///
15965    /// # Arguments
15966    ///
15967    /// * `name` - The name of the file or directory to search for.
15968    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15969    pub async fn find_up_opts<'a>(
15970        &self,
15971        name: impl Into<String>,
15972        opts: WorkspaceFindUpOpts<'a>,
15973    ) -> Result<String, DaggerError> {
15974        let mut query = self.selection.select("findUp");
15975        query = query.arg("name", name.into());
15976        if let Some(from) = opts.from {
15977            query = query.arg("from", from);
15978        }
15979        query.execute(self.graphql_client.clone()).await
15980    }
15981    /// Return all generators from modules loaded in the workspace.
15982    ///
15983    /// # Arguments
15984    ///
15985    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15986    pub fn generators(&self) -> GeneratorGroup {
15987        let query = self.selection.select("generators");
15988        GeneratorGroup {
15989            proc: self.proc.clone(),
15990            selection: query,
15991            graphql_client: self.graphql_client.clone(),
15992        }
15993    }
15994    /// Return all generators from modules loaded in the workspace.
15995    ///
15996    /// # Arguments
15997    ///
15998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15999    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16000        let mut query = self.selection.select("generators");
16001        if let Some(include) = opts.include {
16002            query = query.arg("include", include);
16003        }
16004        GeneratorGroup {
16005            proc: self.proc.clone(),
16006            selection: query,
16007            graphql_client: self.graphql_client.clone(),
16008        }
16009    }
16010    /// Git state for this workspace. Errors if the workspace is not in a git repository.
16011    pub fn git(&self) -> WorkspaceGit {
16012        let query = self.selection.select("git");
16013        WorkspaceGit {
16014            proc: self.proc.clone(),
16015            selection: query,
16016            graphql_client: self.graphql_client.clone(),
16017        }
16018    }
16019    /// Returns a list of files and directories that match the given pattern.
16020    /// Patterns match paths relative to the workspace root.
16021    ///
16022    /// # Arguments
16023    ///
16024    /// * `pattern` - Pattern to match (e.g., "*.md").
16025    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
16026        let mut query = self.selection.select("glob");
16027        query = query.arg("pattern", pattern.into());
16028        query.execute(self.graphql_client.clone()).await
16029    }
16030    /// A unique identifier for this Workspace.
16031    pub async fn id(&self) -> Result<Id, DaggerError> {
16032        let query = self.selection.select("id");
16033        query.execute(self.graphql_client.clone()).await
16034    }
16035    /// Plan the explicit migration needed for the current workspace.
16036    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
16037    /// The returned plan has an empty changeset and no steps when no migration is needed.
16038    ///
16039    /// # Arguments
16040    ///
16041    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16042    pub fn migrate(&self) -> WorkspaceMigration {
16043        let query = self.selection.select("migrate");
16044        WorkspaceMigration {
16045            proc: self.proc.clone(),
16046            selection: query,
16047            graphql_client: self.graphql_client.clone(),
16048        }
16049    }
16050    /// Plan the explicit migration needed for the current workspace.
16051    /// Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected.
16052    /// The returned plan has an empty changeset and no steps when no migration is needed.
16053    ///
16054    /// # Arguments
16055    ///
16056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16057    pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
16058        let mut query = self.selection.select("migrate");
16059        if let Some(modules) = opts.modules {
16060            query = query.arg("modules", modules);
16061        }
16062        WorkspaceMigration {
16063            proc: self.proc.clone(),
16064            selection: query,
16065            graphql_client: self.graphql_client.clone(),
16066        }
16067    }
16068    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
16069    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
16070    ///
16071    /// # Arguments
16072    ///
16073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16074    pub fn migrate_module(&self) -> WorkspaceMigration {
16075        let query = self.selection.select("migrateModule");
16076        WorkspaceMigration {
16077            proc: self.proc.clone(),
16078            selection: query,
16079            graphql_client: self.graphql_client.clone(),
16080        }
16081    }
16082    /// Plan migration of one local module without migrating its dependencies or creating a workspace configuration.
16083    /// Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
16084    ///
16085    /// # Arguments
16086    ///
16087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16088    pub fn migrate_module_opts<'a>(
16089        &self,
16090        opts: WorkspaceMigrateModuleOpts<'a>,
16091    ) -> WorkspaceMigration {
16092        let mut query = self.selection.select("migrateModule");
16093        if let Some(path) = opts.path {
16094            query = query.arg("path", path);
16095        }
16096        WorkspaceMigration {
16097            proc: self.proc.clone(),
16098            selection: query,
16099            graphql_client: self.graphql_client.clone(),
16100        }
16101    }
16102    /// Return a module defined in the workspace configuration.
16103    /// Reflects the selected env's effective view.
16104    ///
16105    /// # Arguments
16106    ///
16107    /// * `name` - Module name to inspect.
16108    pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
16109        let mut query = self.selection.select("module");
16110        query = query.arg("name", name.into());
16111        WorkspaceModule {
16112            proc: self.proc.clone(),
16113            selection: query,
16114            graphql_client: self.graphql_client.clone(),
16115        }
16116    }
16117    /// Load a module source from a path within the workspace.
16118    /// Relative paths (e.g., "foo") resolve from the workspace cwd; absolute paths (e.g., "/foo") resolve from the workspace root.
16119    /// Fails if the path does not point to an initialized module.
16120    ///
16121    /// # Arguments
16122    ///
16123    /// * `path` - Location of the module source to load, relative to the workspace cwd or absolute from the workspace root.
16124    pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
16125        let mut query = self.selection.select("moduleSource");
16126        query = query.arg("path", path.into());
16127        ModuleSource {
16128            proc: self.proc.clone(),
16129            selection: query,
16130            graphql_client: self.graphql_client.clone(),
16131        }
16132    }
16133    /// List modules defined in the workspace configuration.
16134    /// Reflects the selected env's effective view.
16135    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
16136        let query = self.selection.select("modules");
16137        let query = query.select("id");
16138        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16139        Ok(ids
16140            .into_iter()
16141            .map(|id| WorkspaceModule {
16142                proc: self.proc.clone(),
16143                selection: crate::querybuilder::query()
16144                    .select("node")
16145                    .arg("id", &id.0)
16146                    .inline_fragment("WorkspaceModule"),
16147                graphql_client: self.graphql_client.clone(),
16148            })
16149            .collect())
16150    }
16151    /// Return this workspace with its cached host reads invalidated, so subsequent file and directory reads re-read the live host instead of a snapshot cached earlier in the session.
16152    pub fn reloaded(&self) -> Workspace {
16153        let query = self.selection.select("reloaded");
16154        Workspace {
16155            proc: self.proc.clone(),
16156            selection: query,
16157            graphql_client: self.graphql_client.clone(),
16158        }
16159    }
16160    /// An installed SDK, by name.
16161    ///
16162    /// # Arguments
16163    ///
16164    /// * `name` - SDK name to look up.
16165    pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
16166        let mut query = self.selection.select("sdk");
16167        query = query.arg("name", name.into());
16168        WorkspaceSdk {
16169            proc: self.proc.clone(),
16170            selection: query,
16171            graphql_client: self.graphql_client.clone(),
16172        }
16173    }
16174    /// Installed SDKs.
16175    pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
16176        let query = self.selection.select("sdks");
16177        let query = query.select("id");
16178        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16179        Ok(ids
16180            .into_iter()
16181            .map(|id| WorkspaceSdk {
16182                proc: self.proc.clone(),
16183                selection: crate::querybuilder::query()
16184                    .select("node")
16185                    .arg("id", &id.0)
16186                    .inline_fragment("WorkspaceSDK"),
16187                graphql_client: self.graphql_client.clone(),
16188            })
16189            .collect())
16190    }
16191    /// Searches for content matching the given regular expression or literal string.
16192    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
16193    /// Runs ripgrep on the client host, falling back to grep if unavailable.
16194    ///
16195    /// # Arguments
16196    ///
16197    /// * `pattern` - The text to match.
16198    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16199    pub async fn search(
16200        &self,
16201        pattern: impl Into<String>,
16202    ) -> Result<Vec<SearchResult>, DaggerError> {
16203        let mut query = self.selection.select("search");
16204        query = query.arg("pattern", pattern.into());
16205        let query = query.select("id");
16206        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16207        Ok(ids
16208            .into_iter()
16209            .map(|id| SearchResult {
16210                proc: self.proc.clone(),
16211                selection: crate::querybuilder::query()
16212                    .select("node")
16213                    .arg("id", &id.0)
16214                    .inline_fragment("SearchResult"),
16215                graphql_client: self.graphql_client.clone(),
16216            })
16217            .collect())
16218    }
16219    /// Searches for content matching the given regular expression or literal string.
16220    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
16221    /// Runs ripgrep on the client host, falling back to grep if unavailable.
16222    ///
16223    /// # Arguments
16224    ///
16225    /// * `pattern` - The text to match.
16226    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16227    pub async fn search_opts<'a>(
16228        &self,
16229        pattern: impl Into<String>,
16230        opts: WorkspaceSearchOpts<'a>,
16231    ) -> Result<Vec<SearchResult>, DaggerError> {
16232        let mut query = self.selection.select("search");
16233        query = query.arg("pattern", pattern.into());
16234        if let Some(paths) = opts.paths {
16235            query = query.arg("paths", paths);
16236        }
16237        if let Some(globs) = opts.globs {
16238            query = query.arg("globs", globs);
16239        }
16240        if let Some(literal) = opts.literal {
16241            query = query.arg("literal", literal);
16242        }
16243        if let Some(multiline) = opts.multiline {
16244            query = query.arg("multiline", multiline);
16245        }
16246        if let Some(dotall) = opts.dotall {
16247            query = query.arg("dotall", dotall);
16248        }
16249        if let Some(insensitive) = opts.insensitive {
16250            query = query.arg("insensitive", insensitive);
16251        }
16252        if let Some(skip_ignored) = opts.skip_ignored {
16253            query = query.arg("skipIgnored", skip_ignored);
16254        }
16255        if let Some(skip_hidden) = opts.skip_hidden {
16256            query = query.arg("skipHidden", skip_hidden);
16257        }
16258        if let Some(files_only) = opts.files_only {
16259            query = query.arg("filesOnly", files_only);
16260        }
16261        if let Some(limit) = opts.limit {
16262            query = query.arg("limit", limit);
16263        }
16264        let query = query.select("id");
16265        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16266        Ok(ids
16267            .into_iter()
16268            .map(|id| SearchResult {
16269                proc: self.proc.clone(),
16270                selection: crate::querybuilder::query()
16271                    .select("node")
16272                    .arg("id", &id.0)
16273                    .inline_fragment("SearchResult"),
16274                graphql_client: self.graphql_client.clone(),
16275            })
16276            .collect())
16277    }
16278    /// Return all services from modules loaded in the workspace.
16279    ///
16280    /// # Arguments
16281    ///
16282    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16283    pub fn services(&self) -> UpGroup {
16284        let query = self.selection.select("services");
16285        UpGroup {
16286            proc: self.proc.clone(),
16287            selection: query,
16288            graphql_client: self.graphql_client.clone(),
16289        }
16290    }
16291    /// Return all services from modules loaded in the workspace.
16292    ///
16293    /// # Arguments
16294    ///
16295    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16296    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16297        let mut query = self.selection.select("services");
16298        if let Some(include) = opts.include {
16299            query = query.arg("include", include);
16300        }
16301        UpGroup {
16302            proc: self.proc.clone(),
16303            selection: query,
16304            graphql_client: self.graphql_client.clone(),
16305        }
16306    }
16307    /// Return all terminal targets from modules loaded in the workspace.
16308    ///
16309    /// # Arguments
16310    ///
16311    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16312    pub fn terminals(&self) -> TerminalGroup {
16313        let query = self.selection.select("terminals");
16314        TerminalGroup {
16315            proc: self.proc.clone(),
16316            selection: query,
16317            graphql_client: self.graphql_client.clone(),
16318        }
16319    }
16320    /// Return all terminal targets from modules loaded in the workspace.
16321    ///
16322    /// # Arguments
16323    ///
16324    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16325    pub fn terminals_opts<'a>(&self, opts: WorkspaceTerminalsOpts<'a>) -> TerminalGroup {
16326        let mut query = self.selection.select("terminals");
16327        if let Some(include) = opts.include {
16328            query = query.arg("include", include);
16329        }
16330        TerminalGroup {
16331            proc: self.proc.clone(),
16332            selection: query,
16333            graphql_client: self.graphql_client.clone(),
16334        }
16335    }
16336    /// Return this workspace with a changeset applied, without mutating the source.
16337    ///
16338    /// # Arguments
16339    ///
16340    /// * `changes` - Changes to apply.
16341    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
16342        let mut query = self.selection.select("withChanges");
16343        query = query.arg_lazy(
16344            "changes",
16345            Box::new(move || {
16346                let changes = changes.clone();
16347                Box::pin(async move { changes.into_id().await.unwrap().quote() })
16348            }),
16349        );
16350        Workspace {
16351            proc: self.proc.clone(),
16352            selection: query,
16353            graphql_client: self.graphql_client.clone(),
16354        }
16355    }
16356    /// Return this workspace with a generated module client added to one SDK scope.
16357    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
16358    ///
16359    /// # Arguments
16360    ///
16361    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
16362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16363    pub fn with_client(&self, module: impl Into<String>) -> Workspace {
16364        let mut query = self.selection.select("withClient");
16365        query = query.arg("module", module.into());
16366        Workspace {
16367            proc: self.proc.clone(),
16368            selection: query,
16369            graphql_client: self.graphql_client.clone(),
16370        }
16371    }
16372    /// Return this workspace with a generated module client added to one SDK scope.
16373    /// Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
16374    ///
16375    /// # Arguments
16376    ///
16377    /// * `module` - Explicit local path or module address to generate a client for. Installed module names are not supported.
16378    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16379    pub fn with_client_opts<'a>(
16380        &self,
16381        module: impl Into<String>,
16382        opts: WorkspaceWithClientOpts<'a>,
16383    ) -> Workspace {
16384        let mut query = self.selection.select("withClient");
16385        query = query.arg("module", module.into());
16386        if let Some(sdk) = opts.sdk {
16387            query = query.arg("sdk", sdk);
16388        }
16389        if let Some(settings) = opts.settings {
16390            query = query.arg("settings", settings);
16391        }
16392        Workspace {
16393            proc: self.proc.clone(),
16394            selection: query,
16395            graphql_client: self.graphql_client.clone(),
16396        }
16397    }
16398    /// Return this workspace with a named config environment created.
16399    ///
16400    /// # Arguments
16401    ///
16402    /// * `name` - Environment name.
16403    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16404    pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
16405        let mut query = self.selection.select("withConfigEnv");
16406        query = query.arg("name", name.into());
16407        Workspace {
16408            proc: self.proc.clone(),
16409            selection: query,
16410            graphql_client: self.graphql_client.clone(),
16411        }
16412    }
16413    /// Return this workspace with a named config environment created.
16414    ///
16415    /// # Arguments
16416    ///
16417    /// * `name` - Environment name.
16418    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16419    pub fn with_config_env_opts(
16420        &self,
16421        name: impl Into<String>,
16422        opts: WorkspaceWithConfigEnvOpts,
16423    ) -> Workspace {
16424        let mut query = self.selection.select("withConfigEnv");
16425        query = query.arg("name", name.into());
16426        if let Some(here) = opts.here {
16427            query = query.arg("here", here);
16428        }
16429        Workspace {
16430            proc: self.proc.clone(),
16431            selection: query,
16432            graphql_client: self.graphql_client.clone(),
16433        }
16434    }
16435    /// Return this workspace with a configuration value written.
16436    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
16437    ///
16438    /// # Arguments
16439    ///
16440    /// * `key` - Dotted key path.
16441    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
16442    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16443    pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
16444        let mut query = self.selection.select("withConfigValue");
16445        query = query.arg("key", key.into());
16446        query = query.arg("value", value.into());
16447        Workspace {
16448            proc: self.proc.clone(),
16449            selection: query,
16450            graphql_client: self.graphql_client.clone(),
16451        }
16452    }
16453    /// Return this workspace with a configuration value written.
16454    /// When the session selects an env, the key is scoped to that env's overlay and the env is created if missing.
16455    ///
16456    /// # Arguments
16457    ///
16458    /// * `key` - Dotted key path.
16459    /// * `value` - Value to set. Bools, integers, and comma-separated arrays are auto-detected.
16460    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16461    pub fn with_config_value_opts<'a>(
16462        &self,
16463        key: impl Into<String>,
16464        value: impl Into<String>,
16465        opts: WorkspaceWithConfigValueOpts<'a>,
16466    ) -> Workspace {
16467        let mut query = self.selection.select("withConfigValue");
16468        query = query.arg("key", key.into());
16469        query = query.arg("value", value.into());
16470        if let Some(values) = opts.values {
16471            query = query.arg("values", values);
16472        }
16473        if let Some(here) = opts.here {
16474            query = query.arg("here", here);
16475        }
16476        Workspace {
16477            proc: self.proc.clone(),
16478            selection: query,
16479            graphql_client: self.graphql_client.clone(),
16480        }
16481    }
16482    /// Return this workspace with a directory merged into the given path, without mutating the source.
16483    /// Anything already at the path stays, and files the source carries win, as with Directory.withDirectory. Use withNewDirectory to replace the path instead.
16484    ///
16485    /// # Arguments
16486    ///
16487    /// * `path` - Path to merge into. Relative paths resolve from the workspace cwd.
16488    /// * `source` - Directory to merge there.
16489    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
16490        let mut query = self.selection.select("withDirectory");
16491        query = query.arg("path", path.into());
16492        query = query.arg_lazy(
16493            "source",
16494            Box::new(move || {
16495                let source = source.clone();
16496                Box::pin(async move { source.into_id().await.unwrap().quote() })
16497            }),
16498        );
16499        Workspace {
16500            proc: self.proc.clone(),
16501            selection: query,
16502            graphql_client: self.graphql_client.clone(),
16503        }
16504    }
16505    /// Return this workspace with an installed module selected as its entrypoint.
16506    /// Every other entrypoint selection is cleared. Entrypoints live in the base workspace config.
16507    ///
16508    /// # Arguments
16509    ///
16510    /// * `name` - Exact installed module name.
16511    pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
16512        let mut query = self.selection.select("withEntrypoint");
16513        query = query.arg("name", name.into());
16514        Workspace {
16515            proc: self.proc.clone(),
16516            selection: query,
16517            graphql_client: self.graphql_client.clone(),
16518        }
16519    }
16520    /// Return this workspace with a file added or replaced, without mutating the source.
16521    ///
16522    /// # Arguments
16523    ///
16524    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
16525    /// * `source` - File to add.
16526    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16527    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
16528        let mut query = self.selection.select("withFile");
16529        query = query.arg("path", path.into());
16530        query = query.arg_lazy(
16531            "source",
16532            Box::new(move || {
16533                let source = source.clone();
16534                Box::pin(async move { source.into_id().await.unwrap().quote() })
16535            }),
16536        );
16537        Workspace {
16538            proc: self.proc.clone(),
16539            selection: query,
16540            graphql_client: self.graphql_client.clone(),
16541        }
16542    }
16543    /// Return this workspace with a file added or replaced, without mutating the source.
16544    ///
16545    /// # Arguments
16546    ///
16547    /// * `path` - Destination path. Relative paths resolve from the workspace cwd.
16548    /// * `source` - File to add.
16549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16550    pub fn with_file_opts(
16551        &self,
16552        path: impl Into<String>,
16553        source: impl IntoID<Id>,
16554        opts: WorkspaceWithFileOpts,
16555    ) -> Workspace {
16556        let mut query = self.selection.select("withFile");
16557        query = query.arg("path", path.into());
16558        query = query.arg_lazy(
16559            "source",
16560            Box::new(move || {
16561                let source = source.clone();
16562                Box::pin(async move { source.into_id().await.unwrap().quote() })
16563            }),
16564        );
16565        if let Some(permissions) = opts.permissions {
16566            query = query.arg("permissions", permissions);
16567        }
16568        Workspace {
16569            proc: self.proc.clone(),
16570            selection: query,
16571            graphql_client: self.graphql_client.clone(),
16572        }
16573    }
16574    /// Return this workspace with a location initialized as a module scope.
16575    /// The selected SDK module records the scope and generates the module source.
16576    ///
16577    /// # Arguments
16578    ///
16579    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
16580    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16581    pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
16582        let mut query = self.selection.select("withInitModule");
16583        query = query.arg("sdk", sdk.into());
16584        Workspace {
16585            proc: self.proc.clone(),
16586            selection: query,
16587            graphql_client: self.graphql_client.clone(),
16588        }
16589    }
16590    /// Return this workspace with a location initialized as a module scope.
16591    /// The selected SDK module records the scope and generates the module source.
16592    ///
16593    /// # Arguments
16594    ///
16595    /// * `sdk` - Workspace SDK name or module entry name to use. Required.
16596    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16597    pub fn with_init_module_opts<'a>(
16598        &self,
16599        sdk: impl Into<String>,
16600        opts: WorkspaceWithInitModuleOpts<'a>,
16601    ) -> Workspace {
16602        let mut query = self.selection.select("withInitModule");
16603        query = query.arg("sdk", sdk.into());
16604        if let Some(name) = opts.name {
16605            query = query.arg("name", name);
16606        }
16607        if let Some(path) = opts.path {
16608            query = query.arg("path", path);
16609        }
16610        if let Some(install) = opts.install {
16611            query = query.arg("install", install);
16612        }
16613        if let Some(entrypoint) = opts.entrypoint {
16614            query = query.arg("entrypoint", entrypoint);
16615        }
16616        if let Some(settings) = opts.settings {
16617            query = query.arg("settings", settings);
16618        }
16619        Workspace {
16620            proc: self.proc.clone(),
16621            selection: query,
16622            graphql_client: self.graphql_client.clone(),
16623        }
16624    }
16625    /// Return this workspace with a native configuration, without changing an existing configuration.
16626    /// Fail if legacy configuration needs workspace migration.
16627    pub fn with_initialized(&self) -> Workspace {
16628        let query = self.selection.select("withInitialized");
16629        Workspace {
16630            proc: self.proc.clone(),
16631            selection: query,
16632            graphql_client: self.graphql_client.clone(),
16633        }
16634    }
16635    /// Return this workspace with a module installed in its config.
16636    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
16637    ///
16638    /// # Arguments
16639    ///
16640    /// * `r#ref` - Module reference to install.
16641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16642    pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
16643        let mut query = self.selection.select("withModule");
16644        query = query.arg("ref", r#ref.into());
16645        Workspace {
16646            proc: self.proc.clone(),
16647            selection: query,
16648            graphql_client: self.graphql_client.clone(),
16649        }
16650    }
16651    /// Return this workspace with a module installed in its config.
16652    /// When the session selects an env, the module is recorded in that env's overlay and the env is created if missing.
16653    ///
16654    /// # Arguments
16655    ///
16656    /// * `r#ref` - Module reference to install.
16657    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16658    pub fn with_module_opts<'a>(
16659        &self,
16660        r#ref: impl Into<String>,
16661        opts: WorkspaceWithModuleOpts<'a>,
16662    ) -> Workspace {
16663        let mut query = self.selection.select("withModule");
16664        query = query.arg("ref", r#ref.into());
16665        if let Some(name) = opts.name {
16666            query = query.arg("name", name);
16667        }
16668        if let Some(here) = opts.here {
16669            query = query.arg("here", here);
16670        }
16671        Workspace {
16672            proc: self.proc.clone(),
16673            selection: query,
16674            graphql_client: self.graphql_client.clone(),
16675        }
16676    }
16677    /// Return this workspace with a directory mounted read-only at the given path, without mutating the source.
16678    /// 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.
16679    ///
16680    /// # Arguments
16681    ///
16682    /// * `path` - Location of the mounted directory. Relative paths resolve from the workspace cwd.
16683    /// * `source` - Directory to mount.
16684    pub fn with_mounted_directory(
16685        &self,
16686        path: impl Into<String>,
16687        source: impl IntoID<Id>,
16688    ) -> Workspace {
16689        let mut query = self.selection.select("withMountedDirectory");
16690        query = query.arg("path", path.into());
16691        query = query.arg_lazy(
16692            "source",
16693            Box::new(move || {
16694                let source = source.clone();
16695                Box::pin(async move { source.into_id().await.unwrap().quote() })
16696            }),
16697        );
16698        Workspace {
16699            proc: self.proc.clone(),
16700            selection: query,
16701            graphql_client: self.graphql_client.clone(),
16702        }
16703    }
16704    /// Return this workspace with a file mounted read-only at the given path, without mutating the source.
16705    /// 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.
16706    ///
16707    /// # Arguments
16708    ///
16709    /// * `path` - Location of the mounted file. Relative paths resolve from the workspace cwd.
16710    /// * `source` - File to mount.
16711    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
16712        let mut query = self.selection.select("withMountedFile");
16713        query = query.arg("path", path.into());
16714        query = query.arg_lazy(
16715            "source",
16716            Box::new(move || {
16717                let source = source.clone();
16718                Box::pin(async move { source.into_id().await.unwrap().quote() })
16719            }),
16720        );
16721        Workspace {
16722            proc: self.proc.clone(),
16723            selection: query,
16724            graphql_client: self.graphql_client.clone(),
16725        }
16726    }
16727    /// Return this workspace with the given path replaced by a directory, without mutating the source.
16728    /// 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.
16729    ///
16730    /// # Arguments
16731    ///
16732    /// * `path` - Path to replace. Relative paths resolve from the workspace cwd.
16733    /// * `source` - Directory to write there.
16734    pub fn with_new_directory(
16735        &self,
16736        path: impl Into<String>,
16737        source: impl IntoID<Id>,
16738    ) -> Workspace {
16739        let mut query = self.selection.select("withNewDirectory");
16740        query = query.arg("path", path.into());
16741        query = query.arg_lazy(
16742            "source",
16743            Box::new(move || {
16744                let source = source.clone();
16745                Box::pin(async move { source.into_id().await.unwrap().quote() })
16746            }),
16747        );
16748        Workspace {
16749            proc: self.proc.clone(),
16750            selection: query,
16751            graphql_client: self.graphql_client.clone(),
16752        }
16753    }
16754    /// Return this workspace with a new or replaced file, without mutating the source.
16755    ///
16756    /// # Arguments
16757    ///
16758    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
16759    /// * `contents` - Contents of the new file.
16760    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16761    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
16762        let mut query = self.selection.select("withNewFile");
16763        query = query.arg("path", path.into());
16764        query = query.arg("contents", contents.into());
16765        Workspace {
16766            proc: self.proc.clone(),
16767            selection: query,
16768            graphql_client: self.graphql_client.clone(),
16769        }
16770    }
16771    /// Return this workspace with a new or replaced file, without mutating the source.
16772    ///
16773    /// # Arguments
16774    ///
16775    /// * `path` - Path of the new file. Relative paths resolve from the workspace cwd.
16776    /// * `contents` - Contents of the new file.
16777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16778    pub fn with_new_file_opts(
16779        &self,
16780        path: impl Into<String>,
16781        contents: impl Into<String>,
16782        opts: WorkspaceWithNewFileOpts,
16783    ) -> Workspace {
16784        let mut query = self.selection.select("withNewFile");
16785        query = query.arg("path", path.into());
16786        query = query.arg("contents", contents.into());
16787        if let Some(permissions) = opts.permissions {
16788            query = query.arg("permissions", permissions);
16789        }
16790        Workspace {
16791            proc: self.proc.clone(),
16792            selection: query,
16793            graphql_client: self.graphql_client.clone(),
16794        }
16795    }
16796    /// Return this workspace with an SDK installed in its config.
16797    ///
16798    /// # Arguments
16799    ///
16800    /// * `r#ref` - SDK module reference to install.
16801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16802    pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
16803        let mut query = self.selection.select("withSDK");
16804        query = query.arg("ref", r#ref.into());
16805        Workspace {
16806            proc: self.proc.clone(),
16807            selection: query,
16808            graphql_client: self.graphql_client.clone(),
16809        }
16810    }
16811    /// Return this workspace with an SDK installed in its config.
16812    ///
16813    /// # Arguments
16814    ///
16815    /// * `r#ref` - SDK module reference to install.
16816    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16817    pub fn with_sdk_opts<'a>(
16818        &self,
16819        r#ref: impl Into<String>,
16820        opts: WorkspaceWithSdkOpts<'a>,
16821    ) -> Workspace {
16822        let mut query = self.selection.select("withSDK");
16823        query = query.arg("ref", r#ref.into());
16824        if let Some(name) = opts.name {
16825            query = query.arg("name", name);
16826        }
16827        if let Some(here) = opts.here {
16828            query = query.arg("here", here);
16829        }
16830        if let Some(as_sdk_name) = opts.as_sdk_name {
16831            query = query.arg("asSdkName", as_sdk_name);
16832        }
16833        Workspace {
16834            proc: self.proc.clone(),
16835            selection: query,
16836            graphql_client: self.graphql_client.clone(),
16837        }
16838    }
16839    /// Return this workspace with the selected module clients updated.
16840    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
16841    /// The selected SDK module then regenerates every scope that owns one of the targets.
16842    ///
16843    /// # Arguments
16844    ///
16845    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16846    pub fn with_updated_clients(&self) -> Workspace {
16847        let query = self.selection.select("withUpdatedClients");
16848        Workspace {
16849            proc: self.proc.clone(),
16850            selection: query,
16851            graphql_client: self.graphql_client.clone(),
16852        }
16853    }
16854    /// Return this workspace with the selected module clients updated.
16855    /// The engine re-reads the source of each selected client target and writes the lock entries that those targets reach.
16856    /// The selected SDK module then regenerates every scope that owns one of the targets.
16857    ///
16858    /// # Arguments
16859    ///
16860    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16861    pub fn with_updated_clients_opts<'a>(
16862        &self,
16863        opts: WorkspaceWithUpdatedClientsOpts<'a>,
16864    ) -> Workspace {
16865        let mut query = self.selection.select("withUpdatedClients");
16866        if let Some(modules) = opts.modules {
16867            query = query.arg("modules", modules);
16868        }
16869        if let Some(all) = opts.all {
16870            query = query.arg("all", all);
16871        }
16872        if let Some(sdk) = opts.sdk {
16873            query = query.arg("sdk", sdk);
16874        }
16875        Workspace {
16876            proc: self.proc.clone(),
16877            selection: query,
16878            graphql_client: self.graphql_client.clone(),
16879        }
16880    }
16881    /// Return this workspace with refreshed lockfile state.
16882    /// SDK client scopes are regenerated unless noGenerate is true.
16883    ///
16884    /// # Arguments
16885    ///
16886    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16887    pub fn with_updated_lock(&self) -> Workspace {
16888        let query = self.selection.select("withUpdatedLock");
16889        Workspace {
16890            proc: self.proc.clone(),
16891            selection: query,
16892            graphql_client: self.graphql_client.clone(),
16893        }
16894    }
16895    /// Return this workspace with refreshed lockfile state.
16896    /// SDK client scopes are regenerated unless noGenerate is true.
16897    ///
16898    /// # Arguments
16899    ///
16900    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16901    pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
16902        let mut query = self.selection.select("withUpdatedLock");
16903        if let Some(no_generate) = opts.no_generate {
16904            query = query.arg("noGenerate", no_generate);
16905        }
16906        Workspace {
16907            proc: self.proc.clone(),
16908            selection: query,
16909            graphql_client: self.graphql_client.clone(),
16910        }
16911    }
16912    /// Return this workspace with updated module versions and lockfile state.
16913    /// An SDK client scope is regenerated when it targets an updated module.
16914    ///
16915    /// # Arguments
16916    ///
16917    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16918    pub fn with_updated_modules(&self) -> Workspace {
16919        let query = self.selection.select("withUpdatedModules");
16920        Workspace {
16921            proc: self.proc.clone(),
16922            selection: query,
16923            graphql_client: self.graphql_client.clone(),
16924        }
16925    }
16926    /// Return this workspace with updated module versions and lockfile state.
16927    /// An SDK client scope is regenerated when it targets an updated module.
16928    ///
16929    /// # Arguments
16930    ///
16931    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16932    pub fn with_updated_modules_opts<'a>(
16933        &self,
16934        opts: WorkspaceWithUpdatedModulesOpts<'a>,
16935    ) -> Workspace {
16936        let mut query = self.selection.select("withUpdatedModules");
16937        if let Some(names) = opts.names {
16938            query = query.arg("names", names);
16939        }
16940        if let Some(version) = opts.version {
16941            query = query.arg("version", version);
16942        }
16943        Workspace {
16944            proc: self.proc.clone(),
16945            selection: query,
16946            graphql_client: self.graphql_client.clone(),
16947        }
16948    }
16949    /// Return this workspace with its working directory pointed at the given workspace-relative path.
16950    ///
16951    /// # Arguments
16952    ///
16953    /// * `path` - Workspace-relative path to use as the working directory.
16954    pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
16955        let mut query = self.selection.select("withWorkdir");
16956        query = query.arg("path", path.into());
16957        Workspace {
16958            proc: self.proc.clone(),
16959            selection: query,
16960            graphql_client: self.graphql_client.clone(),
16961        }
16962    }
16963    /// Return this workspace with a module client removed from the deepest matching recorded scope.
16964    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
16965    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
16966    ///
16967    /// # Arguments
16968    ///
16969    /// * `module` - The recorded target to remove.
16970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16971    pub fn without_client(&self, module: impl Into<String>) -> Workspace {
16972        let mut query = self.selection.select("withoutClient");
16973        query = query.arg("module", module.into());
16974        Workspace {
16975            proc: self.proc.clone(),
16976            selection: query,
16977            graphql_client: self.graphql_client.clone(),
16978        }
16979    }
16980    /// Return this workspace with a module client removed from the deepest matching recorded scope.
16981    /// Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope.
16982    /// If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
16983    ///
16984    /// # Arguments
16985    ///
16986    /// * `module` - The recorded target to remove.
16987    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16988    pub fn without_client_opts<'a>(
16989        &self,
16990        module: impl Into<String>,
16991        opts: WorkspaceWithoutClientOpts<'a>,
16992    ) -> Workspace {
16993        let mut query = self.selection.select("withoutClient");
16994        query = query.arg("module", module.into());
16995        if let Some(sdk) = opts.sdk {
16996            query = query.arg("sdk", sdk);
16997        }
16998        Workspace {
16999            proc: self.proc.clone(),
17000            selection: query,
17001            graphql_client: self.graphql_client.clone(),
17002        }
17003    }
17004    /// Return this workspace with a named config environment removed.
17005    ///
17006    /// # Arguments
17007    ///
17008    /// * `name` - Environment name.
17009    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17010    pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
17011        let mut query = self.selection.select("withoutConfigEnv");
17012        query = query.arg("name", name.into());
17013        Workspace {
17014            proc: self.proc.clone(),
17015            selection: query,
17016            graphql_client: self.graphql_client.clone(),
17017        }
17018    }
17019    /// Return this workspace with a named config environment removed.
17020    ///
17021    /// # Arguments
17022    ///
17023    /// * `name` - Environment name.
17024    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17025    pub fn without_config_env_opts(
17026        &self,
17027        name: impl Into<String>,
17028        opts: WorkspaceWithoutConfigEnvOpts,
17029    ) -> Workspace {
17030        let mut query = self.selection.select("withoutConfigEnv");
17031        query = query.arg("name", name.into());
17032        if let Some(here) = opts.here {
17033            query = query.arg("here", here);
17034        }
17035        Workspace {
17036            proc: self.proc.clone(),
17037            selection: query,
17038            graphql_client: self.graphql_client.clone(),
17039        }
17040    }
17041    /// Return this workspace with a configuration value removed.
17042    /// Errors when the key is not currently set.
17043    /// When the session selects an env, the key is scoped to that env's overlay.
17044    ///
17045    /// # Arguments
17046    ///
17047    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
17048    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17049    pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
17050        let mut query = self.selection.select("withoutConfigValue");
17051        query = query.arg("key", key.into());
17052        Workspace {
17053            proc: self.proc.clone(),
17054            selection: query,
17055            graphql_client: self.graphql_client.clone(),
17056        }
17057    }
17058    /// Return this workspace with a configuration value removed.
17059    /// Errors when the key is not currently set.
17060    /// When the session selects an env, the key is scoped to that env's overlay.
17061    ///
17062    /// # Arguments
17063    ///
17064    /// * `key` - Dotted key path (e.g. modules.greeter.settings.greeting).
17065    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17066    pub fn without_config_value_opts(
17067        &self,
17068        key: impl Into<String>,
17069        opts: WorkspaceWithoutConfigValueOpts,
17070    ) -> Workspace {
17071        let mut query = self.selection.select("withoutConfigValue");
17072        query = query.arg("key", key.into());
17073        if let Some(here) = opts.here {
17074            query = query.arg("here", here);
17075        }
17076        Workspace {
17077            proc: self.proc.clone(),
17078            selection: query,
17079            graphql_client: self.graphql_client.clone(),
17080        }
17081    }
17082    /// Return this workspace with a directory removed, without mutating the source.
17083    ///
17084    /// # Arguments
17085    ///
17086    /// * `path` - Path of the directory to remove. Relative paths resolve from the workspace cwd.
17087    pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
17088        let mut query = self.selection.select("withoutDirectory");
17089        query = query.arg("path", path.into());
17090        Workspace {
17091            proc: self.proc.clone(),
17092            selection: query,
17093            graphql_client: self.graphql_client.clone(),
17094        }
17095    }
17096    /// Return this workspace with no module selected as its entrypoint.
17097    pub fn without_entrypoint(&self) -> Workspace {
17098        let query = self.selection.select("withoutEntrypoint");
17099        Workspace {
17100            proc: self.proc.clone(),
17101            selection: query,
17102            graphql_client: self.graphql_client.clone(),
17103        }
17104    }
17105    /// Return this workspace with a file removed, without mutating the source.
17106    ///
17107    /// # Arguments
17108    ///
17109    /// * `path` - Path of the file to remove. Relative paths resolve from the workspace cwd.
17110    pub fn without_file(&self, path: impl Into<String>) -> Workspace {
17111        let mut query = self.selection.select("withoutFile");
17112        query = query.arg("path", path.into());
17113        Workspace {
17114            proc: self.proc.clone(),
17115            selection: query,
17116            graphql_client: self.graphql_client.clone(),
17117        }
17118    }
17119    /// Return this workspace with a module removed from its config.
17120    /// When the session selects an env, only that env's overlay entry is removed.
17121    ///
17122    /// # Arguments
17123    ///
17124    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
17125    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17126    pub fn without_module(&self, name: impl Into<String>) -> Workspace {
17127        let mut query = self.selection.select("withoutModule");
17128        query = query.arg("name", name.into());
17129        Workspace {
17130            proc: self.proc.clone(),
17131            selection: query,
17132            graphql_client: self.graphql_client.clone(),
17133        }
17134    }
17135    /// Return this workspace with a module removed from its config.
17136    /// When the session selects an env, only that env's overlay entry is removed.
17137    ///
17138    /// # Arguments
17139    ///
17140    /// * `name` - Installed module name or source to remove. Version selectors are not accepted.
17141    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17142    pub fn without_module_opts(
17143        &self,
17144        name: impl Into<String>,
17145        opts: WorkspaceWithoutModuleOpts,
17146    ) -> Workspace {
17147        let mut query = self.selection.select("withoutModule");
17148        query = query.arg("name", name.into());
17149        if let Some(here) = opts.here {
17150            query = query.arg("here", here);
17151        }
17152        Workspace {
17153            proc: self.proc.clone(),
17154            selection: query,
17155            graphql_client: self.graphql_client.clone(),
17156        }
17157    }
17158    /// Return this workspace with an SDK removed from its config.
17159    ///
17160    /// # Arguments
17161    ///
17162    /// * `name` - Name of the installed SDK entry to remove.
17163    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17164    pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
17165        let mut query = self.selection.select("withoutSDK");
17166        query = query.arg("name", name.into());
17167        Workspace {
17168            proc: self.proc.clone(),
17169            selection: query,
17170            graphql_client: self.graphql_client.clone(),
17171        }
17172    }
17173    /// Return this workspace with an SDK removed from its config.
17174    ///
17175    /// # Arguments
17176    ///
17177    /// * `name` - Name of the installed SDK entry to remove.
17178    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
17179    pub fn without_sdk_opts(
17180        &self,
17181        name: impl Into<String>,
17182        opts: WorkspaceWithoutSdkOpts,
17183    ) -> Workspace {
17184        let mut query = self.selection.select("withoutSDK");
17185        query = query.arg("name", name.into());
17186        if let Some(here) = opts.here {
17187            query = query.arg("here", here);
17188        }
17189        Workspace {
17190            proc: self.proc.clone(),
17191            selection: query,
17192            graphql_client: self.graphql_client.clone(),
17193        }
17194    }
17195}
17196impl Node for Workspace {
17197    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17198        let query = self.selection.select("id");
17199        let graphql_client = self.graphql_client.clone();
17200        async move { query.execute(graphql_client).await }
17201    }
17202}
17203#[derive(Clone)]
17204pub struct WorkspaceGit {
17205    pub proc: Option<Arc<DaggerSessionProc>>,
17206    pub selection: Selection,
17207    pub graphql_client: DynGraphQLClient,
17208}
17209impl IntoID<Id> for WorkspaceGit {
17210    fn into_id(
17211        self,
17212    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17213        Box::pin(async move { self.id().await })
17214    }
17215}
17216impl Loadable for WorkspaceGit {
17217    fn graphql_type() -> &'static str {
17218        "WorkspaceGit"
17219    }
17220    fn from_query(
17221        proc: Option<Arc<DaggerSessionProc>>,
17222        selection: Selection,
17223        graphql_client: DynGraphQLClient,
17224    ) -> Self {
17225        Self {
17226            proc,
17227            selection,
17228            graphql_client,
17229        }
17230    }
17231}
17232impl WorkspaceGit {
17233    /// The checked-out HEAD of this workspace.
17234    pub fn head(&self) -> GitRef {
17235        let query = self.selection.select("head");
17236        GitRef {
17237            proc: self.proc.clone(),
17238            selection: query,
17239            graphql_client: self.graphql_client.clone(),
17240        }
17241    }
17242    /// A unique identifier for this WorkspaceGit.
17243    pub async fn id(&self) -> Result<Id, DaggerError> {
17244        let query = self.selection.select("id");
17245        query.execute(self.graphql_client.clone()).await
17246    }
17247    /// Uncommitted changes in this workspace, using the same rules as GitRepository.uncommitted.
17248    pub fn uncommitted(&self) -> Changeset {
17249        let query = self.selection.select("uncommitted");
17250        Changeset {
17251            proc: self.proc.clone(),
17252            selection: query,
17253            graphql_client: self.graphql_client.clone(),
17254        }
17255    }
17256}
17257impl Node for WorkspaceGit {
17258    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17259        let query = self.selection.select("id");
17260        let graphql_client = self.graphql_client.clone();
17261        async move { query.execute(graphql_client).await }
17262    }
17263}
17264#[derive(Clone)]
17265pub struct WorkspaceMigration {
17266    pub proc: Option<Arc<DaggerSessionProc>>,
17267    pub selection: Selection,
17268    pub graphql_client: DynGraphQLClient,
17269}
17270impl IntoID<Id> for WorkspaceMigration {
17271    fn into_id(
17272        self,
17273    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17274        Box::pin(async move { self.id().await })
17275    }
17276}
17277impl Loadable for WorkspaceMigration {
17278    fn graphql_type() -> &'static str {
17279        "WorkspaceMigration"
17280    }
17281    fn from_query(
17282        proc: Option<Arc<DaggerSessionProc>>,
17283        selection: Selection,
17284        graphql_client: DynGraphQLClient,
17285    ) -> Self {
17286        Self {
17287            proc,
17288            selection,
17289            graphql_client,
17290        }
17291    }
17292}
17293impl WorkspaceMigration {
17294    /// Filesystem changes for the full migration plan.
17295    pub fn changes(&self) -> Changeset {
17296        let query = self.selection.select("changes");
17297        Changeset {
17298            proc: self.proc.clone(),
17299            selection: query,
17300            graphql_client: self.graphql_client.clone(),
17301        }
17302    }
17303    /// Native workspace config path after migration, relative to the workspace root. Empty if no workspace config exists.
17304    pub async fn config_file(&self) -> Result<String, DaggerError> {
17305        let query = self.selection.select("configFile");
17306        query.execute(self.graphql_client.clone()).await
17307    }
17308    /// A unique identifier for this WorkspaceMigration.
17309    pub async fn id(&self) -> Result<Id, DaggerError> {
17310        let query = self.selection.select("id");
17311        query.execute(self.graphql_client.clone()).await
17312    }
17313    /// Unselected legacy module directories relative to the workspace root. Candidates can include fixtures.
17314    pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
17315        let query = self.selection.select("moduleCandidates");
17316        query.execute(self.graphql_client.clone()).await
17317    }
17318    /// Logical migration steps, each identified by a stable code.
17319    pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
17320        let query = self.selection.select("steps");
17321        let query = query.select("id");
17322        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17323        Ok(ids
17324            .into_iter()
17325            .map(|id| WorkspaceMigrationStep {
17326                proc: self.proc.clone(),
17327                selection: crate::querybuilder::query()
17328                    .select("node")
17329                    .arg("id", &id.0)
17330                    .inline_fragment("WorkspaceMigrationStep"),
17331                graphql_client: self.graphql_client.clone(),
17332            })
17333            .collect())
17334    }
17335}
17336impl Node for WorkspaceMigration {
17337    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17338        let query = self.selection.select("id");
17339        let graphql_client = self.graphql_client.clone();
17340        async move { query.execute(graphql_client).await }
17341    }
17342}
17343#[derive(Clone)]
17344pub struct WorkspaceMigrationStep {
17345    pub proc: Option<Arc<DaggerSessionProc>>,
17346    pub selection: Selection,
17347    pub graphql_client: DynGraphQLClient,
17348}
17349impl IntoID<Id> for WorkspaceMigrationStep {
17350    fn into_id(
17351        self,
17352    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17353        Box::pin(async move { self.id().await })
17354    }
17355}
17356impl Loadable for WorkspaceMigrationStep {
17357    fn graphql_type() -> &'static str {
17358        "WorkspaceMigrationStep"
17359    }
17360    fn from_query(
17361        proc: Option<Arc<DaggerSessionProc>>,
17362        selection: Selection,
17363        graphql_client: DynGraphQLClient,
17364    ) -> Self {
17365        Self {
17366            proc,
17367            selection,
17368            graphql_client,
17369        }
17370    }
17371}
17372impl WorkspaceMigrationStep {
17373    /// Filesystem changes for this step.
17374    pub fn changes(&self) -> Changeset {
17375        let query = self.selection.select("changes");
17376        Changeset {
17377            proc: self.proc.clone(),
17378            selection: query,
17379            graphql_client: self.graphql_client.clone(),
17380        }
17381    }
17382    /// Stable code identifying this logical migration step.
17383    pub async fn code(&self) -> Result<String, DaggerError> {
17384        let query = self.selection.select("code");
17385        query.execute(self.graphql_client.clone()).await
17386    }
17387    /// Generic summary of this step's purpose and impact.
17388    pub async fn description(&self) -> Result<String, DaggerError> {
17389        let query = self.selection.select("description");
17390        query.execute(self.graphql_client.clone()).await
17391    }
17392    /// A unique identifier for this WorkspaceMigrationStep.
17393    pub async fn id(&self) -> Result<Id, DaggerError> {
17394        let query = self.selection.select("id");
17395        query.execute(self.graphql_client.clone()).await
17396    }
17397    /// Non-fatal warnings raised while planning this step.
17398    pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
17399        let query = self.selection.select("warnings");
17400        query.execute(self.graphql_client.clone()).await
17401    }
17402}
17403impl Node for WorkspaceMigrationStep {
17404    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17405        let query = self.selection.select("id");
17406        let graphql_client = self.graphql_client.clone();
17407        async move { query.execute(graphql_client).await }
17408    }
17409}
17410#[derive(Clone)]
17411pub struct WorkspaceModule {
17412    pub proc: Option<Arc<DaggerSessionProc>>,
17413    pub selection: Selection,
17414    pub graphql_client: DynGraphQLClient,
17415}
17416impl IntoID<Id> for WorkspaceModule {
17417    fn into_id(
17418        self,
17419    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17420        Box::pin(async move { self.id().await })
17421    }
17422}
17423impl Loadable for WorkspaceModule {
17424    fn graphql_type() -> &'static str {
17425        "WorkspaceModule"
17426    }
17427    fn from_query(
17428        proc: Option<Arc<DaggerSessionProc>>,
17429        selection: Selection,
17430        graphql_client: DynGraphQLClient,
17431    ) -> Self {
17432        Self {
17433            proc,
17434            selection,
17435            graphql_client,
17436        }
17437    }
17438}
17439impl WorkspaceModule {
17440    /// Whether the module is the workspace entrypoint (functions aliased to Query root).
17441    pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
17442        let query = self.selection.select("entrypoint");
17443        query.execute(self.graphql_client.clone()).await
17444    }
17445    /// List the functions of this module's main object, in GraphQL field form.
17446    pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
17447        let query = self.selection.select("functions");
17448        query.execute(self.graphql_client.clone()).await
17449    }
17450    /// A unique identifier for this WorkspaceModule.
17451    pub async fn id(&self) -> Result<Id, DaggerError> {
17452        let query = self.selection.select("id");
17453        query.execute(self.graphql_client.clone()).await
17454    }
17455    /// The module name.
17456    pub async fn name(&self) -> Result<String, DaggerError> {
17457        let query = self.selection.select("name");
17458        query.execute(self.graphql_client.clone()).await
17459    }
17460    /// List constructor-backed settings for this module.
17461    pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
17462        let query = self.selection.select("settings");
17463        let query = query.select("id");
17464        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17465        Ok(ids
17466            .into_iter()
17467            .map(|id| WorkspaceModuleSetting {
17468                proc: self.proc.clone(),
17469                selection: crate::querybuilder::query()
17470                    .select("node")
17471                    .arg("id", &id.0)
17472                    .inline_fragment("WorkspaceModuleSetting"),
17473                graphql_client: self.graphql_client.clone(),
17474            })
17475            .collect())
17476    }
17477    /// The module source path.
17478    pub async fn source(&self) -> Result<String, DaggerError> {
17479        let query = self.selection.select("source");
17480        query.execute(self.graphql_client.clone()).await
17481    }
17482}
17483impl Node for WorkspaceModule {
17484    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17485        let query = self.selection.select("id");
17486        let graphql_client = self.graphql_client.clone();
17487        async move { query.execute(graphql_client).await }
17488    }
17489}
17490#[derive(Clone)]
17491pub struct WorkspaceModuleSetting {
17492    pub proc: Option<Arc<DaggerSessionProc>>,
17493    pub selection: Selection,
17494    pub graphql_client: DynGraphQLClient,
17495}
17496impl IntoID<Id> for WorkspaceModuleSetting {
17497    fn into_id(
17498        self,
17499    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17500        Box::pin(async move { self.id().await })
17501    }
17502}
17503impl Loadable for WorkspaceModuleSetting {
17504    fn graphql_type() -> &'static str {
17505        "WorkspaceModuleSetting"
17506    }
17507    fn from_query(
17508        proc: Option<Arc<DaggerSessionProc>>,
17509        selection: Selection,
17510        graphql_client: DynGraphQLClient,
17511    ) -> Self {
17512        Self {
17513            proc,
17514            selection,
17515            graphql_client,
17516        }
17517    }
17518}
17519impl WorkspaceModuleSetting {
17520    /// The constructor argument description.
17521    pub async fn description(&self) -> Result<String, DaggerError> {
17522        let query = self.selection.select("description");
17523        query.execute(self.graphql_client.clone()).await
17524    }
17525    /// A unique identifier for this WorkspaceModuleSetting.
17526    pub async fn id(&self) -> Result<Id, DaggerError> {
17527        let query = self.selection.select("id");
17528        query.execute(self.graphql_client.clone()).await
17529    }
17530    /// Whether the setting accepts a list of values.
17531    pub async fn is_list(&self) -> Result<bool, DaggerError> {
17532        let query = self.selection.select("isList");
17533        query.execute(self.graphql_client.clone()).await
17534    }
17535    /// Whether the setting is an object type resolved from an address string (Container, Directory, File, Secret, Service, ...), which may be a module reference.
17536    pub async fn is_object(&self) -> Result<bool, DaggerError> {
17537        let query = self.selection.select("isObject");
17538        query.execute(self.graphql_client.clone()).await
17539    }
17540    /// The setting key.
17541    pub async fn key(&self) -> Result<String, DaggerError> {
17542        let query = self.selection.select("key");
17543        query.execute(self.graphql_client.clone()).await
17544    }
17545    /// The configured value after applying the selected workspace environment, or empty when unset.
17546    pub async fn value(&self) -> Result<String, DaggerError> {
17547        let query = self.selection.select("value");
17548        query.execute(self.graphql_client.clone()).await
17549    }
17550}
17551impl Node for WorkspaceModuleSetting {
17552    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17553        let query = self.selection.select("id");
17554        let graphql_client = self.graphql_client.clone();
17555        async move { query.execute(graphql_client).await }
17556    }
17557}
17558#[derive(Clone)]
17559pub struct WorkspaceSdk {
17560    pub proc: Option<Arc<DaggerSessionProc>>,
17561    pub selection: Selection,
17562    pub graphql_client: DynGraphQLClient,
17563}
17564impl IntoID<Id> for WorkspaceSdk {
17565    fn into_id(
17566        self,
17567    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17568        Box::pin(async move { self.id().await })
17569    }
17570}
17571impl Loadable for WorkspaceSdk {
17572    fn graphql_type() -> &'static str {
17573        "WorkspaceSDK"
17574    }
17575    fn from_query(
17576        proc: Option<Arc<DaggerSessionProc>>,
17577        selection: Selection,
17578        graphql_client: DynGraphQLClient,
17579    ) -> Self {
17580        Self {
17581            proc,
17582            selection,
17583            graphql_client,
17584        }
17585    }
17586}
17587impl WorkspaceSdk {
17588    /// Clients generated with this SDK.
17589    pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
17590        let query = self.selection.select("clients");
17591        let query = query.select("id");
17592        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17593        Ok(ids
17594            .into_iter()
17595            .map(|id| WorkspaceModule {
17596                proc: self.proc.clone(),
17597                selection: crate::querybuilder::query()
17598                    .select("node")
17599                    .arg("id", &id.0)
17600                    .inline_fragment("WorkspaceModule"),
17601                graphql_client: self.graphql_client.clone(),
17602            })
17603            .collect())
17604    }
17605    /// A unique identifier for this WorkspaceSDK.
17606    pub async fn id(&self) -> Result<Id, DaggerError> {
17607        let query = self.selection.select("id");
17608        query.execute(self.graphql_client.clone()).await
17609    }
17610    /// Modules authored with this SDK.
17611    pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
17612        let query = self.selection.select("modules");
17613        let query = query.select("id");
17614        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17615        Ok(ids
17616            .into_iter()
17617            .map(|id| WorkspaceModule {
17618                proc: self.proc.clone(),
17619                selection: crate::querybuilder::query()
17620                    .select("node")
17621                    .arg("id", &id.0)
17622                    .inline_fragment("WorkspaceModule"),
17623                graphql_client: self.graphql_client.clone(),
17624            })
17625            .collect())
17626    }
17627    /// The user-facing SDK name.
17628    pub async fn name(&self) -> Result<String, DaggerError> {
17629        let query = self.selection.select("name");
17630        query.execute(self.graphql_client.clone()).await
17631    }
17632    /// The module reference this SDK was installed from.
17633    pub async fn r#ref(&self) -> Result<String, DaggerError> {
17634        let query = self.selection.select("ref");
17635        query.execute(self.graphql_client.clone()).await
17636    }
17637}
17638impl Node for WorkspaceSdk {
17639    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17640        let query = self.selection.select("id");
17641        let graphql_client = self.graphql_client.clone();
17642        async move { query.execute(graphql_client).await }
17643    }
17644}
17645#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17646pub enum CacheSharingMode {
17647    #[serde(rename = "LOCKED")]
17648    Locked,
17649    #[serde(rename = "PRIVATE")]
17650    Private,
17651    #[serde(rename = "SHARED")]
17652    Shared,
17653}
17654#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17655pub enum ChangesetMergeConflict {
17656    #[serde(rename = "FAIL")]
17657    Fail,
17658    #[serde(rename = "FAIL_EARLY")]
17659    FailEarly,
17660    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
17661    LeaveConflictMarkers,
17662    #[serde(rename = "PREFER_OURS")]
17663    PreferOurs,
17664    #[serde(rename = "PREFER_THEIRS")]
17665    PreferTheirs,
17666}
17667#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17668pub enum ChangesetsMergeConflict {
17669    #[serde(rename = "FAIL")]
17670    Fail,
17671    #[serde(rename = "FAIL_EARLY")]
17672    FailEarly,
17673}
17674#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17675pub enum DiffStatKind {
17676    #[serde(rename = "ADDED")]
17677    Added,
17678    #[serde(rename = "MODIFIED")]
17679    Modified,
17680    #[serde(rename = "REMOVED")]
17681    Removed,
17682    #[serde(rename = "RENAMED")]
17683    Renamed,
17684}
17685#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17686pub enum ExistsType {
17687    #[serde(rename = "DIRECTORY_TYPE")]
17688    DirectoryType,
17689    #[serde(rename = "REGULAR_TYPE")]
17690    RegularType,
17691    #[serde(rename = "SYMLINK_TYPE")]
17692    SymlinkType,
17693}
17694#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17695pub enum FileType {
17696    #[serde(rename = "DIRECTORY")]
17697    Directory,
17698    #[serde(rename = "DIRECTORY_TYPE")]
17699    DirectoryType,
17700    #[serde(rename = "REGULAR")]
17701    Regular,
17702    #[serde(rename = "REGULAR_TYPE")]
17703    RegularType,
17704    #[serde(rename = "SYMLINK")]
17705    Symlink,
17706    #[serde(rename = "SYMLINK_TYPE")]
17707    SymlinkType,
17708    #[serde(rename = "UNKNOWN")]
17709    Unknown,
17710}
17711#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17712pub enum FunctionCachePolicy {
17713    #[serde(rename = "Default")]
17714    Default,
17715    #[serde(rename = "Never")]
17716    Never,
17717    #[serde(rename = "PerSession")]
17718    PerSession,
17719}
17720#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17721pub enum ImageLayerCompression {
17722    #[serde(rename = "EStarGZ")]
17723    EStarGz,
17724    #[serde(rename = "ESTARGZ")]
17725    Estargz,
17726    #[serde(rename = "Gzip")]
17727    Gzip,
17728    #[serde(rename = "Uncompressed")]
17729    Uncompressed,
17730    #[serde(rename = "Zstd")]
17731    Zstd,
17732}
17733#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17734pub enum ImageMediaTypes {
17735    #[serde(rename = "DOCKER")]
17736    Docker,
17737    #[serde(rename = "DockerMediaTypes")]
17738    DockerMediaTypes,
17739    #[serde(rename = "OCI")]
17740    Oci,
17741    #[serde(rename = "OCIMediaTypes")]
17742    OciMediaTypes,
17743}
17744#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17745pub enum LlmContentBlockKind {
17746    #[serde(rename = "TEXT")]
17747    Text,
17748    #[serde(rename = "THINKING")]
17749    Thinking,
17750    #[serde(rename = "TOOL_CALL")]
17751    ToolCall,
17752    #[serde(rename = "TOOL_RESULT")]
17753    ToolResult,
17754}
17755#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17756pub enum LlmMessageRole {
17757    #[serde(rename = "ASSISTANT")]
17758    Assistant,
17759    #[serde(rename = "SYSTEM")]
17760    System,
17761    #[serde(rename = "USER")]
17762    User,
17763}
17764#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17765pub enum ModuleSourceExperimentalFeature {
17766    #[serde(rename = "SELF_CALLS")]
17767    SelfCalls,
17768}
17769#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17770pub enum ModuleSourceKind {
17771    #[serde(rename = "DIR")]
17772    Dir,
17773    #[serde(rename = "DIR_SOURCE")]
17774    DirSource,
17775    #[serde(rename = "GIT")]
17776    Git,
17777    #[serde(rename = "GIT_SOURCE")]
17778    GitSource,
17779    #[serde(rename = "LOCAL")]
17780    Local,
17781    #[serde(rename = "LOCAL_SOURCE")]
17782    LocalSource,
17783}
17784#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17785pub enum NetworkProtocol {
17786    #[serde(rename = "TCP")]
17787    Tcp,
17788    #[serde(rename = "UDP")]
17789    Udp,
17790}
17791#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17792pub enum PatchConflict {
17793    #[serde(rename = "FAIL")]
17794    Fail,
17795    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
17796    LeaveConflictMarkers,
17797}
17798#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17799pub enum RegistryProtocol {
17800    #[serde(rename = "HTTP")]
17801    Http,
17802    #[serde(rename = "HTTPS")]
17803    Https,
17804}
17805#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17806pub enum ReturnType {
17807    #[serde(rename = "ANY")]
17808    Any,
17809    #[serde(rename = "FAILURE")]
17810    Failure,
17811    #[serde(rename = "SUCCESS")]
17812    Success,
17813}
17814#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17815pub enum TypeDefKind {
17816    #[serde(rename = "BOOLEAN")]
17817    Boolean,
17818    #[serde(rename = "BOOLEAN_KIND")]
17819    BooleanKind,
17820    #[serde(rename = "ENUM")]
17821    Enum,
17822    #[serde(rename = "ENUM_KIND")]
17823    EnumKind,
17824    #[serde(rename = "FLOAT")]
17825    Float,
17826    #[serde(rename = "FLOAT_KIND")]
17827    FloatKind,
17828    #[serde(rename = "INPUT")]
17829    Input,
17830    #[serde(rename = "INPUT_KIND")]
17831    InputKind,
17832    #[serde(rename = "INTEGER")]
17833    Integer,
17834    #[serde(rename = "INTEGER_KIND")]
17835    IntegerKind,
17836    #[serde(rename = "INTERFACE")]
17837    Interface,
17838    #[serde(rename = "INTERFACE_KIND")]
17839    InterfaceKind,
17840    #[serde(rename = "LIST")]
17841    List,
17842    #[serde(rename = "LIST_KIND")]
17843    ListKind,
17844    #[serde(rename = "OBJECT")]
17845    Object,
17846    #[serde(rename = "OBJECT_KIND")]
17847    ObjectKind,
17848    #[serde(rename = "SCALAR")]
17849    Scalar,
17850    #[serde(rename = "SCALAR_KIND")]
17851    ScalarKind,
17852    #[serde(rename = "STRING")]
17853    String,
17854    #[serde(rename = "STRING_KIND")]
17855    StringKind,
17856    #[serde(rename = "VOID")]
17857    Void,
17858    #[serde(rename = "VOID_KIND")]
17859    VoidKind,
17860}