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
13pub type AddressId = Id;
14pub type BindingId = Id;
15pub type CacheVolumeId = Id;
16pub type ChangesetId = Id;
17pub type CheckGroupId = Id;
18pub type CheckId = Id;
19pub type ClientFilesyncMirrorId = Id;
20pub type CloudId = Id;
21pub type ContainerId = Id;
22pub type CurrentModuleId = Id;
23pub type DiffStatId = Id;
24pub type DirectoryId = Id;
25pub type EngineCacheEntryId = Id;
26pub type EngineCacheEntrySetId = Id;
27pub type EngineCacheId = Id;
28pub type EngineId = Id;
29pub type EnumTypeDefId = Id;
30pub type EnumValueTypeDefId = Id;
31pub type EnvFileId = Id;
32pub type EnvId = Id;
33pub type EnvVariableId = Id;
34pub type ErrorId = Id;
35pub type ErrorValueId = Id;
36pub type ExportableId = Id;
37pub type FieldTypeDefId = Id;
38pub type FileId = Id;
39pub type FunctionArgId = Id;
40pub type FunctionCallArgValueId = Id;
41pub type FunctionCallId = Id;
42pub type FunctionId = Id;
43pub type GeneratedCodeId = Id;
44pub type GeneratorGroupId = Id;
45pub type GeneratorId = Id;
46pub type GitRefId = Id;
47pub type GitRepositoryId = Id;
48pub type HttpStateId = Id;
49pub type HealthcheckConfigId = Id;
50pub type HostId = Id;
51#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
52pub struct Id(pub String);
53impl From<&str> for Id {
54    fn from(value: &str) -> Self {
55        Self(value.to_string())
56    }
57}
58impl From<String> for Id {
59    fn from(value: String) -> Self {
60        Self(value)
61    }
62}
63impl IntoID<Id> for Id {
64    fn into_id(
65        self,
66    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
67        Box::pin(async move { Ok::<Id, DaggerError>(self) })
68    }
69}
70impl Id {
71    fn quote(&self) -> String {
72        format!("\"{}\"", self.0.clone())
73    }
74}
75pub type InputTypeDefId = Id;
76pub type InterfaceTypeDefId = Id;
77#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
78pub struct Json(pub String);
79impl From<&str> for Json {
80    fn from(value: &str) -> Self {
81        Self(value.to_string())
82    }
83}
84impl From<String> for Json {
85    fn from(value: String) -> Self {
86        Self(value)
87    }
88}
89impl Json {
90    fn quote(&self) -> String {
91        format!("\"{}\"", self.0.clone())
92    }
93}
94pub type JsonValueId = Id;
95pub type Llmid = Id;
96pub type LlmTokenUsageId = Id;
97pub type LabelId = Id;
98pub type ListTypeDefId = Id;
99pub type ModuleConfigClientId = Id;
100pub type ModuleId = Id;
101pub type ModuleSourceId = Id;
102pub type ObjectTypeDefId = Id;
103#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
104pub struct Platform(pub String);
105impl From<&str> for Platform {
106    fn from(value: &str) -> Self {
107        Self(value.to_string())
108    }
109}
110impl From<String> for Platform {
111    fn from(value: String) -> Self {
112        Self(value)
113    }
114}
115impl Platform {
116    fn quote(&self) -> String {
117        format!("\"{}\"", self.0.clone())
118    }
119}
120pub type PortId = Id;
121pub type RemoteGitMirrorId = Id;
122pub type SdkConfigId = Id;
123pub type ScalarTypeDefId = Id;
124pub type SearchResultId = Id;
125pub type SearchSubmatchId = Id;
126pub type SecretId = Id;
127pub type ServiceId = Id;
128pub type SocketId = Id;
129pub type SourceMapId = Id;
130pub type StatId = Id;
131pub type SyncerId = Id;
132pub type TerminalId = Id;
133pub type TypeDefId = Id;
134pub type UpGroupId = Id;
135pub type UpId = Id;
136#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
137pub struct Void(pub String);
138impl From<&str> for Void {
139    fn from(value: &str) -> Self {
140        Self(value.to_string())
141    }
142}
143impl From<String> for Void {
144    fn from(value: String) -> Self {
145        Self(value)
146    }
147}
148impl Void {
149    fn quote(&self) -> String {
150        format!("\"{}\"", self.0.clone())
151    }
152}
153pub type WorkspaceId = Id;
154#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
155pub struct BuildArg {
156    pub name: String,
157    pub value: String,
158}
159#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
160pub struct PipelineLabel {
161    pub name: String,
162    pub value: String,
163}
164#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
165pub struct PortForward {
166    pub backend: isize,
167    pub frontend: isize,
168    pub protocol: NetworkProtocol,
169}
170/// An object that can be exported to the host.
171/// Calling export writes the object to a path on the host filesystem and returns the path that was written.
172pub trait Exportable {
173    fn export(
174        &self,
175        path: impl Into<String>,
176    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
177    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
178}
179#[derive(Clone)]
180pub struct ExportableClient {
181    pub proc: Option<Arc<DaggerSessionProc>>,
182    pub selection: Selection,
183    pub graphql_client: DynGraphQLClient,
184}
185impl IntoID<Id> for ExportableClient {
186    fn into_id(
187        self,
188    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
189        Box::pin(async move { self.id().await })
190    }
191}
192impl ExportableClient {
193    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
194        let mut query = self.selection.select("export");
195        query = query.arg("path", path.into());
196        query.execute(self.graphql_client.clone()).await
197    }
198    pub async fn id(&self) -> Result<Id, DaggerError> {
199        let query = self.selection.select("id");
200        query.execute(self.graphql_client.clone()).await
201    }
202}
203impl Loadable for ExportableClient {
204    fn graphql_type() -> &'static str {
205        "Exportable"
206    }
207    fn from_query(
208        proc: Option<Arc<DaggerSessionProc>>,
209        selection: Selection,
210        graphql_client: DynGraphQLClient,
211    ) -> Self {
212        Self {
213            proc,
214            selection,
215            graphql_client,
216        }
217    }
218}
219impl Exportable for ExportableClient {
220    fn export(
221        &self,
222        path: impl Into<String>,
223    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
224        let mut query = self.selection.select("export");
225        query = query.arg("path", path.into());
226        let graphql_client = self.graphql_client.clone();
227        async move { query.execute(graphql_client).await }
228    }
229    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
230        let query = self.selection.select("id");
231        let graphql_client = self.graphql_client.clone();
232        async move { query.execute(graphql_client).await }
233    }
234}
235/// An object with a globally unique ID.
236pub trait Node {
237    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
238}
239#[derive(Clone)]
240pub struct NodeClient {
241    pub proc: Option<Arc<DaggerSessionProc>>,
242    pub selection: Selection,
243    pub graphql_client: DynGraphQLClient,
244}
245impl IntoID<Id> for NodeClient {
246    fn into_id(
247        self,
248    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
249        Box::pin(async move { self.id().await })
250    }
251}
252impl NodeClient {
253    pub async fn id(&self) -> Result<Id, DaggerError> {
254        let query = self.selection.select("id");
255        query.execute(self.graphql_client.clone()).await
256    }
257}
258impl Loadable for NodeClient {
259    fn graphql_type() -> &'static str {
260        "Node"
261    }
262    fn from_query(
263        proc: Option<Arc<DaggerSessionProc>>,
264        selection: Selection,
265        graphql_client: DynGraphQLClient,
266    ) -> Self {
267        Self {
268            proc,
269            selection,
270            graphql_client,
271        }
272    }
273}
274impl Node for NodeClient {
275    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
276        let query = self.selection.select("id");
277        let graphql_client = self.graphql_client.clone();
278        async move { query.execute(graphql_client).await }
279    }
280}
281/// An object that can be force-evaluated.
282/// Calling sync ensures that the object's entire dependency DAG has been evaluated, returning the object's ID once complete.
283pub trait Syncer {
284    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
285    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
286}
287#[derive(Clone)]
288pub struct SyncerClient {
289    pub proc: Option<Arc<DaggerSessionProc>>,
290    pub selection: Selection,
291    pub graphql_client: DynGraphQLClient,
292}
293impl IntoID<Id> for SyncerClient {
294    fn into_id(
295        self,
296    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
297        Box::pin(async move { self.id().await })
298    }
299}
300impl SyncerClient {
301    pub async fn id(&self) -> Result<Id, DaggerError> {
302        let query = self.selection.select("id");
303        query.execute(self.graphql_client.clone()).await
304    }
305    pub async fn sync(&self) -> Result<Id, DaggerError> {
306        let query = self.selection.select("sync");
307        query.execute(self.graphql_client.clone()).await
308    }
309}
310impl Loadable for SyncerClient {
311    fn graphql_type() -> &'static str {
312        "Syncer"
313    }
314    fn from_query(
315        proc: Option<Arc<DaggerSessionProc>>,
316        selection: Selection,
317        graphql_client: DynGraphQLClient,
318    ) -> Self {
319        Self {
320            proc,
321            selection,
322            graphql_client,
323        }
324    }
325}
326impl Syncer for SyncerClient {
327    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
328        let query = self.selection.select("id");
329        let graphql_client = self.graphql_client.clone();
330        async move { query.execute(graphql_client).await }
331    }
332    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
333        let query = self.selection.select("sync");
334        let graphql_client = self.graphql_client.clone();
335        async move { query.execute(graphql_client).await }
336    }
337}
338#[derive(Clone)]
339pub struct Address {
340    pub proc: Option<Arc<DaggerSessionProc>>,
341    pub selection: Selection,
342    pub graphql_client: DynGraphQLClient,
343}
344#[derive(Builder, Debug, PartialEq)]
345pub struct AddressDirectoryOpts<'a> {
346    #[builder(setter(into, strip_option), default)]
347    pub exclude: Option<Vec<&'a str>>,
348    #[builder(setter(into, strip_option), default)]
349    pub gitignore: Option<bool>,
350    #[builder(setter(into, strip_option), default)]
351    pub include: Option<Vec<&'a str>>,
352    #[builder(setter(into, strip_option), default)]
353    pub no_cache: Option<bool>,
354}
355#[derive(Builder, Debug, PartialEq)]
356pub struct AddressFileOpts<'a> {
357    #[builder(setter(into, strip_option), default)]
358    pub exclude: Option<Vec<&'a str>>,
359    #[builder(setter(into, strip_option), default)]
360    pub gitignore: Option<bool>,
361    #[builder(setter(into, strip_option), default)]
362    pub include: Option<Vec<&'a str>>,
363    #[builder(setter(into, strip_option), default)]
364    pub no_cache: Option<bool>,
365}
366impl IntoID<Id> for Address {
367    fn into_id(
368        self,
369    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
370        Box::pin(async move { self.id().await })
371    }
372}
373impl Loadable for Address {
374    fn graphql_type() -> &'static str {
375        "Address"
376    }
377    fn from_query(
378        proc: Option<Arc<DaggerSessionProc>>,
379        selection: Selection,
380        graphql_client: DynGraphQLClient,
381    ) -> Self {
382        Self {
383            proc,
384            selection,
385            graphql_client,
386        }
387    }
388}
389impl Address {
390    /// Load a container from the address.
391    pub fn container(&self) -> Container {
392        let query = self.selection.select("container");
393        Container {
394            proc: self.proc.clone(),
395            selection: query,
396            graphql_client: self.graphql_client.clone(),
397        }
398    }
399    /// Load a directory from the address.
400    ///
401    /// # Arguments
402    ///
403    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
404    pub fn directory(&self) -> Directory {
405        let query = self.selection.select("directory");
406        Directory {
407            proc: self.proc.clone(),
408            selection: query,
409            graphql_client: self.graphql_client.clone(),
410        }
411    }
412    /// Load a directory from the address.
413    ///
414    /// # Arguments
415    ///
416    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
417    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
418        let mut query = self.selection.select("directory");
419        if let Some(exclude) = opts.exclude {
420            query = query.arg("exclude", exclude);
421        }
422        if let Some(include) = opts.include {
423            query = query.arg("include", include);
424        }
425        if let Some(gitignore) = opts.gitignore {
426            query = query.arg("gitignore", gitignore);
427        }
428        if let Some(no_cache) = opts.no_cache {
429            query = query.arg("noCache", no_cache);
430        }
431        Directory {
432            proc: self.proc.clone(),
433            selection: query,
434            graphql_client: self.graphql_client.clone(),
435        }
436    }
437    /// Load a file from the address.
438    ///
439    /// # Arguments
440    ///
441    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
442    pub fn file(&self) -> File {
443        let query = self.selection.select("file");
444        File {
445            proc: self.proc.clone(),
446            selection: query,
447            graphql_client: self.graphql_client.clone(),
448        }
449    }
450    /// Load a file from the address.
451    ///
452    /// # Arguments
453    ///
454    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
455    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
456        let mut query = self.selection.select("file");
457        if let Some(exclude) = opts.exclude {
458            query = query.arg("exclude", exclude);
459        }
460        if let Some(include) = opts.include {
461            query = query.arg("include", include);
462        }
463        if let Some(gitignore) = opts.gitignore {
464            query = query.arg("gitignore", gitignore);
465        }
466        if let Some(no_cache) = opts.no_cache {
467            query = query.arg("noCache", no_cache);
468        }
469        File {
470            proc: self.proc.clone(),
471            selection: query,
472            graphql_client: self.graphql_client.clone(),
473        }
474    }
475    /// Load a git ref (branch, tag or commit) from the address.
476    pub fn git_ref(&self) -> GitRef {
477        let query = self.selection.select("gitRef");
478        GitRef {
479            proc: self.proc.clone(),
480            selection: query,
481            graphql_client: self.graphql_client.clone(),
482        }
483    }
484    /// Load a git repository from the address.
485    pub fn git_repository(&self) -> GitRepository {
486        let query = self.selection.select("gitRepository");
487        GitRepository {
488            proc: self.proc.clone(),
489            selection: query,
490            graphql_client: self.graphql_client.clone(),
491        }
492    }
493    /// A unique identifier for this Address.
494    pub async fn id(&self) -> Result<Id, DaggerError> {
495        let query = self.selection.select("id");
496        query.execute(self.graphql_client.clone()).await
497    }
498    /// Load a secret from the address.
499    pub fn secret(&self) -> Secret {
500        let query = self.selection.select("secret");
501        Secret {
502            proc: self.proc.clone(),
503            selection: query,
504            graphql_client: self.graphql_client.clone(),
505        }
506    }
507    /// Load a service from the address.
508    pub fn service(&self) -> Service {
509        let query = self.selection.select("service");
510        Service {
511            proc: self.proc.clone(),
512            selection: query,
513            graphql_client: self.graphql_client.clone(),
514        }
515    }
516    /// Load a local socket from the address.
517    pub fn socket(&self) -> Socket {
518        let query = self.selection.select("socket");
519        Socket {
520            proc: self.proc.clone(),
521            selection: query,
522            graphql_client: self.graphql_client.clone(),
523        }
524    }
525    /// The address value
526    pub async fn value(&self) -> Result<String, DaggerError> {
527        let query = self.selection.select("value");
528        query.execute(self.graphql_client.clone()).await
529    }
530}
531impl Node for Address {
532    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
533        let query = self.selection.select("id");
534        let graphql_client = self.graphql_client.clone();
535        async move { query.execute(graphql_client).await }
536    }
537}
538#[derive(Clone)]
539pub struct Binding {
540    pub proc: Option<Arc<DaggerSessionProc>>,
541    pub selection: Selection,
542    pub graphql_client: DynGraphQLClient,
543}
544impl IntoID<Id> for Binding {
545    fn into_id(
546        self,
547    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
548        Box::pin(async move { self.id().await })
549    }
550}
551impl Loadable for Binding {
552    fn graphql_type() -> &'static str {
553        "Binding"
554    }
555    fn from_query(
556        proc: Option<Arc<DaggerSessionProc>>,
557        selection: Selection,
558        graphql_client: DynGraphQLClient,
559    ) -> Self {
560        Self {
561            proc,
562            selection,
563            graphql_client,
564        }
565    }
566}
567impl Binding {
568    /// Retrieve the binding value, as type Address
569    pub fn as_address(&self) -> Address {
570        let query = self.selection.select("asAddress");
571        Address {
572            proc: self.proc.clone(),
573            selection: query,
574            graphql_client: self.graphql_client.clone(),
575        }
576    }
577    /// Retrieve the binding value, as type CacheVolume
578    pub fn as_cache_volume(&self) -> CacheVolume {
579        let query = self.selection.select("asCacheVolume");
580        CacheVolume {
581            proc: self.proc.clone(),
582            selection: query,
583            graphql_client: self.graphql_client.clone(),
584        }
585    }
586    /// Retrieve the binding value, as type Changeset
587    pub fn as_changeset(&self) -> Changeset {
588        let query = self.selection.select("asChangeset");
589        Changeset {
590            proc: self.proc.clone(),
591            selection: query,
592            graphql_client: self.graphql_client.clone(),
593        }
594    }
595    /// Retrieve the binding value, as type Check
596    pub fn as_check(&self) -> Check {
597        let query = self.selection.select("asCheck");
598        Check {
599            proc: self.proc.clone(),
600            selection: query,
601            graphql_client: self.graphql_client.clone(),
602        }
603    }
604    /// Retrieve the binding value, as type CheckGroup
605    pub fn as_check_group(&self) -> CheckGroup {
606        let query = self.selection.select("asCheckGroup");
607        CheckGroup {
608            proc: self.proc.clone(),
609            selection: query,
610            graphql_client: self.graphql_client.clone(),
611        }
612    }
613    /// Retrieve the binding value, as type Cloud
614    pub fn as_cloud(&self) -> Cloud {
615        let query = self.selection.select("asCloud");
616        Cloud {
617            proc: self.proc.clone(),
618            selection: query,
619            graphql_client: self.graphql_client.clone(),
620        }
621    }
622    /// Retrieve the binding value, as type Container
623    pub fn as_container(&self) -> Container {
624        let query = self.selection.select("asContainer");
625        Container {
626            proc: self.proc.clone(),
627            selection: query,
628            graphql_client: self.graphql_client.clone(),
629        }
630    }
631    /// Retrieve the binding value, as type DiffStat
632    pub fn as_diff_stat(&self) -> DiffStat {
633        let query = self.selection.select("asDiffStat");
634        DiffStat {
635            proc: self.proc.clone(),
636            selection: query,
637            graphql_client: self.graphql_client.clone(),
638        }
639    }
640    /// Retrieve the binding value, as type Directory
641    pub fn as_directory(&self) -> Directory {
642        let query = self.selection.select("asDirectory");
643        Directory {
644            proc: self.proc.clone(),
645            selection: query,
646            graphql_client: self.graphql_client.clone(),
647        }
648    }
649    /// Retrieve the binding value, as type Env
650    pub fn as_env(&self) -> Env {
651        let query = self.selection.select("asEnv");
652        Env {
653            proc: self.proc.clone(),
654            selection: query,
655            graphql_client: self.graphql_client.clone(),
656        }
657    }
658    /// Retrieve the binding value, as type EnvFile
659    pub fn as_env_file(&self) -> EnvFile {
660        let query = self.selection.select("asEnvFile");
661        EnvFile {
662            proc: self.proc.clone(),
663            selection: query,
664            graphql_client: self.graphql_client.clone(),
665        }
666    }
667    /// Retrieve the binding value, as type File
668    pub fn as_file(&self) -> File {
669        let query = self.selection.select("asFile");
670        File {
671            proc: self.proc.clone(),
672            selection: query,
673            graphql_client: self.graphql_client.clone(),
674        }
675    }
676    /// Retrieve the binding value, as type Generator
677    pub fn as_generator(&self) -> Generator {
678        let query = self.selection.select("asGenerator");
679        Generator {
680            proc: self.proc.clone(),
681            selection: query,
682            graphql_client: self.graphql_client.clone(),
683        }
684    }
685    /// Retrieve the binding value, as type GeneratorGroup
686    pub fn as_generator_group(&self) -> GeneratorGroup {
687        let query = self.selection.select("asGeneratorGroup");
688        GeneratorGroup {
689            proc: self.proc.clone(),
690            selection: query,
691            graphql_client: self.graphql_client.clone(),
692        }
693    }
694    /// Retrieve the binding value, as type GitRef
695    pub fn as_git_ref(&self) -> GitRef {
696        let query = self.selection.select("asGitRef");
697        GitRef {
698            proc: self.proc.clone(),
699            selection: query,
700            graphql_client: self.graphql_client.clone(),
701        }
702    }
703    /// Retrieve the binding value, as type GitRepository
704    pub fn as_git_repository(&self) -> GitRepository {
705        let query = self.selection.select("asGitRepository");
706        GitRepository {
707            proc: self.proc.clone(),
708            selection: query,
709            graphql_client: self.graphql_client.clone(),
710        }
711    }
712    /// Retrieve the binding value, as type HTTPState
713    pub fn as_http_state(&self) -> HttpState {
714        let query = self.selection.select("asHTTPState");
715        HttpState {
716            proc: self.proc.clone(),
717            selection: query,
718            graphql_client: self.graphql_client.clone(),
719        }
720    }
721    /// Retrieve the binding value, as type JSONValue
722    pub fn as_json_value(&self) -> JsonValue {
723        let query = self.selection.select("asJSONValue");
724        JsonValue {
725            proc: self.proc.clone(),
726            selection: query,
727            graphql_client: self.graphql_client.clone(),
728        }
729    }
730    /// Retrieve the binding value, as type Module
731    pub fn as_module(&self) -> Module {
732        let query = self.selection.select("asModule");
733        Module {
734            proc: self.proc.clone(),
735            selection: query,
736            graphql_client: self.graphql_client.clone(),
737        }
738    }
739    /// Retrieve the binding value, as type ModuleConfigClient
740    pub fn as_module_config_client(&self) -> ModuleConfigClient {
741        let query = self.selection.select("asModuleConfigClient");
742        ModuleConfigClient {
743            proc: self.proc.clone(),
744            selection: query,
745            graphql_client: self.graphql_client.clone(),
746        }
747    }
748    /// Retrieve the binding value, as type ModuleSource
749    pub fn as_module_source(&self) -> ModuleSource {
750        let query = self.selection.select("asModuleSource");
751        ModuleSource {
752            proc: self.proc.clone(),
753            selection: query,
754            graphql_client: self.graphql_client.clone(),
755        }
756    }
757    /// Retrieve the binding value, as type SearchResult
758    pub fn as_search_result(&self) -> SearchResult {
759        let query = self.selection.select("asSearchResult");
760        SearchResult {
761            proc: self.proc.clone(),
762            selection: query,
763            graphql_client: self.graphql_client.clone(),
764        }
765    }
766    /// Retrieve the binding value, as type SearchSubmatch
767    pub fn as_search_submatch(&self) -> SearchSubmatch {
768        let query = self.selection.select("asSearchSubmatch");
769        SearchSubmatch {
770            proc: self.proc.clone(),
771            selection: query,
772            graphql_client: self.graphql_client.clone(),
773        }
774    }
775    /// Retrieve the binding value, as type Secret
776    pub fn as_secret(&self) -> Secret {
777        let query = self.selection.select("asSecret");
778        Secret {
779            proc: self.proc.clone(),
780            selection: query,
781            graphql_client: self.graphql_client.clone(),
782        }
783    }
784    /// Retrieve the binding value, as type Service
785    pub fn as_service(&self) -> Service {
786        let query = self.selection.select("asService");
787        Service {
788            proc: self.proc.clone(),
789            selection: query,
790            graphql_client: self.graphql_client.clone(),
791        }
792    }
793    /// Retrieve the binding value, as type Socket
794    pub fn as_socket(&self) -> Socket {
795        let query = self.selection.select("asSocket");
796        Socket {
797            proc: self.proc.clone(),
798            selection: query,
799            graphql_client: self.graphql_client.clone(),
800        }
801    }
802    /// Retrieve the binding value, as type Stat
803    pub fn as_stat(&self) -> Stat {
804        let query = self.selection.select("asStat");
805        Stat {
806            proc: self.proc.clone(),
807            selection: query,
808            graphql_client: self.graphql_client.clone(),
809        }
810    }
811    /// Returns the binding's string value
812    pub async fn as_string(&self) -> Result<String, DaggerError> {
813        let query = self.selection.select("asString");
814        query.execute(self.graphql_client.clone()).await
815    }
816    /// Retrieve the binding value, as type Up
817    pub fn as_up(&self) -> Up {
818        let query = self.selection.select("asUp");
819        Up {
820            proc: self.proc.clone(),
821            selection: query,
822            graphql_client: self.graphql_client.clone(),
823        }
824    }
825    /// Retrieve the binding value, as type UpGroup
826    pub fn as_up_group(&self) -> UpGroup {
827        let query = self.selection.select("asUpGroup");
828        UpGroup {
829            proc: self.proc.clone(),
830            selection: query,
831            graphql_client: self.graphql_client.clone(),
832        }
833    }
834    /// Retrieve the binding value, as type Workspace
835    pub fn as_workspace(&self) -> Workspace {
836        let query = self.selection.select("asWorkspace");
837        Workspace {
838            proc: self.proc.clone(),
839            selection: query,
840            graphql_client: self.graphql_client.clone(),
841        }
842    }
843    /// Returns the digest of the binding value
844    pub async fn digest(&self) -> Result<String, DaggerError> {
845        let query = self.selection.select("digest");
846        query.execute(self.graphql_client.clone()).await
847    }
848    /// A unique identifier for this Binding.
849    pub async fn id(&self) -> Result<Id, DaggerError> {
850        let query = self.selection.select("id");
851        query.execute(self.graphql_client.clone()).await
852    }
853    /// Returns true if the binding is null
854    pub async fn is_null(&self) -> Result<bool, DaggerError> {
855        let query = self.selection.select("isNull");
856        query.execute(self.graphql_client.clone()).await
857    }
858    /// Returns the binding name
859    pub async fn name(&self) -> Result<String, DaggerError> {
860        let query = self.selection.select("name");
861        query.execute(self.graphql_client.clone()).await
862    }
863    /// Returns the binding type
864    pub async fn type_name(&self) -> Result<String, DaggerError> {
865        let query = self.selection.select("typeName");
866        query.execute(self.graphql_client.clone()).await
867    }
868}
869impl Node for Binding {
870    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
871        let query = self.selection.select("id");
872        let graphql_client = self.graphql_client.clone();
873        async move { query.execute(graphql_client).await }
874    }
875}
876#[derive(Clone)]
877pub struct CacheVolume {
878    pub proc: Option<Arc<DaggerSessionProc>>,
879    pub selection: Selection,
880    pub graphql_client: DynGraphQLClient,
881}
882impl IntoID<Id> for CacheVolume {
883    fn into_id(
884        self,
885    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
886        Box::pin(async move { self.id().await })
887    }
888}
889impl Loadable for CacheVolume {
890    fn graphql_type() -> &'static str {
891        "CacheVolume"
892    }
893    fn from_query(
894        proc: Option<Arc<DaggerSessionProc>>,
895        selection: Selection,
896        graphql_client: DynGraphQLClient,
897    ) -> Self {
898        Self {
899            proc,
900            selection,
901            graphql_client,
902        }
903    }
904}
905impl CacheVolume {
906    /// A unique identifier for this CacheVolume.
907    pub async fn id(&self) -> Result<Id, DaggerError> {
908        let query = self.selection.select("id");
909        query.execute(self.graphql_client.clone()).await
910    }
911}
912impl Node for CacheVolume {
913    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
914        let query = self.selection.select("id");
915        let graphql_client = self.graphql_client.clone();
916        async move { query.execute(graphql_client).await }
917    }
918}
919#[derive(Clone)]
920pub struct Changeset {
921    pub proc: Option<Arc<DaggerSessionProc>>,
922    pub selection: Selection,
923    pub graphql_client: DynGraphQLClient,
924}
925#[derive(Builder, Debug, PartialEq)]
926pub struct ChangesetWithChangesetOpts {
927    /// What to do on a merge conflict
928    #[builder(setter(into, strip_option), default)]
929    pub on_conflict: Option<ChangesetMergeConflict>,
930}
931#[derive(Builder, Debug, PartialEq)]
932pub struct ChangesetWithChangesetsOpts {
933    /// What to do on a merge conflict
934    #[builder(setter(into, strip_option), default)]
935    pub on_conflict: Option<ChangesetsMergeConflict>,
936}
937impl IntoID<Id> for Changeset {
938    fn into_id(
939        self,
940    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
941        Box::pin(async move { self.id().await })
942    }
943}
944impl Loadable for Changeset {
945    fn graphql_type() -> &'static str {
946        "Changeset"
947    }
948    fn from_query(
949        proc: Option<Arc<DaggerSessionProc>>,
950        selection: Selection,
951        graphql_client: DynGraphQLClient,
952    ) -> Self {
953        Self {
954            proc,
955            selection,
956            graphql_client,
957        }
958    }
959}
960impl Changeset {
961    /// Files and directories that were added in the newer directory.
962    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
963        let query = self.selection.select("addedPaths");
964        query.execute(self.graphql_client.clone()).await
965    }
966    /// The newer/upper snapshot.
967    pub fn after(&self) -> Directory {
968        let query = self.selection.select("after");
969        Directory {
970            proc: self.proc.clone(),
971            selection: query,
972            graphql_client: self.graphql_client.clone(),
973        }
974    }
975    /// Return a Git-compatible patch of the changes
976    pub fn as_patch(&self) -> File {
977        let query = self.selection.select("asPatch");
978        File {
979            proc: self.proc.clone(),
980            selection: query,
981            graphql_client: self.graphql_client.clone(),
982        }
983    }
984    /// The older/lower snapshot to compare against.
985    pub fn before(&self) -> Directory {
986        let query = self.selection.select("before");
987        Directory {
988            proc: self.proc.clone(),
989            selection: query,
990            graphql_client: self.graphql_client.clone(),
991        }
992    }
993    /// Structured per-path diff statistics (kind and line counts) for this changeset.
994    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
995        let query = self.selection.select("diffStats");
996        let query = query.select("id");
997        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
998        Ok(ids
999            .into_iter()
1000            .map(|id| DiffStat {
1001                proc: self.proc.clone(),
1002                selection: crate::querybuilder::query()
1003                    .select("node")
1004                    .arg("id", &id.0)
1005                    .inline_fragment("DiffStat"),
1006                graphql_client: self.graphql_client.clone(),
1007            })
1008            .collect())
1009    }
1010    /// Applies the diff represented by this changeset to a path on the host.
1011    ///
1012    /// # Arguments
1013    ///
1014    /// * `path` - Location of the copied directory (e.g., "logs/").
1015    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
1016        let mut query = self.selection.select("export");
1017        query = query.arg("path", path.into());
1018        query.execute(self.graphql_client.clone()).await
1019    }
1020    /// A unique identifier for this Changeset.
1021    pub async fn id(&self) -> Result<Id, DaggerError> {
1022        let query = self.selection.select("id");
1023        query.execute(self.graphql_client.clone()).await
1024    }
1025    /// Returns true if the changeset is empty (i.e. there are no changes).
1026    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
1027        let query = self.selection.select("isEmpty");
1028        query.execute(self.graphql_client.clone()).await
1029    }
1030    /// Return a snapshot containing only the created and modified files
1031    pub fn layer(&self) -> Directory {
1032        let query = self.selection.select("layer");
1033        Directory {
1034            proc: self.proc.clone(),
1035            selection: query,
1036            graphql_client: self.graphql_client.clone(),
1037        }
1038    }
1039    /// Files and directories that existed before and were updated in the newer directory.
1040    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
1041        let query = self.selection.select("modifiedPaths");
1042        query.execute(self.graphql_client.clone()).await
1043    }
1044    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
1045    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
1046        let query = self.selection.select("removedPaths");
1047        query.execute(self.graphql_client.clone()).await
1048    }
1049    /// Force evaluation in the engine.
1050    pub async fn sync(&self) -> Result<Changeset, DaggerError> {
1051        let query = self.selection.select("sync");
1052        let id: Id = query.execute(self.graphql_client.clone()).await?;
1053        Ok(Changeset {
1054            proc: self.proc.clone(),
1055            selection: query
1056                .root()
1057                .select("node")
1058                .arg("id", &id.0)
1059                .inline_fragment("Changeset"),
1060            graphql_client: self.graphql_client.clone(),
1061        })
1062    }
1063    /// Add changes to an existing changeset
1064    /// 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
1065    ///
1066    /// # Arguments
1067    ///
1068    /// * `changes` - Changes to merge into the actual changeset
1069    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1070    pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
1071        let mut query = self.selection.select("withChangeset");
1072        query = query.arg_lazy(
1073            "changes",
1074            Box::new(move || {
1075                let changes = changes.clone();
1076                Box::pin(async move { changes.into_id().await.unwrap().quote() })
1077            }),
1078        );
1079        Changeset {
1080            proc: self.proc.clone(),
1081            selection: query,
1082            graphql_client: self.graphql_client.clone(),
1083        }
1084    }
1085    /// Add changes to an existing changeset
1086    /// 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
1087    ///
1088    /// # Arguments
1089    ///
1090    /// * `changes` - Changes to merge into the actual changeset
1091    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1092    pub fn with_changeset_opts(
1093        &self,
1094        changes: impl IntoID<Id>,
1095        opts: ChangesetWithChangesetOpts,
1096    ) -> Changeset {
1097        let mut query = self.selection.select("withChangeset");
1098        query = query.arg_lazy(
1099            "changes",
1100            Box::new(move || {
1101                let changes = changes.clone();
1102                Box::pin(async move { changes.into_id().await.unwrap().quote() })
1103            }),
1104        );
1105        if let Some(on_conflict) = opts.on_conflict {
1106            query = query.arg("onConflict", on_conflict);
1107        }
1108        Changeset {
1109            proc: self.proc.clone(),
1110            selection: query,
1111            graphql_client: self.graphql_client.clone(),
1112        }
1113    }
1114    /// Add changes from multiple changesets using git octopus merge strategy
1115    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
1116    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
1117    ///
1118    /// # Arguments
1119    ///
1120    /// * `changes` - List of changesets to merge into the actual changeset
1121    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1122    pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
1123        let mut query = self.selection.select("withChangesets");
1124        query = query.arg("changes", changes);
1125        Changeset {
1126            proc: self.proc.clone(),
1127            selection: query,
1128            graphql_client: self.graphql_client.clone(),
1129        }
1130    }
1131    /// Add changes from multiple changesets using git octopus merge strategy
1132    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
1133    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
1134    ///
1135    /// # Arguments
1136    ///
1137    /// * `changes` - List of changesets to merge into the actual changeset
1138    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1139    pub fn with_changesets_opts(
1140        &self,
1141        changes: Vec<Id>,
1142        opts: ChangesetWithChangesetsOpts,
1143    ) -> Changeset {
1144        let mut query = self.selection.select("withChangesets");
1145        query = query.arg("changes", changes);
1146        if let Some(on_conflict) = opts.on_conflict {
1147            query = query.arg("onConflict", on_conflict);
1148        }
1149        Changeset {
1150            proc: self.proc.clone(),
1151            selection: query,
1152            graphql_client: self.graphql_client.clone(),
1153        }
1154    }
1155}
1156impl Exportable for Changeset {
1157    fn export(
1158        &self,
1159        path: impl Into<String>,
1160    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
1161        let mut query = self.selection.select("export");
1162        query = query.arg("path", path.into());
1163        let graphql_client = self.graphql_client.clone();
1164        async move { query.execute(graphql_client).await }
1165    }
1166    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1167        let query = self.selection.select("id");
1168        let graphql_client = self.graphql_client.clone();
1169        async move { query.execute(graphql_client).await }
1170    }
1171}
1172impl Node for Changeset {
1173    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1174        let query = self.selection.select("id");
1175        let graphql_client = self.graphql_client.clone();
1176        async move { query.execute(graphql_client).await }
1177    }
1178}
1179impl Syncer for Changeset {
1180    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1181        let query = self.selection.select("id");
1182        let graphql_client = self.graphql_client.clone();
1183        async move { query.execute(graphql_client).await }
1184    }
1185    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1186        let query = self.selection.select("sync");
1187        let graphql_client = self.graphql_client.clone();
1188        async move { query.execute(graphql_client).await }
1189    }
1190}
1191#[derive(Clone)]
1192pub struct Check {
1193    pub proc: Option<Arc<DaggerSessionProc>>,
1194    pub selection: Selection,
1195    pub graphql_client: DynGraphQLClient,
1196}
1197impl IntoID<Id> for Check {
1198    fn into_id(
1199        self,
1200    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1201        Box::pin(async move { self.id().await })
1202    }
1203}
1204impl Loadable for Check {
1205    fn graphql_type() -> &'static str {
1206        "Check"
1207    }
1208    fn from_query(
1209        proc: Option<Arc<DaggerSessionProc>>,
1210        selection: Selection,
1211        graphql_client: DynGraphQLClient,
1212    ) -> Self {
1213        Self {
1214            proc,
1215            selection,
1216            graphql_client,
1217        }
1218    }
1219}
1220impl Check {
1221    /// The type of check: 'check' for annotated checks, 'generate' for generate-as-checks
1222    pub async fn check_type(&self) -> Result<String, DaggerError> {
1223        let query = self.selection.select("checkType");
1224        query.execute(self.graphql_client.clone()).await
1225    }
1226    /// Whether the check completed
1227    pub async fn completed(&self) -> Result<bool, DaggerError> {
1228        let query = self.selection.select("completed");
1229        query.execute(self.graphql_client.clone()).await
1230    }
1231    /// The description of the check
1232    pub async fn description(&self) -> Result<String, DaggerError> {
1233        let query = self.selection.select("description");
1234        query.execute(self.graphql_client.clone()).await
1235    }
1236    /// If the check failed, this is the error
1237    pub fn error(&self) -> Error {
1238        let query = self.selection.select("error");
1239        Error {
1240            proc: self.proc.clone(),
1241            selection: query,
1242            graphql_client: self.graphql_client.clone(),
1243        }
1244    }
1245    /// A unique identifier for this Check.
1246    pub async fn id(&self) -> Result<Id, DaggerError> {
1247        let query = self.selection.select("id");
1248        query.execute(self.graphql_client.clone()).await
1249    }
1250    /// Return the fully qualified name of the check
1251    pub async fn name(&self) -> Result<String, DaggerError> {
1252        let query = self.selection.select("name");
1253        query.execute(self.graphql_client.clone()).await
1254    }
1255    /// The original module in which the check has been defined
1256    pub fn original_module(&self) -> Module {
1257        let query = self.selection.select("originalModule");
1258        Module {
1259            proc: self.proc.clone(),
1260            selection: query,
1261            graphql_client: self.graphql_client.clone(),
1262        }
1263    }
1264    /// Whether the check passed
1265    pub async fn passed(&self) -> Result<bool, DaggerError> {
1266        let query = self.selection.select("passed");
1267        query.execute(self.graphql_client.clone()).await
1268    }
1269    /// The path of the check within its module
1270    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1271        let query = self.selection.select("path");
1272        query.execute(self.graphql_client.clone()).await
1273    }
1274    /// An emoji representing the result of the check
1275    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1276        let query = self.selection.select("resultEmoji");
1277        query.execute(self.graphql_client.clone()).await
1278    }
1279    /// Execute the check
1280    pub fn run(&self) -> Check {
1281        let query = self.selection.select("run");
1282        Check {
1283            proc: self.proc.clone(),
1284            selection: query,
1285            graphql_client: self.graphql_client.clone(),
1286        }
1287    }
1288}
1289impl Node for Check {
1290    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1291        let query = self.selection.select("id");
1292        let graphql_client = self.graphql_client.clone();
1293        async move { query.execute(graphql_client).await }
1294    }
1295}
1296#[derive(Clone)]
1297pub struct CheckGroup {
1298    pub proc: Option<Arc<DaggerSessionProc>>,
1299    pub selection: Selection,
1300    pub graphql_client: DynGraphQLClient,
1301}
1302#[derive(Builder, Debug, PartialEq)]
1303pub struct CheckGroupRunOpts {
1304    /// If true, stop running checks as soon as any check fails.
1305    #[builder(setter(into, strip_option), default)]
1306    pub fail_fast: Option<bool>,
1307}
1308impl IntoID<Id> for CheckGroup {
1309    fn into_id(
1310        self,
1311    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1312        Box::pin(async move { self.id().await })
1313    }
1314}
1315impl Loadable for CheckGroup {
1316    fn graphql_type() -> &'static str {
1317        "CheckGroup"
1318    }
1319    fn from_query(
1320        proc: Option<Arc<DaggerSessionProc>>,
1321        selection: Selection,
1322        graphql_client: DynGraphQLClient,
1323    ) -> Self {
1324        Self {
1325            proc,
1326            selection,
1327            graphql_client,
1328        }
1329    }
1330}
1331impl CheckGroup {
1332    /// A unique identifier for this CheckGroup.
1333    pub async fn id(&self) -> Result<Id, DaggerError> {
1334        let query = self.selection.select("id");
1335        query.execute(self.graphql_client.clone()).await
1336    }
1337    /// Return a list of individual checks and their details
1338    pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1339        let query = self.selection.select("list");
1340        let query = query.select("id");
1341        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1342        Ok(ids
1343            .into_iter()
1344            .map(|id| Check {
1345                proc: self.proc.clone(),
1346                selection: crate::querybuilder::query()
1347                    .select("node")
1348                    .arg("id", &id.0)
1349                    .inline_fragment("Check"),
1350                graphql_client: self.graphql_client.clone(),
1351            })
1352            .collect())
1353    }
1354    /// Generate a markdown report
1355    pub fn report(&self) -> File {
1356        let query = self.selection.select("report");
1357        File {
1358            proc: self.proc.clone(),
1359            selection: query,
1360            graphql_client: self.graphql_client.clone(),
1361        }
1362    }
1363    /// Execute all selected checks
1364    ///
1365    /// # Arguments
1366    ///
1367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1368    pub fn run(&self) -> CheckGroup {
1369        let query = self.selection.select("run");
1370        CheckGroup {
1371            proc: self.proc.clone(),
1372            selection: query,
1373            graphql_client: self.graphql_client.clone(),
1374        }
1375    }
1376    /// Execute all selected checks
1377    ///
1378    /// # Arguments
1379    ///
1380    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1381    pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1382        let mut query = self.selection.select("run");
1383        if let Some(fail_fast) = opts.fail_fast {
1384            query = query.arg("failFast", fail_fast);
1385        }
1386        CheckGroup {
1387            proc: self.proc.clone(),
1388            selection: query,
1389            graphql_client: self.graphql_client.clone(),
1390        }
1391    }
1392}
1393impl Node for CheckGroup {
1394    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1395        let query = self.selection.select("id");
1396        let graphql_client = self.graphql_client.clone();
1397        async move { query.execute(graphql_client).await }
1398    }
1399}
1400#[derive(Clone)]
1401pub struct ClientFilesyncMirror {
1402    pub proc: Option<Arc<DaggerSessionProc>>,
1403    pub selection: Selection,
1404    pub graphql_client: DynGraphQLClient,
1405}
1406impl IntoID<Id> for ClientFilesyncMirror {
1407    fn into_id(
1408        self,
1409    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1410        Box::pin(async move { self.id().await })
1411    }
1412}
1413impl Loadable for ClientFilesyncMirror {
1414    fn graphql_type() -> &'static str {
1415        "ClientFilesyncMirror"
1416    }
1417    fn from_query(
1418        proc: Option<Arc<DaggerSessionProc>>,
1419        selection: Selection,
1420        graphql_client: DynGraphQLClient,
1421    ) -> Self {
1422        Self {
1423            proc,
1424            selection,
1425            graphql_client,
1426        }
1427    }
1428}
1429impl ClientFilesyncMirror {
1430    /// A unique identifier for this ClientFilesyncMirror.
1431    pub async fn id(&self) -> Result<Id, DaggerError> {
1432        let query = self.selection.select("id");
1433        query.execute(self.graphql_client.clone()).await
1434    }
1435}
1436impl Node for ClientFilesyncMirror {
1437    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1438        let query = self.selection.select("id");
1439        let graphql_client = self.graphql_client.clone();
1440        async move { query.execute(graphql_client).await }
1441    }
1442}
1443#[derive(Clone)]
1444pub struct Cloud {
1445    pub proc: Option<Arc<DaggerSessionProc>>,
1446    pub selection: Selection,
1447    pub graphql_client: DynGraphQLClient,
1448}
1449impl IntoID<Id> for Cloud {
1450    fn into_id(
1451        self,
1452    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1453        Box::pin(async move { self.id().await })
1454    }
1455}
1456impl Loadable for Cloud {
1457    fn graphql_type() -> &'static str {
1458        "Cloud"
1459    }
1460    fn from_query(
1461        proc: Option<Arc<DaggerSessionProc>>,
1462        selection: Selection,
1463        graphql_client: DynGraphQLClient,
1464    ) -> Self {
1465        Self {
1466            proc,
1467            selection,
1468            graphql_client,
1469        }
1470    }
1471}
1472impl Cloud {
1473    /// A unique identifier for this Cloud.
1474    pub async fn id(&self) -> Result<Id, DaggerError> {
1475        let query = self.selection.select("id");
1476        query.execute(self.graphql_client.clone()).await
1477    }
1478    /// The trace URL for the current session
1479    pub async fn trace_url(&self) -> Result<String, DaggerError> {
1480        let query = self.selection.select("traceURL");
1481        query.execute(self.graphql_client.clone()).await
1482    }
1483}
1484impl Node for Cloud {
1485    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1486        let query = self.selection.select("id");
1487        let graphql_client = self.graphql_client.clone();
1488        async move { query.execute(graphql_client).await }
1489    }
1490}
1491#[derive(Clone)]
1492pub struct Container {
1493    pub proc: Option<Arc<DaggerSessionProc>>,
1494    pub selection: Selection,
1495    pub graphql_client: DynGraphQLClient,
1496}
1497#[derive(Builder, Debug, PartialEq)]
1498pub struct ContainerAsServiceOpts<'a> {
1499    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1500    /// If empty, the container's default command is used.
1501    #[builder(setter(into, strip_option), default)]
1502    pub args: Option<Vec<&'a str>>,
1503    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1504    #[builder(setter(into, strip_option), default)]
1505    pub expand: Option<bool>,
1506    /// Provides Dagger access to the executed command.
1507    #[builder(setter(into, strip_option), default)]
1508    pub experimental_privileged_nesting: Option<bool>,
1509    /// 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.
1510    #[builder(setter(into, strip_option), default)]
1511    pub insecure_root_capabilities: Option<bool>,
1512    /// If set, skip the automatic init process injected into containers by default.
1513    /// 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.
1514    #[builder(setter(into, strip_option), default)]
1515    pub no_init: Option<bool>,
1516    /// If the container has an entrypoint, prepend it to the args.
1517    #[builder(setter(into, strip_option), default)]
1518    pub use_entrypoint: Option<bool>,
1519}
1520#[derive(Builder, Debug, PartialEq)]
1521pub struct ContainerAsTarballOpts {
1522    /// Force each layer of the image to use the specified compression algorithm.
1523    /// 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.
1524    #[builder(setter(into, strip_option), default)]
1525    pub forced_compression: Option<ImageLayerCompression>,
1526    /// Use the specified media types for the image's layers.
1527    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1528    #[builder(setter(into, strip_option), default)]
1529    pub media_types: Option<ImageMediaTypes>,
1530    /// Identifiers for other platform specific containers.
1531    /// Used for multi-platform images.
1532    #[builder(setter(into, strip_option), default)]
1533    pub platform_variants: Option<Vec<Id>>,
1534}
1535#[derive(Builder, Debug, PartialEq)]
1536pub struct ContainerDirectoryOpts {
1537    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1538    #[builder(setter(into, strip_option), default)]
1539    pub expand: Option<bool>,
1540}
1541#[derive(Builder, Debug, PartialEq)]
1542pub struct ContainerExistsOpts {
1543    /// If specified, do not follow symlinks.
1544    #[builder(setter(into, strip_option), default)]
1545    pub do_not_follow_symlinks: Option<bool>,
1546    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1547    #[builder(setter(into, strip_option), default)]
1548    pub expand: Option<bool>,
1549    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
1550    #[builder(setter(into, strip_option), default)]
1551    pub expected_type: Option<ExistsType>,
1552}
1553#[derive(Builder, Debug, PartialEq)]
1554pub struct ContainerExportOpts {
1555    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1556    #[builder(setter(into, strip_option), default)]
1557    pub expand: Option<bool>,
1558    /// Force each layer of the exported image to use the specified compression algorithm.
1559    /// 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.
1560    #[builder(setter(into, strip_option), default)]
1561    pub forced_compression: Option<ImageLayerCompression>,
1562    /// Use the specified media types for the exported image's layers.
1563    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1564    #[builder(setter(into, strip_option), default)]
1565    pub media_types: Option<ImageMediaTypes>,
1566    /// Identifiers for other platform specific containers.
1567    /// Used for multi-platform image.
1568    #[builder(setter(into, strip_option), default)]
1569    pub platform_variants: Option<Vec<Id>>,
1570}
1571#[derive(Builder, Debug, PartialEq)]
1572pub struct ContainerExportImageOpts {
1573    /// Force each layer of the exported image to use the specified compression algorithm.
1574    /// 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.
1575    #[builder(setter(into, strip_option), default)]
1576    pub forced_compression: Option<ImageLayerCompression>,
1577    /// Use the specified media types for the exported image's layers.
1578    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1579    #[builder(setter(into, strip_option), default)]
1580    pub media_types: Option<ImageMediaTypes>,
1581    /// Identifiers for other platform specific containers.
1582    /// Used for multi-platform image.
1583    #[builder(setter(into, strip_option), default)]
1584    pub platform_variants: Option<Vec<Id>>,
1585}
1586#[derive(Builder, Debug, PartialEq)]
1587pub struct ContainerFileOpts {
1588    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1589    #[builder(setter(into, strip_option), default)]
1590    pub expand: Option<bool>,
1591}
1592#[derive(Builder, Debug, PartialEq)]
1593pub struct ContainerImportOpts<'a> {
1594    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1595    #[builder(setter(into, strip_option), default)]
1596    pub tag: Option<&'a str>,
1597}
1598#[derive(Builder, Debug, PartialEq)]
1599pub struct ContainerPublishOpts {
1600    /// Force each layer of the published image to use the specified compression algorithm.
1601    /// 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.
1602    #[builder(setter(into, strip_option), default)]
1603    pub forced_compression: Option<ImageLayerCompression>,
1604    /// Use the specified media types for the published image's layers.
1605    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1606    #[builder(setter(into, strip_option), default)]
1607    pub media_types: Option<ImageMediaTypes>,
1608    /// Identifiers for other platform specific containers.
1609    /// Used for multi-platform image.
1610    #[builder(setter(into, strip_option), default)]
1611    pub platform_variants: Option<Vec<Id>>,
1612}
1613#[derive(Builder, Debug, PartialEq)]
1614pub struct ContainerStatOpts {
1615    /// If specified, do not follow symlinks.
1616    #[builder(setter(into, strip_option), default)]
1617    pub do_not_follow_symlinks: Option<bool>,
1618}
1619#[derive(Builder, Debug, PartialEq)]
1620pub struct ContainerTerminalOpts<'a> {
1621    /// If set, override the container's default terminal command and invoke these command arguments instead.
1622    #[builder(setter(into, strip_option), default)]
1623    pub cmd: Option<Vec<&'a str>>,
1624    /// Provides Dagger access to the executed command.
1625    #[builder(setter(into, strip_option), default)]
1626    pub experimental_privileged_nesting: Option<bool>,
1627    /// 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.
1628    #[builder(setter(into, strip_option), default)]
1629    pub insecure_root_capabilities: Option<bool>,
1630}
1631#[derive(Builder, Debug, PartialEq)]
1632pub struct ContainerUpOpts<'a> {
1633    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1634    /// If empty, the container's default command is used.
1635    #[builder(setter(into, strip_option), default)]
1636    pub args: Option<Vec<&'a str>>,
1637    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1638    #[builder(setter(into, strip_option), default)]
1639    pub expand: Option<bool>,
1640    /// Provides Dagger access to the executed command.
1641    #[builder(setter(into, strip_option), default)]
1642    pub experimental_privileged_nesting: Option<bool>,
1643    /// 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.
1644    #[builder(setter(into, strip_option), default)]
1645    pub insecure_root_capabilities: Option<bool>,
1646    /// If set, skip the automatic init process injected into containers by default.
1647    /// 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.
1648    #[builder(setter(into, strip_option), default)]
1649    pub no_init: Option<bool>,
1650    /// List of frontend/backend port mappings to forward.
1651    /// Frontend is the port accepting traffic on the host, backend is the service port.
1652    #[builder(setter(into, strip_option), default)]
1653    pub ports: Option<Vec<PortForward>>,
1654    /// Bind each tunnel port to a random port on the host.
1655    #[builder(setter(into, strip_option), default)]
1656    pub random: Option<bool>,
1657    /// If the container has an entrypoint, prepend it to the args.
1658    #[builder(setter(into, strip_option), default)]
1659    pub use_entrypoint: Option<bool>,
1660}
1661#[derive(Builder, Debug, PartialEq)]
1662pub struct ContainerWithDefaultTerminalCmdOpts {
1663    /// Provides Dagger access to the executed command.
1664    #[builder(setter(into, strip_option), default)]
1665    pub experimental_privileged_nesting: Option<bool>,
1666    /// 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.
1667    #[builder(setter(into, strip_option), default)]
1668    pub insecure_root_capabilities: Option<bool>,
1669}
1670#[derive(Builder, Debug, PartialEq)]
1671pub struct ContainerWithDirectoryOpts<'a> {
1672    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
1673    #[builder(setter(into, strip_option), default)]
1674    pub exclude: Option<Vec<&'a str>>,
1675    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1676    #[builder(setter(into, strip_option), default)]
1677    pub expand: Option<bool>,
1678    /// Apply .gitignore rules when writing the directory.
1679    #[builder(setter(into, strip_option), default)]
1680    pub gitignore: Option<bool>,
1681    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
1682    #[builder(setter(into, strip_option), default)]
1683    pub include: Option<Vec<&'a str>>,
1684    /// A user:group to set for the directory and its contents.
1685    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1686    /// If the group is omitted, it defaults to the same as the user.
1687    #[builder(setter(into, strip_option), default)]
1688    pub owner: Option<&'a str>,
1689    #[builder(setter(into, strip_option), default)]
1690    pub permissions: Option<isize>,
1691}
1692#[derive(Builder, Debug, PartialEq)]
1693pub struct ContainerWithDockerHealthcheckOpts<'a> {
1694    /// Interval between running healthcheck. Example: "30s"
1695    #[builder(setter(into, strip_option), default)]
1696    pub interval: Option<&'a str>,
1697    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
1698    #[builder(setter(into, strip_option), default)]
1699    pub retries: Option<isize>,
1700    /// When true, command must be a single element, which is run using the container's shell
1701    #[builder(setter(into, strip_option), default)]
1702    pub shell: Option<bool>,
1703    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
1704    #[builder(setter(into, strip_option), default)]
1705    pub start_interval: Option<&'a str>,
1706    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
1707    #[builder(setter(into, strip_option), default)]
1708    pub start_period: Option<&'a str>,
1709    /// Healthcheck timeout. Example: "3s"
1710    #[builder(setter(into, strip_option), default)]
1711    pub timeout: Option<&'a str>,
1712}
1713#[derive(Builder, Debug, PartialEq)]
1714pub struct ContainerWithEntrypointOpts {
1715    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
1716    #[builder(setter(into, strip_option), default)]
1717    pub keep_default_args: Option<bool>,
1718}
1719#[derive(Builder, Debug, PartialEq)]
1720pub struct ContainerWithEnvVariableOpts {
1721    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
1722    #[builder(setter(into, strip_option), default)]
1723    pub expand: Option<bool>,
1724}
1725#[derive(Builder, Debug, PartialEq)]
1726pub struct ContainerWithExecOpts<'a> {
1727    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1728    #[builder(setter(into, strip_option), default)]
1729    pub expand: Option<bool>,
1730    /// Exit codes this command is allowed to exit with without error
1731    #[builder(setter(into, strip_option), default)]
1732    pub expect: Option<ReturnType>,
1733    /// Provides Dagger access to the executed command.
1734    #[builder(setter(into, strip_option), default)]
1735    pub experimental_privileged_nesting: Option<bool>,
1736    /// Execute the command with all root capabilities. Like --privileged in Docker
1737    /// 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.
1738    #[builder(setter(into, strip_option), default)]
1739    pub insecure_root_capabilities: Option<bool>,
1740    /// Skip the automatic init process injected into containers by default.
1741    /// 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.
1742    #[builder(setter(into, strip_option), default)]
1743    pub no_init: Option<bool>,
1744    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
1745    #[builder(setter(into, strip_option), default)]
1746    pub redirect_stderr: Option<&'a str>,
1747    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
1748    #[builder(setter(into, strip_option), default)]
1749    pub redirect_stdin: Option<&'a str>,
1750    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
1751    #[builder(setter(into, strip_option), default)]
1752    pub redirect_stdout: Option<&'a str>,
1753    /// Content to write to the command's standard input. Example: "Hello world")
1754    #[builder(setter(into, strip_option), default)]
1755    pub stdin: Option<&'a str>,
1756    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
1757    #[builder(setter(into, strip_option), default)]
1758    pub use_entrypoint: Option<bool>,
1759}
1760#[derive(Builder, Debug, PartialEq)]
1761pub struct ContainerWithExposedPortOpts<'a> {
1762    /// Port description. Example: "payment API endpoint"
1763    #[builder(setter(into, strip_option), default)]
1764    pub description: Option<&'a str>,
1765    /// Skip the health check when run as a service.
1766    #[builder(setter(into, strip_option), default)]
1767    pub experimental_skip_healthcheck: Option<bool>,
1768    /// Network protocol. Example: "tcp"
1769    #[builder(setter(into, strip_option), default)]
1770    pub protocol: Option<NetworkProtocol>,
1771}
1772#[derive(Builder, Debug, PartialEq)]
1773pub struct ContainerWithFileOpts<'a> {
1774    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1775    #[builder(setter(into, strip_option), default)]
1776    pub expand: Option<bool>,
1777    /// A user:group to set for the file.
1778    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1779    /// If the group is omitted, it defaults to the same as the user.
1780    #[builder(setter(into, strip_option), default)]
1781    pub owner: Option<&'a str>,
1782    /// Permissions of the new file. Example: 0600
1783    #[builder(setter(into, strip_option), default)]
1784    pub permissions: Option<isize>,
1785}
1786#[derive(Builder, Debug, PartialEq)]
1787pub struct ContainerWithFilesOpts<'a> {
1788    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1789    #[builder(setter(into, strip_option), default)]
1790    pub expand: Option<bool>,
1791    /// A user:group to set for the files.
1792    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1793    /// If the group is omitted, it defaults to the same as the user.
1794    #[builder(setter(into, strip_option), default)]
1795    pub owner: Option<&'a str>,
1796    /// Permission given to the copied files (e.g., 0600).
1797    #[builder(setter(into, strip_option), default)]
1798    pub permissions: Option<isize>,
1799}
1800#[derive(Builder, Debug, PartialEq)]
1801pub struct ContainerWithMountedCacheOpts<'a> {
1802    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1803    #[builder(setter(into, strip_option), default)]
1804    pub expand: Option<bool>,
1805    /// A user:group to set for the mounted cache directory.
1806    /// 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.
1807    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1808    /// If the group is omitted, it defaults to the same as the user.
1809    #[builder(setter(into, strip_option), default)]
1810    pub owner: Option<&'a str>,
1811    /// Sharing mode of the cache volume.
1812    #[builder(setter(into, strip_option), default)]
1813    pub sharing: Option<CacheSharingMode>,
1814    /// Identifier of the directory to use as the cache volume's root.
1815    #[builder(setter(into, strip_option), default)]
1816    pub source: Option<Id>,
1817}
1818#[derive(Builder, Debug, PartialEq)]
1819pub struct ContainerWithMountedDirectoryOpts<'a> {
1820    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1821    #[builder(setter(into, strip_option), default)]
1822    pub expand: Option<bool>,
1823    /// A user:group to set for the mounted directory and its contents.
1824    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1825    /// If the group is omitted, it defaults to the same as the user.
1826    #[builder(setter(into, strip_option), default)]
1827    pub owner: Option<&'a str>,
1828    /// Mount the directory read-only.
1829    #[builder(setter(into, strip_option), default)]
1830    pub read_only: Option<bool>,
1831}
1832#[derive(Builder, Debug, PartialEq)]
1833pub struct ContainerWithMountedFileOpts<'a> {
1834    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1835    #[builder(setter(into, strip_option), default)]
1836    pub expand: Option<bool>,
1837    /// A user or user:group to set for the mounted file.
1838    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1839    /// If the group is omitted, it defaults to the same as the user.
1840    #[builder(setter(into, strip_option), default)]
1841    pub owner: Option<&'a str>,
1842}
1843#[derive(Builder, Debug, PartialEq)]
1844pub struct ContainerWithMountedSecretOpts<'a> {
1845    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1846    #[builder(setter(into, strip_option), default)]
1847    pub expand: Option<bool>,
1848    /// Permission given to the mounted secret (e.g., 0600).
1849    /// This option requires an owner to be set to be active.
1850    #[builder(setter(into, strip_option), default)]
1851    pub mode: Option<isize>,
1852    /// A user:group to set for the mounted secret.
1853    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1854    /// If the group is omitted, it defaults to the same as the user.
1855    #[builder(setter(into, strip_option), default)]
1856    pub owner: Option<&'a str>,
1857}
1858#[derive(Builder, Debug, PartialEq)]
1859pub struct ContainerWithMountedTempOpts {
1860    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1861    #[builder(setter(into, strip_option), default)]
1862    pub expand: Option<bool>,
1863    /// Size of the temporary directory in bytes.
1864    #[builder(setter(into, strip_option), default)]
1865    pub size: Option<isize>,
1866}
1867#[derive(Builder, Debug, PartialEq)]
1868pub struct ContainerWithNewFileOpts<'a> {
1869    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1870    #[builder(setter(into, strip_option), default)]
1871    pub expand: Option<bool>,
1872    /// A user:group to set for the file.
1873    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1874    /// If the group is omitted, it defaults to the same as the user.
1875    #[builder(setter(into, strip_option), default)]
1876    pub owner: Option<&'a str>,
1877    /// Permissions of the new file. Example: 0600
1878    #[builder(setter(into, strip_option), default)]
1879    pub permissions: Option<isize>,
1880}
1881#[derive(Builder, Debug, PartialEq)]
1882pub struct ContainerWithSymlinkOpts {
1883    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1884    #[builder(setter(into, strip_option), default)]
1885    pub expand: Option<bool>,
1886}
1887#[derive(Builder, Debug, PartialEq)]
1888pub struct ContainerWithUnixSocketOpts<'a> {
1889    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1890    #[builder(setter(into, strip_option), default)]
1891    pub expand: Option<bool>,
1892    /// A user:group to set for the mounted socket.
1893    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1894    /// If the group is omitted, it defaults to the same as the user.
1895    #[builder(setter(into, strip_option), default)]
1896    pub owner: Option<&'a str>,
1897}
1898#[derive(Builder, Debug, PartialEq)]
1899pub struct ContainerWithWorkdirOpts {
1900    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1901    #[builder(setter(into, strip_option), default)]
1902    pub expand: Option<bool>,
1903}
1904#[derive(Builder, Debug, PartialEq)]
1905pub struct ContainerWithoutDirectoryOpts {
1906    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1907    #[builder(setter(into, strip_option), default)]
1908    pub expand: Option<bool>,
1909}
1910#[derive(Builder, Debug, PartialEq)]
1911pub struct ContainerWithoutEntrypointOpts {
1912    /// Don't remove the default arguments when unsetting the entrypoint.
1913    #[builder(setter(into, strip_option), default)]
1914    pub keep_default_args: Option<bool>,
1915}
1916#[derive(Builder, Debug, PartialEq)]
1917pub struct ContainerWithoutExposedPortOpts {
1918    /// Port protocol to unexpose
1919    #[builder(setter(into, strip_option), default)]
1920    pub protocol: Option<NetworkProtocol>,
1921}
1922#[derive(Builder, Debug, PartialEq)]
1923pub struct ContainerWithoutFileOpts {
1924    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1925    #[builder(setter(into, strip_option), default)]
1926    pub expand: Option<bool>,
1927}
1928#[derive(Builder, Debug, PartialEq)]
1929pub struct ContainerWithoutFilesOpts {
1930    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1931    #[builder(setter(into, strip_option), default)]
1932    pub expand: Option<bool>,
1933}
1934#[derive(Builder, Debug, PartialEq)]
1935pub struct ContainerWithoutMountOpts {
1936    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1937    #[builder(setter(into, strip_option), default)]
1938    pub expand: Option<bool>,
1939}
1940#[derive(Builder, Debug, PartialEq)]
1941pub struct ContainerWithoutUnixSocketOpts {
1942    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1943    #[builder(setter(into, strip_option), default)]
1944    pub expand: Option<bool>,
1945}
1946impl IntoID<Id> for Container {
1947    fn into_id(
1948        self,
1949    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1950        Box::pin(async move { self.id().await })
1951    }
1952}
1953impl Loadable for Container {
1954    fn graphql_type() -> &'static str {
1955        "Container"
1956    }
1957    fn from_query(
1958        proc: Option<Arc<DaggerSessionProc>>,
1959        selection: Selection,
1960        graphql_client: DynGraphQLClient,
1961    ) -> Self {
1962        Self {
1963            proc,
1964            selection,
1965            graphql_client,
1966        }
1967    }
1968}
1969impl Container {
1970    /// Turn the container into a Service.
1971    /// Be sure to set any exposed ports before this conversion.
1972    ///
1973    /// # Arguments
1974    ///
1975    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1976    pub fn as_service(&self) -> Service {
1977        let query = self.selection.select("asService");
1978        Service {
1979            proc: self.proc.clone(),
1980            selection: query,
1981            graphql_client: self.graphql_client.clone(),
1982        }
1983    }
1984    /// Turn the container into a Service.
1985    /// Be sure to set any exposed ports before this conversion.
1986    ///
1987    /// # Arguments
1988    ///
1989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1990    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1991        let mut query = self.selection.select("asService");
1992        if let Some(args) = opts.args {
1993            query = query.arg("args", args);
1994        }
1995        if let Some(use_entrypoint) = opts.use_entrypoint {
1996            query = query.arg("useEntrypoint", use_entrypoint);
1997        }
1998        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1999            query = query.arg(
2000                "experimentalPrivilegedNesting",
2001                experimental_privileged_nesting,
2002            );
2003        }
2004        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2005            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2006        }
2007        if let Some(expand) = opts.expand {
2008            query = query.arg("expand", expand);
2009        }
2010        if let Some(no_init) = opts.no_init {
2011            query = query.arg("noInit", no_init);
2012        }
2013        Service {
2014            proc: self.proc.clone(),
2015            selection: query,
2016            graphql_client: self.graphql_client.clone(),
2017        }
2018    }
2019    /// Package the container state as an OCI image, and return it as a tar archive
2020    ///
2021    /// # Arguments
2022    ///
2023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2024    pub fn as_tarball(&self) -> File {
2025        let query = self.selection.select("asTarball");
2026        File {
2027            proc: self.proc.clone(),
2028            selection: query,
2029            graphql_client: self.graphql_client.clone(),
2030        }
2031    }
2032    /// Package the container state as an OCI image, and return it as a tar archive
2033    ///
2034    /// # Arguments
2035    ///
2036    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2037    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2038        let mut query = self.selection.select("asTarball");
2039        if let Some(platform_variants) = opts.platform_variants {
2040            query = query.arg("platformVariants", platform_variants);
2041        }
2042        if let Some(forced_compression) = opts.forced_compression {
2043            query = query.arg("forcedCompression", forced_compression);
2044        }
2045        if let Some(media_types) = opts.media_types {
2046            query = query.arg("mediaTypes", media_types);
2047        }
2048        File {
2049            proc: self.proc.clone(),
2050            selection: query,
2051            graphql_client: self.graphql_client.clone(),
2052        }
2053    }
2054    /// The combined buffered standard output and standard error stream of the last executed command
2055    /// Returns an error if no command was executed
2056    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2057        let query = self.selection.select("combinedOutput");
2058        query.execute(self.graphql_client.clone()).await
2059    }
2060    /// Return the container's default arguments.
2061    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2062        let query = self.selection.select("defaultArgs");
2063        query.execute(self.graphql_client.clone()).await
2064    }
2065    /// Retrieve a directory from the container's root filesystem
2066    /// Mounts are included.
2067    ///
2068    /// # Arguments
2069    ///
2070    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2072    pub fn directory(&self, path: impl Into<String>) -> Directory {
2073        let mut query = self.selection.select("directory");
2074        query = query.arg("path", path.into());
2075        Directory {
2076            proc: self.proc.clone(),
2077            selection: query,
2078            graphql_client: self.graphql_client.clone(),
2079        }
2080    }
2081    /// Retrieve a directory from the container's root filesystem
2082    /// Mounts are included.
2083    ///
2084    /// # Arguments
2085    ///
2086    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2088    pub fn directory_opts(
2089        &self,
2090        path: impl Into<String>,
2091        opts: ContainerDirectoryOpts,
2092    ) -> Directory {
2093        let mut query = self.selection.select("directory");
2094        query = query.arg("path", path.into());
2095        if let Some(expand) = opts.expand {
2096            query = query.arg("expand", expand);
2097        }
2098        Directory {
2099            proc: self.proc.clone(),
2100            selection: query,
2101            graphql_client: self.graphql_client.clone(),
2102        }
2103    }
2104    /// Retrieves this container's configured docker healthcheck.
2105    pub fn docker_healthcheck(&self) -> HealthcheckConfig {
2106        let query = self.selection.select("dockerHealthcheck");
2107        HealthcheckConfig {
2108            proc: self.proc.clone(),
2109            selection: query,
2110            graphql_client: self.graphql_client.clone(),
2111        }
2112    }
2113    /// Return the container's OCI entrypoint.
2114    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2115        let query = self.selection.select("entrypoint");
2116        query.execute(self.graphql_client.clone()).await
2117    }
2118    /// Retrieves the value of the specified persistent environment variable.
2119    ///
2120    /// # Arguments
2121    ///
2122    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2123    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2124        let mut query = self.selection.select("envVariable");
2125        query = query.arg("name", name.into());
2126        query.execute(self.graphql_client.clone()).await
2127    }
2128    /// Retrieves the list of persistent environment variables configured on the container.
2129    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2130        let query = self.selection.select("envVariables");
2131        let query = query.select("id");
2132        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2133        Ok(ids
2134            .into_iter()
2135            .map(|id| EnvVariable {
2136                proc: self.proc.clone(),
2137                selection: crate::querybuilder::query()
2138                    .select("node")
2139                    .arg("id", &id.0)
2140                    .inline_fragment("EnvVariable"),
2141                graphql_client: self.graphql_client.clone(),
2142            })
2143            .collect())
2144    }
2145    /// check if a file or directory exists
2146    ///
2147    /// # Arguments
2148    ///
2149    /// * `path` - Path to check (e.g., "/file.txt").
2150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2151    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2152        let mut query = self.selection.select("exists");
2153        query = query.arg("path", path.into());
2154        query.execute(self.graphql_client.clone()).await
2155    }
2156    /// check if a file or directory exists
2157    ///
2158    /// # Arguments
2159    ///
2160    /// * `path` - Path to check (e.g., "/file.txt").
2161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2162    pub async fn exists_opts(
2163        &self,
2164        path: impl Into<String>,
2165        opts: ContainerExistsOpts,
2166    ) -> Result<bool, DaggerError> {
2167        let mut query = self.selection.select("exists");
2168        query = query.arg("path", path.into());
2169        if let Some(expected_type) = opts.expected_type {
2170            query = query.arg("expectedType", expected_type);
2171        }
2172        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2173            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2174        }
2175        if let Some(expand) = opts.expand {
2176            query = query.arg("expand", expand);
2177        }
2178        query.execute(self.graphql_client.clone()).await
2179    }
2180    /// The exit code of the last executed command
2181    /// Returns an error if no command was executed
2182    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2183        let query = self.selection.select("exitCode");
2184        query.execute(self.graphql_client.clone()).await
2185    }
2186    /// EXPERIMENTAL API! Subject to change/removal at any time.
2187    /// Configures all available GPUs on the host to be accessible to this container.
2188    /// This currently works for Nvidia devices only.
2189    pub fn experimental_with_all_gp_us(&self) -> Container {
2190        let query = self.selection.select("experimentalWithAllGPUs");
2191        Container {
2192            proc: self.proc.clone(),
2193            selection: query,
2194            graphql_client: self.graphql_client.clone(),
2195        }
2196    }
2197    /// EXPERIMENTAL API! Subject to change/removal at any time.
2198    /// Configures the provided list of devices to be accessible to this container.
2199    /// This currently works for Nvidia devices only.
2200    ///
2201    /// # Arguments
2202    ///
2203    /// * `devices` - List of devices to be accessible to this container.
2204    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2205        let mut query = self.selection.select("experimentalWithGPU");
2206        query = query.arg(
2207            "devices",
2208            devices
2209                .into_iter()
2210                .map(|i| i.into())
2211                .collect::<Vec<String>>(),
2212        );
2213        Container {
2214            proc: self.proc.clone(),
2215            selection: query,
2216            graphql_client: self.graphql_client.clone(),
2217        }
2218    }
2219    /// Writes the container as an OCI tarball to the destination file path on the host.
2220    /// It can also export platform variants.
2221    ///
2222    /// # Arguments
2223    ///
2224    /// * `path` - Host's destination path (e.g., "./tarball").
2225    ///
2226    /// Path can be relative to the engine's workdir or absolute.
2227    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2228    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2229        let mut query = self.selection.select("export");
2230        query = query.arg("path", path.into());
2231        query.execute(self.graphql_client.clone()).await
2232    }
2233    /// Writes the container as an OCI tarball to the destination file path on the host.
2234    /// It can also export platform variants.
2235    ///
2236    /// # Arguments
2237    ///
2238    /// * `path` - Host's destination path (e.g., "./tarball").
2239    ///
2240    /// Path can be relative to the engine's workdir or absolute.
2241    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2242    pub async fn export_opts(
2243        &self,
2244        path: impl Into<String>,
2245        opts: ContainerExportOpts,
2246    ) -> Result<String, DaggerError> {
2247        let mut query = self.selection.select("export");
2248        query = query.arg("path", path.into());
2249        if let Some(platform_variants) = opts.platform_variants {
2250            query = query.arg("platformVariants", platform_variants);
2251        }
2252        if let Some(forced_compression) = opts.forced_compression {
2253            query = query.arg("forcedCompression", forced_compression);
2254        }
2255        if let Some(media_types) = opts.media_types {
2256            query = query.arg("mediaTypes", media_types);
2257        }
2258        if let Some(expand) = opts.expand {
2259            query = query.arg("expand", expand);
2260        }
2261        query.execute(self.graphql_client.clone()).await
2262    }
2263    /// Exports the container as an image to the host's container image store.
2264    ///
2265    /// # Arguments
2266    ///
2267    /// * `name` - Name of image to export to in the host's store
2268    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2269    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2270        let mut query = self.selection.select("exportImage");
2271        query = query.arg("name", name.into());
2272        query.execute(self.graphql_client.clone()).await
2273    }
2274    /// Exports the container as an image to the host's container image store.
2275    ///
2276    /// # Arguments
2277    ///
2278    /// * `name` - Name of image to export to in the host's store
2279    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2280    pub async fn export_image_opts(
2281        &self,
2282        name: impl Into<String>,
2283        opts: ContainerExportImageOpts,
2284    ) -> Result<Void, DaggerError> {
2285        let mut query = self.selection.select("exportImage");
2286        query = query.arg("name", name.into());
2287        if let Some(platform_variants) = opts.platform_variants {
2288            query = query.arg("platformVariants", platform_variants);
2289        }
2290        if let Some(forced_compression) = opts.forced_compression {
2291            query = query.arg("forcedCompression", forced_compression);
2292        }
2293        if let Some(media_types) = opts.media_types {
2294            query = query.arg("mediaTypes", media_types);
2295        }
2296        query.execute(self.graphql_client.clone()).await
2297    }
2298    /// Retrieves the list of exposed ports.
2299    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2300    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2301        let query = self.selection.select("exposedPorts");
2302        let query = query.select("id");
2303        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2304        Ok(ids
2305            .into_iter()
2306            .map(|id| Port {
2307                proc: self.proc.clone(),
2308                selection: crate::querybuilder::query()
2309                    .select("node")
2310                    .arg("id", &id.0)
2311                    .inline_fragment("Port"),
2312                graphql_client: self.graphql_client.clone(),
2313            })
2314            .collect())
2315    }
2316    /// Retrieves a file at the given path.
2317    /// Mounts are included.
2318    ///
2319    /// # Arguments
2320    ///
2321    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2323    pub fn file(&self, path: impl Into<String>) -> File {
2324        let mut query = self.selection.select("file");
2325        query = query.arg("path", path.into());
2326        File {
2327            proc: self.proc.clone(),
2328            selection: query,
2329            graphql_client: self.graphql_client.clone(),
2330        }
2331    }
2332    /// Retrieves a file at the given path.
2333    /// Mounts are included.
2334    ///
2335    /// # Arguments
2336    ///
2337    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2339    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2340        let mut query = self.selection.select("file");
2341        query = query.arg("path", path.into());
2342        if let Some(expand) = opts.expand {
2343            query = query.arg("expand", expand);
2344        }
2345        File {
2346            proc: self.proc.clone(),
2347            selection: query,
2348            graphql_client: self.graphql_client.clone(),
2349        }
2350    }
2351    /// Download a container image, and apply it to the container state. All previous state will be lost.
2352    ///
2353    /// # Arguments
2354    ///
2355    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2356    pub fn from(&self, address: impl Into<String>) -> Container {
2357        let mut query = self.selection.select("from");
2358        query = query.arg("address", address.into());
2359        Container {
2360            proc: self.proc.clone(),
2361            selection: query,
2362            graphql_client: self.graphql_client.clone(),
2363        }
2364    }
2365    /// A unique identifier for this Container.
2366    pub async fn id(&self) -> Result<Id, DaggerError> {
2367        let query = self.selection.select("id");
2368        query.execute(self.graphql_client.clone()).await
2369    }
2370    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2371    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2372        let query = self.selection.select("imageRef");
2373        query.execute(self.graphql_client.clone()).await
2374    }
2375    /// Reads the container from an OCI tarball.
2376    ///
2377    /// # Arguments
2378    ///
2379    /// * `source` - File to read the container from.
2380    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2381    pub fn import(&self, source: impl IntoID<Id>) -> Container {
2382        let mut query = self.selection.select("import");
2383        query = query.arg_lazy(
2384            "source",
2385            Box::new(move || {
2386                let source = source.clone();
2387                Box::pin(async move { source.into_id().await.unwrap().quote() })
2388            }),
2389        );
2390        Container {
2391            proc: self.proc.clone(),
2392            selection: query,
2393            graphql_client: self.graphql_client.clone(),
2394        }
2395    }
2396    /// Reads the container from an OCI tarball.
2397    ///
2398    /// # Arguments
2399    ///
2400    /// * `source` - File to read the container from.
2401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2402    pub fn import_opts<'a>(
2403        &self,
2404        source: impl IntoID<Id>,
2405        opts: ContainerImportOpts<'a>,
2406    ) -> Container {
2407        let mut query = self.selection.select("import");
2408        query = query.arg_lazy(
2409            "source",
2410            Box::new(move || {
2411                let source = source.clone();
2412                Box::pin(async move { source.into_id().await.unwrap().quote() })
2413            }),
2414        );
2415        if let Some(tag) = opts.tag {
2416            query = query.arg("tag", tag);
2417        }
2418        Container {
2419            proc: self.proc.clone(),
2420            selection: query,
2421            graphql_client: self.graphql_client.clone(),
2422        }
2423    }
2424    /// Retrieves the value of the specified label.
2425    ///
2426    /// # Arguments
2427    ///
2428    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2429    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2430        let mut query = self.selection.select("label");
2431        query = query.arg("name", name.into());
2432        query.execute(self.graphql_client.clone()).await
2433    }
2434    /// Retrieves the list of labels passed to container.
2435    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2436        let query = self.selection.select("labels");
2437        let query = query.select("id");
2438        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2439        Ok(ids
2440            .into_iter()
2441            .map(|id| Label {
2442                proc: self.proc.clone(),
2443                selection: crate::querybuilder::query()
2444                    .select("node")
2445                    .arg("id", &id.0)
2446                    .inline_fragment("Label"),
2447                graphql_client: self.graphql_client.clone(),
2448            })
2449            .collect())
2450    }
2451    /// Retrieves the list of paths where a directory is mounted.
2452    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2453        let query = self.selection.select("mounts");
2454        query.execute(self.graphql_client.clone()).await
2455    }
2456    /// The platform this container executes and publishes as.
2457    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2458        let query = self.selection.select("platform");
2459        query.execute(self.graphql_client.clone()).await
2460    }
2461    /// Package the container state as an OCI image, and publish it to a registry
2462    /// Returns the fully qualified address of the published image, with digest
2463    ///
2464    /// # Arguments
2465    ///
2466    /// * `address` - The OCI address to publish to
2467    ///
2468    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2470    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2471        let mut query = self.selection.select("publish");
2472        query = query.arg("address", address.into());
2473        query.execute(self.graphql_client.clone()).await
2474    }
2475    /// Package the container state as an OCI image, and publish it to a registry
2476    /// Returns the fully qualified address of the published image, with digest
2477    ///
2478    /// # Arguments
2479    ///
2480    /// * `address` - The OCI address to publish to
2481    ///
2482    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2484    pub async fn publish_opts(
2485        &self,
2486        address: impl Into<String>,
2487        opts: ContainerPublishOpts,
2488    ) -> Result<String, DaggerError> {
2489        let mut query = self.selection.select("publish");
2490        query = query.arg("address", address.into());
2491        if let Some(platform_variants) = opts.platform_variants {
2492            query = query.arg("platformVariants", platform_variants);
2493        }
2494        if let Some(forced_compression) = opts.forced_compression {
2495            query = query.arg("forcedCompression", forced_compression);
2496        }
2497        if let Some(media_types) = opts.media_types {
2498            query = query.arg("mediaTypes", media_types);
2499        }
2500        query.execute(self.graphql_client.clone()).await
2501    }
2502    /// 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.
2503    pub fn rootfs(&self) -> Directory {
2504        let query = self.selection.select("rootfs");
2505        Directory {
2506            proc: self.proc.clone(),
2507            selection: query,
2508            graphql_client: self.graphql_client.clone(),
2509        }
2510    }
2511    /// Return file status
2512    ///
2513    /// # Arguments
2514    ///
2515    /// * `path` - Path to check (e.g., "/file.txt").
2516    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2517    pub fn stat(&self, path: impl Into<String>) -> Stat {
2518        let mut query = self.selection.select("stat");
2519        query = query.arg("path", path.into());
2520        Stat {
2521            proc: self.proc.clone(),
2522            selection: query,
2523            graphql_client: self.graphql_client.clone(),
2524        }
2525    }
2526    /// Return file status
2527    ///
2528    /// # Arguments
2529    ///
2530    /// * `path` - Path to check (e.g., "/file.txt").
2531    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2532    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
2533        let mut query = self.selection.select("stat");
2534        query = query.arg("path", path.into());
2535        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2536            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2537        }
2538        Stat {
2539            proc: self.proc.clone(),
2540            selection: query,
2541            graphql_client: self.graphql_client.clone(),
2542        }
2543    }
2544    /// The buffered standard error stream of the last executed command
2545    /// Returns an error if no command was executed
2546    pub async fn stderr(&self) -> Result<String, DaggerError> {
2547        let query = self.selection.select("stderr");
2548        query.execute(self.graphql_client.clone()).await
2549    }
2550    /// The buffered standard output stream of the last executed command
2551    /// Returns an error if no command was executed
2552    pub async fn stdout(&self) -> Result<String, DaggerError> {
2553        let query = self.selection.select("stdout");
2554        query.execute(self.graphql_client.clone()).await
2555    }
2556    /// Forces evaluation of the pipeline in the engine.
2557    /// It doesn't run the default command if no exec has been set.
2558    pub async fn sync(&self) -> Result<Container, DaggerError> {
2559        let query = self.selection.select("sync");
2560        let id: Id = query.execute(self.graphql_client.clone()).await?;
2561        Ok(Container {
2562            proc: self.proc.clone(),
2563            selection: query
2564                .root()
2565                .select("node")
2566                .arg("id", &id.0)
2567                .inline_fragment("Container"),
2568            graphql_client: self.graphql_client.clone(),
2569        })
2570    }
2571    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2572    ///
2573    /// # Arguments
2574    ///
2575    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2576    pub fn terminal(&self) -> Container {
2577        let query = self.selection.select("terminal");
2578        Container {
2579            proc: self.proc.clone(),
2580            selection: query,
2581            graphql_client: self.graphql_client.clone(),
2582        }
2583    }
2584    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2585    ///
2586    /// # Arguments
2587    ///
2588    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2589    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2590        let mut query = self.selection.select("terminal");
2591        if let Some(cmd) = opts.cmd {
2592            query = query.arg("cmd", cmd);
2593        }
2594        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2595            query = query.arg(
2596                "experimentalPrivilegedNesting",
2597                experimental_privileged_nesting,
2598            );
2599        }
2600        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2601            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2602        }
2603        Container {
2604            proc: self.proc.clone(),
2605            selection: query,
2606            graphql_client: self.graphql_client.clone(),
2607        }
2608    }
2609    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2610    /// Be sure to set any exposed ports before calling this api.
2611    ///
2612    /// # Arguments
2613    ///
2614    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2615    pub async fn up(&self) -> Result<Void, DaggerError> {
2616        let query = self.selection.select("up");
2617        query.execute(self.graphql_client.clone()).await
2618    }
2619    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2620    /// Be sure to set any exposed ports before calling this api.
2621    ///
2622    /// # Arguments
2623    ///
2624    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2625    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2626        let mut query = self.selection.select("up");
2627        if let Some(random) = opts.random {
2628            query = query.arg("random", random);
2629        }
2630        if let Some(ports) = opts.ports {
2631            query = query.arg("ports", ports);
2632        }
2633        if let Some(args) = opts.args {
2634            query = query.arg("args", args);
2635        }
2636        if let Some(use_entrypoint) = opts.use_entrypoint {
2637            query = query.arg("useEntrypoint", use_entrypoint);
2638        }
2639        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2640            query = query.arg(
2641                "experimentalPrivilegedNesting",
2642                experimental_privileged_nesting,
2643            );
2644        }
2645        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2646            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2647        }
2648        if let Some(expand) = opts.expand {
2649            query = query.arg("expand", expand);
2650        }
2651        if let Some(no_init) = opts.no_init {
2652            query = query.arg("noInit", no_init);
2653        }
2654        query.execute(self.graphql_client.clone()).await
2655    }
2656    /// Retrieves the user to be set for all commands.
2657    pub async fn user(&self) -> Result<String, DaggerError> {
2658        let query = self.selection.select("user");
2659        query.execute(self.graphql_client.clone()).await
2660    }
2661    /// Retrieves this container plus the given OCI annotation.
2662    ///
2663    /// # Arguments
2664    ///
2665    /// * `name` - The name of the annotation.
2666    /// * `value` - The value of the annotation.
2667    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2668        let mut query = self.selection.select("withAnnotation");
2669        query = query.arg("name", name.into());
2670        query = query.arg("value", value.into());
2671        Container {
2672            proc: self.proc.clone(),
2673            selection: query,
2674            graphql_client: self.graphql_client.clone(),
2675        }
2676    }
2677    /// Configures default arguments for future commands. Like CMD in Dockerfile.
2678    ///
2679    /// # Arguments
2680    ///
2681    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
2682    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2683        let mut query = self.selection.select("withDefaultArgs");
2684        query = query.arg(
2685            "args",
2686            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2687        );
2688        Container {
2689            proc: self.proc.clone(),
2690            selection: query,
2691            graphql_client: self.graphql_client.clone(),
2692        }
2693    }
2694    /// Set the default command to invoke for the container's terminal API.
2695    ///
2696    /// # Arguments
2697    ///
2698    /// * `args` - The args of the command.
2699    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2700    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2701        let mut query = self.selection.select("withDefaultTerminalCmd");
2702        query = query.arg(
2703            "args",
2704            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2705        );
2706        Container {
2707            proc: self.proc.clone(),
2708            selection: query,
2709            graphql_client: self.graphql_client.clone(),
2710        }
2711    }
2712    /// Set the default command to invoke for the container's terminal API.
2713    ///
2714    /// # Arguments
2715    ///
2716    /// * `args` - The args of the command.
2717    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2718    pub fn with_default_terminal_cmd_opts(
2719        &self,
2720        args: Vec<impl Into<String>>,
2721        opts: ContainerWithDefaultTerminalCmdOpts,
2722    ) -> Container {
2723        let mut query = self.selection.select("withDefaultTerminalCmd");
2724        query = query.arg(
2725            "args",
2726            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2727        );
2728        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2729            query = query.arg(
2730                "experimentalPrivilegedNesting",
2731                experimental_privileged_nesting,
2732            );
2733        }
2734        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2735            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2736        }
2737        Container {
2738            proc: self.proc.clone(),
2739            selection: query,
2740            graphql_client: self.graphql_client.clone(),
2741        }
2742    }
2743    /// Return a new container snapshot, with a directory added to its filesystem
2744    ///
2745    /// # Arguments
2746    ///
2747    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2748    /// * `source` - Identifier of the directory to write
2749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2750    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2751        let mut query = self.selection.select("withDirectory");
2752        query = query.arg("path", path.into());
2753        query = query.arg_lazy(
2754            "source",
2755            Box::new(move || {
2756                let source = source.clone();
2757                Box::pin(async move { source.into_id().await.unwrap().quote() })
2758            }),
2759        );
2760        Container {
2761            proc: self.proc.clone(),
2762            selection: query,
2763            graphql_client: self.graphql_client.clone(),
2764        }
2765    }
2766    /// Return a new container snapshot, with a directory added to its filesystem
2767    ///
2768    /// # Arguments
2769    ///
2770    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2771    /// * `source` - Identifier of the directory to write
2772    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2773    pub fn with_directory_opts<'a>(
2774        &self,
2775        path: impl Into<String>,
2776        source: impl IntoID<Id>,
2777        opts: ContainerWithDirectoryOpts<'a>,
2778    ) -> 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        if let Some(exclude) = opts.exclude {
2789            query = query.arg("exclude", exclude);
2790        }
2791        if let Some(include) = opts.include {
2792            query = query.arg("include", include);
2793        }
2794        if let Some(gitignore) = opts.gitignore {
2795            query = query.arg("gitignore", gitignore);
2796        }
2797        if let Some(owner) = opts.owner {
2798            query = query.arg("owner", owner);
2799        }
2800        if let Some(expand) = opts.expand {
2801            query = query.arg("expand", expand);
2802        }
2803        if let Some(permissions) = opts.permissions {
2804            query = query.arg("permissions", permissions);
2805        }
2806        Container {
2807            proc: self.proc.clone(),
2808            selection: query,
2809            graphql_client: self.graphql_client.clone(),
2810        }
2811    }
2812    /// Retrieves this container with the specificed docker healtcheck command set.
2813    ///
2814    /// # Arguments
2815    ///
2816    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2817    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2818    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2819        let mut query = self.selection.select("withDockerHealthcheck");
2820        query = query.arg(
2821            "args",
2822            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2823        );
2824        Container {
2825            proc: self.proc.clone(),
2826            selection: query,
2827            graphql_client: self.graphql_client.clone(),
2828        }
2829    }
2830    /// Retrieves this container with the specificed docker healtcheck command set.
2831    ///
2832    /// # Arguments
2833    ///
2834    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2835    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2836    pub fn with_docker_healthcheck_opts<'a>(
2837        &self,
2838        args: Vec<impl Into<String>>,
2839        opts: ContainerWithDockerHealthcheckOpts<'a>,
2840    ) -> Container {
2841        let mut query = self.selection.select("withDockerHealthcheck");
2842        query = query.arg(
2843            "args",
2844            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2845        );
2846        if let Some(shell) = opts.shell {
2847            query = query.arg("shell", shell);
2848        }
2849        if let Some(interval) = opts.interval {
2850            query = query.arg("interval", interval);
2851        }
2852        if let Some(timeout) = opts.timeout {
2853            query = query.arg("timeout", timeout);
2854        }
2855        if let Some(start_period) = opts.start_period {
2856            query = query.arg("startPeriod", start_period);
2857        }
2858        if let Some(start_interval) = opts.start_interval {
2859            query = query.arg("startInterval", start_interval);
2860        }
2861        if let Some(retries) = opts.retries {
2862            query = query.arg("retries", retries);
2863        }
2864        Container {
2865            proc: self.proc.clone(),
2866            selection: query,
2867            graphql_client: self.graphql_client.clone(),
2868        }
2869    }
2870    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2871    ///
2872    /// # Arguments
2873    ///
2874    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2876    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2877        let mut query = self.selection.select("withEntrypoint");
2878        query = query.arg(
2879            "args",
2880            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2881        );
2882        Container {
2883            proc: self.proc.clone(),
2884            selection: query,
2885            graphql_client: self.graphql_client.clone(),
2886        }
2887    }
2888    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2889    ///
2890    /// # Arguments
2891    ///
2892    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2894    pub fn with_entrypoint_opts(
2895        &self,
2896        args: Vec<impl Into<String>>,
2897        opts: ContainerWithEntrypointOpts,
2898    ) -> Container {
2899        let mut query = self.selection.select("withEntrypoint");
2900        query = query.arg(
2901            "args",
2902            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2903        );
2904        if let Some(keep_default_args) = opts.keep_default_args {
2905            query = query.arg("keepDefaultArgs", keep_default_args);
2906        }
2907        Container {
2908            proc: self.proc.clone(),
2909            selection: query,
2910            graphql_client: self.graphql_client.clone(),
2911        }
2912    }
2913    /// Export environment variables from an env-file to the container.
2914    ///
2915    /// # Arguments
2916    ///
2917    /// * `source` - Identifier of the envfile
2918    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2919        let mut query = self.selection.select("withEnvFileVariables");
2920        query = query.arg_lazy(
2921            "source",
2922            Box::new(move || {
2923                let source = source.clone();
2924                Box::pin(async move { source.into_id().await.unwrap().quote() })
2925            }),
2926        );
2927        Container {
2928            proc: self.proc.clone(),
2929            selection: query,
2930            graphql_client: self.graphql_client.clone(),
2931        }
2932    }
2933    /// Set a new environment variable in the container.
2934    ///
2935    /// # Arguments
2936    ///
2937    /// * `name` - Name of the environment variable (e.g., "HOST").
2938    /// * `value` - Value of the environment variable. (e.g., "localhost").
2939    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2940    pub fn with_env_variable(
2941        &self,
2942        name: impl Into<String>,
2943        value: impl Into<String>,
2944    ) -> Container {
2945        let mut query = self.selection.select("withEnvVariable");
2946        query = query.arg("name", name.into());
2947        query = query.arg("value", value.into());
2948        Container {
2949            proc: self.proc.clone(),
2950            selection: query,
2951            graphql_client: self.graphql_client.clone(),
2952        }
2953    }
2954    /// Set a new environment variable in the container.
2955    ///
2956    /// # Arguments
2957    ///
2958    /// * `name` - Name of the environment variable (e.g., "HOST").
2959    /// * `value` - Value of the environment variable. (e.g., "localhost").
2960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2961    pub fn with_env_variable_opts(
2962        &self,
2963        name: impl Into<String>,
2964        value: impl Into<String>,
2965        opts: ContainerWithEnvVariableOpts,
2966    ) -> Container {
2967        let mut query = self.selection.select("withEnvVariable");
2968        query = query.arg("name", name.into());
2969        query = query.arg("value", value.into());
2970        if let Some(expand) = opts.expand {
2971            query = query.arg("expand", expand);
2972        }
2973        Container {
2974            proc: self.proc.clone(),
2975            selection: query,
2976            graphql_client: self.graphql_client.clone(),
2977        }
2978    }
2979    /// Raise an error.
2980    ///
2981    /// # Arguments
2982    ///
2983    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
2984    pub fn with_error(&self, err: impl Into<String>) -> Container {
2985        let mut query = self.selection.select("withError");
2986        query = query.arg("err", err.into());
2987        Container {
2988            proc: self.proc.clone(),
2989            selection: query,
2990            graphql_client: self.graphql_client.clone(),
2991        }
2992    }
2993    /// Execute a command in the container, and return a new snapshot of the container state after execution.
2994    ///
2995    /// # Arguments
2996    ///
2997    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
2998    ///
2999    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3000    ///
3001    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3002    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3003    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3004        let mut query = self.selection.select("withExec");
3005        query = query.arg(
3006            "args",
3007            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3008        );
3009        Container {
3010            proc: self.proc.clone(),
3011            selection: query,
3012            graphql_client: self.graphql_client.clone(),
3013        }
3014    }
3015    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3016    ///
3017    /// # Arguments
3018    ///
3019    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3020    ///
3021    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3022    ///
3023    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3024    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3025    pub fn with_exec_opts<'a>(
3026        &self,
3027        args: Vec<impl Into<String>>,
3028        opts: ContainerWithExecOpts<'a>,
3029    ) -> Container {
3030        let mut query = self.selection.select("withExec");
3031        query = query.arg(
3032            "args",
3033            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3034        );
3035        if let Some(use_entrypoint) = opts.use_entrypoint {
3036            query = query.arg("useEntrypoint", use_entrypoint);
3037        }
3038        if let Some(stdin) = opts.stdin {
3039            query = query.arg("stdin", stdin);
3040        }
3041        if let Some(redirect_stdin) = opts.redirect_stdin {
3042            query = query.arg("redirectStdin", redirect_stdin);
3043        }
3044        if let Some(redirect_stdout) = opts.redirect_stdout {
3045            query = query.arg("redirectStdout", redirect_stdout);
3046        }
3047        if let Some(redirect_stderr) = opts.redirect_stderr {
3048            query = query.arg("redirectStderr", redirect_stderr);
3049        }
3050        if let Some(expect) = opts.expect {
3051            query = query.arg("expect", expect);
3052        }
3053        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3054            query = query.arg(
3055                "experimentalPrivilegedNesting",
3056                experimental_privileged_nesting,
3057            );
3058        }
3059        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3060            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3061        }
3062        if let Some(expand) = opts.expand {
3063            query = query.arg("expand", expand);
3064        }
3065        if let Some(no_init) = opts.no_init {
3066            query = query.arg("noInit", no_init);
3067        }
3068        Container {
3069            proc: self.proc.clone(),
3070            selection: query,
3071            graphql_client: self.graphql_client.clone(),
3072        }
3073    }
3074    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3075    /// Exposed ports serve two purposes:
3076    /// - For health checks and introspection, when running services
3077    /// - For setting the EXPOSE OCI field when publishing the container
3078    ///
3079    /// # Arguments
3080    ///
3081    /// * `port` - Port number to expose. Example: 8080
3082    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3083    pub fn with_exposed_port(&self, port: isize) -> Container {
3084        let mut query = self.selection.select("withExposedPort");
3085        query = query.arg("port", port);
3086        Container {
3087            proc: self.proc.clone(),
3088            selection: query,
3089            graphql_client: self.graphql_client.clone(),
3090        }
3091    }
3092    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3093    /// Exposed ports serve two purposes:
3094    /// - For health checks and introspection, when running services
3095    /// - For setting the EXPOSE OCI field when publishing the container
3096    ///
3097    /// # Arguments
3098    ///
3099    /// * `port` - Port number to expose. Example: 8080
3100    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3101    pub fn with_exposed_port_opts<'a>(
3102        &self,
3103        port: isize,
3104        opts: ContainerWithExposedPortOpts<'a>,
3105    ) -> Container {
3106        let mut query = self.selection.select("withExposedPort");
3107        query = query.arg("port", port);
3108        if let Some(protocol) = opts.protocol {
3109            query = query.arg("protocol", protocol);
3110        }
3111        if let Some(description) = opts.description {
3112            query = query.arg("description", description);
3113        }
3114        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3115            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3116        }
3117        Container {
3118            proc: self.proc.clone(),
3119            selection: query,
3120            graphql_client: self.graphql_client.clone(),
3121        }
3122    }
3123    /// Return a container snapshot with a file added
3124    ///
3125    /// # Arguments
3126    ///
3127    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3128    /// * `source` - File to add
3129    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3130    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3131        let mut query = self.selection.select("withFile");
3132        query = query.arg("path", path.into());
3133        query = query.arg_lazy(
3134            "source",
3135            Box::new(move || {
3136                let source = source.clone();
3137                Box::pin(async move { source.into_id().await.unwrap().quote() })
3138            }),
3139        );
3140        Container {
3141            proc: self.proc.clone(),
3142            selection: query,
3143            graphql_client: self.graphql_client.clone(),
3144        }
3145    }
3146    /// Return a container snapshot with a file added
3147    ///
3148    /// # Arguments
3149    ///
3150    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3151    /// * `source` - File to add
3152    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3153    pub fn with_file_opts<'a>(
3154        &self,
3155        path: impl Into<String>,
3156        source: impl IntoID<Id>,
3157        opts: ContainerWithFileOpts<'a>,
3158    ) -> Container {
3159        let mut query = self.selection.select("withFile");
3160        query = query.arg("path", path.into());
3161        query = query.arg_lazy(
3162            "source",
3163            Box::new(move || {
3164                let source = source.clone();
3165                Box::pin(async move { source.into_id().await.unwrap().quote() })
3166            }),
3167        );
3168        if let Some(permissions) = opts.permissions {
3169            query = query.arg("permissions", permissions);
3170        }
3171        if let Some(owner) = opts.owner {
3172            query = query.arg("owner", owner);
3173        }
3174        if let Some(expand) = opts.expand {
3175            query = query.arg("expand", expand);
3176        }
3177        Container {
3178            proc: self.proc.clone(),
3179            selection: query,
3180            graphql_client: self.graphql_client.clone(),
3181        }
3182    }
3183    /// Retrieves this container plus the contents of the given files copied to the given path.
3184    ///
3185    /// # Arguments
3186    ///
3187    /// * `path` - Location where copied files should be placed (e.g., "/src").
3188    /// * `sources` - Identifiers of the files to copy.
3189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3190    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3191        let mut query = self.selection.select("withFiles");
3192        query = query.arg("path", path.into());
3193        query = query.arg("sources", sources);
3194        Container {
3195            proc: self.proc.clone(),
3196            selection: query,
3197            graphql_client: self.graphql_client.clone(),
3198        }
3199    }
3200    /// Retrieves this container plus the contents of the given files copied to the given path.
3201    ///
3202    /// # Arguments
3203    ///
3204    /// * `path` - Location where copied files should be placed (e.g., "/src").
3205    /// * `sources` - Identifiers of the files to copy.
3206    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3207    pub fn with_files_opts<'a>(
3208        &self,
3209        path: impl Into<String>,
3210        sources: Vec<Id>,
3211        opts: ContainerWithFilesOpts<'a>,
3212    ) -> Container {
3213        let mut query = self.selection.select("withFiles");
3214        query = query.arg("path", path.into());
3215        query = query.arg("sources", sources);
3216        if let Some(permissions) = opts.permissions {
3217            query = query.arg("permissions", permissions);
3218        }
3219        if let Some(owner) = opts.owner {
3220            query = query.arg("owner", owner);
3221        }
3222        if let Some(expand) = opts.expand {
3223            query = query.arg("expand", expand);
3224        }
3225        Container {
3226            proc: self.proc.clone(),
3227            selection: query,
3228            graphql_client: self.graphql_client.clone(),
3229        }
3230    }
3231    /// Retrieves this container plus the given label.
3232    ///
3233    /// # Arguments
3234    ///
3235    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3236    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3237    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3238        let mut query = self.selection.select("withLabel");
3239        query = query.arg("name", name.into());
3240        query = query.arg("value", value.into());
3241        Container {
3242            proc: self.proc.clone(),
3243            selection: query,
3244            graphql_client: self.graphql_client.clone(),
3245        }
3246    }
3247    /// Retrieves this container plus a cache volume mounted at the given path.
3248    ///
3249    /// # Arguments
3250    ///
3251    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3252    /// * `cache` - Identifier of the cache volume to mount.
3253    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3254    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3255        let mut query = self.selection.select("withMountedCache");
3256        query = query.arg("path", path.into());
3257        query = query.arg_lazy(
3258            "cache",
3259            Box::new(move || {
3260                let cache = cache.clone();
3261                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3262            }),
3263        );
3264        Container {
3265            proc: self.proc.clone(),
3266            selection: query,
3267            graphql_client: self.graphql_client.clone(),
3268        }
3269    }
3270    /// Retrieves this container plus a cache volume mounted at the given path.
3271    ///
3272    /// # Arguments
3273    ///
3274    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3275    /// * `cache` - Identifier of the cache volume to mount.
3276    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3277    pub fn with_mounted_cache_opts<'a>(
3278        &self,
3279        path: impl Into<String>,
3280        cache: impl IntoID<Id>,
3281        opts: ContainerWithMountedCacheOpts<'a>,
3282    ) -> Container {
3283        let mut query = self.selection.select("withMountedCache");
3284        query = query.arg("path", path.into());
3285        query = query.arg_lazy(
3286            "cache",
3287            Box::new(move || {
3288                let cache = cache.clone();
3289                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3290            }),
3291        );
3292        if let Some(source) = opts.source {
3293            query = query.arg("source", source);
3294        }
3295        if let Some(sharing) = opts.sharing {
3296            query = query.arg("sharing", sharing);
3297        }
3298        if let Some(owner) = opts.owner {
3299            query = query.arg("owner", owner);
3300        }
3301        if let Some(expand) = opts.expand {
3302            query = query.arg("expand", expand);
3303        }
3304        Container {
3305            proc: self.proc.clone(),
3306            selection: query,
3307            graphql_client: self.graphql_client.clone(),
3308        }
3309    }
3310    /// Retrieves this container plus a directory mounted at the given path.
3311    ///
3312    /// # Arguments
3313    ///
3314    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3315    /// * `source` - Identifier of the mounted directory.
3316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3317    pub fn with_mounted_directory(
3318        &self,
3319        path: impl Into<String>,
3320        source: impl IntoID<Id>,
3321    ) -> Container {
3322        let mut query = self.selection.select("withMountedDirectory");
3323        query = query.arg("path", path.into());
3324        query = query.arg_lazy(
3325            "source",
3326            Box::new(move || {
3327                let source = source.clone();
3328                Box::pin(async move { source.into_id().await.unwrap().quote() })
3329            }),
3330        );
3331        Container {
3332            proc: self.proc.clone(),
3333            selection: query,
3334            graphql_client: self.graphql_client.clone(),
3335        }
3336    }
3337    /// Retrieves this container plus a directory mounted at the given path.
3338    ///
3339    /// # Arguments
3340    ///
3341    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3342    /// * `source` - Identifier of the mounted directory.
3343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3344    pub fn with_mounted_directory_opts<'a>(
3345        &self,
3346        path: impl Into<String>,
3347        source: impl IntoID<Id>,
3348        opts: ContainerWithMountedDirectoryOpts<'a>,
3349    ) -> Container {
3350        let mut query = self.selection.select("withMountedDirectory");
3351        query = query.arg("path", path.into());
3352        query = query.arg_lazy(
3353            "source",
3354            Box::new(move || {
3355                let source = source.clone();
3356                Box::pin(async move { source.into_id().await.unwrap().quote() })
3357            }),
3358        );
3359        if let Some(owner) = opts.owner {
3360            query = query.arg("owner", owner);
3361        }
3362        if let Some(read_only) = opts.read_only {
3363            query = query.arg("readOnly", read_only);
3364        }
3365        if let Some(expand) = opts.expand {
3366            query = query.arg("expand", expand);
3367        }
3368        Container {
3369            proc: self.proc.clone(),
3370            selection: query,
3371            graphql_client: self.graphql_client.clone(),
3372        }
3373    }
3374    /// Retrieves this container plus a file mounted at the given path.
3375    ///
3376    /// # Arguments
3377    ///
3378    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3379    /// * `source` - Identifier of the mounted file.
3380    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3381    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3382        let mut query = self.selection.select("withMountedFile");
3383        query = query.arg("path", path.into());
3384        query = query.arg_lazy(
3385            "source",
3386            Box::new(move || {
3387                let source = source.clone();
3388                Box::pin(async move { source.into_id().await.unwrap().quote() })
3389            }),
3390        );
3391        Container {
3392            proc: self.proc.clone(),
3393            selection: query,
3394            graphql_client: self.graphql_client.clone(),
3395        }
3396    }
3397    /// Retrieves this container plus a file mounted at the given path.
3398    ///
3399    /// # Arguments
3400    ///
3401    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3402    /// * `source` - Identifier of the mounted file.
3403    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3404    pub fn with_mounted_file_opts<'a>(
3405        &self,
3406        path: impl Into<String>,
3407        source: impl IntoID<Id>,
3408        opts: ContainerWithMountedFileOpts<'a>,
3409    ) -> Container {
3410        let mut query = self.selection.select("withMountedFile");
3411        query = query.arg("path", path.into());
3412        query = query.arg_lazy(
3413            "source",
3414            Box::new(move || {
3415                let source = source.clone();
3416                Box::pin(async move { source.into_id().await.unwrap().quote() })
3417            }),
3418        );
3419        if let Some(owner) = opts.owner {
3420            query = query.arg("owner", owner);
3421        }
3422        if let Some(expand) = opts.expand {
3423            query = query.arg("expand", expand);
3424        }
3425        Container {
3426            proc: self.proc.clone(),
3427            selection: query,
3428            graphql_client: self.graphql_client.clone(),
3429        }
3430    }
3431    /// Retrieves this container plus a secret mounted into a file at the given path.
3432    ///
3433    /// # Arguments
3434    ///
3435    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3436    /// * `source` - Identifier of the secret to mount.
3437    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3438    pub fn with_mounted_secret(
3439        &self,
3440        path: impl Into<String>,
3441        source: impl IntoID<Id>,
3442    ) -> Container {
3443        let mut query = self.selection.select("withMountedSecret");
3444        query = query.arg("path", path.into());
3445        query = query.arg_lazy(
3446            "source",
3447            Box::new(move || {
3448                let source = source.clone();
3449                Box::pin(async move { source.into_id().await.unwrap().quote() })
3450            }),
3451        );
3452        Container {
3453            proc: self.proc.clone(),
3454            selection: query,
3455            graphql_client: self.graphql_client.clone(),
3456        }
3457    }
3458    /// Retrieves this container plus a secret mounted into a file at the given path.
3459    ///
3460    /// # Arguments
3461    ///
3462    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3463    /// * `source` - Identifier of the secret to mount.
3464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3465    pub fn with_mounted_secret_opts<'a>(
3466        &self,
3467        path: impl Into<String>,
3468        source: impl IntoID<Id>,
3469        opts: ContainerWithMountedSecretOpts<'a>,
3470    ) -> Container {
3471        let mut query = self.selection.select("withMountedSecret");
3472        query = query.arg("path", path.into());
3473        query = query.arg_lazy(
3474            "source",
3475            Box::new(move || {
3476                let source = source.clone();
3477                Box::pin(async move { source.into_id().await.unwrap().quote() })
3478            }),
3479        );
3480        if let Some(owner) = opts.owner {
3481            query = query.arg("owner", owner);
3482        }
3483        if let Some(mode) = opts.mode {
3484            query = query.arg("mode", mode);
3485        }
3486        if let Some(expand) = opts.expand {
3487            query = query.arg("expand", expand);
3488        }
3489        Container {
3490            proc: self.proc.clone(),
3491            selection: query,
3492            graphql_client: self.graphql_client.clone(),
3493        }
3494    }
3495    /// 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.
3496    ///
3497    /// # Arguments
3498    ///
3499    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3500    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3501    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3502        let mut query = self.selection.select("withMountedTemp");
3503        query = query.arg("path", path.into());
3504        Container {
3505            proc: self.proc.clone(),
3506            selection: query,
3507            graphql_client: self.graphql_client.clone(),
3508        }
3509    }
3510    /// 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.
3511    ///
3512    /// # Arguments
3513    ///
3514    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3516    pub fn with_mounted_temp_opts(
3517        &self,
3518        path: impl Into<String>,
3519        opts: ContainerWithMountedTempOpts,
3520    ) -> Container {
3521        let mut query = self.selection.select("withMountedTemp");
3522        query = query.arg("path", path.into());
3523        if let Some(size) = opts.size {
3524            query = query.arg("size", size);
3525        }
3526        if let Some(expand) = opts.expand {
3527            query = query.arg("expand", expand);
3528        }
3529        Container {
3530            proc: self.proc.clone(),
3531            selection: query,
3532            graphql_client: self.graphql_client.clone(),
3533        }
3534    }
3535    /// Return a new container snapshot, with a file added to its filesystem with text content
3536    ///
3537    /// # Arguments
3538    ///
3539    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3540    /// * `contents` - Contents of the new file. Example: "Hello world!"
3541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3542    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3543        let mut query = self.selection.select("withNewFile");
3544        query = query.arg("path", path.into());
3545        query = query.arg("contents", contents.into());
3546        Container {
3547            proc: self.proc.clone(),
3548            selection: query,
3549            graphql_client: self.graphql_client.clone(),
3550        }
3551    }
3552    /// Return a new container snapshot, with a file added to its filesystem with text content
3553    ///
3554    /// # Arguments
3555    ///
3556    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3557    /// * `contents` - Contents of the new file. Example: "Hello world!"
3558    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3559    pub fn with_new_file_opts<'a>(
3560        &self,
3561        path: impl Into<String>,
3562        contents: impl Into<String>,
3563        opts: ContainerWithNewFileOpts<'a>,
3564    ) -> Container {
3565        let mut query = self.selection.select("withNewFile");
3566        query = query.arg("path", path.into());
3567        query = query.arg("contents", contents.into());
3568        if let Some(permissions) = opts.permissions {
3569            query = query.arg("permissions", permissions);
3570        }
3571        if let Some(owner) = opts.owner {
3572            query = query.arg("owner", owner);
3573        }
3574        if let Some(expand) = opts.expand {
3575            query = query.arg("expand", expand);
3576        }
3577        Container {
3578            proc: self.proc.clone(),
3579            selection: query,
3580            graphql_client: self.graphql_client.clone(),
3581        }
3582    }
3583    /// Attach credentials for future publishing to a registry. Use in combination with publish
3584    ///
3585    /// # Arguments
3586    ///
3587    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
3588    /// * `username` - The username to authenticate with. Example: "alice"
3589    /// * `secret` - The API key, password or token to authenticate to this registry
3590    pub fn with_registry_auth(
3591        &self,
3592        address: impl Into<String>,
3593        username: impl Into<String>,
3594        secret: impl IntoID<Id>,
3595    ) -> Container {
3596        let mut query = self.selection.select("withRegistryAuth");
3597        query = query.arg("address", address.into());
3598        query = query.arg("username", username.into());
3599        query = query.arg_lazy(
3600            "secret",
3601            Box::new(move || {
3602                let secret = secret.clone();
3603                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3604            }),
3605        );
3606        Container {
3607            proc: self.proc.clone(),
3608            selection: query,
3609            graphql_client: self.graphql_client.clone(),
3610        }
3611    }
3612    /// Change the container's root filesystem. The previous root filesystem will be lost.
3613    ///
3614    /// # Arguments
3615    ///
3616    /// * `directory` - The new root filesystem.
3617    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3618        let mut query = self.selection.select("withRootfs");
3619        query = query.arg_lazy(
3620            "directory",
3621            Box::new(move || {
3622                let directory = directory.clone();
3623                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3624            }),
3625        );
3626        Container {
3627            proc: self.proc.clone(),
3628            selection: query,
3629            graphql_client: self.graphql_client.clone(),
3630        }
3631    }
3632    /// Set a new environment variable, using a secret value
3633    ///
3634    /// # Arguments
3635    ///
3636    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3637    /// * `secret` - Identifier of the secret value.
3638    pub fn with_secret_variable(
3639        &self,
3640        name: impl Into<String>,
3641        secret: impl IntoID<Id>,
3642    ) -> Container {
3643        let mut query = self.selection.select("withSecretVariable");
3644        query = query.arg("name", name.into());
3645        query = query.arg_lazy(
3646            "secret",
3647            Box::new(move || {
3648                let secret = secret.clone();
3649                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3650            }),
3651        );
3652        Container {
3653            proc: self.proc.clone(),
3654            selection: query,
3655            graphql_client: self.graphql_client.clone(),
3656        }
3657    }
3658    /// Establish a runtime dependency from a container to a network service.
3659    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3660    /// The service will be reachable from the container via the provided hostname alias.
3661    /// The service dependency will also convey to any files or directories produced by the container.
3662    ///
3663    /// # Arguments
3664    ///
3665    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
3666    /// * `service` - The target service
3667    pub fn with_service_binding(
3668        &self,
3669        alias: impl Into<String>,
3670        service: impl IntoID<Id>,
3671    ) -> Container {
3672        let mut query = self.selection.select("withServiceBinding");
3673        query = query.arg("alias", alias.into());
3674        query = query.arg_lazy(
3675            "service",
3676            Box::new(move || {
3677                let service = service.clone();
3678                Box::pin(async move { service.into_id().await.unwrap().quote() })
3679            }),
3680        );
3681        Container {
3682            proc: self.proc.clone(),
3683            selection: query,
3684            graphql_client: self.graphql_client.clone(),
3685        }
3686    }
3687    /// Return a snapshot with a symlink
3688    ///
3689    /// # Arguments
3690    ///
3691    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3692    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3694    pub fn with_symlink(
3695        &self,
3696        target: impl Into<String>,
3697        link_name: impl Into<String>,
3698    ) -> Container {
3699        let mut query = self.selection.select("withSymlink");
3700        query = query.arg("target", target.into());
3701        query = query.arg("linkName", link_name.into());
3702        Container {
3703            proc: self.proc.clone(),
3704            selection: query,
3705            graphql_client: self.graphql_client.clone(),
3706        }
3707    }
3708    /// Return a snapshot with a symlink
3709    ///
3710    /// # Arguments
3711    ///
3712    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3713    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3714    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3715    pub fn with_symlink_opts(
3716        &self,
3717        target: impl Into<String>,
3718        link_name: impl Into<String>,
3719        opts: ContainerWithSymlinkOpts,
3720    ) -> Container {
3721        let mut query = self.selection.select("withSymlink");
3722        query = query.arg("target", target.into());
3723        query = query.arg("linkName", link_name.into());
3724        if let Some(expand) = opts.expand {
3725            query = query.arg("expand", expand);
3726        }
3727        Container {
3728            proc: self.proc.clone(),
3729            selection: query,
3730            graphql_client: self.graphql_client.clone(),
3731        }
3732    }
3733    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3734    ///
3735    /// # Arguments
3736    ///
3737    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3738    /// * `source` - Identifier of the socket to forward.
3739    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3740    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3741        let mut query = self.selection.select("withUnixSocket");
3742        query = query.arg("path", path.into());
3743        query = query.arg_lazy(
3744            "source",
3745            Box::new(move || {
3746                let source = source.clone();
3747                Box::pin(async move { source.into_id().await.unwrap().quote() })
3748            }),
3749        );
3750        Container {
3751            proc: self.proc.clone(),
3752            selection: query,
3753            graphql_client: self.graphql_client.clone(),
3754        }
3755    }
3756    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3757    ///
3758    /// # Arguments
3759    ///
3760    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3761    /// * `source` - Identifier of the socket to forward.
3762    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3763    pub fn with_unix_socket_opts<'a>(
3764        &self,
3765        path: impl Into<String>,
3766        source: impl IntoID<Id>,
3767        opts: ContainerWithUnixSocketOpts<'a>,
3768    ) -> Container {
3769        let mut query = self.selection.select("withUnixSocket");
3770        query = query.arg("path", path.into());
3771        query = query.arg_lazy(
3772            "source",
3773            Box::new(move || {
3774                let source = source.clone();
3775                Box::pin(async move { source.into_id().await.unwrap().quote() })
3776            }),
3777        );
3778        if let Some(owner) = opts.owner {
3779            query = query.arg("owner", owner);
3780        }
3781        if let Some(expand) = opts.expand {
3782            query = query.arg("expand", expand);
3783        }
3784        Container {
3785            proc: self.proc.clone(),
3786            selection: query,
3787            graphql_client: self.graphql_client.clone(),
3788        }
3789    }
3790    /// Retrieves this container with a different command user.
3791    ///
3792    /// # Arguments
3793    ///
3794    /// * `name` - The user to set (e.g., "root").
3795    pub fn with_user(&self, name: impl Into<String>) -> Container {
3796        let mut query = self.selection.select("withUser");
3797        query = query.arg("name", name.into());
3798        Container {
3799            proc: self.proc.clone(),
3800            selection: query,
3801            graphql_client: self.graphql_client.clone(),
3802        }
3803    }
3804    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
3805    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
3806    ///
3807    /// # Arguments
3808    ///
3809    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
3810    /// * `value` - Value of the volatile variable.
3811    pub fn with_volatile_variable(
3812        &self,
3813        name: impl Into<String>,
3814        value: impl Into<String>,
3815    ) -> Container {
3816        let mut query = self.selection.select("withVolatileVariable");
3817        query = query.arg("name", name.into());
3818        query = query.arg("value", value.into());
3819        Container {
3820            proc: self.proc.clone(),
3821            selection: query,
3822            graphql_client: self.graphql_client.clone(),
3823        }
3824    }
3825    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3826    ///
3827    /// # Arguments
3828    ///
3829    /// * `path` - The path to set as the working directory (e.g., "/app").
3830    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3831    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3832        let mut query = self.selection.select("withWorkdir");
3833        query = query.arg("path", path.into());
3834        Container {
3835            proc: self.proc.clone(),
3836            selection: query,
3837            graphql_client: self.graphql_client.clone(),
3838        }
3839    }
3840    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3841    ///
3842    /// # Arguments
3843    ///
3844    /// * `path` - The path to set as the working directory (e.g., "/app").
3845    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3846    pub fn with_workdir_opts(
3847        &self,
3848        path: impl Into<String>,
3849        opts: ContainerWithWorkdirOpts,
3850    ) -> Container {
3851        let mut query = self.selection.select("withWorkdir");
3852        query = query.arg("path", path.into());
3853        if let Some(expand) = opts.expand {
3854            query = query.arg("expand", expand);
3855        }
3856        Container {
3857            proc: self.proc.clone(),
3858            selection: query,
3859            graphql_client: self.graphql_client.clone(),
3860        }
3861    }
3862    /// Retrieves this container minus the given OCI annotation.
3863    ///
3864    /// # Arguments
3865    ///
3866    /// * `name` - The name of the annotation.
3867    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3868        let mut query = self.selection.select("withoutAnnotation");
3869        query = query.arg("name", name.into());
3870        Container {
3871            proc: self.proc.clone(),
3872            selection: query,
3873            graphql_client: self.graphql_client.clone(),
3874        }
3875    }
3876    /// Remove the container's default arguments.
3877    pub fn without_default_args(&self) -> Container {
3878        let query = self.selection.select("withoutDefaultArgs");
3879        Container {
3880            proc: self.proc.clone(),
3881            selection: query,
3882            graphql_client: self.graphql_client.clone(),
3883        }
3884    }
3885    /// Return a new container snapshot, with a directory removed from its filesystem
3886    ///
3887    /// # Arguments
3888    ///
3889    /// * `path` - Location of the directory to remove (e.g., ".github/").
3890    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3891    pub fn without_directory(&self, path: impl Into<String>) -> Container {
3892        let mut query = self.selection.select("withoutDirectory");
3893        query = query.arg("path", path.into());
3894        Container {
3895            proc: self.proc.clone(),
3896            selection: query,
3897            graphql_client: self.graphql_client.clone(),
3898        }
3899    }
3900    /// Return a new container snapshot, with a directory removed from its filesystem
3901    ///
3902    /// # Arguments
3903    ///
3904    /// * `path` - Location of the directory to remove (e.g., ".github/").
3905    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3906    pub fn without_directory_opts(
3907        &self,
3908        path: impl Into<String>,
3909        opts: ContainerWithoutDirectoryOpts,
3910    ) -> Container {
3911        let mut query = self.selection.select("withoutDirectory");
3912        query = query.arg("path", path.into());
3913        if let Some(expand) = opts.expand {
3914            query = query.arg("expand", expand);
3915        }
3916        Container {
3917            proc: self.proc.clone(),
3918            selection: query,
3919            graphql_client: self.graphql_client.clone(),
3920        }
3921    }
3922    /// Retrieves this container without a configured docker healtcheck command.
3923    pub fn without_docker_healthcheck(&self) -> Container {
3924        let query = self.selection.select("withoutDockerHealthcheck");
3925        Container {
3926            proc: self.proc.clone(),
3927            selection: query,
3928            graphql_client: self.graphql_client.clone(),
3929        }
3930    }
3931    /// Reset the container's OCI entrypoint.
3932    ///
3933    /// # Arguments
3934    ///
3935    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3936    pub fn without_entrypoint(&self) -> Container {
3937        let query = self.selection.select("withoutEntrypoint");
3938        Container {
3939            proc: self.proc.clone(),
3940            selection: query,
3941            graphql_client: self.graphql_client.clone(),
3942        }
3943    }
3944    /// Reset the container's OCI entrypoint.
3945    ///
3946    /// # Arguments
3947    ///
3948    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3949    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3950        let mut query = self.selection.select("withoutEntrypoint");
3951        if let Some(keep_default_args) = opts.keep_default_args {
3952            query = query.arg("keepDefaultArgs", keep_default_args);
3953        }
3954        Container {
3955            proc: self.proc.clone(),
3956            selection: query,
3957            graphql_client: self.graphql_client.clone(),
3958        }
3959    }
3960    /// Retrieves this container minus the given environment variable.
3961    ///
3962    /// # Arguments
3963    ///
3964    /// * `name` - The name of the environment variable (e.g., "HOST").
3965    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3966        let mut query = self.selection.select("withoutEnvVariable");
3967        query = query.arg("name", name.into());
3968        Container {
3969            proc: self.proc.clone(),
3970            selection: query,
3971            graphql_client: self.graphql_client.clone(),
3972        }
3973    }
3974    /// Unexpose a previously exposed port.
3975    ///
3976    /// # Arguments
3977    ///
3978    /// * `port` - Port number to unexpose
3979    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3980    pub fn without_exposed_port(&self, port: isize) -> Container {
3981        let mut query = self.selection.select("withoutExposedPort");
3982        query = query.arg("port", port);
3983        Container {
3984            proc: self.proc.clone(),
3985            selection: query,
3986            graphql_client: self.graphql_client.clone(),
3987        }
3988    }
3989    /// Unexpose a previously exposed port.
3990    ///
3991    /// # Arguments
3992    ///
3993    /// * `port` - Port number to unexpose
3994    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3995    pub fn without_exposed_port_opts(
3996        &self,
3997        port: isize,
3998        opts: ContainerWithoutExposedPortOpts,
3999    ) -> Container {
4000        let mut query = self.selection.select("withoutExposedPort");
4001        query = query.arg("port", port);
4002        if let Some(protocol) = opts.protocol {
4003            query = query.arg("protocol", protocol);
4004        }
4005        Container {
4006            proc: self.proc.clone(),
4007            selection: query,
4008            graphql_client: self.graphql_client.clone(),
4009        }
4010    }
4011    /// Retrieves this container with the file at the given path removed.
4012    ///
4013    /// # Arguments
4014    ///
4015    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4016    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4017    pub fn without_file(&self, path: impl Into<String>) -> Container {
4018        let mut query = self.selection.select("withoutFile");
4019        query = query.arg("path", path.into());
4020        Container {
4021            proc: self.proc.clone(),
4022            selection: query,
4023            graphql_client: self.graphql_client.clone(),
4024        }
4025    }
4026    /// Retrieves this container with the file at the given path removed.
4027    ///
4028    /// # Arguments
4029    ///
4030    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4031    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4032    pub fn without_file_opts(
4033        &self,
4034        path: impl Into<String>,
4035        opts: ContainerWithoutFileOpts,
4036    ) -> Container {
4037        let mut query = self.selection.select("withoutFile");
4038        query = query.arg("path", path.into());
4039        if let Some(expand) = opts.expand {
4040            query = query.arg("expand", expand);
4041        }
4042        Container {
4043            proc: self.proc.clone(),
4044            selection: query,
4045            graphql_client: self.graphql_client.clone(),
4046        }
4047    }
4048    /// Return a new container spanshot with specified files removed
4049    ///
4050    /// # Arguments
4051    ///
4052    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4053    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4054    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4055        let mut query = self.selection.select("withoutFiles");
4056        query = query.arg(
4057            "paths",
4058            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4059        );
4060        Container {
4061            proc: self.proc.clone(),
4062            selection: query,
4063            graphql_client: self.graphql_client.clone(),
4064        }
4065    }
4066    /// Return a new container spanshot with specified files removed
4067    ///
4068    /// # Arguments
4069    ///
4070    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4072    pub fn without_files_opts(
4073        &self,
4074        paths: Vec<impl Into<String>>,
4075        opts: ContainerWithoutFilesOpts,
4076    ) -> Container {
4077        let mut query = self.selection.select("withoutFiles");
4078        query = query.arg(
4079            "paths",
4080            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4081        );
4082        if let Some(expand) = opts.expand {
4083            query = query.arg("expand", expand);
4084        }
4085        Container {
4086            proc: self.proc.clone(),
4087            selection: query,
4088            graphql_client: self.graphql_client.clone(),
4089        }
4090    }
4091    /// Retrieves this container minus the given environment label.
4092    ///
4093    /// # Arguments
4094    ///
4095    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4096    pub fn without_label(&self, name: impl Into<String>) -> Container {
4097        let mut query = self.selection.select("withoutLabel");
4098        query = query.arg("name", name.into());
4099        Container {
4100            proc: self.proc.clone(),
4101            selection: query,
4102            graphql_client: self.graphql_client.clone(),
4103        }
4104    }
4105    /// Retrieves this container after unmounting everything at the given path.
4106    ///
4107    /// # Arguments
4108    ///
4109    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4110    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4111    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4112        let mut query = self.selection.select("withoutMount");
4113        query = query.arg("path", path.into());
4114        Container {
4115            proc: self.proc.clone(),
4116            selection: query,
4117            graphql_client: self.graphql_client.clone(),
4118        }
4119    }
4120    /// Retrieves this container after unmounting everything at the given path.
4121    ///
4122    /// # Arguments
4123    ///
4124    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4125    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4126    pub fn without_mount_opts(
4127        &self,
4128        path: impl Into<String>,
4129        opts: ContainerWithoutMountOpts,
4130    ) -> Container {
4131        let mut query = self.selection.select("withoutMount");
4132        query = query.arg("path", path.into());
4133        if let Some(expand) = opts.expand {
4134            query = query.arg("expand", expand);
4135        }
4136        Container {
4137            proc: self.proc.clone(),
4138            selection: query,
4139            graphql_client: self.graphql_client.clone(),
4140        }
4141    }
4142    /// Retrieves this container without the registry authentication of a given address.
4143    ///
4144    /// # Arguments
4145    ///
4146    /// * `address` - Registry's address to remove the authentication from.
4147    ///
4148    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4149    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4150        let mut query = self.selection.select("withoutRegistryAuth");
4151        query = query.arg("address", address.into());
4152        Container {
4153            proc: self.proc.clone(),
4154            selection: query,
4155            graphql_client: self.graphql_client.clone(),
4156        }
4157    }
4158    /// Retrieves this container minus the given environment variable containing the secret.
4159    ///
4160    /// # Arguments
4161    ///
4162    /// * `name` - The name of the environment variable (e.g., "HOST").
4163    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4164        let mut query = self.selection.select("withoutSecretVariable");
4165        query = query.arg("name", name.into());
4166        Container {
4167            proc: self.proc.clone(),
4168            selection: query,
4169            graphql_client: self.graphql_client.clone(),
4170        }
4171    }
4172    /// Retrieves this container with a previously added Unix socket removed.
4173    ///
4174    /// # Arguments
4175    ///
4176    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4177    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4178    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4179        let mut query = self.selection.select("withoutUnixSocket");
4180        query = query.arg("path", path.into());
4181        Container {
4182            proc: self.proc.clone(),
4183            selection: query,
4184            graphql_client: self.graphql_client.clone(),
4185        }
4186    }
4187    /// Retrieves this container with a previously added Unix socket removed.
4188    ///
4189    /// # Arguments
4190    ///
4191    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4192    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4193    pub fn without_unix_socket_opts(
4194        &self,
4195        path: impl Into<String>,
4196        opts: ContainerWithoutUnixSocketOpts,
4197    ) -> Container {
4198        let mut query = self.selection.select("withoutUnixSocket");
4199        query = query.arg("path", path.into());
4200        if let Some(expand) = opts.expand {
4201            query = query.arg("expand", expand);
4202        }
4203        Container {
4204            proc: self.proc.clone(),
4205            selection: query,
4206            graphql_client: self.graphql_client.clone(),
4207        }
4208    }
4209    /// Retrieves this container with an unset command user.
4210    /// Should default to root.
4211    pub fn without_user(&self) -> Container {
4212        let query = self.selection.select("withoutUser");
4213        Container {
4214            proc: self.proc.clone(),
4215            selection: query,
4216            graphql_client: self.graphql_client.clone(),
4217        }
4218    }
4219    /// Retrieves this container minus the given volatile environment variable.
4220    ///
4221    /// # Arguments
4222    ///
4223    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4224    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4225        let mut query = self.selection.select("withoutVolatileVariable");
4226        query = query.arg("name", name.into());
4227        Container {
4228            proc: self.proc.clone(),
4229            selection: query,
4230            graphql_client: self.graphql_client.clone(),
4231        }
4232    }
4233    /// Unset the container's working directory.
4234    /// Should default to "/".
4235    pub fn without_workdir(&self) -> Container {
4236        let query = self.selection.select("withoutWorkdir");
4237        Container {
4238            proc: self.proc.clone(),
4239            selection: query,
4240            graphql_client: self.graphql_client.clone(),
4241        }
4242    }
4243    /// Retrieves the working directory for all commands.
4244    pub async fn workdir(&self) -> Result<String, DaggerError> {
4245        let query = self.selection.select("workdir");
4246        query.execute(self.graphql_client.clone()).await
4247    }
4248}
4249impl Exportable for Container {
4250    fn export(
4251        &self,
4252        path: impl Into<String>,
4253    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4254        let mut query = self.selection.select("export");
4255        query = query.arg("path", path.into());
4256        let graphql_client = self.graphql_client.clone();
4257        async move { query.execute(graphql_client).await }
4258    }
4259    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4260        let query = self.selection.select("id");
4261        let graphql_client = self.graphql_client.clone();
4262        async move { query.execute(graphql_client).await }
4263    }
4264}
4265impl Node for Container {
4266    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4267        let query = self.selection.select("id");
4268        let graphql_client = self.graphql_client.clone();
4269        async move { query.execute(graphql_client).await }
4270    }
4271}
4272impl Syncer for Container {
4273    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4274        let query = self.selection.select("id");
4275        let graphql_client = self.graphql_client.clone();
4276        async move { query.execute(graphql_client).await }
4277    }
4278    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4279        let query = self.selection.select("sync");
4280        let graphql_client = self.graphql_client.clone();
4281        async move { query.execute(graphql_client).await }
4282    }
4283}
4284#[derive(Clone)]
4285pub struct CurrentModule {
4286    pub proc: Option<Arc<DaggerSessionProc>>,
4287    pub selection: Selection,
4288    pub graphql_client: DynGraphQLClient,
4289}
4290#[derive(Builder, Debug, PartialEq)]
4291pub struct CurrentModuleGeneratorsOpts<'a> {
4292    /// Only include generators matching the specified patterns
4293    #[builder(setter(into, strip_option), default)]
4294    pub include: Option<Vec<&'a str>>,
4295}
4296#[derive(Builder, Debug, PartialEq)]
4297pub struct CurrentModuleWorkdirOpts<'a> {
4298    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4299    #[builder(setter(into, strip_option), default)]
4300    pub exclude: Option<Vec<&'a str>>,
4301    /// Apply .gitignore filter rules inside the directory
4302    #[builder(setter(into, strip_option), default)]
4303    pub gitignore: Option<bool>,
4304    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4305    #[builder(setter(into, strip_option), default)]
4306    pub include: Option<Vec<&'a str>>,
4307}
4308impl IntoID<Id> for CurrentModule {
4309    fn into_id(
4310        self,
4311    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4312        Box::pin(async move { self.id().await })
4313    }
4314}
4315impl Loadable for CurrentModule {
4316    fn graphql_type() -> &'static str {
4317        "CurrentModule"
4318    }
4319    fn from_query(
4320        proc: Option<Arc<DaggerSessionProc>>,
4321        selection: Selection,
4322        graphql_client: DynGraphQLClient,
4323    ) -> Self {
4324        Self {
4325            proc,
4326            selection,
4327            graphql_client,
4328        }
4329    }
4330}
4331impl CurrentModule {
4332    /// The dependencies of the module.
4333    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4334        let query = self.selection.select("dependencies");
4335        let query = query.select("id");
4336        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4337        Ok(ids
4338            .into_iter()
4339            .map(|id| Module {
4340                proc: self.proc.clone(),
4341                selection: crate::querybuilder::query()
4342                    .select("node")
4343                    .arg("id", &id.0)
4344                    .inline_fragment("Module"),
4345                graphql_client: self.graphql_client.clone(),
4346            })
4347            .collect())
4348    }
4349    /// The generated files and directories made on top of the module source's context directory.
4350    pub fn generated_context_directory(&self) -> Directory {
4351        let query = self.selection.select("generatedContextDirectory");
4352        Directory {
4353            proc: self.proc.clone(),
4354            selection: query,
4355            graphql_client: self.graphql_client.clone(),
4356        }
4357    }
4358    /// Return all generators defined by the module
4359    ///
4360    /// # Arguments
4361    ///
4362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4363    pub fn generators(&self) -> GeneratorGroup {
4364        let query = self.selection.select("generators");
4365        GeneratorGroup {
4366            proc: self.proc.clone(),
4367            selection: query,
4368            graphql_client: self.graphql_client.clone(),
4369        }
4370    }
4371    /// Return all generators defined by the module
4372    ///
4373    /// # Arguments
4374    ///
4375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4376    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4377        let mut query = self.selection.select("generators");
4378        if let Some(include) = opts.include {
4379            query = query.arg("include", include);
4380        }
4381        GeneratorGroup {
4382            proc: self.proc.clone(),
4383            selection: query,
4384            graphql_client: self.graphql_client.clone(),
4385        }
4386    }
4387    /// A unique identifier for this CurrentModule.
4388    pub async fn id(&self) -> Result<Id, DaggerError> {
4389        let query = self.selection.select("id");
4390        query.execute(self.graphql_client.clone()).await
4391    }
4392    /// The name of the module being executed in
4393    pub async fn name(&self) -> Result<String, DaggerError> {
4394        let query = self.selection.select("name");
4395        query.execute(self.graphql_client.clone()).await
4396    }
4397    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4398    pub fn source(&self) -> Directory {
4399        let query = self.selection.select("source");
4400        Directory {
4401            proc: self.proc.clone(),
4402            selection: query,
4403            graphql_client: self.graphql_client.clone(),
4404        }
4405    }
4406    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4407    ///
4408    /// # Arguments
4409    ///
4410    /// * `path` - Location of the directory to access (e.g., ".").
4411    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4412    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4413        let mut query = self.selection.select("workdir");
4414        query = query.arg("path", path.into());
4415        Directory {
4416            proc: self.proc.clone(),
4417            selection: query,
4418            graphql_client: self.graphql_client.clone(),
4419        }
4420    }
4421    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4422    ///
4423    /// # Arguments
4424    ///
4425    /// * `path` - Location of the directory to access (e.g., ".").
4426    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4427    pub fn workdir_opts<'a>(
4428        &self,
4429        path: impl Into<String>,
4430        opts: CurrentModuleWorkdirOpts<'a>,
4431    ) -> Directory {
4432        let mut query = self.selection.select("workdir");
4433        query = query.arg("path", path.into());
4434        if let Some(exclude) = opts.exclude {
4435            query = query.arg("exclude", exclude);
4436        }
4437        if let Some(include) = opts.include {
4438            query = query.arg("include", include);
4439        }
4440        if let Some(gitignore) = opts.gitignore {
4441            query = query.arg("gitignore", gitignore);
4442        }
4443        Directory {
4444            proc: self.proc.clone(),
4445            selection: query,
4446            graphql_client: self.graphql_client.clone(),
4447        }
4448    }
4449    /// 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.
4450    ///
4451    /// # Arguments
4452    ///
4453    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4454    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4455        let mut query = self.selection.select("workdirFile");
4456        query = query.arg("path", path.into());
4457        File {
4458            proc: self.proc.clone(),
4459            selection: query,
4460            graphql_client: self.graphql_client.clone(),
4461        }
4462    }
4463}
4464impl Node for CurrentModule {
4465    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4466        let query = self.selection.select("id");
4467        let graphql_client = self.graphql_client.clone();
4468        async move { query.execute(graphql_client).await }
4469    }
4470}
4471#[derive(Clone)]
4472pub struct DiffStat {
4473    pub proc: Option<Arc<DaggerSessionProc>>,
4474    pub selection: Selection,
4475    pub graphql_client: DynGraphQLClient,
4476}
4477impl IntoID<Id> for DiffStat {
4478    fn into_id(
4479        self,
4480    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4481        Box::pin(async move { self.id().await })
4482    }
4483}
4484impl Loadable for DiffStat {
4485    fn graphql_type() -> &'static str {
4486        "DiffStat"
4487    }
4488    fn from_query(
4489        proc: Option<Arc<DaggerSessionProc>>,
4490        selection: Selection,
4491        graphql_client: DynGraphQLClient,
4492    ) -> Self {
4493        Self {
4494            proc,
4495            selection,
4496            graphql_client,
4497        }
4498    }
4499}
4500impl DiffStat {
4501    /// Number of added lines for this path.
4502    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4503        let query = self.selection.select("addedLines");
4504        query.execute(self.graphql_client.clone()).await
4505    }
4506    /// A unique identifier for this DiffStat.
4507    pub async fn id(&self) -> Result<Id, DaggerError> {
4508        let query = self.selection.select("id");
4509        query.execute(self.graphql_client.clone()).await
4510    }
4511    /// Type of change.
4512    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4513        let query = self.selection.select("kind");
4514        query.execute(self.graphql_client.clone()).await
4515    }
4516    /// Previous path of the file, set only for renames.
4517    pub async fn old_path(&self) -> Result<String, DaggerError> {
4518        let query = self.selection.select("oldPath");
4519        query.execute(self.graphql_client.clone()).await
4520    }
4521    /// Path of the changed file or directory.
4522    pub async fn path(&self) -> Result<String, DaggerError> {
4523        let query = self.selection.select("path");
4524        query.execute(self.graphql_client.clone()).await
4525    }
4526    /// Number of removed lines for this path.
4527    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4528        let query = self.selection.select("removedLines");
4529        query.execute(self.graphql_client.clone()).await
4530    }
4531}
4532impl Node for DiffStat {
4533    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4534        let query = self.selection.select("id");
4535        let graphql_client = self.graphql_client.clone();
4536        async move { query.execute(graphql_client).await }
4537    }
4538}
4539#[derive(Clone)]
4540pub struct Directory {
4541    pub proc: Option<Arc<DaggerSessionProc>>,
4542    pub selection: Selection,
4543    pub graphql_client: DynGraphQLClient,
4544}
4545#[derive(Builder, Debug, PartialEq)]
4546pub struct DirectoryAsModuleOpts<'a> {
4547    /// An optional subpath of the directory which contains the module's configuration file.
4548    /// If not set, the module source code is loaded from the root of the directory.
4549    #[builder(setter(into, strip_option), default)]
4550    pub source_root_path: Option<&'a str>,
4551}
4552#[derive(Builder, Debug, PartialEq)]
4553pub struct DirectoryAsModuleSourceOpts<'a> {
4554    /// An optional subpath of the directory which contains the module's configuration file.
4555    /// If not set, the module source code is loaded from the root of the directory.
4556    #[builder(setter(into, strip_option), default)]
4557    pub source_root_path: Option<&'a str>,
4558}
4559#[derive(Builder, Debug, PartialEq)]
4560pub struct DirectoryDockerBuildOpts<'a> {
4561    /// Build arguments to use in the build.
4562    #[builder(setter(into, strip_option), default)]
4563    pub build_args: Option<Vec<BuildArg>>,
4564    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4565    #[builder(setter(into, strip_option), default)]
4566    pub dockerfile: Option<&'a str>,
4567    /// If set, skip the automatic init process injected into containers created by RUN statements.
4568    /// 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.
4569    #[builder(setter(into, strip_option), default)]
4570    pub no_init: Option<bool>,
4571    /// The platform to build.
4572    #[builder(setter(into, strip_option), default)]
4573    pub platform: Option<Platform>,
4574    /// Secrets to pass to the build.
4575    /// They will be mounted at /run/secrets/[secret-name].
4576    #[builder(setter(into, strip_option), default)]
4577    pub secrets: Option<Vec<Id>>,
4578    /// A socket to use for SSH authentication during the build
4579    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
4580    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
4581    #[builder(setter(into, strip_option), default)]
4582    pub ssh: Option<Id>,
4583    /// Target build stage to build.
4584    #[builder(setter(into, strip_option), default)]
4585    pub target: Option<&'a str>,
4586}
4587#[derive(Builder, Debug, PartialEq)]
4588pub struct DirectoryEntriesOpts<'a> {
4589    /// Location of the directory to look at (e.g., "/src").
4590    #[builder(setter(into, strip_option), default)]
4591    pub path: Option<&'a str>,
4592}
4593#[derive(Builder, Debug, PartialEq)]
4594pub struct DirectoryExistsOpts {
4595    /// If specified, do not follow symlinks.
4596    #[builder(setter(into, strip_option), default)]
4597    pub do_not_follow_symlinks: Option<bool>,
4598    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4599    #[builder(setter(into, strip_option), default)]
4600    pub expected_type: Option<ExistsType>,
4601}
4602#[derive(Builder, Debug, PartialEq)]
4603pub struct DirectoryExportOpts {
4604    /// 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.
4605    #[builder(setter(into, strip_option), default)]
4606    pub wipe: Option<bool>,
4607}
4608#[derive(Builder, Debug, PartialEq)]
4609pub struct DirectoryFilterOpts<'a> {
4610    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4611    #[builder(setter(into, strip_option), default)]
4612    pub exclude: Option<Vec<&'a str>>,
4613    /// If set, apply .gitignore rules when filtering the directory.
4614    #[builder(setter(into, strip_option), default)]
4615    pub gitignore: Option<bool>,
4616    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4617    #[builder(setter(into, strip_option), default)]
4618    pub include: Option<Vec<&'a str>>,
4619}
4620#[derive(Builder, Debug, PartialEq)]
4621pub struct DirectorySearchOpts<'a> {
4622    /// Allow the . pattern to match newlines in multiline mode.
4623    #[builder(setter(into, strip_option), default)]
4624    pub dotall: Option<bool>,
4625    /// Only return matching files, not lines and content
4626    #[builder(setter(into, strip_option), default)]
4627    pub files_only: Option<bool>,
4628    /// Glob patterns to match (e.g., "*.md")
4629    #[builder(setter(into, strip_option), default)]
4630    pub globs: Option<Vec<&'a str>>,
4631    /// Enable case-insensitive matching.
4632    #[builder(setter(into, strip_option), default)]
4633    pub insensitive: Option<bool>,
4634    /// Limit the number of results to return
4635    #[builder(setter(into, strip_option), default)]
4636    pub limit: Option<isize>,
4637    /// Interpret the pattern as a literal string instead of a regular expression.
4638    #[builder(setter(into, strip_option), default)]
4639    pub literal: Option<bool>,
4640    /// Enable searching across multiple lines.
4641    #[builder(setter(into, strip_option), default)]
4642    pub multiline: Option<bool>,
4643    /// Directory or file paths to search
4644    #[builder(setter(into, strip_option), default)]
4645    pub paths: Option<Vec<&'a str>>,
4646    /// Skip hidden files (files starting with .).
4647    #[builder(setter(into, strip_option), default)]
4648    pub skip_hidden: Option<bool>,
4649    /// Honor .gitignore, .ignore, and .rgignore files.
4650    #[builder(setter(into, strip_option), default)]
4651    pub skip_ignored: Option<bool>,
4652}
4653#[derive(Builder, Debug, PartialEq)]
4654pub struct DirectoryStatOpts {
4655    /// If specified, do not follow symlinks.
4656    #[builder(setter(into, strip_option), default)]
4657    pub do_not_follow_symlinks: Option<bool>,
4658}
4659#[derive(Builder, Debug, PartialEq)]
4660pub struct DirectoryTerminalOpts<'a> {
4661    /// If set, override the container's default terminal command and invoke these command arguments instead.
4662    #[builder(setter(into, strip_option), default)]
4663    pub cmd: Option<Vec<&'a str>>,
4664    /// If set, override the default container used for the terminal.
4665    #[builder(setter(into, strip_option), default)]
4666    pub container: Option<Id>,
4667    /// Provides Dagger access to the executed command.
4668    #[builder(setter(into, strip_option), default)]
4669    pub experimental_privileged_nesting: Option<bool>,
4670    /// 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.
4671    #[builder(setter(into, strip_option), default)]
4672    pub insecure_root_capabilities: Option<bool>,
4673}
4674#[derive(Builder, Debug, PartialEq)]
4675pub struct DirectoryWithDirectoryOpts<'a> {
4676    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4677    #[builder(setter(into, strip_option), default)]
4678    pub exclude: Option<Vec<&'a str>>,
4679    /// Apply .gitignore filter rules inside the directory
4680    #[builder(setter(into, strip_option), default)]
4681    pub gitignore: Option<bool>,
4682    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4683    #[builder(setter(into, strip_option), default)]
4684    pub include: Option<Vec<&'a str>>,
4685    /// A user:group to set for the copied directory and its contents.
4686    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4687    /// If the group is omitted, it defaults to the same as the user.
4688    #[builder(setter(into, strip_option), default)]
4689    pub owner: Option<&'a str>,
4690    /// Permission given to the copied directory and contents (e.g., 0755).
4691    #[builder(setter(into, strip_option), default)]
4692    pub permissions: Option<isize>,
4693}
4694#[derive(Builder, Debug, PartialEq)]
4695pub struct DirectoryWithFileOpts<'a> {
4696    /// A user:group to set for the copied directory and its contents.
4697    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4698    /// If the group is omitted, it defaults to the same as the user.
4699    #[builder(setter(into, strip_option), default)]
4700    pub owner: Option<&'a str>,
4701    /// Permission given to the copied file (e.g., 0600).
4702    #[builder(setter(into, strip_option), default)]
4703    pub permissions: Option<isize>,
4704}
4705#[derive(Builder, Debug, PartialEq)]
4706pub struct DirectoryWithFilesOpts {
4707    /// Permission given to the copied files (e.g., 0600).
4708    #[builder(setter(into, strip_option), default)]
4709    pub permissions: Option<isize>,
4710}
4711#[derive(Builder, Debug, PartialEq)]
4712pub struct DirectoryWithNewDirectoryOpts {
4713    /// Permission granted to the created directory (e.g., 0777).
4714    #[builder(setter(into, strip_option), default)]
4715    pub permissions: Option<isize>,
4716}
4717#[derive(Builder, Debug, PartialEq)]
4718pub struct DirectoryWithNewFileOpts {
4719    /// Permissions of the new file. Example: 0600
4720    #[builder(setter(into, strip_option), default)]
4721    pub permissions: Option<isize>,
4722}
4723impl IntoID<Id> for Directory {
4724    fn into_id(
4725        self,
4726    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4727        Box::pin(async move { self.id().await })
4728    }
4729}
4730impl Loadable for Directory {
4731    fn graphql_type() -> &'static str {
4732        "Directory"
4733    }
4734    fn from_query(
4735        proc: Option<Arc<DaggerSessionProc>>,
4736        selection: Selection,
4737        graphql_client: DynGraphQLClient,
4738    ) -> Self {
4739        Self {
4740            proc,
4741            selection,
4742            graphql_client,
4743        }
4744    }
4745}
4746impl Directory {
4747    /// Converts this directory to a local git repository
4748    pub fn as_git(&self) -> GitRepository {
4749        let query = self.selection.select("asGit");
4750        GitRepository {
4751            proc: self.proc.clone(),
4752            selection: query,
4753            graphql_client: self.graphql_client.clone(),
4754        }
4755    }
4756    /// Load the directory as a Dagger module source
4757    ///
4758    /// # Arguments
4759    ///
4760    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4761    pub fn as_module(&self) -> Module {
4762        let query = self.selection.select("asModule");
4763        Module {
4764            proc: self.proc.clone(),
4765            selection: query,
4766            graphql_client: self.graphql_client.clone(),
4767        }
4768    }
4769    /// Load the directory as a Dagger module source
4770    ///
4771    /// # Arguments
4772    ///
4773    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4774    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4775        let mut query = self.selection.select("asModule");
4776        if let Some(source_root_path) = opts.source_root_path {
4777            query = query.arg("sourceRootPath", source_root_path);
4778        }
4779        Module {
4780            proc: self.proc.clone(),
4781            selection: query,
4782            graphql_client: self.graphql_client.clone(),
4783        }
4784    }
4785    /// Load the directory as a Dagger module source
4786    ///
4787    /// # Arguments
4788    ///
4789    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4790    pub fn as_module_source(&self) -> ModuleSource {
4791        let query = self.selection.select("asModuleSource");
4792        ModuleSource {
4793            proc: self.proc.clone(),
4794            selection: query,
4795            graphql_client: self.graphql_client.clone(),
4796        }
4797    }
4798    /// Load the directory as a Dagger module source
4799    ///
4800    /// # Arguments
4801    ///
4802    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4803    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4804        let mut query = self.selection.select("asModuleSource");
4805        if let Some(source_root_path) = opts.source_root_path {
4806            query = query.arg("sourceRootPath", source_root_path);
4807        }
4808        ModuleSource {
4809            proc: self.proc.clone(),
4810            selection: query,
4811            graphql_client: self.graphql_client.clone(),
4812        }
4813    }
4814    /// Return the difference between this directory and another directory, typically an older snapshot.
4815    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
4816    ///
4817    /// # Arguments
4818    ///
4819    /// * `from` - The base directory snapshot to compare against
4820    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4821        let mut query = self.selection.select("changes");
4822        query = query.arg_lazy(
4823            "from",
4824            Box::new(move || {
4825                let from = from.clone();
4826                Box::pin(async move { from.into_id().await.unwrap().quote() })
4827            }),
4828        );
4829        Changeset {
4830            proc: self.proc.clone(),
4831            selection: query,
4832            graphql_client: self.graphql_client.clone(),
4833        }
4834    }
4835    /// Change the owner of the directory contents recursively.
4836    ///
4837    /// # Arguments
4838    ///
4839    /// * `path` - Path of the directory to change ownership of (e.g., "/").
4840    /// * `owner` - A user:group to set for the mounted directory and its contents.
4841    ///
4842    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4843    ///
4844    /// If the group is omitted, it defaults to the same as the user.
4845    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4846        let mut query = self.selection.select("chown");
4847        query = query.arg("path", path.into());
4848        query = query.arg("owner", owner.into());
4849        Directory {
4850            proc: self.proc.clone(),
4851            selection: query,
4852            graphql_client: self.graphql_client.clone(),
4853        }
4854    }
4855    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
4856    ///
4857    /// # Arguments
4858    ///
4859    /// * `other` - The directory to compare against
4860    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4861        let mut query = self.selection.select("diff");
4862        query = query.arg_lazy(
4863            "other",
4864            Box::new(move || {
4865                let other = other.clone();
4866                Box::pin(async move { other.into_id().await.unwrap().quote() })
4867            }),
4868        );
4869        Directory {
4870            proc: self.proc.clone(),
4871            selection: query,
4872            graphql_client: self.graphql_client.clone(),
4873        }
4874    }
4875    /// 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.
4876    pub async fn digest(&self) -> Result<String, DaggerError> {
4877        let query = self.selection.select("digest");
4878        query.execute(self.graphql_client.clone()).await
4879    }
4880    /// Retrieves a directory at the given path.
4881    ///
4882    /// # Arguments
4883    ///
4884    /// * `path` - Location of the directory to retrieve. Example: "/src"
4885    pub fn directory(&self, path: impl Into<String>) -> Directory {
4886        let mut query = self.selection.select("directory");
4887        query = query.arg("path", path.into());
4888        Directory {
4889            proc: self.proc.clone(),
4890            selection: query,
4891            graphql_client: self.graphql_client.clone(),
4892        }
4893    }
4894    /// 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.
4895    ///
4896    /// # Arguments
4897    ///
4898    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4899    pub fn docker_build(&self) -> Container {
4900        let query = self.selection.select("dockerBuild");
4901        Container {
4902            proc: self.proc.clone(),
4903            selection: query,
4904            graphql_client: self.graphql_client.clone(),
4905        }
4906    }
4907    /// 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.
4908    ///
4909    /// # Arguments
4910    ///
4911    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4912    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4913        let mut query = self.selection.select("dockerBuild");
4914        if let Some(dockerfile) = opts.dockerfile {
4915            query = query.arg("dockerfile", dockerfile);
4916        }
4917        if let Some(platform) = opts.platform {
4918            query = query.arg("platform", platform);
4919        }
4920        if let Some(build_args) = opts.build_args {
4921            query = query.arg("buildArgs", build_args);
4922        }
4923        if let Some(target) = opts.target {
4924            query = query.arg("target", target);
4925        }
4926        if let Some(secrets) = opts.secrets {
4927            query = query.arg("secrets", secrets);
4928        }
4929        if let Some(no_init) = opts.no_init {
4930            query = query.arg("noInit", no_init);
4931        }
4932        if let Some(ssh) = opts.ssh {
4933            query = query.arg("ssh", ssh);
4934        }
4935        Container {
4936            proc: self.proc.clone(),
4937            selection: query,
4938            graphql_client: self.graphql_client.clone(),
4939        }
4940    }
4941    /// Returns a list of files and directories at the given path.
4942    ///
4943    /// # Arguments
4944    ///
4945    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4946    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4947        let query = self.selection.select("entries");
4948        query.execute(self.graphql_client.clone()).await
4949    }
4950    /// Returns a list of files and directories at the given path.
4951    ///
4952    /// # Arguments
4953    ///
4954    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4955    pub async fn entries_opts<'a>(
4956        &self,
4957        opts: DirectoryEntriesOpts<'a>,
4958    ) -> Result<Vec<String>, DaggerError> {
4959        let mut query = self.selection.select("entries");
4960        if let Some(path) = opts.path {
4961            query = query.arg("path", path);
4962        }
4963        query.execute(self.graphql_client.clone()).await
4964    }
4965    /// check if a file or directory exists
4966    ///
4967    /// # Arguments
4968    ///
4969    /// * `path` - Path to check (e.g., "/file.txt").
4970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4971    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4972        let mut query = self.selection.select("exists");
4973        query = query.arg("path", path.into());
4974        query.execute(self.graphql_client.clone()).await
4975    }
4976    /// check if a file or directory exists
4977    ///
4978    /// # Arguments
4979    ///
4980    /// * `path` - Path to check (e.g., "/file.txt").
4981    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4982    pub async fn exists_opts(
4983        &self,
4984        path: impl Into<String>,
4985        opts: DirectoryExistsOpts,
4986    ) -> Result<bool, DaggerError> {
4987        let mut query = self.selection.select("exists");
4988        query = query.arg("path", path.into());
4989        if let Some(expected_type) = opts.expected_type {
4990            query = query.arg("expectedType", expected_type);
4991        }
4992        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4993            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4994        }
4995        query.execute(self.graphql_client.clone()).await
4996    }
4997    /// Writes the contents of the directory to a path on the host.
4998    ///
4999    /// # Arguments
5000    ///
5001    /// * `path` - Location of the copied directory (e.g., "logs/").
5002    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5003    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5004        let mut query = self.selection.select("export");
5005        query = query.arg("path", path.into());
5006        query.execute(self.graphql_client.clone()).await
5007    }
5008    /// Writes the contents of the directory to a path on the host.
5009    ///
5010    /// # Arguments
5011    ///
5012    /// * `path` - Location of the copied directory (e.g., "logs/").
5013    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5014    pub async fn export_opts(
5015        &self,
5016        path: impl Into<String>,
5017        opts: DirectoryExportOpts,
5018    ) -> Result<String, DaggerError> {
5019        let mut query = self.selection.select("export");
5020        query = query.arg("path", path.into());
5021        if let Some(wipe) = opts.wipe {
5022            query = query.arg("wipe", wipe);
5023        }
5024        query.execute(self.graphql_client.clone()).await
5025    }
5026    /// Retrieve a file at the given path.
5027    ///
5028    /// # Arguments
5029    ///
5030    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5031    pub fn file(&self, path: impl Into<String>) -> File {
5032        let mut query = self.selection.select("file");
5033        query = query.arg("path", path.into());
5034        File {
5035            proc: self.proc.clone(),
5036            selection: query,
5037            graphql_client: self.graphql_client.clone(),
5038        }
5039    }
5040    /// Return a snapshot with some paths included or excluded
5041    ///
5042    /// # Arguments
5043    ///
5044    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5045    pub fn filter(&self) -> Directory {
5046        let query = self.selection.select("filter");
5047        Directory {
5048            proc: self.proc.clone(),
5049            selection: query,
5050            graphql_client: self.graphql_client.clone(),
5051        }
5052    }
5053    /// Return a snapshot with some paths included or excluded
5054    ///
5055    /// # Arguments
5056    ///
5057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5058    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5059        let mut query = self.selection.select("filter");
5060        if let Some(exclude) = opts.exclude {
5061            query = query.arg("exclude", exclude);
5062        }
5063        if let Some(include) = opts.include {
5064            query = query.arg("include", include);
5065        }
5066        if let Some(gitignore) = opts.gitignore {
5067            query = query.arg("gitignore", gitignore);
5068        }
5069        Directory {
5070            proc: self.proc.clone(),
5071            selection: query,
5072            graphql_client: self.graphql_client.clone(),
5073        }
5074    }
5075    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5076    ///
5077    /// # Arguments
5078    ///
5079    /// * `name` - The name of the file or directory to search for
5080    /// * `start` - The path to start the search from
5081    pub async fn find_up(
5082        &self,
5083        name: impl Into<String>,
5084        start: impl Into<String>,
5085    ) -> Result<String, DaggerError> {
5086        let mut query = self.selection.select("findUp");
5087        query = query.arg("name", name.into());
5088        query = query.arg("start", start.into());
5089        query.execute(self.graphql_client.clone()).await
5090    }
5091    /// Returns a list of files and directories that matche the given pattern.
5092    ///
5093    /// # Arguments
5094    ///
5095    /// * `pattern` - Pattern to match (e.g., "*.md").
5096    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5097        let mut query = self.selection.select("glob");
5098        query = query.arg("pattern", pattern.into());
5099        query.execute(self.graphql_client.clone()).await
5100    }
5101    /// A unique identifier for this Directory.
5102    pub async fn id(&self) -> Result<Id, DaggerError> {
5103        let query = self.selection.select("id");
5104        query.execute(self.graphql_client.clone()).await
5105    }
5106    /// Returns the name of the directory.
5107    pub async fn name(&self) -> Result<String, DaggerError> {
5108        let query = self.selection.select("name");
5109        query.execute(self.graphql_client.clone()).await
5110    }
5111    /// Searches for content matching the given regular expression or literal string.
5112    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5113    ///
5114    /// # Arguments
5115    ///
5116    /// * `pattern` - The text to match.
5117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5118    pub async fn search(
5119        &self,
5120        pattern: impl Into<String>,
5121    ) -> Result<Vec<SearchResult>, DaggerError> {
5122        let mut query = self.selection.select("search");
5123        query = query.arg("pattern", pattern.into());
5124        let query = query.select("id");
5125        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5126        Ok(ids
5127            .into_iter()
5128            .map(|id| SearchResult {
5129                proc: self.proc.clone(),
5130                selection: crate::querybuilder::query()
5131                    .select("node")
5132                    .arg("id", &id.0)
5133                    .inline_fragment("SearchResult"),
5134                graphql_client: self.graphql_client.clone(),
5135            })
5136            .collect())
5137    }
5138    /// Searches for content matching the given regular expression or literal string.
5139    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5140    ///
5141    /// # Arguments
5142    ///
5143    /// * `pattern` - The text to match.
5144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5145    pub async fn search_opts<'a>(
5146        &self,
5147        pattern: impl Into<String>,
5148        opts: DirectorySearchOpts<'a>,
5149    ) -> Result<Vec<SearchResult>, DaggerError> {
5150        let mut query = self.selection.select("search");
5151        query = query.arg("pattern", pattern.into());
5152        if let Some(paths) = opts.paths {
5153            query = query.arg("paths", paths);
5154        }
5155        if let Some(globs) = opts.globs {
5156            query = query.arg("globs", globs);
5157        }
5158        if let Some(literal) = opts.literal {
5159            query = query.arg("literal", literal);
5160        }
5161        if let Some(multiline) = opts.multiline {
5162            query = query.arg("multiline", multiline);
5163        }
5164        if let Some(dotall) = opts.dotall {
5165            query = query.arg("dotall", dotall);
5166        }
5167        if let Some(insensitive) = opts.insensitive {
5168            query = query.arg("insensitive", insensitive);
5169        }
5170        if let Some(skip_ignored) = opts.skip_ignored {
5171            query = query.arg("skipIgnored", skip_ignored);
5172        }
5173        if let Some(skip_hidden) = opts.skip_hidden {
5174            query = query.arg("skipHidden", skip_hidden);
5175        }
5176        if let Some(files_only) = opts.files_only {
5177            query = query.arg("filesOnly", files_only);
5178        }
5179        if let Some(limit) = opts.limit {
5180            query = query.arg("limit", limit);
5181        }
5182        let query = query.select("id");
5183        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5184        Ok(ids
5185            .into_iter()
5186            .map(|id| SearchResult {
5187                proc: self.proc.clone(),
5188                selection: crate::querybuilder::query()
5189                    .select("node")
5190                    .arg("id", &id.0)
5191                    .inline_fragment("SearchResult"),
5192                graphql_client: self.graphql_client.clone(),
5193            })
5194            .collect())
5195    }
5196    /// Return file status
5197    ///
5198    /// # Arguments
5199    ///
5200    /// * `path` - Path to stat (e.g., "/file.txt").
5201    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5202    pub fn stat(&self, path: impl Into<String>) -> Stat {
5203        let mut query = self.selection.select("stat");
5204        query = query.arg("path", path.into());
5205        Stat {
5206            proc: self.proc.clone(),
5207            selection: query,
5208            graphql_client: self.graphql_client.clone(),
5209        }
5210    }
5211    /// Return file status
5212    ///
5213    /// # Arguments
5214    ///
5215    /// * `path` - Path to stat (e.g., "/file.txt").
5216    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5217    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5218        let mut query = self.selection.select("stat");
5219        query = query.arg("path", path.into());
5220        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5221            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5222        }
5223        Stat {
5224            proc: self.proc.clone(),
5225            selection: query,
5226            graphql_client: self.graphql_client.clone(),
5227        }
5228    }
5229    /// Force evaluation in the engine.
5230    pub async fn sync(&self) -> Result<Directory, DaggerError> {
5231        let query = self.selection.select("sync");
5232        let id: Id = query.execute(self.graphql_client.clone()).await?;
5233        Ok(Directory {
5234            proc: self.proc.clone(),
5235            selection: query
5236                .root()
5237                .select("node")
5238                .arg("id", &id.0)
5239                .inline_fragment("Directory"),
5240            graphql_client: self.graphql_client.clone(),
5241        })
5242    }
5243    /// Opens an interactive terminal in new container with this directory mounted inside.
5244    ///
5245    /// # Arguments
5246    ///
5247    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5248    pub fn terminal(&self) -> Directory {
5249        let query = self.selection.select("terminal");
5250        Directory {
5251            proc: self.proc.clone(),
5252            selection: query,
5253            graphql_client: self.graphql_client.clone(),
5254        }
5255    }
5256    /// Opens an interactive terminal in new container with this directory mounted inside.
5257    ///
5258    /// # Arguments
5259    ///
5260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5261    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5262        let mut query = self.selection.select("terminal");
5263        if let Some(container) = opts.container {
5264            query = query.arg("container", container);
5265        }
5266        if let Some(cmd) = opts.cmd {
5267            query = query.arg("cmd", cmd);
5268        }
5269        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5270            query = query.arg(
5271                "experimentalPrivilegedNesting",
5272                experimental_privileged_nesting,
5273            );
5274        }
5275        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5276            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5277        }
5278        Directory {
5279            proc: self.proc.clone(),
5280            selection: query,
5281            graphql_client: self.graphql_client.clone(),
5282        }
5283    }
5284    /// Return a directory with changes from another directory applied to it.
5285    ///
5286    /// # Arguments
5287    ///
5288    /// * `changes` - Changes to apply to the directory
5289    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5290        let mut query = self.selection.select("withChanges");
5291        query = query.arg_lazy(
5292            "changes",
5293            Box::new(move || {
5294                let changes = changes.clone();
5295                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5296            }),
5297        );
5298        Directory {
5299            proc: self.proc.clone(),
5300            selection: query,
5301            graphql_client: self.graphql_client.clone(),
5302        }
5303    }
5304    /// Return a snapshot with a directory added
5305    ///
5306    /// # Arguments
5307    ///
5308    /// * `path` - Location of the written directory (e.g., "/src/").
5309    /// * `source` - Identifier of the directory to copy.
5310    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5311    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5312        let mut query = self.selection.select("withDirectory");
5313        query = query.arg("path", path.into());
5314        query = query.arg_lazy(
5315            "source",
5316            Box::new(move || {
5317                let source = source.clone();
5318                Box::pin(async move { source.into_id().await.unwrap().quote() })
5319            }),
5320        );
5321        Directory {
5322            proc: self.proc.clone(),
5323            selection: query,
5324            graphql_client: self.graphql_client.clone(),
5325        }
5326    }
5327    /// Return a snapshot with a directory added
5328    ///
5329    /// # Arguments
5330    ///
5331    /// * `path` - Location of the written directory (e.g., "/src/").
5332    /// * `source` - Identifier of the directory to copy.
5333    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5334    pub fn with_directory_opts<'a>(
5335        &self,
5336        path: impl Into<String>,
5337        source: impl IntoID<Id>,
5338        opts: DirectoryWithDirectoryOpts<'a>,
5339    ) -> Directory {
5340        let mut query = self.selection.select("withDirectory");
5341        query = query.arg("path", path.into());
5342        query = query.arg_lazy(
5343            "source",
5344            Box::new(move || {
5345                let source = source.clone();
5346                Box::pin(async move { source.into_id().await.unwrap().quote() })
5347            }),
5348        );
5349        if let Some(exclude) = opts.exclude {
5350            query = query.arg("exclude", exclude);
5351        }
5352        if let Some(include) = opts.include {
5353            query = query.arg("include", include);
5354        }
5355        if let Some(gitignore) = opts.gitignore {
5356            query = query.arg("gitignore", gitignore);
5357        }
5358        if let Some(owner) = opts.owner {
5359            query = query.arg("owner", owner);
5360        }
5361        if let Some(permissions) = opts.permissions {
5362            query = query.arg("permissions", permissions);
5363        }
5364        Directory {
5365            proc: self.proc.clone(),
5366            selection: query,
5367            graphql_client: self.graphql_client.clone(),
5368        }
5369    }
5370    /// Raise an error.
5371    ///
5372    /// # Arguments
5373    ///
5374    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5375    pub fn with_error(&self, err: impl Into<String>) -> Directory {
5376        let mut query = self.selection.select("withError");
5377        query = query.arg("err", err.into());
5378        Directory {
5379            proc: self.proc.clone(),
5380            selection: query,
5381            graphql_client: self.graphql_client.clone(),
5382        }
5383    }
5384    /// Retrieves this directory plus the contents of the given file copied to the given path.
5385    ///
5386    /// # Arguments
5387    ///
5388    /// * `path` - Location of the copied file (e.g., "/file.txt").
5389    /// * `source` - Identifier of the file to copy.
5390    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5391    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5392        let mut query = self.selection.select("withFile");
5393        query = query.arg("path", path.into());
5394        query = query.arg_lazy(
5395            "source",
5396            Box::new(move || {
5397                let source = source.clone();
5398                Box::pin(async move { source.into_id().await.unwrap().quote() })
5399            }),
5400        );
5401        Directory {
5402            proc: self.proc.clone(),
5403            selection: query,
5404            graphql_client: self.graphql_client.clone(),
5405        }
5406    }
5407    /// Retrieves this directory plus the contents of the given file copied to the given path.
5408    ///
5409    /// # Arguments
5410    ///
5411    /// * `path` - Location of the copied file (e.g., "/file.txt").
5412    /// * `source` - Identifier of the file to copy.
5413    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5414    pub fn with_file_opts<'a>(
5415        &self,
5416        path: impl Into<String>,
5417        source: impl IntoID<Id>,
5418        opts: DirectoryWithFileOpts<'a>,
5419    ) -> Directory {
5420        let mut query = self.selection.select("withFile");
5421        query = query.arg("path", path.into());
5422        query = query.arg_lazy(
5423            "source",
5424            Box::new(move || {
5425                let source = source.clone();
5426                Box::pin(async move { source.into_id().await.unwrap().quote() })
5427            }),
5428        );
5429        if let Some(permissions) = opts.permissions {
5430            query = query.arg("permissions", permissions);
5431        }
5432        if let Some(owner) = opts.owner {
5433            query = query.arg("owner", owner);
5434        }
5435        Directory {
5436            proc: self.proc.clone(),
5437            selection: query,
5438            graphql_client: self.graphql_client.clone(),
5439        }
5440    }
5441    /// Retrieves this directory plus the contents of the given files copied to the given path.
5442    ///
5443    /// # Arguments
5444    ///
5445    /// * `path` - Location where copied files should be placed (e.g., "/src").
5446    /// * `sources` - Identifiers of the files to copy.
5447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5448    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5449        let mut query = self.selection.select("withFiles");
5450        query = query.arg("path", path.into());
5451        query = query.arg("sources", sources);
5452        Directory {
5453            proc: self.proc.clone(),
5454            selection: query,
5455            graphql_client: self.graphql_client.clone(),
5456        }
5457    }
5458    /// Retrieves this directory plus the contents of the given files copied to the given path.
5459    ///
5460    /// # Arguments
5461    ///
5462    /// * `path` - Location where copied files should be placed (e.g., "/src").
5463    /// * `sources` - Identifiers of the files to copy.
5464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5465    pub fn with_files_opts(
5466        &self,
5467        path: impl Into<String>,
5468        sources: Vec<Id>,
5469        opts: DirectoryWithFilesOpts,
5470    ) -> Directory {
5471        let mut query = self.selection.select("withFiles");
5472        query = query.arg("path", path.into());
5473        query = query.arg("sources", sources);
5474        if let Some(permissions) = opts.permissions {
5475            query = query.arg("permissions", permissions);
5476        }
5477        Directory {
5478            proc: self.proc.clone(),
5479            selection: query,
5480            graphql_client: self.graphql_client.clone(),
5481        }
5482    }
5483    /// Retrieves this directory plus a new directory created at the given path.
5484    ///
5485    /// # Arguments
5486    ///
5487    /// * `path` - Location of the directory created (e.g., "/logs").
5488    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5489    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5490        let mut query = self.selection.select("withNewDirectory");
5491        query = query.arg("path", path.into());
5492        Directory {
5493            proc: self.proc.clone(),
5494            selection: query,
5495            graphql_client: self.graphql_client.clone(),
5496        }
5497    }
5498    /// Retrieves this directory plus a new directory created at the given path.
5499    ///
5500    /// # Arguments
5501    ///
5502    /// * `path` - Location of the directory created (e.g., "/logs").
5503    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5504    pub fn with_new_directory_opts(
5505        &self,
5506        path: impl Into<String>,
5507        opts: DirectoryWithNewDirectoryOpts,
5508    ) -> Directory {
5509        let mut query = self.selection.select("withNewDirectory");
5510        query = query.arg("path", path.into());
5511        if let Some(permissions) = opts.permissions {
5512            query = query.arg("permissions", permissions);
5513        }
5514        Directory {
5515            proc: self.proc.clone(),
5516            selection: query,
5517            graphql_client: self.graphql_client.clone(),
5518        }
5519    }
5520    /// Return a snapshot with a new file added
5521    ///
5522    /// # Arguments
5523    ///
5524    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5525    /// * `contents` - Contents of the new file. Example: "Hello world!"
5526    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5527    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5528        let mut query = self.selection.select("withNewFile");
5529        query = query.arg("path", path.into());
5530        query = query.arg("contents", contents.into());
5531        Directory {
5532            proc: self.proc.clone(),
5533            selection: query,
5534            graphql_client: self.graphql_client.clone(),
5535        }
5536    }
5537    /// Return a snapshot with a new file added
5538    ///
5539    /// # Arguments
5540    ///
5541    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5542    /// * `contents` - Contents of the new file. Example: "Hello world!"
5543    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5544    pub fn with_new_file_opts(
5545        &self,
5546        path: impl Into<String>,
5547        contents: impl Into<String>,
5548        opts: DirectoryWithNewFileOpts,
5549    ) -> Directory {
5550        let mut query = self.selection.select("withNewFile");
5551        query = query.arg("path", path.into());
5552        query = query.arg("contents", contents.into());
5553        if let Some(permissions) = opts.permissions {
5554            query = query.arg("permissions", permissions);
5555        }
5556        Directory {
5557            proc: self.proc.clone(),
5558            selection: query,
5559            graphql_client: self.graphql_client.clone(),
5560        }
5561    }
5562    /// Retrieves this directory with the given Git-compatible patch applied.
5563    ///
5564    /// # Arguments
5565    ///
5566    /// * `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").
5567    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5568        let mut query = self.selection.select("withPatch");
5569        query = query.arg("patch", patch.into());
5570        Directory {
5571            proc: self.proc.clone(),
5572            selection: query,
5573            graphql_client: self.graphql_client.clone(),
5574        }
5575    }
5576    /// Retrieves this directory with the given Git-compatible patch file applied.
5577    ///
5578    /// # Arguments
5579    ///
5580    /// * `patch` - File containing the patch to apply
5581    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5582        let mut query = self.selection.select("withPatchFile");
5583        query = query.arg_lazy(
5584            "patch",
5585            Box::new(move || {
5586                let patch = patch.clone();
5587                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5588            }),
5589        );
5590        Directory {
5591            proc: self.proc.clone(),
5592            selection: query,
5593            graphql_client: self.graphql_client.clone(),
5594        }
5595    }
5596    /// Return a snapshot with a symlink
5597    ///
5598    /// # Arguments
5599    ///
5600    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5601    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5602    pub fn with_symlink(
5603        &self,
5604        target: impl Into<String>,
5605        link_name: impl Into<String>,
5606    ) -> Directory {
5607        let mut query = self.selection.select("withSymlink");
5608        query = query.arg("target", target.into());
5609        query = query.arg("linkName", link_name.into());
5610        Directory {
5611            proc: self.proc.clone(),
5612            selection: query,
5613            graphql_client: self.graphql_client.clone(),
5614        }
5615    }
5616    /// Retrieves this directory with all file/dir timestamps set to the given time.
5617    ///
5618    /// # Arguments
5619    ///
5620    /// * `timestamp` - Timestamp to set dir/files in.
5621    ///
5622    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5623    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5624        let mut query = self.selection.select("withTimestamps");
5625        query = query.arg("timestamp", timestamp);
5626        Directory {
5627            proc: self.proc.clone(),
5628            selection: query,
5629            graphql_client: self.graphql_client.clone(),
5630        }
5631    }
5632    /// Return a snapshot with a subdirectory removed
5633    ///
5634    /// # Arguments
5635    ///
5636    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5637    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5638        let mut query = self.selection.select("withoutDirectory");
5639        query = query.arg("path", path.into());
5640        Directory {
5641            proc: self.proc.clone(),
5642            selection: query,
5643            graphql_client: self.graphql_client.clone(),
5644        }
5645    }
5646    /// Return a snapshot with a file removed
5647    ///
5648    /// # Arguments
5649    ///
5650    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5651    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5652        let mut query = self.selection.select("withoutFile");
5653        query = query.arg("path", path.into());
5654        Directory {
5655            proc: self.proc.clone(),
5656            selection: query,
5657            graphql_client: self.graphql_client.clone(),
5658        }
5659    }
5660    /// Return a snapshot with files removed
5661    ///
5662    /// # Arguments
5663    ///
5664    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5665    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5666        let mut query = self.selection.select("withoutFiles");
5667        query = query.arg(
5668            "paths",
5669            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5670        );
5671        Directory {
5672            proc: self.proc.clone(),
5673            selection: query,
5674            graphql_client: self.graphql_client.clone(),
5675        }
5676    }
5677}
5678impl Exportable for Directory {
5679    fn export(
5680        &self,
5681        path: impl Into<String>,
5682    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5683        let mut query = self.selection.select("export");
5684        query = query.arg("path", path.into());
5685        let graphql_client = self.graphql_client.clone();
5686        async move { query.execute(graphql_client).await }
5687    }
5688    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5689        let query = self.selection.select("id");
5690        let graphql_client = self.graphql_client.clone();
5691        async move { query.execute(graphql_client).await }
5692    }
5693}
5694impl Node for Directory {
5695    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5696        let query = self.selection.select("id");
5697        let graphql_client = self.graphql_client.clone();
5698        async move { query.execute(graphql_client).await }
5699    }
5700}
5701impl Syncer for Directory {
5702    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5703        let query = self.selection.select("id");
5704        let graphql_client = self.graphql_client.clone();
5705        async move { query.execute(graphql_client).await }
5706    }
5707    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5708        let query = self.selection.select("sync");
5709        let graphql_client = self.graphql_client.clone();
5710        async move { query.execute(graphql_client).await }
5711    }
5712}
5713#[derive(Clone)]
5714pub struct Engine {
5715    pub proc: Option<Arc<DaggerSessionProc>>,
5716    pub selection: Selection,
5717    pub graphql_client: DynGraphQLClient,
5718}
5719impl IntoID<Id> for Engine {
5720    fn into_id(
5721        self,
5722    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5723        Box::pin(async move { self.id().await })
5724    }
5725}
5726impl Loadable for Engine {
5727    fn graphql_type() -> &'static str {
5728        "Engine"
5729    }
5730    fn from_query(
5731        proc: Option<Arc<DaggerSessionProc>>,
5732        selection: Selection,
5733        graphql_client: DynGraphQLClient,
5734    ) -> Self {
5735        Self {
5736            proc,
5737            selection,
5738            graphql_client,
5739        }
5740    }
5741}
5742impl Engine {
5743    /// The list of connected client IDs
5744    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5745        let query = self.selection.select("clients");
5746        query.execute(self.graphql_client.clone()).await
5747    }
5748    /// A unique identifier for this Engine.
5749    pub async fn id(&self) -> Result<Id, DaggerError> {
5750        let query = self.selection.select("id");
5751        query.execute(self.graphql_client.clone()).await
5752    }
5753    /// The local engine cache state tracked by dagql
5754    pub fn local_cache(&self) -> EngineCache {
5755        let query = self.selection.select("localCache");
5756        EngineCache {
5757            proc: self.proc.clone(),
5758            selection: query,
5759            graphql_client: self.graphql_client.clone(),
5760        }
5761    }
5762    /// The name of the engine instance.
5763    pub async fn name(&self) -> Result<String, DaggerError> {
5764        let query = self.selection.select("name");
5765        query.execute(self.graphql_client.clone()).await
5766    }
5767}
5768impl Node for Engine {
5769    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5770        let query = self.selection.select("id");
5771        let graphql_client = self.graphql_client.clone();
5772        async move { query.execute(graphql_client).await }
5773    }
5774}
5775#[derive(Clone)]
5776pub struct EngineCache {
5777    pub proc: Option<Arc<DaggerSessionProc>>,
5778    pub selection: Selection,
5779    pub graphql_client: DynGraphQLClient,
5780}
5781#[derive(Builder, Debug, PartialEq)]
5782pub struct EngineCacheEntrySetOpts<'a> {
5783    #[builder(setter(into, strip_option), default)]
5784    pub key: Option<&'a str>,
5785}
5786#[derive(Builder, Debug, PartialEq)]
5787pub struct EngineCachePruneOpts<'a> {
5788    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
5789    #[builder(setter(into, strip_option), default)]
5790    pub max_used_space: Option<&'a str>,
5791    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
5792    #[builder(setter(into, strip_option), default)]
5793    pub min_free_space: Option<&'a str>,
5794    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
5795    #[builder(setter(into, strip_option), default)]
5796    pub reserved_space: Option<&'a str>,
5797    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
5798    #[builder(setter(into, strip_option), default)]
5799    pub target_space: Option<&'a str>,
5800    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5801    #[builder(setter(into, strip_option), default)]
5802    pub use_default_policy: Option<bool>,
5803}
5804impl IntoID<Id> for EngineCache {
5805    fn into_id(
5806        self,
5807    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5808        Box::pin(async move { self.id().await })
5809    }
5810}
5811impl Loadable for EngineCache {
5812    fn graphql_type() -> &'static str {
5813        "EngineCache"
5814    }
5815    fn from_query(
5816        proc: Option<Arc<DaggerSessionProc>>,
5817        selection: Selection,
5818        graphql_client: DynGraphQLClient,
5819    ) -> Self {
5820        Self {
5821            proc,
5822            selection,
5823            graphql_client,
5824        }
5825    }
5826}
5827impl EngineCache {
5828    /// The current set of entries in the cache
5829    ///
5830    /// # Arguments
5831    ///
5832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5833    pub fn entry_set(&self) -> EngineCacheEntrySet {
5834        let query = self.selection.select("entrySet");
5835        EngineCacheEntrySet {
5836            proc: self.proc.clone(),
5837            selection: query,
5838            graphql_client: self.graphql_client.clone(),
5839        }
5840    }
5841    /// The current set of entries in the cache
5842    ///
5843    /// # Arguments
5844    ///
5845    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5846    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5847        let mut query = self.selection.select("entrySet");
5848        if let Some(key) = opts.key {
5849            query = query.arg("key", key);
5850        }
5851        EngineCacheEntrySet {
5852            proc: self.proc.clone(),
5853            selection: query,
5854            graphql_client: self.graphql_client.clone(),
5855        }
5856    }
5857    /// A unique identifier for this EngineCache.
5858    pub async fn id(&self) -> Result<Id, DaggerError> {
5859        let query = self.selection.select("id");
5860        query.execute(self.graphql_client.clone()).await
5861    }
5862    /// The maximum bytes to keep in the cache without pruning.
5863    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5864        let query = self.selection.select("maxUsedSpace");
5865        query.execute(self.graphql_client.clone()).await
5866    }
5867    /// The target amount of free disk space the garbage collector will attempt to leave.
5868    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5869        let query = self.selection.select("minFreeSpace");
5870        query.execute(self.graphql_client.clone()).await
5871    }
5872    /// Prune the cache of releaseable entries
5873    ///
5874    /// # Arguments
5875    ///
5876    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5877    pub async fn prune(&self) -> Result<Void, DaggerError> {
5878        let query = self.selection.select("prune");
5879        query.execute(self.graphql_client.clone()).await
5880    }
5881    /// Prune the cache of releaseable entries
5882    ///
5883    /// # Arguments
5884    ///
5885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5886    pub async fn prune_opts<'a>(
5887        &self,
5888        opts: EngineCachePruneOpts<'a>,
5889    ) -> Result<Void, DaggerError> {
5890        let mut query = self.selection.select("prune");
5891        if let Some(use_default_policy) = opts.use_default_policy {
5892            query = query.arg("useDefaultPolicy", use_default_policy);
5893        }
5894        if let Some(max_used_space) = opts.max_used_space {
5895            query = query.arg("maxUsedSpace", max_used_space);
5896        }
5897        if let Some(reserved_space) = opts.reserved_space {
5898            query = query.arg("reservedSpace", reserved_space);
5899        }
5900        if let Some(min_free_space) = opts.min_free_space {
5901            query = query.arg("minFreeSpace", min_free_space);
5902        }
5903        if let Some(target_space) = opts.target_space {
5904            query = query.arg("targetSpace", target_space);
5905        }
5906        query.execute(self.graphql_client.clone()).await
5907    }
5908    /// The minimum amount of disk space this policy is guaranteed to retain.
5909    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5910        let query = self.selection.select("reservedSpace");
5911        query.execute(self.graphql_client.clone()).await
5912    }
5913    /// The target number of bytes to keep when pruning.
5914    pub async fn target_space(&self) -> Result<isize, DaggerError> {
5915        let query = self.selection.select("targetSpace");
5916        query.execute(self.graphql_client.clone()).await
5917    }
5918}
5919impl Node for EngineCache {
5920    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5921        let query = self.selection.select("id");
5922        let graphql_client = self.graphql_client.clone();
5923        async move { query.execute(graphql_client).await }
5924    }
5925}
5926#[derive(Clone)]
5927pub struct EngineCacheEntry {
5928    pub proc: Option<Arc<DaggerSessionProc>>,
5929    pub selection: Selection,
5930    pub graphql_client: DynGraphQLClient,
5931}
5932impl IntoID<Id> for EngineCacheEntry {
5933    fn into_id(
5934        self,
5935    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5936        Box::pin(async move { self.id().await })
5937    }
5938}
5939impl Loadable for EngineCacheEntry {
5940    fn graphql_type() -> &'static str {
5941        "EngineCacheEntry"
5942    }
5943    fn from_query(
5944        proc: Option<Arc<DaggerSessionProc>>,
5945        selection: Selection,
5946        graphql_client: DynGraphQLClient,
5947    ) -> Self {
5948        Self {
5949            proc,
5950            selection,
5951            graphql_client,
5952        }
5953    }
5954}
5955impl EngineCacheEntry {
5956    /// Whether the cache entry is actively being used.
5957    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5958        let query = self.selection.select("activelyUsed");
5959        query.execute(self.graphql_client.clone()).await
5960    }
5961    /// The time the cache entry was created, in Unix nanoseconds.
5962    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5963        let query = self.selection.select("createdTimeUnixNano");
5964        query.execute(self.graphql_client.clone()).await
5965    }
5966    /// The DagQL call that produced this cache entry.
5967    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
5968        let query = self.selection.select("dagqlCall");
5969        query.execute(self.graphql_client.clone()).await
5970    }
5971    /// The description of the cache entry.
5972    pub async fn description(&self) -> Result<String, DaggerError> {
5973        let query = self.selection.select("description");
5974        query.execute(self.graphql_client.clone()).await
5975    }
5976    /// The disk space used by the cache entry.
5977    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5978        let query = self.selection.select("diskSpaceBytes");
5979        query.execute(self.graphql_client.clone()).await
5980    }
5981    /// A unique identifier for this EngineCacheEntry.
5982    pub async fn id(&self) -> Result<Id, DaggerError> {
5983        let query = self.selection.select("id");
5984        query.execute(self.graphql_client.clone()).await
5985    }
5986    /// The most recent time the cache entry was used, in Unix nanoseconds.
5987    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5988        let query = self.selection.select("mostRecentUseTimeUnixNano");
5989        query.execute(self.graphql_client.clone()).await
5990    }
5991    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
5992    pub async fn record_type(&self) -> Result<String, DaggerError> {
5993        let query = self.selection.select("recordType");
5994        query.execute(self.graphql_client.clone()).await
5995    }
5996    /// The storage record types represented by this cache entry.
5997    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
5998        let query = self.selection.select("recordTypes");
5999        query.execute(self.graphql_client.clone()).await
6000    }
6001}
6002impl Node for EngineCacheEntry {
6003    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6004        let query = self.selection.select("id");
6005        let graphql_client = self.graphql_client.clone();
6006        async move { query.execute(graphql_client).await }
6007    }
6008}
6009#[derive(Clone)]
6010pub struct EngineCacheEntrySet {
6011    pub proc: Option<Arc<DaggerSessionProc>>,
6012    pub selection: Selection,
6013    pub graphql_client: DynGraphQLClient,
6014}
6015impl IntoID<Id> for EngineCacheEntrySet {
6016    fn into_id(
6017        self,
6018    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6019        Box::pin(async move { self.id().await })
6020    }
6021}
6022impl Loadable for EngineCacheEntrySet {
6023    fn graphql_type() -> &'static str {
6024        "EngineCacheEntrySet"
6025    }
6026    fn from_query(
6027        proc: Option<Arc<DaggerSessionProc>>,
6028        selection: Selection,
6029        graphql_client: DynGraphQLClient,
6030    ) -> Self {
6031        Self {
6032            proc,
6033            selection,
6034            graphql_client,
6035        }
6036    }
6037}
6038impl EngineCacheEntrySet {
6039    /// The total disk space used by the cache entries in this set.
6040    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6041        let query = self.selection.select("diskSpaceBytes");
6042        query.execute(self.graphql_client.clone()).await
6043    }
6044    /// The list of individual cache entries in the set
6045    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6046        let query = self.selection.select("entries");
6047        let query = query.select("id");
6048        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6049        Ok(ids
6050            .into_iter()
6051            .map(|id| EngineCacheEntry {
6052                proc: self.proc.clone(),
6053                selection: crate::querybuilder::query()
6054                    .select("node")
6055                    .arg("id", &id.0)
6056                    .inline_fragment("EngineCacheEntry"),
6057                graphql_client: self.graphql_client.clone(),
6058            })
6059            .collect())
6060    }
6061    /// The number of cache entries in this set.
6062    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6063        let query = self.selection.select("entryCount");
6064        query.execute(self.graphql_client.clone()).await
6065    }
6066    /// A unique identifier for this EngineCacheEntrySet.
6067    pub async fn id(&self) -> Result<Id, DaggerError> {
6068        let query = self.selection.select("id");
6069        query.execute(self.graphql_client.clone()).await
6070    }
6071}
6072impl Node for EngineCacheEntrySet {
6073    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6074        let query = self.selection.select("id");
6075        let graphql_client = self.graphql_client.clone();
6076        async move { query.execute(graphql_client).await }
6077    }
6078}
6079#[derive(Clone)]
6080pub struct EnumTypeDef {
6081    pub proc: Option<Arc<DaggerSessionProc>>,
6082    pub selection: Selection,
6083    pub graphql_client: DynGraphQLClient,
6084}
6085impl IntoID<Id> for EnumTypeDef {
6086    fn into_id(
6087        self,
6088    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6089        Box::pin(async move { self.id().await })
6090    }
6091}
6092impl Loadable for EnumTypeDef {
6093    fn graphql_type() -> &'static str {
6094        "EnumTypeDef"
6095    }
6096    fn from_query(
6097        proc: Option<Arc<DaggerSessionProc>>,
6098        selection: Selection,
6099        graphql_client: DynGraphQLClient,
6100    ) -> Self {
6101        Self {
6102            proc,
6103            selection,
6104            graphql_client,
6105        }
6106    }
6107}
6108impl EnumTypeDef {
6109    /// A doc string for the enum, if any.
6110    pub async fn description(&self) -> Result<String, DaggerError> {
6111        let query = self.selection.select("description");
6112        query.execute(self.graphql_client.clone()).await
6113    }
6114    /// A unique identifier for this EnumTypeDef.
6115    pub async fn id(&self) -> Result<Id, DaggerError> {
6116        let query = self.selection.select("id");
6117        query.execute(self.graphql_client.clone()).await
6118    }
6119    /// The members of the enum.
6120    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6121        let query = self.selection.select("members");
6122        let query = query.select("id");
6123        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6124        Ok(ids
6125            .into_iter()
6126            .map(|id| EnumValueTypeDef {
6127                proc: self.proc.clone(),
6128                selection: crate::querybuilder::query()
6129                    .select("node")
6130                    .arg("id", &id.0)
6131                    .inline_fragment("EnumValueTypeDef"),
6132                graphql_client: self.graphql_client.clone(),
6133            })
6134            .collect())
6135    }
6136    /// The name of the enum.
6137    pub async fn name(&self) -> Result<String, DaggerError> {
6138        let query = self.selection.select("name");
6139        query.execute(self.graphql_client.clone()).await
6140    }
6141    /// The location of this enum declaration.
6142    pub fn source_map(&self) -> SourceMap {
6143        let query = self.selection.select("sourceMap");
6144        SourceMap {
6145            proc: self.proc.clone(),
6146            selection: query,
6147            graphql_client: self.graphql_client.clone(),
6148        }
6149    }
6150    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6151    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6152        let query = self.selection.select("sourceModuleName");
6153        query.execute(self.graphql_client.clone()).await
6154    }
6155    /// The members of the enum.
6156    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6157        let query = self.selection.select("values");
6158        let query = query.select("id");
6159        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6160        Ok(ids
6161            .into_iter()
6162            .map(|id| EnumValueTypeDef {
6163                proc: self.proc.clone(),
6164                selection: crate::querybuilder::query()
6165                    .select("node")
6166                    .arg("id", &id.0)
6167                    .inline_fragment("EnumValueTypeDef"),
6168                graphql_client: self.graphql_client.clone(),
6169            })
6170            .collect())
6171    }
6172}
6173impl Node for EnumTypeDef {
6174    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6175        let query = self.selection.select("id");
6176        let graphql_client = self.graphql_client.clone();
6177        async move { query.execute(graphql_client).await }
6178    }
6179}
6180#[derive(Clone)]
6181pub struct EnumValueTypeDef {
6182    pub proc: Option<Arc<DaggerSessionProc>>,
6183    pub selection: Selection,
6184    pub graphql_client: DynGraphQLClient,
6185}
6186impl IntoID<Id> for EnumValueTypeDef {
6187    fn into_id(
6188        self,
6189    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6190        Box::pin(async move { self.id().await })
6191    }
6192}
6193impl Loadable for EnumValueTypeDef {
6194    fn graphql_type() -> &'static str {
6195        "EnumValueTypeDef"
6196    }
6197    fn from_query(
6198        proc: Option<Arc<DaggerSessionProc>>,
6199        selection: Selection,
6200        graphql_client: DynGraphQLClient,
6201    ) -> Self {
6202        Self {
6203            proc,
6204            selection,
6205            graphql_client,
6206        }
6207    }
6208}
6209impl EnumValueTypeDef {
6210    /// The reason this enum member is deprecated, if any.
6211    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6212        let query = self.selection.select("deprecated");
6213        query.execute(self.graphql_client.clone()).await
6214    }
6215    /// A doc string for the enum member, if any.
6216    pub async fn description(&self) -> Result<String, DaggerError> {
6217        let query = self.selection.select("description");
6218        query.execute(self.graphql_client.clone()).await
6219    }
6220    /// A unique identifier for this EnumValueTypeDef.
6221    pub async fn id(&self) -> Result<Id, DaggerError> {
6222        let query = self.selection.select("id");
6223        query.execute(self.graphql_client.clone()).await
6224    }
6225    /// The name of the enum member.
6226    pub async fn name(&self) -> Result<String, DaggerError> {
6227        let query = self.selection.select("name");
6228        query.execute(self.graphql_client.clone()).await
6229    }
6230    /// The location of this enum member declaration.
6231    pub fn source_map(&self) -> SourceMap {
6232        let query = self.selection.select("sourceMap");
6233        SourceMap {
6234            proc: self.proc.clone(),
6235            selection: query,
6236            graphql_client: self.graphql_client.clone(),
6237        }
6238    }
6239    /// The value of the enum member
6240    pub async fn value(&self) -> Result<String, DaggerError> {
6241        let query = self.selection.select("value");
6242        query.execute(self.graphql_client.clone()).await
6243    }
6244}
6245impl Node for EnumValueTypeDef {
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 Env {
6254    pub proc: Option<Arc<DaggerSessionProc>>,
6255    pub selection: Selection,
6256    pub graphql_client: DynGraphQLClient,
6257}
6258#[derive(Builder, Debug, PartialEq)]
6259pub struct EnvChecksOpts<'a> {
6260    /// Only include checks matching the specified patterns
6261    #[builder(setter(into, strip_option), default)]
6262    pub include: Option<Vec<&'a str>>,
6263    /// When true, only return annotated check functions; exclude generate-as-checks
6264    #[builder(setter(into, strip_option), default)]
6265    pub no_generate: Option<bool>,
6266}
6267#[derive(Builder, Debug, PartialEq)]
6268pub struct EnvServicesOpts<'a> {
6269    /// Only include services matching the specified patterns
6270    #[builder(setter(into, strip_option), default)]
6271    pub include: Option<Vec<&'a str>>,
6272}
6273impl IntoID<Id> for Env {
6274    fn into_id(
6275        self,
6276    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6277        Box::pin(async move { self.id().await })
6278    }
6279}
6280impl Loadable for Env {
6281    fn graphql_type() -> &'static str {
6282        "Env"
6283    }
6284    fn from_query(
6285        proc: Option<Arc<DaggerSessionProc>>,
6286        selection: Selection,
6287        graphql_client: DynGraphQLClient,
6288    ) -> Self {
6289        Self {
6290            proc,
6291            selection,
6292            graphql_client,
6293        }
6294    }
6295}
6296impl Env {
6297    /// Return the check with the given name from the installed modules. Must match exactly one check.
6298    ///
6299    /// # Arguments
6300    ///
6301    /// * `name` - The name of the check to retrieve
6302    pub fn check(&self, name: impl Into<String>) -> Check {
6303        let mut query = self.selection.select("check");
6304        query = query.arg("name", name.into());
6305        Check {
6306            proc: self.proc.clone(),
6307            selection: query,
6308            graphql_client: self.graphql_client.clone(),
6309        }
6310    }
6311    /// Return all checks defined by the installed modules
6312    ///
6313    /// # Arguments
6314    ///
6315    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6316    pub fn checks(&self) -> CheckGroup {
6317        let query = self.selection.select("checks");
6318        CheckGroup {
6319            proc: self.proc.clone(),
6320            selection: query,
6321            graphql_client: self.graphql_client.clone(),
6322        }
6323    }
6324    /// Return all checks defined by the installed modules
6325    ///
6326    /// # Arguments
6327    ///
6328    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6329    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6330        let mut query = self.selection.select("checks");
6331        if let Some(include) = opts.include {
6332            query = query.arg("include", include);
6333        }
6334        if let Some(no_generate) = opts.no_generate {
6335            query = query.arg("noGenerate", no_generate);
6336        }
6337        CheckGroup {
6338            proc: self.proc.clone(),
6339            selection: query,
6340            graphql_client: self.graphql_client.clone(),
6341        }
6342    }
6343    /// A unique identifier for this Env.
6344    pub async fn id(&self) -> Result<Id, DaggerError> {
6345        let query = self.selection.select("id");
6346        query.execute(self.graphql_client.clone()).await
6347    }
6348    /// Retrieves an input binding by name
6349    pub fn input(&self, name: impl Into<String>) -> Binding {
6350        let mut query = self.selection.select("input");
6351        query = query.arg("name", name.into());
6352        Binding {
6353            proc: self.proc.clone(),
6354            selection: query,
6355            graphql_client: self.graphql_client.clone(),
6356        }
6357    }
6358    /// Returns all input bindings provided to the environment
6359    pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6360        let query = self.selection.select("inputs");
6361        let query = query.select("id");
6362        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6363        Ok(ids
6364            .into_iter()
6365            .map(|id| Binding {
6366                proc: self.proc.clone(),
6367                selection: crate::querybuilder::query()
6368                    .select("node")
6369                    .arg("id", &id.0)
6370                    .inline_fragment("Binding"),
6371                graphql_client: self.graphql_client.clone(),
6372            })
6373            .collect())
6374    }
6375    /// Retrieves an output binding by name
6376    pub fn output(&self, name: impl Into<String>) -> Binding {
6377        let mut query = self.selection.select("output");
6378        query = query.arg("name", name.into());
6379        Binding {
6380            proc: self.proc.clone(),
6381            selection: query,
6382            graphql_client: self.graphql_client.clone(),
6383        }
6384    }
6385    /// Returns all declared output bindings for the environment
6386    pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6387        let query = self.selection.select("outputs");
6388        let query = query.select("id");
6389        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6390        Ok(ids
6391            .into_iter()
6392            .map(|id| Binding {
6393                proc: self.proc.clone(),
6394                selection: crate::querybuilder::query()
6395                    .select("node")
6396                    .arg("id", &id.0)
6397                    .inline_fragment("Binding"),
6398                graphql_client: self.graphql_client.clone(),
6399            })
6400            .collect())
6401    }
6402    /// Return all services defined by the installed modules
6403    ///
6404    /// # Arguments
6405    ///
6406    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6407    pub fn services(&self) -> UpGroup {
6408        let query = self.selection.select("services");
6409        UpGroup {
6410            proc: self.proc.clone(),
6411            selection: query,
6412            graphql_client: self.graphql_client.clone(),
6413        }
6414    }
6415    /// Return all services defined by the installed modules
6416    ///
6417    /// # Arguments
6418    ///
6419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6420    pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6421        let mut query = self.selection.select("services");
6422        if let Some(include) = opts.include {
6423            query = query.arg("include", include);
6424        }
6425        UpGroup {
6426            proc: self.proc.clone(),
6427            selection: query,
6428            graphql_client: self.graphql_client.clone(),
6429        }
6430    }
6431    /// Create or update a binding of type Address in the environment
6432    ///
6433    /// # Arguments
6434    ///
6435    /// * `name` - The name of the binding
6436    /// * `value` - The Address value to assign to the binding
6437    /// * `description` - The purpose of the input
6438    pub fn with_address_input(
6439        &self,
6440        name: impl Into<String>,
6441        value: impl IntoID<Id>,
6442        description: impl Into<String>,
6443    ) -> Env {
6444        let mut query = self.selection.select("withAddressInput");
6445        query = query.arg("name", name.into());
6446        query = query.arg_lazy(
6447            "value",
6448            Box::new(move || {
6449                let value = value.clone();
6450                Box::pin(async move { value.into_id().await.unwrap().quote() })
6451            }),
6452        );
6453        query = query.arg("description", description.into());
6454        Env {
6455            proc: self.proc.clone(),
6456            selection: query,
6457            graphql_client: self.graphql_client.clone(),
6458        }
6459    }
6460    /// Declare a desired Address output to be assigned in the environment
6461    ///
6462    /// # Arguments
6463    ///
6464    /// * `name` - The name of the binding
6465    /// * `description` - A description of the desired value of the binding
6466    pub fn with_address_output(
6467        &self,
6468        name: impl Into<String>,
6469        description: impl Into<String>,
6470    ) -> Env {
6471        let mut query = self.selection.select("withAddressOutput");
6472        query = query.arg("name", name.into());
6473        query = query.arg("description", description.into());
6474        Env {
6475            proc: self.proc.clone(),
6476            selection: query,
6477            graphql_client: self.graphql_client.clone(),
6478        }
6479    }
6480    /// Create or update a binding of type CacheVolume in the environment
6481    ///
6482    /// # Arguments
6483    ///
6484    /// * `name` - The name of the binding
6485    /// * `value` - The CacheVolume value to assign to the binding
6486    /// * `description` - The purpose of the input
6487    pub fn with_cache_volume_input(
6488        &self,
6489        name: impl Into<String>,
6490        value: impl IntoID<Id>,
6491        description: impl Into<String>,
6492    ) -> Env {
6493        let mut query = self.selection.select("withCacheVolumeInput");
6494        query = query.arg("name", name.into());
6495        query = query.arg_lazy(
6496            "value",
6497            Box::new(move || {
6498                let value = value.clone();
6499                Box::pin(async move { value.into_id().await.unwrap().quote() })
6500            }),
6501        );
6502        query = query.arg("description", description.into());
6503        Env {
6504            proc: self.proc.clone(),
6505            selection: query,
6506            graphql_client: self.graphql_client.clone(),
6507        }
6508    }
6509    /// Declare a desired CacheVolume output to be assigned in the environment
6510    ///
6511    /// # Arguments
6512    ///
6513    /// * `name` - The name of the binding
6514    /// * `description` - A description of the desired value of the binding
6515    pub fn with_cache_volume_output(
6516        &self,
6517        name: impl Into<String>,
6518        description: impl Into<String>,
6519    ) -> Env {
6520        let mut query = self.selection.select("withCacheVolumeOutput");
6521        query = query.arg("name", name.into());
6522        query = query.arg("description", description.into());
6523        Env {
6524            proc: self.proc.clone(),
6525            selection: query,
6526            graphql_client: self.graphql_client.clone(),
6527        }
6528    }
6529    /// Create or update a binding of type Changeset in the environment
6530    ///
6531    /// # Arguments
6532    ///
6533    /// * `name` - The name of the binding
6534    /// * `value` - The Changeset value to assign to the binding
6535    /// * `description` - The purpose of the input
6536    pub fn with_changeset_input(
6537        &self,
6538        name: impl Into<String>,
6539        value: impl IntoID<Id>,
6540        description: impl Into<String>,
6541    ) -> Env {
6542        let mut query = self.selection.select("withChangesetInput");
6543        query = query.arg("name", name.into());
6544        query = query.arg_lazy(
6545            "value",
6546            Box::new(move || {
6547                let value = value.clone();
6548                Box::pin(async move { value.into_id().await.unwrap().quote() })
6549            }),
6550        );
6551        query = query.arg("description", description.into());
6552        Env {
6553            proc: self.proc.clone(),
6554            selection: query,
6555            graphql_client: self.graphql_client.clone(),
6556        }
6557    }
6558    /// Declare a desired Changeset output to be assigned in the environment
6559    ///
6560    /// # Arguments
6561    ///
6562    /// * `name` - The name of the binding
6563    /// * `description` - A description of the desired value of the binding
6564    pub fn with_changeset_output(
6565        &self,
6566        name: impl Into<String>,
6567        description: impl Into<String>,
6568    ) -> Env {
6569        let mut query = self.selection.select("withChangesetOutput");
6570        query = query.arg("name", name.into());
6571        query = query.arg("description", description.into());
6572        Env {
6573            proc: self.proc.clone(),
6574            selection: query,
6575            graphql_client: self.graphql_client.clone(),
6576        }
6577    }
6578    /// Create or update a binding of type CheckGroup in the environment
6579    ///
6580    /// # Arguments
6581    ///
6582    /// * `name` - The name of the binding
6583    /// * `value` - The CheckGroup value to assign to the binding
6584    /// * `description` - The purpose of the input
6585    pub fn with_check_group_input(
6586        &self,
6587        name: impl Into<String>,
6588        value: impl IntoID<Id>,
6589        description: impl Into<String>,
6590    ) -> Env {
6591        let mut query = self.selection.select("withCheckGroupInput");
6592        query = query.arg("name", name.into());
6593        query = query.arg_lazy(
6594            "value",
6595            Box::new(move || {
6596                let value = value.clone();
6597                Box::pin(async move { value.into_id().await.unwrap().quote() })
6598            }),
6599        );
6600        query = query.arg("description", description.into());
6601        Env {
6602            proc: self.proc.clone(),
6603            selection: query,
6604            graphql_client: self.graphql_client.clone(),
6605        }
6606    }
6607    /// Declare a desired CheckGroup output to be assigned in the environment
6608    ///
6609    /// # Arguments
6610    ///
6611    /// * `name` - The name of the binding
6612    /// * `description` - A description of the desired value of the binding
6613    pub fn with_check_group_output(
6614        &self,
6615        name: impl Into<String>,
6616        description: impl Into<String>,
6617    ) -> Env {
6618        let mut query = self.selection.select("withCheckGroupOutput");
6619        query = query.arg("name", name.into());
6620        query = query.arg("description", description.into());
6621        Env {
6622            proc: self.proc.clone(),
6623            selection: query,
6624            graphql_client: self.graphql_client.clone(),
6625        }
6626    }
6627    /// Create or update a binding of type Check in the environment
6628    ///
6629    /// # Arguments
6630    ///
6631    /// * `name` - The name of the binding
6632    /// * `value` - The Check value to assign to the binding
6633    /// * `description` - The purpose of the input
6634    pub fn with_check_input(
6635        &self,
6636        name: impl Into<String>,
6637        value: impl IntoID<Id>,
6638        description: impl Into<String>,
6639    ) -> Env {
6640        let mut query = self.selection.select("withCheckInput");
6641        query = query.arg("name", name.into());
6642        query = query.arg_lazy(
6643            "value",
6644            Box::new(move || {
6645                let value = value.clone();
6646                Box::pin(async move { value.into_id().await.unwrap().quote() })
6647            }),
6648        );
6649        query = query.arg("description", description.into());
6650        Env {
6651            proc: self.proc.clone(),
6652            selection: query,
6653            graphql_client: self.graphql_client.clone(),
6654        }
6655    }
6656    /// Declare a desired Check output to be assigned in the environment
6657    ///
6658    /// # Arguments
6659    ///
6660    /// * `name` - The name of the binding
6661    /// * `description` - A description of the desired value of the binding
6662    pub fn with_check_output(
6663        &self,
6664        name: impl Into<String>,
6665        description: impl Into<String>,
6666    ) -> Env {
6667        let mut query = self.selection.select("withCheckOutput");
6668        query = query.arg("name", name.into());
6669        query = query.arg("description", description.into());
6670        Env {
6671            proc: self.proc.clone(),
6672            selection: query,
6673            graphql_client: self.graphql_client.clone(),
6674        }
6675    }
6676    /// Create or update a binding of type Cloud in the environment
6677    ///
6678    /// # Arguments
6679    ///
6680    /// * `name` - The name of the binding
6681    /// * `value` - The Cloud value to assign to the binding
6682    /// * `description` - The purpose of the input
6683    pub fn with_cloud_input(
6684        &self,
6685        name: impl Into<String>,
6686        value: impl IntoID<Id>,
6687        description: impl Into<String>,
6688    ) -> Env {
6689        let mut query = self.selection.select("withCloudInput");
6690        query = query.arg("name", name.into());
6691        query = query.arg_lazy(
6692            "value",
6693            Box::new(move || {
6694                let value = value.clone();
6695                Box::pin(async move { value.into_id().await.unwrap().quote() })
6696            }),
6697        );
6698        query = query.arg("description", description.into());
6699        Env {
6700            proc: self.proc.clone(),
6701            selection: query,
6702            graphql_client: self.graphql_client.clone(),
6703        }
6704    }
6705    /// Declare a desired Cloud output to be assigned in the environment
6706    ///
6707    /// # Arguments
6708    ///
6709    /// * `name` - The name of the binding
6710    /// * `description` - A description of the desired value of the binding
6711    pub fn with_cloud_output(
6712        &self,
6713        name: impl Into<String>,
6714        description: impl Into<String>,
6715    ) -> Env {
6716        let mut query = self.selection.select("withCloudOutput");
6717        query = query.arg("name", name.into());
6718        query = query.arg("description", description.into());
6719        Env {
6720            proc: self.proc.clone(),
6721            selection: query,
6722            graphql_client: self.graphql_client.clone(),
6723        }
6724    }
6725    /// Create or update a binding of type Container in the environment
6726    ///
6727    /// # Arguments
6728    ///
6729    /// * `name` - The name of the binding
6730    /// * `value` - The Container value to assign to the binding
6731    /// * `description` - The purpose of the input
6732    pub fn with_container_input(
6733        &self,
6734        name: impl Into<String>,
6735        value: impl IntoID<Id>,
6736        description: impl Into<String>,
6737    ) -> Env {
6738        let mut query = self.selection.select("withContainerInput");
6739        query = query.arg("name", name.into());
6740        query = query.arg_lazy(
6741            "value",
6742            Box::new(move || {
6743                let value = value.clone();
6744                Box::pin(async move { value.into_id().await.unwrap().quote() })
6745            }),
6746        );
6747        query = query.arg("description", description.into());
6748        Env {
6749            proc: self.proc.clone(),
6750            selection: query,
6751            graphql_client: self.graphql_client.clone(),
6752        }
6753    }
6754    /// Declare a desired Container output to be assigned in the environment
6755    ///
6756    /// # Arguments
6757    ///
6758    /// * `name` - The name of the binding
6759    /// * `description` - A description of the desired value of the binding
6760    pub fn with_container_output(
6761        &self,
6762        name: impl Into<String>,
6763        description: impl Into<String>,
6764    ) -> Env {
6765        let mut query = self.selection.select("withContainerOutput");
6766        query = query.arg("name", name.into());
6767        query = query.arg("description", description.into());
6768        Env {
6769            proc: self.proc.clone(),
6770            selection: query,
6771            graphql_client: self.graphql_client.clone(),
6772        }
6773    }
6774    /// Installs the current module into the environment, exposing its functions to the model
6775    /// Contextual path arguments will be populated using the environment's workspace.
6776    pub fn with_current_module(&self) -> Env {
6777        let query = self.selection.select("withCurrentModule");
6778        Env {
6779            proc: self.proc.clone(),
6780            selection: query,
6781            graphql_client: self.graphql_client.clone(),
6782        }
6783    }
6784    /// Create or update a binding of type DiffStat in the environment
6785    ///
6786    /// # Arguments
6787    ///
6788    /// * `name` - The name of the binding
6789    /// * `value` - The DiffStat value to assign to the binding
6790    /// * `description` - The purpose of the input
6791    pub fn with_diff_stat_input(
6792        &self,
6793        name: impl Into<String>,
6794        value: impl IntoID<Id>,
6795        description: impl Into<String>,
6796    ) -> Env {
6797        let mut query = self.selection.select("withDiffStatInput");
6798        query = query.arg("name", name.into());
6799        query = query.arg_lazy(
6800            "value",
6801            Box::new(move || {
6802                let value = value.clone();
6803                Box::pin(async move { value.into_id().await.unwrap().quote() })
6804            }),
6805        );
6806        query = query.arg("description", description.into());
6807        Env {
6808            proc: self.proc.clone(),
6809            selection: query,
6810            graphql_client: self.graphql_client.clone(),
6811        }
6812    }
6813    /// Declare a desired DiffStat output to be assigned in the environment
6814    ///
6815    /// # Arguments
6816    ///
6817    /// * `name` - The name of the binding
6818    /// * `description` - A description of the desired value of the binding
6819    pub fn with_diff_stat_output(
6820        &self,
6821        name: impl Into<String>,
6822        description: impl Into<String>,
6823    ) -> Env {
6824        let mut query = self.selection.select("withDiffStatOutput");
6825        query = query.arg("name", name.into());
6826        query = query.arg("description", description.into());
6827        Env {
6828            proc: self.proc.clone(),
6829            selection: query,
6830            graphql_client: self.graphql_client.clone(),
6831        }
6832    }
6833    /// Create or update a binding of type Directory in the environment
6834    ///
6835    /// # Arguments
6836    ///
6837    /// * `name` - The name of the binding
6838    /// * `value` - The Directory value to assign to the binding
6839    /// * `description` - The purpose of the input
6840    pub fn with_directory_input(
6841        &self,
6842        name: impl Into<String>,
6843        value: impl IntoID<Id>,
6844        description: impl Into<String>,
6845    ) -> Env {
6846        let mut query = self.selection.select("withDirectoryInput");
6847        query = query.arg("name", name.into());
6848        query = query.arg_lazy(
6849            "value",
6850            Box::new(move || {
6851                let value = value.clone();
6852                Box::pin(async move { value.into_id().await.unwrap().quote() })
6853            }),
6854        );
6855        query = query.arg("description", description.into());
6856        Env {
6857            proc: self.proc.clone(),
6858            selection: query,
6859            graphql_client: self.graphql_client.clone(),
6860        }
6861    }
6862    /// Declare a desired Directory output to be assigned in the environment
6863    ///
6864    /// # Arguments
6865    ///
6866    /// * `name` - The name of the binding
6867    /// * `description` - A description of the desired value of the binding
6868    pub fn with_directory_output(
6869        &self,
6870        name: impl Into<String>,
6871        description: impl Into<String>,
6872    ) -> Env {
6873        let mut query = self.selection.select("withDirectoryOutput");
6874        query = query.arg("name", name.into());
6875        query = query.arg("description", description.into());
6876        Env {
6877            proc: self.proc.clone(),
6878            selection: query,
6879            graphql_client: self.graphql_client.clone(),
6880        }
6881    }
6882    /// Create or update a binding of type EnvFile in the environment
6883    ///
6884    /// # Arguments
6885    ///
6886    /// * `name` - The name of the binding
6887    /// * `value` - The EnvFile value to assign to the binding
6888    /// * `description` - The purpose of the input
6889    pub fn with_env_file_input(
6890        &self,
6891        name: impl Into<String>,
6892        value: impl IntoID<Id>,
6893        description: impl Into<String>,
6894    ) -> Env {
6895        let mut query = self.selection.select("withEnvFileInput");
6896        query = query.arg("name", name.into());
6897        query = query.arg_lazy(
6898            "value",
6899            Box::new(move || {
6900                let value = value.clone();
6901                Box::pin(async move { value.into_id().await.unwrap().quote() })
6902            }),
6903        );
6904        query = query.arg("description", description.into());
6905        Env {
6906            proc: self.proc.clone(),
6907            selection: query,
6908            graphql_client: self.graphql_client.clone(),
6909        }
6910    }
6911    /// Declare a desired EnvFile output to be assigned in the environment
6912    ///
6913    /// # Arguments
6914    ///
6915    /// * `name` - The name of the binding
6916    /// * `description` - A description of the desired value of the binding
6917    pub fn with_env_file_output(
6918        &self,
6919        name: impl Into<String>,
6920        description: impl Into<String>,
6921    ) -> Env {
6922        let mut query = self.selection.select("withEnvFileOutput");
6923        query = query.arg("name", name.into());
6924        query = query.arg("description", description.into());
6925        Env {
6926            proc: self.proc.clone(),
6927            selection: query,
6928            graphql_client: self.graphql_client.clone(),
6929        }
6930    }
6931    /// Create or update a binding of type Env in the environment
6932    ///
6933    /// # Arguments
6934    ///
6935    /// * `name` - The name of the binding
6936    /// * `value` - The Env value to assign to the binding
6937    /// * `description` - The purpose of the input
6938    pub fn with_env_input(
6939        &self,
6940        name: impl Into<String>,
6941        value: impl IntoID<Id>,
6942        description: impl Into<String>,
6943    ) -> Env {
6944        let mut query = self.selection.select("withEnvInput");
6945        query = query.arg("name", name.into());
6946        query = query.arg_lazy(
6947            "value",
6948            Box::new(move || {
6949                let value = value.clone();
6950                Box::pin(async move { value.into_id().await.unwrap().quote() })
6951            }),
6952        );
6953        query = query.arg("description", description.into());
6954        Env {
6955            proc: self.proc.clone(),
6956            selection: query,
6957            graphql_client: self.graphql_client.clone(),
6958        }
6959    }
6960    /// Declare a desired Env output to be assigned in the environment
6961    ///
6962    /// # Arguments
6963    ///
6964    /// * `name` - The name of the binding
6965    /// * `description` - A description of the desired value of the binding
6966    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6967        let mut query = self.selection.select("withEnvOutput");
6968        query = query.arg("name", name.into());
6969        query = query.arg("description", description.into());
6970        Env {
6971            proc: self.proc.clone(),
6972            selection: query,
6973            graphql_client: self.graphql_client.clone(),
6974        }
6975    }
6976    /// Create or update a binding of type File in the environment
6977    ///
6978    /// # Arguments
6979    ///
6980    /// * `name` - The name of the binding
6981    /// * `value` - The File value to assign to the binding
6982    /// * `description` - The purpose of the input
6983    pub fn with_file_input(
6984        &self,
6985        name: impl Into<String>,
6986        value: impl IntoID<Id>,
6987        description: impl Into<String>,
6988    ) -> Env {
6989        let mut query = self.selection.select("withFileInput");
6990        query = query.arg("name", name.into());
6991        query = query.arg_lazy(
6992            "value",
6993            Box::new(move || {
6994                let value = value.clone();
6995                Box::pin(async move { value.into_id().await.unwrap().quote() })
6996            }),
6997        );
6998        query = query.arg("description", description.into());
6999        Env {
7000            proc: self.proc.clone(),
7001            selection: query,
7002            graphql_client: self.graphql_client.clone(),
7003        }
7004    }
7005    /// Declare a desired File output to be assigned in the environment
7006    ///
7007    /// # Arguments
7008    ///
7009    /// * `name` - The name of the binding
7010    /// * `description` - A description of the desired value of the binding
7011    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7012        let mut query = self.selection.select("withFileOutput");
7013        query = query.arg("name", name.into());
7014        query = query.arg("description", description.into());
7015        Env {
7016            proc: self.proc.clone(),
7017            selection: query,
7018            graphql_client: self.graphql_client.clone(),
7019        }
7020    }
7021    /// Create or update a binding of type GeneratorGroup in the environment
7022    ///
7023    /// # Arguments
7024    ///
7025    /// * `name` - The name of the binding
7026    /// * `value` - The GeneratorGroup value to assign to the binding
7027    /// * `description` - The purpose of the input
7028    pub fn with_generator_group_input(
7029        &self,
7030        name: impl Into<String>,
7031        value: impl IntoID<Id>,
7032        description: impl Into<String>,
7033    ) -> Env {
7034        let mut query = self.selection.select("withGeneratorGroupInput");
7035        query = query.arg("name", name.into());
7036        query = query.arg_lazy(
7037            "value",
7038            Box::new(move || {
7039                let value = value.clone();
7040                Box::pin(async move { value.into_id().await.unwrap().quote() })
7041            }),
7042        );
7043        query = query.arg("description", description.into());
7044        Env {
7045            proc: self.proc.clone(),
7046            selection: query,
7047            graphql_client: self.graphql_client.clone(),
7048        }
7049    }
7050    /// Declare a desired GeneratorGroup output to be assigned in the environment
7051    ///
7052    /// # Arguments
7053    ///
7054    /// * `name` - The name of the binding
7055    /// * `description` - A description of the desired value of the binding
7056    pub fn with_generator_group_output(
7057        &self,
7058        name: impl Into<String>,
7059        description: impl Into<String>,
7060    ) -> Env {
7061        let mut query = self.selection.select("withGeneratorGroupOutput");
7062        query = query.arg("name", name.into());
7063        query = query.arg("description", description.into());
7064        Env {
7065            proc: self.proc.clone(),
7066            selection: query,
7067            graphql_client: self.graphql_client.clone(),
7068        }
7069    }
7070    /// Create or update a binding of type Generator in the environment
7071    ///
7072    /// # Arguments
7073    ///
7074    /// * `name` - The name of the binding
7075    /// * `value` - The Generator value to assign to the binding
7076    /// * `description` - The purpose of the input
7077    pub fn with_generator_input(
7078        &self,
7079        name: impl Into<String>,
7080        value: impl IntoID<Id>,
7081        description: impl Into<String>,
7082    ) -> Env {
7083        let mut query = self.selection.select("withGeneratorInput");
7084        query = query.arg("name", name.into());
7085        query = query.arg_lazy(
7086            "value",
7087            Box::new(move || {
7088                let value = value.clone();
7089                Box::pin(async move { value.into_id().await.unwrap().quote() })
7090            }),
7091        );
7092        query = query.arg("description", description.into());
7093        Env {
7094            proc: self.proc.clone(),
7095            selection: query,
7096            graphql_client: self.graphql_client.clone(),
7097        }
7098    }
7099    /// Declare a desired Generator output to be assigned in the environment
7100    ///
7101    /// # Arguments
7102    ///
7103    /// * `name` - The name of the binding
7104    /// * `description` - A description of the desired value of the binding
7105    pub fn with_generator_output(
7106        &self,
7107        name: impl Into<String>,
7108        description: impl Into<String>,
7109    ) -> Env {
7110        let mut query = self.selection.select("withGeneratorOutput");
7111        query = query.arg("name", name.into());
7112        query = query.arg("description", description.into());
7113        Env {
7114            proc: self.proc.clone(),
7115            selection: query,
7116            graphql_client: self.graphql_client.clone(),
7117        }
7118    }
7119    /// Create or update a binding of type GitRef in the environment
7120    ///
7121    /// # Arguments
7122    ///
7123    /// * `name` - The name of the binding
7124    /// * `value` - The GitRef value to assign to the binding
7125    /// * `description` - The purpose of the input
7126    pub fn with_git_ref_input(
7127        &self,
7128        name: impl Into<String>,
7129        value: impl IntoID<Id>,
7130        description: impl Into<String>,
7131    ) -> Env {
7132        let mut query = self.selection.select("withGitRefInput");
7133        query = query.arg("name", name.into());
7134        query = query.arg_lazy(
7135            "value",
7136            Box::new(move || {
7137                let value = value.clone();
7138                Box::pin(async move { value.into_id().await.unwrap().quote() })
7139            }),
7140        );
7141        query = query.arg("description", description.into());
7142        Env {
7143            proc: self.proc.clone(),
7144            selection: query,
7145            graphql_client: self.graphql_client.clone(),
7146        }
7147    }
7148    /// Declare a desired GitRef output to be assigned in the environment
7149    ///
7150    /// # Arguments
7151    ///
7152    /// * `name` - The name of the binding
7153    /// * `description` - A description of the desired value of the binding
7154    pub fn with_git_ref_output(
7155        &self,
7156        name: impl Into<String>,
7157        description: impl Into<String>,
7158    ) -> Env {
7159        let mut query = self.selection.select("withGitRefOutput");
7160        query = query.arg("name", name.into());
7161        query = query.arg("description", description.into());
7162        Env {
7163            proc: self.proc.clone(),
7164            selection: query,
7165            graphql_client: self.graphql_client.clone(),
7166        }
7167    }
7168    /// Create or update a binding of type GitRepository in the environment
7169    ///
7170    /// # Arguments
7171    ///
7172    /// * `name` - The name of the binding
7173    /// * `value` - The GitRepository value to assign to the binding
7174    /// * `description` - The purpose of the input
7175    pub fn with_git_repository_input(
7176        &self,
7177        name: impl Into<String>,
7178        value: impl IntoID<Id>,
7179        description: impl Into<String>,
7180    ) -> Env {
7181        let mut query = self.selection.select("withGitRepositoryInput");
7182        query = query.arg("name", name.into());
7183        query = query.arg_lazy(
7184            "value",
7185            Box::new(move || {
7186                let value = value.clone();
7187                Box::pin(async move { value.into_id().await.unwrap().quote() })
7188            }),
7189        );
7190        query = query.arg("description", description.into());
7191        Env {
7192            proc: self.proc.clone(),
7193            selection: query,
7194            graphql_client: self.graphql_client.clone(),
7195        }
7196    }
7197    /// Declare a desired GitRepository output to be assigned in the environment
7198    ///
7199    /// # Arguments
7200    ///
7201    /// * `name` - The name of the binding
7202    /// * `description` - A description of the desired value of the binding
7203    pub fn with_git_repository_output(
7204        &self,
7205        name: impl Into<String>,
7206        description: impl Into<String>,
7207    ) -> Env {
7208        let mut query = self.selection.select("withGitRepositoryOutput");
7209        query = query.arg("name", name.into());
7210        query = query.arg("description", description.into());
7211        Env {
7212            proc: self.proc.clone(),
7213            selection: query,
7214            graphql_client: self.graphql_client.clone(),
7215        }
7216    }
7217    /// Create or update a binding of type HTTPState in the environment
7218    ///
7219    /// # Arguments
7220    ///
7221    /// * `name` - The name of the binding
7222    /// * `value` - The HTTPState value to assign to the binding
7223    /// * `description` - The purpose of the input
7224    pub fn with_http_state_input(
7225        &self,
7226        name: impl Into<String>,
7227        value: impl IntoID<Id>,
7228        description: impl Into<String>,
7229    ) -> Env {
7230        let mut query = self.selection.select("withHTTPStateInput");
7231        query = query.arg("name", name.into());
7232        query = query.arg_lazy(
7233            "value",
7234            Box::new(move || {
7235                let value = value.clone();
7236                Box::pin(async move { value.into_id().await.unwrap().quote() })
7237            }),
7238        );
7239        query = query.arg("description", description.into());
7240        Env {
7241            proc: self.proc.clone(),
7242            selection: query,
7243            graphql_client: self.graphql_client.clone(),
7244        }
7245    }
7246    /// Declare a desired HTTPState output to be assigned in the environment
7247    ///
7248    /// # Arguments
7249    ///
7250    /// * `name` - The name of the binding
7251    /// * `description` - A description of the desired value of the binding
7252    pub fn with_http_state_output(
7253        &self,
7254        name: impl Into<String>,
7255        description: impl Into<String>,
7256    ) -> Env {
7257        let mut query = self.selection.select("withHTTPStateOutput");
7258        query = query.arg("name", name.into());
7259        query = query.arg("description", description.into());
7260        Env {
7261            proc: self.proc.clone(),
7262            selection: query,
7263            graphql_client: self.graphql_client.clone(),
7264        }
7265    }
7266    /// Create or update a binding of type JSONValue in the environment
7267    ///
7268    /// # Arguments
7269    ///
7270    /// * `name` - The name of the binding
7271    /// * `value` - The JSONValue value to assign to the binding
7272    /// * `description` - The purpose of the input
7273    pub fn with_json_value_input(
7274        &self,
7275        name: impl Into<String>,
7276        value: impl IntoID<Id>,
7277        description: impl Into<String>,
7278    ) -> Env {
7279        let mut query = self.selection.select("withJSONValueInput");
7280        query = query.arg("name", name.into());
7281        query = query.arg_lazy(
7282            "value",
7283            Box::new(move || {
7284                let value = value.clone();
7285                Box::pin(async move { value.into_id().await.unwrap().quote() })
7286            }),
7287        );
7288        query = query.arg("description", description.into());
7289        Env {
7290            proc: self.proc.clone(),
7291            selection: query,
7292            graphql_client: self.graphql_client.clone(),
7293        }
7294    }
7295    /// Declare a desired JSONValue output to be assigned in the environment
7296    ///
7297    /// # Arguments
7298    ///
7299    /// * `name` - The name of the binding
7300    /// * `description` - A description of the desired value of the binding
7301    pub fn with_json_value_output(
7302        &self,
7303        name: impl Into<String>,
7304        description: impl Into<String>,
7305    ) -> Env {
7306        let mut query = self.selection.select("withJSONValueOutput");
7307        query = query.arg("name", name.into());
7308        query = query.arg("description", description.into());
7309        Env {
7310            proc: self.proc.clone(),
7311            selection: query,
7312            graphql_client: self.graphql_client.clone(),
7313        }
7314    }
7315    /// Sets the main module for this environment (the project being worked on)
7316    /// Contextual path arguments will be populated using the environment's workspace.
7317    pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7318        let mut query = self.selection.select("withMainModule");
7319        query = query.arg_lazy(
7320            "module",
7321            Box::new(move || {
7322                let module = module.clone();
7323                Box::pin(async move { module.into_id().await.unwrap().quote() })
7324            }),
7325        );
7326        Env {
7327            proc: self.proc.clone(),
7328            selection: query,
7329            graphql_client: self.graphql_client.clone(),
7330        }
7331    }
7332    /// Installs a module into the environment, exposing its functions to the model
7333    /// Contextual path arguments will be populated using the environment's workspace.
7334    pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7335        let mut query = self.selection.select("withModule");
7336        query = query.arg_lazy(
7337            "module",
7338            Box::new(move || {
7339                let module = module.clone();
7340                Box::pin(async move { module.into_id().await.unwrap().quote() })
7341            }),
7342        );
7343        Env {
7344            proc: self.proc.clone(),
7345            selection: query,
7346            graphql_client: self.graphql_client.clone(),
7347        }
7348    }
7349    /// Create or update a binding of type ModuleConfigClient in the environment
7350    ///
7351    /// # Arguments
7352    ///
7353    /// * `name` - The name of the binding
7354    /// * `value` - The ModuleConfigClient value to assign to the binding
7355    /// * `description` - The purpose of the input
7356    pub fn with_module_config_client_input(
7357        &self,
7358        name: impl Into<String>,
7359        value: impl IntoID<Id>,
7360        description: impl Into<String>,
7361    ) -> Env {
7362        let mut query = self.selection.select("withModuleConfigClientInput");
7363        query = query.arg("name", name.into());
7364        query = query.arg_lazy(
7365            "value",
7366            Box::new(move || {
7367                let value = value.clone();
7368                Box::pin(async move { value.into_id().await.unwrap().quote() })
7369            }),
7370        );
7371        query = query.arg("description", description.into());
7372        Env {
7373            proc: self.proc.clone(),
7374            selection: query,
7375            graphql_client: self.graphql_client.clone(),
7376        }
7377    }
7378    /// Declare a desired ModuleConfigClient output to be assigned in the environment
7379    ///
7380    /// # Arguments
7381    ///
7382    /// * `name` - The name of the binding
7383    /// * `description` - A description of the desired value of the binding
7384    pub fn with_module_config_client_output(
7385        &self,
7386        name: impl Into<String>,
7387        description: impl Into<String>,
7388    ) -> Env {
7389        let mut query = self.selection.select("withModuleConfigClientOutput");
7390        query = query.arg("name", name.into());
7391        query = query.arg("description", description.into());
7392        Env {
7393            proc: self.proc.clone(),
7394            selection: query,
7395            graphql_client: self.graphql_client.clone(),
7396        }
7397    }
7398    /// Create or update a binding of type Module in the environment
7399    ///
7400    /// # Arguments
7401    ///
7402    /// * `name` - The name of the binding
7403    /// * `value` - The Module value to assign to the binding
7404    /// * `description` - The purpose of the input
7405    pub fn with_module_input(
7406        &self,
7407        name: impl Into<String>,
7408        value: impl IntoID<Id>,
7409        description: impl Into<String>,
7410    ) -> Env {
7411        let mut query = self.selection.select("withModuleInput");
7412        query = query.arg("name", name.into());
7413        query = query.arg_lazy(
7414            "value",
7415            Box::new(move || {
7416                let value = value.clone();
7417                Box::pin(async move { value.into_id().await.unwrap().quote() })
7418            }),
7419        );
7420        query = query.arg("description", description.into());
7421        Env {
7422            proc: self.proc.clone(),
7423            selection: query,
7424            graphql_client: self.graphql_client.clone(),
7425        }
7426    }
7427    /// Declare a desired Module output to be assigned in the environment
7428    ///
7429    /// # Arguments
7430    ///
7431    /// * `name` - The name of the binding
7432    /// * `description` - A description of the desired value of the binding
7433    pub fn with_module_output(
7434        &self,
7435        name: impl Into<String>,
7436        description: impl Into<String>,
7437    ) -> Env {
7438        let mut query = self.selection.select("withModuleOutput");
7439        query = query.arg("name", name.into());
7440        query = query.arg("description", description.into());
7441        Env {
7442            proc: self.proc.clone(),
7443            selection: query,
7444            graphql_client: self.graphql_client.clone(),
7445        }
7446    }
7447    /// Create or update a binding of type ModuleSource in the environment
7448    ///
7449    /// # Arguments
7450    ///
7451    /// * `name` - The name of the binding
7452    /// * `value` - The ModuleSource value to assign to the binding
7453    /// * `description` - The purpose of the input
7454    pub fn with_module_source_input(
7455        &self,
7456        name: impl Into<String>,
7457        value: impl IntoID<Id>,
7458        description: impl Into<String>,
7459    ) -> Env {
7460        let mut query = self.selection.select("withModuleSourceInput");
7461        query = query.arg("name", name.into());
7462        query = query.arg_lazy(
7463            "value",
7464            Box::new(move || {
7465                let value = value.clone();
7466                Box::pin(async move { value.into_id().await.unwrap().quote() })
7467            }),
7468        );
7469        query = query.arg("description", description.into());
7470        Env {
7471            proc: self.proc.clone(),
7472            selection: query,
7473            graphql_client: self.graphql_client.clone(),
7474        }
7475    }
7476    /// Declare a desired ModuleSource output to be assigned in the environment
7477    ///
7478    /// # Arguments
7479    ///
7480    /// * `name` - The name of the binding
7481    /// * `description` - A description of the desired value of the binding
7482    pub fn with_module_source_output(
7483        &self,
7484        name: impl Into<String>,
7485        description: impl Into<String>,
7486    ) -> Env {
7487        let mut query = self.selection.select("withModuleSourceOutput");
7488        query = query.arg("name", name.into());
7489        query = query.arg("description", description.into());
7490        Env {
7491            proc: self.proc.clone(),
7492            selection: query,
7493            graphql_client: self.graphql_client.clone(),
7494        }
7495    }
7496    /// Create or update a binding of type SearchResult in the environment
7497    ///
7498    /// # Arguments
7499    ///
7500    /// * `name` - The name of the binding
7501    /// * `value` - The SearchResult value to assign to the binding
7502    /// * `description` - The purpose of the input
7503    pub fn with_search_result_input(
7504        &self,
7505        name: impl Into<String>,
7506        value: impl IntoID<Id>,
7507        description: impl Into<String>,
7508    ) -> Env {
7509        let mut query = self.selection.select("withSearchResultInput");
7510        query = query.arg("name", name.into());
7511        query = query.arg_lazy(
7512            "value",
7513            Box::new(move || {
7514                let value = value.clone();
7515                Box::pin(async move { value.into_id().await.unwrap().quote() })
7516            }),
7517        );
7518        query = query.arg("description", description.into());
7519        Env {
7520            proc: self.proc.clone(),
7521            selection: query,
7522            graphql_client: self.graphql_client.clone(),
7523        }
7524    }
7525    /// Declare a desired SearchResult output to be assigned in the environment
7526    ///
7527    /// # Arguments
7528    ///
7529    /// * `name` - The name of the binding
7530    /// * `description` - A description of the desired value of the binding
7531    pub fn with_search_result_output(
7532        &self,
7533        name: impl Into<String>,
7534        description: impl Into<String>,
7535    ) -> Env {
7536        let mut query = self.selection.select("withSearchResultOutput");
7537        query = query.arg("name", name.into());
7538        query = query.arg("description", description.into());
7539        Env {
7540            proc: self.proc.clone(),
7541            selection: query,
7542            graphql_client: self.graphql_client.clone(),
7543        }
7544    }
7545    /// Create or update a binding of type SearchSubmatch in the environment
7546    ///
7547    /// # Arguments
7548    ///
7549    /// * `name` - The name of the binding
7550    /// * `value` - The SearchSubmatch value to assign to the binding
7551    /// * `description` - The purpose of the input
7552    pub fn with_search_submatch_input(
7553        &self,
7554        name: impl Into<String>,
7555        value: impl IntoID<Id>,
7556        description: impl Into<String>,
7557    ) -> Env {
7558        let mut query = self.selection.select("withSearchSubmatchInput");
7559        query = query.arg("name", name.into());
7560        query = query.arg_lazy(
7561            "value",
7562            Box::new(move || {
7563                let value = value.clone();
7564                Box::pin(async move { value.into_id().await.unwrap().quote() })
7565            }),
7566        );
7567        query = query.arg("description", description.into());
7568        Env {
7569            proc: self.proc.clone(),
7570            selection: query,
7571            graphql_client: self.graphql_client.clone(),
7572        }
7573    }
7574    /// Declare a desired SearchSubmatch output to be assigned in the environment
7575    ///
7576    /// # Arguments
7577    ///
7578    /// * `name` - The name of the binding
7579    /// * `description` - A description of the desired value of the binding
7580    pub fn with_search_submatch_output(
7581        &self,
7582        name: impl Into<String>,
7583        description: impl Into<String>,
7584    ) -> Env {
7585        let mut query = self.selection.select("withSearchSubmatchOutput");
7586        query = query.arg("name", name.into());
7587        query = query.arg("description", description.into());
7588        Env {
7589            proc: self.proc.clone(),
7590            selection: query,
7591            graphql_client: self.graphql_client.clone(),
7592        }
7593    }
7594    /// Create or update a binding of type Secret in the environment
7595    ///
7596    /// # Arguments
7597    ///
7598    /// * `name` - The name of the binding
7599    /// * `value` - The Secret value to assign to the binding
7600    /// * `description` - The purpose of the input
7601    pub fn with_secret_input(
7602        &self,
7603        name: impl Into<String>,
7604        value: impl IntoID<Id>,
7605        description: impl Into<String>,
7606    ) -> Env {
7607        let mut query = self.selection.select("withSecretInput");
7608        query = query.arg("name", name.into());
7609        query = query.arg_lazy(
7610            "value",
7611            Box::new(move || {
7612                let value = value.clone();
7613                Box::pin(async move { value.into_id().await.unwrap().quote() })
7614            }),
7615        );
7616        query = query.arg("description", description.into());
7617        Env {
7618            proc: self.proc.clone(),
7619            selection: query,
7620            graphql_client: self.graphql_client.clone(),
7621        }
7622    }
7623    /// Declare a desired Secret output to be assigned in the environment
7624    ///
7625    /// # Arguments
7626    ///
7627    /// * `name` - The name of the binding
7628    /// * `description` - A description of the desired value of the binding
7629    pub fn with_secret_output(
7630        &self,
7631        name: impl Into<String>,
7632        description: impl Into<String>,
7633    ) -> Env {
7634        let mut query = self.selection.select("withSecretOutput");
7635        query = query.arg("name", name.into());
7636        query = query.arg("description", description.into());
7637        Env {
7638            proc: self.proc.clone(),
7639            selection: query,
7640            graphql_client: self.graphql_client.clone(),
7641        }
7642    }
7643    /// Create or update a binding of type Service in the environment
7644    ///
7645    /// # Arguments
7646    ///
7647    /// * `name` - The name of the binding
7648    /// * `value` - The Service value to assign to the binding
7649    /// * `description` - The purpose of the input
7650    pub fn with_service_input(
7651        &self,
7652        name: impl Into<String>,
7653        value: impl IntoID<Id>,
7654        description: impl Into<String>,
7655    ) -> Env {
7656        let mut query = self.selection.select("withServiceInput");
7657        query = query.arg("name", name.into());
7658        query = query.arg_lazy(
7659            "value",
7660            Box::new(move || {
7661                let value = value.clone();
7662                Box::pin(async move { value.into_id().await.unwrap().quote() })
7663            }),
7664        );
7665        query = query.arg("description", description.into());
7666        Env {
7667            proc: self.proc.clone(),
7668            selection: query,
7669            graphql_client: self.graphql_client.clone(),
7670        }
7671    }
7672    /// Declare a desired Service output to be assigned in the environment
7673    ///
7674    /// # Arguments
7675    ///
7676    /// * `name` - The name of the binding
7677    /// * `description` - A description of the desired value of the binding
7678    pub fn with_service_output(
7679        &self,
7680        name: impl Into<String>,
7681        description: impl Into<String>,
7682    ) -> Env {
7683        let mut query = self.selection.select("withServiceOutput");
7684        query = query.arg("name", name.into());
7685        query = query.arg("description", description.into());
7686        Env {
7687            proc: self.proc.clone(),
7688            selection: query,
7689            graphql_client: self.graphql_client.clone(),
7690        }
7691    }
7692    /// Create or update a binding of type Socket in the environment
7693    ///
7694    /// # Arguments
7695    ///
7696    /// * `name` - The name of the binding
7697    /// * `value` - The Socket value to assign to the binding
7698    /// * `description` - The purpose of the input
7699    pub fn with_socket_input(
7700        &self,
7701        name: impl Into<String>,
7702        value: impl IntoID<Id>,
7703        description: impl Into<String>,
7704    ) -> Env {
7705        let mut query = self.selection.select("withSocketInput");
7706        query = query.arg("name", name.into());
7707        query = query.arg_lazy(
7708            "value",
7709            Box::new(move || {
7710                let value = value.clone();
7711                Box::pin(async move { value.into_id().await.unwrap().quote() })
7712            }),
7713        );
7714        query = query.arg("description", description.into());
7715        Env {
7716            proc: self.proc.clone(),
7717            selection: query,
7718            graphql_client: self.graphql_client.clone(),
7719        }
7720    }
7721    /// Declare a desired Socket output to be assigned in the environment
7722    ///
7723    /// # Arguments
7724    ///
7725    /// * `name` - The name of the binding
7726    /// * `description` - A description of the desired value of the binding
7727    pub fn with_socket_output(
7728        &self,
7729        name: impl Into<String>,
7730        description: impl Into<String>,
7731    ) -> Env {
7732        let mut query = self.selection.select("withSocketOutput");
7733        query = query.arg("name", name.into());
7734        query = query.arg("description", description.into());
7735        Env {
7736            proc: self.proc.clone(),
7737            selection: query,
7738            graphql_client: self.graphql_client.clone(),
7739        }
7740    }
7741    /// Create or update a binding of type Stat in the environment
7742    ///
7743    /// # Arguments
7744    ///
7745    /// * `name` - The name of the binding
7746    /// * `value` - The Stat value to assign to the binding
7747    /// * `description` - The purpose of the input
7748    pub fn with_stat_input(
7749        &self,
7750        name: impl Into<String>,
7751        value: impl IntoID<Id>,
7752        description: impl Into<String>,
7753    ) -> Env {
7754        let mut query = self.selection.select("withStatInput");
7755        query = query.arg("name", name.into());
7756        query = query.arg_lazy(
7757            "value",
7758            Box::new(move || {
7759                let value = value.clone();
7760                Box::pin(async move { value.into_id().await.unwrap().quote() })
7761            }),
7762        );
7763        query = query.arg("description", description.into());
7764        Env {
7765            proc: self.proc.clone(),
7766            selection: query,
7767            graphql_client: self.graphql_client.clone(),
7768        }
7769    }
7770    /// Declare a desired Stat output to be assigned in the environment
7771    ///
7772    /// # Arguments
7773    ///
7774    /// * `name` - The name of the binding
7775    /// * `description` - A description of the desired value of the binding
7776    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7777        let mut query = self.selection.select("withStatOutput");
7778        query = query.arg("name", name.into());
7779        query = query.arg("description", description.into());
7780        Env {
7781            proc: self.proc.clone(),
7782            selection: query,
7783            graphql_client: self.graphql_client.clone(),
7784        }
7785    }
7786    /// Provides a string input binding to the environment
7787    ///
7788    /// # Arguments
7789    ///
7790    /// * `name` - The name of the binding
7791    /// * `value` - The string value to assign to the binding
7792    /// * `description` - The description of the input
7793    pub fn with_string_input(
7794        &self,
7795        name: impl Into<String>,
7796        value: impl Into<String>,
7797        description: impl Into<String>,
7798    ) -> Env {
7799        let mut query = self.selection.select("withStringInput");
7800        query = query.arg("name", name.into());
7801        query = query.arg("value", value.into());
7802        query = query.arg("description", description.into());
7803        Env {
7804            proc: self.proc.clone(),
7805            selection: query,
7806            graphql_client: self.graphql_client.clone(),
7807        }
7808    }
7809    /// Declares a desired string output binding
7810    ///
7811    /// # Arguments
7812    ///
7813    /// * `name` - The name of the binding
7814    /// * `description` - The description of the output
7815    pub fn with_string_output(
7816        &self,
7817        name: impl Into<String>,
7818        description: impl Into<String>,
7819    ) -> Env {
7820        let mut query = self.selection.select("withStringOutput");
7821        query = query.arg("name", name.into());
7822        query = query.arg("description", description.into());
7823        Env {
7824            proc: self.proc.clone(),
7825            selection: query,
7826            graphql_client: self.graphql_client.clone(),
7827        }
7828    }
7829    /// Create or update a binding of type UpGroup in the environment
7830    ///
7831    /// # Arguments
7832    ///
7833    /// * `name` - The name of the binding
7834    /// * `value` - The UpGroup value to assign to the binding
7835    /// * `description` - The purpose of the input
7836    pub fn with_up_group_input(
7837        &self,
7838        name: impl Into<String>,
7839        value: impl IntoID<Id>,
7840        description: impl Into<String>,
7841    ) -> Env {
7842        let mut query = self.selection.select("withUpGroupInput");
7843        query = query.arg("name", name.into());
7844        query = query.arg_lazy(
7845            "value",
7846            Box::new(move || {
7847                let value = value.clone();
7848                Box::pin(async move { value.into_id().await.unwrap().quote() })
7849            }),
7850        );
7851        query = query.arg("description", description.into());
7852        Env {
7853            proc: self.proc.clone(),
7854            selection: query,
7855            graphql_client: self.graphql_client.clone(),
7856        }
7857    }
7858    /// Declare a desired UpGroup output to be assigned in the environment
7859    ///
7860    /// # Arguments
7861    ///
7862    /// * `name` - The name of the binding
7863    /// * `description` - A description of the desired value of the binding
7864    pub fn with_up_group_output(
7865        &self,
7866        name: impl Into<String>,
7867        description: impl Into<String>,
7868    ) -> Env {
7869        let mut query = self.selection.select("withUpGroupOutput");
7870        query = query.arg("name", name.into());
7871        query = query.arg("description", description.into());
7872        Env {
7873            proc: self.proc.clone(),
7874            selection: query,
7875            graphql_client: self.graphql_client.clone(),
7876        }
7877    }
7878    /// Create or update a binding of type Up in the environment
7879    ///
7880    /// # Arguments
7881    ///
7882    /// * `name` - The name of the binding
7883    /// * `value` - The Up value to assign to the binding
7884    /// * `description` - The purpose of the input
7885    pub fn with_up_input(
7886        &self,
7887        name: impl Into<String>,
7888        value: impl IntoID<Id>,
7889        description: impl Into<String>,
7890    ) -> Env {
7891        let mut query = self.selection.select("withUpInput");
7892        query = query.arg("name", name.into());
7893        query = query.arg_lazy(
7894            "value",
7895            Box::new(move || {
7896                let value = value.clone();
7897                Box::pin(async move { value.into_id().await.unwrap().quote() })
7898            }),
7899        );
7900        query = query.arg("description", description.into());
7901        Env {
7902            proc: self.proc.clone(),
7903            selection: query,
7904            graphql_client: self.graphql_client.clone(),
7905        }
7906    }
7907    /// Declare a desired Up output to be assigned in the environment
7908    ///
7909    /// # Arguments
7910    ///
7911    /// * `name` - The name of the binding
7912    /// * `description` - A description of the desired value of the binding
7913    pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7914        let mut query = self.selection.select("withUpOutput");
7915        query = query.arg("name", name.into());
7916        query = query.arg("description", description.into());
7917        Env {
7918            proc: self.proc.clone(),
7919            selection: query,
7920            graphql_client: self.graphql_client.clone(),
7921        }
7922    }
7923    /// Returns a new environment with the provided workspace
7924    ///
7925    /// # Arguments
7926    ///
7927    /// * `workspace` - The directory to set as the host filesystem
7928    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
7929        let mut query = self.selection.select("withWorkspace");
7930        query = query.arg_lazy(
7931            "workspace",
7932            Box::new(move || {
7933                let workspace = workspace.clone();
7934                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7935            }),
7936        );
7937        Env {
7938            proc: self.proc.clone(),
7939            selection: query,
7940            graphql_client: self.graphql_client.clone(),
7941        }
7942    }
7943    /// Create or update a binding of type Workspace in the environment
7944    ///
7945    /// # Arguments
7946    ///
7947    /// * `name` - The name of the binding
7948    /// * `value` - The Workspace value to assign to the binding
7949    /// * `description` - The purpose of the input
7950    pub fn with_workspace_input(
7951        &self,
7952        name: impl Into<String>,
7953        value: impl IntoID<Id>,
7954        description: impl Into<String>,
7955    ) -> Env {
7956        let mut query = self.selection.select("withWorkspaceInput");
7957        query = query.arg("name", name.into());
7958        query = query.arg_lazy(
7959            "value",
7960            Box::new(move || {
7961                let value = value.clone();
7962                Box::pin(async move { value.into_id().await.unwrap().quote() })
7963            }),
7964        );
7965        query = query.arg("description", description.into());
7966        Env {
7967            proc: self.proc.clone(),
7968            selection: query,
7969            graphql_client: self.graphql_client.clone(),
7970        }
7971    }
7972    /// Declare a desired Workspace output to be assigned in the environment
7973    ///
7974    /// # Arguments
7975    ///
7976    /// * `name` - The name of the binding
7977    /// * `description` - A description of the desired value of the binding
7978    pub fn with_workspace_output(
7979        &self,
7980        name: impl Into<String>,
7981        description: impl Into<String>,
7982    ) -> Env {
7983        let mut query = self.selection.select("withWorkspaceOutput");
7984        query = query.arg("name", name.into());
7985        query = query.arg("description", description.into());
7986        Env {
7987            proc: self.proc.clone(),
7988            selection: query,
7989            graphql_client: self.graphql_client.clone(),
7990        }
7991    }
7992    /// Returns a new environment without any outputs
7993    pub fn without_outputs(&self) -> Env {
7994        let query = self.selection.select("withoutOutputs");
7995        Env {
7996            proc: self.proc.clone(),
7997            selection: query,
7998            graphql_client: self.graphql_client.clone(),
7999        }
8000    }
8001    pub fn workspace(&self) -> Directory {
8002        let query = self.selection.select("workspace");
8003        Directory {
8004            proc: self.proc.clone(),
8005            selection: query,
8006            graphql_client: self.graphql_client.clone(),
8007        }
8008    }
8009}
8010impl Node for Env {
8011    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8012        let query = self.selection.select("id");
8013        let graphql_client = self.graphql_client.clone();
8014        async move { query.execute(graphql_client).await }
8015    }
8016}
8017#[derive(Clone)]
8018pub struct EnvFile {
8019    pub proc: Option<Arc<DaggerSessionProc>>,
8020    pub selection: Selection,
8021    pub graphql_client: DynGraphQLClient,
8022}
8023#[derive(Builder, Debug, PartialEq)]
8024pub struct EnvFileGetOpts {
8025    /// Return the value exactly as written to the file. No quote removal or variable expansion
8026    #[builder(setter(into, strip_option), default)]
8027    pub raw: Option<bool>,
8028}
8029#[derive(Builder, Debug, PartialEq)]
8030pub struct EnvFileVariablesOpts {
8031    /// Return values exactly as written to the file. No quote removal or variable expansion
8032    #[builder(setter(into, strip_option), default)]
8033    pub raw: Option<bool>,
8034}
8035impl IntoID<Id> for EnvFile {
8036    fn into_id(
8037        self,
8038    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8039        Box::pin(async move { self.id().await })
8040    }
8041}
8042impl Loadable for EnvFile {
8043    fn graphql_type() -> &'static str {
8044        "EnvFile"
8045    }
8046    fn from_query(
8047        proc: Option<Arc<DaggerSessionProc>>,
8048        selection: Selection,
8049        graphql_client: DynGraphQLClient,
8050    ) -> Self {
8051        Self {
8052            proc,
8053            selection,
8054            graphql_client,
8055        }
8056    }
8057}
8058impl EnvFile {
8059    /// Return as a file
8060    pub fn as_file(&self) -> File {
8061        let query = self.selection.select("asFile");
8062        File {
8063            proc: self.proc.clone(),
8064            selection: query,
8065            graphql_client: self.graphql_client.clone(),
8066        }
8067    }
8068    /// Check if a variable exists
8069    ///
8070    /// # Arguments
8071    ///
8072    /// * `name` - Variable name
8073    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8074        let mut query = self.selection.select("exists");
8075        query = query.arg("name", name.into());
8076        query.execute(self.graphql_client.clone()).await
8077    }
8078    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8079    ///
8080    /// # Arguments
8081    ///
8082    /// * `name` - Variable name
8083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8084    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8085        let mut query = self.selection.select("get");
8086        query = query.arg("name", name.into());
8087        query.execute(self.graphql_client.clone()).await
8088    }
8089    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8090    ///
8091    /// # Arguments
8092    ///
8093    /// * `name` - Variable name
8094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8095    pub async fn get_opts(
8096        &self,
8097        name: impl Into<String>,
8098        opts: EnvFileGetOpts,
8099    ) -> Result<String, DaggerError> {
8100        let mut query = self.selection.select("get");
8101        query = query.arg("name", name.into());
8102        if let Some(raw) = opts.raw {
8103            query = query.arg("raw", raw);
8104        }
8105        query.execute(self.graphql_client.clone()).await
8106    }
8107    /// A unique identifier for this EnvFile.
8108    pub async fn id(&self) -> Result<Id, DaggerError> {
8109        let query = self.selection.select("id");
8110        query.execute(self.graphql_client.clone()).await
8111    }
8112    /// 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
8113    ///
8114    /// # Arguments
8115    ///
8116    /// * `prefix` - The prefix to filter by
8117    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8118        let mut query = self.selection.select("namespace");
8119        query = query.arg("prefix", prefix.into());
8120        EnvFile {
8121            proc: self.proc.clone(),
8122            selection: query,
8123            graphql_client: self.graphql_client.clone(),
8124        }
8125    }
8126    /// Return all variables
8127    ///
8128    /// # Arguments
8129    ///
8130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8131    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8132        let query = self.selection.select("variables");
8133        let query = query.select("id");
8134        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8135        Ok(ids
8136            .into_iter()
8137            .map(|id| EnvVariable {
8138                proc: self.proc.clone(),
8139                selection: crate::querybuilder::query()
8140                    .select("node")
8141                    .arg("id", &id.0)
8142                    .inline_fragment("EnvVariable"),
8143                graphql_client: self.graphql_client.clone(),
8144            })
8145            .collect())
8146    }
8147    /// Return all variables
8148    ///
8149    /// # Arguments
8150    ///
8151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8152    pub async fn variables_opts(
8153        &self,
8154        opts: EnvFileVariablesOpts,
8155    ) -> Result<Vec<EnvVariable>, DaggerError> {
8156        let mut query = self.selection.select("variables");
8157        if let Some(raw) = opts.raw {
8158            query = query.arg("raw", raw);
8159        }
8160        let query = query.select("id");
8161        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8162        Ok(ids
8163            .into_iter()
8164            .map(|id| EnvVariable {
8165                proc: self.proc.clone(),
8166                selection: crate::querybuilder::query()
8167                    .select("node")
8168                    .arg("id", &id.0)
8169                    .inline_fragment("EnvVariable"),
8170                graphql_client: self.graphql_client.clone(),
8171            })
8172            .collect())
8173    }
8174    /// Add a variable
8175    ///
8176    /// # Arguments
8177    ///
8178    /// * `name` - Variable name
8179    /// * `value` - Variable value
8180    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8181        let mut query = self.selection.select("withVariable");
8182        query = query.arg("name", name.into());
8183        query = query.arg("value", value.into());
8184        EnvFile {
8185            proc: self.proc.clone(),
8186            selection: query,
8187            graphql_client: self.graphql_client.clone(),
8188        }
8189    }
8190    /// Remove all occurrences of the named variable
8191    ///
8192    /// # Arguments
8193    ///
8194    /// * `name` - Variable name
8195    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8196        let mut query = self.selection.select("withoutVariable");
8197        query = query.arg("name", name.into());
8198        EnvFile {
8199            proc: self.proc.clone(),
8200            selection: query,
8201            graphql_client: self.graphql_client.clone(),
8202        }
8203    }
8204}
8205impl Node for EnvFile {
8206    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8207        let query = self.selection.select("id");
8208        let graphql_client = self.graphql_client.clone();
8209        async move { query.execute(graphql_client).await }
8210    }
8211}
8212#[derive(Clone)]
8213pub struct EnvVariable {
8214    pub proc: Option<Arc<DaggerSessionProc>>,
8215    pub selection: Selection,
8216    pub graphql_client: DynGraphQLClient,
8217}
8218impl IntoID<Id> for EnvVariable {
8219    fn into_id(
8220        self,
8221    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8222        Box::pin(async move { self.id().await })
8223    }
8224}
8225impl Loadable for EnvVariable {
8226    fn graphql_type() -> &'static str {
8227        "EnvVariable"
8228    }
8229    fn from_query(
8230        proc: Option<Arc<DaggerSessionProc>>,
8231        selection: Selection,
8232        graphql_client: DynGraphQLClient,
8233    ) -> Self {
8234        Self {
8235            proc,
8236            selection,
8237            graphql_client,
8238        }
8239    }
8240}
8241impl EnvVariable {
8242    /// A unique identifier for this EnvVariable.
8243    pub async fn id(&self) -> Result<Id, DaggerError> {
8244        let query = self.selection.select("id");
8245        query.execute(self.graphql_client.clone()).await
8246    }
8247    /// The environment variable name.
8248    pub async fn name(&self) -> Result<String, DaggerError> {
8249        let query = self.selection.select("name");
8250        query.execute(self.graphql_client.clone()).await
8251    }
8252    /// The environment variable value.
8253    pub async fn value(&self) -> Result<String, DaggerError> {
8254        let query = self.selection.select("value");
8255        query.execute(self.graphql_client.clone()).await
8256    }
8257}
8258impl Node for EnvVariable {
8259    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8260        let query = self.selection.select("id");
8261        let graphql_client = self.graphql_client.clone();
8262        async move { query.execute(graphql_client).await }
8263    }
8264}
8265#[derive(Clone)]
8266pub struct Error {
8267    pub proc: Option<Arc<DaggerSessionProc>>,
8268    pub selection: Selection,
8269    pub graphql_client: DynGraphQLClient,
8270}
8271impl IntoID<Id> for Error {
8272    fn into_id(
8273        self,
8274    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8275        Box::pin(async move { self.id().await })
8276    }
8277}
8278impl Loadable for Error {
8279    fn graphql_type() -> &'static str {
8280        "Error"
8281    }
8282    fn from_query(
8283        proc: Option<Arc<DaggerSessionProc>>,
8284        selection: Selection,
8285        graphql_client: DynGraphQLClient,
8286    ) -> Self {
8287        Self {
8288            proc,
8289            selection,
8290            graphql_client,
8291        }
8292    }
8293}
8294impl Error {
8295    /// A unique identifier for this Error.
8296    pub async fn id(&self) -> Result<Id, DaggerError> {
8297        let query = self.selection.select("id");
8298        query.execute(self.graphql_client.clone()).await
8299    }
8300    /// A description of the error.
8301    pub async fn message(&self) -> Result<String, DaggerError> {
8302        let query = self.selection.select("message");
8303        query.execute(self.graphql_client.clone()).await
8304    }
8305    /// The extensions of the error.
8306    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8307        let query = self.selection.select("values");
8308        let query = query.select("id");
8309        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8310        Ok(ids
8311            .into_iter()
8312            .map(|id| ErrorValue {
8313                proc: self.proc.clone(),
8314                selection: crate::querybuilder::query()
8315                    .select("node")
8316                    .arg("id", &id.0)
8317                    .inline_fragment("ErrorValue"),
8318                graphql_client: self.graphql_client.clone(),
8319            })
8320            .collect())
8321    }
8322    /// Add a value to the error.
8323    ///
8324    /// # Arguments
8325    ///
8326    /// * `name` - The name of the value.
8327    /// * `value` - The value to store on the error.
8328    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8329        let mut query = self.selection.select("withValue");
8330        query = query.arg("name", name.into());
8331        query = query.arg("value", value);
8332        Error {
8333            proc: self.proc.clone(),
8334            selection: query,
8335            graphql_client: self.graphql_client.clone(),
8336        }
8337    }
8338}
8339impl Node for Error {
8340    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8341        let query = self.selection.select("id");
8342        let graphql_client = self.graphql_client.clone();
8343        async move { query.execute(graphql_client).await }
8344    }
8345}
8346#[derive(Clone)]
8347pub struct ErrorValue {
8348    pub proc: Option<Arc<DaggerSessionProc>>,
8349    pub selection: Selection,
8350    pub graphql_client: DynGraphQLClient,
8351}
8352impl IntoID<Id> for ErrorValue {
8353    fn into_id(
8354        self,
8355    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8356        Box::pin(async move { self.id().await })
8357    }
8358}
8359impl Loadable for ErrorValue {
8360    fn graphql_type() -> &'static str {
8361        "ErrorValue"
8362    }
8363    fn from_query(
8364        proc: Option<Arc<DaggerSessionProc>>,
8365        selection: Selection,
8366        graphql_client: DynGraphQLClient,
8367    ) -> Self {
8368        Self {
8369            proc,
8370            selection,
8371            graphql_client,
8372        }
8373    }
8374}
8375impl ErrorValue {
8376    /// A unique identifier for this ErrorValue.
8377    pub async fn id(&self) -> Result<Id, DaggerError> {
8378        let query = self.selection.select("id");
8379        query.execute(self.graphql_client.clone()).await
8380    }
8381    /// The name of the value.
8382    pub async fn name(&self) -> Result<String, DaggerError> {
8383        let query = self.selection.select("name");
8384        query.execute(self.graphql_client.clone()).await
8385    }
8386    /// The value.
8387    pub async fn value(&self) -> Result<Json, DaggerError> {
8388        let query = self.selection.select("value");
8389        query.execute(self.graphql_client.clone()).await
8390    }
8391}
8392impl Node for ErrorValue {
8393    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8394        let query = self.selection.select("id");
8395        let graphql_client = self.graphql_client.clone();
8396        async move { query.execute(graphql_client).await }
8397    }
8398}
8399#[derive(Clone)]
8400pub struct FieldTypeDef {
8401    pub proc: Option<Arc<DaggerSessionProc>>,
8402    pub selection: Selection,
8403    pub graphql_client: DynGraphQLClient,
8404}
8405impl IntoID<Id> for FieldTypeDef {
8406    fn into_id(
8407        self,
8408    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8409        Box::pin(async move { self.id().await })
8410    }
8411}
8412impl Loadable for FieldTypeDef {
8413    fn graphql_type() -> &'static str {
8414        "FieldTypeDef"
8415    }
8416    fn from_query(
8417        proc: Option<Arc<DaggerSessionProc>>,
8418        selection: Selection,
8419        graphql_client: DynGraphQLClient,
8420    ) -> Self {
8421        Self {
8422            proc,
8423            selection,
8424            graphql_client,
8425        }
8426    }
8427}
8428impl FieldTypeDef {
8429    /// The reason this enum member is deprecated, if any.
8430    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8431        let query = self.selection.select("deprecated");
8432        query.execute(self.graphql_client.clone()).await
8433    }
8434    /// A doc string for the field, if any.
8435    pub async fn description(&self) -> Result<String, DaggerError> {
8436        let query = self.selection.select("description");
8437        query.execute(self.graphql_client.clone()).await
8438    }
8439    /// A unique identifier for this FieldTypeDef.
8440    pub async fn id(&self) -> Result<Id, DaggerError> {
8441        let query = self.selection.select("id");
8442        query.execute(self.graphql_client.clone()).await
8443    }
8444    /// The name of the field in lowerCamelCase format.
8445    pub async fn name(&self) -> Result<String, DaggerError> {
8446        let query = self.selection.select("name");
8447        query.execute(self.graphql_client.clone()).await
8448    }
8449    /// The location of this field declaration.
8450    pub fn source_map(&self) -> SourceMap {
8451        let query = self.selection.select("sourceMap");
8452        SourceMap {
8453            proc: self.proc.clone(),
8454            selection: query,
8455            graphql_client: self.graphql_client.clone(),
8456        }
8457    }
8458    /// The type of the field.
8459    pub fn type_def(&self) -> TypeDef {
8460        let query = self.selection.select("typeDef");
8461        TypeDef {
8462            proc: self.proc.clone(),
8463            selection: query,
8464            graphql_client: self.graphql_client.clone(),
8465        }
8466    }
8467}
8468impl Node for FieldTypeDef {
8469    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8470        let query = self.selection.select("id");
8471        let graphql_client = self.graphql_client.clone();
8472        async move { query.execute(graphql_client).await }
8473    }
8474}
8475#[derive(Clone)]
8476pub struct File {
8477    pub proc: Option<Arc<DaggerSessionProc>>,
8478    pub selection: Selection,
8479    pub graphql_client: DynGraphQLClient,
8480}
8481#[derive(Builder, Debug, PartialEq)]
8482pub struct FileAsEnvFileOpts {
8483    /// Replace "${VAR}" or "$VAR" with the value of other vars
8484    #[builder(setter(into, strip_option), default)]
8485    pub expand: Option<bool>,
8486}
8487#[derive(Builder, Debug, PartialEq)]
8488pub struct FileContentsOpts {
8489    /// Maximum number of lines to read
8490    #[builder(setter(into, strip_option), default)]
8491    pub limit_lines: Option<isize>,
8492    /// Start reading after this line
8493    #[builder(setter(into, strip_option), default)]
8494    pub offset_lines: Option<isize>,
8495}
8496#[derive(Builder, Debug, PartialEq)]
8497pub struct FileDigestOpts {
8498    /// If true, exclude metadata from the digest.
8499    #[builder(setter(into, strip_option), default)]
8500    pub exclude_metadata: Option<bool>,
8501}
8502#[derive(Builder, Debug, PartialEq)]
8503pub struct FileExportOpts {
8504    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8505    #[builder(setter(into, strip_option), default)]
8506    pub allow_parent_dir_path: Option<bool>,
8507}
8508#[derive(Builder, Debug, PartialEq)]
8509pub struct FileSearchOpts<'a> {
8510    /// Allow the . pattern to match newlines in multiline mode.
8511    #[builder(setter(into, strip_option), default)]
8512    pub dotall: Option<bool>,
8513    /// Only return matching files, not lines and content
8514    #[builder(setter(into, strip_option), default)]
8515    pub files_only: Option<bool>,
8516    #[builder(setter(into, strip_option), default)]
8517    pub globs: Option<Vec<&'a str>>,
8518    /// Enable case-insensitive matching.
8519    #[builder(setter(into, strip_option), default)]
8520    pub insensitive: Option<bool>,
8521    /// Limit the number of results to return
8522    #[builder(setter(into, strip_option), default)]
8523    pub limit: Option<isize>,
8524    /// Interpret the pattern as a literal string instead of a regular expression.
8525    #[builder(setter(into, strip_option), default)]
8526    pub literal: Option<bool>,
8527    /// Enable searching across multiple lines.
8528    #[builder(setter(into, strip_option), default)]
8529    pub multiline: Option<bool>,
8530    #[builder(setter(into, strip_option), default)]
8531    pub paths: Option<Vec<&'a str>>,
8532    /// Skip hidden files (files starting with .).
8533    #[builder(setter(into, strip_option), default)]
8534    pub skip_hidden: Option<bool>,
8535    /// Honor .gitignore, .ignore, and .rgignore files.
8536    #[builder(setter(into, strip_option), default)]
8537    pub skip_ignored: Option<bool>,
8538}
8539#[derive(Builder, Debug, PartialEq)]
8540pub struct FileWithReplacedOpts {
8541    /// Replace all occurrences of the pattern.
8542    #[builder(setter(into, strip_option), default)]
8543    pub all: Option<bool>,
8544    /// Replace the first match starting from the specified line.
8545    #[builder(setter(into, strip_option), default)]
8546    pub first_from: Option<isize>,
8547}
8548impl IntoID<Id> for File {
8549    fn into_id(
8550        self,
8551    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8552        Box::pin(async move { self.id().await })
8553    }
8554}
8555impl Loadable for File {
8556    fn graphql_type() -> &'static str {
8557        "File"
8558    }
8559    fn from_query(
8560        proc: Option<Arc<DaggerSessionProc>>,
8561        selection: Selection,
8562        graphql_client: DynGraphQLClient,
8563    ) -> Self {
8564        Self {
8565            proc,
8566            selection,
8567            graphql_client,
8568        }
8569    }
8570}
8571impl File {
8572    /// Parse as an env file
8573    ///
8574    /// # Arguments
8575    ///
8576    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8577    pub fn as_env_file(&self) -> EnvFile {
8578        let query = self.selection.select("asEnvFile");
8579        EnvFile {
8580            proc: self.proc.clone(),
8581            selection: query,
8582            graphql_client: self.graphql_client.clone(),
8583        }
8584    }
8585    /// Parse as an env file
8586    ///
8587    /// # Arguments
8588    ///
8589    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8590    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8591        let mut query = self.selection.select("asEnvFile");
8592        if let Some(expand) = opts.expand {
8593            query = query.arg("expand", expand);
8594        }
8595        EnvFile {
8596            proc: self.proc.clone(),
8597            selection: query,
8598            graphql_client: self.graphql_client.clone(),
8599        }
8600    }
8601    /// Parse the file contents as JSON.
8602    pub fn as_json(&self) -> JsonValue {
8603        let query = self.selection.select("asJSON");
8604        JsonValue {
8605            proc: self.proc.clone(),
8606            selection: query,
8607            graphql_client: self.graphql_client.clone(),
8608        }
8609    }
8610    /// Change the owner of the file recursively.
8611    ///
8612    /// # Arguments
8613    ///
8614    /// * `owner` - A user:group to set for the file.
8615    ///
8616    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
8617    ///
8618    /// If the group is omitted, it defaults to the same as the user.
8619    pub fn chown(&self, owner: impl Into<String>) -> File {
8620        let mut query = self.selection.select("chown");
8621        query = query.arg("owner", owner.into());
8622        File {
8623            proc: self.proc.clone(),
8624            selection: query,
8625            graphql_client: self.graphql_client.clone(),
8626        }
8627    }
8628    /// Retrieves the contents of the file.
8629    ///
8630    /// # Arguments
8631    ///
8632    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8633    pub async fn contents(&self) -> Result<String, DaggerError> {
8634        let query = self.selection.select("contents");
8635        query.execute(self.graphql_client.clone()).await
8636    }
8637    /// Retrieves the contents of the file.
8638    ///
8639    /// # Arguments
8640    ///
8641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8642    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8643        let mut query = self.selection.select("contents");
8644        if let Some(offset_lines) = opts.offset_lines {
8645            query = query.arg("offsetLines", offset_lines);
8646        }
8647        if let Some(limit_lines) = opts.limit_lines {
8648            query = query.arg("limitLines", limit_lines);
8649        }
8650        query.execute(self.graphql_client.clone()).await
8651    }
8652    /// 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.
8653    ///
8654    /// # Arguments
8655    ///
8656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8657    pub async fn digest(&self) -> Result<String, DaggerError> {
8658        let query = self.selection.select("digest");
8659        query.execute(self.graphql_client.clone()).await
8660    }
8661    /// 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.
8662    ///
8663    /// # Arguments
8664    ///
8665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8666    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8667        let mut query = self.selection.select("digest");
8668        if let Some(exclude_metadata) = opts.exclude_metadata {
8669            query = query.arg("excludeMetadata", exclude_metadata);
8670        }
8671        query.execute(self.graphql_client.clone()).await
8672    }
8673    /// Writes the file to a file path on the host.
8674    ///
8675    /// # Arguments
8676    ///
8677    /// * `path` - Location of the written directory (e.g., "output.txt").
8678    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8679    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8680        let mut query = self.selection.select("export");
8681        query = query.arg("path", path.into());
8682        query.execute(self.graphql_client.clone()).await
8683    }
8684    /// Writes the file to a file path on the host.
8685    ///
8686    /// # Arguments
8687    ///
8688    /// * `path` - Location of the written directory (e.g., "output.txt").
8689    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8690    pub async fn export_opts(
8691        &self,
8692        path: impl Into<String>,
8693        opts: FileExportOpts,
8694    ) -> Result<String, DaggerError> {
8695        let mut query = self.selection.select("export");
8696        query = query.arg("path", path.into());
8697        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8698            query = query.arg("allowParentDirPath", allow_parent_dir_path);
8699        }
8700        query.execute(self.graphql_client.clone()).await
8701    }
8702    /// A unique identifier for this File.
8703    pub async fn id(&self) -> Result<Id, DaggerError> {
8704        let query = self.selection.select("id");
8705        query.execute(self.graphql_client.clone()).await
8706    }
8707    /// Retrieves the name of the file.
8708    pub async fn name(&self) -> Result<String, DaggerError> {
8709        let query = self.selection.select("name");
8710        query.execute(self.graphql_client.clone()).await
8711    }
8712    /// Searches for content matching the given regular expression or literal string.
8713    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8714    ///
8715    /// # Arguments
8716    ///
8717    /// * `pattern` - The text to match.
8718    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8719    pub async fn search(
8720        &self,
8721        pattern: impl Into<String>,
8722    ) -> Result<Vec<SearchResult>, DaggerError> {
8723        let mut query = self.selection.select("search");
8724        query = query.arg("pattern", pattern.into());
8725        let query = query.select("id");
8726        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8727        Ok(ids
8728            .into_iter()
8729            .map(|id| SearchResult {
8730                proc: self.proc.clone(),
8731                selection: crate::querybuilder::query()
8732                    .select("node")
8733                    .arg("id", &id.0)
8734                    .inline_fragment("SearchResult"),
8735                graphql_client: self.graphql_client.clone(),
8736            })
8737            .collect())
8738    }
8739    /// Searches for content matching the given regular expression or literal string.
8740    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8741    ///
8742    /// # Arguments
8743    ///
8744    /// * `pattern` - The text to match.
8745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8746    pub async fn search_opts<'a>(
8747        &self,
8748        pattern: impl Into<String>,
8749        opts: FileSearchOpts<'a>,
8750    ) -> Result<Vec<SearchResult>, DaggerError> {
8751        let mut query = self.selection.select("search");
8752        query = query.arg("pattern", pattern.into());
8753        if let Some(literal) = opts.literal {
8754            query = query.arg("literal", literal);
8755        }
8756        if let Some(multiline) = opts.multiline {
8757            query = query.arg("multiline", multiline);
8758        }
8759        if let Some(dotall) = opts.dotall {
8760            query = query.arg("dotall", dotall);
8761        }
8762        if let Some(insensitive) = opts.insensitive {
8763            query = query.arg("insensitive", insensitive);
8764        }
8765        if let Some(skip_ignored) = opts.skip_ignored {
8766            query = query.arg("skipIgnored", skip_ignored);
8767        }
8768        if let Some(skip_hidden) = opts.skip_hidden {
8769            query = query.arg("skipHidden", skip_hidden);
8770        }
8771        if let Some(files_only) = opts.files_only {
8772            query = query.arg("filesOnly", files_only);
8773        }
8774        if let Some(limit) = opts.limit {
8775            query = query.arg("limit", limit);
8776        }
8777        if let Some(paths) = opts.paths {
8778            query = query.arg("paths", paths);
8779        }
8780        if let Some(globs) = opts.globs {
8781            query = query.arg("globs", globs);
8782        }
8783        let query = query.select("id");
8784        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8785        Ok(ids
8786            .into_iter()
8787            .map(|id| SearchResult {
8788                proc: self.proc.clone(),
8789                selection: crate::querybuilder::query()
8790                    .select("node")
8791                    .arg("id", &id.0)
8792                    .inline_fragment("SearchResult"),
8793                graphql_client: self.graphql_client.clone(),
8794            })
8795            .collect())
8796    }
8797    /// Retrieves the size of the file, in bytes.
8798    pub async fn size(&self) -> Result<isize, DaggerError> {
8799        let query = self.selection.select("size");
8800        query.execute(self.graphql_client.clone()).await
8801    }
8802    /// Return file status
8803    pub fn stat(&self) -> Stat {
8804        let query = self.selection.select("stat");
8805        Stat {
8806            proc: self.proc.clone(),
8807            selection: query,
8808            graphql_client: self.graphql_client.clone(),
8809        }
8810    }
8811    /// Force evaluation in the engine.
8812    pub async fn sync(&self) -> Result<File, DaggerError> {
8813        let query = self.selection.select("sync");
8814        let id: Id = query.execute(self.graphql_client.clone()).await?;
8815        Ok(File {
8816            proc: self.proc.clone(),
8817            selection: query
8818                .root()
8819                .select("node")
8820                .arg("id", &id.0)
8821                .inline_fragment("File"),
8822            graphql_client: self.graphql_client.clone(),
8823        })
8824    }
8825    /// Retrieves this file with its name set to the given name.
8826    ///
8827    /// # Arguments
8828    ///
8829    /// * `name` - Name to set file to.
8830    pub fn with_name(&self, name: impl Into<String>) -> File {
8831        let mut query = self.selection.select("withName");
8832        query = query.arg("name", name.into());
8833        File {
8834            proc: self.proc.clone(),
8835            selection: query,
8836            graphql_client: self.graphql_client.clone(),
8837        }
8838    }
8839    /// Retrieves the file with content replaced with the given text.
8840    /// If 'all' is true, all occurrences of the pattern will be replaced.
8841    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8842    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8843    /// If there are no matches for the pattern, this will error.
8844    ///
8845    /// # Arguments
8846    ///
8847    /// * `search` - The text to match.
8848    /// * `replacement` - The text to match.
8849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8850    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8851        let mut query = self.selection.select("withReplaced");
8852        query = query.arg("search", search.into());
8853        query = query.arg("replacement", replacement.into());
8854        File {
8855            proc: self.proc.clone(),
8856            selection: query,
8857            graphql_client: self.graphql_client.clone(),
8858        }
8859    }
8860    /// Retrieves the file with content replaced with the given text.
8861    /// If 'all' is true, all occurrences of the pattern will be replaced.
8862    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8863    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8864    /// If there are no matches for the pattern, this will error.
8865    ///
8866    /// # Arguments
8867    ///
8868    /// * `search` - The text to match.
8869    /// * `replacement` - The text to match.
8870    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8871    pub fn with_replaced_opts(
8872        &self,
8873        search: impl Into<String>,
8874        replacement: impl Into<String>,
8875        opts: FileWithReplacedOpts,
8876    ) -> File {
8877        let mut query = self.selection.select("withReplaced");
8878        query = query.arg("search", search.into());
8879        query = query.arg("replacement", replacement.into());
8880        if let Some(all) = opts.all {
8881            query = query.arg("all", all);
8882        }
8883        if let Some(first_from) = opts.first_from {
8884            query = query.arg("firstFrom", first_from);
8885        }
8886        File {
8887            proc: self.proc.clone(),
8888            selection: query,
8889            graphql_client: self.graphql_client.clone(),
8890        }
8891    }
8892    /// Retrieves this file with its created/modified timestamps set to the given time.
8893    ///
8894    /// # Arguments
8895    ///
8896    /// * `timestamp` - Timestamp to set dir/files in.
8897    ///
8898    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
8899    pub fn with_timestamps(&self, timestamp: isize) -> File {
8900        let mut query = self.selection.select("withTimestamps");
8901        query = query.arg("timestamp", timestamp);
8902        File {
8903            proc: self.proc.clone(),
8904            selection: query,
8905            graphql_client: self.graphql_client.clone(),
8906        }
8907    }
8908}
8909impl Exportable for File {
8910    fn export(
8911        &self,
8912        path: impl Into<String>,
8913    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
8914        let mut query = self.selection.select("export");
8915        query = query.arg("path", path.into());
8916        let graphql_client = self.graphql_client.clone();
8917        async move { query.execute(graphql_client).await }
8918    }
8919    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8920        let query = self.selection.select("id");
8921        let graphql_client = self.graphql_client.clone();
8922        async move { query.execute(graphql_client).await }
8923    }
8924}
8925impl Node for File {
8926    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8927        let query = self.selection.select("id");
8928        let graphql_client = self.graphql_client.clone();
8929        async move { query.execute(graphql_client).await }
8930    }
8931}
8932impl Syncer for File {
8933    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8934        let query = self.selection.select("id");
8935        let graphql_client = self.graphql_client.clone();
8936        async move { query.execute(graphql_client).await }
8937    }
8938    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8939        let query = self.selection.select("sync");
8940        let graphql_client = self.graphql_client.clone();
8941        async move { query.execute(graphql_client).await }
8942    }
8943}
8944#[derive(Clone)]
8945pub struct Function {
8946    pub proc: Option<Arc<DaggerSessionProc>>,
8947    pub selection: Selection,
8948    pub graphql_client: DynGraphQLClient,
8949}
8950#[derive(Builder, Debug, PartialEq)]
8951pub struct FunctionWithArgOpts<'a> {
8952    #[builder(setter(into, strip_option), default)]
8953    pub default_address: Option<&'a str>,
8954    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
8955    #[builder(setter(into, strip_option), default)]
8956    pub default_path: Option<&'a str>,
8957    /// A default value to use for this argument if not explicitly set by the caller, if any
8958    #[builder(setter(into, strip_option), default)]
8959    pub default_value: Option<Json>,
8960    /// If deprecated, the reason or migration path.
8961    #[builder(setter(into, strip_option), default)]
8962    pub deprecated: Option<&'a str>,
8963    /// A doc string for the argument, if any
8964    #[builder(setter(into, strip_option), default)]
8965    pub description: Option<&'a str>,
8966    /// Patterns to ignore when loading the contextual argument value.
8967    #[builder(setter(into, strip_option), default)]
8968    pub ignore: Option<Vec<&'a str>>,
8969    /// The source map for the argument definition.
8970    #[builder(setter(into, strip_option), default)]
8971    pub source_map: Option<Id>,
8972}
8973#[derive(Builder, Debug, PartialEq)]
8974pub struct FunctionWithCachePolicyOpts<'a> {
8975    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
8976    #[builder(setter(into, strip_option), default)]
8977    pub time_to_live: Option<&'a str>,
8978}
8979#[derive(Builder, Debug, PartialEq)]
8980pub struct FunctionWithDeprecatedOpts<'a> {
8981    /// Reason or migration path describing the deprecation.
8982    #[builder(setter(into, strip_option), default)]
8983    pub reason: Option<&'a str>,
8984}
8985impl IntoID<Id> for Function {
8986    fn into_id(
8987        self,
8988    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8989        Box::pin(async move { self.id().await })
8990    }
8991}
8992impl Loadable for Function {
8993    fn graphql_type() -> &'static str {
8994        "Function"
8995    }
8996    fn from_query(
8997        proc: Option<Arc<DaggerSessionProc>>,
8998        selection: Selection,
8999        graphql_client: DynGraphQLClient,
9000    ) -> Self {
9001        Self {
9002            proc,
9003            selection,
9004            graphql_client,
9005        }
9006    }
9007}
9008impl Function {
9009    /// Arguments accepted by the function, if any.
9010    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9011        let query = self.selection.select("args");
9012        let query = query.select("id");
9013        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9014        Ok(ids
9015            .into_iter()
9016            .map(|id| FunctionArg {
9017                proc: self.proc.clone(),
9018                selection: crate::querybuilder::query()
9019                    .select("node")
9020                    .arg("id", &id.0)
9021                    .inline_fragment("FunctionArg"),
9022                graphql_client: self.graphql_client.clone(),
9023            })
9024            .collect())
9025    }
9026    /// The reason this function is deprecated, if any.
9027    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9028        let query = self.selection.select("deprecated");
9029        query.execute(self.graphql_client.clone()).await
9030    }
9031    /// A doc string for the function, if any.
9032    pub async fn description(&self) -> Result<String, DaggerError> {
9033        let query = self.selection.select("description");
9034        query.execute(self.graphql_client.clone()).await
9035    }
9036    /// A unique identifier for this Function.
9037    pub async fn id(&self) -> Result<Id, DaggerError> {
9038        let query = self.selection.select("id");
9039        query.execute(self.graphql_client.clone()).await
9040    }
9041    /// The name of the function.
9042    pub async fn name(&self) -> Result<String, DaggerError> {
9043        let query = self.selection.select("name");
9044        query.execute(self.graphql_client.clone()).await
9045    }
9046    /// The type returned by the function.
9047    pub fn return_type(&self) -> TypeDef {
9048        let query = self.selection.select("returnType");
9049        TypeDef {
9050            proc: self.proc.clone(),
9051            selection: query,
9052            graphql_client: self.graphql_client.clone(),
9053        }
9054    }
9055    /// The location of this function declaration.
9056    pub fn source_map(&self) -> SourceMap {
9057        let query = self.selection.select("sourceMap");
9058        SourceMap {
9059            proc: self.proc.clone(),
9060            selection: query,
9061            graphql_client: self.graphql_client.clone(),
9062        }
9063    }
9064    /// If this function is provided by a module, the name of the module. Unset otherwise.
9065    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9066        let query = self.selection.select("sourceModuleName");
9067        query.execute(self.graphql_client.clone()).await
9068    }
9069    /// Returns the function with the provided argument
9070    ///
9071    /// # Arguments
9072    ///
9073    /// * `name` - The name of the argument
9074    /// * `type_def` - The type of the argument
9075    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9076    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9077        let mut query = self.selection.select("withArg");
9078        query = query.arg("name", name.into());
9079        query = query.arg_lazy(
9080            "typeDef",
9081            Box::new(move || {
9082                let type_def = type_def.clone();
9083                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9084            }),
9085        );
9086        Function {
9087            proc: self.proc.clone(),
9088            selection: query,
9089            graphql_client: self.graphql_client.clone(),
9090        }
9091    }
9092    /// Returns the function with the provided argument
9093    ///
9094    /// # Arguments
9095    ///
9096    /// * `name` - The name of the argument
9097    /// * `type_def` - The type of the argument
9098    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9099    pub fn with_arg_opts<'a>(
9100        &self,
9101        name: impl Into<String>,
9102        type_def: impl IntoID<Id>,
9103        opts: FunctionWithArgOpts<'a>,
9104    ) -> Function {
9105        let mut query = self.selection.select("withArg");
9106        query = query.arg("name", name.into());
9107        query = query.arg_lazy(
9108            "typeDef",
9109            Box::new(move || {
9110                let type_def = type_def.clone();
9111                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9112            }),
9113        );
9114        if let Some(description) = opts.description {
9115            query = query.arg("description", description);
9116        }
9117        if let Some(default_value) = opts.default_value {
9118            query = query.arg("defaultValue", default_value);
9119        }
9120        if let Some(default_path) = opts.default_path {
9121            query = query.arg("defaultPath", default_path);
9122        }
9123        if let Some(ignore) = opts.ignore {
9124            query = query.arg("ignore", ignore);
9125        }
9126        if let Some(source_map) = opts.source_map {
9127            query = query.arg("sourceMap", source_map);
9128        }
9129        if let Some(deprecated) = opts.deprecated {
9130            query = query.arg("deprecated", deprecated);
9131        }
9132        if let Some(default_address) = opts.default_address {
9133            query = query.arg("defaultAddress", default_address);
9134        }
9135        Function {
9136            proc: self.proc.clone(),
9137            selection: query,
9138            graphql_client: self.graphql_client.clone(),
9139        }
9140    }
9141    /// Returns the function updated to use the provided cache policy.
9142    ///
9143    /// # Arguments
9144    ///
9145    /// * `policy` - The cache policy to use.
9146    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9147    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9148        let mut query = self.selection.select("withCachePolicy");
9149        query = query.arg("policy", policy);
9150        Function {
9151            proc: self.proc.clone(),
9152            selection: query,
9153            graphql_client: self.graphql_client.clone(),
9154        }
9155    }
9156    /// Returns the function updated to use the provided cache policy.
9157    ///
9158    /// # Arguments
9159    ///
9160    /// * `policy` - The cache policy to use.
9161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9162    pub fn with_cache_policy_opts<'a>(
9163        &self,
9164        policy: FunctionCachePolicy,
9165        opts: FunctionWithCachePolicyOpts<'a>,
9166    ) -> Function {
9167        let mut query = self.selection.select("withCachePolicy");
9168        query = query.arg("policy", policy);
9169        if let Some(time_to_live) = opts.time_to_live {
9170            query = query.arg("timeToLive", time_to_live);
9171        }
9172        Function {
9173            proc: self.proc.clone(),
9174            selection: query,
9175            graphql_client: self.graphql_client.clone(),
9176        }
9177    }
9178    /// Returns the function with a flag indicating it's a check.
9179    pub fn with_check(&self) -> Function {
9180        let query = self.selection.select("withCheck");
9181        Function {
9182            proc: self.proc.clone(),
9183            selection: query,
9184            graphql_client: self.graphql_client.clone(),
9185        }
9186    }
9187    /// Returns the function with the provided deprecation reason.
9188    ///
9189    /// # Arguments
9190    ///
9191    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9192    pub fn with_deprecated(&self) -> Function {
9193        let query = self.selection.select("withDeprecated");
9194        Function {
9195            proc: self.proc.clone(),
9196            selection: query,
9197            graphql_client: self.graphql_client.clone(),
9198        }
9199    }
9200    /// Returns the function with the provided deprecation reason.
9201    ///
9202    /// # Arguments
9203    ///
9204    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9205    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9206        let mut query = self.selection.select("withDeprecated");
9207        if let Some(reason) = opts.reason {
9208            query = query.arg("reason", reason);
9209        }
9210        Function {
9211            proc: self.proc.clone(),
9212            selection: query,
9213            graphql_client: self.graphql_client.clone(),
9214        }
9215    }
9216    /// Returns the function with the given doc string.
9217    ///
9218    /// # Arguments
9219    ///
9220    /// * `description` - The doc string to set.
9221    pub fn with_description(&self, description: impl Into<String>) -> Function {
9222        let mut query = self.selection.select("withDescription");
9223        query = query.arg("description", description.into());
9224        Function {
9225            proc: self.proc.clone(),
9226            selection: query,
9227            graphql_client: self.graphql_client.clone(),
9228        }
9229    }
9230    /// Returns the function with a flag indicating it's a generator.
9231    pub fn with_generator(&self) -> Function {
9232        let query = self.selection.select("withGenerator");
9233        Function {
9234            proc: self.proc.clone(),
9235            selection: query,
9236            graphql_client: self.graphql_client.clone(),
9237        }
9238    }
9239    /// Returns the function with the given source map.
9240    ///
9241    /// # Arguments
9242    ///
9243    /// * `source_map` - The source map for the function definition.
9244    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9245        let mut query = self.selection.select("withSourceMap");
9246        query = query.arg_lazy(
9247            "sourceMap",
9248            Box::new(move || {
9249                let source_map = source_map.clone();
9250                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9251            }),
9252        );
9253        Function {
9254            proc: self.proc.clone(),
9255            selection: query,
9256            graphql_client: self.graphql_client.clone(),
9257        }
9258    }
9259    /// Returns the function with a flag indicating it returns a service for dagger up.
9260    pub fn with_up(&self) -> Function {
9261        let query = self.selection.select("withUp");
9262        Function {
9263            proc: self.proc.clone(),
9264            selection: query,
9265            graphql_client: self.graphql_client.clone(),
9266        }
9267    }
9268}
9269impl Node for Function {
9270    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9271        let query = self.selection.select("id");
9272        let graphql_client = self.graphql_client.clone();
9273        async move { query.execute(graphql_client).await }
9274    }
9275}
9276#[derive(Clone)]
9277pub struct FunctionArg {
9278    pub proc: Option<Arc<DaggerSessionProc>>,
9279    pub selection: Selection,
9280    pub graphql_client: DynGraphQLClient,
9281}
9282impl IntoID<Id> for FunctionArg {
9283    fn into_id(
9284        self,
9285    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9286        Box::pin(async move { self.id().await })
9287    }
9288}
9289impl Loadable for FunctionArg {
9290    fn graphql_type() -> &'static str {
9291        "FunctionArg"
9292    }
9293    fn from_query(
9294        proc: Option<Arc<DaggerSessionProc>>,
9295        selection: Selection,
9296        graphql_client: DynGraphQLClient,
9297    ) -> Self {
9298        Self {
9299            proc,
9300            selection,
9301            graphql_client,
9302        }
9303    }
9304}
9305impl FunctionArg {
9306    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9307    pub async fn default_address(&self) -> Result<String, DaggerError> {
9308        let query = self.selection.select("defaultAddress");
9309        query.execute(self.graphql_client.clone()).await
9310    }
9311    /// 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
9312    pub async fn default_path(&self) -> Result<String, DaggerError> {
9313        let query = self.selection.select("defaultPath");
9314        query.execute(self.graphql_client.clone()).await
9315    }
9316    /// A default value to use for this argument when not explicitly set by the caller, if any.
9317    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9318        let query = self.selection.select("defaultValue");
9319        query.execute(self.graphql_client.clone()).await
9320    }
9321    /// The reason this function is deprecated, if any.
9322    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9323        let query = self.selection.select("deprecated");
9324        query.execute(self.graphql_client.clone()).await
9325    }
9326    /// A doc string for the argument, if any.
9327    pub async fn description(&self) -> Result<String, DaggerError> {
9328        let query = self.selection.select("description");
9329        query.execute(self.graphql_client.clone()).await
9330    }
9331    /// A unique identifier for this FunctionArg.
9332    pub async fn id(&self) -> Result<Id, DaggerError> {
9333        let query = self.selection.select("id");
9334        query.execute(self.graphql_client.clone()).await
9335    }
9336    /// 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.
9337    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9338        let query = self.selection.select("ignore");
9339        query.execute(self.graphql_client.clone()).await
9340    }
9341    /// The name of the argument in lowerCamelCase format.
9342    pub async fn name(&self) -> Result<String, DaggerError> {
9343        let query = self.selection.select("name");
9344        query.execute(self.graphql_client.clone()).await
9345    }
9346    /// The location of this arg declaration.
9347    pub fn source_map(&self) -> SourceMap {
9348        let query = self.selection.select("sourceMap");
9349        SourceMap {
9350            proc: self.proc.clone(),
9351            selection: query,
9352            graphql_client: self.graphql_client.clone(),
9353        }
9354    }
9355    /// The type of the argument.
9356    pub fn type_def(&self) -> TypeDef {
9357        let query = self.selection.select("typeDef");
9358        TypeDef {
9359            proc: self.proc.clone(),
9360            selection: query,
9361            graphql_client: self.graphql_client.clone(),
9362        }
9363    }
9364}
9365impl Node for FunctionArg {
9366    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9367        let query = self.selection.select("id");
9368        let graphql_client = self.graphql_client.clone();
9369        async move { query.execute(graphql_client).await }
9370    }
9371}
9372#[derive(Clone)]
9373pub struct FunctionCall {
9374    pub proc: Option<Arc<DaggerSessionProc>>,
9375    pub selection: Selection,
9376    pub graphql_client: DynGraphQLClient,
9377}
9378impl IntoID<Id> for FunctionCall {
9379    fn into_id(
9380        self,
9381    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9382        Box::pin(async move { self.id().await })
9383    }
9384}
9385impl Loadable for FunctionCall {
9386    fn graphql_type() -> &'static str {
9387        "FunctionCall"
9388    }
9389    fn from_query(
9390        proc: Option<Arc<DaggerSessionProc>>,
9391        selection: Selection,
9392        graphql_client: DynGraphQLClient,
9393    ) -> Self {
9394        Self {
9395            proc,
9396            selection,
9397            graphql_client,
9398        }
9399    }
9400}
9401impl FunctionCall {
9402    /// A unique identifier for this FunctionCall.
9403    pub async fn id(&self) -> Result<Id, DaggerError> {
9404        let query = self.selection.select("id");
9405        query.execute(self.graphql_client.clone()).await
9406    }
9407    /// The argument values the function is being invoked with.
9408    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9409        let query = self.selection.select("inputArgs");
9410        let query = query.select("id");
9411        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9412        Ok(ids
9413            .into_iter()
9414            .map(|id| FunctionCallArgValue {
9415                proc: self.proc.clone(),
9416                selection: crate::querybuilder::query()
9417                    .select("node")
9418                    .arg("id", &id.0)
9419                    .inline_fragment("FunctionCallArgValue"),
9420                graphql_client: self.graphql_client.clone(),
9421            })
9422            .collect())
9423    }
9424    /// The name of the function being called.
9425    pub async fn name(&self) -> Result<String, DaggerError> {
9426        let query = self.selection.select("name");
9427        query.execute(self.graphql_client.clone()).await
9428    }
9429    /// 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.
9430    pub async fn parent(&self) -> Result<Json, DaggerError> {
9431        let query = self.selection.select("parent");
9432        query.execute(self.graphql_client.clone()).await
9433    }
9434    /// 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.
9435    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9436        let query = self.selection.select("parentName");
9437        query.execute(self.graphql_client.clone()).await
9438    }
9439    /// Return an error from the function.
9440    ///
9441    /// # Arguments
9442    ///
9443    /// * `error` - The error to return.
9444    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9445        let mut query = self.selection.select("returnError");
9446        query = query.arg_lazy(
9447            "error",
9448            Box::new(move || {
9449                let error = error.clone();
9450                Box::pin(async move { error.into_id().await.unwrap().quote() })
9451            }),
9452        );
9453        query.execute(self.graphql_client.clone()).await
9454    }
9455    /// Set the return value of the function call to the provided value.
9456    ///
9457    /// # Arguments
9458    ///
9459    /// * `value` - JSON serialization of the return value.
9460    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9461        let mut query = self.selection.select("returnValue");
9462        query = query.arg("value", value);
9463        query.execute(self.graphql_client.clone()).await
9464    }
9465}
9466impl Node for FunctionCall {
9467    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9468        let query = self.selection.select("id");
9469        let graphql_client = self.graphql_client.clone();
9470        async move { query.execute(graphql_client).await }
9471    }
9472}
9473#[derive(Clone)]
9474pub struct FunctionCallArgValue {
9475    pub proc: Option<Arc<DaggerSessionProc>>,
9476    pub selection: Selection,
9477    pub graphql_client: DynGraphQLClient,
9478}
9479impl IntoID<Id> for FunctionCallArgValue {
9480    fn into_id(
9481        self,
9482    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9483        Box::pin(async move { self.id().await })
9484    }
9485}
9486impl Loadable for FunctionCallArgValue {
9487    fn graphql_type() -> &'static str {
9488        "FunctionCallArgValue"
9489    }
9490    fn from_query(
9491        proc: Option<Arc<DaggerSessionProc>>,
9492        selection: Selection,
9493        graphql_client: DynGraphQLClient,
9494    ) -> Self {
9495        Self {
9496            proc,
9497            selection,
9498            graphql_client,
9499        }
9500    }
9501}
9502impl FunctionCallArgValue {
9503    /// A unique identifier for this FunctionCallArgValue.
9504    pub async fn id(&self) -> Result<Id, DaggerError> {
9505        let query = self.selection.select("id");
9506        query.execute(self.graphql_client.clone()).await
9507    }
9508    /// The name of the argument.
9509    pub async fn name(&self) -> Result<String, DaggerError> {
9510        let query = self.selection.select("name");
9511        query.execute(self.graphql_client.clone()).await
9512    }
9513    /// The value of the argument represented as a JSON serialized string.
9514    pub async fn value(&self) -> Result<Json, DaggerError> {
9515        let query = self.selection.select("value");
9516        query.execute(self.graphql_client.clone()).await
9517    }
9518}
9519impl Node for FunctionCallArgValue {
9520    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9521        let query = self.selection.select("id");
9522        let graphql_client = self.graphql_client.clone();
9523        async move { query.execute(graphql_client).await }
9524    }
9525}
9526#[derive(Clone)]
9527pub struct GeneratedCode {
9528    pub proc: Option<Arc<DaggerSessionProc>>,
9529    pub selection: Selection,
9530    pub graphql_client: DynGraphQLClient,
9531}
9532impl IntoID<Id> for GeneratedCode {
9533    fn into_id(
9534        self,
9535    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9536        Box::pin(async move { self.id().await })
9537    }
9538}
9539impl Loadable for GeneratedCode {
9540    fn graphql_type() -> &'static str {
9541        "GeneratedCode"
9542    }
9543    fn from_query(
9544        proc: Option<Arc<DaggerSessionProc>>,
9545        selection: Selection,
9546        graphql_client: DynGraphQLClient,
9547    ) -> Self {
9548        Self {
9549            proc,
9550            selection,
9551            graphql_client,
9552        }
9553    }
9554}
9555impl GeneratedCode {
9556    /// The directory containing the generated code.
9557    pub fn code(&self) -> Directory {
9558        let query = self.selection.select("code");
9559        Directory {
9560            proc: self.proc.clone(),
9561            selection: query,
9562            graphql_client: self.graphql_client.clone(),
9563        }
9564    }
9565    /// A unique identifier for this GeneratedCode.
9566    pub async fn id(&self) -> Result<Id, DaggerError> {
9567        let query = self.selection.select("id");
9568        query.execute(self.graphql_client.clone()).await
9569    }
9570    /// List of paths to mark generated in version control (i.e. .gitattributes).
9571    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9572        let query = self.selection.select("vcsGeneratedPaths");
9573        query.execute(self.graphql_client.clone()).await
9574    }
9575    /// List of paths to ignore in version control (i.e. .gitignore).
9576    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9577        let query = self.selection.select("vcsIgnoredPaths");
9578        query.execute(self.graphql_client.clone()).await
9579    }
9580    /// Set the list of paths to mark generated in version control.
9581    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9582        let mut query = self.selection.select("withVCSGeneratedPaths");
9583        query = query.arg(
9584            "paths",
9585            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9586        );
9587        GeneratedCode {
9588            proc: self.proc.clone(),
9589            selection: query,
9590            graphql_client: self.graphql_client.clone(),
9591        }
9592    }
9593    /// Set the list of paths to ignore in version control.
9594    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9595        let mut query = self.selection.select("withVCSIgnoredPaths");
9596        query = query.arg(
9597            "paths",
9598            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9599        );
9600        GeneratedCode {
9601            proc: self.proc.clone(),
9602            selection: query,
9603            graphql_client: self.graphql_client.clone(),
9604        }
9605    }
9606}
9607impl Node for GeneratedCode {
9608    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9609        let query = self.selection.select("id");
9610        let graphql_client = self.graphql_client.clone();
9611        async move { query.execute(graphql_client).await }
9612    }
9613}
9614#[derive(Clone)]
9615pub struct Generator {
9616    pub proc: Option<Arc<DaggerSessionProc>>,
9617    pub selection: Selection,
9618    pub graphql_client: DynGraphQLClient,
9619}
9620impl IntoID<Id> for Generator {
9621    fn into_id(
9622        self,
9623    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9624        Box::pin(async move { self.id().await })
9625    }
9626}
9627impl Loadable for Generator {
9628    fn graphql_type() -> &'static str {
9629        "Generator"
9630    }
9631    fn from_query(
9632        proc: Option<Arc<DaggerSessionProc>>,
9633        selection: Selection,
9634        graphql_client: DynGraphQLClient,
9635    ) -> Self {
9636        Self {
9637            proc,
9638            selection,
9639            graphql_client,
9640        }
9641    }
9642}
9643impl Generator {
9644    /// The generated changeset from the last run
9645    pub fn changes(&self) -> Changeset {
9646        let query = self.selection.select("changes");
9647        Changeset {
9648            proc: self.proc.clone(),
9649            selection: query,
9650            graphql_client: self.graphql_client.clone(),
9651        }
9652    }
9653    /// Whether the generator complete
9654    pub async fn completed(&self) -> Result<bool, DaggerError> {
9655        let query = self.selection.select("completed");
9656        query.execute(self.graphql_client.clone()).await
9657    }
9658    /// Return the description of the generator
9659    pub async fn description(&self) -> Result<String, DaggerError> {
9660        let query = self.selection.select("description");
9661        query.execute(self.graphql_client.clone()).await
9662    }
9663    /// A unique identifier for this Generator.
9664    pub async fn id(&self) -> Result<Id, DaggerError> {
9665        let query = self.selection.select("id");
9666        query.execute(self.graphql_client.clone()).await
9667    }
9668    /// Whether changeset from the last generator run is empty or not
9669    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9670        let query = self.selection.select("isEmpty");
9671        query.execute(self.graphql_client.clone()).await
9672    }
9673    /// Return the fully qualified name of the generator
9674    pub async fn name(&self) -> Result<String, DaggerError> {
9675        let query = self.selection.select("name");
9676        query.execute(self.graphql_client.clone()).await
9677    }
9678    /// The original module in which the generator has been defined
9679    pub fn original_module(&self) -> Module {
9680        let query = self.selection.select("originalModule");
9681        Module {
9682            proc: self.proc.clone(),
9683            selection: query,
9684            graphql_client: self.graphql_client.clone(),
9685        }
9686    }
9687    /// The path of the generator within its module
9688    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9689        let query = self.selection.select("path");
9690        query.execute(self.graphql_client.clone()).await
9691    }
9692    /// Execute the generator
9693    pub fn run(&self) -> Generator {
9694        let query = self.selection.select("run");
9695        Generator {
9696            proc: self.proc.clone(),
9697            selection: query,
9698            graphql_client: self.graphql_client.clone(),
9699        }
9700    }
9701}
9702impl Node for Generator {
9703    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9704        let query = self.selection.select("id");
9705        let graphql_client = self.graphql_client.clone();
9706        async move { query.execute(graphql_client).await }
9707    }
9708}
9709#[derive(Clone)]
9710pub struct GeneratorGroup {
9711    pub proc: Option<Arc<DaggerSessionProc>>,
9712    pub selection: Selection,
9713    pub graphql_client: DynGraphQLClient,
9714}
9715#[derive(Builder, Debug, PartialEq)]
9716pub struct GeneratorGroupChangesOpts {
9717    /// Strategy to apply on conflicts between generators
9718    #[builder(setter(into, strip_option), default)]
9719    pub on_conflict: Option<ChangesetsMergeConflict>,
9720}
9721impl IntoID<Id> for GeneratorGroup {
9722    fn into_id(
9723        self,
9724    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9725        Box::pin(async move { self.id().await })
9726    }
9727}
9728impl Loadable for GeneratorGroup {
9729    fn graphql_type() -> &'static str {
9730        "GeneratorGroup"
9731    }
9732    fn from_query(
9733        proc: Option<Arc<DaggerSessionProc>>,
9734        selection: Selection,
9735        graphql_client: DynGraphQLClient,
9736    ) -> Self {
9737        Self {
9738            proc,
9739            selection,
9740            graphql_client,
9741        }
9742    }
9743}
9744impl GeneratorGroup {
9745    /// The combined changes from the last run of the generators
9746    /// 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.
9747    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9748    ///
9749    /// # Arguments
9750    ///
9751    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9752    pub fn changes(&self) -> Changeset {
9753        let query = self.selection.select("changes");
9754        Changeset {
9755            proc: self.proc.clone(),
9756            selection: query,
9757            graphql_client: self.graphql_client.clone(),
9758        }
9759    }
9760    /// The combined changes from the last run of the generators
9761    /// 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.
9762    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9763    ///
9764    /// # Arguments
9765    ///
9766    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9767    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9768        let mut query = self.selection.select("changes");
9769        if let Some(on_conflict) = opts.on_conflict {
9770            query = query.arg("onConflict", on_conflict);
9771        }
9772        Changeset {
9773            proc: self.proc.clone(),
9774            selection: query,
9775            graphql_client: self.graphql_client.clone(),
9776        }
9777    }
9778    /// A unique identifier for this GeneratorGroup.
9779    pub async fn id(&self) -> Result<Id, DaggerError> {
9780        let query = self.selection.select("id");
9781        query.execute(self.graphql_client.clone()).await
9782    }
9783    /// Whether the generated changeset from the last run is empty or not
9784    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9785        let query = self.selection.select("isEmpty");
9786        query.execute(self.graphql_client.clone()).await
9787    }
9788    /// Return a list of individual generators and their details
9789    pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9790        let query = self.selection.select("list");
9791        let query = query.select("id");
9792        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9793        Ok(ids
9794            .into_iter()
9795            .map(|id| Generator {
9796                proc: self.proc.clone(),
9797                selection: crate::querybuilder::query()
9798                    .select("node")
9799                    .arg("id", &id.0)
9800                    .inline_fragment("Generator"),
9801                graphql_client: self.graphql_client.clone(),
9802            })
9803            .collect())
9804    }
9805    /// Execute all selected generators
9806    pub fn run(&self) -> GeneratorGroup {
9807        let query = self.selection.select("run");
9808        GeneratorGroup {
9809            proc: self.proc.clone(),
9810            selection: query,
9811            graphql_client: self.graphql_client.clone(),
9812        }
9813    }
9814}
9815impl Node for GeneratorGroup {
9816    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9817        let query = self.selection.select("id");
9818        let graphql_client = self.graphql_client.clone();
9819        async move { query.execute(graphql_client).await }
9820    }
9821}
9822#[derive(Clone)]
9823pub struct GitRef {
9824    pub proc: Option<Arc<DaggerSessionProc>>,
9825    pub selection: Selection,
9826    pub graphql_client: DynGraphQLClient,
9827}
9828#[derive(Builder, Debug, PartialEq)]
9829pub struct GitRefTreeOpts {
9830    /// The depth of the tree to fetch.
9831    #[builder(setter(into, strip_option), default)]
9832    pub depth: Option<isize>,
9833    /// Set to true to discard .git directory.
9834    #[builder(setter(into, strip_option), default)]
9835    pub discard_git_dir: Option<bool>,
9836    /// Set to true to populate tag refs in the local checkout .git.
9837    #[builder(setter(into, strip_option), default)]
9838    pub include_tags: Option<bool>,
9839}
9840impl IntoID<Id> for GitRef {
9841    fn into_id(
9842        self,
9843    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9844        Box::pin(async move { self.id().await })
9845    }
9846}
9847impl Loadable for GitRef {
9848    fn graphql_type() -> &'static str {
9849        "GitRef"
9850    }
9851    fn from_query(
9852        proc: Option<Arc<DaggerSessionProc>>,
9853        selection: Selection,
9854        graphql_client: DynGraphQLClient,
9855    ) -> Self {
9856        Self {
9857            proc,
9858            selection,
9859            graphql_client,
9860        }
9861    }
9862}
9863impl GitRef {
9864    /// The resolved commit id at this ref.
9865    pub async fn commit(&self) -> Result<String, DaggerError> {
9866        let query = self.selection.select("commit");
9867        query.execute(self.graphql_client.clone()).await
9868    }
9869    /// Find the best common ancestor between this ref and another ref.
9870    ///
9871    /// # Arguments
9872    ///
9873    /// * `other` - The other ref to compare against.
9874    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9875        let mut query = self.selection.select("commonAncestor");
9876        query = query.arg_lazy(
9877            "other",
9878            Box::new(move || {
9879                let other = other.clone();
9880                Box::pin(async move { other.into_id().await.unwrap().quote() })
9881            }),
9882        );
9883        GitRef {
9884            proc: self.proc.clone(),
9885            selection: query,
9886            graphql_client: self.graphql_client.clone(),
9887        }
9888    }
9889    /// A unique identifier for this GitRef.
9890    pub async fn id(&self) -> Result<Id, DaggerError> {
9891        let query = self.selection.select("id");
9892        query.execute(self.graphql_client.clone()).await
9893    }
9894    /// The resolved ref name at this ref.
9895    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9896        let query = self.selection.select("ref");
9897        query.execute(self.graphql_client.clone()).await
9898    }
9899    /// The filesystem tree at this ref.
9900    ///
9901    /// # Arguments
9902    ///
9903    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9904    pub fn tree(&self) -> Directory {
9905        let query = self.selection.select("tree");
9906        Directory {
9907            proc: self.proc.clone(),
9908            selection: query,
9909            graphql_client: self.graphql_client.clone(),
9910        }
9911    }
9912    /// The filesystem tree at this ref.
9913    ///
9914    /// # Arguments
9915    ///
9916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9917    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9918        let mut query = self.selection.select("tree");
9919        if let Some(discard_git_dir) = opts.discard_git_dir {
9920            query = query.arg("discardGitDir", discard_git_dir);
9921        }
9922        if let Some(depth) = opts.depth {
9923            query = query.arg("depth", depth);
9924        }
9925        if let Some(include_tags) = opts.include_tags {
9926            query = query.arg("includeTags", include_tags);
9927        }
9928        Directory {
9929            proc: self.proc.clone(),
9930            selection: query,
9931            graphql_client: self.graphql_client.clone(),
9932        }
9933    }
9934}
9935impl Node for GitRef {
9936    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9937        let query = self.selection.select("id");
9938        let graphql_client = self.graphql_client.clone();
9939        async move { query.execute(graphql_client).await }
9940    }
9941}
9942#[derive(Clone)]
9943pub struct GitRepository {
9944    pub proc: Option<Arc<DaggerSessionProc>>,
9945    pub selection: Selection,
9946    pub graphql_client: DynGraphQLClient,
9947}
9948#[derive(Builder, Debug, PartialEq)]
9949pub struct GitRepositoryBranchesOpts<'a> {
9950    /// Glob patterns (e.g., "refs/tags/v*").
9951    #[builder(setter(into, strip_option), default)]
9952    pub patterns: Option<Vec<&'a str>>,
9953}
9954#[derive(Builder, Debug, PartialEq)]
9955pub struct GitRepositoryTagsOpts<'a> {
9956    /// Glob patterns (e.g., "refs/tags/v*").
9957    #[builder(setter(into, strip_option), default)]
9958    pub patterns: Option<Vec<&'a str>>,
9959}
9960impl IntoID<Id> for GitRepository {
9961    fn into_id(
9962        self,
9963    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9964        Box::pin(async move { self.id().await })
9965    }
9966}
9967impl Loadable for GitRepository {
9968    fn graphql_type() -> &'static str {
9969        "GitRepository"
9970    }
9971    fn from_query(
9972        proc: Option<Arc<DaggerSessionProc>>,
9973        selection: Selection,
9974        graphql_client: DynGraphQLClient,
9975    ) -> Self {
9976        Self {
9977            proc,
9978            selection,
9979            graphql_client,
9980        }
9981    }
9982}
9983impl GitRepository {
9984    /// Returns details of a branch.
9985    ///
9986    /// # Arguments
9987    ///
9988    /// * `name` - Branch's name (e.g., "main").
9989    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9990        let mut query = self.selection.select("branch");
9991        query = query.arg("name", name.into());
9992        GitRef {
9993            proc: self.proc.clone(),
9994            selection: query,
9995            graphql_client: self.graphql_client.clone(),
9996        }
9997    }
9998    /// branches that match any of the given glob patterns.
9999    ///
10000    /// # Arguments
10001    ///
10002    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10003    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10004        let query = self.selection.select("branches");
10005        query.execute(self.graphql_client.clone()).await
10006    }
10007    /// branches that match any of the given glob patterns.
10008    ///
10009    /// # Arguments
10010    ///
10011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10012    pub async fn branches_opts<'a>(
10013        &self,
10014        opts: GitRepositoryBranchesOpts<'a>,
10015    ) -> Result<Vec<String>, DaggerError> {
10016        let mut query = self.selection.select("branches");
10017        if let Some(patterns) = opts.patterns {
10018            query = query.arg("patterns", patterns);
10019        }
10020        query.execute(self.graphql_client.clone()).await
10021    }
10022    /// Returns details of a commit.
10023    ///
10024    /// # Arguments
10025    ///
10026    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
10027    pub fn commit(&self, id: impl Into<String>) -> GitRef {
10028        let mut query = self.selection.select("commit");
10029        query = query.arg("id", id.into());
10030        GitRef {
10031            proc: self.proc.clone(),
10032            selection: query,
10033            graphql_client: self.graphql_client.clone(),
10034        }
10035    }
10036    /// Returns details for HEAD.
10037    pub fn head(&self) -> GitRef {
10038        let query = self.selection.select("head");
10039        GitRef {
10040            proc: self.proc.clone(),
10041            selection: query,
10042            graphql_client: self.graphql_client.clone(),
10043        }
10044    }
10045    /// A unique identifier for this GitRepository.
10046    pub async fn id(&self) -> Result<Id, DaggerError> {
10047        let query = self.selection.select("id");
10048        query.execute(self.graphql_client.clone()).await
10049    }
10050    /// Returns details for the latest semver tag.
10051    pub fn latest_version(&self) -> GitRef {
10052        let query = self.selection.select("latestVersion");
10053        GitRef {
10054            proc: self.proc.clone(),
10055            selection: query,
10056            graphql_client: self.graphql_client.clone(),
10057        }
10058    }
10059    /// Returns details of a ref.
10060    ///
10061    /// # Arguments
10062    ///
10063    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10064    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10065        let mut query = self.selection.select("ref");
10066        query = query.arg("name", name.into());
10067        GitRef {
10068            proc: self.proc.clone(),
10069            selection: query,
10070            graphql_client: self.graphql_client.clone(),
10071        }
10072    }
10073    /// Returns details of a tag.
10074    ///
10075    /// # Arguments
10076    ///
10077    /// * `name` - Tag's name (e.g., "v0.3.9").
10078    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10079        let mut query = self.selection.select("tag");
10080        query = query.arg("name", name.into());
10081        GitRef {
10082            proc: self.proc.clone(),
10083            selection: query,
10084            graphql_client: self.graphql_client.clone(),
10085        }
10086    }
10087    /// tags that match any of the given glob patterns.
10088    ///
10089    /// # Arguments
10090    ///
10091    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10092    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10093        let query = self.selection.select("tags");
10094        query.execute(self.graphql_client.clone()).await
10095    }
10096    /// tags that match any of the given glob patterns.
10097    ///
10098    /// # Arguments
10099    ///
10100    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10101    pub async fn tags_opts<'a>(
10102        &self,
10103        opts: GitRepositoryTagsOpts<'a>,
10104    ) -> Result<Vec<String>, DaggerError> {
10105        let mut query = self.selection.select("tags");
10106        if let Some(patterns) = opts.patterns {
10107            query = query.arg("patterns", patterns);
10108        }
10109        query.execute(self.graphql_client.clone()).await
10110    }
10111    /// Returns the changeset of uncommitted changes in the git repository.
10112    pub fn uncommitted(&self) -> Changeset {
10113        let query = self.selection.select("uncommitted");
10114        Changeset {
10115            proc: self.proc.clone(),
10116            selection: query,
10117            graphql_client: self.graphql_client.clone(),
10118        }
10119    }
10120    /// The URL of the git repository.
10121    pub async fn url(&self) -> Result<String, DaggerError> {
10122        let query = self.selection.select("url");
10123        query.execute(self.graphql_client.clone()).await
10124    }
10125}
10126impl Node for GitRepository {
10127    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10128        let query = self.selection.select("id");
10129        let graphql_client = self.graphql_client.clone();
10130        async move { query.execute(graphql_client).await }
10131    }
10132}
10133#[derive(Clone)]
10134pub struct HttpState {
10135    pub proc: Option<Arc<DaggerSessionProc>>,
10136    pub selection: Selection,
10137    pub graphql_client: DynGraphQLClient,
10138}
10139impl IntoID<Id> for HttpState {
10140    fn into_id(
10141        self,
10142    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10143        Box::pin(async move { self.id().await })
10144    }
10145}
10146impl Loadable for HttpState {
10147    fn graphql_type() -> &'static str {
10148        "HTTPState"
10149    }
10150    fn from_query(
10151        proc: Option<Arc<DaggerSessionProc>>,
10152        selection: Selection,
10153        graphql_client: DynGraphQLClient,
10154    ) -> Self {
10155        Self {
10156            proc,
10157            selection,
10158            graphql_client,
10159        }
10160    }
10161}
10162impl HttpState {
10163    /// A unique identifier for this HTTPState.
10164    pub async fn id(&self) -> Result<Id, DaggerError> {
10165        let query = self.selection.select("id");
10166        query.execute(self.graphql_client.clone()).await
10167    }
10168}
10169impl Node for HttpState {
10170    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10171        let query = self.selection.select("id");
10172        let graphql_client = self.graphql_client.clone();
10173        async move { query.execute(graphql_client).await }
10174    }
10175}
10176#[derive(Clone)]
10177pub struct HealthcheckConfig {
10178    pub proc: Option<Arc<DaggerSessionProc>>,
10179    pub selection: Selection,
10180    pub graphql_client: DynGraphQLClient,
10181}
10182impl IntoID<Id> for HealthcheckConfig {
10183    fn into_id(
10184        self,
10185    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10186        Box::pin(async move { self.id().await })
10187    }
10188}
10189impl Loadable for HealthcheckConfig {
10190    fn graphql_type() -> &'static str {
10191        "HealthcheckConfig"
10192    }
10193    fn from_query(
10194        proc: Option<Arc<DaggerSessionProc>>,
10195        selection: Selection,
10196        graphql_client: DynGraphQLClient,
10197    ) -> Self {
10198        Self {
10199            proc,
10200            selection,
10201            graphql_client,
10202        }
10203    }
10204}
10205impl HealthcheckConfig {
10206    /// Healthcheck command arguments.
10207    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10208        let query = self.selection.select("args");
10209        query.execute(self.graphql_client.clone()).await
10210    }
10211    /// A unique identifier for this HealthcheckConfig.
10212    pub async fn id(&self) -> Result<Id, DaggerError> {
10213        let query = self.selection.select("id");
10214        query.execute(self.graphql_client.clone()).await
10215    }
10216    /// Interval between running healthcheck. Example:30s
10217    pub async fn interval(&self) -> Result<String, DaggerError> {
10218        let query = self.selection.select("interval");
10219        query.execute(self.graphql_client.clone()).await
10220    }
10221    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10222    pub async fn retries(&self) -> Result<isize, DaggerError> {
10223        let query = self.selection.select("retries");
10224        query.execute(self.graphql_client.clone()).await
10225    }
10226    /// Healthcheck command is a shell command.
10227    pub async fn shell(&self) -> Result<bool, DaggerError> {
10228        let query = self.selection.select("shell");
10229        query.execute(self.graphql_client.clone()).await
10230    }
10231    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10232    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10233        let query = self.selection.select("startInterval");
10234        query.execute(self.graphql_client.clone()).await
10235    }
10236    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10237    pub async fn start_period(&self) -> Result<String, DaggerError> {
10238        let query = self.selection.select("startPeriod");
10239        query.execute(self.graphql_client.clone()).await
10240    }
10241    /// Healthcheck timeout. Example:3s
10242    pub async fn timeout(&self) -> Result<String, DaggerError> {
10243        let query = self.selection.select("timeout");
10244        query.execute(self.graphql_client.clone()).await
10245    }
10246}
10247impl Node for HealthcheckConfig {
10248    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10249        let query = self.selection.select("id");
10250        let graphql_client = self.graphql_client.clone();
10251        async move { query.execute(graphql_client).await }
10252    }
10253}
10254#[derive(Clone)]
10255pub struct Host {
10256    pub proc: Option<Arc<DaggerSessionProc>>,
10257    pub selection: Selection,
10258    pub graphql_client: DynGraphQLClient,
10259}
10260#[derive(Builder, Debug, PartialEq)]
10261pub struct HostDirectoryOpts<'a> {
10262    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10263    #[builder(setter(into, strip_option), default)]
10264    pub exclude: Option<Vec<&'a str>>,
10265    /// Apply .gitignore filter rules inside the directory
10266    #[builder(setter(into, strip_option), default)]
10267    pub gitignore: Option<bool>,
10268    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10269    #[builder(setter(into, strip_option), default)]
10270    pub include: Option<Vec<&'a str>>,
10271    /// If true, the directory will always be reloaded from the host.
10272    #[builder(setter(into, strip_option), default)]
10273    pub no_cache: Option<bool>,
10274}
10275#[derive(Builder, Debug, PartialEq)]
10276pub struct HostFileOpts {
10277    /// If true, the file will always be reloaded from the host.
10278    #[builder(setter(into, strip_option), default)]
10279    pub no_cache: Option<bool>,
10280}
10281#[derive(Builder, Debug, PartialEq)]
10282pub struct HostFindUpOpts {
10283    #[builder(setter(into, strip_option), default)]
10284    pub no_cache: Option<bool>,
10285}
10286#[derive(Builder, Debug, PartialEq)]
10287pub struct HostServiceOpts<'a> {
10288    /// Upstream host to forward traffic to.
10289    #[builder(setter(into, strip_option), default)]
10290    pub host: Option<&'a str>,
10291}
10292#[derive(Builder, Debug, PartialEq)]
10293pub struct HostTunnelOpts {
10294    /// Map each service port to the same port on the host, as if the service were running natively.
10295    /// Note: enabling may result in port conflicts.
10296    #[builder(setter(into, strip_option), default)]
10297    pub native: Option<bool>,
10298    /// Configure explicit port forwarding rules for the tunnel.
10299    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10300    /// 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.
10301    /// If ports are given and native is true, the ports are additive.
10302    #[builder(setter(into, strip_option), default)]
10303    pub ports: Option<Vec<PortForward>>,
10304}
10305impl IntoID<Id> for Host {
10306    fn into_id(
10307        self,
10308    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10309        Box::pin(async move { self.id().await })
10310    }
10311}
10312impl Loadable for Host {
10313    fn graphql_type() -> &'static str {
10314        "Host"
10315    }
10316    fn from_query(
10317        proc: Option<Arc<DaggerSessionProc>>,
10318        selection: Selection,
10319        graphql_client: DynGraphQLClient,
10320    ) -> Self {
10321        Self {
10322            proc,
10323            selection,
10324            graphql_client,
10325        }
10326    }
10327}
10328impl Host {
10329    /// Accesses a container image on the host.
10330    ///
10331    /// # Arguments
10332    ///
10333    /// * `name` - Name of the image to access.
10334    pub fn container_image(&self, name: impl Into<String>) -> Container {
10335        let mut query = self.selection.select("containerImage");
10336        query = query.arg("name", name.into());
10337        Container {
10338            proc: self.proc.clone(),
10339            selection: query,
10340            graphql_client: self.graphql_client.clone(),
10341        }
10342    }
10343    /// Accesses a directory on the host.
10344    ///
10345    /// # Arguments
10346    ///
10347    /// * `path` - Location of the directory to access (e.g., ".").
10348    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10349    pub fn directory(&self, path: impl Into<String>) -> Directory {
10350        let mut query = self.selection.select("directory");
10351        query = query.arg("path", path.into());
10352        Directory {
10353            proc: self.proc.clone(),
10354            selection: query,
10355            graphql_client: self.graphql_client.clone(),
10356        }
10357    }
10358    /// Accesses a directory on the host.
10359    ///
10360    /// # Arguments
10361    ///
10362    /// * `path` - Location of the directory to access (e.g., ".").
10363    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10364    pub fn directory_opts<'a>(
10365        &self,
10366        path: impl Into<String>,
10367        opts: HostDirectoryOpts<'a>,
10368    ) -> Directory {
10369        let mut query = self.selection.select("directory");
10370        query = query.arg("path", path.into());
10371        if let Some(exclude) = opts.exclude {
10372            query = query.arg("exclude", exclude);
10373        }
10374        if let Some(include) = opts.include {
10375            query = query.arg("include", include);
10376        }
10377        if let Some(no_cache) = opts.no_cache {
10378            query = query.arg("noCache", no_cache);
10379        }
10380        if let Some(gitignore) = opts.gitignore {
10381            query = query.arg("gitignore", gitignore);
10382        }
10383        Directory {
10384            proc: self.proc.clone(),
10385            selection: query,
10386            graphql_client: self.graphql_client.clone(),
10387        }
10388    }
10389    /// Accesses a file on the host.
10390    ///
10391    /// # Arguments
10392    ///
10393    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10395    pub fn file(&self, path: impl Into<String>) -> File {
10396        let mut query = self.selection.select("file");
10397        query = query.arg("path", path.into());
10398        File {
10399            proc: self.proc.clone(),
10400            selection: query,
10401            graphql_client: self.graphql_client.clone(),
10402        }
10403    }
10404    /// Accesses a file on the host.
10405    ///
10406    /// # Arguments
10407    ///
10408    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10409    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10410    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10411        let mut query = self.selection.select("file");
10412        query = query.arg("path", path.into());
10413        if let Some(no_cache) = opts.no_cache {
10414            query = query.arg("noCache", no_cache);
10415        }
10416        File {
10417            proc: self.proc.clone(),
10418            selection: query,
10419            graphql_client: self.graphql_client.clone(),
10420        }
10421    }
10422    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10423    ///
10424    /// # Arguments
10425    ///
10426    /// * `name` - name of the file or directory to search for
10427    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10428    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10429        let mut query = self.selection.select("findUp");
10430        query = query.arg("name", name.into());
10431        query.execute(self.graphql_client.clone()).await
10432    }
10433    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10434    ///
10435    /// # Arguments
10436    ///
10437    /// * `name` - name of the file or directory to search for
10438    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10439    pub async fn find_up_opts(
10440        &self,
10441        name: impl Into<String>,
10442        opts: HostFindUpOpts,
10443    ) -> Result<String, DaggerError> {
10444        let mut query = self.selection.select("findUp");
10445        query = query.arg("name", name.into());
10446        if let Some(no_cache) = opts.no_cache {
10447            query = query.arg("noCache", no_cache);
10448        }
10449        query.execute(self.graphql_client.clone()).await
10450    }
10451    /// A unique identifier for this Host.
10452    pub async fn id(&self) -> Result<Id, DaggerError> {
10453        let query = self.selection.select("id");
10454        query.execute(self.graphql_client.clone()).await
10455    }
10456    /// Creates a service that forwards traffic to a specified address via the host.
10457    ///
10458    /// # Arguments
10459    ///
10460    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10461    ///
10462    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10463    ///
10464    /// An empty set of ports is not valid; an error will be returned.
10465    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10466    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10467        let mut query = self.selection.select("service");
10468        query = query.arg("ports", ports);
10469        Service {
10470            proc: self.proc.clone(),
10471            selection: query,
10472            graphql_client: self.graphql_client.clone(),
10473        }
10474    }
10475    /// Creates a service that forwards traffic to a specified address via the host.
10476    ///
10477    /// # Arguments
10478    ///
10479    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10480    ///
10481    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10482    ///
10483    /// An empty set of ports is not valid; an error will be returned.
10484    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10485    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10486        let mut query = self.selection.select("service");
10487        query = query.arg("ports", ports);
10488        if let Some(host) = opts.host {
10489            query = query.arg("host", host);
10490        }
10491        Service {
10492            proc: self.proc.clone(),
10493            selection: query,
10494            graphql_client: self.graphql_client.clone(),
10495        }
10496    }
10497    /// Creates a tunnel that forwards traffic from the host to a service.
10498    ///
10499    /// # Arguments
10500    ///
10501    /// * `service` - Service to send traffic from the tunnel.
10502    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10503    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10504        let mut query = self.selection.select("tunnel");
10505        query = query.arg_lazy(
10506            "service",
10507            Box::new(move || {
10508                let service = service.clone();
10509                Box::pin(async move { service.into_id().await.unwrap().quote() })
10510            }),
10511        );
10512        Service {
10513            proc: self.proc.clone(),
10514            selection: query,
10515            graphql_client: self.graphql_client.clone(),
10516        }
10517    }
10518    /// Creates a tunnel that forwards traffic from the host to a service.
10519    ///
10520    /// # Arguments
10521    ///
10522    /// * `service` - Service to send traffic from the tunnel.
10523    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10524    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10525        let mut query = self.selection.select("tunnel");
10526        query = query.arg_lazy(
10527            "service",
10528            Box::new(move || {
10529                let service = service.clone();
10530                Box::pin(async move { service.into_id().await.unwrap().quote() })
10531            }),
10532        );
10533        if let Some(native) = opts.native {
10534            query = query.arg("native", native);
10535        }
10536        if let Some(ports) = opts.ports {
10537            query = query.arg("ports", ports);
10538        }
10539        Service {
10540            proc: self.proc.clone(),
10541            selection: query,
10542            graphql_client: self.graphql_client.clone(),
10543        }
10544    }
10545    /// Accesses a Unix socket on the host.
10546    ///
10547    /// # Arguments
10548    ///
10549    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10550    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10551        let mut query = self.selection.select("unixSocket");
10552        query = query.arg("path", path.into());
10553        Socket {
10554            proc: self.proc.clone(),
10555            selection: query,
10556            graphql_client: self.graphql_client.clone(),
10557        }
10558    }
10559}
10560impl Node for Host {
10561    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10562        let query = self.selection.select("id");
10563        let graphql_client = self.graphql_client.clone();
10564        async move { query.execute(graphql_client).await }
10565    }
10566}
10567#[derive(Clone)]
10568pub struct InputTypeDef {
10569    pub proc: Option<Arc<DaggerSessionProc>>,
10570    pub selection: Selection,
10571    pub graphql_client: DynGraphQLClient,
10572}
10573impl IntoID<Id> for InputTypeDef {
10574    fn into_id(
10575        self,
10576    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10577        Box::pin(async move { self.id().await })
10578    }
10579}
10580impl Loadable for InputTypeDef {
10581    fn graphql_type() -> &'static str {
10582        "InputTypeDef"
10583    }
10584    fn from_query(
10585        proc: Option<Arc<DaggerSessionProc>>,
10586        selection: Selection,
10587        graphql_client: DynGraphQLClient,
10588    ) -> Self {
10589        Self {
10590            proc,
10591            selection,
10592            graphql_client,
10593        }
10594    }
10595}
10596impl InputTypeDef {
10597    /// Static fields defined on this input object, if any.
10598    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10599        let query = self.selection.select("fields");
10600        let query = query.select("id");
10601        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10602        Ok(ids
10603            .into_iter()
10604            .map(|id| FieldTypeDef {
10605                proc: self.proc.clone(),
10606                selection: crate::querybuilder::query()
10607                    .select("node")
10608                    .arg("id", &id.0)
10609                    .inline_fragment("FieldTypeDef"),
10610                graphql_client: self.graphql_client.clone(),
10611            })
10612            .collect())
10613    }
10614    /// A unique identifier for this InputTypeDef.
10615    pub async fn id(&self) -> Result<Id, DaggerError> {
10616        let query = self.selection.select("id");
10617        query.execute(self.graphql_client.clone()).await
10618    }
10619    /// The name of the input object.
10620    pub async fn name(&self) -> Result<String, DaggerError> {
10621        let query = self.selection.select("name");
10622        query.execute(self.graphql_client.clone()).await
10623    }
10624}
10625impl Node for InputTypeDef {
10626    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10627        let query = self.selection.select("id");
10628        let graphql_client = self.graphql_client.clone();
10629        async move { query.execute(graphql_client).await }
10630    }
10631}
10632#[derive(Clone)]
10633pub struct InterfaceTypeDef {
10634    pub proc: Option<Arc<DaggerSessionProc>>,
10635    pub selection: Selection,
10636    pub graphql_client: DynGraphQLClient,
10637}
10638impl IntoID<Id> for InterfaceTypeDef {
10639    fn into_id(
10640        self,
10641    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10642        Box::pin(async move { self.id().await })
10643    }
10644}
10645impl Loadable for InterfaceTypeDef {
10646    fn graphql_type() -> &'static str {
10647        "InterfaceTypeDef"
10648    }
10649    fn from_query(
10650        proc: Option<Arc<DaggerSessionProc>>,
10651        selection: Selection,
10652        graphql_client: DynGraphQLClient,
10653    ) -> Self {
10654        Self {
10655            proc,
10656            selection,
10657            graphql_client,
10658        }
10659    }
10660}
10661impl InterfaceTypeDef {
10662    /// The doc string for the interface, if any.
10663    pub async fn description(&self) -> Result<String, DaggerError> {
10664        let query = self.selection.select("description");
10665        query.execute(self.graphql_client.clone()).await
10666    }
10667    /// Functions defined on this interface, if any.
10668    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10669        let query = self.selection.select("functions");
10670        let query = query.select("id");
10671        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10672        Ok(ids
10673            .into_iter()
10674            .map(|id| Function {
10675                proc: self.proc.clone(),
10676                selection: crate::querybuilder::query()
10677                    .select("node")
10678                    .arg("id", &id.0)
10679                    .inline_fragment("Function"),
10680                graphql_client: self.graphql_client.clone(),
10681            })
10682            .collect())
10683    }
10684    /// A unique identifier for this InterfaceTypeDef.
10685    pub async fn id(&self) -> Result<Id, DaggerError> {
10686        let query = self.selection.select("id");
10687        query.execute(self.graphql_client.clone()).await
10688    }
10689    /// The name of the interface.
10690    pub async fn name(&self) -> Result<String, DaggerError> {
10691        let query = self.selection.select("name");
10692        query.execute(self.graphql_client.clone()).await
10693    }
10694    /// The location of this interface declaration.
10695    pub fn source_map(&self) -> SourceMap {
10696        let query = self.selection.select("sourceMap");
10697        SourceMap {
10698            proc: self.proc.clone(),
10699            selection: query,
10700            graphql_client: self.graphql_client.clone(),
10701        }
10702    }
10703    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10704    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10705        let query = self.selection.select("sourceModuleName");
10706        query.execute(self.graphql_client.clone()).await
10707    }
10708}
10709impl Node for InterfaceTypeDef {
10710    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10711        let query = self.selection.select("id");
10712        let graphql_client = self.graphql_client.clone();
10713        async move { query.execute(graphql_client).await }
10714    }
10715}
10716#[derive(Clone)]
10717pub struct JsonValue {
10718    pub proc: Option<Arc<DaggerSessionProc>>,
10719    pub selection: Selection,
10720    pub graphql_client: DynGraphQLClient,
10721}
10722#[derive(Builder, Debug, PartialEq)]
10723pub struct JsonValueContentsOpts<'a> {
10724    /// Optional line prefix
10725    #[builder(setter(into, strip_option), default)]
10726    pub indent: Option<&'a str>,
10727    /// Pretty-print
10728    #[builder(setter(into, strip_option), default)]
10729    pub pretty: Option<bool>,
10730}
10731impl IntoID<Id> for JsonValue {
10732    fn into_id(
10733        self,
10734    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10735        Box::pin(async move { self.id().await })
10736    }
10737}
10738impl Loadable for JsonValue {
10739    fn graphql_type() -> &'static str {
10740        "JSONValue"
10741    }
10742    fn from_query(
10743        proc: Option<Arc<DaggerSessionProc>>,
10744        selection: Selection,
10745        graphql_client: DynGraphQLClient,
10746    ) -> Self {
10747        Self {
10748            proc,
10749            selection,
10750            graphql_client,
10751        }
10752    }
10753}
10754impl JsonValue {
10755    /// Decode an array from json
10756    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10757        let query = self.selection.select("asArray");
10758        let query = query.select("id");
10759        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10760        Ok(ids
10761            .into_iter()
10762            .map(|id| JsonValue {
10763                proc: self.proc.clone(),
10764                selection: crate::querybuilder::query()
10765                    .select("node")
10766                    .arg("id", &id.0)
10767                    .inline_fragment("JSONValue"),
10768                graphql_client: self.graphql_client.clone(),
10769            })
10770            .collect())
10771    }
10772    /// Decode a boolean from json
10773    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10774        let query = self.selection.select("asBoolean");
10775        query.execute(self.graphql_client.clone()).await
10776    }
10777    /// Decode an integer from json
10778    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10779        let query = self.selection.select("asInteger");
10780        query.execute(self.graphql_client.clone()).await
10781    }
10782    /// Decode a string from json
10783    pub async fn as_string(&self) -> Result<String, DaggerError> {
10784        let query = self.selection.select("asString");
10785        query.execute(self.graphql_client.clone()).await
10786    }
10787    /// Return the value encoded as json
10788    ///
10789    /// # Arguments
10790    ///
10791    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10792    pub async fn contents(&self) -> Result<Json, DaggerError> {
10793        let query = self.selection.select("contents");
10794        query.execute(self.graphql_client.clone()).await
10795    }
10796    /// Return the value encoded as json
10797    ///
10798    /// # Arguments
10799    ///
10800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10801    pub async fn contents_opts<'a>(
10802        &self,
10803        opts: JsonValueContentsOpts<'a>,
10804    ) -> Result<Json, DaggerError> {
10805        let mut query = self.selection.select("contents");
10806        if let Some(pretty) = opts.pretty {
10807            query = query.arg("pretty", pretty);
10808        }
10809        if let Some(indent) = opts.indent {
10810            query = query.arg("indent", indent);
10811        }
10812        query.execute(self.graphql_client.clone()).await
10813    }
10814    /// Lookup the field at the given path, and return its value.
10815    ///
10816    /// # Arguments
10817    ///
10818    /// * `path` - Path of the field to lookup, encoded as an array of field names
10819    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10820        let mut query = self.selection.select("field");
10821        query = query.arg(
10822            "path",
10823            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10824        );
10825        JsonValue {
10826            proc: self.proc.clone(),
10827            selection: query,
10828            graphql_client: self.graphql_client.clone(),
10829        }
10830    }
10831    /// List fields of the encoded object
10832    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10833        let query = self.selection.select("fields");
10834        query.execute(self.graphql_client.clone()).await
10835    }
10836    /// A unique identifier for this JSONValue.
10837    pub async fn id(&self) -> Result<Id, DaggerError> {
10838        let query = self.selection.select("id");
10839        query.execute(self.graphql_client.clone()).await
10840    }
10841    /// Encode a boolean to json
10842    ///
10843    /// # Arguments
10844    ///
10845    /// * `value` - New boolean value
10846    pub fn new_boolean(&self, value: bool) -> JsonValue {
10847        let mut query = self.selection.select("newBoolean");
10848        query = query.arg("value", value);
10849        JsonValue {
10850            proc: self.proc.clone(),
10851            selection: query,
10852            graphql_client: self.graphql_client.clone(),
10853        }
10854    }
10855    /// Encode an integer to json
10856    ///
10857    /// # Arguments
10858    ///
10859    /// * `value` - New integer value
10860    pub fn new_integer(&self, value: isize) -> JsonValue {
10861        let mut query = self.selection.select("newInteger");
10862        query = query.arg("value", value);
10863        JsonValue {
10864            proc: self.proc.clone(),
10865            selection: query,
10866            graphql_client: self.graphql_client.clone(),
10867        }
10868    }
10869    /// Encode a string to json
10870    ///
10871    /// # Arguments
10872    ///
10873    /// * `value` - New string value
10874    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10875        let mut query = self.selection.select("newString");
10876        query = query.arg("value", value.into());
10877        JsonValue {
10878            proc: self.proc.clone(),
10879            selection: query,
10880            graphql_client: self.graphql_client.clone(),
10881        }
10882    }
10883    /// Return a new json value, decoded from the given content
10884    ///
10885    /// # Arguments
10886    ///
10887    /// * `contents` - New JSON-encoded contents
10888    pub fn with_contents(&self, contents: Json) -> JsonValue {
10889        let mut query = self.selection.select("withContents");
10890        query = query.arg("contents", contents);
10891        JsonValue {
10892            proc: self.proc.clone(),
10893            selection: query,
10894            graphql_client: self.graphql_client.clone(),
10895        }
10896    }
10897    /// Set a new field at the given path
10898    ///
10899    /// # Arguments
10900    ///
10901    /// * `path` - Path of the field to set, encoded as an array of field names
10902    /// * `value` - The new value of the field
10903    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10904        let mut query = self.selection.select("withField");
10905        query = query.arg(
10906            "path",
10907            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10908        );
10909        query = query.arg_lazy(
10910            "value",
10911            Box::new(move || {
10912                let value = value.clone();
10913                Box::pin(async move { value.into_id().await.unwrap().quote() })
10914            }),
10915        );
10916        JsonValue {
10917            proc: self.proc.clone(),
10918            selection: query,
10919            graphql_client: self.graphql_client.clone(),
10920        }
10921    }
10922}
10923impl Node for JsonValue {
10924    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10925        let query = self.selection.select("id");
10926        let graphql_client = self.graphql_client.clone();
10927        async move { query.execute(graphql_client).await }
10928    }
10929}
10930#[derive(Clone)]
10931pub struct Llm {
10932    pub proc: Option<Arc<DaggerSessionProc>>,
10933    pub selection: Selection,
10934    pub graphql_client: DynGraphQLClient,
10935}
10936impl IntoID<Id> for Llm {
10937    fn into_id(
10938        self,
10939    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10940        Box::pin(async move { self.id().await })
10941    }
10942}
10943impl Loadable for Llm {
10944    fn graphql_type() -> &'static str {
10945        "LLM"
10946    }
10947    fn from_query(
10948        proc: Option<Arc<DaggerSessionProc>>,
10949        selection: Selection,
10950        graphql_client: DynGraphQLClient,
10951    ) -> Self {
10952        Self {
10953            proc,
10954            selection,
10955            graphql_client,
10956        }
10957    }
10958}
10959impl Llm {
10960    /// create a branch in the LLM's history
10961    pub fn attempt(&self, number: isize) -> Llm {
10962        let mut query = self.selection.select("attempt");
10963        query = query.arg("number", number);
10964        Llm {
10965            proc: self.proc.clone(),
10966            selection: query,
10967            graphql_client: self.graphql_client.clone(),
10968        }
10969    }
10970    /// returns the type of the current state
10971    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10972        let mut query = self.selection.select("bindResult");
10973        query = query.arg("name", name.into());
10974        Binding {
10975            proc: self.proc.clone(),
10976            selection: query,
10977            graphql_client: self.graphql_client.clone(),
10978        }
10979    }
10980    /// return the LLM's current environment
10981    pub fn env(&self) -> Env {
10982        let query = self.selection.select("env");
10983        Env {
10984            proc: self.proc.clone(),
10985            selection: query,
10986            graphql_client: self.graphql_client.clone(),
10987        }
10988    }
10989    /// Indicates whether there are any queued prompts or tool results to send to the model
10990    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10991        let query = self.selection.select("hasPrompt");
10992        query.execute(self.graphql_client.clone()).await
10993    }
10994    /// return the llm message history
10995    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10996        let query = self.selection.select("history");
10997        query.execute(self.graphql_client.clone()).await
10998    }
10999    /// return the raw llm message history as json
11000    pub async fn history_json(&self) -> Result<Json, DaggerError> {
11001        let query = self.selection.select("historyJSON");
11002        query.execute(self.graphql_client.clone()).await
11003    }
11004    /// A unique identifier for this LLM.
11005    pub async fn id(&self) -> Result<Id, DaggerError> {
11006        let query = self.selection.select("id");
11007        query.execute(self.graphql_client.clone()).await
11008    }
11009    /// return the last llm reply from the history
11010    pub async fn last_reply(&self) -> Result<String, DaggerError> {
11011        let query = self.selection.select("lastReply");
11012        query.execute(self.graphql_client.clone()).await
11013    }
11014    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
11015    pub fn r#loop(&self) -> Llm {
11016        let query = self.selection.select("loop");
11017        Llm {
11018            proc: self.proc.clone(),
11019            selection: query,
11020            graphql_client: self.graphql_client.clone(),
11021        }
11022    }
11023    /// return the model used by the llm
11024    pub async fn model(&self) -> Result<String, DaggerError> {
11025        let query = self.selection.select("model");
11026        query.execute(self.graphql_client.clone()).await
11027    }
11028    /// return the provider used by the llm
11029    pub async fn provider(&self) -> Result<String, DaggerError> {
11030        let query = self.selection.select("provider");
11031        query.execute(self.graphql_client.clone()).await
11032    }
11033    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
11034    pub async fn step(&self) -> Result<Llm, DaggerError> {
11035        let query = self.selection.select("step");
11036        let id: Id = query.execute(self.graphql_client.clone()).await?;
11037        Ok(Llm {
11038            proc: self.proc.clone(),
11039            selection: query
11040                .root()
11041                .select("node")
11042                .arg("id", &id.0)
11043                .inline_fragment("LLM"),
11044            graphql_client: self.graphql_client.clone(),
11045        })
11046    }
11047    /// synchronize LLM state
11048    pub async fn sync(&self) -> Result<Llm, DaggerError> {
11049        let query = self.selection.select("sync");
11050        let id: Id = query.execute(self.graphql_client.clone()).await?;
11051        Ok(Llm {
11052            proc: self.proc.clone(),
11053            selection: query
11054                .root()
11055                .select("node")
11056                .arg("id", &id.0)
11057                .inline_fragment("LLM"),
11058            graphql_client: self.graphql_client.clone(),
11059        })
11060    }
11061    /// returns the token usage of the current state
11062    pub fn token_usage(&self) -> LlmTokenUsage {
11063        let query = self.selection.select("tokenUsage");
11064        LlmTokenUsage {
11065            proc: self.proc.clone(),
11066            selection: query,
11067            graphql_client: self.graphql_client.clone(),
11068        }
11069    }
11070    /// print documentation for available tools
11071    pub async fn tools(&self) -> Result<String, DaggerError> {
11072        let query = self.selection.select("tools");
11073        query.execute(self.graphql_client.clone()).await
11074    }
11075    /// Return a new LLM with the specified function no longer exposed as a tool
11076    ///
11077    /// # Arguments
11078    ///
11079    /// * `type_name` - The type name whose function will be blocked
11080    /// * `function` - The function to block
11081    ///
11082    /// Will be converted to lowerCamelCase if necessary.
11083    pub fn with_blocked_function(
11084        &self,
11085        type_name: impl Into<String>,
11086        function: impl Into<String>,
11087    ) -> Llm {
11088        let mut query = self.selection.select("withBlockedFunction");
11089        query = query.arg("typeName", type_name.into());
11090        query = query.arg("function", function.into());
11091        Llm {
11092            proc: self.proc.clone(),
11093            selection: query,
11094            graphql_client: self.graphql_client.clone(),
11095        }
11096    }
11097    /// allow the LLM to interact with an environment via MCP
11098    pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11099        let mut query = self.selection.select("withEnv");
11100        query = query.arg_lazy(
11101            "env",
11102            Box::new(move || {
11103                let env = env.clone();
11104                Box::pin(async move { env.into_id().await.unwrap().quote() })
11105            }),
11106        );
11107        Llm {
11108            proc: self.proc.clone(),
11109            selection: query,
11110            graphql_client: self.graphql_client.clone(),
11111        }
11112    }
11113    /// Add an external MCP server to the LLM
11114    ///
11115    /// # Arguments
11116    ///
11117    /// * `name` - The name of the MCP server
11118    /// * `service` - The MCP service to run and communicate with over stdio
11119    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11120        let mut query = self.selection.select("withMCPServer");
11121        query = query.arg("name", name.into());
11122        query = query.arg_lazy(
11123            "service",
11124            Box::new(move || {
11125                let service = service.clone();
11126                Box::pin(async move { service.into_id().await.unwrap().quote() })
11127            }),
11128        );
11129        Llm {
11130            proc: self.proc.clone(),
11131            selection: query,
11132            graphql_client: self.graphql_client.clone(),
11133        }
11134    }
11135    /// swap out the llm model
11136    ///
11137    /// # Arguments
11138    ///
11139    /// * `model` - The model to use
11140    pub fn with_model(&self, model: impl Into<String>) -> Llm {
11141        let mut query = self.selection.select("withModel");
11142        query = query.arg("model", model.into());
11143        Llm {
11144            proc: self.proc.clone(),
11145            selection: query,
11146            graphql_client: self.graphql_client.clone(),
11147        }
11148    }
11149    /// append a prompt to the llm context
11150    ///
11151    /// # Arguments
11152    ///
11153    /// * `prompt` - The prompt to send
11154    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11155        let mut query = self.selection.select("withPrompt");
11156        query = query.arg("prompt", prompt.into());
11157        Llm {
11158            proc: self.proc.clone(),
11159            selection: query,
11160            graphql_client: self.graphql_client.clone(),
11161        }
11162    }
11163    /// append the contents of a file to the llm context
11164    ///
11165    /// # Arguments
11166    ///
11167    /// * `file` - The file to read the prompt from
11168    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11169        let mut query = self.selection.select("withPromptFile");
11170        query = query.arg_lazy(
11171            "file",
11172            Box::new(move || {
11173                let file = file.clone();
11174                Box::pin(async move { file.into_id().await.unwrap().quote() })
11175            }),
11176        );
11177        Llm {
11178            proc: self.proc.clone(),
11179            selection: query,
11180            graphql_client: self.graphql_client.clone(),
11181        }
11182    }
11183    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
11184    pub fn with_static_tools(&self) -> Llm {
11185        let query = self.selection.select("withStaticTools");
11186        Llm {
11187            proc: self.proc.clone(),
11188            selection: query,
11189            graphql_client: self.graphql_client.clone(),
11190        }
11191    }
11192    /// Add a system prompt to the LLM's environment
11193    ///
11194    /// # Arguments
11195    ///
11196    /// * `prompt` - The system prompt to send
11197    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11198        let mut query = self.selection.select("withSystemPrompt");
11199        query = query.arg("prompt", prompt.into());
11200        Llm {
11201            proc: self.proc.clone(),
11202            selection: query,
11203            graphql_client: self.graphql_client.clone(),
11204        }
11205    }
11206    /// Disable the default system prompt
11207    pub fn without_default_system_prompt(&self) -> Llm {
11208        let query = self.selection.select("withoutDefaultSystemPrompt");
11209        Llm {
11210            proc: self.proc.clone(),
11211            selection: query,
11212            graphql_client: self.graphql_client.clone(),
11213        }
11214    }
11215    /// Clear the message history, leaving only the system prompts
11216    pub fn without_message_history(&self) -> Llm {
11217        let query = self.selection.select("withoutMessageHistory");
11218        Llm {
11219            proc: self.proc.clone(),
11220            selection: query,
11221            graphql_client: self.graphql_client.clone(),
11222        }
11223    }
11224    /// Clear the system prompts, leaving only the default system prompt
11225    pub fn without_system_prompts(&self) -> Llm {
11226        let query = self.selection.select("withoutSystemPrompts");
11227        Llm {
11228            proc: self.proc.clone(),
11229            selection: query,
11230            graphql_client: self.graphql_client.clone(),
11231        }
11232    }
11233}
11234impl Node for Llm {
11235    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11236        let query = self.selection.select("id");
11237        let graphql_client = self.graphql_client.clone();
11238        async move { query.execute(graphql_client).await }
11239    }
11240}
11241impl Syncer for Llm {
11242    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11243        let query = self.selection.select("id");
11244        let graphql_client = self.graphql_client.clone();
11245        async move { query.execute(graphql_client).await }
11246    }
11247    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11248        let query = self.selection.select("sync");
11249        let graphql_client = self.graphql_client.clone();
11250        async move { query.execute(graphql_client).await }
11251    }
11252}
11253#[derive(Clone)]
11254pub struct LlmTokenUsage {
11255    pub proc: Option<Arc<DaggerSessionProc>>,
11256    pub selection: Selection,
11257    pub graphql_client: DynGraphQLClient,
11258}
11259impl IntoID<Id> for LlmTokenUsage {
11260    fn into_id(
11261        self,
11262    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11263        Box::pin(async move { self.id().await })
11264    }
11265}
11266impl Loadable for LlmTokenUsage {
11267    fn graphql_type() -> &'static str {
11268        "LLMTokenUsage"
11269    }
11270    fn from_query(
11271        proc: Option<Arc<DaggerSessionProc>>,
11272        selection: Selection,
11273        graphql_client: DynGraphQLClient,
11274    ) -> Self {
11275        Self {
11276            proc,
11277            selection,
11278            graphql_client,
11279        }
11280    }
11281}
11282impl LlmTokenUsage {
11283    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11284        let query = self.selection.select("cachedTokenReads");
11285        query.execute(self.graphql_client.clone()).await
11286    }
11287    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11288        let query = self.selection.select("cachedTokenWrites");
11289        query.execute(self.graphql_client.clone()).await
11290    }
11291    /// A unique identifier for this LLMTokenUsage.
11292    pub async fn id(&self) -> Result<Id, DaggerError> {
11293        let query = self.selection.select("id");
11294        query.execute(self.graphql_client.clone()).await
11295    }
11296    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11297        let query = self.selection.select("inputTokens");
11298        query.execute(self.graphql_client.clone()).await
11299    }
11300    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11301        let query = self.selection.select("outputTokens");
11302        query.execute(self.graphql_client.clone()).await
11303    }
11304    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11305        let query = self.selection.select("totalTokens");
11306        query.execute(self.graphql_client.clone()).await
11307    }
11308}
11309impl Node for LlmTokenUsage {
11310    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11311        let query = self.selection.select("id");
11312        let graphql_client = self.graphql_client.clone();
11313        async move { query.execute(graphql_client).await }
11314    }
11315}
11316#[derive(Clone)]
11317pub struct Label {
11318    pub proc: Option<Arc<DaggerSessionProc>>,
11319    pub selection: Selection,
11320    pub graphql_client: DynGraphQLClient,
11321}
11322impl IntoID<Id> for Label {
11323    fn into_id(
11324        self,
11325    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11326        Box::pin(async move { self.id().await })
11327    }
11328}
11329impl Loadable for Label {
11330    fn graphql_type() -> &'static str {
11331        "Label"
11332    }
11333    fn from_query(
11334        proc: Option<Arc<DaggerSessionProc>>,
11335        selection: Selection,
11336        graphql_client: DynGraphQLClient,
11337    ) -> Self {
11338        Self {
11339            proc,
11340            selection,
11341            graphql_client,
11342        }
11343    }
11344}
11345impl Label {
11346    /// A unique identifier for this Label.
11347    pub async fn id(&self) -> Result<Id, DaggerError> {
11348        let query = self.selection.select("id");
11349        query.execute(self.graphql_client.clone()).await
11350    }
11351    /// The label name.
11352    pub async fn name(&self) -> Result<String, DaggerError> {
11353        let query = self.selection.select("name");
11354        query.execute(self.graphql_client.clone()).await
11355    }
11356    /// The label value.
11357    pub async fn value(&self) -> Result<String, DaggerError> {
11358        let query = self.selection.select("value");
11359        query.execute(self.graphql_client.clone()).await
11360    }
11361}
11362impl Node for Label {
11363    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11364        let query = self.selection.select("id");
11365        let graphql_client = self.graphql_client.clone();
11366        async move { query.execute(graphql_client).await }
11367    }
11368}
11369#[derive(Clone)]
11370pub struct ListTypeDef {
11371    pub proc: Option<Arc<DaggerSessionProc>>,
11372    pub selection: Selection,
11373    pub graphql_client: DynGraphQLClient,
11374}
11375impl IntoID<Id> for ListTypeDef {
11376    fn into_id(
11377        self,
11378    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11379        Box::pin(async move { self.id().await })
11380    }
11381}
11382impl Loadable for ListTypeDef {
11383    fn graphql_type() -> &'static str {
11384        "ListTypeDef"
11385    }
11386    fn from_query(
11387        proc: Option<Arc<DaggerSessionProc>>,
11388        selection: Selection,
11389        graphql_client: DynGraphQLClient,
11390    ) -> Self {
11391        Self {
11392            proc,
11393            selection,
11394            graphql_client,
11395        }
11396    }
11397}
11398impl ListTypeDef {
11399    /// The type of the elements in the list.
11400    pub fn element_type_def(&self) -> TypeDef {
11401        let query = self.selection.select("elementTypeDef");
11402        TypeDef {
11403            proc: self.proc.clone(),
11404            selection: query,
11405            graphql_client: self.graphql_client.clone(),
11406        }
11407    }
11408    /// A unique identifier for this ListTypeDef.
11409    pub async fn id(&self) -> Result<Id, DaggerError> {
11410        let query = self.selection.select("id");
11411        query.execute(self.graphql_client.clone()).await
11412    }
11413}
11414impl Node for ListTypeDef {
11415    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11416        let query = self.selection.select("id");
11417        let graphql_client = self.graphql_client.clone();
11418        async move { query.execute(graphql_client).await }
11419    }
11420}
11421#[derive(Clone)]
11422pub struct Module {
11423    pub proc: Option<Arc<DaggerSessionProc>>,
11424    pub selection: Selection,
11425    pub graphql_client: DynGraphQLClient,
11426}
11427#[derive(Builder, Debug, PartialEq)]
11428pub struct ModuleChecksOpts<'a> {
11429    /// Only include checks matching the specified patterns
11430    #[builder(setter(into, strip_option), default)]
11431    pub include: Option<Vec<&'a str>>,
11432    /// When true, only return annotated check functions; exclude generate-as-checks
11433    #[builder(setter(into, strip_option), default)]
11434    pub no_generate: Option<bool>,
11435}
11436#[derive(Builder, Debug, PartialEq)]
11437pub struct ModuleGeneratorsOpts<'a> {
11438    /// Only include generators matching the specified patterns
11439    #[builder(setter(into, strip_option), default)]
11440    pub include: Option<Vec<&'a str>>,
11441}
11442#[derive(Builder, Debug, PartialEq)]
11443pub struct ModuleServeOpts {
11444    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
11445    #[builder(setter(into, strip_option), default)]
11446    pub entrypoint: Option<bool>,
11447    /// Expose the dependencies of this module to the client
11448    #[builder(setter(into, strip_option), default)]
11449    pub include_dependencies: Option<bool>,
11450}
11451#[derive(Builder, Debug, PartialEq)]
11452pub struct ModuleServicesOpts<'a> {
11453    /// Only include services matching the specified patterns
11454    #[builder(setter(into, strip_option), default)]
11455    pub include: Option<Vec<&'a str>>,
11456}
11457impl IntoID<Id> for Module {
11458    fn into_id(
11459        self,
11460    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11461        Box::pin(async move { self.id().await })
11462    }
11463}
11464impl Loadable for Module {
11465    fn graphql_type() -> &'static str {
11466        "Module"
11467    }
11468    fn from_query(
11469        proc: Option<Arc<DaggerSessionProc>>,
11470        selection: Selection,
11471        graphql_client: DynGraphQLClient,
11472    ) -> Self {
11473        Self {
11474            proc,
11475            selection,
11476            graphql_client,
11477        }
11478    }
11479}
11480impl Module {
11481    /// Return the check defined by the module with the given name. Must match to exactly one check.
11482    ///
11483    /// # Arguments
11484    ///
11485    /// * `name` - The name of the check to retrieve
11486    pub fn check(&self, name: impl Into<String>) -> Check {
11487        let mut query = self.selection.select("check");
11488        query = query.arg("name", name.into());
11489        Check {
11490            proc: self.proc.clone(),
11491            selection: query,
11492            graphql_client: self.graphql_client.clone(),
11493        }
11494    }
11495    /// Return all checks defined by the module
11496    ///
11497    /// # Arguments
11498    ///
11499    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11500    pub fn checks(&self) -> CheckGroup {
11501        let query = self.selection.select("checks");
11502        CheckGroup {
11503            proc: self.proc.clone(),
11504            selection: query,
11505            graphql_client: self.graphql_client.clone(),
11506        }
11507    }
11508    /// Return all checks defined by the module
11509    ///
11510    /// # Arguments
11511    ///
11512    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11513    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11514        let mut query = self.selection.select("checks");
11515        if let Some(include) = opts.include {
11516            query = query.arg("include", include);
11517        }
11518        if let Some(no_generate) = opts.no_generate {
11519            query = query.arg("noGenerate", no_generate);
11520        }
11521        CheckGroup {
11522            proc: self.proc.clone(),
11523            selection: query,
11524            graphql_client: self.graphql_client.clone(),
11525        }
11526    }
11527    /// The dependencies of the module.
11528    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11529        let query = self.selection.select("dependencies");
11530        let query = query.select("id");
11531        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11532        Ok(ids
11533            .into_iter()
11534            .map(|id| Module {
11535                proc: self.proc.clone(),
11536                selection: crate::querybuilder::query()
11537                    .select("node")
11538                    .arg("id", &id.0)
11539                    .inline_fragment("Module"),
11540                graphql_client: self.graphql_client.clone(),
11541            })
11542            .collect())
11543    }
11544    /// The doc string of the module, if any
11545    pub async fn description(&self) -> Result<String, DaggerError> {
11546        let query = self.selection.select("description");
11547        query.execute(self.graphql_client.clone()).await
11548    }
11549    /// Enumerations served by this module.
11550    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11551        let query = self.selection.select("enums");
11552        let query = query.select("id");
11553        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11554        Ok(ids
11555            .into_iter()
11556            .map(|id| TypeDef {
11557                proc: self.proc.clone(),
11558                selection: crate::querybuilder::query()
11559                    .select("node")
11560                    .arg("id", &id.0)
11561                    .inline_fragment("TypeDef"),
11562                graphql_client: self.graphql_client.clone(),
11563            })
11564            .collect())
11565    }
11566    /// The generated files and directories made on top of the module source's context directory.
11567    pub fn generated_context_directory(&self) -> Directory {
11568        let query = self.selection.select("generatedContextDirectory");
11569        Directory {
11570            proc: self.proc.clone(),
11571            selection: query,
11572            graphql_client: self.graphql_client.clone(),
11573        }
11574    }
11575    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11576    ///
11577    /// # Arguments
11578    ///
11579    /// * `name` - The name of the generator to retrieve
11580    pub fn generator(&self, name: impl Into<String>) -> Generator {
11581        let mut query = self.selection.select("generator");
11582        query = query.arg("name", name.into());
11583        Generator {
11584            proc: self.proc.clone(),
11585            selection: query,
11586            graphql_client: self.graphql_client.clone(),
11587        }
11588    }
11589    /// Return all generators defined by the module
11590    ///
11591    /// # Arguments
11592    ///
11593    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11594    pub fn generators(&self) -> GeneratorGroup {
11595        let query = self.selection.select("generators");
11596        GeneratorGroup {
11597            proc: self.proc.clone(),
11598            selection: query,
11599            graphql_client: self.graphql_client.clone(),
11600        }
11601    }
11602    /// Return all generators defined by the module
11603    ///
11604    /// # Arguments
11605    ///
11606    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11607    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11608        let mut query = self.selection.select("generators");
11609        if let Some(include) = opts.include {
11610            query = query.arg("include", include);
11611        }
11612        GeneratorGroup {
11613            proc: self.proc.clone(),
11614            selection: query,
11615            graphql_client: self.graphql_client.clone(),
11616        }
11617    }
11618    /// A unique identifier for this Module.
11619    pub async fn id(&self) -> Result<Id, DaggerError> {
11620        let query = self.selection.select("id");
11621        query.execute(self.graphql_client.clone()).await
11622    }
11623    /// Interfaces served by this module.
11624    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11625        let query = self.selection.select("interfaces");
11626        let query = query.select("id");
11627        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11628        Ok(ids
11629            .into_iter()
11630            .map(|id| TypeDef {
11631                proc: self.proc.clone(),
11632                selection: crate::querybuilder::query()
11633                    .select("node")
11634                    .arg("id", &id.0)
11635                    .inline_fragment("TypeDef"),
11636                graphql_client: self.graphql_client.clone(),
11637            })
11638            .collect())
11639    }
11640    /// The introspection schema JSON file for this module.
11641    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11642    /// Note: this is in the context of a module, so some core types may be hidden.
11643    pub fn introspection_schema_json(&self) -> File {
11644        let query = self.selection.select("introspectionSchemaJSON");
11645        File {
11646            proc: self.proc.clone(),
11647            selection: query,
11648            graphql_client: self.graphql_client.clone(),
11649        }
11650    }
11651    /// The name of the module
11652    pub async fn name(&self) -> Result<String, DaggerError> {
11653        let query = self.selection.select("name");
11654        query.execute(self.graphql_client.clone()).await
11655    }
11656    /// Objects served by this module.
11657    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11658        let query = self.selection.select("objects");
11659        let query = query.select("id");
11660        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11661        Ok(ids
11662            .into_iter()
11663            .map(|id| TypeDef {
11664                proc: self.proc.clone(),
11665                selection: crate::querybuilder::query()
11666                    .select("node")
11667                    .arg("id", &id.0)
11668                    .inline_fragment("TypeDef"),
11669                graphql_client: self.graphql_client.clone(),
11670            })
11671            .collect())
11672    }
11673    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11674    pub fn runtime(&self) -> Container {
11675        let query = self.selection.select("runtime");
11676        Container {
11677            proc: self.proc.clone(),
11678            selection: query,
11679            graphql_client: self.graphql_client.clone(),
11680        }
11681    }
11682    /// The SDK config used by this module.
11683    pub fn sdk(&self) -> SdkConfig {
11684        let query = self.selection.select("sdk");
11685        SdkConfig {
11686            proc: self.proc.clone(),
11687            selection: query,
11688            graphql_client: self.graphql_client.clone(),
11689        }
11690    }
11691    /// Serve a module's API in the current session.
11692    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11693    ///
11694    /// # Arguments
11695    ///
11696    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11697    pub async fn serve(&self) -> Result<Void, DaggerError> {
11698        let query = self.selection.select("serve");
11699        query.execute(self.graphql_client.clone()).await
11700    }
11701    /// Serve a module's API in the current session.
11702    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11703    ///
11704    /// # Arguments
11705    ///
11706    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11707    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11708        let mut query = self.selection.select("serve");
11709        if let Some(include_dependencies) = opts.include_dependencies {
11710            query = query.arg("includeDependencies", include_dependencies);
11711        }
11712        if let Some(entrypoint) = opts.entrypoint {
11713            query = query.arg("entrypoint", entrypoint);
11714        }
11715        query.execute(self.graphql_client.clone()).await
11716    }
11717    /// Return all services defined by the module
11718    ///
11719    /// # Arguments
11720    ///
11721    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11722    pub fn services(&self) -> UpGroup {
11723        let query = self.selection.select("services");
11724        UpGroup {
11725            proc: self.proc.clone(),
11726            selection: query,
11727            graphql_client: self.graphql_client.clone(),
11728        }
11729    }
11730    /// Return all services defined by the module
11731    ///
11732    /// # Arguments
11733    ///
11734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11735    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11736        let mut query = self.selection.select("services");
11737        if let Some(include) = opts.include {
11738            query = query.arg("include", include);
11739        }
11740        UpGroup {
11741            proc: self.proc.clone(),
11742            selection: query,
11743            graphql_client: self.graphql_client.clone(),
11744        }
11745    }
11746    /// The source for the module.
11747    pub fn source(&self) -> ModuleSource {
11748        let query = self.selection.select("source");
11749        ModuleSource {
11750            proc: self.proc.clone(),
11751            selection: query,
11752            graphql_client: self.graphql_client.clone(),
11753        }
11754    }
11755    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11756    pub async fn sync(&self) -> Result<Module, DaggerError> {
11757        let query = self.selection.select("sync");
11758        let id: Id = query.execute(self.graphql_client.clone()).await?;
11759        Ok(Module {
11760            proc: self.proc.clone(),
11761            selection: query
11762                .root()
11763                .select("node")
11764                .arg("id", &id.0)
11765                .inline_fragment("Module"),
11766            graphql_client: self.graphql_client.clone(),
11767        })
11768    }
11769    /// User-defined default values, loaded from local .env files.
11770    pub fn user_defaults(&self) -> EnvFile {
11771        let query = self.selection.select("userDefaults");
11772        EnvFile {
11773            proc: self.proc.clone(),
11774            selection: query,
11775            graphql_client: self.graphql_client.clone(),
11776        }
11777    }
11778    /// Retrieves the module with the given description
11779    ///
11780    /// # Arguments
11781    ///
11782    /// * `description` - The description to set
11783    pub fn with_description(&self, description: impl Into<String>) -> Module {
11784        let mut query = self.selection.select("withDescription");
11785        query = query.arg("description", description.into());
11786        Module {
11787            proc: self.proc.clone(),
11788            selection: query,
11789            graphql_client: self.graphql_client.clone(),
11790        }
11791    }
11792    /// This module plus the given Enum type and associated values
11793    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11794        let mut query = self.selection.select("withEnum");
11795        query = query.arg_lazy(
11796            "enum",
11797            Box::new(move || {
11798                let r#enum = r#enum.clone();
11799                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11800            }),
11801        );
11802        Module {
11803            proc: self.proc.clone(),
11804            selection: query,
11805            graphql_client: self.graphql_client.clone(),
11806        }
11807    }
11808    /// This module plus the given Interface type and associated functions
11809    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11810        let mut query = self.selection.select("withInterface");
11811        query = query.arg_lazy(
11812            "iface",
11813            Box::new(move || {
11814                let iface = iface.clone();
11815                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11816            }),
11817        );
11818        Module {
11819            proc: self.proc.clone(),
11820            selection: query,
11821            graphql_client: self.graphql_client.clone(),
11822        }
11823    }
11824    /// This module plus the given Object type and associated functions.
11825    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11826        let mut query = self.selection.select("withObject");
11827        query = query.arg_lazy(
11828            "object",
11829            Box::new(move || {
11830                let object = object.clone();
11831                Box::pin(async move { object.into_id().await.unwrap().quote() })
11832            }),
11833        );
11834        Module {
11835            proc: self.proc.clone(),
11836            selection: query,
11837            graphql_client: self.graphql_client.clone(),
11838        }
11839    }
11840}
11841impl Node for Module {
11842    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11843        let query = self.selection.select("id");
11844        let graphql_client = self.graphql_client.clone();
11845        async move { query.execute(graphql_client).await }
11846    }
11847}
11848impl Syncer for Module {
11849    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11850        let query = self.selection.select("id");
11851        let graphql_client = self.graphql_client.clone();
11852        async move { query.execute(graphql_client).await }
11853    }
11854    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11855        let query = self.selection.select("sync");
11856        let graphql_client = self.graphql_client.clone();
11857        async move { query.execute(graphql_client).await }
11858    }
11859}
11860#[derive(Clone)]
11861pub struct ModuleConfigClient {
11862    pub proc: Option<Arc<DaggerSessionProc>>,
11863    pub selection: Selection,
11864    pub graphql_client: DynGraphQLClient,
11865}
11866impl IntoID<Id> for ModuleConfigClient {
11867    fn into_id(
11868        self,
11869    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11870        Box::pin(async move { self.id().await })
11871    }
11872}
11873impl Loadable for ModuleConfigClient {
11874    fn graphql_type() -> &'static str {
11875        "ModuleConfigClient"
11876    }
11877    fn from_query(
11878        proc: Option<Arc<DaggerSessionProc>>,
11879        selection: Selection,
11880        graphql_client: DynGraphQLClient,
11881    ) -> Self {
11882        Self {
11883            proc,
11884            selection,
11885            graphql_client,
11886        }
11887    }
11888}
11889impl ModuleConfigClient {
11890    /// The directory the client is generated in.
11891    pub async fn directory(&self) -> Result<String, DaggerError> {
11892        let query = self.selection.select("directory");
11893        query.execute(self.graphql_client.clone()).await
11894    }
11895    /// The generator to use
11896    pub async fn generator(&self) -> Result<String, DaggerError> {
11897        let query = self.selection.select("generator");
11898        query.execute(self.graphql_client.clone()).await
11899    }
11900    /// A unique identifier for this ModuleConfigClient.
11901    pub async fn id(&self) -> Result<Id, DaggerError> {
11902        let query = self.selection.select("id");
11903        query.execute(self.graphql_client.clone()).await
11904    }
11905}
11906impl Node for ModuleConfigClient {
11907    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11908        let query = self.selection.select("id");
11909        let graphql_client = self.graphql_client.clone();
11910        async move { query.execute(graphql_client).await }
11911    }
11912}
11913#[derive(Clone)]
11914pub struct ModuleSource {
11915    pub proc: Option<Arc<DaggerSessionProc>>,
11916    pub selection: Selection,
11917    pub graphql_client: DynGraphQLClient,
11918}
11919impl IntoID<Id> for ModuleSource {
11920    fn into_id(
11921        self,
11922    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11923        Box::pin(async move { self.id().await })
11924    }
11925}
11926impl Loadable for ModuleSource {
11927    fn graphql_type() -> &'static str {
11928        "ModuleSource"
11929    }
11930    fn from_query(
11931        proc: Option<Arc<DaggerSessionProc>>,
11932        selection: Selection,
11933        graphql_client: DynGraphQLClient,
11934    ) -> Self {
11935        Self {
11936            proc,
11937            selection,
11938            graphql_client,
11939        }
11940    }
11941}
11942impl ModuleSource {
11943    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
11944    pub fn as_module(&self) -> Module {
11945        let query = self.selection.select("asModule");
11946        Module {
11947            proc: self.proc.clone(),
11948            selection: query,
11949            graphql_client: self.graphql_client.clone(),
11950        }
11951    }
11952    /// A human readable ref string representation of this module source.
11953    pub async fn as_string(&self) -> Result<String, DaggerError> {
11954        let query = self.selection.select("asString");
11955        query.execute(self.graphql_client.clone()).await
11956    }
11957    /// The blueprint referenced by the module source.
11958    pub fn blueprint(&self) -> ModuleSource {
11959        let query = self.selection.select("blueprint");
11960        ModuleSource {
11961            proc: self.proc.clone(),
11962            selection: query,
11963            graphql_client: self.graphql_client.clone(),
11964        }
11965    }
11966    /// The ref to clone the root of the git repo from. Only valid for git sources.
11967    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11968        let query = self.selection.select("cloneRef");
11969        query.execute(self.graphql_client.clone()).await
11970    }
11971    /// The resolved commit of the git repo this source points to.
11972    pub async fn commit(&self) -> Result<String, DaggerError> {
11973        let query = self.selection.select("commit");
11974        query.execute(self.graphql_client.clone()).await
11975    }
11976    /// The clients generated for the module.
11977    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11978        let query = self.selection.select("configClients");
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| ModuleConfigClient {
11984                proc: self.proc.clone(),
11985                selection: crate::querybuilder::query()
11986                    .select("node")
11987                    .arg("id", &id.0)
11988                    .inline_fragment("ModuleConfigClient"),
11989                graphql_client: self.graphql_client.clone(),
11990            })
11991            .collect())
11992    }
11993    /// Whether an existing dagger.json for the module was found.
11994    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11995        let query = self.selection.select("configExists");
11996        query.execute(self.graphql_client.clone()).await
11997    }
11998    /// The full directory loaded for the module source, including the source code as a subdirectory.
11999    pub fn context_directory(&self) -> Directory {
12000        let query = self.selection.select("contextDirectory");
12001        Directory {
12002            proc: self.proc.clone(),
12003            selection: query,
12004            graphql_client: self.graphql_client.clone(),
12005        }
12006    }
12007    /// The dependencies of the module source.
12008    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12009        let query = self.selection.select("dependencies");
12010        let query = query.select("id");
12011        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12012        Ok(ids
12013            .into_iter()
12014            .map(|id| ModuleSource {
12015                proc: self.proc.clone(),
12016                selection: crate::querybuilder::query()
12017                    .select("node")
12018                    .arg("id", &id.0)
12019                    .inline_fragment("ModuleSource"),
12020                graphql_client: self.graphql_client.clone(),
12021            })
12022            .collect())
12023    }
12024    /// 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.
12025    pub async fn digest(&self) -> Result<String, DaggerError> {
12026        let query = self.selection.select("digest");
12027        query.execute(self.graphql_client.clone()).await
12028    }
12029    /// The directory containing the module configuration and source code (source code may be in a subdir).
12030    ///
12031    /// # Arguments
12032    ///
12033    /// * `path` - A subpath from the source directory to select.
12034    pub fn directory(&self, path: impl Into<String>) -> Directory {
12035        let mut query = self.selection.select("directory");
12036        query = query.arg("path", path.into());
12037        Directory {
12038            proc: self.proc.clone(),
12039            selection: query,
12040            graphql_client: self.graphql_client.clone(),
12041        }
12042    }
12043    /// The engine version of the module.
12044    pub async fn engine_version(&self) -> Result<String, DaggerError> {
12045        let query = self.selection.select("engineVersion");
12046        query.execute(self.graphql_client.clone()).await
12047    }
12048    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
12049    pub fn generated_context_changeset(&self) -> Changeset {
12050        let query = self.selection.select("generatedContextChangeset");
12051        Changeset {
12052            proc: self.proc.clone(),
12053            selection: query,
12054            graphql_client: self.graphql_client.clone(),
12055        }
12056    }
12057    /// The generated files and directories made on top of the module source's context directory.
12058    pub fn generated_context_directory(&self) -> Directory {
12059        let query = self.selection.select("generatedContextDirectory");
12060        Directory {
12061            proc: self.proc.clone(),
12062            selection: query,
12063            graphql_client: self.graphql_client.clone(),
12064        }
12065    }
12066    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
12067    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12068        let query = self.selection.select("htmlRepoURL");
12069        query.execute(self.graphql_client.clone()).await
12070    }
12071    /// The URL to the source's git repo in a web browser. Only valid for git sources.
12072    pub async fn html_url(&self) -> Result<String, DaggerError> {
12073        let query = self.selection.select("htmlURL");
12074        query.execute(self.graphql_client.clone()).await
12075    }
12076    /// A unique identifier for this ModuleSource.
12077    pub async fn id(&self) -> Result<Id, DaggerError> {
12078        let query = self.selection.select("id");
12079        query.execute(self.graphql_client.clone()).await
12080    }
12081    /// The introspection schema JSON file for this module source.
12082    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
12083    /// Note: this is in the context of a module, so some core types may be hidden.
12084    pub fn introspection_schema_json(&self) -> File {
12085        let query = self.selection.select("introspectionSchemaJSON");
12086        File {
12087            proc: self.proc.clone(),
12088            selection: query,
12089            graphql_client: self.graphql_client.clone(),
12090        }
12091    }
12092    /// The kind of module source (currently local, git or dir).
12093    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12094        let query = self.selection.select("kind");
12095        query.execute(self.graphql_client.clone()).await
12096    }
12097    /// 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.
12098    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12099        let query = self.selection.select("localContextDirectoryPath");
12100        query.execute(self.graphql_client.clone()).await
12101    }
12102    /// The name of the module, including any setting via the withName API.
12103    pub async fn module_name(&self) -> Result<String, DaggerError> {
12104        let query = self.selection.select("moduleName");
12105        query.execute(self.graphql_client.clone()).await
12106    }
12107    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
12108    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12109        let query = self.selection.select("moduleOriginalName");
12110        query.execute(self.graphql_client.clone()).await
12111    }
12112    /// The original subpath used when instantiating this module source, relative to the context directory.
12113    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12114        let query = self.selection.select("originalSubpath");
12115        query.execute(self.graphql_client.clone()).await
12116    }
12117    /// The pinned version of this module source.
12118    pub async fn pin(&self) -> Result<String, DaggerError> {
12119        let query = self.selection.select("pin");
12120        query.execute(self.graphql_client.clone()).await
12121    }
12122    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
12123    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12124        let query = self.selection.select("repoRootPath");
12125        query.execute(self.graphql_client.clone()).await
12126    }
12127    /// The SDK configuration of the module.
12128    pub fn sdk(&self) -> SdkConfig {
12129        let query = self.selection.select("sdk");
12130        SdkConfig {
12131            proc: self.proc.clone(),
12132            selection: query,
12133            graphql_client: self.graphql_client.clone(),
12134        }
12135    }
12136    /// The path, relative to the context directory, that contains the module's dagger.json.
12137    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12138        let query = self.selection.select("sourceRootSubpath");
12139        query.execute(self.graphql_client.clone()).await
12140    }
12141    /// The path to the directory containing the module's source code, relative to the context directory.
12142    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12143        let query = self.selection.select("sourceSubpath");
12144        query.execute(self.graphql_client.clone()).await
12145    }
12146    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
12147    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12148        let query = self.selection.select("sync");
12149        let id: Id = query.execute(self.graphql_client.clone()).await?;
12150        Ok(ModuleSource {
12151            proc: self.proc.clone(),
12152            selection: query
12153                .root()
12154                .select("node")
12155                .arg("id", &id.0)
12156                .inline_fragment("ModuleSource"),
12157            graphql_client: self.graphql_client.clone(),
12158        })
12159    }
12160    /// The toolchains referenced by the module source.
12161    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12162        let query = self.selection.select("toolchains");
12163        let query = query.select("id");
12164        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12165        Ok(ids
12166            .into_iter()
12167            .map(|id| ModuleSource {
12168                proc: self.proc.clone(),
12169                selection: crate::querybuilder::query()
12170                    .select("node")
12171                    .arg("id", &id.0)
12172                    .inline_fragment("ModuleSource"),
12173                graphql_client: self.graphql_client.clone(),
12174            })
12175            .collect())
12176    }
12177    /// User-defined defaults read from local .env files
12178    pub fn user_defaults(&self) -> EnvFile {
12179        let query = self.selection.select("userDefaults");
12180        EnvFile {
12181            proc: self.proc.clone(),
12182            selection: query,
12183            graphql_client: self.graphql_client.clone(),
12184        }
12185    }
12186    /// The specified version of the git repo this source points to.
12187    pub async fn version(&self) -> Result<String, DaggerError> {
12188        let query = self.selection.select("version");
12189        query.execute(self.graphql_client.clone()).await
12190    }
12191    /// Set a blueprint for the module source.
12192    ///
12193    /// # Arguments
12194    ///
12195    /// * `blueprint` - The blueprint module to set.
12196    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12197        let mut query = self.selection.select("withBlueprint");
12198        query = query.arg_lazy(
12199            "blueprint",
12200            Box::new(move || {
12201                let blueprint = blueprint.clone();
12202                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12203            }),
12204        );
12205        ModuleSource {
12206            proc: self.proc.clone(),
12207            selection: query,
12208            graphql_client: self.graphql_client.clone(),
12209        }
12210    }
12211    /// Update the module source with a new client to generate.
12212    ///
12213    /// # Arguments
12214    ///
12215    /// * `generator` - The generator to use
12216    /// * `output_dir` - The output directory for the generated client.
12217    pub fn with_client(
12218        &self,
12219        generator: impl Into<String>,
12220        output_dir: impl Into<String>,
12221    ) -> ModuleSource {
12222        let mut query = self.selection.select("withClient");
12223        query = query.arg("generator", generator.into());
12224        query = query.arg("outputDir", output_dir.into());
12225        ModuleSource {
12226            proc: self.proc.clone(),
12227            selection: query,
12228            graphql_client: self.graphql_client.clone(),
12229        }
12230    }
12231    /// Append the provided dependencies to the module source's dependency list.
12232    ///
12233    /// # Arguments
12234    ///
12235    /// * `dependencies` - The dependencies to append.
12236    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12237        let mut query = self.selection.select("withDependencies");
12238        query = query.arg("dependencies", dependencies);
12239        ModuleSource {
12240            proc: self.proc.clone(),
12241            selection: query,
12242            graphql_client: self.graphql_client.clone(),
12243        }
12244    }
12245    /// Upgrade the engine version of the module to the given value.
12246    ///
12247    /// # Arguments
12248    ///
12249    /// * `version` - The engine version to upgrade to.
12250    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12251        let mut query = self.selection.select("withEngineVersion");
12252        query = query.arg("version", version.into());
12253        ModuleSource {
12254            proc: self.proc.clone(),
12255            selection: query,
12256            graphql_client: self.graphql_client.clone(),
12257        }
12258    }
12259    /// Enable the experimental features for the module source.
12260    ///
12261    /// # Arguments
12262    ///
12263    /// * `features` - The experimental features to enable.
12264    pub fn with_experimental_features(
12265        &self,
12266        features: Vec<ModuleSourceExperimentalFeature>,
12267    ) -> ModuleSource {
12268        let mut query = self.selection.select("withExperimentalFeatures");
12269        query = query.arg("features", features);
12270        ModuleSource {
12271            proc: self.proc.clone(),
12272            selection: query,
12273            graphql_client: self.graphql_client.clone(),
12274        }
12275    }
12276    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
12277    ///
12278    /// # Arguments
12279    ///
12280    /// * `patterns` - The new additional include patterns.
12281    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12282        let mut query = self.selection.select("withIncludes");
12283        query = query.arg(
12284            "patterns",
12285            patterns
12286                .into_iter()
12287                .map(|i| i.into())
12288                .collect::<Vec<String>>(),
12289        );
12290        ModuleSource {
12291            proc: self.proc.clone(),
12292            selection: query,
12293            graphql_client: self.graphql_client.clone(),
12294        }
12295    }
12296    /// Update the module source with a new name.
12297    ///
12298    /// # Arguments
12299    ///
12300    /// * `name` - The name to set.
12301    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12302        let mut query = self.selection.select("withName");
12303        query = query.arg("name", name.into());
12304        ModuleSource {
12305            proc: self.proc.clone(),
12306            selection: query,
12307            graphql_client: self.graphql_client.clone(),
12308        }
12309    }
12310    /// Update the module source with a new SDK.
12311    ///
12312    /// # Arguments
12313    ///
12314    /// * `source` - The SDK source to set.
12315    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12316        let mut query = self.selection.select("withSDK");
12317        query = query.arg("source", source.into());
12318        ModuleSource {
12319            proc: self.proc.clone(),
12320            selection: query,
12321            graphql_client: self.graphql_client.clone(),
12322        }
12323    }
12324    /// Update the module source with a new source subpath.
12325    ///
12326    /// # Arguments
12327    ///
12328    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
12329    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12330        let mut query = self.selection.select("withSourceSubpath");
12331        query = query.arg("path", path.into());
12332        ModuleSource {
12333            proc: self.proc.clone(),
12334            selection: query,
12335            graphql_client: self.graphql_client.clone(),
12336        }
12337    }
12338    /// Add toolchains to the module source.
12339    ///
12340    /// # Arguments
12341    ///
12342    /// * `toolchains` - The toolchain modules to add.
12343    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12344        let mut query = self.selection.select("withToolchains");
12345        query = query.arg("toolchains", toolchains);
12346        ModuleSource {
12347            proc: self.proc.clone(),
12348            selection: query,
12349            graphql_client: self.graphql_client.clone(),
12350        }
12351    }
12352    /// Update the blueprint module to the latest version.
12353    pub fn with_update_blueprint(&self) -> ModuleSource {
12354        let query = self.selection.select("withUpdateBlueprint");
12355        ModuleSource {
12356            proc: self.proc.clone(),
12357            selection: query,
12358            graphql_client: self.graphql_client.clone(),
12359        }
12360    }
12361    /// Update one or more module dependencies.
12362    ///
12363    /// # Arguments
12364    ///
12365    /// * `dependencies` - The dependencies to update.
12366    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12367        let mut query = self.selection.select("withUpdateDependencies");
12368        query = query.arg(
12369            "dependencies",
12370            dependencies
12371                .into_iter()
12372                .map(|i| i.into())
12373                .collect::<Vec<String>>(),
12374        );
12375        ModuleSource {
12376            proc: self.proc.clone(),
12377            selection: query,
12378            graphql_client: self.graphql_client.clone(),
12379        }
12380    }
12381    /// Update one or more toolchains.
12382    ///
12383    /// # Arguments
12384    ///
12385    /// * `toolchains` - The toolchains to update.
12386    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12387        let mut query = self.selection.select("withUpdateToolchains");
12388        query = query.arg(
12389            "toolchains",
12390            toolchains
12391                .into_iter()
12392                .map(|i| i.into())
12393                .collect::<Vec<String>>(),
12394        );
12395        ModuleSource {
12396            proc: self.proc.clone(),
12397            selection: query,
12398            graphql_client: self.graphql_client.clone(),
12399        }
12400    }
12401    /// Update one or more clients.
12402    ///
12403    /// # Arguments
12404    ///
12405    /// * `clients` - The clients to update
12406    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12407        let mut query = self.selection.select("withUpdatedClients");
12408        query = query.arg(
12409            "clients",
12410            clients
12411                .into_iter()
12412                .map(|i| i.into())
12413                .collect::<Vec<String>>(),
12414        );
12415        ModuleSource {
12416            proc: self.proc.clone(),
12417            selection: query,
12418            graphql_client: self.graphql_client.clone(),
12419        }
12420    }
12421    /// Remove the current blueprint from the module source.
12422    pub fn without_blueprint(&self) -> ModuleSource {
12423        let query = self.selection.select("withoutBlueprint");
12424        ModuleSource {
12425            proc: self.proc.clone(),
12426            selection: query,
12427            graphql_client: self.graphql_client.clone(),
12428        }
12429    }
12430    /// Remove a client from the module source.
12431    ///
12432    /// # Arguments
12433    ///
12434    /// * `path` - The path of the client to remove.
12435    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12436        let mut query = self.selection.select("withoutClient");
12437        query = query.arg("path", path.into());
12438        ModuleSource {
12439            proc: self.proc.clone(),
12440            selection: query,
12441            graphql_client: self.graphql_client.clone(),
12442        }
12443    }
12444    /// Remove the provided dependencies from the module source's dependency list.
12445    ///
12446    /// # Arguments
12447    ///
12448    /// * `dependencies` - The dependencies to remove.
12449    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12450        let mut query = self.selection.select("withoutDependencies");
12451        query = query.arg(
12452            "dependencies",
12453            dependencies
12454                .into_iter()
12455                .map(|i| i.into())
12456                .collect::<Vec<String>>(),
12457        );
12458        ModuleSource {
12459            proc: self.proc.clone(),
12460            selection: query,
12461            graphql_client: self.graphql_client.clone(),
12462        }
12463    }
12464    /// Disable experimental features for the module source.
12465    ///
12466    /// # Arguments
12467    ///
12468    /// * `features` - The experimental features to disable.
12469    pub fn without_experimental_features(
12470        &self,
12471        features: Vec<ModuleSourceExperimentalFeature>,
12472    ) -> ModuleSource {
12473        let mut query = self.selection.select("withoutExperimentalFeatures");
12474        query = query.arg("features", features);
12475        ModuleSource {
12476            proc: self.proc.clone(),
12477            selection: query,
12478            graphql_client: self.graphql_client.clone(),
12479        }
12480    }
12481    /// Remove the provided toolchains from the module source.
12482    ///
12483    /// # Arguments
12484    ///
12485    /// * `toolchains` - The toolchains to remove.
12486    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12487        let mut query = self.selection.select("withoutToolchains");
12488        query = query.arg(
12489            "toolchains",
12490            toolchains
12491                .into_iter()
12492                .map(|i| i.into())
12493                .collect::<Vec<String>>(),
12494        );
12495        ModuleSource {
12496            proc: self.proc.clone(),
12497            selection: query,
12498            graphql_client: self.graphql_client.clone(),
12499        }
12500    }
12501}
12502impl Node for ModuleSource {
12503    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12504        let query = self.selection.select("id");
12505        let graphql_client = self.graphql_client.clone();
12506        async move { query.execute(graphql_client).await }
12507    }
12508}
12509impl Syncer for ModuleSource {
12510    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12511        let query = self.selection.select("id");
12512        let graphql_client = self.graphql_client.clone();
12513        async move { query.execute(graphql_client).await }
12514    }
12515    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12516        let query = self.selection.select("sync");
12517        let graphql_client = self.graphql_client.clone();
12518        async move { query.execute(graphql_client).await }
12519    }
12520}
12521#[derive(Clone)]
12522pub struct ObjectTypeDef {
12523    pub proc: Option<Arc<DaggerSessionProc>>,
12524    pub selection: Selection,
12525    pub graphql_client: DynGraphQLClient,
12526}
12527impl IntoID<Id> for ObjectTypeDef {
12528    fn into_id(
12529        self,
12530    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12531        Box::pin(async move { self.id().await })
12532    }
12533}
12534impl Loadable for ObjectTypeDef {
12535    fn graphql_type() -> &'static str {
12536        "ObjectTypeDef"
12537    }
12538    fn from_query(
12539        proc: Option<Arc<DaggerSessionProc>>,
12540        selection: Selection,
12541        graphql_client: DynGraphQLClient,
12542    ) -> Self {
12543        Self {
12544            proc,
12545            selection,
12546            graphql_client,
12547        }
12548    }
12549}
12550impl ObjectTypeDef {
12551    /// The function used to construct new instances of this object, if any.
12552    pub fn constructor(&self) -> Function {
12553        let query = self.selection.select("constructor");
12554        Function {
12555            proc: self.proc.clone(),
12556            selection: query,
12557            graphql_client: self.graphql_client.clone(),
12558        }
12559    }
12560    /// The reason this enum member is deprecated, if any.
12561    pub async fn deprecated(&self) -> Result<String, DaggerError> {
12562        let query = self.selection.select("deprecated");
12563        query.execute(self.graphql_client.clone()).await
12564    }
12565    /// The doc string for the object, if any.
12566    pub async fn description(&self) -> Result<String, DaggerError> {
12567        let query = self.selection.select("description");
12568        query.execute(self.graphql_client.clone()).await
12569    }
12570    /// Static fields defined on this object, if any.
12571    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12572        let query = self.selection.select("fields");
12573        let query = query.select("id");
12574        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12575        Ok(ids
12576            .into_iter()
12577            .map(|id| FieldTypeDef {
12578                proc: self.proc.clone(),
12579                selection: crate::querybuilder::query()
12580                    .select("node")
12581                    .arg("id", &id.0)
12582                    .inline_fragment("FieldTypeDef"),
12583                graphql_client: self.graphql_client.clone(),
12584            })
12585            .collect())
12586    }
12587    /// Functions defined on this object, if any.
12588    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12589        let query = self.selection.select("functions");
12590        let query = query.select("id");
12591        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12592        Ok(ids
12593            .into_iter()
12594            .map(|id| Function {
12595                proc: self.proc.clone(),
12596                selection: crate::querybuilder::query()
12597                    .select("node")
12598                    .arg("id", &id.0)
12599                    .inline_fragment("Function"),
12600                graphql_client: self.graphql_client.clone(),
12601            })
12602            .collect())
12603    }
12604    /// A unique identifier for this ObjectTypeDef.
12605    pub async fn id(&self) -> Result<Id, DaggerError> {
12606        let query = self.selection.select("id");
12607        query.execute(self.graphql_client.clone()).await
12608    }
12609    /// The name of the object.
12610    pub async fn name(&self) -> Result<String, DaggerError> {
12611        let query = self.selection.select("name");
12612        query.execute(self.graphql_client.clone()).await
12613    }
12614    /// The location of this object declaration.
12615    pub fn source_map(&self) -> SourceMap {
12616        let query = self.selection.select("sourceMap");
12617        SourceMap {
12618            proc: self.proc.clone(),
12619            selection: query,
12620            graphql_client: self.graphql_client.clone(),
12621        }
12622    }
12623    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
12624    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12625        let query = self.selection.select("sourceModuleName");
12626        query.execute(self.graphql_client.clone()).await
12627    }
12628}
12629impl Node for ObjectTypeDef {
12630    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12631        let query = self.selection.select("id");
12632        let graphql_client = self.graphql_client.clone();
12633        async move { query.execute(graphql_client).await }
12634    }
12635}
12636#[derive(Clone)]
12637pub struct Port {
12638    pub proc: Option<Arc<DaggerSessionProc>>,
12639    pub selection: Selection,
12640    pub graphql_client: DynGraphQLClient,
12641}
12642impl IntoID<Id> for Port {
12643    fn into_id(
12644        self,
12645    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12646        Box::pin(async move { self.id().await })
12647    }
12648}
12649impl Loadable for Port {
12650    fn graphql_type() -> &'static str {
12651        "Port"
12652    }
12653    fn from_query(
12654        proc: Option<Arc<DaggerSessionProc>>,
12655        selection: Selection,
12656        graphql_client: DynGraphQLClient,
12657    ) -> Self {
12658        Self {
12659            proc,
12660            selection,
12661            graphql_client,
12662        }
12663    }
12664}
12665impl Port {
12666    /// The port description.
12667    pub async fn description(&self) -> Result<String, DaggerError> {
12668        let query = self.selection.select("description");
12669        query.execute(self.graphql_client.clone()).await
12670    }
12671    /// Skip the health check when run as a service.
12672    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12673        let query = self.selection.select("experimentalSkipHealthcheck");
12674        query.execute(self.graphql_client.clone()).await
12675    }
12676    /// A unique identifier for this Port.
12677    pub async fn id(&self) -> Result<Id, DaggerError> {
12678        let query = self.selection.select("id");
12679        query.execute(self.graphql_client.clone()).await
12680    }
12681    /// The port number.
12682    pub async fn port(&self) -> Result<isize, DaggerError> {
12683        let query = self.selection.select("port");
12684        query.execute(self.graphql_client.clone()).await
12685    }
12686    /// The transport layer protocol.
12687    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12688        let query = self.selection.select("protocol");
12689        query.execute(self.graphql_client.clone()).await
12690    }
12691}
12692impl Node for Port {
12693    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12694        let query = self.selection.select("id");
12695        let graphql_client = self.graphql_client.clone();
12696        async move { query.execute(graphql_client).await }
12697    }
12698}
12699#[derive(Clone)]
12700pub struct Query {
12701    pub proc: Option<Arc<DaggerSessionProc>>,
12702    pub selection: Selection,
12703    pub graphql_client: DynGraphQLClient,
12704}
12705#[derive(Builder, Debug, PartialEq)]
12706pub struct QueryCacheVolumeOpts<'a> {
12707    /// A user:group to set for the cache volume root.
12708    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
12709    /// If the group is omitted, it defaults to the same as the user.
12710    #[builder(setter(into, strip_option), default)]
12711    pub owner: Option<&'a str>,
12712    /// Sharing mode of the cache volume.
12713    #[builder(setter(into, strip_option), default)]
12714    pub sharing: Option<CacheSharingMode>,
12715    /// Identifier of the directory to use as the cache volume's root.
12716    #[builder(setter(into, strip_option), default)]
12717    pub source: Option<Id>,
12718}
12719#[derive(Builder, Debug, PartialEq)]
12720pub struct QueryContainerOpts {
12721    /// Platform to initialize the container with. Defaults to the native platform of the current engine
12722    #[builder(setter(into, strip_option), default)]
12723    pub platform: Option<Platform>,
12724}
12725#[derive(Builder, Debug, PartialEq)]
12726pub struct QueryCurrentTypeDefsOpts {
12727    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
12728    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
12729    #[builder(setter(into, strip_option), default)]
12730    pub hide_core: Option<bool>,
12731    /// Return the full referenced typedef closure instead of only top-level served typedefs.
12732    #[builder(setter(into, strip_option), default)]
12733    pub return_all_types: Option<bool>,
12734}
12735#[derive(Builder, Debug, PartialEq)]
12736pub struct QueryEnvOpts {
12737    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
12738    #[builder(setter(into, strip_option), default)]
12739    pub privileged: Option<bool>,
12740    /// Allow new outputs to be declared and saved in the environment
12741    #[builder(setter(into, strip_option), default)]
12742    pub writable: Option<bool>,
12743}
12744#[derive(Builder, Debug, PartialEq)]
12745pub struct QueryEnvFileOpts {
12746    /// Replace "${VAR}" or "$VAR" with the value of other vars
12747    #[builder(setter(into, strip_option), default)]
12748    pub expand: Option<bool>,
12749}
12750#[derive(Builder, Debug, PartialEq)]
12751pub struct QueryFileOpts {
12752    /// Permissions of the new file. Example: 0600
12753    #[builder(setter(into, strip_option), default)]
12754    pub permissions: Option<isize>,
12755}
12756#[derive(Builder, Debug, PartialEq)]
12757pub struct QueryGitOpts<'a> {
12758    /// A service which must be started before the repo is fetched.
12759    #[builder(setter(into, strip_option), default)]
12760    pub experimental_service_host: Option<Id>,
12761    /// Secret used to populate the Authorization HTTP header
12762    #[builder(setter(into, strip_option), default)]
12763    pub http_auth_header: Option<Id>,
12764    /// Secret used to populate the password during basic HTTP Authorization
12765    #[builder(setter(into, strip_option), default)]
12766    pub http_auth_token: Option<Id>,
12767    /// Username used to populate the password during basic HTTP Authorization
12768    #[builder(setter(into, strip_option), default)]
12769    pub http_auth_username: Option<&'a str>,
12770    /// DEPRECATED: Set to true to keep .git directory.
12771    #[builder(setter(into, strip_option), default)]
12772    pub keep_git_dir: Option<bool>,
12773    /// Set SSH auth socket
12774    #[builder(setter(into, strip_option), default)]
12775    pub ssh_auth_socket: Option<Id>,
12776    /// Set SSH known hosts
12777    #[builder(setter(into, strip_option), default)]
12778    pub ssh_known_hosts: Option<&'a str>,
12779}
12780#[derive(Builder, Debug, PartialEq)]
12781pub struct QueryHttpOpts<'a> {
12782    /// Secret used to populate the Authorization HTTP header
12783    #[builder(setter(into, strip_option), default)]
12784    pub auth_header: Option<Id>,
12785    /// Expected digest of the downloaded content (e.g., "sha256:...").
12786    #[builder(setter(into, strip_option), default)]
12787    pub checksum: Option<&'a str>,
12788    /// A service which must be started before the URL is fetched.
12789    #[builder(setter(into, strip_option), default)]
12790    pub experimental_service_host: Option<Id>,
12791    /// File name to use for the file. Defaults to the last part of the URL.
12792    #[builder(setter(into, strip_option), default)]
12793    pub name: Option<&'a str>,
12794    /// Permissions to set on the file.
12795    #[builder(setter(into, strip_option), default)]
12796    pub permissions: Option<isize>,
12797}
12798#[derive(Builder, Debug, PartialEq)]
12799pub struct QueryLlmOpts<'a> {
12800    /// Cap the number of API calls for this LLM
12801    #[builder(setter(into, strip_option), default)]
12802    pub max_api_calls: Option<isize>,
12803    /// Model to use
12804    #[builder(setter(into, strip_option), default)]
12805    pub model: Option<&'a str>,
12806}
12807#[derive(Builder, Debug, PartialEq)]
12808pub struct QueryModuleSourceOpts<'a> {
12809    /// 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.
12810    #[builder(setter(into, strip_option), default)]
12811    pub allow_not_exists: Option<bool>,
12812    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
12813    #[builder(setter(into, strip_option), default)]
12814    pub disable_find_up: Option<bool>,
12815    /// The pinned version of the module source
12816    #[builder(setter(into, strip_option), default)]
12817    pub ref_pin: Option<&'a str>,
12818    /// If set, error out if the ref string is not of the provided requireKind.
12819    #[builder(setter(into, strip_option), default)]
12820    pub require_kind: Option<ModuleSourceKind>,
12821}
12822#[derive(Builder, Debug, PartialEq)]
12823pub struct QuerySecretOpts<'a> {
12824    /// 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.
12825    /// 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.
12826    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
12827    #[builder(setter(into, strip_option), default)]
12828    pub cache_key: Option<&'a str>,
12829}
12830impl IntoID<Id> for Query {
12831    fn into_id(
12832        self,
12833    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12834        Box::pin(async move { self.id().await })
12835    }
12836}
12837impl Loadable for Query {
12838    fn graphql_type() -> &'static str {
12839        "Query"
12840    }
12841    fn from_query(
12842        proc: Option<Arc<DaggerSessionProc>>,
12843        selection: Selection,
12844        graphql_client: DynGraphQLClient,
12845    ) -> Self {
12846        Self {
12847            proc,
12848            selection,
12849            graphql_client,
12850        }
12851    }
12852}
12853impl Query {
12854    /// initialize an address to load directories, containers, secrets or other object types.
12855    pub fn address(&self, value: impl Into<String>) -> Address {
12856        let mut query = self.selection.select("address");
12857        query = query.arg("value", value.into());
12858        Address {
12859            proc: self.proc.clone(),
12860            selection: query,
12861            graphql_client: self.graphql_client.clone(),
12862        }
12863    }
12864    /// Constructs a cache volume for a given cache key.
12865    ///
12866    /// # Arguments
12867    ///
12868    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12870    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12871        let mut query = self.selection.select("cacheVolume");
12872        query = query.arg("key", key.into());
12873        CacheVolume {
12874            proc: self.proc.clone(),
12875            selection: query,
12876            graphql_client: self.graphql_client.clone(),
12877        }
12878    }
12879    /// Constructs a cache volume for a given cache key.
12880    ///
12881    /// # Arguments
12882    ///
12883    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12884    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12885    pub fn cache_volume_opts<'a>(
12886        &self,
12887        key: impl Into<String>,
12888        opts: QueryCacheVolumeOpts<'a>,
12889    ) -> CacheVolume {
12890        let mut query = self.selection.select("cacheVolume");
12891        query = query.arg("key", key.into());
12892        if let Some(source) = opts.source {
12893            query = query.arg("source", source);
12894        }
12895        if let Some(sharing) = opts.sharing {
12896            query = query.arg("sharing", sharing);
12897        }
12898        if let Some(owner) = opts.owner {
12899            query = query.arg("owner", owner);
12900        }
12901        CacheVolume {
12902            proc: self.proc.clone(),
12903            selection: query,
12904            graphql_client: self.graphql_client.clone(),
12905        }
12906    }
12907    /// Creates an empty changeset
12908    pub fn changeset(&self) -> Changeset {
12909        let query = self.selection.select("changeset");
12910        Changeset {
12911            proc: self.proc.clone(),
12912            selection: query,
12913            graphql_client: self.graphql_client.clone(),
12914        }
12915    }
12916    /// Dagger Cloud configuration and state
12917    pub fn cloud(&self) -> Cloud {
12918        let query = self.selection.select("cloud");
12919        Cloud {
12920            proc: self.proc.clone(),
12921            selection: query,
12922            graphql_client: self.graphql_client.clone(),
12923        }
12924    }
12925    /// Creates a scratch container, with no image or metadata.
12926    /// To pull an image, follow up with the "from" function.
12927    ///
12928    /// # Arguments
12929    ///
12930    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12931    pub fn container(&self) -> Container {
12932        let query = self.selection.select("container");
12933        Container {
12934            proc: self.proc.clone(),
12935            selection: query,
12936            graphql_client: self.graphql_client.clone(),
12937        }
12938    }
12939    /// Creates a scratch container, with no image or metadata.
12940    /// To pull an image, follow up with the "from" function.
12941    ///
12942    /// # Arguments
12943    ///
12944    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12945    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12946        let mut query = self.selection.select("container");
12947        if let Some(platform) = opts.platform {
12948            query = query.arg("platform", platform);
12949        }
12950        Container {
12951            proc: self.proc.clone(),
12952            selection: query,
12953            graphql_client: self.graphql_client.clone(),
12954        }
12955    }
12956    /// Returns the current environment
12957    /// When called from a function invoked via an LLM tool call, this will be the LLM's current environment, including any modifications made through calling tools. Env values returned by functions become the new environment for subsequent calls, and Changeset values returned by functions are applied to the environment's workspace.
12958    /// When called from a module function outside of an LLM, this returns an Env with the current module installed, and with the current module's source directory as its workspace.
12959    pub fn current_env(&self) -> Env {
12960        let query = self.selection.select("currentEnv");
12961        Env {
12962            proc: self.proc.clone(),
12963            selection: query,
12964            graphql_client: self.graphql_client.clone(),
12965        }
12966    }
12967    /// The FunctionCall context that the SDK caller is currently executing in.
12968    /// If the caller is not currently executing in a function, this will return an error.
12969    pub fn current_function_call(&self) -> FunctionCall {
12970        let query = self.selection.select("currentFunctionCall");
12971        FunctionCall {
12972            proc: self.proc.clone(),
12973            selection: query,
12974            graphql_client: self.graphql_client.clone(),
12975        }
12976    }
12977    /// The module currently being served in the session, if any.
12978    pub fn current_module(&self) -> CurrentModule {
12979        let query = self.selection.select("currentModule");
12980        CurrentModule {
12981            proc: self.proc.clone(),
12982            selection: query,
12983            graphql_client: self.graphql_client.clone(),
12984        }
12985    }
12986    /// The TypeDef representations of the objects currently being served in the session.
12987    ///
12988    /// # Arguments
12989    ///
12990    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12991    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12992        let query = self.selection.select("currentTypeDefs");
12993        let query = query.select("id");
12994        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12995        Ok(ids
12996            .into_iter()
12997            .map(|id| TypeDef {
12998                proc: self.proc.clone(),
12999                selection: crate::querybuilder::query()
13000                    .select("node")
13001                    .arg("id", &id.0)
13002                    .inline_fragment("TypeDef"),
13003                graphql_client: self.graphql_client.clone(),
13004            })
13005            .collect())
13006    }
13007    /// The TypeDef representations of the objects currently being served in the session.
13008    ///
13009    /// # Arguments
13010    ///
13011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13012    pub async fn current_type_defs_opts(
13013        &self,
13014        opts: QueryCurrentTypeDefsOpts,
13015    ) -> Result<Vec<TypeDef>, DaggerError> {
13016        let mut query = self.selection.select("currentTypeDefs");
13017        if let Some(return_all_types) = opts.return_all_types {
13018            query = query.arg("returnAllTypes", return_all_types);
13019        }
13020        if let Some(hide_core) = opts.hide_core {
13021            query = query.arg("hideCore", hide_core);
13022        }
13023        let query = query.select("id");
13024        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13025        Ok(ids
13026            .into_iter()
13027            .map(|id| TypeDef {
13028                proc: self.proc.clone(),
13029                selection: crate::querybuilder::query()
13030                    .select("node")
13031                    .arg("id", &id.0)
13032                    .inline_fragment("TypeDef"),
13033                graphql_client: self.graphql_client.clone(),
13034            })
13035            .collect())
13036    }
13037    /// Detect and return the current workspace.
13038    pub fn current_workspace(&self) -> Workspace {
13039        let query = self.selection.select("currentWorkspace");
13040        Workspace {
13041            proc: self.proc.clone(),
13042            selection: query,
13043            graphql_client: self.graphql_client.clone(),
13044        }
13045    }
13046    /// The default platform of the engine.
13047    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13048        let query = self.selection.select("defaultPlatform");
13049        query.execute(self.graphql_client.clone()).await
13050    }
13051    /// Creates an empty directory.
13052    pub fn directory(&self) -> Directory {
13053        let query = self.selection.select("directory");
13054        Directory {
13055            proc: self.proc.clone(),
13056            selection: query,
13057            graphql_client: self.graphql_client.clone(),
13058        }
13059    }
13060    /// The Dagger engine container configuration and state
13061    pub fn engine(&self) -> Engine {
13062        let query = self.selection.select("engine");
13063        Engine {
13064            proc: self.proc.clone(),
13065            selection: query,
13066            graphql_client: self.graphql_client.clone(),
13067        }
13068    }
13069    /// Initializes a new environment
13070    ///
13071    /// # Arguments
13072    ///
13073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13074    pub fn env(&self) -> Env {
13075        let query = self.selection.select("env");
13076        Env {
13077            proc: self.proc.clone(),
13078            selection: query,
13079            graphql_client: self.graphql_client.clone(),
13080        }
13081    }
13082    /// Initializes a new environment
13083    ///
13084    /// # Arguments
13085    ///
13086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13087    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13088        let mut query = self.selection.select("env");
13089        if let Some(privileged) = opts.privileged {
13090            query = query.arg("privileged", privileged);
13091        }
13092        if let Some(writable) = opts.writable {
13093            query = query.arg("writable", writable);
13094        }
13095        Env {
13096            proc: self.proc.clone(),
13097            selection: query,
13098            graphql_client: self.graphql_client.clone(),
13099        }
13100    }
13101    /// Initialize an environment file
13102    ///
13103    /// # Arguments
13104    ///
13105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13106    pub fn env_file(&self) -> EnvFile {
13107        let query = self.selection.select("envFile");
13108        EnvFile {
13109            proc: self.proc.clone(),
13110            selection: query,
13111            graphql_client: self.graphql_client.clone(),
13112        }
13113    }
13114    /// Initialize an environment file
13115    ///
13116    /// # Arguments
13117    ///
13118    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13119    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13120        let mut query = self.selection.select("envFile");
13121        if let Some(expand) = opts.expand {
13122            query = query.arg("expand", expand);
13123        }
13124        EnvFile {
13125            proc: self.proc.clone(),
13126            selection: query,
13127            graphql_client: self.graphql_client.clone(),
13128        }
13129    }
13130    /// Create a new error.
13131    ///
13132    /// # Arguments
13133    ///
13134    /// * `message` - A brief description of the error.
13135    pub fn error(&self, message: impl Into<String>) -> Error {
13136        let mut query = self.selection.select("error");
13137        query = query.arg("message", message.into());
13138        Error {
13139            proc: self.proc.clone(),
13140            selection: query,
13141            graphql_client: self.graphql_client.clone(),
13142        }
13143    }
13144    /// Creates a file with the specified contents.
13145    ///
13146    /// # Arguments
13147    ///
13148    /// * `name` - Name of the new file. Example: "foo.txt"
13149    /// * `contents` - Contents of the new file. Example: "Hello world!"
13150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13151    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13152        let mut query = self.selection.select("file");
13153        query = query.arg("name", name.into());
13154        query = query.arg("contents", contents.into());
13155        File {
13156            proc: self.proc.clone(),
13157            selection: query,
13158            graphql_client: self.graphql_client.clone(),
13159        }
13160    }
13161    /// Creates a file with the specified contents.
13162    ///
13163    /// # Arguments
13164    ///
13165    /// * `name` - Name of the new file. Example: "foo.txt"
13166    /// * `contents` - Contents of the new file. Example: "Hello world!"
13167    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13168    pub fn file_opts(
13169        &self,
13170        name: impl Into<String>,
13171        contents: impl Into<String>,
13172        opts: QueryFileOpts,
13173    ) -> File {
13174        let mut query = self.selection.select("file");
13175        query = query.arg("name", name.into());
13176        query = query.arg("contents", contents.into());
13177        if let Some(permissions) = opts.permissions {
13178            query = query.arg("permissions", permissions);
13179        }
13180        File {
13181            proc: self.proc.clone(),
13182            selection: query,
13183            graphql_client: self.graphql_client.clone(),
13184        }
13185    }
13186    /// Creates a function.
13187    ///
13188    /// # Arguments
13189    ///
13190    /// * `name` - Name of the function, in its original format from the implementation language.
13191    /// * `return_type` - Return type of the function.
13192    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13193        let mut query = self.selection.select("function");
13194        query = query.arg("name", name.into());
13195        query = query.arg_lazy(
13196            "returnType",
13197            Box::new(move || {
13198                let return_type = return_type.clone();
13199                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13200            }),
13201        );
13202        Function {
13203            proc: self.proc.clone(),
13204            selection: query,
13205            graphql_client: self.graphql_client.clone(),
13206        }
13207    }
13208    /// Create a code generation result, given a directory containing the generated code.
13209    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13210        let mut query = self.selection.select("generatedCode");
13211        query = query.arg_lazy(
13212            "code",
13213            Box::new(move || {
13214                let code = code.clone();
13215                Box::pin(async move { code.into_id().await.unwrap().quote() })
13216            }),
13217        );
13218        GeneratedCode {
13219            proc: self.proc.clone(),
13220            selection: query,
13221            graphql_client: self.graphql_client.clone(),
13222        }
13223    }
13224    /// Queries a Git repository.
13225    ///
13226    /// # Arguments
13227    ///
13228    /// * `url` - URL of the git repository.
13229    ///
13230    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13231    ///
13232    /// Suffix ".git" is optional.
13233    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13234    pub fn git(&self, url: impl Into<String>) -> GitRepository {
13235        let mut query = self.selection.select("git");
13236        query = query.arg("url", url.into());
13237        GitRepository {
13238            proc: self.proc.clone(),
13239            selection: query,
13240            graphql_client: self.graphql_client.clone(),
13241        }
13242    }
13243    /// Queries a Git repository.
13244    ///
13245    /// # Arguments
13246    ///
13247    /// * `url` - URL of the git repository.
13248    ///
13249    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13250    ///
13251    /// Suffix ".git" is optional.
13252    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13253    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13254        let mut query = self.selection.select("git");
13255        query = query.arg("url", url.into());
13256        if let Some(keep_git_dir) = opts.keep_git_dir {
13257            query = query.arg("keepGitDir", keep_git_dir);
13258        }
13259        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13260            query = query.arg("sshKnownHosts", ssh_known_hosts);
13261        }
13262        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13263            query = query.arg("sshAuthSocket", ssh_auth_socket);
13264        }
13265        if let Some(http_auth_username) = opts.http_auth_username {
13266            query = query.arg("httpAuthUsername", http_auth_username);
13267        }
13268        if let Some(http_auth_token) = opts.http_auth_token {
13269            query = query.arg("httpAuthToken", http_auth_token);
13270        }
13271        if let Some(http_auth_header) = opts.http_auth_header {
13272            query = query.arg("httpAuthHeader", http_auth_header);
13273        }
13274        if let Some(experimental_service_host) = opts.experimental_service_host {
13275            query = query.arg("experimentalServiceHost", experimental_service_host);
13276        }
13277        GitRepository {
13278            proc: self.proc.clone(),
13279            selection: query,
13280            graphql_client: self.graphql_client.clone(),
13281        }
13282    }
13283    /// Queries the host environment.
13284    pub fn host(&self) -> Host {
13285        let query = self.selection.select("host");
13286        Host {
13287            proc: self.proc.clone(),
13288            selection: query,
13289            graphql_client: self.graphql_client.clone(),
13290        }
13291    }
13292    /// Returns a file containing an http remote url content.
13293    ///
13294    /// # Arguments
13295    ///
13296    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13297    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13298    pub fn http(&self, url: impl Into<String>) -> File {
13299        let mut query = self.selection.select("http");
13300        query = query.arg("url", url.into());
13301        File {
13302            proc: self.proc.clone(),
13303            selection: query,
13304            graphql_client: self.graphql_client.clone(),
13305        }
13306    }
13307    /// Returns a file containing an http remote url content.
13308    ///
13309    /// # Arguments
13310    ///
13311    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13312    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13313    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13314        let mut query = self.selection.select("http");
13315        query = query.arg("url", url.into());
13316        if let Some(name) = opts.name {
13317            query = query.arg("name", name);
13318        }
13319        if let Some(permissions) = opts.permissions {
13320            query = query.arg("permissions", permissions);
13321        }
13322        if let Some(checksum) = opts.checksum {
13323            query = query.arg("checksum", checksum);
13324        }
13325        if let Some(auth_header) = opts.auth_header {
13326            query = query.arg("authHeader", auth_header);
13327        }
13328        if let Some(experimental_service_host) = opts.experimental_service_host {
13329            query = query.arg("experimentalServiceHost", experimental_service_host);
13330        }
13331        File {
13332            proc: self.proc.clone(),
13333            selection: query,
13334            graphql_client: self.graphql_client.clone(),
13335        }
13336    }
13337    /// A unique identifier for this Query.
13338    pub async fn id(&self) -> Result<Id, DaggerError> {
13339        let query = self.selection.select("id");
13340        query.execute(self.graphql_client.clone()).await
13341    }
13342    /// Initialize a JSON value
13343    pub fn json(&self) -> JsonValue {
13344        let query = self.selection.select("json");
13345        JsonValue {
13346            proc: self.proc.clone(),
13347            selection: query,
13348            graphql_client: self.graphql_client.clone(),
13349        }
13350    }
13351    /// Initialize a Large Language Model (LLM)
13352    ///
13353    /// # Arguments
13354    ///
13355    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13356    pub fn llm(&self) -> Llm {
13357        let query = self.selection.select("llm");
13358        Llm {
13359            proc: self.proc.clone(),
13360            selection: query,
13361            graphql_client: self.graphql_client.clone(),
13362        }
13363    }
13364    /// Initialize a Large Language Model (LLM)
13365    ///
13366    /// # Arguments
13367    ///
13368    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13369    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13370        let mut query = self.selection.select("llm");
13371        if let Some(model) = opts.model {
13372            query = query.arg("model", model);
13373        }
13374        if let Some(max_api_calls) = opts.max_api_calls {
13375            query = query.arg("maxAPICalls", max_api_calls);
13376        }
13377        Llm {
13378            proc: self.proc.clone(),
13379            selection: query,
13380            graphql_client: self.graphql_client.clone(),
13381        }
13382    }
13383    /// Load a Address from its ID.
13384    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13385        let mut query = self.selection.select("loadAddressFromID");
13386        query = query.arg_lazy(
13387            "id",
13388            Box::new(move || {
13389                let id = id.clone();
13390                Box::pin(async move { id.into_id().await.unwrap().quote() })
13391            }),
13392        );
13393        Address {
13394            proc: self.proc.clone(),
13395            selection: query,
13396            graphql_client: self.graphql_client.clone(),
13397        }
13398    }
13399    /// Load a Binding from its ID.
13400    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13401        let mut query = self.selection.select("loadBindingFromID");
13402        query = query.arg_lazy(
13403            "id",
13404            Box::new(move || {
13405                let id = id.clone();
13406                Box::pin(async move { id.into_id().await.unwrap().quote() })
13407            }),
13408        );
13409        Binding {
13410            proc: self.proc.clone(),
13411            selection: query,
13412            graphql_client: self.graphql_client.clone(),
13413        }
13414    }
13415    /// Load a CacheVolume from its ID.
13416    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13417        let mut query = self.selection.select("loadCacheVolumeFromID");
13418        query = query.arg_lazy(
13419            "id",
13420            Box::new(move || {
13421                let id = id.clone();
13422                Box::pin(async move { id.into_id().await.unwrap().quote() })
13423            }),
13424        );
13425        CacheVolume {
13426            proc: self.proc.clone(),
13427            selection: query,
13428            graphql_client: self.graphql_client.clone(),
13429        }
13430    }
13431    /// Load a Changeset from its ID.
13432    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13433        let mut query = self.selection.select("loadChangesetFromID");
13434        query = query.arg_lazy(
13435            "id",
13436            Box::new(move || {
13437                let id = id.clone();
13438                Box::pin(async move { id.into_id().await.unwrap().quote() })
13439            }),
13440        );
13441        Changeset {
13442            proc: self.proc.clone(),
13443            selection: query,
13444            graphql_client: self.graphql_client.clone(),
13445        }
13446    }
13447    /// Load a Check from its ID.
13448    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13449        let mut query = self.selection.select("loadCheckFromID");
13450        query = query.arg_lazy(
13451            "id",
13452            Box::new(move || {
13453                let id = id.clone();
13454                Box::pin(async move { id.into_id().await.unwrap().quote() })
13455            }),
13456        );
13457        Check {
13458            proc: self.proc.clone(),
13459            selection: query,
13460            graphql_client: self.graphql_client.clone(),
13461        }
13462    }
13463    /// Load a CheckGroup from its ID.
13464    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13465        let mut query = self.selection.select("loadCheckGroupFromID");
13466        query = query.arg_lazy(
13467            "id",
13468            Box::new(move || {
13469                let id = id.clone();
13470                Box::pin(async move { id.into_id().await.unwrap().quote() })
13471            }),
13472        );
13473        CheckGroup {
13474            proc: self.proc.clone(),
13475            selection: query,
13476            graphql_client: self.graphql_client.clone(),
13477        }
13478    }
13479    /// Load a ClientFilesyncMirror from its ID.
13480    pub fn load_client_filesync_mirror_from_id(
13481        &self,
13482        id: impl IntoID<ClientFilesyncMirrorId>,
13483    ) -> ClientFilesyncMirror {
13484        let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13485        query = query.arg_lazy(
13486            "id",
13487            Box::new(move || {
13488                let id = id.clone();
13489                Box::pin(async move { id.into_id().await.unwrap().quote() })
13490            }),
13491        );
13492        ClientFilesyncMirror {
13493            proc: self.proc.clone(),
13494            selection: query,
13495            graphql_client: self.graphql_client.clone(),
13496        }
13497    }
13498    /// Load a Cloud from its ID.
13499    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13500        let mut query = self.selection.select("loadCloudFromID");
13501        query = query.arg_lazy(
13502            "id",
13503            Box::new(move || {
13504                let id = id.clone();
13505                Box::pin(async move { id.into_id().await.unwrap().quote() })
13506            }),
13507        );
13508        Cloud {
13509            proc: self.proc.clone(),
13510            selection: query,
13511            graphql_client: self.graphql_client.clone(),
13512        }
13513    }
13514    /// Load a Container from its ID.
13515    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13516        let mut query = self.selection.select("loadContainerFromID");
13517        query = query.arg_lazy(
13518            "id",
13519            Box::new(move || {
13520                let id = id.clone();
13521                Box::pin(async move { id.into_id().await.unwrap().quote() })
13522            }),
13523        );
13524        Container {
13525            proc: self.proc.clone(),
13526            selection: query,
13527            graphql_client: self.graphql_client.clone(),
13528        }
13529    }
13530    /// Load a CurrentModule from its ID.
13531    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13532        let mut query = self.selection.select("loadCurrentModuleFromID");
13533        query = query.arg_lazy(
13534            "id",
13535            Box::new(move || {
13536                let id = id.clone();
13537                Box::pin(async move { id.into_id().await.unwrap().quote() })
13538            }),
13539        );
13540        CurrentModule {
13541            proc: self.proc.clone(),
13542            selection: query,
13543            graphql_client: self.graphql_client.clone(),
13544        }
13545    }
13546    /// Load a DiffStat from its ID.
13547    pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13548        let mut query = self.selection.select("loadDiffStatFromID");
13549        query = query.arg_lazy(
13550            "id",
13551            Box::new(move || {
13552                let id = id.clone();
13553                Box::pin(async move { id.into_id().await.unwrap().quote() })
13554            }),
13555        );
13556        DiffStat {
13557            proc: self.proc.clone(),
13558            selection: query,
13559            graphql_client: self.graphql_client.clone(),
13560        }
13561    }
13562    /// Load a Directory from its ID.
13563    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13564        let mut query = self.selection.select("loadDirectoryFromID");
13565        query = query.arg_lazy(
13566            "id",
13567            Box::new(move || {
13568                let id = id.clone();
13569                Box::pin(async move { id.into_id().await.unwrap().quote() })
13570            }),
13571        );
13572        Directory {
13573            proc: self.proc.clone(),
13574            selection: query,
13575            graphql_client: self.graphql_client.clone(),
13576        }
13577    }
13578    /// Load a EngineCacheEntry from its ID.
13579    pub fn load_engine_cache_entry_from_id(
13580        &self,
13581        id: impl IntoID<EngineCacheEntryId>,
13582    ) -> EngineCacheEntry {
13583        let mut query = self.selection.select("loadEngineCacheEntryFromID");
13584        query = query.arg_lazy(
13585            "id",
13586            Box::new(move || {
13587                let id = id.clone();
13588                Box::pin(async move { id.into_id().await.unwrap().quote() })
13589            }),
13590        );
13591        EngineCacheEntry {
13592            proc: self.proc.clone(),
13593            selection: query,
13594            graphql_client: self.graphql_client.clone(),
13595        }
13596    }
13597    /// Load a EngineCacheEntrySet from its ID.
13598    pub fn load_engine_cache_entry_set_from_id(
13599        &self,
13600        id: impl IntoID<EngineCacheEntrySetId>,
13601    ) -> EngineCacheEntrySet {
13602        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13603        query = query.arg_lazy(
13604            "id",
13605            Box::new(move || {
13606                let id = id.clone();
13607                Box::pin(async move { id.into_id().await.unwrap().quote() })
13608            }),
13609        );
13610        EngineCacheEntrySet {
13611            proc: self.proc.clone(),
13612            selection: query,
13613            graphql_client: self.graphql_client.clone(),
13614        }
13615    }
13616    /// Load a EngineCache from its ID.
13617    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13618        let mut query = self.selection.select("loadEngineCacheFromID");
13619        query = query.arg_lazy(
13620            "id",
13621            Box::new(move || {
13622                let id = id.clone();
13623                Box::pin(async move { id.into_id().await.unwrap().quote() })
13624            }),
13625        );
13626        EngineCache {
13627            proc: self.proc.clone(),
13628            selection: query,
13629            graphql_client: self.graphql_client.clone(),
13630        }
13631    }
13632    /// Load a Engine from its ID.
13633    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13634        let mut query = self.selection.select("loadEngineFromID");
13635        query = query.arg_lazy(
13636            "id",
13637            Box::new(move || {
13638                let id = id.clone();
13639                Box::pin(async move { id.into_id().await.unwrap().quote() })
13640            }),
13641        );
13642        Engine {
13643            proc: self.proc.clone(),
13644            selection: query,
13645            graphql_client: self.graphql_client.clone(),
13646        }
13647    }
13648    /// Load a EnumTypeDef from its ID.
13649    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13650        let mut query = self.selection.select("loadEnumTypeDefFromID");
13651        query = query.arg_lazy(
13652            "id",
13653            Box::new(move || {
13654                let id = id.clone();
13655                Box::pin(async move { id.into_id().await.unwrap().quote() })
13656            }),
13657        );
13658        EnumTypeDef {
13659            proc: self.proc.clone(),
13660            selection: query,
13661            graphql_client: self.graphql_client.clone(),
13662        }
13663    }
13664    /// Load a EnumValueTypeDef from its ID.
13665    pub fn load_enum_value_type_def_from_id(
13666        &self,
13667        id: impl IntoID<EnumValueTypeDefId>,
13668    ) -> EnumValueTypeDef {
13669        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13670        query = query.arg_lazy(
13671            "id",
13672            Box::new(move || {
13673                let id = id.clone();
13674                Box::pin(async move { id.into_id().await.unwrap().quote() })
13675            }),
13676        );
13677        EnumValueTypeDef {
13678            proc: self.proc.clone(),
13679            selection: query,
13680            graphql_client: self.graphql_client.clone(),
13681        }
13682    }
13683    /// Load a EnvFile from its ID.
13684    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13685        let mut query = self.selection.select("loadEnvFileFromID");
13686        query = query.arg_lazy(
13687            "id",
13688            Box::new(move || {
13689                let id = id.clone();
13690                Box::pin(async move { id.into_id().await.unwrap().quote() })
13691            }),
13692        );
13693        EnvFile {
13694            proc: self.proc.clone(),
13695            selection: query,
13696            graphql_client: self.graphql_client.clone(),
13697        }
13698    }
13699    /// Load a Env from its ID.
13700    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13701        let mut query = self.selection.select("loadEnvFromID");
13702        query = query.arg_lazy(
13703            "id",
13704            Box::new(move || {
13705                let id = id.clone();
13706                Box::pin(async move { id.into_id().await.unwrap().quote() })
13707            }),
13708        );
13709        Env {
13710            proc: self.proc.clone(),
13711            selection: query,
13712            graphql_client: self.graphql_client.clone(),
13713        }
13714    }
13715    /// Load a EnvVariable from its ID.
13716    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13717        let mut query = self.selection.select("loadEnvVariableFromID");
13718        query = query.arg_lazy(
13719            "id",
13720            Box::new(move || {
13721                let id = id.clone();
13722                Box::pin(async move { id.into_id().await.unwrap().quote() })
13723            }),
13724        );
13725        EnvVariable {
13726            proc: self.proc.clone(),
13727            selection: query,
13728            graphql_client: self.graphql_client.clone(),
13729        }
13730    }
13731    /// Load a Error from its ID.
13732    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13733        let mut query = self.selection.select("loadErrorFromID");
13734        query = query.arg_lazy(
13735            "id",
13736            Box::new(move || {
13737                let id = id.clone();
13738                Box::pin(async move { id.into_id().await.unwrap().quote() })
13739            }),
13740        );
13741        Error {
13742            proc: self.proc.clone(),
13743            selection: query,
13744            graphql_client: self.graphql_client.clone(),
13745        }
13746    }
13747    /// Load a ErrorValue from its ID.
13748    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13749        let mut query = self.selection.select("loadErrorValueFromID");
13750        query = query.arg_lazy(
13751            "id",
13752            Box::new(move || {
13753                let id = id.clone();
13754                Box::pin(async move { id.into_id().await.unwrap().quote() })
13755            }),
13756        );
13757        ErrorValue {
13758            proc: self.proc.clone(),
13759            selection: query,
13760            graphql_client: self.graphql_client.clone(),
13761        }
13762    }
13763    /// Load a Exportable from its ID.
13764    pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13765        let mut query = self.selection.select("loadExportableFromID");
13766        query = query.arg_lazy(
13767            "id",
13768            Box::new(move || {
13769                let id = id.clone();
13770                Box::pin(async move { id.into_id().await.unwrap().quote() })
13771            }),
13772        );
13773        ExportableClient {
13774            proc: self.proc.clone(),
13775            selection: query,
13776            graphql_client: self.graphql_client.clone(),
13777        }
13778    }
13779    /// Load a FieldTypeDef from its ID.
13780    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13781        let mut query = self.selection.select("loadFieldTypeDefFromID");
13782        query = query.arg_lazy(
13783            "id",
13784            Box::new(move || {
13785                let id = id.clone();
13786                Box::pin(async move { id.into_id().await.unwrap().quote() })
13787            }),
13788        );
13789        FieldTypeDef {
13790            proc: self.proc.clone(),
13791            selection: query,
13792            graphql_client: self.graphql_client.clone(),
13793        }
13794    }
13795    /// Load a File from its ID.
13796    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13797        let mut query = self.selection.select("loadFileFromID");
13798        query = query.arg_lazy(
13799            "id",
13800            Box::new(move || {
13801                let id = id.clone();
13802                Box::pin(async move { id.into_id().await.unwrap().quote() })
13803            }),
13804        );
13805        File {
13806            proc: self.proc.clone(),
13807            selection: query,
13808            graphql_client: self.graphql_client.clone(),
13809        }
13810    }
13811    /// Load a FunctionArg from its ID.
13812    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13813        let mut query = self.selection.select("loadFunctionArgFromID");
13814        query = query.arg_lazy(
13815            "id",
13816            Box::new(move || {
13817                let id = id.clone();
13818                Box::pin(async move { id.into_id().await.unwrap().quote() })
13819            }),
13820        );
13821        FunctionArg {
13822            proc: self.proc.clone(),
13823            selection: query,
13824            graphql_client: self.graphql_client.clone(),
13825        }
13826    }
13827    /// Load a FunctionCallArgValue from its ID.
13828    pub fn load_function_call_arg_value_from_id(
13829        &self,
13830        id: impl IntoID<FunctionCallArgValueId>,
13831    ) -> FunctionCallArgValue {
13832        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13833        query = query.arg_lazy(
13834            "id",
13835            Box::new(move || {
13836                let id = id.clone();
13837                Box::pin(async move { id.into_id().await.unwrap().quote() })
13838            }),
13839        );
13840        FunctionCallArgValue {
13841            proc: self.proc.clone(),
13842            selection: query,
13843            graphql_client: self.graphql_client.clone(),
13844        }
13845    }
13846    /// Load a FunctionCall from its ID.
13847    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13848        let mut query = self.selection.select("loadFunctionCallFromID");
13849        query = query.arg_lazy(
13850            "id",
13851            Box::new(move || {
13852                let id = id.clone();
13853                Box::pin(async move { id.into_id().await.unwrap().quote() })
13854            }),
13855        );
13856        FunctionCall {
13857            proc: self.proc.clone(),
13858            selection: query,
13859            graphql_client: self.graphql_client.clone(),
13860        }
13861    }
13862    /// Load a Function from its ID.
13863    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13864        let mut query = self.selection.select("loadFunctionFromID");
13865        query = query.arg_lazy(
13866            "id",
13867            Box::new(move || {
13868                let id = id.clone();
13869                Box::pin(async move { id.into_id().await.unwrap().quote() })
13870            }),
13871        );
13872        Function {
13873            proc: self.proc.clone(),
13874            selection: query,
13875            graphql_client: self.graphql_client.clone(),
13876        }
13877    }
13878    /// Load a GeneratedCode from its ID.
13879    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13880        let mut query = self.selection.select("loadGeneratedCodeFromID");
13881        query = query.arg_lazy(
13882            "id",
13883            Box::new(move || {
13884                let id = id.clone();
13885                Box::pin(async move { id.into_id().await.unwrap().quote() })
13886            }),
13887        );
13888        GeneratedCode {
13889            proc: self.proc.clone(),
13890            selection: query,
13891            graphql_client: self.graphql_client.clone(),
13892        }
13893    }
13894    /// Load a Generator from its ID.
13895    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13896        let mut query = self.selection.select("loadGeneratorFromID");
13897        query = query.arg_lazy(
13898            "id",
13899            Box::new(move || {
13900                let id = id.clone();
13901                Box::pin(async move { id.into_id().await.unwrap().quote() })
13902            }),
13903        );
13904        Generator {
13905            proc: self.proc.clone(),
13906            selection: query,
13907            graphql_client: self.graphql_client.clone(),
13908        }
13909    }
13910    /// Load a GeneratorGroup from its ID.
13911    pub fn load_generator_group_from_id(
13912        &self,
13913        id: impl IntoID<GeneratorGroupId>,
13914    ) -> GeneratorGroup {
13915        let mut query = self.selection.select("loadGeneratorGroupFromID");
13916        query = query.arg_lazy(
13917            "id",
13918            Box::new(move || {
13919                let id = id.clone();
13920                Box::pin(async move { id.into_id().await.unwrap().quote() })
13921            }),
13922        );
13923        GeneratorGroup {
13924            proc: self.proc.clone(),
13925            selection: query,
13926            graphql_client: self.graphql_client.clone(),
13927        }
13928    }
13929    /// Load a GitRef from its ID.
13930    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13931        let mut query = self.selection.select("loadGitRefFromID");
13932        query = query.arg_lazy(
13933            "id",
13934            Box::new(move || {
13935                let id = id.clone();
13936                Box::pin(async move { id.into_id().await.unwrap().quote() })
13937            }),
13938        );
13939        GitRef {
13940            proc: self.proc.clone(),
13941            selection: query,
13942            graphql_client: self.graphql_client.clone(),
13943        }
13944    }
13945    /// Load a GitRepository from its ID.
13946    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13947        let mut query = self.selection.select("loadGitRepositoryFromID");
13948        query = query.arg_lazy(
13949            "id",
13950            Box::new(move || {
13951                let id = id.clone();
13952                Box::pin(async move { id.into_id().await.unwrap().quote() })
13953            }),
13954        );
13955        GitRepository {
13956            proc: self.proc.clone(),
13957            selection: query,
13958            graphql_client: self.graphql_client.clone(),
13959        }
13960    }
13961    /// Load a HTTPState from its ID.
13962    pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
13963        let mut query = self.selection.select("loadHTTPStateFromID");
13964        query = query.arg_lazy(
13965            "id",
13966            Box::new(move || {
13967                let id = id.clone();
13968                Box::pin(async move { id.into_id().await.unwrap().quote() })
13969            }),
13970        );
13971        HttpState {
13972            proc: self.proc.clone(),
13973            selection: query,
13974            graphql_client: self.graphql_client.clone(),
13975        }
13976    }
13977    /// Load a HealthcheckConfig from its ID.
13978    pub fn load_healthcheck_config_from_id(
13979        &self,
13980        id: impl IntoID<HealthcheckConfigId>,
13981    ) -> HealthcheckConfig {
13982        let mut query = self.selection.select("loadHealthcheckConfigFromID");
13983        query = query.arg_lazy(
13984            "id",
13985            Box::new(move || {
13986                let id = id.clone();
13987                Box::pin(async move { id.into_id().await.unwrap().quote() })
13988            }),
13989        );
13990        HealthcheckConfig {
13991            proc: self.proc.clone(),
13992            selection: query,
13993            graphql_client: self.graphql_client.clone(),
13994        }
13995    }
13996    /// Load a Host from its ID.
13997    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13998        let mut query = self.selection.select("loadHostFromID");
13999        query = query.arg_lazy(
14000            "id",
14001            Box::new(move || {
14002                let id = id.clone();
14003                Box::pin(async move { id.into_id().await.unwrap().quote() })
14004            }),
14005        );
14006        Host {
14007            proc: self.proc.clone(),
14008            selection: query,
14009            graphql_client: self.graphql_client.clone(),
14010        }
14011    }
14012    /// Load a InputTypeDef from its ID.
14013    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14014        let mut query = self.selection.select("loadInputTypeDefFromID");
14015        query = query.arg_lazy(
14016            "id",
14017            Box::new(move || {
14018                let id = id.clone();
14019                Box::pin(async move { id.into_id().await.unwrap().quote() })
14020            }),
14021        );
14022        InputTypeDef {
14023            proc: self.proc.clone(),
14024            selection: query,
14025            graphql_client: self.graphql_client.clone(),
14026        }
14027    }
14028    /// Load a InterfaceTypeDef from its ID.
14029    pub fn load_interface_type_def_from_id(
14030        &self,
14031        id: impl IntoID<InterfaceTypeDefId>,
14032    ) -> InterfaceTypeDef {
14033        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14034        query = query.arg_lazy(
14035            "id",
14036            Box::new(move || {
14037                let id = id.clone();
14038                Box::pin(async move { id.into_id().await.unwrap().quote() })
14039            }),
14040        );
14041        InterfaceTypeDef {
14042            proc: self.proc.clone(),
14043            selection: query,
14044            graphql_client: self.graphql_client.clone(),
14045        }
14046    }
14047    /// Load a JSONValue from its ID.
14048    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14049        let mut query = self.selection.select("loadJSONValueFromID");
14050        query = query.arg_lazy(
14051            "id",
14052            Box::new(move || {
14053                let id = id.clone();
14054                Box::pin(async move { id.into_id().await.unwrap().quote() })
14055            }),
14056        );
14057        JsonValue {
14058            proc: self.proc.clone(),
14059            selection: query,
14060            graphql_client: self.graphql_client.clone(),
14061        }
14062    }
14063    /// Load a LLM from its ID.
14064    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14065        let mut query = self.selection.select("loadLLMFromID");
14066        query = query.arg_lazy(
14067            "id",
14068            Box::new(move || {
14069                let id = id.clone();
14070                Box::pin(async move { id.into_id().await.unwrap().quote() })
14071            }),
14072        );
14073        Llm {
14074            proc: self.proc.clone(),
14075            selection: query,
14076            graphql_client: self.graphql_client.clone(),
14077        }
14078    }
14079    /// Load a LLMTokenUsage from its ID.
14080    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14081        let mut query = self.selection.select("loadLLMTokenUsageFromID");
14082        query = query.arg_lazy(
14083            "id",
14084            Box::new(move || {
14085                let id = id.clone();
14086                Box::pin(async move { id.into_id().await.unwrap().quote() })
14087            }),
14088        );
14089        LlmTokenUsage {
14090            proc: self.proc.clone(),
14091            selection: query,
14092            graphql_client: self.graphql_client.clone(),
14093        }
14094    }
14095    /// Load a Label from its ID.
14096    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14097        let mut query = self.selection.select("loadLabelFromID");
14098        query = query.arg_lazy(
14099            "id",
14100            Box::new(move || {
14101                let id = id.clone();
14102                Box::pin(async move { id.into_id().await.unwrap().quote() })
14103            }),
14104        );
14105        Label {
14106            proc: self.proc.clone(),
14107            selection: query,
14108            graphql_client: self.graphql_client.clone(),
14109        }
14110    }
14111    /// Load a ListTypeDef from its ID.
14112    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14113        let mut query = self.selection.select("loadListTypeDefFromID");
14114        query = query.arg_lazy(
14115            "id",
14116            Box::new(move || {
14117                let id = id.clone();
14118                Box::pin(async move { id.into_id().await.unwrap().quote() })
14119            }),
14120        );
14121        ListTypeDef {
14122            proc: self.proc.clone(),
14123            selection: query,
14124            graphql_client: self.graphql_client.clone(),
14125        }
14126    }
14127    /// Load a ModuleConfigClient from its ID.
14128    pub fn load_module_config_client_from_id(
14129        &self,
14130        id: impl IntoID<ModuleConfigClientId>,
14131    ) -> ModuleConfigClient {
14132        let mut query = self.selection.select("loadModuleConfigClientFromID");
14133        query = query.arg_lazy(
14134            "id",
14135            Box::new(move || {
14136                let id = id.clone();
14137                Box::pin(async move { id.into_id().await.unwrap().quote() })
14138            }),
14139        );
14140        ModuleConfigClient {
14141            proc: self.proc.clone(),
14142            selection: query,
14143            graphql_client: self.graphql_client.clone(),
14144        }
14145    }
14146    /// Load a Module from its ID.
14147    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14148        let mut query = self.selection.select("loadModuleFromID");
14149        query = query.arg_lazy(
14150            "id",
14151            Box::new(move || {
14152                let id = id.clone();
14153                Box::pin(async move { id.into_id().await.unwrap().quote() })
14154            }),
14155        );
14156        Module {
14157            proc: self.proc.clone(),
14158            selection: query,
14159            graphql_client: self.graphql_client.clone(),
14160        }
14161    }
14162    /// Load a ModuleSource from its ID.
14163    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14164        let mut query = self.selection.select("loadModuleSourceFromID");
14165        query = query.arg_lazy(
14166            "id",
14167            Box::new(move || {
14168                let id = id.clone();
14169                Box::pin(async move { id.into_id().await.unwrap().quote() })
14170            }),
14171        );
14172        ModuleSource {
14173            proc: self.proc.clone(),
14174            selection: query,
14175            graphql_client: self.graphql_client.clone(),
14176        }
14177    }
14178    /// Load a ObjectTypeDef from its ID.
14179    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14180        let mut query = self.selection.select("loadObjectTypeDefFromID");
14181        query = query.arg_lazy(
14182            "id",
14183            Box::new(move || {
14184                let id = id.clone();
14185                Box::pin(async move { id.into_id().await.unwrap().quote() })
14186            }),
14187        );
14188        ObjectTypeDef {
14189            proc: self.proc.clone(),
14190            selection: query,
14191            graphql_client: self.graphql_client.clone(),
14192        }
14193    }
14194    /// Load a Port from its ID.
14195    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14196        let mut query = self.selection.select("loadPortFromID");
14197        query = query.arg_lazy(
14198            "id",
14199            Box::new(move || {
14200                let id = id.clone();
14201                Box::pin(async move { id.into_id().await.unwrap().quote() })
14202            }),
14203        );
14204        Port {
14205            proc: self.proc.clone(),
14206            selection: query,
14207            graphql_client: self.graphql_client.clone(),
14208        }
14209    }
14210    /// Load a RemoteGitMirror from its ID.
14211    pub fn load_remote_git_mirror_from_id(
14212        &self,
14213        id: impl IntoID<RemoteGitMirrorId>,
14214    ) -> RemoteGitMirror {
14215        let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14216        query = query.arg_lazy(
14217            "id",
14218            Box::new(move || {
14219                let id = id.clone();
14220                Box::pin(async move { id.into_id().await.unwrap().quote() })
14221            }),
14222        );
14223        RemoteGitMirror {
14224            proc: self.proc.clone(),
14225            selection: query,
14226            graphql_client: self.graphql_client.clone(),
14227        }
14228    }
14229    /// Load a SDKConfig from its ID.
14230    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14231        let mut query = self.selection.select("loadSDKConfigFromID");
14232        query = query.arg_lazy(
14233            "id",
14234            Box::new(move || {
14235                let id = id.clone();
14236                Box::pin(async move { id.into_id().await.unwrap().quote() })
14237            }),
14238        );
14239        SdkConfig {
14240            proc: self.proc.clone(),
14241            selection: query,
14242            graphql_client: self.graphql_client.clone(),
14243        }
14244    }
14245    /// Load a ScalarTypeDef from its ID.
14246    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14247        let mut query = self.selection.select("loadScalarTypeDefFromID");
14248        query = query.arg_lazy(
14249            "id",
14250            Box::new(move || {
14251                let id = id.clone();
14252                Box::pin(async move { id.into_id().await.unwrap().quote() })
14253            }),
14254        );
14255        ScalarTypeDef {
14256            proc: self.proc.clone(),
14257            selection: query,
14258            graphql_client: self.graphql_client.clone(),
14259        }
14260    }
14261    /// Load a SearchResult from its ID.
14262    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14263        let mut query = self.selection.select("loadSearchResultFromID");
14264        query = query.arg_lazy(
14265            "id",
14266            Box::new(move || {
14267                let id = id.clone();
14268                Box::pin(async move { id.into_id().await.unwrap().quote() })
14269            }),
14270        );
14271        SearchResult {
14272            proc: self.proc.clone(),
14273            selection: query,
14274            graphql_client: self.graphql_client.clone(),
14275        }
14276    }
14277    /// Load a SearchSubmatch from its ID.
14278    pub fn load_search_submatch_from_id(
14279        &self,
14280        id: impl IntoID<SearchSubmatchId>,
14281    ) -> SearchSubmatch {
14282        let mut query = self.selection.select("loadSearchSubmatchFromID");
14283        query = query.arg_lazy(
14284            "id",
14285            Box::new(move || {
14286                let id = id.clone();
14287                Box::pin(async move { id.into_id().await.unwrap().quote() })
14288            }),
14289        );
14290        SearchSubmatch {
14291            proc: self.proc.clone(),
14292            selection: query,
14293            graphql_client: self.graphql_client.clone(),
14294        }
14295    }
14296    /// Load a Secret from its ID.
14297    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14298        let mut query = self.selection.select("loadSecretFromID");
14299        query = query.arg_lazy(
14300            "id",
14301            Box::new(move || {
14302                let id = id.clone();
14303                Box::pin(async move { id.into_id().await.unwrap().quote() })
14304            }),
14305        );
14306        Secret {
14307            proc: self.proc.clone(),
14308            selection: query,
14309            graphql_client: self.graphql_client.clone(),
14310        }
14311    }
14312    /// Load a Service from its ID.
14313    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14314        let mut query = self.selection.select("loadServiceFromID");
14315        query = query.arg_lazy(
14316            "id",
14317            Box::new(move || {
14318                let id = id.clone();
14319                Box::pin(async move { id.into_id().await.unwrap().quote() })
14320            }),
14321        );
14322        Service {
14323            proc: self.proc.clone(),
14324            selection: query,
14325            graphql_client: self.graphql_client.clone(),
14326        }
14327    }
14328    /// Load a Socket from its ID.
14329    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14330        let mut query = self.selection.select("loadSocketFromID");
14331        query = query.arg_lazy(
14332            "id",
14333            Box::new(move || {
14334                let id = id.clone();
14335                Box::pin(async move { id.into_id().await.unwrap().quote() })
14336            }),
14337        );
14338        Socket {
14339            proc: self.proc.clone(),
14340            selection: query,
14341            graphql_client: self.graphql_client.clone(),
14342        }
14343    }
14344    /// Load a SourceMap from its ID.
14345    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14346        let mut query = self.selection.select("loadSourceMapFromID");
14347        query = query.arg_lazy(
14348            "id",
14349            Box::new(move || {
14350                let id = id.clone();
14351                Box::pin(async move { id.into_id().await.unwrap().quote() })
14352            }),
14353        );
14354        SourceMap {
14355            proc: self.proc.clone(),
14356            selection: query,
14357            graphql_client: self.graphql_client.clone(),
14358        }
14359    }
14360    /// Load a Stat from its ID.
14361    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14362        let mut query = self.selection.select("loadStatFromID");
14363        query = query.arg_lazy(
14364            "id",
14365            Box::new(move || {
14366                let id = id.clone();
14367                Box::pin(async move { id.into_id().await.unwrap().quote() })
14368            }),
14369        );
14370        Stat {
14371            proc: self.proc.clone(),
14372            selection: query,
14373            graphql_client: self.graphql_client.clone(),
14374        }
14375    }
14376    /// Load a Syncer from its ID.
14377    pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14378        let mut query = self.selection.select("loadSyncerFromID");
14379        query = query.arg_lazy(
14380            "id",
14381            Box::new(move || {
14382                let id = id.clone();
14383                Box::pin(async move { id.into_id().await.unwrap().quote() })
14384            }),
14385        );
14386        SyncerClient {
14387            proc: self.proc.clone(),
14388            selection: query,
14389            graphql_client: self.graphql_client.clone(),
14390        }
14391    }
14392    /// Load a Terminal from its ID.
14393    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14394        let mut query = self.selection.select("loadTerminalFromID");
14395        query = query.arg_lazy(
14396            "id",
14397            Box::new(move || {
14398                let id = id.clone();
14399                Box::pin(async move { id.into_id().await.unwrap().quote() })
14400            }),
14401        );
14402        Terminal {
14403            proc: self.proc.clone(),
14404            selection: query,
14405            graphql_client: self.graphql_client.clone(),
14406        }
14407    }
14408    /// Load a TypeDef from its ID.
14409    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14410        let mut query = self.selection.select("loadTypeDefFromID");
14411        query = query.arg_lazy(
14412            "id",
14413            Box::new(move || {
14414                let id = id.clone();
14415                Box::pin(async move { id.into_id().await.unwrap().quote() })
14416            }),
14417        );
14418        TypeDef {
14419            proc: self.proc.clone(),
14420            selection: query,
14421            graphql_client: self.graphql_client.clone(),
14422        }
14423    }
14424    /// Load a Up from its ID.
14425    pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14426        let mut query = self.selection.select("loadUpFromID");
14427        query = query.arg_lazy(
14428            "id",
14429            Box::new(move || {
14430                let id = id.clone();
14431                Box::pin(async move { id.into_id().await.unwrap().quote() })
14432            }),
14433        );
14434        Up {
14435            proc: self.proc.clone(),
14436            selection: query,
14437            graphql_client: self.graphql_client.clone(),
14438        }
14439    }
14440    /// Load a UpGroup from its ID.
14441    pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14442        let mut query = self.selection.select("loadUpGroupFromID");
14443        query = query.arg_lazy(
14444            "id",
14445            Box::new(move || {
14446                let id = id.clone();
14447                Box::pin(async move { id.into_id().await.unwrap().quote() })
14448            }),
14449        );
14450        UpGroup {
14451            proc: self.proc.clone(),
14452            selection: query,
14453            graphql_client: self.graphql_client.clone(),
14454        }
14455    }
14456    /// Load a Workspace from its ID.
14457    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14458        let mut query = self.selection.select("loadWorkspaceFromID");
14459        query = query.arg_lazy(
14460            "id",
14461            Box::new(move || {
14462                let id = id.clone();
14463                Box::pin(async move { id.into_id().await.unwrap().quote() })
14464            }),
14465        );
14466        Workspace {
14467            proc: self.proc.clone(),
14468            selection: query,
14469            graphql_client: self.graphql_client.clone(),
14470        }
14471    }
14472    /// Create a new module.
14473    pub fn module(&self) -> Module {
14474        let query = self.selection.select("module");
14475        Module {
14476            proc: self.proc.clone(),
14477            selection: query,
14478            graphql_client: self.graphql_client.clone(),
14479        }
14480    }
14481    /// Create a new module source instance from a source ref string
14482    ///
14483    /// # Arguments
14484    ///
14485    /// * `ref_string` - The string ref representation of the module source
14486    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14487    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14488        let mut query = self.selection.select("moduleSource");
14489        query = query.arg("refString", ref_string.into());
14490        ModuleSource {
14491            proc: self.proc.clone(),
14492            selection: query,
14493            graphql_client: self.graphql_client.clone(),
14494        }
14495    }
14496    /// Create a new module source instance from a source ref string
14497    ///
14498    /// # Arguments
14499    ///
14500    /// * `ref_string` - The string ref representation of the module source
14501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14502    pub fn module_source_opts<'a>(
14503        &self,
14504        ref_string: impl Into<String>,
14505        opts: QueryModuleSourceOpts<'a>,
14506    ) -> ModuleSource {
14507        let mut query = self.selection.select("moduleSource");
14508        query = query.arg("refString", ref_string.into());
14509        if let Some(ref_pin) = opts.ref_pin {
14510            query = query.arg("refPin", ref_pin);
14511        }
14512        if let Some(disable_find_up) = opts.disable_find_up {
14513            query = query.arg("disableFindUp", disable_find_up);
14514        }
14515        if let Some(allow_not_exists) = opts.allow_not_exists {
14516            query = query.arg("allowNotExists", allow_not_exists);
14517        }
14518        if let Some(require_kind) = opts.require_kind {
14519            query = query.arg("requireKind", require_kind);
14520        }
14521        ModuleSource {
14522            proc: self.proc.clone(),
14523            selection: query,
14524            graphql_client: self.graphql_client.clone(),
14525        }
14526    }
14527    /// Load any object by its ID.
14528    pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14529        let mut query = self.selection.select("node");
14530        query = query.arg_lazy(
14531            "id",
14532            Box::new(move || {
14533                let id = id.clone();
14534                Box::pin(async move { id.into_id().await.unwrap().quote() })
14535            }),
14536        );
14537        NodeClient {
14538            proc: self.proc.clone(),
14539            selection: query,
14540            graphql_client: self.graphql_client.clone(),
14541        }
14542    }
14543    /// Creates a new secret.
14544    ///
14545    /// # Arguments
14546    ///
14547    /// * `uri` - The URI of the secret store
14548    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14549    pub fn secret(&self, uri: impl Into<String>) -> Secret {
14550        let mut query = self.selection.select("secret");
14551        query = query.arg("uri", uri.into());
14552        Secret {
14553            proc: self.proc.clone(),
14554            selection: query,
14555            graphql_client: self.graphql_client.clone(),
14556        }
14557    }
14558    /// Creates a new secret.
14559    ///
14560    /// # Arguments
14561    ///
14562    /// * `uri` - The URI of the secret store
14563    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14564    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14565        let mut query = self.selection.select("secret");
14566        query = query.arg("uri", uri.into());
14567        if let Some(cache_key) = opts.cache_key {
14568            query = query.arg("cacheKey", cache_key);
14569        }
14570        Secret {
14571            proc: self.proc.clone(),
14572            selection: query,
14573            graphql_client: self.graphql_client.clone(),
14574        }
14575    }
14576    /// Sets a secret given a user defined name to its plaintext and returns the secret.
14577    /// The plaintext value is limited to a size of 128000 bytes.
14578    ///
14579    /// # Arguments
14580    ///
14581    /// * `name` - The user defined name for this secret
14582    /// * `plaintext` - The plaintext of the secret
14583    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14584        let mut query = self.selection.select("setSecret");
14585        query = query.arg("name", name.into());
14586        query = query.arg("plaintext", plaintext.into());
14587        Secret {
14588            proc: self.proc.clone(),
14589            selection: query,
14590            graphql_client: self.graphql_client.clone(),
14591        }
14592    }
14593    /// Creates source map metadata.
14594    ///
14595    /// # Arguments
14596    ///
14597    /// * `filename` - The filename from the module source.
14598    /// * `line` - The line number within the filename.
14599    /// * `column` - The column number within the line.
14600    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14601        let mut query = self.selection.select("sourceMap");
14602        query = query.arg("filename", filename.into());
14603        query = query.arg("line", line);
14604        query = query.arg("column", column);
14605        SourceMap {
14606            proc: self.proc.clone(),
14607            selection: query,
14608            graphql_client: self.graphql_client.clone(),
14609        }
14610    }
14611    /// Create a new TypeDef.
14612    pub fn type_def(&self) -> TypeDef {
14613        let query = self.selection.select("typeDef");
14614        TypeDef {
14615            proc: self.proc.clone(),
14616            selection: query,
14617            graphql_client: self.graphql_client.clone(),
14618        }
14619    }
14620    /// Get the current Dagger Engine version.
14621    pub async fn version(&self) -> Result<String, DaggerError> {
14622        let query = self.selection.select("version");
14623        query.execute(self.graphql_client.clone()).await
14624    }
14625}
14626impl Node for Query {
14627    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14628        let query = self.selection.select("id");
14629        let graphql_client = self.graphql_client.clone();
14630        async move { query.execute(graphql_client).await }
14631    }
14632}
14633#[derive(Clone)]
14634pub struct RemoteGitMirror {
14635    pub proc: Option<Arc<DaggerSessionProc>>,
14636    pub selection: Selection,
14637    pub graphql_client: DynGraphQLClient,
14638}
14639impl IntoID<Id> for RemoteGitMirror {
14640    fn into_id(
14641        self,
14642    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14643        Box::pin(async move { self.id().await })
14644    }
14645}
14646impl Loadable for RemoteGitMirror {
14647    fn graphql_type() -> &'static str {
14648        "RemoteGitMirror"
14649    }
14650    fn from_query(
14651        proc: Option<Arc<DaggerSessionProc>>,
14652        selection: Selection,
14653        graphql_client: DynGraphQLClient,
14654    ) -> Self {
14655        Self {
14656            proc,
14657            selection,
14658            graphql_client,
14659        }
14660    }
14661}
14662impl RemoteGitMirror {
14663    /// A unique identifier for this RemoteGitMirror.
14664    pub async fn id(&self) -> Result<Id, DaggerError> {
14665        let query = self.selection.select("id");
14666        query.execute(self.graphql_client.clone()).await
14667    }
14668}
14669impl Node for RemoteGitMirror {
14670    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14671        let query = self.selection.select("id");
14672        let graphql_client = self.graphql_client.clone();
14673        async move { query.execute(graphql_client).await }
14674    }
14675}
14676#[derive(Clone)]
14677pub struct SdkConfig {
14678    pub proc: Option<Arc<DaggerSessionProc>>,
14679    pub selection: Selection,
14680    pub graphql_client: DynGraphQLClient,
14681}
14682impl IntoID<Id> for SdkConfig {
14683    fn into_id(
14684        self,
14685    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14686        Box::pin(async move { self.id().await })
14687    }
14688}
14689impl Loadable for SdkConfig {
14690    fn graphql_type() -> &'static str {
14691        "SDKConfig"
14692    }
14693    fn from_query(
14694        proc: Option<Arc<DaggerSessionProc>>,
14695        selection: Selection,
14696        graphql_client: DynGraphQLClient,
14697    ) -> Self {
14698        Self {
14699            proc,
14700            selection,
14701            graphql_client,
14702        }
14703    }
14704}
14705impl SdkConfig {
14706    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
14707    pub async fn debug(&self) -> Result<bool, DaggerError> {
14708        let query = self.selection.select("debug");
14709        query.execute(self.graphql_client.clone()).await
14710    }
14711    /// A unique identifier for this SDKConfig.
14712    pub async fn id(&self) -> Result<Id, DaggerError> {
14713        let query = self.selection.select("id");
14714        query.execute(self.graphql_client.clone()).await
14715    }
14716    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
14717    pub async fn source(&self) -> Result<String, DaggerError> {
14718        let query = self.selection.select("source");
14719        query.execute(self.graphql_client.clone()).await
14720    }
14721}
14722impl Node for SdkConfig {
14723    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14724        let query = self.selection.select("id");
14725        let graphql_client = self.graphql_client.clone();
14726        async move { query.execute(graphql_client).await }
14727    }
14728}
14729#[derive(Clone)]
14730pub struct ScalarTypeDef {
14731    pub proc: Option<Arc<DaggerSessionProc>>,
14732    pub selection: Selection,
14733    pub graphql_client: DynGraphQLClient,
14734}
14735impl IntoID<Id> for ScalarTypeDef {
14736    fn into_id(
14737        self,
14738    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14739        Box::pin(async move { self.id().await })
14740    }
14741}
14742impl Loadable for ScalarTypeDef {
14743    fn graphql_type() -> &'static str {
14744        "ScalarTypeDef"
14745    }
14746    fn from_query(
14747        proc: Option<Arc<DaggerSessionProc>>,
14748        selection: Selection,
14749        graphql_client: DynGraphQLClient,
14750    ) -> Self {
14751        Self {
14752            proc,
14753            selection,
14754            graphql_client,
14755        }
14756    }
14757}
14758impl ScalarTypeDef {
14759    /// A doc string for the scalar, if any.
14760    pub async fn description(&self) -> Result<String, DaggerError> {
14761        let query = self.selection.select("description");
14762        query.execute(self.graphql_client.clone()).await
14763    }
14764    /// A unique identifier for this ScalarTypeDef.
14765    pub async fn id(&self) -> Result<Id, DaggerError> {
14766        let query = self.selection.select("id");
14767        query.execute(self.graphql_client.clone()).await
14768    }
14769    /// The name of the scalar.
14770    pub async fn name(&self) -> Result<String, DaggerError> {
14771        let query = self.selection.select("name");
14772        query.execute(self.graphql_client.clone()).await
14773    }
14774    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
14775    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14776        let query = self.selection.select("sourceModuleName");
14777        query.execute(self.graphql_client.clone()).await
14778    }
14779}
14780impl Node for ScalarTypeDef {
14781    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14782        let query = self.selection.select("id");
14783        let graphql_client = self.graphql_client.clone();
14784        async move { query.execute(graphql_client).await }
14785    }
14786}
14787#[derive(Clone)]
14788pub struct SearchResult {
14789    pub proc: Option<Arc<DaggerSessionProc>>,
14790    pub selection: Selection,
14791    pub graphql_client: DynGraphQLClient,
14792}
14793impl IntoID<Id> for SearchResult {
14794    fn into_id(
14795        self,
14796    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14797        Box::pin(async move { self.id().await })
14798    }
14799}
14800impl Loadable for SearchResult {
14801    fn graphql_type() -> &'static str {
14802        "SearchResult"
14803    }
14804    fn from_query(
14805        proc: Option<Arc<DaggerSessionProc>>,
14806        selection: Selection,
14807        graphql_client: DynGraphQLClient,
14808    ) -> Self {
14809        Self {
14810            proc,
14811            selection,
14812            graphql_client,
14813        }
14814    }
14815}
14816impl SearchResult {
14817    /// The byte offset of this line within the file.
14818    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14819        let query = self.selection.select("absoluteOffset");
14820        query.execute(self.graphql_client.clone()).await
14821    }
14822    /// The path to the file that matched.
14823    pub async fn file_path(&self) -> Result<String, DaggerError> {
14824        let query = self.selection.select("filePath");
14825        query.execute(self.graphql_client.clone()).await
14826    }
14827    /// A unique identifier for this SearchResult.
14828    pub async fn id(&self) -> Result<Id, DaggerError> {
14829        let query = self.selection.select("id");
14830        query.execute(self.graphql_client.clone()).await
14831    }
14832    /// The first line that matched.
14833    pub async fn line_number(&self) -> Result<isize, DaggerError> {
14834        let query = self.selection.select("lineNumber");
14835        query.execute(self.graphql_client.clone()).await
14836    }
14837    /// The line content that matched.
14838    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14839        let query = self.selection.select("matchedLines");
14840        query.execute(self.graphql_client.clone()).await
14841    }
14842    /// Sub-match positions and content within the matched lines.
14843    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14844        let query = self.selection.select("submatches");
14845        let query = query.select("id");
14846        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14847        Ok(ids
14848            .into_iter()
14849            .map(|id| SearchSubmatch {
14850                proc: self.proc.clone(),
14851                selection: crate::querybuilder::query()
14852                    .select("node")
14853                    .arg("id", &id.0)
14854                    .inline_fragment("SearchSubmatch"),
14855                graphql_client: self.graphql_client.clone(),
14856            })
14857            .collect())
14858    }
14859}
14860impl Node for SearchResult {
14861    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14862        let query = self.selection.select("id");
14863        let graphql_client = self.graphql_client.clone();
14864        async move { query.execute(graphql_client).await }
14865    }
14866}
14867#[derive(Clone)]
14868pub struct SearchSubmatch {
14869    pub proc: Option<Arc<DaggerSessionProc>>,
14870    pub selection: Selection,
14871    pub graphql_client: DynGraphQLClient,
14872}
14873impl IntoID<Id> for SearchSubmatch {
14874    fn into_id(
14875        self,
14876    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14877        Box::pin(async move { self.id().await })
14878    }
14879}
14880impl Loadable for SearchSubmatch {
14881    fn graphql_type() -> &'static str {
14882        "SearchSubmatch"
14883    }
14884    fn from_query(
14885        proc: Option<Arc<DaggerSessionProc>>,
14886        selection: Selection,
14887        graphql_client: DynGraphQLClient,
14888    ) -> Self {
14889        Self {
14890            proc,
14891            selection,
14892            graphql_client,
14893        }
14894    }
14895}
14896impl SearchSubmatch {
14897    /// The match's end offset within the matched lines.
14898    pub async fn end(&self) -> Result<isize, DaggerError> {
14899        let query = self.selection.select("end");
14900        query.execute(self.graphql_client.clone()).await
14901    }
14902    /// A unique identifier for this SearchSubmatch.
14903    pub async fn id(&self) -> Result<Id, DaggerError> {
14904        let query = self.selection.select("id");
14905        query.execute(self.graphql_client.clone()).await
14906    }
14907    /// The match's start offset within the matched lines.
14908    pub async fn start(&self) -> Result<isize, DaggerError> {
14909        let query = self.selection.select("start");
14910        query.execute(self.graphql_client.clone()).await
14911    }
14912    /// The matched text.
14913    pub async fn text(&self) -> Result<String, DaggerError> {
14914        let query = self.selection.select("text");
14915        query.execute(self.graphql_client.clone()).await
14916    }
14917}
14918impl Node for SearchSubmatch {
14919    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14920        let query = self.selection.select("id");
14921        let graphql_client = self.graphql_client.clone();
14922        async move { query.execute(graphql_client).await }
14923    }
14924}
14925#[derive(Clone)]
14926pub struct Secret {
14927    pub proc: Option<Arc<DaggerSessionProc>>,
14928    pub selection: Selection,
14929    pub graphql_client: DynGraphQLClient,
14930}
14931impl IntoID<Id> for Secret {
14932    fn into_id(
14933        self,
14934    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14935        Box::pin(async move { self.id().await })
14936    }
14937}
14938impl Loadable for Secret {
14939    fn graphql_type() -> &'static str {
14940        "Secret"
14941    }
14942    fn from_query(
14943        proc: Option<Arc<DaggerSessionProc>>,
14944        selection: Selection,
14945        graphql_client: DynGraphQLClient,
14946    ) -> Self {
14947        Self {
14948            proc,
14949            selection,
14950            graphql_client,
14951        }
14952    }
14953}
14954impl Secret {
14955    /// A unique identifier for this Secret.
14956    pub async fn id(&self) -> Result<Id, DaggerError> {
14957        let query = self.selection.select("id");
14958        query.execute(self.graphql_client.clone()).await
14959    }
14960    /// The name of this secret.
14961    pub async fn name(&self) -> Result<String, DaggerError> {
14962        let query = self.selection.select("name");
14963        query.execute(self.graphql_client.clone()).await
14964    }
14965    /// The value of this secret.
14966    pub async fn plaintext(&self) -> Result<String, DaggerError> {
14967        let query = self.selection.select("plaintext");
14968        query.execute(self.graphql_client.clone()).await
14969    }
14970    /// The URI of this secret.
14971    pub async fn uri(&self) -> Result<String, DaggerError> {
14972        let query = self.selection.select("uri");
14973        query.execute(self.graphql_client.clone()).await
14974    }
14975}
14976impl Node for Secret {
14977    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14978        let query = self.selection.select("id");
14979        let graphql_client = self.graphql_client.clone();
14980        async move { query.execute(graphql_client).await }
14981    }
14982}
14983#[derive(Clone)]
14984pub struct Service {
14985    pub proc: Option<Arc<DaggerSessionProc>>,
14986    pub selection: Selection,
14987    pub graphql_client: DynGraphQLClient,
14988}
14989#[derive(Builder, Debug, PartialEq)]
14990pub struct ServiceEndpointOpts<'a> {
14991    /// The exposed port number for the endpoint
14992    #[builder(setter(into, strip_option), default)]
14993    pub port: Option<isize>,
14994    /// Return a URL with the given scheme, eg. http for http://
14995    #[builder(setter(into, strip_option), default)]
14996    pub scheme: Option<&'a str>,
14997}
14998#[derive(Builder, Debug, PartialEq)]
14999pub struct ServiceStopOpts {
15000    /// Immediately kill the service without waiting for a graceful exit
15001    #[builder(setter(into, strip_option), default)]
15002    pub kill: Option<bool>,
15003}
15004#[derive(Builder, Debug, PartialEq)]
15005pub struct ServiceTerminalOpts<'a> {
15006    #[builder(setter(into, strip_option), default)]
15007    pub cmd: Option<Vec<&'a str>>,
15008}
15009#[derive(Builder, Debug, PartialEq)]
15010pub struct ServiceUpOpts {
15011    /// List of frontend/backend port mappings to forward.
15012    /// Frontend is the port accepting traffic on the host, backend is the service port.
15013    #[builder(setter(into, strip_option), default)]
15014    pub ports: Option<Vec<PortForward>>,
15015    /// Bind each tunnel port to a random port on the host.
15016    #[builder(setter(into, strip_option), default)]
15017    pub random: Option<bool>,
15018}
15019impl IntoID<Id> for Service {
15020    fn into_id(
15021        self,
15022    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15023        Box::pin(async move { self.id().await })
15024    }
15025}
15026impl Loadable for Service {
15027    fn graphql_type() -> &'static str {
15028        "Service"
15029    }
15030    fn from_query(
15031        proc: Option<Arc<DaggerSessionProc>>,
15032        selection: Selection,
15033        graphql_client: DynGraphQLClient,
15034    ) -> Self {
15035        Self {
15036            proc,
15037            selection,
15038            graphql_client,
15039        }
15040    }
15041}
15042impl Service {
15043    /// Retrieves an endpoint that clients can use to reach this container.
15044    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15045    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15046    ///
15047    /// # Arguments
15048    ///
15049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15050    pub async fn endpoint(&self) -> Result<String, DaggerError> {
15051        let query = self.selection.select("endpoint");
15052        query.execute(self.graphql_client.clone()).await
15053    }
15054    /// Retrieves an endpoint that clients can use to reach this container.
15055    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15056    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15057    ///
15058    /// # Arguments
15059    ///
15060    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15061    pub async fn endpoint_opts<'a>(
15062        &self,
15063        opts: ServiceEndpointOpts<'a>,
15064    ) -> Result<String, DaggerError> {
15065        let mut query = self.selection.select("endpoint");
15066        if let Some(port) = opts.port {
15067            query = query.arg("port", port);
15068        }
15069        if let Some(scheme) = opts.scheme {
15070            query = query.arg("scheme", scheme);
15071        }
15072        query.execute(self.graphql_client.clone()).await
15073    }
15074    /// Retrieves a hostname which can be used by clients to reach this container.
15075    pub async fn hostname(&self) -> Result<String, DaggerError> {
15076        let query = self.selection.select("hostname");
15077        query.execute(self.graphql_client.clone()).await
15078    }
15079    /// A unique identifier for this Service.
15080    pub async fn id(&self) -> Result<Id, DaggerError> {
15081        let query = self.selection.select("id");
15082        query.execute(self.graphql_client.clone()).await
15083    }
15084    /// Retrieves the list of ports provided by the service.
15085    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15086        let query = self.selection.select("ports");
15087        let query = query.select("id");
15088        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15089        Ok(ids
15090            .into_iter()
15091            .map(|id| Port {
15092                proc: self.proc.clone(),
15093                selection: crate::querybuilder::query()
15094                    .select("node")
15095                    .arg("id", &id.0)
15096                    .inline_fragment("Port"),
15097                graphql_client: self.graphql_client.clone(),
15098            })
15099            .collect())
15100    }
15101    /// Start the service and wait for its health checks to succeed.
15102    /// Services bound to a Container do not need to be manually started.
15103    pub async fn start(&self) -> Result<Service, DaggerError> {
15104        let query = self.selection.select("start");
15105        let id: Id = query.execute(self.graphql_client.clone()).await?;
15106        Ok(Service {
15107            proc: self.proc.clone(),
15108            selection: query
15109                .root()
15110                .select("node")
15111                .arg("id", &id.0)
15112                .inline_fragment("Service"),
15113            graphql_client: self.graphql_client.clone(),
15114        })
15115    }
15116    /// Stop the service.
15117    ///
15118    /// # Arguments
15119    ///
15120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15121    pub async fn stop(&self) -> Result<Service, DaggerError> {
15122        let query = self.selection.select("stop");
15123        let id: Id = query.execute(self.graphql_client.clone()).await?;
15124        Ok(Service {
15125            proc: self.proc.clone(),
15126            selection: query
15127                .root()
15128                .select("node")
15129                .arg("id", &id.0)
15130                .inline_fragment("Service"),
15131            graphql_client: self.graphql_client.clone(),
15132        })
15133    }
15134    /// Stop the service.
15135    ///
15136    /// # Arguments
15137    ///
15138    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15139    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15140        let mut query = self.selection.select("stop");
15141        if let Some(kill) = opts.kill {
15142            query = query.arg("kill", kill);
15143        }
15144        let id: Id = query.execute(self.graphql_client.clone()).await?;
15145        Ok(Service {
15146            proc: self.proc.clone(),
15147            selection: query
15148                .root()
15149                .select("node")
15150                .arg("id", &id.0)
15151                .inline_fragment("Service"),
15152            graphql_client: self.graphql_client.clone(),
15153        })
15154    }
15155    /// Forces evaluation of the pipeline in the engine.
15156    pub async fn sync(&self) -> Result<Service, DaggerError> {
15157        let query = self.selection.select("sync");
15158        let id: Id = query.execute(self.graphql_client.clone()).await?;
15159        Ok(Service {
15160            proc: self.proc.clone(),
15161            selection: query
15162                .root()
15163                .select("node")
15164                .arg("id", &id.0)
15165                .inline_fragment("Service"),
15166            graphql_client: self.graphql_client.clone(),
15167        })
15168    }
15169    ///
15170    /// # Arguments
15171    ///
15172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15173    pub fn terminal(&self) -> Service {
15174        let query = self.selection.select("terminal");
15175        Service {
15176            proc: self.proc.clone(),
15177            selection: query,
15178            graphql_client: self.graphql_client.clone(),
15179        }
15180    }
15181    ///
15182    /// # Arguments
15183    ///
15184    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15185    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15186        let mut query = self.selection.select("terminal");
15187        if let Some(cmd) = opts.cmd {
15188            query = query.arg("cmd", cmd);
15189        }
15190        Service {
15191            proc: self.proc.clone(),
15192            selection: query,
15193            graphql_client: self.graphql_client.clone(),
15194        }
15195    }
15196    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15197    ///
15198    /// # Arguments
15199    ///
15200    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15201    pub async fn up(&self) -> Result<Void, DaggerError> {
15202        let query = self.selection.select("up");
15203        query.execute(self.graphql_client.clone()).await
15204    }
15205    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15206    ///
15207    /// # Arguments
15208    ///
15209    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15210    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15211        let mut query = self.selection.select("up");
15212        if let Some(ports) = opts.ports {
15213            query = query.arg("ports", ports);
15214        }
15215        if let Some(random) = opts.random {
15216            query = query.arg("random", random);
15217        }
15218        query.execute(self.graphql_client.clone()).await
15219    }
15220    /// Configures a hostname which can be used by clients within the session to reach this container.
15221    ///
15222    /// # Arguments
15223    ///
15224    /// * `hostname` - The hostname to use.
15225    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15226        let mut query = self.selection.select("withHostname");
15227        query = query.arg("hostname", hostname.into());
15228        Service {
15229            proc: self.proc.clone(),
15230            selection: query,
15231            graphql_client: self.graphql_client.clone(),
15232        }
15233    }
15234}
15235impl Node for Service {
15236    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15237        let query = self.selection.select("id");
15238        let graphql_client = self.graphql_client.clone();
15239        async move { query.execute(graphql_client).await }
15240    }
15241}
15242impl Syncer for Service {
15243    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15244        let query = self.selection.select("id");
15245        let graphql_client = self.graphql_client.clone();
15246        async move { query.execute(graphql_client).await }
15247    }
15248    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15249        let query = self.selection.select("sync");
15250        let graphql_client = self.graphql_client.clone();
15251        async move { query.execute(graphql_client).await }
15252    }
15253}
15254#[derive(Clone)]
15255pub struct Socket {
15256    pub proc: Option<Arc<DaggerSessionProc>>,
15257    pub selection: Selection,
15258    pub graphql_client: DynGraphQLClient,
15259}
15260impl IntoID<Id> for Socket {
15261    fn into_id(
15262        self,
15263    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15264        Box::pin(async move { self.id().await })
15265    }
15266}
15267impl Loadable for Socket {
15268    fn graphql_type() -> &'static str {
15269        "Socket"
15270    }
15271    fn from_query(
15272        proc: Option<Arc<DaggerSessionProc>>,
15273        selection: Selection,
15274        graphql_client: DynGraphQLClient,
15275    ) -> Self {
15276        Self {
15277            proc,
15278            selection,
15279            graphql_client,
15280        }
15281    }
15282}
15283impl Socket {
15284    /// A unique identifier for this Socket.
15285    pub async fn id(&self) -> Result<Id, DaggerError> {
15286        let query = self.selection.select("id");
15287        query.execute(self.graphql_client.clone()).await
15288    }
15289}
15290impl Node for Socket {
15291    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15292        let query = self.selection.select("id");
15293        let graphql_client = self.graphql_client.clone();
15294        async move { query.execute(graphql_client).await }
15295    }
15296}
15297#[derive(Clone)]
15298pub struct SourceMap {
15299    pub proc: Option<Arc<DaggerSessionProc>>,
15300    pub selection: Selection,
15301    pub graphql_client: DynGraphQLClient,
15302}
15303impl IntoID<Id> for SourceMap {
15304    fn into_id(
15305        self,
15306    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15307        Box::pin(async move { self.id().await })
15308    }
15309}
15310impl Loadable for SourceMap {
15311    fn graphql_type() -> &'static str {
15312        "SourceMap"
15313    }
15314    fn from_query(
15315        proc: Option<Arc<DaggerSessionProc>>,
15316        selection: Selection,
15317        graphql_client: DynGraphQLClient,
15318    ) -> Self {
15319        Self {
15320            proc,
15321            selection,
15322            graphql_client,
15323        }
15324    }
15325}
15326impl SourceMap {
15327    /// The column number within the line.
15328    pub async fn column(&self) -> Result<isize, DaggerError> {
15329        let query = self.selection.select("column");
15330        query.execute(self.graphql_client.clone()).await
15331    }
15332    /// The filename from the module source.
15333    pub async fn filename(&self) -> Result<String, DaggerError> {
15334        let query = self.selection.select("filename");
15335        query.execute(self.graphql_client.clone()).await
15336    }
15337    /// A unique identifier for this SourceMap.
15338    pub async fn id(&self) -> Result<Id, DaggerError> {
15339        let query = self.selection.select("id");
15340        query.execute(self.graphql_client.clone()).await
15341    }
15342    /// The line number within the filename.
15343    pub async fn line(&self) -> Result<isize, DaggerError> {
15344        let query = self.selection.select("line");
15345        query.execute(self.graphql_client.clone()).await
15346    }
15347    /// The module dependency this was declared in.
15348    pub async fn module(&self) -> Result<String, DaggerError> {
15349        let query = self.selection.select("module");
15350        query.execute(self.graphql_client.clone()).await
15351    }
15352    /// The URL to the file, if any. This can be used to link to the source map in the browser.
15353    pub async fn url(&self) -> Result<String, DaggerError> {
15354        let query = self.selection.select("url");
15355        query.execute(self.graphql_client.clone()).await
15356    }
15357}
15358impl Node for SourceMap {
15359    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15360        let query = self.selection.select("id");
15361        let graphql_client = self.graphql_client.clone();
15362        async move { query.execute(graphql_client).await }
15363    }
15364}
15365#[derive(Clone)]
15366pub struct Stat {
15367    pub proc: Option<Arc<DaggerSessionProc>>,
15368    pub selection: Selection,
15369    pub graphql_client: DynGraphQLClient,
15370}
15371impl IntoID<Id> for Stat {
15372    fn into_id(
15373        self,
15374    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15375        Box::pin(async move { self.id().await })
15376    }
15377}
15378impl Loadable for Stat {
15379    fn graphql_type() -> &'static str {
15380        "Stat"
15381    }
15382    fn from_query(
15383        proc: Option<Arc<DaggerSessionProc>>,
15384        selection: Selection,
15385        graphql_client: DynGraphQLClient,
15386    ) -> Self {
15387        Self {
15388            proc,
15389            selection,
15390            graphql_client,
15391        }
15392    }
15393}
15394impl Stat {
15395    /// file type
15396    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15397        let query = self.selection.select("fileType");
15398        query.execute(self.graphql_client.clone()).await
15399    }
15400    /// A unique identifier for this Stat.
15401    pub async fn id(&self) -> Result<Id, DaggerError> {
15402        let query = self.selection.select("id");
15403        query.execute(self.graphql_client.clone()).await
15404    }
15405    /// file name
15406    pub async fn name(&self) -> Result<String, DaggerError> {
15407        let query = self.selection.select("name");
15408        query.execute(self.graphql_client.clone()).await
15409    }
15410    /// permission bits
15411    pub async fn permissions(&self) -> Result<isize, DaggerError> {
15412        let query = self.selection.select("permissions");
15413        query.execute(self.graphql_client.clone()).await
15414    }
15415    /// file size
15416    pub async fn size(&self) -> Result<isize, DaggerError> {
15417        let query = self.selection.select("size");
15418        query.execute(self.graphql_client.clone()).await
15419    }
15420}
15421impl Node for Stat {
15422    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15423        let query = self.selection.select("id");
15424        let graphql_client = self.graphql_client.clone();
15425        async move { query.execute(graphql_client).await }
15426    }
15427}
15428#[derive(Clone)]
15429pub struct Terminal {
15430    pub proc: Option<Arc<DaggerSessionProc>>,
15431    pub selection: Selection,
15432    pub graphql_client: DynGraphQLClient,
15433}
15434impl IntoID<Id> for Terminal {
15435    fn into_id(
15436        self,
15437    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15438        Box::pin(async move { self.id().await })
15439    }
15440}
15441impl Loadable for Terminal {
15442    fn graphql_type() -> &'static str {
15443        "Terminal"
15444    }
15445    fn from_query(
15446        proc: Option<Arc<DaggerSessionProc>>,
15447        selection: Selection,
15448        graphql_client: DynGraphQLClient,
15449    ) -> Self {
15450        Self {
15451            proc,
15452            selection,
15453            graphql_client,
15454        }
15455    }
15456}
15457impl Terminal {
15458    /// A unique identifier for this Terminal.
15459    pub async fn id(&self) -> Result<Id, DaggerError> {
15460        let query = self.selection.select("id");
15461        query.execute(self.graphql_client.clone()).await
15462    }
15463    /// Forces evaluation of the pipeline in the engine.
15464    /// It doesn't run the default command if no exec has been set.
15465    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15466        let query = self.selection.select("sync");
15467        let id: Id = query.execute(self.graphql_client.clone()).await?;
15468        Ok(Terminal {
15469            proc: self.proc.clone(),
15470            selection: query
15471                .root()
15472                .select("node")
15473                .arg("id", &id.0)
15474                .inline_fragment("Terminal"),
15475            graphql_client: self.graphql_client.clone(),
15476        })
15477    }
15478}
15479impl Node for Terminal {
15480    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15481        let query = self.selection.select("id");
15482        let graphql_client = self.graphql_client.clone();
15483        async move { query.execute(graphql_client).await }
15484    }
15485}
15486impl Syncer for Terminal {
15487    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15488        let query = self.selection.select("id");
15489        let graphql_client = self.graphql_client.clone();
15490        async move { query.execute(graphql_client).await }
15491    }
15492    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15493        let query = self.selection.select("sync");
15494        let graphql_client = self.graphql_client.clone();
15495        async move { query.execute(graphql_client).await }
15496    }
15497}
15498#[derive(Clone)]
15499pub struct TypeDef {
15500    pub proc: Option<Arc<DaggerSessionProc>>,
15501    pub selection: Selection,
15502    pub graphql_client: DynGraphQLClient,
15503}
15504#[derive(Builder, Debug, PartialEq)]
15505pub struct TypeDefWithEnumOpts<'a> {
15506    /// A doc string for the enum, if any
15507    #[builder(setter(into, strip_option), default)]
15508    pub description: Option<&'a str>,
15509    /// The source map for the enum definition.
15510    #[builder(setter(into, strip_option), default)]
15511    pub source_map: Option<Id>,
15512}
15513#[derive(Builder, Debug, PartialEq)]
15514pub struct TypeDefWithEnumMemberOpts<'a> {
15515    /// If deprecated, the reason or migration path.
15516    #[builder(setter(into, strip_option), default)]
15517    pub deprecated: Option<&'a str>,
15518    /// A doc string for the member, if any
15519    #[builder(setter(into, strip_option), default)]
15520    pub description: Option<&'a str>,
15521    /// The source map for the enum member definition.
15522    #[builder(setter(into, strip_option), default)]
15523    pub source_map: Option<Id>,
15524    /// The value of the member in the enum
15525    #[builder(setter(into, strip_option), default)]
15526    pub value: Option<&'a str>,
15527}
15528#[derive(Builder, Debug, PartialEq)]
15529pub struct TypeDefWithEnumValueOpts<'a> {
15530    /// If deprecated, the reason or migration path.
15531    #[builder(setter(into, strip_option), default)]
15532    pub deprecated: Option<&'a str>,
15533    /// A doc string for the value, if any
15534    #[builder(setter(into, strip_option), default)]
15535    pub description: Option<&'a str>,
15536    /// The source map for the enum value definition.
15537    #[builder(setter(into, strip_option), default)]
15538    pub source_map: Option<Id>,
15539}
15540#[derive(Builder, Debug, PartialEq)]
15541pub struct TypeDefWithFieldOpts<'a> {
15542    /// If deprecated, the reason or migration path.
15543    #[builder(setter(into, strip_option), default)]
15544    pub deprecated: Option<&'a str>,
15545    /// A doc string for the field, if any
15546    #[builder(setter(into, strip_option), default)]
15547    pub description: Option<&'a str>,
15548    /// The source map for the field definition.
15549    #[builder(setter(into, strip_option), default)]
15550    pub source_map: Option<Id>,
15551}
15552#[derive(Builder, Debug, PartialEq)]
15553pub struct TypeDefWithInterfaceOpts<'a> {
15554    #[builder(setter(into, strip_option), default)]
15555    pub description: Option<&'a str>,
15556    #[builder(setter(into, strip_option), default)]
15557    pub source_map: Option<Id>,
15558}
15559#[derive(Builder, Debug, PartialEq)]
15560pub struct TypeDefWithObjectOpts<'a> {
15561    #[builder(setter(into, strip_option), default)]
15562    pub deprecated: Option<&'a str>,
15563    #[builder(setter(into, strip_option), default)]
15564    pub description: Option<&'a str>,
15565    #[builder(setter(into, strip_option), default)]
15566    pub source_map: Option<Id>,
15567}
15568#[derive(Builder, Debug, PartialEq)]
15569pub struct TypeDefWithScalarOpts<'a> {
15570    #[builder(setter(into, strip_option), default)]
15571    pub description: Option<&'a str>,
15572}
15573impl IntoID<Id> for TypeDef {
15574    fn into_id(
15575        self,
15576    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15577        Box::pin(async move { self.id().await })
15578    }
15579}
15580impl Loadable for TypeDef {
15581    fn graphql_type() -> &'static str {
15582        "TypeDef"
15583    }
15584    fn from_query(
15585        proc: Option<Arc<DaggerSessionProc>>,
15586        selection: Selection,
15587        graphql_client: DynGraphQLClient,
15588    ) -> Self {
15589        Self {
15590            proc,
15591            selection,
15592            graphql_client,
15593        }
15594    }
15595}
15596impl TypeDef {
15597    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
15598    pub fn as_enum(&self) -> EnumTypeDef {
15599        let query = self.selection.select("asEnum");
15600        EnumTypeDef {
15601            proc: self.proc.clone(),
15602            selection: query,
15603            graphql_client: self.graphql_client.clone(),
15604        }
15605    }
15606    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
15607    pub fn as_input(&self) -> InputTypeDef {
15608        let query = self.selection.select("asInput");
15609        InputTypeDef {
15610            proc: self.proc.clone(),
15611            selection: query,
15612            graphql_client: self.graphql_client.clone(),
15613        }
15614    }
15615    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
15616    pub fn as_interface(&self) -> InterfaceTypeDef {
15617        let query = self.selection.select("asInterface");
15618        InterfaceTypeDef {
15619            proc: self.proc.clone(),
15620            selection: query,
15621            graphql_client: self.graphql_client.clone(),
15622        }
15623    }
15624    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
15625    pub fn as_list(&self) -> ListTypeDef {
15626        let query = self.selection.select("asList");
15627        ListTypeDef {
15628            proc: self.proc.clone(),
15629            selection: query,
15630            graphql_client: self.graphql_client.clone(),
15631        }
15632    }
15633    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
15634    pub fn as_object(&self) -> ObjectTypeDef {
15635        let query = self.selection.select("asObject");
15636        ObjectTypeDef {
15637            proc: self.proc.clone(),
15638            selection: query,
15639            graphql_client: self.graphql_client.clone(),
15640        }
15641    }
15642    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
15643    pub fn as_scalar(&self) -> ScalarTypeDef {
15644        let query = self.selection.select("asScalar");
15645        ScalarTypeDef {
15646            proc: self.proc.clone(),
15647            selection: query,
15648            graphql_client: self.graphql_client.clone(),
15649        }
15650    }
15651    /// A unique identifier for this TypeDef.
15652    pub async fn id(&self) -> Result<Id, DaggerError> {
15653        let query = self.selection.select("id");
15654        query.execute(self.graphql_client.clone()).await
15655    }
15656    /// The kind of type this is (e.g. primitive, list, object).
15657    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15658        let query = self.selection.select("kind");
15659        query.execute(self.graphql_client.clone()).await
15660    }
15661    /// The canonical non-optional name of the type.
15662    pub async fn name(&self) -> Result<String, DaggerError> {
15663        let query = self.selection.select("name");
15664        query.execute(self.graphql_client.clone()).await
15665    }
15666    /// Whether this type can be set to null. Defaults to false.
15667    pub async fn optional(&self) -> Result<bool, DaggerError> {
15668        let query = self.selection.select("optional");
15669        query.execute(self.graphql_client.clone()).await
15670    }
15671    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
15672    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15673        let mut query = self.selection.select("withConstructor");
15674        query = query.arg_lazy(
15675            "function",
15676            Box::new(move || {
15677                let function = function.clone();
15678                Box::pin(async move { function.into_id().await.unwrap().quote() })
15679            }),
15680        );
15681        TypeDef {
15682            proc: self.proc.clone(),
15683            selection: query,
15684            graphql_client: self.graphql_client.clone(),
15685        }
15686    }
15687    /// Returns a TypeDef of kind Enum with the provided name.
15688    /// 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.
15689    ///
15690    /// # Arguments
15691    ///
15692    /// * `name` - The name of the enum
15693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15694    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15695        let mut query = self.selection.select("withEnum");
15696        query = query.arg("name", name.into());
15697        TypeDef {
15698            proc: self.proc.clone(),
15699            selection: query,
15700            graphql_client: self.graphql_client.clone(),
15701        }
15702    }
15703    /// Returns a TypeDef of kind Enum with the provided name.
15704    /// 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.
15705    ///
15706    /// # Arguments
15707    ///
15708    /// * `name` - The name of the enum
15709    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15710    pub fn with_enum_opts<'a>(
15711        &self,
15712        name: impl Into<String>,
15713        opts: TypeDefWithEnumOpts<'a>,
15714    ) -> TypeDef {
15715        let mut query = self.selection.select("withEnum");
15716        query = query.arg("name", name.into());
15717        if let Some(description) = opts.description {
15718            query = query.arg("description", description);
15719        }
15720        if let Some(source_map) = opts.source_map {
15721            query = query.arg("sourceMap", source_map);
15722        }
15723        TypeDef {
15724            proc: self.proc.clone(),
15725            selection: query,
15726            graphql_client: self.graphql_client.clone(),
15727        }
15728    }
15729    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15730    ///
15731    /// # Arguments
15732    ///
15733    /// * `name` - The name of the member in the enum
15734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15735    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15736        let mut query = self.selection.select("withEnumMember");
15737        query = query.arg("name", name.into());
15738        TypeDef {
15739            proc: self.proc.clone(),
15740            selection: query,
15741            graphql_client: self.graphql_client.clone(),
15742        }
15743    }
15744    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15745    ///
15746    /// # Arguments
15747    ///
15748    /// * `name` - The name of the member in the enum
15749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15750    pub fn with_enum_member_opts<'a>(
15751        &self,
15752        name: impl Into<String>,
15753        opts: TypeDefWithEnumMemberOpts<'a>,
15754    ) -> TypeDef {
15755        let mut query = self.selection.select("withEnumMember");
15756        query = query.arg("name", name.into());
15757        if let Some(value) = opts.value {
15758            query = query.arg("value", value);
15759        }
15760        if let Some(description) = opts.description {
15761            query = query.arg("description", description);
15762        }
15763        if let Some(source_map) = opts.source_map {
15764            query = query.arg("sourceMap", source_map);
15765        }
15766        if let Some(deprecated) = opts.deprecated {
15767            query = query.arg("deprecated", deprecated);
15768        }
15769        TypeDef {
15770            proc: self.proc.clone(),
15771            selection: query,
15772            graphql_client: self.graphql_client.clone(),
15773        }
15774    }
15775    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15776    ///
15777    /// # Arguments
15778    ///
15779    /// * `value` - The name of the value in the enum
15780    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15781    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15782        let mut query = self.selection.select("withEnumValue");
15783        query = query.arg("value", value.into());
15784        TypeDef {
15785            proc: self.proc.clone(),
15786            selection: query,
15787            graphql_client: self.graphql_client.clone(),
15788        }
15789    }
15790    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15791    ///
15792    /// # Arguments
15793    ///
15794    /// * `value` - The name of the value in the enum
15795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15796    pub fn with_enum_value_opts<'a>(
15797        &self,
15798        value: impl Into<String>,
15799        opts: TypeDefWithEnumValueOpts<'a>,
15800    ) -> TypeDef {
15801        let mut query = self.selection.select("withEnumValue");
15802        query = query.arg("value", value.into());
15803        if let Some(description) = opts.description {
15804            query = query.arg("description", description);
15805        }
15806        if let Some(source_map) = opts.source_map {
15807            query = query.arg("sourceMap", source_map);
15808        }
15809        if let Some(deprecated) = opts.deprecated {
15810            query = query.arg("deprecated", deprecated);
15811        }
15812        TypeDef {
15813            proc: self.proc.clone(),
15814            selection: query,
15815            graphql_client: self.graphql_client.clone(),
15816        }
15817    }
15818    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15819    ///
15820    /// # Arguments
15821    ///
15822    /// * `name` - The name of the field in the object
15823    /// * `type_def` - The type of the field
15824    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15825    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
15826        let mut query = self.selection.select("withField");
15827        query = query.arg("name", name.into());
15828        query = query.arg_lazy(
15829            "typeDef",
15830            Box::new(move || {
15831                let type_def = type_def.clone();
15832                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15833            }),
15834        );
15835        TypeDef {
15836            proc: self.proc.clone(),
15837            selection: query,
15838            graphql_client: self.graphql_client.clone(),
15839        }
15840    }
15841    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15842    ///
15843    /// # Arguments
15844    ///
15845    /// * `name` - The name of the field in the object
15846    /// * `type_def` - The type of the field
15847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15848    pub fn with_field_opts<'a>(
15849        &self,
15850        name: impl Into<String>,
15851        type_def: impl IntoID<Id>,
15852        opts: TypeDefWithFieldOpts<'a>,
15853    ) -> TypeDef {
15854        let mut query = self.selection.select("withField");
15855        query = query.arg("name", name.into());
15856        query = query.arg_lazy(
15857            "typeDef",
15858            Box::new(move || {
15859                let type_def = type_def.clone();
15860                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15861            }),
15862        );
15863        if let Some(description) = opts.description {
15864            query = query.arg("description", description);
15865        }
15866        if let Some(source_map) = opts.source_map {
15867            query = query.arg("sourceMap", source_map);
15868        }
15869        if let Some(deprecated) = opts.deprecated {
15870            query = query.arg("deprecated", deprecated);
15871        }
15872        TypeDef {
15873            proc: self.proc.clone(),
15874            selection: query,
15875            graphql_client: self.graphql_client.clone(),
15876        }
15877    }
15878    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
15879    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15880        let mut query = self.selection.select("withFunction");
15881        query = query.arg_lazy(
15882            "function",
15883            Box::new(move || {
15884                let function = function.clone();
15885                Box::pin(async move { function.into_id().await.unwrap().quote() })
15886            }),
15887        );
15888        TypeDef {
15889            proc: self.proc.clone(),
15890            selection: query,
15891            graphql_client: self.graphql_client.clone(),
15892        }
15893    }
15894    /// Returns a TypeDef of kind Interface with the provided name.
15895    ///
15896    /// # Arguments
15897    ///
15898    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15899    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15900        let mut query = self.selection.select("withInterface");
15901        query = query.arg("name", name.into());
15902        TypeDef {
15903            proc: self.proc.clone(),
15904            selection: query,
15905            graphql_client: self.graphql_client.clone(),
15906        }
15907    }
15908    /// Returns a TypeDef of kind Interface with the provided name.
15909    ///
15910    /// # Arguments
15911    ///
15912    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15913    pub fn with_interface_opts<'a>(
15914        &self,
15915        name: impl Into<String>,
15916        opts: TypeDefWithInterfaceOpts<'a>,
15917    ) -> TypeDef {
15918        let mut query = self.selection.select("withInterface");
15919        query = query.arg("name", name.into());
15920        if let Some(description) = opts.description {
15921            query = query.arg("description", description);
15922        }
15923        if let Some(source_map) = opts.source_map {
15924            query = query.arg("sourceMap", source_map);
15925        }
15926        TypeDef {
15927            proc: self.proc.clone(),
15928            selection: query,
15929            graphql_client: self.graphql_client.clone(),
15930        }
15931    }
15932    /// Sets the kind of the type.
15933    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15934        let mut query = self.selection.select("withKind");
15935        query = query.arg("kind", kind);
15936        TypeDef {
15937            proc: self.proc.clone(),
15938            selection: query,
15939            graphql_client: self.graphql_client.clone(),
15940        }
15941    }
15942    /// Returns a TypeDef of kind List with the provided type for its elements.
15943    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15944        let mut query = self.selection.select("withListOf");
15945        query = query.arg_lazy(
15946            "elementType",
15947            Box::new(move || {
15948                let element_type = element_type.clone();
15949                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15950            }),
15951        );
15952        TypeDef {
15953            proc: self.proc.clone(),
15954            selection: query,
15955            graphql_client: self.graphql_client.clone(),
15956        }
15957    }
15958    /// Returns a TypeDef of kind Object with the provided name.
15959    /// 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.
15960    ///
15961    /// # Arguments
15962    ///
15963    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15964    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15965        let mut query = self.selection.select("withObject");
15966        query = query.arg("name", name.into());
15967        TypeDef {
15968            proc: self.proc.clone(),
15969            selection: query,
15970            graphql_client: self.graphql_client.clone(),
15971        }
15972    }
15973    /// Returns a TypeDef of kind Object with the provided name.
15974    /// 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.
15975    ///
15976    /// # Arguments
15977    ///
15978    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15979    pub fn with_object_opts<'a>(
15980        &self,
15981        name: impl Into<String>,
15982        opts: TypeDefWithObjectOpts<'a>,
15983    ) -> TypeDef {
15984        let mut query = self.selection.select("withObject");
15985        query = query.arg("name", name.into());
15986        if let Some(description) = opts.description {
15987            query = query.arg("description", description);
15988        }
15989        if let Some(source_map) = opts.source_map {
15990            query = query.arg("sourceMap", source_map);
15991        }
15992        if let Some(deprecated) = opts.deprecated {
15993            query = query.arg("deprecated", deprecated);
15994        }
15995        TypeDef {
15996            proc: self.proc.clone(),
15997            selection: query,
15998            graphql_client: self.graphql_client.clone(),
15999        }
16000    }
16001    /// Sets whether this type can be set to null.
16002    pub fn with_optional(&self, optional: bool) -> TypeDef {
16003        let mut query = self.selection.select("withOptional");
16004        query = query.arg("optional", optional);
16005        TypeDef {
16006            proc: self.proc.clone(),
16007            selection: query,
16008            graphql_client: self.graphql_client.clone(),
16009        }
16010    }
16011    /// Returns a TypeDef of kind Scalar with the provided name.
16012    ///
16013    /// # Arguments
16014    ///
16015    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16016    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16017        let mut query = self.selection.select("withScalar");
16018        query = query.arg("name", name.into());
16019        TypeDef {
16020            proc: self.proc.clone(),
16021            selection: query,
16022            graphql_client: self.graphql_client.clone(),
16023        }
16024    }
16025    /// Returns a TypeDef of kind Scalar with the provided name.
16026    ///
16027    /// # Arguments
16028    ///
16029    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16030    pub fn with_scalar_opts<'a>(
16031        &self,
16032        name: impl Into<String>,
16033        opts: TypeDefWithScalarOpts<'a>,
16034    ) -> TypeDef {
16035        let mut query = self.selection.select("withScalar");
16036        query = query.arg("name", name.into());
16037        if let Some(description) = opts.description {
16038            query = query.arg("description", description);
16039        }
16040        TypeDef {
16041            proc: self.proc.clone(),
16042            selection: query,
16043            graphql_client: self.graphql_client.clone(),
16044        }
16045    }
16046}
16047impl Node for TypeDef {
16048    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16049        let query = self.selection.select("id");
16050        let graphql_client = self.graphql_client.clone();
16051        async move { query.execute(graphql_client).await }
16052    }
16053}
16054#[derive(Clone)]
16055pub struct Up {
16056    pub proc: Option<Arc<DaggerSessionProc>>,
16057    pub selection: Selection,
16058    pub graphql_client: DynGraphQLClient,
16059}
16060impl IntoID<Id> for Up {
16061    fn into_id(
16062        self,
16063    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16064        Box::pin(async move { self.id().await })
16065    }
16066}
16067impl Loadable for Up {
16068    fn graphql_type() -> &'static str {
16069        "Up"
16070    }
16071    fn from_query(
16072        proc: Option<Arc<DaggerSessionProc>>,
16073        selection: Selection,
16074        graphql_client: DynGraphQLClient,
16075    ) -> Self {
16076        Self {
16077            proc,
16078            selection,
16079            graphql_client,
16080        }
16081    }
16082}
16083impl Up {
16084    /// The description of the service
16085    pub async fn description(&self) -> Result<String, DaggerError> {
16086        let query = self.selection.select("description");
16087        query.execute(self.graphql_client.clone()).await
16088    }
16089    /// A unique identifier for this Up.
16090    pub async fn id(&self) -> Result<Id, DaggerError> {
16091        let query = self.selection.select("id");
16092        query.execute(self.graphql_client.clone()).await
16093    }
16094    /// Return the fully qualified name of the service
16095    pub async fn name(&self) -> Result<String, DaggerError> {
16096        let query = self.selection.select("name");
16097        query.execute(self.graphql_client.clone()).await
16098    }
16099    /// The original module in which the service has been defined
16100    pub fn original_module(&self) -> Module {
16101        let query = self.selection.select("originalModule");
16102        Module {
16103            proc: self.proc.clone(),
16104            selection: query,
16105            graphql_client: self.graphql_client.clone(),
16106        }
16107    }
16108    /// The path of the service within its module
16109    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16110        let query = self.selection.select("path");
16111        query.execute(self.graphql_client.clone()).await
16112    }
16113    /// Execute the service function
16114    pub fn run(&self) -> Up {
16115        let query = self.selection.select("run");
16116        Up {
16117            proc: self.proc.clone(),
16118            selection: query,
16119            graphql_client: self.graphql_client.clone(),
16120        }
16121    }
16122}
16123impl Node for Up {
16124    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16125        let query = self.selection.select("id");
16126        let graphql_client = self.graphql_client.clone();
16127        async move { query.execute(graphql_client).await }
16128    }
16129}
16130#[derive(Clone)]
16131pub struct UpGroup {
16132    pub proc: Option<Arc<DaggerSessionProc>>,
16133    pub selection: Selection,
16134    pub graphql_client: DynGraphQLClient,
16135}
16136impl IntoID<Id> for UpGroup {
16137    fn into_id(
16138        self,
16139    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16140        Box::pin(async move { self.id().await })
16141    }
16142}
16143impl Loadable for UpGroup {
16144    fn graphql_type() -> &'static str {
16145        "UpGroup"
16146    }
16147    fn from_query(
16148        proc: Option<Arc<DaggerSessionProc>>,
16149        selection: Selection,
16150        graphql_client: DynGraphQLClient,
16151    ) -> Self {
16152        Self {
16153            proc,
16154            selection,
16155            graphql_client,
16156        }
16157    }
16158}
16159impl UpGroup {
16160    /// A unique identifier for this UpGroup.
16161    pub async fn id(&self) -> Result<Id, DaggerError> {
16162        let query = self.selection.select("id");
16163        query.execute(self.graphql_client.clone()).await
16164    }
16165    /// Return a list of individual services and their details
16166    pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16167        let query = self.selection.select("list");
16168        let query = query.select("id");
16169        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16170        Ok(ids
16171            .into_iter()
16172            .map(|id| Up {
16173                proc: self.proc.clone(),
16174                selection: crate::querybuilder::query()
16175                    .select("node")
16176                    .arg("id", &id.0)
16177                    .inline_fragment("Up"),
16178                graphql_client: self.graphql_client.clone(),
16179            })
16180            .collect())
16181    }
16182    /// Execute all selected service functions
16183    pub fn run(&self) -> UpGroup {
16184        let query = self.selection.select("run");
16185        UpGroup {
16186            proc: self.proc.clone(),
16187            selection: query,
16188            graphql_client: self.graphql_client.clone(),
16189        }
16190    }
16191}
16192impl Node for UpGroup {
16193    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16194        let query = self.selection.select("id");
16195        let graphql_client = self.graphql_client.clone();
16196        async move { query.execute(graphql_client).await }
16197    }
16198}
16199#[derive(Clone)]
16200pub struct Workspace {
16201    pub proc: Option<Arc<DaggerSessionProc>>,
16202    pub selection: Selection,
16203    pub graphql_client: DynGraphQLClient,
16204}
16205#[derive(Builder, Debug, PartialEq)]
16206pub struct WorkspaceChecksOpts<'a> {
16207    /// Only include checks matching the specified patterns
16208    #[builder(setter(into, strip_option), default)]
16209    pub include: Option<Vec<&'a str>>,
16210    /// When true, only return annotated check functions; exclude generate-as-checks
16211    #[builder(setter(into, strip_option), default)]
16212    pub no_generate: Option<bool>,
16213    /// When true, only return generate-as-checks; exclude annotated check functions
16214    #[builder(setter(into, strip_option), default)]
16215    pub only_generate: Option<bool>,
16216}
16217#[derive(Builder, Debug, PartialEq)]
16218pub struct WorkspaceDirectoryOpts<'a> {
16219    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
16220    #[builder(setter(into, strip_option), default)]
16221    pub exclude: Option<Vec<&'a str>>,
16222    /// Apply .gitignore filter rules inside the directory.
16223    #[builder(setter(into, strip_option), default)]
16224    pub gitignore: Option<bool>,
16225    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
16226    #[builder(setter(into, strip_option), default)]
16227    pub include: Option<Vec<&'a str>>,
16228}
16229#[derive(Builder, Debug, PartialEq)]
16230pub struct WorkspaceFindUpOpts<'a> {
16231    /// Path to start the search from. Relative paths resolve from the workspace directory; absolute paths resolve from the workspace boundary.
16232    #[builder(setter(into, strip_option), default)]
16233    pub from: Option<&'a str>,
16234}
16235#[derive(Builder, Debug, PartialEq)]
16236pub struct WorkspaceGeneratorsOpts<'a> {
16237    /// Only include generators matching the specified patterns
16238    #[builder(setter(into, strip_option), default)]
16239    pub include: Option<Vec<&'a str>>,
16240}
16241#[derive(Builder, Debug, PartialEq)]
16242pub struct WorkspaceServicesOpts<'a> {
16243    /// Only include services matching the specified patterns
16244    #[builder(setter(into, strip_option), default)]
16245    pub include: Option<Vec<&'a str>>,
16246}
16247impl IntoID<Id> for Workspace {
16248    fn into_id(
16249        self,
16250    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16251        Box::pin(async move { self.id().await })
16252    }
16253}
16254impl Loadable for Workspace {
16255    fn graphql_type() -> &'static str {
16256        "Workspace"
16257    }
16258    fn from_query(
16259        proc: Option<Arc<DaggerSessionProc>>,
16260        selection: Selection,
16261        graphql_client: DynGraphQLClient,
16262    ) -> Self {
16263        Self {
16264            proc,
16265            selection,
16266            graphql_client,
16267        }
16268    }
16269}
16270impl Workspace {
16271    /// Canonical Dagger address of the workspace directory.
16272    pub async fn address(&self) -> Result<String, DaggerError> {
16273        let query = self.selection.select("address");
16274        query.execute(self.graphql_client.clone()).await
16275    }
16276    /// Return all checks from modules loaded in the workspace.
16277    ///
16278    /// # Arguments
16279    ///
16280    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16281    pub fn checks(&self) -> CheckGroup {
16282        let query = self.selection.select("checks");
16283        CheckGroup {
16284            proc: self.proc.clone(),
16285            selection: query,
16286            graphql_client: self.graphql_client.clone(),
16287        }
16288    }
16289    /// Return all checks from modules loaded in the workspace.
16290    ///
16291    /// # Arguments
16292    ///
16293    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16294    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16295        let mut query = self.selection.select("checks");
16296        if let Some(include) = opts.include {
16297            query = query.arg("include", include);
16298        }
16299        if let Some(no_generate) = opts.no_generate {
16300            query = query.arg("noGenerate", no_generate);
16301        }
16302        if let Some(only_generate) = opts.only_generate {
16303            query = query.arg("onlyGenerate", only_generate);
16304        }
16305        CheckGroup {
16306            proc: self.proc.clone(),
16307            selection: query,
16308            graphql_client: self.graphql_client.clone(),
16309        }
16310    }
16311    /// The client ID that owns this workspace's host filesystem.
16312    pub async fn client_id(&self) -> Result<String, DaggerError> {
16313        let query = self.selection.select("clientId");
16314        query.execute(self.graphql_client.clone()).await
16315    }
16316    /// Path to config.toml relative to the workspace boundary (empty if not initialized).
16317    pub async fn config_path(&self) -> Result<String, DaggerError> {
16318        let query = self.selection.select("configPath");
16319        query.execute(self.graphql_client.clone()).await
16320    }
16321    /// Returns a Directory from the workspace.
16322    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16323    ///
16324    /// # Arguments
16325    ///
16326    /// * `path` - Location of the directory to retrieve. Relative paths (e.g., "src") resolve from the workspace directory; absolute paths (e.g., "/src") resolve from the workspace boundary.
16327    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16328    pub fn directory(&self, path: impl Into<String>) -> Directory {
16329        let mut query = self.selection.select("directory");
16330        query = query.arg("path", path.into());
16331        Directory {
16332            proc: self.proc.clone(),
16333            selection: query,
16334            graphql_client: self.graphql_client.clone(),
16335        }
16336    }
16337    /// Returns a Directory from the workspace.
16338    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16339    ///
16340    /// # Arguments
16341    ///
16342    /// * `path` - Location of the directory to retrieve. Relative paths (e.g., "src") resolve from the workspace directory; absolute paths (e.g., "/src") resolve from the workspace boundary.
16343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16344    pub fn directory_opts<'a>(
16345        &self,
16346        path: impl Into<String>,
16347        opts: WorkspaceDirectoryOpts<'a>,
16348    ) -> Directory {
16349        let mut query = self.selection.select("directory");
16350        query = query.arg("path", path.into());
16351        if let Some(exclude) = opts.exclude {
16352            query = query.arg("exclude", exclude);
16353        }
16354        if let Some(include) = opts.include {
16355            query = query.arg("include", include);
16356        }
16357        if let Some(gitignore) = opts.gitignore {
16358            query = query.arg("gitignore", gitignore);
16359        }
16360        Directory {
16361            proc: self.proc.clone(),
16362            selection: query,
16363            graphql_client: self.graphql_client.clone(),
16364        }
16365    }
16366    /// Returns a File from the workspace.
16367    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16368    ///
16369    /// # Arguments
16370    ///
16371    /// * `path` - Location of the file to retrieve. Relative paths (e.g., "go.mod") resolve from the workspace directory; absolute paths (e.g., "/go.mod") resolve from the workspace boundary.
16372    pub fn file(&self, path: impl Into<String>) -> File {
16373        let mut query = self.selection.select("file");
16374        query = query.arg("path", path.into());
16375        File {
16376            proc: self.proc.clone(),
16377            selection: query,
16378            graphql_client: self.graphql_client.clone(),
16379        }
16380    }
16381    /// Search for a file or directory by walking up from the start path within the workspace.
16382    /// Returns the absolute workspace path if found, or null if not found.
16383    /// Relative start paths resolve from the workspace directory.
16384    /// The search stops at the workspace boundary and will not traverse above it.
16385    ///
16386    /// # Arguments
16387    ///
16388    /// * `name` - The name of the file or directory to search for.
16389    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16390    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16391        let mut query = self.selection.select("findUp");
16392        query = query.arg("name", name.into());
16393        query.execute(self.graphql_client.clone()).await
16394    }
16395    /// Search for a file or directory by walking up from the start path within the workspace.
16396    /// Returns the absolute workspace path if found, or null if not found.
16397    /// Relative start paths resolve from the workspace directory.
16398    /// The search stops at the workspace boundary and will not traverse above it.
16399    ///
16400    /// # Arguments
16401    ///
16402    /// * `name` - The name of the file or directory to search for.
16403    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16404    pub async fn find_up_opts<'a>(
16405        &self,
16406        name: impl Into<String>,
16407        opts: WorkspaceFindUpOpts<'a>,
16408    ) -> Result<String, DaggerError> {
16409        let mut query = self.selection.select("findUp");
16410        query = query.arg("name", name.into());
16411        if let Some(from) = opts.from {
16412            query = query.arg("from", from);
16413        }
16414        query.execute(self.graphql_client.clone()).await
16415    }
16416    /// Return all generators from modules loaded in the workspace.
16417    ///
16418    /// # Arguments
16419    ///
16420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16421    pub fn generators(&self) -> GeneratorGroup {
16422        let query = self.selection.select("generators");
16423        GeneratorGroup {
16424            proc: self.proc.clone(),
16425            selection: query,
16426            graphql_client: self.graphql_client.clone(),
16427        }
16428    }
16429    /// Return all generators from modules loaded in the workspace.
16430    ///
16431    /// # Arguments
16432    ///
16433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16434    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16435        let mut query = self.selection.select("generators");
16436        if let Some(include) = opts.include {
16437            query = query.arg("include", include);
16438        }
16439        GeneratorGroup {
16440            proc: self.proc.clone(),
16441            selection: query,
16442            graphql_client: self.graphql_client.clone(),
16443        }
16444    }
16445    /// Whether a config.toml file exists in the workspace.
16446    pub async fn has_config(&self) -> Result<bool, DaggerError> {
16447        let query = self.selection.select("hasConfig");
16448        query.execute(self.graphql_client.clone()).await
16449    }
16450    /// A unique identifier for this Workspace.
16451    pub async fn id(&self) -> Result<Id, DaggerError> {
16452        let query = self.selection.select("id");
16453        query.execute(self.graphql_client.clone()).await
16454    }
16455    /// Whether .dagger/config.toml exists.
16456    pub async fn initialized(&self) -> Result<bool, DaggerError> {
16457        let query = self.selection.select("initialized");
16458        query.execute(self.graphql_client.clone()).await
16459    }
16460    /// Workspace directory path relative to the workspace boundary.
16461    pub async fn path(&self) -> Result<String, DaggerError> {
16462        let query = self.selection.select("path");
16463        query.execute(self.graphql_client.clone()).await
16464    }
16465    /// Return all services from modules loaded in the workspace.
16466    ///
16467    /// # Arguments
16468    ///
16469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16470    pub fn services(&self) -> UpGroup {
16471        let query = self.selection.select("services");
16472        UpGroup {
16473            proc: self.proc.clone(),
16474            selection: query,
16475            graphql_client: self.graphql_client.clone(),
16476        }
16477    }
16478    /// Return all services from modules loaded in the workspace.
16479    ///
16480    /// # Arguments
16481    ///
16482    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16483    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16484        let mut query = self.selection.select("services");
16485        if let Some(include) = opts.include {
16486            query = query.arg("include", include);
16487        }
16488        UpGroup {
16489            proc: self.proc.clone(),
16490            selection: query,
16491            graphql_client: self.graphql_client.clone(),
16492        }
16493    }
16494    /// Refresh workspace-managed state and return the resulting changeset.
16495    /// Currently this refreshes existing lockfile entries only.
16496    pub fn update(&self) -> Changeset {
16497        let query = self.selection.select("update");
16498        Changeset {
16499            proc: self.proc.clone(),
16500            selection: query,
16501            graphql_client: self.graphql_client.clone(),
16502        }
16503    }
16504}
16505impl Node for Workspace {
16506    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16507        let query = self.selection.select("id");
16508        let graphql_client = self.graphql_client.clone();
16509        async move { query.execute(graphql_client).await }
16510    }
16511}
16512#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16513pub enum CacheSharingMode {
16514    #[serde(rename = "LOCKED")]
16515    Locked,
16516    #[serde(rename = "PRIVATE")]
16517    Private,
16518    #[serde(rename = "SHARED")]
16519    Shared,
16520}
16521#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16522pub enum ChangesetMergeConflict {
16523    #[serde(rename = "FAIL")]
16524    Fail,
16525    #[serde(rename = "FAIL_EARLY")]
16526    FailEarly,
16527    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16528    LeaveConflictMarkers,
16529    #[serde(rename = "PREFER_OURS")]
16530    PreferOurs,
16531    #[serde(rename = "PREFER_THEIRS")]
16532    PreferTheirs,
16533}
16534#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16535pub enum ChangesetsMergeConflict {
16536    #[serde(rename = "FAIL")]
16537    Fail,
16538    #[serde(rename = "FAIL_EARLY")]
16539    FailEarly,
16540}
16541#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16542pub enum DiffStatKind {
16543    #[serde(rename = "ADDED")]
16544    Added,
16545    #[serde(rename = "MODIFIED")]
16546    Modified,
16547    #[serde(rename = "REMOVED")]
16548    Removed,
16549    #[serde(rename = "RENAMED")]
16550    Renamed,
16551}
16552#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16553pub enum ExistsType {
16554    #[serde(rename = "DIRECTORY_TYPE")]
16555    DirectoryType,
16556    #[serde(rename = "REGULAR_TYPE")]
16557    RegularType,
16558    #[serde(rename = "SYMLINK_TYPE")]
16559    SymlinkType,
16560}
16561#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16562pub enum FileType {
16563    #[serde(rename = "DIRECTORY")]
16564    Directory,
16565    #[serde(rename = "DIRECTORY_TYPE")]
16566    DirectoryType,
16567    #[serde(rename = "REGULAR")]
16568    Regular,
16569    #[serde(rename = "REGULAR_TYPE")]
16570    RegularType,
16571    #[serde(rename = "SYMLINK")]
16572    Symlink,
16573    #[serde(rename = "SYMLINK_TYPE")]
16574    SymlinkType,
16575    #[serde(rename = "UNKNOWN")]
16576    Unknown,
16577}
16578#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16579pub enum FunctionCachePolicy {
16580    #[serde(rename = "Default")]
16581    Default,
16582    #[serde(rename = "Never")]
16583    Never,
16584    #[serde(rename = "PerSession")]
16585    PerSession,
16586}
16587#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16588pub enum ImageLayerCompression {
16589    #[serde(rename = "EStarGZ")]
16590    EStarGz,
16591    #[serde(rename = "ESTARGZ")]
16592    Estargz,
16593    #[serde(rename = "Gzip")]
16594    Gzip,
16595    #[serde(rename = "Uncompressed")]
16596    Uncompressed,
16597    #[serde(rename = "Zstd")]
16598    Zstd,
16599}
16600#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16601pub enum ImageMediaTypes {
16602    #[serde(rename = "DOCKER")]
16603    Docker,
16604    #[serde(rename = "DockerMediaTypes")]
16605    DockerMediaTypes,
16606    #[serde(rename = "OCI")]
16607    Oci,
16608    #[serde(rename = "OCIMediaTypes")]
16609    OciMediaTypes,
16610}
16611#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16612pub enum ModuleSourceExperimentalFeature {
16613    #[serde(rename = "SELF_CALLS")]
16614    SelfCalls,
16615}
16616#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16617pub enum ModuleSourceKind {
16618    #[serde(rename = "DIR")]
16619    Dir,
16620    #[serde(rename = "DIR_SOURCE")]
16621    DirSource,
16622    #[serde(rename = "GIT")]
16623    Git,
16624    #[serde(rename = "GIT_SOURCE")]
16625    GitSource,
16626    #[serde(rename = "LOCAL")]
16627    Local,
16628    #[serde(rename = "LOCAL_SOURCE")]
16629    LocalSource,
16630}
16631#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16632pub enum NetworkProtocol {
16633    #[serde(rename = "TCP")]
16634    Tcp,
16635    #[serde(rename = "UDP")]
16636    Udp,
16637}
16638#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16639pub enum ReturnType {
16640    #[serde(rename = "ANY")]
16641    Any,
16642    #[serde(rename = "FAILURE")]
16643    Failure,
16644    #[serde(rename = "SUCCESS")]
16645    Success,
16646}
16647#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16648pub enum TypeDefKind {
16649    #[serde(rename = "BOOLEAN")]
16650    Boolean,
16651    #[serde(rename = "BOOLEAN_KIND")]
16652    BooleanKind,
16653    #[serde(rename = "ENUM")]
16654    Enum,
16655    #[serde(rename = "ENUM_KIND")]
16656    EnumKind,
16657    #[serde(rename = "FLOAT")]
16658    Float,
16659    #[serde(rename = "FLOAT_KIND")]
16660    FloatKind,
16661    #[serde(rename = "INPUT")]
16662    Input,
16663    #[serde(rename = "INPUT_KIND")]
16664    InputKind,
16665    #[serde(rename = "INTEGER")]
16666    Integer,
16667    #[serde(rename = "INTEGER_KIND")]
16668    IntegerKind,
16669    #[serde(rename = "INTERFACE")]
16670    Interface,
16671    #[serde(rename = "INTERFACE_KIND")]
16672    InterfaceKind,
16673    #[serde(rename = "LIST")]
16674    List,
16675    #[serde(rename = "LIST_KIND")]
16676    ListKind,
16677    #[serde(rename = "OBJECT")]
16678    Object,
16679    #[serde(rename = "OBJECT_KIND")]
16680    ObjectKind,
16681    #[serde(rename = "SCALAR")]
16682    Scalar,
16683    #[serde(rename = "SCALAR_KIND")]
16684    ScalarKind,
16685    #[serde(rename = "STRING")]
16686    String,
16687    #[serde(rename = "STRING_KIND")]
16688    StringKind,
16689    #[serde(rename = "VOID")]
16690    Void,
16691    #[serde(rename = "VOID_KIND")]
16692    VoidKind,
16693}